diff --git a/.hgignore b/.hgignore index 530c92512..7892f93af 100644 --- a/.hgignore +++ b/.hgignore @@ -43,7 +43,6 @@ default_c *.so *.so.* *_debug -core *.pc *.gch @@ -160,6 +159,7 @@ code/build/* code/build-2010/* build/* install/* +build_vc* code/nel/tools/build_gamedata/configuration/buildsite.py # Linux nel compile @@ -203,16 +203,7 @@ code/nel/tools/pacs/build_rbank/build_rbank code/ryzom/common/data_leveldesign/leveldesign/game_element/xp_table/skills.skill_tree code/ryzom/common/data_leveldesign/leveldesign/game_element/xp_table/xptable.xp_table code/ryzom/tools/server/sql/ryzom_admin_default_data.sql -code/ryzom/tools/server/ryzom_ams/drupal -code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/autoload -code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/configs -code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/cron -code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/img -code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/plugins -code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/smarty -code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/translations -code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/libinclude.php -code/ryzom/tools/server/ryzom_ams/www/html/templates_c + # Linux server compile code/ryzom/server/src/entities_game_service/entities_game_service @@ -226,11 +217,23 @@ code/ryzom/server/src/ryzom_welcome_service/ryzom_welcome_service code/ryzom/server/src/tick_service/tick_service # WebTT temp dir code/ryzom/tools/server/www/webtt/app/tmp -code\ryzom\tools\server\ryzom_ams\old # AMS ignore -code/ryzom/tools/server/ryzom_ams/www/config.php -code/ryzom/tools/server/ryzom_ams/www/is_installed +code/web/public_php/ams/is_installed +code/web/docs/ams/html +code/web/public_php/ams/templates_c +code/ryzom/tools/server/ryzom_ams/drupal +code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/autoload +code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/configs +code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/cron +code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/img +code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/plugins +code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/smarty +code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/translations +code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/libinclude.php +code/ryzom/tools/server/ryzom_ams/old + + #tools and external dir's external @@ -245,3 +248,17 @@ code/nel/tools/build_gamedata/processes/ai_wmap/ai_build_wmap.cfg code/nel/tools/build_gamedata/processes/sheets/sheets_packer.cfg code/nel/tools/build_gamedata/processes/rbank/build_rbank.cfg code/nel/tools/build_gamedata/processes/zone/debug_zone_dependencies.cfg +code/web/public_php/config.php +code/web/public_php/is_installed +code/web/public_php/ams/files +code/web/public_php/db_version_lib +code/web/public_php/db_version_shard +code/web/public_php/db_version_tool +code/web/public_php/db_version_web +code/web/public_php/role_service +code/web/public_php/role_support +code/web/public_php/role_domain +code/web/public_php/db_version_ring +code/web/public_php/config_user.php +code/nel/tools/build_gamedata/processes/pz/build_world_packed_col.cfg +code/nel/tools/build_gamedata/processes/cartographer/island_screenshots.cfg diff --git a/.hgtags b/.hgtags index cb11e3e8b..80061a2ee 100644 --- a/.hgtags +++ b/.hgtags @@ -1,8 +1,8 @@ -a409552f83cb55a5c20f867fd7bcae1d0083d01a ryzomcore_0_8_0 -a409552f83cb55a5c20f867fd7bcae1d0083d01a ryzomcore_0_8_0 -0000000000000000000000000000000000000000 ryzomcore_0_8_0 -0000000000000000000000000000000000000000 ryzomcore_0_8_0 -4eddbaff0c5e5d685db96ee3e8427aa0fd96ac83 ryzomcore_0_8_0 - -950d650ca92e6041611258d7e5131ccf661e4ec2 latest-graft-to-default -950d650ca92e6041611258d7e5131ccf661e4ec2 latest-merge-from-default +950d650ca92e6041611258d7e5131ccf661e4ec2 compatibility-merge +4eddbaff0c5e5d685db96ee3e8427aa0fd96ac83 ryzomcore/v0.8.0 +00d9b6e29e95f56785fbf85abe60afd34674f402 ryzomcore/v0.9.0 +79776c337176dd5b02e1a74fe5dfb703b91747aa ryzomcore/v0.9.1 +fedf2aa443d09707beed814b0f499c6a5519cc84 ryzomcore/v0.10.0 +edaa3624a56420b02ccc64c26059801a389927ee ryzomcore/v0.11.0 +e3fe4855f22c3e75722e015dc33c091c340b3ad7 ryzomcore/v0.11.1 +9e583b717fd63be0be9fd60b99087abf1691ea49 ryzomcore/v0.11.2 diff --git a/README.md b/README.md new file mode 100644 index 000000000..19e5bef3a --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +Ryzom Core is the open-source project related to Ryzom Game. Written in C++, Ryzom Core contains the whole code (client, server, tools) used to make the commercial MMORPG Ryzom. Ryzom Core is a toolkit for the development of massively multiplayer online universes. It provides the base technologies and a set of development methodologies for the development of both client and server code. + + + +Ryzom Core is open source and released under the terms of the GNU Affero General Public License 3.0 (GNU/AGPLv3) for the source code and the Creative Commons Attributions-ShareAlike 3.0 (CC-BY-SA) for the art assets. Which means you can create your own game using Ryzom Core, for more information on doing so check out Creating Your Own Game Using Ryzom Core. \ No newline at end of file diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 4f0439dfd..279aa3d49 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -1,8 +1,8 @@ #----------------------------------------------------------------------------- # -# NeL -# Authors: Nevrax and the NeL Community -# Version: 0.9.0 +# Ryzom Core +# Authors: Nevrax and the Ryzom Core Community +# Version: 0.11.2 # # Notes: # * Changing install location: add -DCMAKE_INSTALL_PREFIX:PATH=/my/new/path @@ -47,8 +47,8 @@ CHECK_OUT_OF_SOURCE() CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(RyzomCore CXX C) SET(NL_VERSION_MAJOR 0) -SET(NL_VERSION_MINOR 9) -SET(NL_VERSION_PATCH 0) +SET(NL_VERSION_MINOR 11) +SET(NL_VERSION_PATCH 2) SET(NL_VERSION "${NL_VERSION_MAJOR}.${NL_VERSION_MINOR}.${NL_VERSION_PATCH}") #----------------------------------------------------------------------------- @@ -112,16 +112,20 @@ IF(WITH_STATIC_LIBXML2) SET(LIBXML2_DEFINITIONS ${LIBXML2_DEFINITIONS} -DLIBXML_STATIC) ENDIF(WITH_STATIC_LIBXML2) +IF(WITH_LIBXML2_ICONV) + FIND_PACKAGE(Iconv REQUIRED) + INCLUDE_DIRECTORIES(${ICONV_INCLUDE_DIR}) + SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${ICONV_LIBRARIES}) +ENDIF(WITH_LIBXML2_ICONV) + IF(WITH_STATIC) # libxml2 could need winsock2 library SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${WINSOCK2_LIB}) # on Mac OS X libxml2 requires iconv and liblzma IF(APPLE) - FIND_PACKAGE(Iconv REQUIRED) FIND_PACKAGE(LibLZMA REQUIRED) - SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${ICONV_LIBRARIES} ${LIBLZMA_LIBRARIES}) - INCLUDE_DIRECTORIES(${ICONV_INCLUDE_DIR}) + SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${LIBLZMA_LIBRARIES}) ENDIF(APPLE) ENDIF(WITH_STATIC) @@ -131,6 +135,13 @@ IF(FINAL_VERSION) ADD_DEFINITIONS(-DFINAL_VERSION=1) ENDIF(FINAL_VERSION) +IF(WITH_SSE2) + ADD_DEFINITIONS(-DNL_HAS_SSE2) + IF(WITH_SSE3) + ADD_DEFINITIONS(-DNL_HAS_SSE3) + ENDIF(WITH_SSE3) +ENDIF(WITH_SSE2) + IF(WITH_QT) FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtXml QtOpenGL REQUIRED) ENDIF(WITH_QT) @@ -145,9 +156,11 @@ IF(WITH_NEL) FIND_PACKAGE(Luabind REQUIRED) FIND_PACKAGE(CURL REQUIRED) - IF(WIN32 OR CURL_LIBRARIES MATCHES "\\.a") + IF((WIN32 OR CURL_LIBRARIES MATCHES "\\.a") AND WITH_STATIC_CURL) SET(CURL_STATIC ON) - ENDIF(WIN32 OR CURL_LIBRARIES MATCHES "\\.a") + ELSE((WIN32 OR CURL_LIBRARIES MATCHES "\\.a") AND WITH_STATIC_CURL) + SET(CURL_STATIC OFF) + ENDIF((WIN32 OR CURL_LIBRARIES MATCHES "\\.a") AND WITH_STATIC_CURL) IF(CURL_STATIC) SET(CURL_DEFINITIONS -DCURL_STATICLIB) @@ -190,6 +203,10 @@ IF(WITH_TOOLS) ADD_SUBDIRECTORY(tool) ENDIF(WITH_TOOLS) +IF(WITH_STUDIO) + ADD_SUBDIRECTORY(studio) +ENDIF(WITH_STUDIO) + # To build the documention, you will have to enable it # and then do the equivalent of "make DoxygenDoc". IF(BUILD_DOCUMENTATION) @@ -217,30 +234,31 @@ IF(WITH_NEL_TESTS) ENDIF(WITH_NEL_TESTS) # packaging information -SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "NeL MMORPG Framework") -SET(CPACK_PACKAGE_VENDOR "NeL") +SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Ryzom Core MMORPG Framework") +SET(CPACK_PACKAGE_VENDOR "Ryzom Core") SET(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_SOURCE_DIR}/README) SET(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/COPYING) SET(CPACK_PACKAGE_VERSION_MAJOR "${NL_VERSION_MAJOR}") SET(CPACK_PACKAGE_VERSION_MINOR "${NL_VERSION_MINOR}") SET(CPACK_PACKAGE_VERSION_PATCH "${NL_VERSION_PATCH}") SET(CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_BINARY_DIR};NeL;ALL;/") -SET(CPACK_PACKAGE_EXECUTABLES "nel${NL_VERSION}" "nel") +SET(CPACK_PACKAGE_EXECUTABLES "ryzomcore${NL_VERSION}" "ryzomcore") +SET(CPACK_SET_DESTDIR TRUE) # NSIS Specific Packing Setup -SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "NeL") +SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "RyzomCore") SET(CPACK_NSIS_MODIFY_PATH "ON") SET(CPACK_NSIS_MUI_ICON ${CMAKE_SOURCE_DIR}/resources/nevraxpill.ico) SET(CPACK_NSIS_MUI_UNIICON ${CMAKE_SOURCE_DIR}/resources/nevraxpill.ico) SET(CPACK_PACKAGE_ICON ${CMAKE_SOURCE_DIR}/resources\\\\nel.bmp) -SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} NeL") +SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} RyzomCore") SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\dev.ryzom.com") SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\dev.ryzom.com\\\\projects\\\\nel\\\\wiki") SET(CPACK_NSIS_CONTACT "matt.raykowski@gmail.com") ## Source Packages -SET(CPACK_PACKAGE_FILE_NAME "nel-${NL_VERSION}") -SET(CPACK_SOURCE_PACKAGE_FILE_NAME "nel-${NL_VERSION}") +SET(CPACK_PACKAGE_FILE_NAME "ryzomcore-${NL_VERSION}") +SET(CPACK_SOURCE_PACKAGE_FILE_NAME "ryzomcore-${NL_VERSION}") IF(WIN32) #SET(CPACK_GENERATOR "NSIS") SET(CPACK_GENERATOR "NSIS;ZIP") diff --git a/code/CMakeModules/AndroidToolChain.cmake b/code/CMakeModules/AndroidToolChain.cmake index 049c39adf..6690497d4 100644 --- a/code/CMakeModules/AndroidToolChain.cmake +++ b/code/CMakeModules/AndroidToolChain.cmake @@ -26,63 +26,46 @@ IF(TARGET_CPU STREQUAL "armv7") SET(LIBRARY_ARCHITECTURE "armeabi-v7a") SET(CMAKE_SYSTEM_PROCESSOR "armv7") SET(TOOLCHAIN_ARCH "arm") - SET(TOOLCHAIN_PREFIX "arm-linux-androideabi") + SET(GCC_TOOLCHAIN_PREFIX "arm-linux-androideabi") SET(TOOLCHAIN_BIN_PREFIX "arm") SET(MINIMUM_NDK_TARGET 4) ELSEIF(TARGET_CPU STREQUAL "armv5") SET(LIBRARY_ARCHITECTURE "armeabi") SET(CMAKE_SYSTEM_PROCESSOR "armv5") SET(TOOLCHAIN_ARCH "arm") - SET(TOOLCHAIN_PREFIX "arm-linux-androideabi") + SET(GCC_TOOLCHAIN_PREFIX "arm-linux-androideabi") SET(TOOLCHAIN_BIN_PREFIX "arm") SET(MINIMUM_NDK_TARGET 4) ELSEIF(TARGET_CPU STREQUAL "x86") SET(LIBRARY_ARCHITECTURE "x86") SET(CMAKE_SYSTEM_PROCESSOR "x86") SET(TOOLCHAIN_ARCH "x86") - SET(TOOLCHAIN_PREFIX "x86") + SET(GCC_TOOLCHAIN_PREFIX "x86") SET(TOOLCHAIN_BIN_PREFIX "i686") SET(MINIMUM_NDK_TARGET 9) ELSEIF(TARGET_CPU STREQUAL "mips") SET(LIBRARY_ARCHITECTURE "mips") SET(CMAKE_SYSTEM_PROCESSOR "mips") SET(TOOLCHAIN_ARCH "mips") - SET(TOOLCHAIN_PREFIX "mipsel-linux-android") + SET(GCC_TOOLCHAIN_PREFIX "mipsel-linux-android") SET(TOOLCHAIN_BIN_PREFIX "mipsel") SET(MINIMUM_NDK_TARGET 9) ENDIF(TARGET_CPU STREQUAL "armv7") +SET(ANDROID_COMPILER "GCC") + +IF(NDK_TOOLCHAIN_VERSION STREQUAL "clang") + SET(ANDROID_COMPILER "clang") + SET(CLANG_TOOLCHAIN_PREFIX "llvm") + SET(CLANG ON) +ELSE() + SET(GCC_TOOLCHAIN_VERSION ${NDK_TOOLCHAIN_VERSION}) +ENDIF() + IF(NOT NDK_TARGET) SET(NDK_TARGET ${MINIMUM_NDK_TARGET}) ENDIF(NOT NDK_TARGET) -FILE(GLOB _TOOLCHAIN_VERSIONS "${NDK_ROOT}/toolchains/${TOOLCHAIN_PREFIX}-*") -IF(_TOOLCHAIN_VERSIONS) - LIST(SORT _TOOLCHAIN_VERSIONS) - LIST(REVERSE _TOOLCHAIN_VERSIONS) - FOREACH(_TOOLCHAIN_VERSION ${_TOOLCHAIN_VERSIONS}) - STRING(REGEX REPLACE ".+${TOOLCHAIN_PREFIX}-([0-9.]+)" "\\1" _TOOLCHAIN_VERSION "${_TOOLCHAIN_VERSION}") - IF(_TOOLCHAIN_VERSION MATCHES "^([0-9.]+)$") - LIST(APPEND NDK_TOOLCHAIN_VERSIONS ${_TOOLCHAIN_VERSION}) - ENDIF(_TOOLCHAIN_VERSION MATCHES "^([0-9.]+)$") - ENDFOREACH(_TOOLCHAIN_VERSION) -ENDIF(_TOOLCHAIN_VERSIONS) - -IF(NOT NDK_TOOLCHAIN_VERSIONS) - MESSAGE(FATAL_ERROR "No Android toolchain found in default search path ${NDK_ROOT}/toolchains") -ENDIF(NOT NDK_TOOLCHAIN_VERSIONS) - -IF(NDK_TOOLCHAIN_VERSION) - LIST(FIND NDK_TOOLCHAIN_VERSIONS "${NDK_TOOLCHAIN_VERSION}" _INDEX) - IF(_INDEX EQUAL -1) - LIST(GET NDK_TOOLCHAIN_VERSIONS 0 NDK_TOOLCHAIN_VERSION) - ENDIF(_INDEX EQUAL -1) -ELSE(NDK_TOOLCHAIN_VERSION) - LIST(GET NDK_TOOLCHAIN_VERSIONS 0 NDK_TOOLCHAIN_VERSION) -ENDIF(NDK_TOOLCHAIN_VERSION) - -MESSAGE(STATUS "Target Android NDK ${NDK_TARGET} and use GCC ${NDK_TOOLCHAIN_VERSION}") - IF(CMAKE_HOST_WIN32) SET(TOOLCHAIN_HOST "windows") SET(TOOLCHAIN_BIN_SUFFIX ".exe") @@ -94,33 +77,73 @@ ELSEIF(CMAKE_HOST_UNIX) SET(TOOLCHAIN_BIN_SUFFIX "") ENDIF(CMAKE_HOST_WIN32) -SET(TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${TOOLCHAIN_PREFIX}-${NDK_TOOLCHAIN_VERSION}/prebuilt/${TOOLCHAIN_HOST}") -SET(PLATFORM_ROOT "${NDK_ROOT}/platforms/android-${NDK_TARGET}/arch-${TOOLCHAIN_ARCH}") +MACRO(SEARCH_TOOLCHAIN _COMPILER) + SET(${_COMPILER}_TOOLCHAIN_VERSIONS) + FILE(GLOB _TOOLCHAIN_VERSIONS "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}-*") + IF(_TOOLCHAIN_VERSIONS) + LIST(SORT _TOOLCHAIN_VERSIONS) + LIST(REVERSE _TOOLCHAIN_VERSIONS) + FOREACH(_TOOLCHAIN_VERSION ${_TOOLCHAIN_VERSIONS}) + STRING(REGEX REPLACE ".+${_PREFIX}-([0-9.]+)" "\\1" _TOOLCHAIN_VERSION "${_TOOLCHAIN_VERSION}") + IF(_TOOLCHAIN_VERSION MATCHES "^([0-9.]+)$") + LIST(APPEND ${_COMPILER}_TOOLCHAIN_VERSIONS ${_TOOLCHAIN_VERSION}) + ENDIF() + ENDFOREACH() + ENDIF() + + IF(NOT ${_COMPILER}_TOOLCHAIN_VERSIONS) + MESSAGE(FATAL_ERROR "No Android ${_COMPILER} toolchain found in default search path ${NDK_ROOT}/toolchains") + ENDIF() + + IF(${_COMPILER}_TOOLCHAIN_VERSIONS) + LIST(FIND ${_COMPILER}_TOOLCHAIN_VERSIONS "${${_COMPILER}_TOOLCHAIN_VERSION}" _INDEX) + IF(_INDEX EQUAL -1) + LIST(GET ${_COMPILER}_TOOLCHAIN_VERSIONS 0 ${_COMPILER}_TOOLCHAIN_VERSION) + ENDIF() + ELSE() + LIST(GET ${_COMPILER}_TOOLCHAIN_VERSIONS 0 ${_COMPILER}_TOOLCHAIN_VERSION) + ENDIF() + + SET(${_COMPILER}_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}-${${_COMPILER}_TOOLCHAIN_VERSION}/prebuilt/${TOOLCHAIN_HOST}") + + IF(NOT EXISTS "${${_COMPILER}_TOOLCHAIN_ROOT}") + FILE(GLOB _TOOLCHAIN_PREFIXES "${${_COMPILER}_TOOLCHAIN_ROOT}*") + IF(_TOOLCHAIN_PREFIXES) + LIST(GET _TOOLCHAIN_PREFIXES 0 ${_COMPILER}_TOOLCHAIN_ROOT) + ENDIF(_TOOLCHAIN_PREFIXES) + ENDIF() +ENDMACRO() + +IF(CLANG) + SEARCH_TOOLCHAIN(CLANG) + + MESSAGE(STATUS "Target Android NDK ${NDK_TARGET} and use clang ${CLANG_TOOLCHAIN_VERSION}") +ENDIF() + +SEARCH_TOOLCHAIN(GCC) -IF(NOT EXISTS "${TOOLCHAIN_ROOT}") - FILE(GLOB _TOOLCHAIN_PREFIXES "${TOOLCHAIN_ROOT}*") - IF(_TOOLCHAIN_PREFIXES) - LIST(GET _TOOLCHAIN_PREFIXES 0 TOOLCHAIN_ROOT) - ENDIF(_TOOLCHAIN_PREFIXES) -ENDIF(NOT EXISTS "${TOOLCHAIN_ROOT}") +MESSAGE(STATUS "Target Android NDK ${NDK_TARGET} and use GCC ${GCC_TOOLCHAIN_VERSION}") +MESSAGE(STATUS "Found Android LLVM toolchain in ${CLANG_TOOLCHAIN_ROOT}") +MESSAGE(STATUS "Found Android GCC toolchain in ${GCC_TOOLCHAIN_ROOT}") + +SET(PLATFORM_ROOT "${NDK_ROOT}/platforms/android-${NDK_TARGET}/arch-${TOOLCHAIN_ARCH}") -MESSAGE(STATUS "Found Android toolchain in ${TOOLCHAIN_ROOT}") MESSAGE(STATUS "Found Android platform in ${PLATFORM_ROOT}") # include dirs SET(PLATFORM_INCLUDE_DIR "${PLATFORM_ROOT}/usr/include") SET(STL_DIR "${NDK_ROOT}/sources/cxx-stl/gnu-libstdc++") -IF(EXISTS "${STL_DIR}/${NDK_TOOLCHAIN_VERSION}") +IF(EXISTS "${STL_DIR}/${GCC_TOOLCHAIN_VERSION}") # NDK version >= 8b - SET(STL_DIR "${STL_DIR}/${NDK_TOOLCHAIN_VERSION}") -ENDIF(EXISTS "${STL_DIR}/${NDK_TOOLCHAIN_VERSION}") + SET(STL_DIR "${STL_DIR}/${GCC_TOOLCHAIN_VERSION}") +ENDIF(EXISTS "${STL_DIR}/${GCC_TOOLCHAIN_VERSION}") # Determine bin prefix for toolchain -FILE(GLOB _TOOLCHAIN_BIN_PREFIXES "${TOOLCHAIN_ROOT}/bin/${TOOLCHAIN_BIN_PREFIX}-*-gcc${TOOLCHAIN_BIN_SUFFIX}") +FILE(GLOB _TOOLCHAIN_BIN_PREFIXES "${GCC_TOOLCHAIN_ROOT}/bin/${TOOLCHAIN_BIN_PREFIX}-*-gcc${TOOLCHAIN_BIN_SUFFIX}") IF(_TOOLCHAIN_BIN_PREFIXES) LIST(GET _TOOLCHAIN_BIN_PREFIXES 0 _TOOLCHAIN_BIN_PREFIX) - STRING(REGEX REPLACE "${TOOLCHAIN_ROOT}/bin/([a-z0-9-]+)-gcc${TOOLCHAIN_BIN_SUFFIX}" "\\1" TOOLCHAIN_BIN_PREFIX "${_TOOLCHAIN_BIN_PREFIX}") + STRING(REGEX REPLACE "${GCC_TOOLCHAIN_ROOT}/bin/([a-z0-9-]+)-gcc${TOOLCHAIN_BIN_SUFFIX}" "\\1" TOOLCHAIN_BIN_PREFIX "${_TOOLCHAIN_BIN_PREFIX}") ENDIF(_TOOLCHAIN_BIN_PREFIXES) SET(STL_INCLUDE_DIR "${STL_DIR}/include") @@ -128,22 +151,48 @@ SET(STL_LIBRARY_DIR "${STL_DIR}/libs/${LIBRARY_ARCHITECTURE}") SET(STL_INCLUDE_CPU_DIR "${STL_LIBRARY_DIR}/include") SET(STL_LIBRARY "${STL_LIBRARY_DIR}/libgnustl_static.a") -SET(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_ROOT} ${PLATFORM_ROOT}/usr ${CMAKE_PREFIX_PATH} ${CMAKE_INSTALL_PREFIX} $ENV{EXTERNAL_ANDROID_PATH} CACHE string "Android find search path root") +MESSAGE(STATUS "STL include dir: ${STL_INCLUDE_DIR}") +MESSAGE(STATUS "STL library dir: ${STL_LIBRARY_DIR}") + +SET(CMAKE_FIND_ROOT_PATH ${CLANG_TOOLCHAIN_ROOT} ${GCC_TOOLCHAIN_ROOT} ${PLATFORM_ROOT}/usr ${CMAKE_PREFIX_PATH} ${CMAKE_INSTALL_PREFIX} $ENV{EXTERNAL_ANDROID_PATH} CACHE string "Android find search path root") SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -INCLUDE_DIRECTORIES(${STL_INCLUDE_DIR} ${STL_INCLUDE_CPU_DIR}) - MACRO(SET_TOOLCHAIN_BINARY _NAME _BINARY) - SET(${_NAME} ${TOOLCHAIN_ROOT}/bin/${TOOLCHAIN_BIN_PREFIX}-${_BINARY}${TOOLCHAIN_BIN_SUFFIX}) + IF("${_BINARY}" MATCHES "clang") + SET(${_NAME} ${CLANG_TOOLCHAIN_ROOT}/bin/${_BINARY}${TOOLCHAIN_BIN_SUFFIX} CACHE PATH "" FORCE ) + ELSE() + SET(${_NAME} ${GCC_TOOLCHAIN_ROOT}/bin/${TOOLCHAIN_BIN_PREFIX}-${_BINARY}${TOOLCHAIN_BIN_SUFFIX} CACHE PATH "" FORCE) + ENDIF() ENDMACRO(SET_TOOLCHAIN_BINARY) -SET_TOOLCHAIN_BINARY(CMAKE_C_COMPILER gcc) -SET_TOOLCHAIN_BINARY(CMAKE_CXX_COMPILER g++) - # Force the compilers to GCC for Android include (CMakeForceCompiler) -CMAKE_FORCE_C_COMPILER(${CMAKE_C_COMPILER} GNU) -CMAKE_FORCE_CXX_COMPILER(${CMAKE_CXX_COMPILER} GNU) + +IF(CLANG) + SET_TOOLCHAIN_BINARY(CMAKE_C_COMPILER clang) + SET_TOOLCHAIN_BINARY(CMAKE_CXX_COMPILER clang++) + + CMAKE_FORCE_C_COMPILER(${CMAKE_C_COMPILER} clang) + CMAKE_FORCE_CXX_COMPILER(${CMAKE_CXX_COMPILER} clang) + + MESSAGE(STATUS "Using clang compiler") +ELSE() + SET_TOOLCHAIN_BINARY(CMAKE_C_COMPILER gcc) + SET_TOOLCHAIN_BINARY(CMAKE_CXX_COMPILER g++) + + CMAKE_FORCE_C_COMPILER(${CMAKE_C_COMPILER} GNU) + CMAKE_FORCE_CXX_COMPILER(${CMAKE_CXX_COMPILER} GNU) + + MESSAGE(STATUS "Using GCC compiler") +ENDIF() + +SET_TOOLCHAIN_BINARY(CMAKE_STRIP strip) +SET_TOOLCHAIN_BINARY(CMAKE_AR ar) +SET_TOOLCHAIN_BINARY(CMAKE_LINKER ld) +SET_TOOLCHAIN_BINARY(CMAKE_NM nm) +SET_TOOLCHAIN_BINARY(CMAKE_OBJCOPY objcopy) +SET_TOOLCHAIN_BINARY(CMAKE_OBJDUMP objdump) +SET_TOOLCHAIN_BINARY(CMAKE_RANLIB ranlib) diff --git a/code/CMakeModules/Find3dsMaxSDK.cmake b/code/CMakeModules/Find3dsMaxSDK.cmake index 2a41081c5..0510d3a6e 100644 --- a/code/CMakeModules/Find3dsMaxSDK.cmake +++ b/code/CMakeModules/Find3dsMaxSDK.cmake @@ -1,49 +1,52 @@ # - Find DirectInput # Find the DirectSound includes and libraries # +# MAXSDK_DIR - 3DSMAX SDK root directory # MAXSDK_INCLUDE_DIR - where to find baseinterface.h # MAXSDK_LIBRARIES - List of libraries when using 3DSMAX. # MAXSDK_FOUND - True if MAX SDK found. if(MAXSDK_INCLUDE_DIR) - # Already in cache, be silent - set(MAXSDK_FIND_QUIETLY TRUE) + # Already in cache, be silent + SET(MAXSDK_FIND_QUIETLY TRUE) endif(MAXSDK_INCLUDE_DIR) -find_path(MAXSDK_INCLUDE_DIR max.h +FIND_PATH(MAXSDK_DIR + "include/maxversion.h" + HINTS + "$ENV{MAXSDK_DIR}" PATHS - "$ENV{ADSK_3DSMAX_SDK_2012}/maxsdk/include" - "$ENV{3DSMAX_2011_SDK_PATH}/maxsdk/include" - "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2010 SDK/maxsdk/include" - "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2009 SDK/maxsdk/include" - "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2008 SDK/maxsdk/include" - "$ENV{PROGRAMFILES}/Autodesk/3ds Max 9 SDK/maxsdk/include" - "C:/3dsmax7/maxsdk/include" -) + "$ENV{ADSK_3DSMAX_SDK_2012}/maxsdk" + "$ENV{3DSMAX_2011_SDK_PATH}/maxsdk" + "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2010 SDK/maxsdk" + "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2009 SDK/maxsdk" + "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2008 SDK/maxsdk" + "$ENV{PROGRAMFILES}/Autodesk/3ds Max 9 SDK/maxsdk" +) -find_path(MAXSDK_CS_INCLUDE_DIR bipexp.h - PATHS - "$ENV{ADSK_3DSMAX_SDK_2012}/maxsdk/include/CS" - "$ENV{3DSMAX_2011_SDK_PATH}/maxsdk/include/CS" - "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2010 SDK/maxsdk/include/CS" - "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2009 SDK/maxsdk/include/CS" - "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2008 SDK/maxsdk/include/CS" - "$ENV{PROGRAMFILES}/Autodesk/3ds Max 9 SDK/maxsdk/include/CS" - "C:/3dsmax7/maxsdk/include/CS" +FIND_PATH(MAXSDK_INCLUDE_DIR + max.h + HINTS + ${MAXSDK_DIR}/include ) +FIND_PATH(MAXSDK_CS_INCLUDE_DIR bipexp.h + HINTS + ${MAXSDK_DIR}/include/CS +) + +IF(TARGET_X64) + SET(MAXSDK_LIBRARY_DIRS ${MAXSDK_DIR}/x64/lib) +ELSE(TARGET_X64) + SET(MAXSDK_LIBRARY_DIRS ${MAXSDK_DIR}/lib) +ENDIF(TARGET_X64) + MACRO(FIND_3DS_LIBRARY MYLIBRARY MYLIBRARYNAME) FIND_LIBRARY(${MYLIBRARY} - NAMES ${MYLIBRARYNAME} - PATHS - "$ENV{ADSK_3DSMAX_SDK_2012}/maxsdk/lib" - "$ENV{3DSMAX_2011_SDK_PATH}/maxsdk/lib" - "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2010 SDK/maxsdk/lib" - "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2009 SDK/maxsdk/lib" - "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2008 SDK/maxsdk/lib" - "$ENV{PROGRAMFILES}/Autodesk/3ds Max 9 SDK/maxsdk/lib" - "C:/3dsmax7/maxsdk/lib" - ) + NAMES ${MYLIBRARYNAME} + HINTS + ${MAXSDK_LIBRARY_DIRS} + ) ENDMACRO(FIND_3DS_LIBRARY MYLIBRARY MYLIBRARYNAME) FIND_3DS_LIBRARY(MAXSDK_CORE_LIBRARY core) diff --git a/code/CMakeModules/FindDirectXSDK.cmake b/code/CMakeModules/FindDirectXSDK.cmake index 3cf91ec3c..b64fca6ea 100644 --- a/code/CMakeModules/FindDirectXSDK.cmake +++ b/code/CMakeModules/FindDirectXSDK.cmake @@ -52,12 +52,6 @@ IF(DXSDK_DIR) FIND_DXSDK_LIBRARY(DXSDK_XAUDIO_LIBRARY x3daudio) FIND_DXSDK_LIBRARY(DXSDK_D3DX9_LIBRARY d3dx9) FIND_DXSDK_LIBRARY(DXSDK_D3D9_LIBRARY d3d9) - - #FIND_DXSDK_LIBRARY(DXSDK_MESH_LIBRARY mesh) - #FIND_DXSDK_LIBRARY(DXSDK_MAXUTIL_LIBRARY maxutil) - #FIND_DXSDK_LIBRARY(DXSDK_MAXSCRIPT_LIBRARY maxscrpt) - #FIND_DXSDK_LIBRARY(DXSDK_PARAMBLK2_LIBRARY paramblk2) - #FIND_DXSDK_LIBRARY(DXSDK_BMM_LIBRARY bmm) ENDIF(DXSDK_DIR) # Handle the QUIETLY and REQUIRED arguments and set DXSDK_FOUND to TRUE if diff --git a/code/CMakeModules/FindFMOD.cmake b/code/CMakeModules/FindFMOD.cmake index c9237f695..f85795142 100644 --- a/code/CMakeModules/FindFMOD.cmake +++ b/code/CMakeModules/FindFMOD.cmake @@ -23,8 +23,15 @@ FIND_PATH(FMOD_INCLUDE_DIR PATH_SUFFIXES fmod fmod3 ) +IF(TARGET_X64) + SET(FMOD_LIBRARY_NAMES fmod64 fmod) +ELSE(TARGET_X64) + SET(FMOD_LIBRARY_NAMES fmodvc fmod) +ENDIF(TARGET_X64) + FIND_LIBRARY(FMOD_LIBRARY - NAMES fmod fmodvc libfmod fmod64 + NAMES + ${FMOD_LIBRARY_NAMES} PATHS $ENV{FMOD_DIR}/lib /usr/local/lib diff --git a/code/CMakeModules/FindIconv.cmake b/code/CMakeModules/FindIconv.cmake index 5e9e48250..092b35702 100644 --- a/code/CMakeModules/FindIconv.cmake +++ b/code/CMakeModules/FindIconv.cmake @@ -1,4 +1,4 @@ -# - Try to find Iconv on Mac OS X +# - Try to find Iconv # Once done this will define # # ICONV_FOUND - system has Iconv @@ -6,78 +6,59 @@ # ICONV_LIBRARIES - Link these to use Iconv # ICONV_SECOND_ARGUMENT_IS_CONST - the second argument for iconv() is const # +include(CheckCCompilerFlag) +include(CheckCSourceCompiles) -IF(APPLE) - include(CheckCCompilerFlag) - include(CheckCSourceCompiles) - - IF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) - # Already in cache, be silent - SET(ICONV_FIND_QUIETLY TRUE) - ENDIF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) - - IF(APPLE) - FIND_PATH(ICONV_INCLUDE_DIR iconv.h - PATHS - /opt/local/include/ - NO_CMAKE_SYSTEM_PATH - ) - - FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv c - PATHS - /opt/local/lib/ - NO_CMAKE_SYSTEM_PATH - ) - ENDIF(APPLE) - - FIND_PATH(ICONV_INCLUDE_DIR iconv.h PATHS /opt/local/include /sw/include) - - string(REGEX REPLACE "(.*)/include/?" "\\1" ICONV_INCLUDE_BASE_DIR "${ICONV_INCLUDE_DIR}") - - FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv c HINTS "${ICONV_INCLUDE_BASE_DIR}/lib" PATHS /opt/local/lib) - - IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) - SET(ICONV_FOUND TRUE) - ENDIF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) - - set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR}) - set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES}) - IF(ICONV_FOUND) - check_c_compiler_flag("-Werror" ICONV_HAVE_WERROR) - set (CMAKE_C_FLAGS_BACKUP "${CMAKE_C_FLAGS}") - if(ICONV_HAVE_WERROR) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") - endif(ICONV_HAVE_WERROR) - check_c_source_compiles(" - #include - int main(){ - iconv_t conv = 0; - const char* in = 0; - size_t ilen = 0; - char* out = 0; - size_t olen = 0; - iconv(conv, &in, &ilen, &out, &olen); - return 0; - } - " ICONV_SECOND_ARGUMENT_IS_CONST ) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_BACKUP}") - ENDIF(ICONV_FOUND) - set(CMAKE_REQUIRED_INCLUDES) - set(CMAKE_REQUIRED_LIBRARIES) - - IF(ICONV_FOUND) - IF(NOT ICONV_FIND_QUIETLY) - MESSAGE(STATUS "Found Iconv: ${ICONV_LIBRARIES}") - ENDIF(NOT ICONV_FIND_QUIETLY) - ELSE(ICONV_FOUND) - IF(Iconv_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could not find Iconv") - ENDIF(Iconv_FIND_REQUIRED) - ENDIF(ICONV_FOUND) - - MARK_AS_ADVANCED( - ICONV_INCLUDE_DIR - ICONV_LIBRARIES - ICONV_SECOND_ARGUMENT_IS_CONST - ) -ENDIF(APPLE) +IF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) + # Already in cache, be silent + SET(ICONV_FIND_QUIETLY TRUE) +ENDIF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) + +FIND_PATH(ICONV_INCLUDE_DIR iconv.h HINTS /sw/include/ PATHS /opt/local) + +FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv c PATHS /opt/local) + +IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) + SET(ICONV_FOUND TRUE) +ENDIF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) + +set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR}) +set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES}) +IF(ICONV_FOUND) + check_c_compiler_flag("-Werror" ICONV_HAVE_WERROR) + set (CMAKE_C_FLAGS_BACKUP "${CMAKE_C_FLAGS}") + if(ICONV_HAVE_WERROR) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") + endif(ICONV_HAVE_WERROR) + check_c_source_compiles(" + #include + int main(){ + iconv_t conv = 0; + const char* in = 0; + size_t ilen = 0; + char* out = 0; + size_t olen = 0; + iconv(conv, &in, &ilen, &out, &olen); + return 0; + } +" ICONV_SECOND_ARGUMENT_IS_CONST ) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_BACKUP}") +ENDIF(ICONV_FOUND) +set(CMAKE_REQUIRED_INCLUDES) +set(CMAKE_REQUIRED_LIBRARIES) + +IF(ICONV_FOUND) + IF(NOT ICONV_FIND_QUIETLY) + MESSAGE(STATUS "Found Iconv: ${ICONV_LIBRARIES}") + ENDIF(NOT ICONV_FIND_QUIETLY) +ELSE(ICONV_FOUND) + IF(Iconv_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find Iconv") + ENDIF(Iconv_FIND_REQUIRED) +ENDIF(ICONV_FOUND) + +MARK_AS_ADVANCED( + ICONV_INCLUDE_DIR + ICONV_LIBRARIES + ICONV_SECOND_ARGUMENT_IS_CONST +) diff --git a/code/CMakeModules/FindLibOVR.cmake b/code/CMakeModules/FindLibOVR.cmake index 1403a4b2c..707949613 100644 --- a/code/CMakeModules/FindLibOVR.cmake +++ b/code/CMakeModules/FindLibOVR.cmake @@ -38,7 +38,7 @@ ELSEIF(WIN32) ENDIF(UNIX) FIND_LIBRARY(LIBOVR_LIBRARY - NAMES ovr + NAMES ovr libovr PATHS $ENV{LIBOVR_DIR}/${LIBOVR_LIBRARY_BUILD_PATH} /usr/local/lib diff --git a/code/CMakeModules/FindLuabind.cmake b/code/CMakeModules/FindLuabind.cmake index f61885be8..73255077a 100644 --- a/code/CMakeModules/FindLuabind.cmake +++ b/code/CMakeModules/FindLuabind.cmake @@ -11,6 +11,12 @@ MACRO(FIND_CORRECT_LUA_VERSION) SET(LUA52_LIBRARY "liblua5.2") CHECK_LINKED_LIBRARY(LUABIND_LIBRARY_RELEASE LUA52_LIBRARY LUALIB_FOUND) + + IF(NOT LUALIB_FOUND) + # fedora (v20) + SET(LUA52_LIBRARY "liblua-5.2") + CHECK_LINKED_LIBRARY(LUABIND_LIBRARY_RELEASE LUA52_LIBRARY LUALIB_FOUND) + ENDIF(NOT LUALIB_FOUND) IF(LUALIB_FOUND) MESSAGE(STATUS "Luabind is using Lua 5.2") @@ -63,14 +69,48 @@ FIND_PATH(LUABIND_INCLUDE_DIR /opt/include ) -SET(LIBRARY_NAME_RELEASE luabind libluabind) -SET(LIBRARY_NAME_DEBUG luabind_d luabindd libluabind_d libluabindd) +SET(LIBRARY_NAME_RELEASE) +SET(LIBRARY_NAME_DEBUG) + +IF(WITH_LUA52) + IF(WITH_STLPORT) + LIST(APPEND LIBRARY_NAME_RELEASE luabind_stlport_lua52) + LIST(APPEND LIBRARY_NAME_DEBUG luabind_stlport_lua52d) + ENDIF(WITH_STLPORT) + + LIST(APPEND LIBRARY_NAME_RELEASE luabind_lua52) + LIST(APPEND LIBRARY_NAME_DEBUG luabind_lua52d) +ENDIF() + +IF(WITH_LUA51) + IF(WITH_STLPORT) + LIST(APPEND LIBRARY_NAME_RELEASE luabind_stlport_lua51) + LIST(APPEND LIBRARY_NAME_DEBUG luabind_stlport_lua51d) + ENDIF(WITH_STLPORT) + + LIST(APPEND LIBRARY_NAME_RELEASE luabind_lua51) + LIST(APPEND LIBRARY_NAME_DEBUG luabind_lua51d) +ENDIF() + +IF(WITH_LUA50) + IF(WITH_STLPORT) + LIST(APPEND LIBRARY_NAME_RELEASE luabind_stlport_lua50) + LIST(APPEND LIBRARY_NAME_DEBUG luabind_stlport_lua50d) + ENDIF(WITH_STLPORT) + + LIST(APPEND LIBRARY_NAME_RELEASE luabind_lua50) + LIST(APPEND LIBRARY_NAME_DEBUG luabind_lua50d) +ENDIF() IF(WITH_STLPORT) - SET(LIBRARY_NAME_RELEASE luabind_stlport ${LIBRARY_NAME_RELEASE}) - SET(LIBRARY_NAME_DEBUG luabind_stlportd ${LIBRARY_NAME_DEBUG}) + LIST(APPEND LIBRARY_NAME_RELEASE luabind_stlport) + LIST(APPEND LIBRARY_NAME_DEBUG luabind_stlportd) ENDIF(WITH_STLPORT) +# generic libraries names +LIST(APPEND LIBRARY_NAME_RELEASE luabind libluabind) +LIST(APPEND LIBRARY_NAME_DEBUG luabind_d luabindd libluabind_d libluabindd) + FIND_LIBRARY(LUABIND_LIBRARY_RELEASE NAMES ${LIBRARY_NAME_RELEASE} PATHS diff --git a/code/CMakeModules/FindMSVC.cmake b/code/CMakeModules/FindMSVC.cmake index 16455b02d..94146775d 100644 --- a/code/CMakeModules/FindMSVC.cmake +++ b/code/CMakeModules/FindMSVC.cmake @@ -57,13 +57,15 @@ ENDMACRO(DETECT_EXPRESS_VERSION) IF(MSVC12) DETECT_VC_VERSION("12.0") + SET(MSVC_TOOLSET "120") IF(NOT MSVC12_REDIST_DIR) # If you have VC++ 2013 Express, put x64/Microsoft.VC120.CRT/*.dll in ${EXTERNAL_PATH}/redist SET(MSVC12_REDIST_DIR "${EXTERNAL_PATH}/redist") - ENDIF(NOT MSVC11_REDIST_DIR) + ENDIF(NOT MSVC12_REDIST_DIR) ELSEIF(MSVC11) DETECT_VC_VERSION("11.0") + SET(MSVC_TOOLSET "110") IF(NOT MSVC11_REDIST_DIR) # If you have VC++ 2012 Express, put x64/Microsoft.VC110.CRT/*.dll in ${EXTERNAL_PATH}/redist @@ -71,6 +73,7 @@ ELSEIF(MSVC11) ENDIF(NOT MSVC11_REDIST_DIR) ELSEIF(MSVC10) DETECT_VC_VERSION("10.0") + SET(MSVC_TOOLSET "100") IF(NOT MSVC10_REDIST_DIR) # If you have VC++ 2010 Express, put x64/Microsoft.VC100.CRT/*.dll in ${EXTERNAL_PATH}/redist @@ -78,8 +81,10 @@ ELSEIF(MSVC10) ENDIF(NOT MSVC10_REDIST_DIR) ELSEIF(MSVC90) DETECT_VC_VERSION("9.0") + SET(MSVC_TOOLSET "90") ELSEIF(MSVC80) DETECT_VC_VERSION("8.0") + SET(MSVC_TOOLSET "80") ENDIF(MSVC12) # If you plan to use VC++ compilers with WINE, set VC_DIR environment variable diff --git a/code/CMakeModules/FindMySQL.cmake b/code/CMakeModules/FindMySQL.cmake index eb2102c8d..0e0ebfd48 100644 --- a/code/CMakeModules/FindMySQL.cmake +++ b/code/CMakeModules/FindMySQL.cmake @@ -13,7 +13,7 @@ IF(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES) SET(MYSQL_FOUND TRUE) -ELSE(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES) +ELSE() FIND_PATH(MYSQL_INCLUDE_DIR mysql.h PATH_SUFFIXES mysql @@ -33,7 +33,7 @@ ELSE(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES) PATHS $ENV{ProgramFiles}/MySQL/*/lib/opt $ENV{SystemDrive}/MySQL/*/lib/opt) - ELSE(WIN32 AND MSVC) + ELSE() FIND_LIBRARY(MYSQL_LIBRARY_RELEASE NAMES mysqlclient PATHS /usr/lib @@ -51,31 +51,30 @@ ELSE(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES) /usr/local/lib/mysql /opt/local/lib/mysql5/mysql ) - ENDIF(WIN32 AND MSVC) + ENDIF() IF(MYSQL_INCLUDE_DIR) IF(MYSQL_LIBRARY_RELEASE) - SET(MYSQL_LIBRARIES optimized ${MYSQL_LIBRARY_RELEASE}) IF(MYSQL_LIBRARY_DEBUG) - SET(MYSQL_LIBRARIES ${MYSQL_LIBRARIES} debug ${MYSQL_LIBRARY_DEBUG}) - ELSE(MYSQL_LIBRARY_DEBUG) - SET(MYSQL_LIBRARIES ${MYSQL_LIBRARIES} debug ${MYSQL_LIBRARY_RELEASE}) - ENDIF(MYSQL_LIBRARY_DEBUG) + SET(MYSQL_LIBRARIES optimized ${MYSQL_LIBRARY_RELEASE} debug ${MYSQL_LIBRARY_DEBUG}) + ELSE() + SET(MYSQL_LIBRARIES ${MYSQL_LIBRARY_RELEASE}) + ENDIF() FIND_PACKAGE(OpenSSL) IF(OPENSSL_FOUND) SET(MYSQL_LIBRARIES ${MYSQL_LIBRARIES} ${OPENSSL_LIBRARIES}) - ENDIF(OPENSSL_FOUND) - ENDIF(MYSQL_LIBRARY_RELEASE) - ENDIF(MYSQL_INCLUDE_DIR) + ENDIF() + ENDIF() + ENDIF() IF(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES) SET(MYSQL_FOUND TRUE) MESSAGE(STATUS "Found MySQL: ${MYSQL_INCLUDE_DIR}, ${MYSQL_LIBRARIES}") - ELSE(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES) + ELSE() SET(MYSQL_FOUND FALSE) MESSAGE(STATUS "MySQL not found.") - ENDIF(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES) + ENDIF() MARK_AS_ADVANCED(MYSQL_LIBRARY_RELEASE MYSQL_LIBRARY_DEBUG) -ENDIF(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES) +ENDIF() diff --git a/code/CMakeModules/FindSquish.cmake b/code/CMakeModules/FindSquish.cmake index ad0f7ce80..61250fec1 100644 --- a/code/CMakeModules/FindSquish.cmake +++ b/code/CMakeModules/FindSquish.cmake @@ -55,10 +55,12 @@ FIND_LIBRARY(SQUISH_LIBRARY_DEBUG IF(SQUISH_INCLUDE_DIR) IF(SQUISH_LIBRARY_RELEASE) SET(SQUISH_FOUND "YES") - SET(SQUISH_LIBRARIES "optimized;${SQUISH_LIBRARY_RELEASE}") IF(SQUISH_LIBRARY_DEBUG) SET(SQUISH_LIBRARIES "${SQUISH_LIBRARIES};debug;${SQUISH_LIBRARY_DEBUG}") + ELSE(SQUISH_LIBRARY_DEBUG) + SET(SQUISH_LIBRARIES "${SQUISH_LIBRARIES};debug;${SQUISH_LIBRARY_RELEASE}") + MESSAGE("Debug Squish NOT found, using the release version!") ENDIF(SQUISH_LIBRARY_DEBUG) ENDIF(SQUISH_LIBRARY_RELEASE) ENDIF(SQUISH_INCLUDE_DIR) diff --git a/code/CMakeModules/FindWindowsSDK.cmake b/code/CMakeModules/FindWindowsSDK.cmake index 2e72af9e5..31288eb03 100644 --- a/code/CMakeModules/FindWindowsSDK.cmake +++ b/code/CMakeModules/FindWindowsSDK.cmake @@ -68,6 +68,10 @@ ENDIF(WINSDKCURRENT_VERSION_INCLUDE) SET(WINSDKENV_DIR $ENV{WINSDK_DIR}) +IF(NOT WINSDKENV_DIR) + SET(WINSDKENV_DIR $ENV{WindowsSDKDir}) +ENDIF(NOT WINSDKENV_DIR) + MACRO(FIND_WINSDK_VERSION_HEADERS) IF(WINSDK_DIR AND NOT WINSDK_VERSION) # Search version in headers @@ -78,7 +82,6 @@ MACRO(FIND_WINSDK_VERSION_HEADERS) ) IF(_MSI_FILE) - # Look for Windows SDK 8.0 FILE(STRINGS ${_MSI_FILE} _CONTENT REGEX "^#ifndef NTDDI_WIN8") @@ -181,7 +184,7 @@ MACRO(USE_CURRENT_WINSDK) # Look for Windows.h because there are several paths IF(EXISTS ${_INCLUDE}/Windows.h) STRING(REGEX REPLACE "/(include|INCLUDE|Include)(.*)" "" WINSDK_DIR ${_INCLUDE}) - MESSAGE(STATUS "Found Windows SDK from include environment variable in ${WINSDK_DIR}") + MESSAGE(STATUS "Found Windows SDK in INCLUDE environment variable: ${WINSDK_DIR}") BREAK() ENDIF(EXISTS ${_INCLUDE}/Windows.h) ENDFOREACH(_INCLUDE) @@ -280,6 +283,13 @@ FIND_PATH(WINSDK_SHARED_INCLUDE_DIR d3d9.h ${WINSDK_DIR}/Include ) +# directory where OpenGL headers are found +FIND_PATH(WINSDK_OPENGL_INCLUDE_DIR GL.h + HINTS + ${WINSDK_DIR}/Include/gl + ${WINSDK_DIR}/Include +) + # directory where all libraries are found FIND_PATH(WINSDK_LIBRARY_DIR ComCtl32.lib HINTS @@ -303,7 +313,7 @@ FIND_PROGRAM(WINSDK_MIDL midl IF(WINSDK_INCLUDE_DIR) SET(WINSDK_FOUND ON) - SET(WINSDK_INCLUDE_DIRS ${WINSDK_INCLUDE_DIR} ${WINSDK_SHARED_INCLUDE_DIR}) + SET(WINSDK_INCLUDE_DIRS ${WINSDK_INCLUDE_DIR} ${WINSDK_SHARED_INCLUDE_DIR} ${WINSDK_OPENGL_INCLUDE_DIR}) SET(CMAKE_LIBRARY_PATH ${WINSDK_LIBRARY_DIR} ${CMAKE_LIBRARY_PATH}) INCLUDE_DIRECTORIES(${WINSDK_INCLUDE_DIRS}) diff --git a/code/CMakeModules/GetRevision.cmake b/code/CMakeModules/GetRevision.cmake index 21b234f74..7f0a4e5f1 100644 --- a/code/CMakeModules/GetRevision.cmake +++ b/code/CMakeModules/GetRevision.cmake @@ -13,38 +13,44 @@ IF(SOURCE_DIR) IF(NOT ROOT_DIR AND SOURCE_DIR) SET(ROOT_DIR ${SOURCE_DIR}) - ENDIF(NOT ROOT_DIR AND SOURCE_DIR) + ENDIF() IF(NOT SOURCE_DIR AND ROOT_DIR) SET(SOURCE_DIR ${ROOT_DIR}) - ENDIF(NOT SOURCE_DIR AND ROOT_DIR) -ELSE(SOURCE_DIR) + ENDIF() +ELSE() SET(SOURCE_DIR ${CMAKE_SOURCE_DIR}) SET(ROOT_DIR ${CMAKE_SOURCE_DIR}) -ENDIF(SOURCE_DIR) +ENDIF() MACRO(NOW RESULT) IF (WIN32) EXECUTE_PROCESS(COMMAND "wmic" "os" "get" "localdatetime" OUTPUT_VARIABLE DATETIME) IF(NOT DATETIME MATCHES "ERROR") STRING(REGEX REPLACE ".*\n([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9]).*" "\\1-\\2-\\3 \\4:\\5:\\6" ${RESULT} "${DATETIME}") - ENDIF(NOT DATETIME MATCHES "ERROR") + ENDIF() ELSEIF(UNIX) EXECUTE_PROCESS(COMMAND "date" "+%Y-%m-%d %H:%M:%S" OUTPUT_VARIABLE DATETIME) STRING(REGEX REPLACE "([0-9: -]+).*" "\\1" ${RESULT} "${DATETIME}") - ELSE (WIN32) + ELSE() MESSAGE(SEND_ERROR "date not implemented") SET(${RESULT} "0000-00-00 00:00:00") - ENDIF (WIN32) + ENDIF() ENDMACRO(NOW) IF(EXISTS "${ROOT_DIR}/.svn/") - FIND_PACKAGE(Subversion) + FIND_PACKAGE(Subversion QUIET) IF(SUBVERSION_FOUND) Subversion_WC_INFO(${ROOT_DIR} ER) SET(REVISION ${ER_WC_REVISION}) ENDIF(SUBVERSION_FOUND) + + FIND_PACKAGE(TortoiseSVN QUIET) + + IF(TORTOISESVN_FOUND) + TORTOISESVN_GET_REVISION(${ROOT_DIR} REVISION) + ENDIF(TORTOISESVN_FOUND) ENDIF(EXISTS "${ROOT_DIR}/.svn/") IF(EXISTS "${ROOT_DIR}/.hg/") @@ -55,8 +61,8 @@ IF(EXISTS "${ROOT_DIR}/.hg/") SET(REVISION ${ER_WC_REVISION}) SET(CHANGESET ${ER_WC_CHANGESET}) SET(BRANCH ${ER_WC_BRANCH}) - ENDIF(MERCURIAL_FOUND) -ENDIF(EXISTS "${ROOT_DIR}/.hg/") + ENDIF() +ENDIF() # if processing exported sources, use "revision" file if exists IF(SOURCE_DIR AND NOT DEFINED REVISION) @@ -64,8 +70,8 @@ IF(SOURCE_DIR AND NOT DEFINED REVISION) IF(EXISTS ${REVISION_FILE}) FILE(STRINGS ${REVISION_FILE} REVISION LIMIT_COUNT 1) MESSAGE(STATUS "Read revision ${REVISION} from file") - ENDIF(EXISTS ${REVISION_FILE}) -ENDIF(SOURCE_DIR AND NOT DEFINED REVISION) + ENDIF() +ENDIF() IF(SOURCE_DIR AND DEFINED REVISION) IF(EXISTS ${SOURCE_DIR}/revision.h.in) @@ -73,5 +79,5 @@ IF(SOURCE_DIR AND DEFINED REVISION) NOW(BUILD_DATE) CONFIGURE_FILE(${SOURCE_DIR}/revision.h.in revision.h.txt) EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy revision.h.txt revision.h) # copy_if_different - ENDIF(EXISTS ${SOURCE_DIR}/revision.h.in) -ENDIF(SOURCE_DIR AND DEFINED REVISION) + ENDIF() +ENDIF() diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index 74e12de9d..80f076d04 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -6,6 +6,9 @@ IF(NOT CMAKE_BUILD_TYPE) SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE) ENDIF(NOT CMAKE_BUILD_TYPE) +# Declare CMAKE_CONFIGURATION_TYPES before PROJECT +SET(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE) + ### # Helper macro that generates .pc and installs it. # Argument: name - the name of the .pc package, e.g. "nel-pacs.pc" @@ -118,13 +121,13 @@ MACRO(NL_DEFAULT_PROPS name label) ENDIF(NL_LIB_PREFIX) ENDIF(${type} STREQUAL SHARED_LIBRARY) - IF(${type} STREQUAL EXECUTABLE AND WIN32) + IF(${type} STREQUAL EXECUTABLE AND WIN32 AND NOT MINGW) SET_TARGET_PROPERTIES(${name} PROPERTIES VERSION ${NL_VERSION} SOVERSION ${NL_VERSION_MAJOR} COMPILE_FLAGS "/GA" LINK_FLAGS "/VERSION:${NL_VERSION_MAJOR}.${NL_VERSION_MINOR}") - ENDIF(${type} STREQUAL EXECUTABLE AND WIN32) + ENDIF(${type} STREQUAL EXECUTABLE AND WIN32 AND NOT MINGW) ENDMACRO(NL_DEFAULT_PROPS) ### @@ -229,6 +232,10 @@ Remove the CMakeCache.txt file and try again from another folder, e.g.: ENDMACRO(CHECK_OUT_OF_SOURCE) MACRO(NL_SETUP_DEFAULT_OPTIONS) + IF(WITH_QT) + OPTION(WITH_STUDIO "Build Core Studio" OFF ) + ENDIF(WITH_QT) + ### # Features ### @@ -248,6 +255,16 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS) ELSE(WITH_STATIC) OPTION(WITH_STATIC_LIBXML2 "With static libxml2" OFF) ENDIF(WITH_STATIC) + IF (WITH_STATIC) + OPTION(WITH_STATIC_CURL "With static curl" ON ) + ELSE(WITH_STATIC) + OPTION(WITH_STATIC_CURL "With static curl" OFF) + ENDIF(WITH_STATIC) + IF(APPLE) + OPTION(WITH_LIBXML2_ICONV "With libxml2 using iconv" ON ) + ELSE(APPLE) + OPTION(WITH_LIBXML2_ICONV "With libxml2 using iconv" OFF) + ENDIF(APPLE) OPTION(WITH_STATIC_DRIVERS "With static drivers." OFF) IF(WIN32) OPTION(WITH_EXTERNAL "With provided external." ON ) @@ -324,6 +341,13 @@ MACRO(NL_SETUP_NEL_DEFAULT_OPTIONS) OPTION(WITH_LIBOVR "With LibOVR support" OFF) OPTION(WITH_LIBVR "With LibVR support" OFF) OPTION(WITH_PERFHUD "With NVIDIA PerfHUD support" OFF) + + OPTION(WITH_SSE2 "With SSE2" ON ) + OPTION(WITH_SSE3 "With SSE3" ON ) + + IF(NOT MSVC) + OPTION(WITH_GCC_FPMATH_BOTH "With GCC -mfpmath=both" OFF) + ENDIF(NOT MSVC) ENDMACRO(NL_SETUP_NEL_DEFAULT_OPTIONS) MACRO(NL_SETUP_NELNS_DEFAULT_OPTIONS) @@ -349,6 +373,7 @@ MACRO(NL_SETUP_RYZOM_DEFAULT_OPTIONS) ### OPTION(WITH_LUA51 "Build Ryzom Core using Lua 5.1" ON ) OPTION(WITH_LUA52 "Build Ryzom Core using Lua 5.2" OFF) + OPTION(WITH_RYZOM_CLIENT_UAC "Ask to run as Administrator" OFF) ENDMACRO(NL_SETUP_RYZOM_DEFAULT_OPTIONS) MACRO(NL_SETUP_SNOWBALLS_DEFAULT_OPTIONS) @@ -373,8 +398,6 @@ MACRO(NL_SETUP_BUILD) # Debug = NL_DEBUG # Release = NL_RELEASE - SET(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE) - IF(CMAKE_BUILD_TYPE MATCHES "Debug") SET(NL_BUILD_MODE "NL_DEBUG") ELSE(CMAKE_BUILD_TYPE MATCHES "Debug") @@ -545,9 +568,15 @@ MACRO(NL_SETUP_BUILD) # Ignore default include paths ADD_PLATFORM_FLAGS("/X") - IF(MSVC11) + IF(MSVC12) ADD_PLATFORM_FLAGS("/Gy- /MP") - # /Ox is working with VC++ 2010, but custom optimizations don't exist + # /Ox is working with VC++ 2013, but custom optimizations don't exist + SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}") + # without inlining it's unusable, use custom optimizations again + SET(DEBUG_CFLAGS "/Od /Ob1 /GF- ${DEBUG_CFLAGS}") + ELSEIF(MSVC11) + ADD_PLATFORM_FLAGS("/Gy- /MP") + # /Ox is working with VC++ 2012, but custom optimizations don't exist SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}") # without inlining it's unusable, use custom optimizations again SET(DEBUG_CFLAGS "/Od /Ob1 /GF- ${DEBUG_CFLAGS}") @@ -569,9 +598,9 @@ MACRO(NL_SETUP_BUILD) SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}") # without inlining it's unusable, use custom optimizations again SET(DEBUG_CFLAGS "/Od /Ob1 ${DEBUG_CFLAGS}") - ELSE(MSVC11) + ELSE(MSVC12) MESSAGE(FATAL_ERROR "Can't determine compiler version ${MSVC_VERSION}") - ENDIF(MSVC11) + ENDIF(MSVC12) ADD_PLATFORM_FLAGS("/D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /DWIN32 /D_WINDOWS /Zm1000 /wd4250") @@ -614,6 +643,14 @@ MACRO(NL_SETUP_BUILD) ENDIF(CLANG) ENDIF(WIN32) + IF(WITH_SSE3) + ADD_PLATFORM_FLAGS("-msse3") + ENDIF(WITH_SSE3) + + IF(WITH_GCC_FPMATH_BOTH) + ADD_PLATFORM_FLAGS("-mfpmath=both") + ENDIF(WITH_GCC_FPMATH_BOTH) + IF(APPLE) IF(NOT XCODE) IF(CMAKE_OSX_ARCHITECTURES) @@ -875,9 +912,9 @@ MACRO(NL_SETUP_BUILD) ENDIF(APPLE) # Fix "relocation R_X86_64_32 against.." error on x64 platforms - IF(TARGET_X64 AND WITH_STATIC AND NOT WITH_STATIC_DRIVERS) + IF(TARGET_X64 AND WITH_STATIC AND NOT WITH_STATIC_DRIVERS AND NOT MINGW) ADD_PLATFORM_FLAGS("-fPIC") - ENDIF(TARGET_X64 AND WITH_STATIC AND NOT WITH_STATIC_DRIVERS) + ENDIF(TARGET_X64 AND WITH_STATIC AND NOT WITH_STATIC_DRIVERS AND NOT MINGW) SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} -ftemplate-depth-48") diff --git a/code/nel/CMakeLists.txt b/code/nel/CMakeLists.txt index 53bf071e3..16a8166fe 100644 --- a/code/nel/CMakeLists.txt +++ b/code/nel/CMakeLists.txt @@ -83,4 +83,3 @@ IF(WITH_NEL_TOOLS OR WITH_NEL_MAXPLUGIN) ENDIF(WITH_NEL_TOOLS) ADD_SUBDIRECTORY(tools) ENDIF(WITH_NEL_TOOLS OR WITH_NEL_MAXPLUGIN) - diff --git a/code/nel/include/nel/3d/anim_detail_trav.h b/code/nel/include/nel/3d/anim_detail_trav.h index 7b51afe84..0a94fe376 100644 --- a/code/nel/include/nel/3d/anim_detail_trav.h +++ b/code/nel/include/nel/3d/anim_detail_trav.h @@ -71,7 +71,7 @@ public: // For clipTrav. cleared at beginning of CClipTrav::traverse void clearVisibleList(); - // For ClipTrav only. NB: list is cleared at begininng of traverse(). NB: only CTransform are supported + // For ClipTrav only. NB: list is cleared at beginning of traverse(). NB: only CTransform are supported void addVisibleModel(CTransform *model) { _VisibleList[_CurrentNumVisibleModels]= model; diff --git a/code/nel/include/nel/3d/bloom_effect.h b/code/nel/include/nel/3d/bloom_effect.h index c10967254..49c959e23 100644 --- a/code/nel/include/nel/3d/bloom_effect.h +++ b/code/nel/include/nel/3d/bloom_effect.h @@ -31,6 +31,7 @@ namespace NL3D class UDriver; class UScene; +class CTextureUser; //----------------------------------------------------------------------------------------------------------- //---------------------------------------- CBloomEffect ----------------------------------------------------- @@ -52,19 +53,14 @@ public: // Destructor ~CBloomEffect(); - // Called after the Driver initialization to indicate if OpenGL or Direct3D is used. - // They are some differences in bloom algorithm depending on this API choice. - // If bloom effect is activated and supported, private method init() is called to initialize - // textures and materials. - // initBloomEffect = false => directx - // initBloomEffect = true => opengl - void init(bool initBloomEffect); + // Called after the Driver initialization. + void init(); // must be called before init void setDriver(UDriver *driver) { _Driver = driver; } UDriver* getDriver() const { return _Driver; } - // must be called before initBloom + // must be called before applyBloom void setScene(UScene *scene) { _Scene = scene; } UScene* getScene() const { return _Scene; } @@ -76,6 +72,9 @@ public: void setDensityBloom(uint8 densityBloom) { _DensityBloom = densityBloom; } uint8 getDensityBloom() const { return _DensityBloom; } + // Applies bloom to the current render target + void applyBloom(); + // Called at the beginning of renderAll method in the main loop, if window has been resized, // reinitialize bloom textures according to new window size. // The bloom texture (_InitText attribute) which is used as render target during scene render @@ -83,11 +82,11 @@ public: // If window size exceeds 256*256 the textures used to apply blur are reinitialized with // 256*256 size. If a dimension is less than 256, the texture is initialized with the nearer // power of 2, lower than this window dimension. - void initBloom(); + // void initBloom(); // Called at the end of renderAll method in the main loop, recover stretched texture, apply // both blur passes, and the blending operation between initial render target and the blured one. - void endBloom(); + // void endBloom(); // In OpenGL, the use of FBO implies that Z buffer values of scene render have been stored in // a depth render target. Then, to display 3D interfaces, we must display them in the same FBO, @@ -95,15 +94,12 @@ public: // This method is called at the end of interfaces display in the main loop, to display final render target // (with added interfaces) in the color frame buffer. // NB : In Direct3D, the final render target is displayed at the end of endBloom call. - void endInterfacesDisplayBloom(); + // void endInterfacesDisplayBloom(); private: - // Initialize textures and materials. - void init(); - // Initialize a bloom texture with new dimensions. - void initTexture(NLMISC::CSmartPtr & tex, bool isMode2D, uint32 width, uint32 height); + // void initTexture(NLMISC::CSmartPtr & tex, bool isMode2D, uint32 width, uint32 height); // Called in endBloom method to build a blurred texture. Two passes (then two calls) // are necessary : horizontal and vertical. @@ -130,6 +126,7 @@ private: // density of bloom uint8 _DensityBloom; +/* // render target textures // used to display scene NLMISC::CSmartPtr _InitText; @@ -140,13 +137,12 @@ private: NLMISC::CSmartPtr _BlurHorizontalTex; // original render target NLMISC::CSmartPtr _OriginalRenderTarget; +*/ // materials // used to display first texture in doBlur passes. NL3D::UMaterial _BlurMat; - // used to display final render target texture in endInterfacesDisplayBloom call (OpenGL). - NL3D::UMaterial _DisplayInitMat; // used to blend initial scene render target texture and blur texture according to a // dest+src - dest*src blend operation. NL3D::UMaterial _DisplayBlurMat; @@ -156,21 +152,24 @@ private: // quads NLMISC::CQuadUV _BlurQuad; - NLMISC::CQuadUV _DisplayQuad; - - // openGL or Direct3D? - bool _InitBloomEffect; // textures and materials already initialized? bool _Init; // current window dimensions - uint32 _WndWidth; - uint32 _WndHeight; + /*uint32 _WndWidth; + uint32 _WndHeight;*/ + // Temporary variables used during applyBloom(...) -> // current blur texture dimensions uint32 _BlurWidth; uint32 _BlurHeight; + // used as stretched texture from _InitText, as displayed texture in first blur pass, + // and as render target in second blur pass. + CTextureUser *_BlurFinalTex; + // used as render target in first blur pass, and as displayed texture on second blur pass. + CTextureUser *_BlurHorizontalTex; + // <- }; } // NL3D diff --git a/code/nel/include/nel/3d/computed_string.h b/code/nel/include/nel/3d/computed_string.h index fcb758da4..517200383 100644 --- a/code/nel/include/nel/3d/computed_string.h +++ b/code/nel/include/nel/3d/computed_string.h @@ -290,7 +290,7 @@ public: * \param matrix transformation matrix * \param hotspot position of string origine */ - void render3D (IDriver& driver,CMatrix matrix,THotSpot hotspot = MiddleMiddle); + void render3D (IDriver& driver, const CMatrix &matrix, THotSpot hotspot = MiddleMiddle); }; diff --git a/code/nel/include/nel/3d/driver.h b/code/nel/include/nel/3d/driver.h index 3eb5823ca..39cafc2de 100644 --- a/code/nel/include/nel/3d/driver.h +++ b/code/nel/include/nel/3d/driver.h @@ -42,9 +42,6 @@ namespace NLMISC { class IEventEmitter; -struct IMouseDevice; -struct IKeyboardDevice; -struct IInputDeviceManager; class CRect; class CLog; } @@ -75,6 +72,7 @@ struct IOcclusionQuery; /// A Graphic Mode descriptor. struct GfxMode { + std::string DisplayDevice; bool OffScreen; bool Windowed; uint16 Width; @@ -93,7 +91,7 @@ struct GfxMode Frequency = 0; AntiAlias = -1; } - GfxMode(uint16 w, uint16 h, uint8 d, bool windowed = true, bool offscreen = false, uint frequency = 0, sint8 aa = -1); + GfxMode(uint16 w, uint16 h, uint8 d, bool windowed = true, bool offscreen = false, uint frequency = 0, sint8 aa = -1, const std::string &displayDevice = std::string()); }; // **************************************************************************** @@ -182,7 +180,7 @@ public: IDriver(); virtual ~IDriver(); - virtual bool init(uint windowIcon = 0, emptyProc exitFunc = 0) = 0; + virtual bool init(uintptr_t windowIcon = 0, emptyProc exitFunc = 0) = 0; /// Deriver should calls IDriver::release() first, to destroy all driver components (textures, shaders, VBuffers). virtual bool release(); @@ -259,7 +257,7 @@ public: virtual emptyProc getWindowProc() = 0; virtual NLMISC::IEventEmitter *getEventEmitter() = 0; - + /// Copy a string to system clipboard. virtual bool copyTextToClipboard(const ucstring &text) = 0; @@ -362,7 +360,7 @@ public: virtual void getDepthRange(float &znear, float &zfar) const = 0; // @} - + /// \name Textures // @{ @@ -434,7 +432,7 @@ public: * Under OpenGL this simply returns the maximum number of texture stages (getNbTextureStages) in both return values. */ virtual void getNumPerStageConstant(uint &lightedMaterial, uint &unlightedMaterial) const = 0; - + // [DEPRECATED] Return if this texture is a rectangle texture that requires RECT sampler (OpenGL specific pre-NPOT functionality) virtual bool isTextureRectangle(ITexture *tex) const = 0; @@ -442,7 +440,7 @@ public: virtual bool supportNonPowerOfTwoTextures() const = 0; // @} - + /// \name Texture operations // @{ @@ -495,7 +493,7 @@ public: * * NB: you must setupViewMatrix() BEFORE setupModelMatrix(), or else undefined results. */ - virtual void setupViewMatrix(const CMatrix &mtx)=0; + virtual void setupViewMatrix(const CMatrix &mtx) = 0; /** setup the view matrix (inverse of camera matrix). * Extended: give a cameraPos (mtx.Pos() is not taken into account but for getViewMatrix()), @@ -536,7 +534,7 @@ public: virtual bool isForceNormalize() const = 0; // @} - + /// \name Vertex Buffer Hard: Features // @{ @@ -737,7 +735,7 @@ public: virtual uint getSwapVBLInterval() = 0; // @} - + @@ -869,29 +867,6 @@ public: /// x and y must be between 0.0 and 1.0 virtual void setMousePos(float x, float y) = 0; - /** Enable / disable low level mouse. This allow to take advantage of some options (speed of the mouse, automatic wrapping) - * It returns a interface to these parameters when it is supported, or NULL otherwise - * The interface pointer is valid as long as the low level mouse is enabled. - * A call to disable the mouse returns NULL, and restore the default mouse behavior - * NB : - In this mode the mouse cursor isn't drawn. - * - Calls to showCursor have no effects - * - Calls to setCapture have no effects - */ - virtual NLMISC::IMouseDevice *enableLowLevelMouse(bool enable, bool exclusive) = 0; - - /** Enable / disable a low level keyboard. - * Such a keyboard can only send KeyDown and KeyUp event. It just consider the keyboard as a - * gamepad with lots of buttons... - * This returns a interface to some parameters when it is supported, or NULL otherwise. - * The interface pointer is valid as long as the low level keyboard is enabled. - * A call to disable the keyboard returns NULL, and restore the default keyboard behavior - */ - virtual NLMISC::IKeyboardDevice *enableLowLevelKeyboard(bool enable) = 0; - - /** Get the delay in ms for mouse double clicks. - */ - virtual uint getDoubleClickDelay(bool hardwareMouse) = 0; - /** If true, capture the mouse to force it to stay under the window. * NB : this has no effects if a low level mouse is used */ @@ -908,11 +883,6 @@ public: // Change default scale for all cursors virtual void setCursorScale(float scale) = 0; - - /** Check whether there is a low level device manager available, and get its interface. Return NULL if not available - * From this interface you can deal with mouse and keyboard as above, but you can also manage game device (joysticks, joypads ...) - */ - virtual NLMISC::IInputDeviceManager *getLowLevelInputDeviceManager() = 0; // @} @@ -1005,6 +975,9 @@ public: ) = 0; // @} + /// Hack for bloom + virtual bool textureCoordinateAlternativeMode() const = 0; + /// \name Render state: Polygon mode @@ -1106,7 +1079,7 @@ public: virtual bool supportVertexProgram(CVertexProgram::TProfile profile) const = 0; /** Compile the given vertex program, return if successful. - * If a vertex program was set active before compilation, + * If a vertex program was set active before compilation, * the state of the active vertex program is undefined behaviour afterwards. */ virtual bool compileVertexProgram(CVertexProgram *program) = 0; @@ -1133,7 +1106,7 @@ public: virtual bool supportPixelProgram(CPixelProgram::TProfile profile) const = 0; /** Compile the given pixel program, return if successful. - * If a pixel program was set active before compilation, + * If a pixel program was set active before compilation, * the state of the active pixel program is undefined behaviour afterwards. */ virtual bool compilePixelProgram(CPixelProgram *program) = 0; @@ -1160,7 +1133,7 @@ public: virtual bool supportGeometryProgram(CGeometryProgram::TProfile profile) const = 0; /** Compile the given pixel program, return if successful. - * If a pixel program was set active before compilation, + * If a pixel program was set active before compilation, * the state of the active pixel program is undefined behaviour afterwards. */ virtual bool compileGeometryProgram(CGeometryProgram *program) = 0; @@ -1341,7 +1314,7 @@ public: * NB: if implementation does not support it, 0 may be returned. OpenGL ones return the Texture ID. * NB: unlike isTextureExist(), this method is not thread safe. */ - virtual uint getTextureHandle(const ITexture&tex) = 0; + virtual uintptr_t getTextureHandle(const ITexture&tex) = 0; // see if the Multiply-Add Tex Env operator is supported (see CMaterial::Mad) virtual bool supportMADOperator() const = 0; @@ -1449,7 +1422,6 @@ protected: private: bool _StaticMemoryToVRAM; - }; // -------------------------------------------------- diff --git a/code/nel/include/nel/3d/driver_user.h b/code/nel/include/nel/3d/driver_user.h index 30ea98c65..f1e1fad84 100644 --- a/code/nel/include/nel/3d/driver_user.h +++ b/code/nel/include/nel/3d/driver_user.h @@ -34,7 +34,7 @@ #include "nel/3d/vertex_stream_manager.h" #include "nel/3d/async_texture_manager.h" #include "nel/3d/lod_character_manager.h" - +#include "nel/3d/render_target_manager.h" namespace NL3D { @@ -71,6 +71,7 @@ protected: bool _WindowInit; CMatrixContext _CurrentMatrixContext; CFontManager _FontManager; + CRenderTargetManager _RenderTargetManager; // Components List. typedef CPtrSet TTextureSet; typedef CPtrSet TTextContextSet; @@ -108,6 +109,11 @@ protected: CMaterial _MatTextInternal; CMaterial _MatTextStretchInternal; + // Default render target for effect pipeline + CTextureUser *_EffectRenderTarget; + UMaterial _MatRenderTarget; + CMaterial _MatRenderTargetInt; + NLMISC::CQuadUV _RenderTargetQuad; // StaticInit static bool _StaticInit; @@ -123,7 +129,7 @@ public: /// \name Object // @{ - CDriverUser (uint windowIcon, UDriver::TDriver driver, emptyProc exitFunc = 0); + CDriverUser (uintptr_t windowIcon, UDriver::TDriver driver, emptyProc exitFunc = 0); virtual ~CDriverUser(); // @} @@ -241,6 +247,16 @@ public: // @} + /// Get the render target manager + virtual CRenderTargetManager &getRenderTargetManager() { return _RenderTargetManager; } + + /// Set a texture the size of the window as render target + virtual void beginDefaultRenderTarget(uint32 width = 0, uint32 height = 0); + + /// Draw the render target to the back buffer + virtual void endDefaultRenderTarget(UScene *scene); + + /// \name Components gestion for Interface 2D/3D. // @{ @@ -410,21 +426,6 @@ public: virtual bool fillBuffer (CBitmap &bitmap); // @} - - /// \name Mouse / Keyboards / Game devices - // @{ - virtual NLMISC::IMouseDevice *enableLowLevelMouse(bool enable, bool exclusive); - // - virtual NLMISC::IKeyboardDevice *enableLowLevelKeyboard(bool enable); - virtual NLMISC::IInputDeviceManager *getLowLevelInputDeviceManager(); - - /** - * wrapper for IEventEmitter::emulateMouseRawMode() - */ - virtual void emulateMouseRawMode(bool enable); - - virtual uint getDoubleClickDelay(bool hardwareMouse); - /// show cursor if b is true, or hide it if b is false virtual void showCursor (bool b); /// x and y must be between 0.0 and 1.0 diff --git a/code/nel/include/nel/3d/dru.h b/code/nel/include/nel/3d/dru.h index 115f86432..fda543ecd 100644 --- a/code/nel/include/nel/3d/dru.h +++ b/code/nel/include/nel/3d/dru.h @@ -24,8 +24,11 @@ #include "nel/misc/geom_ext.h" #include "nel/misc/line.h" - -#ifdef NL_OS_WINDOWS +#if defined (NL_COMP_MINGW) +# define NL3D_GL_DLL_NAME "libnel_drv_opengl_win" +# define NL3D_GLES_DLL_NAME "libnel_drv_opengles_win" +# define NL3D_D3D_DLL_NAME "libnel_drv_direct3d_win" +#elif defined (NL_OS_WINDOWS) # define NL3D_GL_DLL_NAME "nel_drv_opengl_win" # define NL3D_GLES_DLL_NAME "nel_drv_opengles_win" # define NL3D_D3D_DLL_NAME "nel_drv_direct3d_win" diff --git a/code/nel/include/nel/3d/fxaa.h b/code/nel/include/nel/3d/fxaa.h new file mode 100644 index 000000000..f7ccf4866 --- /dev/null +++ b/code/nel/include/nel/3d/fxaa.h @@ -0,0 +1,84 @@ +/** + * \file fxaa.h + * \brief CFXAA + * \date 2014-08-03 21:41GMT + * \author Jan Boon (Kaetemi) + * CFXAA + */ + +/* + * Copyright (C) 2014 by authors + * + * This file is part of NL3D. + * NL3D is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * NL3D is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General + * Public License for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with NL3D. If not, see + * . + */ + +#ifndef NL3D_FXAA_H +#define NL3D_FXAA_H +#include + +// STL includes + +// NeL includes +#include +#include + +// Project includes +#include +#include + +#define NL_STEREO_MAX_USER_CAMERAS 8 + +namespace NL3D { + +class ITexture; +class CTextureUser; +class CPixelProgram; +class CVertexProgram; + +/** + * \brief CFXAA + * \date 2014-08-03 21:41GMT + * \author Jan Boon (Kaetemi) + * CFXAA + */ +class CFXAA +{ +public: + CFXAA(NL3D::UDriver *driver); + virtual ~CFXAA(); + + /// Apply effect to current render target. Render target must be managed by render target manager + virtual void applyEffect(); + +private: + UDriver *m_Driver; + + NL3D::UMaterial m_Mat; + // NL3D::CVertexBuffer m_VB; + NLMISC::CQuadUV m_QuadUV; + CVertexProgram *m_VP; + CPixelProgram *m_PP; + + uint m_Width; + uint m_Height; + +}; /* class CFXAA */ + +} /* namespace NL3D */ + +#endif /* #ifndef NL3D_FXAA_H */ + +/* end of file */ diff --git a/code/nel/include/nel/3d/matrix_3x4.h b/code/nel/include/nel/3d/matrix_3x4.h index d7ed660fc..45901c20e 100644 --- a/code/nel/include/nel/3d/matrix_3x4.h +++ b/code/nel/include/nel/3d/matrix_3x4.h @@ -108,281 +108,6 @@ public: }; -// *************************************************************************** -// *************************************************************************** -// SSE Matrix -// *************************************************************************** -// *************************************************************************** - - -// *************************************************************************** -#if defined(NL_OS_WINDOWS) && !defined(NL_NO_ASM) - - -/** For fast vector/point multiplication. Special usage for Skinning. - * NB: SSE is no more used (no speed gain, some memory problem), but keep it for possible future usage. - */ -class CMatrix3x4SSE -{ -public: - // Order them in memory column first, for SSE column multiplication. - float a11, a21, a31, a41; - float a12, a22, a32, a42; - float a13, a23, a33, a43; - float a14, a24, a34, a44; - - // Copy from a matrix. - void set(const CMatrix &mat) - { - const float *m =mat.get(); - a11= m[0]; a12= m[4]; a13= m[8] ; a14= m[12]; - a21= m[1]; a22= m[5]; a23= m[9] ; a24= m[13]; - a31= m[2]; a32= m[6]; a33= m[10]; a34= m[14]; - // not used. - a41= 0 ; a42= 0 ; a43= 0 ; a44= 1; - } - - - // mulSetvector. NB: in should be different as v!! (else don't work). - void mulSetVector(const CVector &vin, CVector &vout) - { - __asm - { - mov eax, vin - mov ebx, this - mov edi, vout - // Load in vector in op[0] - movss xmm0, [eax]vin.x - movss xmm1, [eax]vin.y - movss xmm2, [eax]vin.z - // Expand op[0] to op[1], op[2], op[3] - shufps xmm0, xmm0, 0 - shufps xmm1, xmm1, 0 - shufps xmm2, xmm2, 0 - // Mul each vector with 3 Matrix column - mulps xmm0, [ebx]this.a11 - mulps xmm1, [ebx]this.a12 - mulps xmm2, [ebx]this.a13 - // Add each column vector. - addps xmm0, xmm1 - addps xmm0, xmm2 - - // write the result. - movss [edi]vout.x, xmm0 - shufps xmm0, xmm0, 33 - movss [edi]vout.y, xmm0 - movhlps xmm0, xmm0 - movss [edi]vout.z, xmm0 - } - } - // mulSetpoint. NB: in should be different as v!! (else don't work). - void mulSetPoint(const CVector &vin, CVector &vout) - { - __asm - { - mov eax, vin - mov ebx, this - mov edi, vout - // Load in vector in op[0] - movss xmm0, [eax]vin.x - movss xmm1, [eax]vin.y - movss xmm2, [eax]vin.z - // Expand op[0] to op[1], op[2], op[3] - shufps xmm0, xmm0, 0 - shufps xmm1, xmm1, 0 - shufps xmm2, xmm2, 0 - // Mul each vector with 3 Matrix column - mulps xmm0, [ebx]this.a11 - mulps xmm1, [ebx]this.a12 - mulps xmm2, [ebx]this.a13 - // Add each column vector. - addps xmm0, xmm1 - addps xmm0, xmm2 - // Add Matrix translate column vector - addps xmm0, [ebx]this.a14 - - // write the result. - movss [edi]vout.x, xmm0 - shufps xmm0, xmm0, 33 - movss [edi]vout.y, xmm0 - movhlps xmm0, xmm0 - movss [edi]vout.z, xmm0 - } - } - - - // mulSetvector. NB: vin should be different as v!! (else don't work). - void mulSetVector(const CVector &vin, float scale, CVector &vout) - { - __asm - { - mov eax, vin - mov ebx, this - mov edi, vout - // Load in vector in op[0] - movss xmm0, [eax]vin.x - movss xmm1, [eax]vin.y - movss xmm2, [eax]vin.z - // Load scale in op[0] - movss xmm3, scale - // Expand op[0] to op[1], op[2], op[3] - shufps xmm0, xmm0, 0 - shufps xmm1, xmm1, 0 - shufps xmm2, xmm2, 0 - shufps xmm3, xmm3, 0 - // Store vertex column in other regs. - movaps xmm5, xmm0 - movaps xmm6, xmm1 - movaps xmm7, xmm2 - // Mul each vector with 3 Matrix column - mulps xmm0, [ebx]this.a11 - mulps xmm1, [ebx]this.a12 - mulps xmm2, [ebx]this.a13 - // Add each column vector. - addps xmm0, xmm1 - addps xmm0, xmm2 - - // mul final result with scale - mulps xmm0, xmm3 - - // store it in xmm4 for future use. - movaps xmm4, xmm0 - } - } - // mulSetpoint. NB: vin should be different as v!! (else don't work). - void mulSetPoint(const CVector &vin, float scale, CVector &vout) - { - __asm - { - mov eax, vin - mov ebx, this - mov edi, vout - // Load in vector in op[0] - movss xmm0, [eax]vin.x - movss xmm1, [eax]vin.y - movss xmm2, [eax]vin.z - // Load scale in op[0] - movss xmm3, scale - // Expand op[0] to op[1], op[2], op[3] - shufps xmm0, xmm0, 0 - shufps xmm1, xmm1, 0 - shufps xmm2, xmm2, 0 - shufps xmm3, xmm3, 0 - // Store vertex column in other regs. - movaps xmm5, xmm0 - movaps xmm6, xmm1 - movaps xmm7, xmm2 - // Mul each vector with 3 Matrix column - mulps xmm0, [ebx]this.a11 - mulps xmm1, [ebx]this.a12 - mulps xmm2, [ebx]this.a13 - // Add each column vector. - addps xmm0, xmm1 - addps xmm0, xmm2 - // Add Matrix translate column vector - addps xmm0, [ebx]this.a14 - - // mul final result with scale - mulps xmm0, xmm3 - - // store it in xmm4 for future use. - movaps xmm4, xmm0 - } - } - - - // mulAddvector. NB: vin should be different as v!! (else don't work). - void mulAddVector(const CVector &/* vin */, float scale, CVector &vout) - { - __asm - { - mov ebx, this - mov edi, vout - // Load vin vector loaded in mulSetVector - movaps xmm0, xmm5 - movaps xmm1, xmm6 - movaps xmm2, xmm7 - // Load scale in op[0] - movss xmm3, scale - // Expand op[0] to op[1], op[2], op[3] - shufps xmm3, xmm3, 0 - // Mul each vector with 3 Matrix column - mulps xmm0, [ebx]this.a11 - mulps xmm1, [ebx]this.a12 - mulps xmm2, [ebx]this.a13 - // Add each column vector. - addps xmm0, xmm1 - addps xmm0, xmm2 - - // mul final result with scale - mulps xmm0, xmm3 - - // Add result, with prec sum. - addps xmm0, xmm4 - - // store it in xmm4 for future use. - movaps xmm4, xmm0 - - // write the result. - movss [edi]vout.x, xmm0 - shufps xmm0, xmm0, 33 - movss [edi]vout.y, xmm0 - movhlps xmm0, xmm0 - movss [edi]vout.z, xmm0 - } - } - // mulAddpoint. NB: vin should be different as v!! (else don't work). - void mulAddPoint(const CVector &/* vin */, float scale, CVector &vout) - { - __asm - { - mov ebx, this - mov edi, vout - // Load vin vector loaded in mulSetPoint - movaps xmm0, xmm5 - movaps xmm1, xmm6 - movaps xmm2, xmm7 - // Load scale in op[0] - movss xmm3, scale - // Expand op[0] to op[1], op[2], op[3] - shufps xmm3, xmm3, 0 - // Mul each vector with 3 Matrix column - mulps xmm0, [ebx]this.a11 - mulps xmm1, [ebx]this.a12 - mulps xmm2, [ebx]this.a13 - // Add each column vector. - addps xmm0, xmm1 - addps xmm0, xmm2 - // Add Matrix translate column vector - addps xmm0, [ebx]this.a14 - - // mul final result with scale - mulps xmm0, xmm3 - - // Add result, with prec sum. - addps xmm0, xmm4 - - // store it in xmm4 for future use. - movaps xmm4, xmm0 - - // write the result. - movss [edi]vout.x, xmm0 - shufps xmm0, xmm0, 33 - movss [edi]vout.y, xmm0 - movhlps xmm0, xmm0 - movss [edi]vout.z, xmm0 - } - } - -}; - -#else // NL_OS_WINDOWS -/// dummy CMatrix3x4SSE for non windows platform -class CMatrix3x4SSE : public CMatrix3x4 { }; -#endif - - - } // NL3D diff --git a/code/nel/include/nel/3d/particle_system.h b/code/nel/include/nel/3d/particle_system.h index c1139d070..68f67ae6d 100644 --- a/code/nel/include/nel/3d/particle_system.h +++ b/code/nel/include/nel/3d/particle_system.h @@ -1178,9 +1178,6 @@ private: CPSMultiMap::M TLBMap; TLBMap _LBMap; - float _AutoLODStartDistPercent; - uint8 _AutoLODDegradationExponent; - CPSAttribMaker *_ColorAttenuationScheme; NLMISC::CRGBA _GlobalColor; NLMISC::CRGBA _GlobalColorLighted; @@ -1206,6 +1203,11 @@ private: bool _HiddenAtCurrentFrame : 1; bool _HiddenAtPreviousFrame : 1; + // The two following members have been moved after the bitfield to workaround a MSVC 64-bit compiler bug (fixed in VS2013) + // For more info, see: http://connect.microsoft.com/VisualStudio/feedback/details/777184/c-compiler-bug-vtable-pointer-put-at-wrong-offset-in-64-bit-mode + float _AutoLODStartDistPercent; + uint8 _AutoLODDegradationExponent; + static bool _SerialIdentifiers; static bool _ForceDisplayBBox; diff --git a/code/nel/include/nel/3d/render_target_manager.h b/code/nel/include/nel/3d/render_target_manager.h new file mode 100644 index 000000000..cae8e31b0 --- /dev/null +++ b/code/nel/include/nel/3d/render_target_manager.h @@ -0,0 +1,83 @@ +/** + * \file render_target_manager.h + * \brief CRenderTargetManager + * \date 2014-07-30 21:30GMT + * \author Jan Boon (Kaetemi) + * CRenderTargetManager + */ + +/* + * Copyright (C) 2013 by authors + * + * This file is part of NL3D. + * NL3D is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * NL3D is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General + * Public License for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with NL3D. If not, see + * . + */ + +#ifndef NL3D_RENDER_TARGET_MANAGER_H +#define NL3D_RENDER_TARGET_MANAGER_H +#include + +// STL includes + +// NeL includes +#include +#include + +// Project includes +#include + +namespace NL3D { + +class UDriver; +class ITexture; +class CTextureUser; +class CDriverUser; + +struct CRenderTargetDescInt; + +/** + * \brief CRenderTargetManager + * \date 2013-07-03 20:17GMT + * \author Jan Boon (Kaetemi) + * CRenderTargetManager + * Usage: Call 'getRenderTarget' when you start using a render target, + * call 'recycledRenderTarget' when the render target can be recycled. + * At end of frame call cleanup. + * Assumes semi-constant render target quantity between frames, + * except on changes of resolution or feature settings. + */ +class CRenderTargetManager +{ +public: + CRenderTargetManager(); + ~CRenderTargetManager(); + + NL3D::CTextureUser *getRenderTarget(uint width, uint height, bool mode2D = false, UTexture::TUploadFormat format = UTexture::Auto); + void recycleRenderTarget(NL3D::CTextureUser *renderTarget); + + void cleanup(); + +private: + friend class CDriverUser; + NL3D::UDriver *m_Driver; + std::vector m_RenderTargets; + +}; /* class CRenderTargetManager */ + +} /* namespace NL3D */ + +#endif /* #ifndef NL3D_RENDER_TARGET_MANAGER_H */ + +/* end of file */ diff --git a/code/nel/include/nel/3d/render_trav.h b/code/nel/include/nel/3d/render_trav.h index d50d2c242..6e41d8282 100644 --- a/code/nel/include/nel/3d/render_trav.h +++ b/code/nel/include/nel/3d/render_trav.h @@ -139,7 +139,7 @@ public: * \param renderPart : The part of the scene that must be rendered * \param newRender true If scene render is beginning. Otherwise other parts of the scene have already been rendered. */ - void traverse(UScene::TRenderPart renderPart, bool newRender); + void traverse(UScene::TRenderPart renderPart, bool newRender, bool generateShadows); //@} /// \name RenderList. diff --git a/code/nel/include/nel/3d/scene.h b/code/nel/include/nel/3d/scene.h index e0648ebd3..12c18b484 100644 --- a/code/nel/include/nel/3d/scene.h +++ b/code/nel/include/nel/3d/scene.h @@ -157,7 +157,7 @@ public: * \param doHrcPass set it to false to indicate that the CHrcTrav have not to be traversed. Useful to optimize if * you know that NONE of your models have moved (a good example is a shoot of the scene from different cameras). */ - void render(bool doHrcPass=true); + void render(bool doHrcPass = true); /** Begin Part Rendering * During beginPartRender()/endPartRender(), you can ask other scene to render their part, but you should @@ -171,10 +171,10 @@ public: * WARNING: always must begin rendering with at least UScene::RenderOpaque, else shadows won't work * WARNING: assert-crash if a part in 'rp' has already been rendered since the last beginPartRender() */ - void renderPart(UScene::TRenderPart rp, bool doHrcPass=true); + void renderPart(UScene::TRenderPart rp, bool doHrcPass = true, bool doTrav = true, bool keepTrav = false); /** End Part Rendering (commit model creation and deletion that were asked during rendering) */ - void endPartRender(); + void endPartRender(bool keepTrav = false); //@} @@ -826,7 +826,7 @@ private: void flushSSSModelRequests(); // common vb for water display CVertexBuffer _WaterVB; - + bool _RequestParticlesAnimate; }; diff --git a/code/nel/include/nel/3d/scene_user.h b/code/nel/include/nel/3d/scene_user.h index 708c8bfd7..639fa33d8 100644 --- a/code/nel/include/nel/3d/scene_user.h +++ b/code/nel/include/nel/3d/scene_user.h @@ -96,8 +96,8 @@ public: // render methods virtual void render(bool updateWaitingInstances = true, bool restoreMatrixContextAfterRender = true); virtual void beginPartRender(); - virtual void renderPart(TRenderPart rp); - virtual void endPartRender(bool updateWaitingInstances = true, bool restoreMatrixContextAfterRender = true); + virtual void renderPart(TRenderPart rp, bool doHrcPass = true, bool doTrav = true, bool keepTrav = false); + virtual void endPartRender(bool updateWaitingInstances = true, bool restoreMatrixContextAfterRender = true, bool keepTrav = true); // update async loading whithout a call to render virtual void updateWaitingInstances(double ellapsedTime); diff --git a/code/nel/include/nel/3d/skeleton_model.h b/code/nel/include/nel/3d/skeleton_model.h index ed4f8aadc..dccafd1f1 100644 --- a/code/nel/include/nel/3d/skeleton_model.h +++ b/code/nel/include/nel/3d/skeleton_model.h @@ -54,7 +54,7 @@ public: // The index of the skin rdrPass uint16 RdrPassIndex; // The texture id of the specular texture. This is the sort Key. - uint32 SpecId; + uintptr_t SpecId; bool operator<(const CSkinSpecularRdrPass &o) const { diff --git a/code/nel/include/nel/3d/stereo_debugger.h b/code/nel/include/nel/3d/stereo_debugger.h index b07a9630c..6c974f93d 100644 --- a/code/nel/include/nel/3d/stereo_debugger.h +++ b/code/nel/include/nel/3d/stereo_debugger.h @@ -65,10 +65,17 @@ public: /// Sets driver and generates necessary render targets virtual void setDriver(NL3D::UDriver *driver); - void releaseTextures(); + /*void releaseTextures(); void initTextures(); void setTextures(); - void verifyTextures(); + void verifyTextures();*/ + void getTextures(); + void recycleTextures(); + + /// Attach the driver to the display + virtual bool attachToDisplay(); + /// Detach the driver from the display + virtual void detachFromDisplay(); /// Gets the required screen resolution for this device virtual bool getScreenResolution(uint &width, uint &height); @@ -76,6 +83,8 @@ public: virtual void updateCamera(uint cid, const NL3D::UCamera *camera); /// Get the frustum to use for clipping virtual void getClippingFrustum(uint cid, NL3D::UCamera *camera) const; + /// Get the original frustum of the camera + virtual void getOriginalFrustum(uint cid, NL3D::UCamera *camera) const; /// Is there a next pass virtual bool nextPass(); @@ -89,14 +98,21 @@ public: virtual void getCurrentMatrix(uint cid, NL3D::UCamera *camera) const; /// At the start of a new render target - virtual bool wantClear(); + virtual bool wantClear(); /// The 3D scene virtual bool wantScene(); + /// Scene post processing effects + virtual bool wantSceneEffects(); /// Interface within the 3D scene virtual bool wantInterface3D(); /// 2D Interface virtual bool wantInterface2D(); + /// Is this the first 3D scene of the frame + virtual bool isSceneFirst(); + /// Is this the last 3D scene of the frame + virtual bool isSceneLast(); + /// Returns true if a new render target was set, always fase if not using render targets virtual bool beginRenderTarget(); /// Returns true if a render target was fully drawn, always false if not using render targets @@ -116,9 +132,7 @@ private: CFrustum m_Frustum[NL_STEREO_MAX_USER_CAMERAS]; CMatrix m_CameraMatrix[NL_STEREO_MAX_USER_CAMERAS]; - NLMISC::CSmartPtr m_LeftTex; NL3D::CTextureUser *m_LeftTexU; - NLMISC::CSmartPtr m_RightTex; NL3D::CTextureUser *m_RightTexU; NL3D::UMaterial m_Mat; NLMISC::CQuadUV m_QuadUV; diff --git a/code/nel/include/nel/3d/stereo_display.h b/code/nel/include/nel/3d/stereo_display.h index 3b9c73b74..3b6fdbb21 100644 --- a/code/nel/include/nel/3d/stereo_display.h +++ b/code/nel/include/nel/3d/stereo_display.h @@ -94,6 +94,11 @@ public: /// Sets driver and generates necessary render targets virtual void setDriver(NL3D::UDriver *driver) = 0; + + /// Attach the driver to the display, return true if attached + virtual bool attachToDisplay() = 0; + /// Detach the driver from the display + virtual void detachFromDisplay() = 0; /// Gets the required screen resolution for this device virtual bool getScreenResolution(uint &width, uint &height) = 0; @@ -101,6 +106,8 @@ public: virtual void updateCamera(uint cid, const NL3D::UCamera *camera) = 0; /// Get the frustum to use for clipping virtual void getClippingFrustum(uint cid, NL3D::UCamera *camera) const = 0; + /// Get the original frustum of the camera + virtual void getOriginalFrustum(uint cid, NL3D::UCamera *camera) const = 0; /// Is there a next pass virtual bool nextPass() = 0; @@ -114,20 +121,28 @@ public: virtual void getCurrentMatrix(uint cid, NL3D::UCamera *camera) const = 0; /// At the start of a new render target - virtual bool wantClear() = 0; + virtual bool wantClear() = 0; /// The 3D scene virtual bool wantScene() = 0; + /// Scene post processing effects + virtual bool wantSceneEffects() = 0; /// Interface within the 3D scene virtual bool wantInterface3D() = 0; /// 2D Interface virtual bool wantInterface2D() = 0; + /// Is this the first 3D scene of the frame + virtual bool isSceneFirst() = 0; + /// Is this the last 3D scene of the frame + virtual bool isSceneLast() = 0; + /// Returns true if a new render target was set, always fase if not using render targets virtual bool beginRenderTarget() = 0; /// Returns true if a render target was fully drawn, always false if not using render targets virtual bool endRenderTarget() = 0; static const char *getLibraryName(CStereoDeviceInfo::TStereoDeviceLibrary library); + // List all devices. Device creation factories are no longer valid after re-calling this function static void listDevices(std::vector &devicesOut); static IStereoDisplay *createDevice(const CStereoDeviceInfo &deviceInfo); static void releaseUnusedLibraries(); diff --git a/code/nel/include/nel/3d/stereo_hmd.h b/code/nel/include/nel/3d/stereo_hmd.h index 95c159cfd..3276e78fe 100644 --- a/code/nel/include/nel/3d/stereo_hmd.h +++ b/code/nel/include/nel/3d/stereo_hmd.h @@ -53,6 +53,9 @@ public: /// Get the HMD orientation virtual NLMISC::CQuat getOrientation() const = 0; + /// Set the GUI reference + virtual void setInterfaceMatrix(const NL3D::CMatrix &matrix) = 0; + /// Get GUI center (1 = width, 1 = height, 0 = center) virtual void getInterface2DShift(uint cid, float &x, float &y, float distance) const = 0; diff --git a/code/nel/include/nel/3d/stereo_ovr.h b/code/nel/include/nel/3d/stereo_ovr.h index ba6895bf0..750f32027 100644 --- a/code/nel/include/nel/3d/stereo_ovr.h +++ b/code/nel/include/nel/3d/stereo_ovr.h @@ -44,7 +44,7 @@ #ifndef NL3D_STEREO_OVR_H #define NL3D_STEREO_OVR_H -#ifdef HAVE_LIBOVR +#ifdef HAVE_LIBOVR_02 #include @@ -91,6 +91,8 @@ public: virtual void updateCamera(uint cid, const NL3D::UCamera *camera); /// Get the frustum to use for clipping virtual void getClippingFrustum(uint cid, NL3D::UCamera *camera) const; + /// Get the original frustum of the camera + virtual void getOriginalFrustum(uint cid, NL3D::UCamera *camera) const; /// Is there a next pass virtual bool nextPass(); @@ -121,6 +123,9 @@ public: /// Get the HMD orientation virtual NLMISC::CQuat getOrientation() const; + /// Set the GUI reference + virtual void setInterfaceMatrix(const NL3D::CMatrix &matrix); + /// Get GUI center (1 = width, 1 = height, 0 = center) virtual void getInterface2DShift(uint cid, float &x, float &y, float distance) const; @@ -132,33 +137,37 @@ public: /// Set the scale of the game in units per meter virtual void setScale(float s); - - static void listDevices(std::vector &devicesOut); - static bool isLibraryInUse(); - static void releaseLibrary(); - - /// Calculates internal camera information based on the reference camera void initCamera(uint cid, const NL3D::UCamera *camera); + /// Render GUI + void renderGUI(); + /// Checks if the device used by this class was actually created bool isDeviceCreated(); + static void listDevices(std::vector &devicesOut); + static bool isLibraryInUse(); + static void releaseLibrary(); + private: CStereoOVRDevicePtr *m_DevicePtr; int m_Stage; int m_SubStage; + CViewport m_RegularViewport; CViewport m_LeftViewport; CViewport m_RightViewport; CFrustum m_ClippingFrustum[NL_STEREO_MAX_USER_CAMERAS]; CFrustum m_LeftFrustum[NL_STEREO_MAX_USER_CAMERAS]; CFrustum m_RightFrustum[NL_STEREO_MAX_USER_CAMERAS]; + CFrustum m_OriginalFrustum[NL_STEREO_MAX_USER_CAMERAS]; CMatrix m_CameraMatrix[NL_STEREO_MAX_USER_CAMERAS]; + CMatrix m_InterfaceCameraMatrix; mutable bool m_OrientationCached; mutable NLMISC::CQuat m_OrientationCache; UDriver *m_Driver; - NLMISC::CSmartPtr m_BarrelTex; - NL3D::CTextureUser *m_BarrelTexU; + NL3D::CTextureUser *m_SceneTexture; NL3D::UMaterial m_BarrelMat; + NL3D::CTextureUser *m_GUITexture; NLMISC::CQuadUV m_BarrelQuadLeft; NLMISC::CQuadUV m_BarrelQuadRight; NLMISC::CRefPtr m_PixelProgram; diff --git a/code/nel/include/nel/3d/stereo_ovr_04.h b/code/nel/include/nel/3d/stereo_ovr_04.h new file mode 100644 index 000000000..8bda88c88 --- /dev/null +++ b/code/nel/include/nel/3d/stereo_ovr_04.h @@ -0,0 +1,225 @@ +/** + * \file stereo_ovr.h + * \brief CStereoOVR + * \date 2014-08-04 16:21GMT + * \author Jan Boon (Kaetemi) + * CStereoOVR + */ + +/* + * Copyright (C) 2014 by authors + * + * This file is part of NL3D. + * NL3D is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * NL3D is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General + * Public License for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with NL3D. If not, see + * . + * + * Linking this library statically or dynamically with other modules + * is making a combined work based on this library. Thus, the terms + * and conditions of the GNU General Public License cover the whole + * combination. + * + * As a special exception, the copyright holders of this library give + * you permission to link this library with the Oculus SDK to produce + * an executable, regardless of the license terms of the Oculus SDK, + * and distribute linked combinations including the two, provided that + * you also meet the terms and conditions of the license of the Oculus + * SDK. You must obey the GNU General Public License in all respects + * for all of the code used other than the Oculus SDK. If you modify + * this file, you may extend this exception to your version of the + * file, but you are not obligated to do so. If you do not wish to do + * so, delete this exception statement from your version. + */ + +#ifndef NL3D_STEREO_OVR_04_H +#define NL3D_STEREO_OVR_04_H + +#ifdef HAVE_LIBOVR + +#include + +// STL includes + +// NeL includes +#include +#include + +// Project includes +#include +#include +#include +#include +#include +#include +#include + +struct ovrHmdDesc_; +typedef const ovrHmdDesc_ *ovrHmd; + +namespace NL3D { + +class ITexture; +class CTextureUser; +class CStereoOVRDeviceFactory; + +#define NL_STEREO_MAX_USER_CAMERAS 8 +#define NL_OVR_EYE_COUNT 2 + +/** + * \brief CStereoOVR + * \date 2014-08-04 16:21GMT + * \author Jan Boon (Kaetemi) + * CStereoOVR + */ +class CStereoOVR : public IStereoHMD +{ +public: + CStereoOVR(const CStereoOVRDeviceFactory *factory); + virtual ~CStereoOVR(); + + /// Sets driver and generates necessary render targets + virtual void setDriver(NL3D::UDriver *driver); + + /// Attach the driver to the display + virtual bool attachToDisplay(); + /// Detach the driver from the display + virtual void detachFromDisplay(); + + /// Gets the required screen resolution for this device + virtual bool getScreenResolution(uint &width, uint &height); + /// Set latest camera position etcetera + virtual void updateCamera(uint cid, const NL3D::UCamera *camera); + /// Get the frustum to use for clipping + virtual void getClippingFrustum(uint cid, NL3D::UCamera *camera) const; + /// Get the original frustum of the camera + virtual void getOriginalFrustum(uint cid, NL3D::UCamera *camera) const; + + /// Is there a next pass + virtual bool nextPass(); + /// Gets the current viewport + virtual const NL3D::CViewport &getCurrentViewport() const; + /// Gets the current camera frustum + virtual const NL3D::CFrustum &getCurrentFrustum(uint cid) const; + /// Gets the current camera frustum + virtual void getCurrentFrustum(uint cid, NL3D::UCamera *camera) const; + /// Gets the current camera matrix + virtual void getCurrentMatrix(uint cid, NL3D::UCamera *camera) const; + + /// At the start of a new render target + virtual bool wantClear(); + /// The 3D scene + virtual bool wantScene(); + /// Scene post processing effects + virtual bool wantSceneEffects(); + /// Interface within the 3D scene + virtual bool wantInterface3D(); + /// 2D Interface + virtual bool wantInterface2D(); + + /// Is this the first 3D scene of the frame + virtual bool isSceneFirst(); + /// Is this the last 3D scene of the frame + virtual bool isSceneLast(); + + /// Returns true if a new render target was set, always fase if not using render targets + virtual bool beginRenderTarget(); + /// Returns true if a render target was fully drawn, always false if not using render targets + virtual bool endRenderTarget(); + + + /// Get the HMD orientation + virtual NLMISC::CQuat getOrientation() const; + + /// Set the GUI reference + virtual void setInterfaceMatrix(const NL3D::CMatrix &matrix); + + /// Get GUI center (1 = width, 1 = height, 0 = center) + virtual void getInterface2DShift(uint cid, float &x, float &y, float distance) const; + + /// Set the head model, eye position relative to orientation point + virtual void setEyePosition(const NLMISC::CVector &v); + /// Get the head model, eye position relative to orientation point + virtual const NLMISC::CVector &getEyePosition() const; + + /// Set the scale of the game in units per meter + virtual void setScale(float s); + + /// Calculates internal camera information based on the reference camera + void initCamera(uint cid, const NL3D::UCamera *camera); + /// Render GUI + void renderGUI(); + + /// Checks if the device used by this class was actually created + bool isDeviceCreated(); + + static void listDevices(std::vector &devicesOut); + static bool isLibraryInUse(); + static void releaseLibrary(); + +private: + ovrHmd m_DevicePtr; + bool m_DebugDevice; + + int m_Stage; + int m_SubStage; + + CViewport m_RegularViewport; + CViewport m_EyeViewport[NL_OVR_EYE_COUNT]; + CFrustum m_EyeFrustumBase[NL_OVR_EYE_COUNT]; + uint m_RenderTargetWidth; + uint m_RenderTargetHeight; + NLMISC::CVector2f m_EyeUVScaleOffset[NL_OVR_EYE_COUNT][2]; + float m_EyeViewAdjustX[NL_OVR_EYE_COUNT]; + + CVertexBuffer m_VB[NL_OVR_EYE_COUNT]; + CIndexBuffer m_IB[NL_OVR_EYE_COUNT]; + uint32 m_NbTris[NL_OVR_EYE_COUNT]; + + CFrustum m_ClippingFrustum[NL_STEREO_MAX_USER_CAMERAS]; + CFrustum m_LeftFrustum[NL_STEREO_MAX_USER_CAMERAS]; + CFrustum m_RightFrustum[NL_STEREO_MAX_USER_CAMERAS]; + CFrustum m_OriginalFrustum[NL_STEREO_MAX_USER_CAMERAS]; + CMatrix m_CameraMatrix[NL_STEREO_MAX_USER_CAMERAS]; + CMatrix m_InterfaceCameraMatrix; + mutable bool m_OrientationCached; + mutable NLMISC::CQuat m_OrientationCache; + + UDriver *m_Driver; + + CTextureUser *m_GUITexture; + NL3D::CTextureUser *m_SceneTexture; + + UMaterial m_UnlitMat; + + UDriver::CMode m_OriginalMode; + sint32 m_OriginalWinPosX; + sint32 m_OriginalWinPosY; + bool m_AttachedDisplay; + + /* + NL3D::UMaterial m_BarrelMat; + NLMISC::CQuadUV m_BarrelQuadLeft; + NLMISC::CQuadUV m_BarrelQuadRight; + NLMISC::CRefPtr m_PixelProgram;*/ + NLMISC::CVector m_EyePosition; + float m_Scale; + +}; /* class CStereoOVR */ + +} /* namespace NL3D */ + +#endif /* HAVE_LIBOVR */ + +#endif /* #ifndef NL3D_STEREO_OVR_04_H */ + +/* end of file */ diff --git a/code/nel/include/nel/3d/text_context.h b/code/nel/include/nel/3d/text_context.h index 203e2b3c3..8cf7ad7f0 100644 --- a/code/nel/include/nel/3d/text_context.h +++ b/code/nel/include/nel/3d/text_context.h @@ -82,6 +82,8 @@ public: void setShaded (bool b) { _Shaded = b; } + void setShadeOutline (bool b) { _ShadeOutline = b; } + void setShadeExtent (float shext) { _ShadeExtent = shext; } /// The alpha of the shade is multiplied at each draw with the alpha of the color. Default: (0,0,0,255) @@ -107,6 +109,8 @@ public: bool getShaded() const { return _Shaded; } + bool getShadeOutline() const { return _ShadeOutline; } + bool getKeep800x600Ratio() const {return _Keep800x600Ratio;} NLMISC::CRGBA getShadeColor () const { return _ShadeColor; } @@ -138,15 +142,30 @@ public: { nlassert (index < _CacheStrings.size()); CComputedString &rCS = _CacheStrings[index]; - if(_Shaded) + if (_Shaded) { - CRGBA bkup = rCS.Color; + CRGBA bkup = rCS.Color; rCS.Color = _ShadeColor; rCS.Color.A = (uint8)((uint(bkup.A) * uint(_ShadeColor.A)+1)>>8); - rCS.render2D (*_Driver, x+_ShadeExtent, z-_ShadeExtent, _HotSpot, _ScaleX, _ScaleZ); + if (_ShadeOutline) + { + float rext = _ShadeExtent * 0.7071f; + rCS.render2D(*_Driver, x+rext, z-rext, _HotSpot, _ScaleX, _ScaleZ); + rCS.render2D(*_Driver, x-rext, z-rext, _HotSpot, _ScaleX, _ScaleZ); + rCS.render2D(*_Driver, x-rext, z+rext, _HotSpot, _ScaleX, _ScaleZ); + rCS.render2D(*_Driver, x+rext, z+rext, _HotSpot, _ScaleX, _ScaleZ); + rCS.render2D(*_Driver, x+_ShadeExtent, z, _HotSpot, _ScaleX, _ScaleZ); + rCS.render2D(*_Driver, x-_ShadeExtent, z, _HotSpot, _ScaleX, _ScaleZ); + rCS.render2D(*_Driver, x, z-_ShadeExtent, _HotSpot, _ScaleX, _ScaleZ); + rCS.render2D(*_Driver, x, z-_ShadeExtent, _HotSpot, _ScaleX, _ScaleZ); + } + else + { + rCS.render2D(*_Driver, x+_ShadeExtent, z-_ShadeExtent, _HotSpot, _ScaleX, _ScaleZ); + } rCS.Color= bkup; } - rCS.render2D (*_Driver, x, z, _HotSpot, _ScaleX, _ScaleZ); + rCS.render2D(*_Driver, x, z, _HotSpot, _ScaleX, _ScaleZ); } /** Clip and print a string that is in the cache (it leaves the string in the cache) @@ -161,7 +180,22 @@ public: CRGBA bkup = rCS.Color; rCS.Color= _ShadeColor; rCS.Color.A = (uint8)((uint(bkup.A) * uint(_ShadeColor.A)+1)>>8); - rCS.render2DClip(*_Driver, rdrBuffer, x+_ShadeExtent, z-_ShadeExtent, xmin, ymin, xmax, ymax); + if (_ShadeOutline) + { + float rext = _ShadeExtent * 0.7071f; + rCS.render2DClip(*_Driver, rdrBuffer, x+rext, z-rext, xmin, ymin, xmax, ymax); + rCS.render2DClip(*_Driver, rdrBuffer, x-rext, z-rext, xmin, ymin, xmax, ymax); + rCS.render2DClip(*_Driver, rdrBuffer, x-rext, z+rext, xmin, ymin, xmax, ymax); + rCS.render2DClip(*_Driver, rdrBuffer, x+rext, z+rext, xmin, ymin, xmax, ymax); + rCS.render2DClip(*_Driver, rdrBuffer, x+_ShadeExtent, z, xmin, ymin, xmax, ymax); + rCS.render2DClip(*_Driver, rdrBuffer, x-_ShadeExtent, z, xmin, ymin, xmax, ymax); + rCS.render2DClip(*_Driver, rdrBuffer, x, z+_ShadeExtent, xmin, ymin, xmax, ymax); + rCS.render2DClip(*_Driver, rdrBuffer, x, z-_ShadeExtent, xmin, ymin, xmax, ymax); + } + else + { + rCS.render2DClip(*_Driver, rdrBuffer, x+_ShadeExtent, z-_ShadeExtent, xmin, ymin, xmax, ymax); + } rCS.Color= bkup; } rCS.render2DClip (*_Driver, rdrBuffer, x, z, xmin, ymin, xmax, ymax); @@ -174,12 +208,27 @@ public: { nlassert (index < _CacheStrings.size()); CComputedString &rCS = _CacheStrings[index]; - if(_Shaded) + if (_Shaded) { CRGBA bkup = rCS.Color; rCS.Color= _ShadeColor; rCS.Color.A = (uint8)((uint(bkup.A) * uint(_ShadeColor.A)+1)>>8); - rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x+_ShadeExtent, y-_ShadeExtent, depth, xmin, ymin, xmax, ymax); + if (_ShadeOutline) + { + float rext = _ShadeExtent * 0.7071f; + rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x+rext, y-rext, depth, xmin, ymin, xmax, ymax); + rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x-rext, y-rext, depth, xmin, ymin, xmax, ymax); + rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x-rext, y+rext, depth, xmin, ymin, xmax, ymax); + rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x+rext, y+rext, depth, xmin, ymin, xmax, ymax); + rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x+_ShadeExtent, y, depth, xmin, ymin, xmax, ymax); + rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x-_ShadeExtent, y, depth, xmin, ymin, xmax, ymax); + rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x, y+_ShadeExtent, depth, xmin, ymin, xmax, ymax); + rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x, y-_ShadeExtent, depth, xmin, ymin, xmax, ymax); + } + else + { + rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x+_ShadeExtent, y-_ShadeExtent, depth, xmin, ymin, xmax, ymax); + } rCS.Color= bkup; } rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x, y, depth, xmin, ymin, xmax, ymax); @@ -194,17 +243,32 @@ public: _FontManager->computeString (ucstr, _FontGen, _Color, _FontSize, _Driver, _TempString, _Keep800x600Ratio); // draw shaded - if(_Shaded) + if (_Shaded) { CRGBA bkup = _TempString.Color; - _TempString.Color= _ShadeColor; + _TempString.Color = _ShadeColor; _TempString.Color.A = (uint8)((uint(bkup.A) * uint(_ShadeColor.A)+1)>>8); - _TempString.render2D (*_Driver,x+_ShadeExtent,z-_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ); - _TempString.Color= bkup; + if (_ShadeOutline) + { + float rext = _ShadeExtent * 0.7071f; + _TempString.render2D(*_Driver,x+rext,z-rext,_HotSpot,_ScaleX,_ScaleZ); + _TempString.render2D(*_Driver,x-rext,z-rext,_HotSpot,_ScaleX,_ScaleZ); + _TempString.render2D(*_Driver,x-rext,z+rext,_HotSpot,_ScaleX,_ScaleZ); + _TempString.render2D(*_Driver,x+rext,z+rext,_HotSpot,_ScaleX,_ScaleZ); + _TempString.render2D(*_Driver,x+_ShadeExtent,z,_HotSpot,_ScaleX,_ScaleZ); + _TempString.render2D(*_Driver,x-_ShadeExtent,z,_HotSpot,_ScaleX,_ScaleZ); + _TempString.render2D(*_Driver,x,z+_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ); + _TempString.render2D(*_Driver,x,z-_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ); + } + else + { + _TempString.render2D(*_Driver,x+_ShadeExtent,z-_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ); + } + _TempString.Color = bkup; } // draw - _TempString.render2D (*_Driver, x, z, _HotSpot, _ScaleX, _ScaleZ); + _TempString.render2D(*_Driver, x, z, _HotSpot, _ScaleX, _ScaleZ); } /// Directly print a string @@ -218,17 +282,32 @@ public: _FontManager->computeString (str, _FontGen, _Color, _FontSize, _Driver, _TempString, _Keep800x600Ratio); // draw shaded - if(_Shaded) + if (_Shaded) { CRGBA bkup = _TempString.Color; _TempString.Color = _ShadeColor; _TempString.Color.A = (uint8)((uint(bkup.A) * uint(_ShadeColor.A)+1)>>8); - _TempString.render2D (*_Driver,x+_ShadeExtent,z-_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ); - _TempString.Color= bkup; + if (_ShadeOutline) + { + float rext = _ShadeExtent * 0.7071f; + _TempString.render2D(*_Driver,x+rext,z-rext,_HotSpot,_ScaleX,_ScaleZ); + _TempString.render2D(*_Driver,x-rext,z-rext,_HotSpot,_ScaleX,_ScaleZ); + _TempString.render2D(*_Driver,x-rext,z+rext,_HotSpot,_ScaleX,_ScaleZ); + _TempString.render2D(*_Driver,x+rext,z+rext,_HotSpot,_ScaleX,_ScaleZ); + _TempString.render2D(*_Driver,x+_ShadeExtent,z,_HotSpot,_ScaleX,_ScaleZ); + _TempString.render2D(*_Driver,x-_ShadeExtent,z,_HotSpot,_ScaleX,_ScaleZ); + _TempString.render2D(*_Driver,x,z+_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ); + _TempString.render2D(*_Driver,x,z-_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ); + } + else + { + _TempString.render2D(*_Driver,x+_ShadeExtent,z-_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ); + } + _TempString.Color = bkup; } // draw - _TempString.render2D (*_Driver, x, z, _HotSpot, _ScaleX, _ScaleZ); + _TempString.render2D(*_Driver, x, z, _HotSpot, _ScaleX, _ScaleZ); } /// Get computed string from index @@ -317,6 +396,9 @@ private: /// true if text is shaded bool _Shaded; + /// true if shade appears as an outline + bool _ShadeOutline; + /// shade's extent (shadow size) float _ShadeExtent; diff --git a/code/nel/include/nel/3d/text_context_user.h b/code/nel/include/nel/3d/text_context_user.h index a95fb2ca1..8e14dc878 100644 --- a/code/nel/include/nel/3d/text_context_user.h +++ b/code/nel/include/nel/3d/text_context_user.h @@ -64,19 +64,21 @@ public: /// \name Text look. // @{ void setColor(NLMISC::CRGBA color); - void setFontSize(uint32 fontSize) ; - uint32 getFontSize() const ; - void setHotSpot(THotSpot hotSpot) ; - THotSpot getHotSpot() const ; - void setScaleX(float scaleX) ; - void setScaleY(float scaleY) ; - float getScaleX() const ; - float getScaleY() const ; - void setShaded(bool b) ; - bool getShaded() const ; - void setShadeExtent(float shext) ; - void setShadeColor (NLMISC::CRGBA sc); - NLMISC::CRGBA getShadeColor () const; + void setFontSize(uint32 fontSize); + uint32 getFontSize() const; + void setHotSpot(THotSpot hotSpot); + THotSpot getHotSpot() const; + void setScaleX(float scaleX); + void setScaleY(float scaleY); + float getScaleX() const; + float getScaleY() const; + void setShaded(bool b); + bool getShaded() const; + void setShadeOutline(bool b); + bool getShadeOutline() const; + void setShadeExtent(float shext) ; + void setShadeColor (NLMISC::CRGBA sc); + NLMISC::CRGBA getShadeColor () const; void setKeep800x600Ratio(bool keep); bool getKeep800x600Ratio() const; // @} diff --git a/code/nel/include/nel/3d/tile_bank.h b/code/nel/include/nel/3d/tile_bank.h index 9253c5f45..00e0f2cae 100644 --- a/code/nel/include/nel/3d/tile_bank.h +++ b/code/nel/include/nel/3d/tile_bank.h @@ -86,6 +86,11 @@ public: _BitmapName[bitmapType]=name; } + std::string getFileName (TBitmap bitmapType) const + { + return _BitmapName[bitmapType]; + } + /// Get the additional orientation (CCW) for alpha texture. uint8 getRotAlpha () { @@ -161,6 +166,9 @@ public: { return _Name; }; + + std::set getTileSets() const{ return _TileSet; } + void setName (const std::string& name); void addTileSet (const std::string& name); void removeTileSet (const std::string& name); @@ -169,6 +177,8 @@ public: return _TileSet.find (name)!=_TileSet.end(); } + void clear(){ _TileSet.clear(); } + void serial(class NLMISC::IStream &f) throw(NLMISC::EStream); private: diff --git a/code/nel/include/nel/3d/track_tcb.h b/code/nel/include/nel/3d/track_tcb.h index e91cfb397..153dcbc54 100644 --- a/code/nel/include/nel/3d/track_tcb.h +++ b/code/nel/include/nel/3d/track_tcb.h @@ -218,7 +218,7 @@ protected: date*= previous->OODeltaTime; NLMISC::clamp(date, 0,1); - date = this->ease(previous, date); + date = this->ease(previous, (float)date); float hb[4]; this->computeHermiteBasis(date, hb); diff --git a/code/nel/include/nel/3d/u_driver.h b/code/nel/include/nel/3d/u_driver.h index 2e74ae3fe..dc2b02e56 100644 --- a/code/nel/include/nel/3d/u_driver.h +++ b/code/nel/include/nel/3d/u_driver.h @@ -35,9 +35,6 @@ namespace NLMISC { - struct IMouseDevice; - struct IKeyboardDevice; - struct IInputDeviceManager; class CLog; } @@ -63,6 +60,7 @@ class U3dMouseListener; class ULight; class UAnimationSet; class UWaterEnvMap; +class CRenderTargetManager; typedef void (*emptyProc)(void); @@ -94,6 +92,7 @@ public: /// A Graphic Mode descriptor. struct CMode { + std::string DisplayDevice; bool Windowed; uint16 Width; uint16 Height; @@ -110,8 +109,9 @@ public: Frequency = 0; AntiAlias = -1; } - CMode(uint16 w, uint16 h, uint8 d, bool windowed= true, uint frequency = 0, sint8 aa = -1) + CMode(uint16 w, uint16 h, uint8 d, bool windowed= true, uint frequency = 0, sint8 aa = -1, const std::string &displayDevice = std::string()) { + DisplayDevice = displayDevice; Windowed = windowed; Width = w; Height = h; @@ -309,6 +309,16 @@ public: // @} + /// Get the render target manager + virtual CRenderTargetManager &getRenderTargetManager() =0; + + /// Set a texture of specified size or of the size of the window as render target + virtual void beginDefaultRenderTarget(uint32 width = 0, uint32 height = 0) =0; + + /// Draw the render target to the back buffer + virtual void endDefaultRenderTarget(UScene *scene) =0; + + /// \name Components gestion for Interface 2D/3D. // @{ @@ -556,36 +566,6 @@ public: /// \name Mouse / Keyboard / Gamedevices // @{ - /** Enable / disable low level mouse. This allow to take advantage of some options (speed of the mouse, automatic wrapping) - * It returns a interface to these parameters when it is supported, or NULL otherwise - * The interface pointer is valid as long as the low level mouse is enabled. - * A call to disable the mouse returns NULL, and restore the default mouse behaviour - * NB : - In this mode the mouse cursor isn't drawn. - * - Calls to showCursor have no effects - * - Calls to setCapture have no effects - */ - virtual NLMISC::IMouseDevice *enableLowLevelMouse(bool enable, bool hardware) = 0; - - /** Enable / disable a low level keyboard. - * This returns a interface to some parameters when it is supported, or NULL otherwise. - * The interface pointer is valid as long as the low level keyboard is enabled. - * A call to disable the keyboard returns NULL, and restore the default keyboard behaviour. - */ - virtual NLMISC::IKeyboardDevice *enableLowLevelKeyboard(bool enable) = 0; - - /** Check whether there is a low level device manager available, and get its interface. Return NULL if not available. - * From this interface you can deal with mouse and keyboard as above, but you can also manage game devices (joysticks, joypads ...) - */ - virtual NLMISC::IInputDeviceManager *getLowLevelInputDeviceManager() = 0; - - /** - * wrapper for IEventEmitter::emulateMouseRawMode() - */ - virtual void emulateMouseRawMode(bool enable) = 0; - - // get delay used for mouse double click - virtual uint getDoubleClickDelay(bool hardwareMouse) = 0; - /** show cursor if b is true, or hide it if b is false * NB: This has no effects if a low level mouse is used. */ @@ -845,8 +825,8 @@ public: /** * This is the static function which build a UDriver, the root for all 3D functions. */ - static UDriver *createDriver(uint windowIcon = 0, bool direct3d = false, emptyProc exitFunc = 0); - static UDriver *createDriver(uint windowIcon, TDriver driver, emptyProc exitFunc = 0); + static UDriver *createDriver(uintptr_t windowIcon = 0, bool direct3d = false, emptyProc exitFunc = 0); + static UDriver *createDriver(uintptr_t windowIcon, TDriver driver, emptyProc exitFunc = 0); /** * Purge static memory diff --git a/code/nel/include/nel/3d/u_scene.h b/code/nel/include/nel/3d/u_scene.h index d60266afe..c0733c5d2 100644 --- a/code/nel/include/nel/3d/u_scene.h +++ b/code/nel/include/nel/3d/u_scene.h @@ -134,14 +134,17 @@ public: /** Render a part (see render() for what it does) * beginPartRender() must have been called * \param renderPart a combination of UScene::TRenderPart flags, allow to choose which part of the scene must be rendered + * \param doHrcPass set it to false to indicate that the CHrcTrav have not to be traversed. Useful to optimize if + * you know that NONE of your models have moved (a good example is a shoot of the scene from different cameras). + * \param doTrav set to false when processing a second frame for stereo rending to avoid unnecessary traversals. * WARNING: always must begin rendering with at least UScene::RenderOpaque, else shadows won't work * WARNING: assert-crash if a part in 'rp' has already been rendered since the last beginPartRender() */ - virtual void renderPart(UScene::TRenderPart rp) =0; + virtual void renderPart(UScene::TRenderPart rp, bool doHrcPass = true, bool doTrav = true, bool keepTrav = false) =0; /** End Part Rendering (commit model creation and deletion that were asked during rendering) */ - virtual void endPartRender(bool updateWaitingInstances = true, bool restoreMatrixContextAfterRender = true) =0; + virtual void endPartRender(bool updateWaitingInstances = true, bool restoreMatrixContextAfterRender = true, bool keepTrav = false) =0; /** Update waiting instances and igs that are loaded asynchronously diff --git a/code/nel/include/nel/3d/u_text_context.h b/code/nel/include/nel/3d/u_text_context.h index dcaa1949a..1056d3839 100644 --- a/code/nel/include/nel/3d/u_text_context.h +++ b/code/nel/include/nel/3d/u_text_context.h @@ -174,6 +174,15 @@ public: * \return the shade state */ virtual bool getShaded () const = 0; + /** + * set the shade states + * \param the shade state + */ + virtual void setShadeOutline (bool b) = 0; + /** + * \return the shade state + */ + virtual bool getShadeOutline () const = 0; /** * set the shadow's size * \param the shade extent diff --git a/code/nel/include/nel/georges/form_dfn.h b/code/nel/include/nel/georges/form_dfn.h index 283fd0fdd..a93dcbe48 100644 --- a/code/nel/include/nel/georges/form_dfn.h +++ b/code/nel/include/nel/georges/form_dfn.h @@ -87,6 +87,8 @@ public: // Set as a type void setType (CFormLoader &loader, const char *filename); + void setType (TEntryType type); + // Set as a dfn void setDfn (CFormLoader &loader, const char *filename); @@ -160,6 +162,10 @@ public: NLMISC::CSmartPtr Parent; }; + void addEntry( const std::string &name ); + + void removeEntry( uint idx ); + // ** IO functions void write (xmlDocPtr root, const char *filename); diff --git a/code/nel/include/nel/georges/form_elm.h b/code/nel/include/nel/georges/form_elm.h index 5453717a2..2d9e76630 100644 --- a/code/nel/include/nel/georges/form_elm.h +++ b/code/nel/include/nel/georges/form_elm.h @@ -440,21 +440,24 @@ public: // From UFormElm bool isAtom () const; - bool getValue (std::string &resultname, TEval evaluate) const; - bool getValue (sint8 &resultname, TEval evaluate) const; - bool getValue (uint8 &resultname, TEval evaluate) const; - bool getValue (sint16 &resultname, TEval evaluate) const; - bool getValue (uint16 &resultname, TEval evaluate) const; - bool getValue (sint32 &resultname, TEval evaluate) const; - bool getValue (uint32 &resultname, TEval evaluate) const; - bool getValue (float &resultname, TEval evaluate) const; - bool getValue (double &resultname, TEval evaluate) const; - bool getValue (bool &resultname, TEval evaluate) const; - bool getValue (NLMISC::CRGBA &resultname, TEval evaluate) const; + bool getValue (std::string &result, TEval evaluate) const; + bool getValue (sint8 &result, TEval evaluate) const; + bool getValue (uint8 &result, TEval evaluate) const; + bool getValue (sint16 &result, TEval evaluate) const; + bool getValue (uint16 &result, TEval evaluate) const; + bool getValue (sint32 &result, TEval evaluate) const; + bool getValue (uint32 &result, TEval evaluate) const; + bool getValue (float &result, TEval evaluate) const; + bool getValue (double &result, TEval evaluate) const; + bool getValue (bool &result, TEval evaluate) const; + bool getValue (NLMISC::CRGBA &result, TEval evaluate) const; // Set the value, the elt been used void setValue (const char *value); + // Get the raw value. Does not care about any parent or default values + void getValue (std::string &result) const; + private: // The value std::string Value; diff --git a/code/nel/include/nel/gui/action_handler.h b/code/nel/include/nel/gui/action_handler.h index 70c4b386e..48b49e451 100644 --- a/code/nel/include/nel/gui/action_handler.h +++ b/code/nel/include/nel/gui/action_handler.h @@ -68,6 +68,8 @@ namespace NLGUI return _GlobalInstance; } + void getActionHandlers( std::vector< std::string > &handlers ); + /// return pointer to action handler or null if it doesn't exist IActionHandler *getActionHandler(const std::string &name) const { diff --git a/code/nel/include/nel/gui/ctrl_base.h b/code/nel/include/nel/gui/ctrl_base.h index 28eeb2cd0..3b522e114 100644 --- a/code/nel/include/nel/gui/ctrl_base.h +++ b/code/nel/include/nel/gui/ctrl_base.h @@ -50,6 +50,8 @@ namespace NLGUI // see interface.txt for meaning of auto _ToolTipParentPosRef= Hotspot_TTAuto; _ToolTipPosRef= Hotspot_TTAuto; + _EventX = 0; + _EventY = 0; resizer = false; } @@ -70,6 +72,9 @@ namespace NLGUI bool handleEvent (const NLGUI::CEventDescriptor &event); + sint32 getEventX() { return _EventX; } + sint32 getEventY() { return _EventY; } + virtual CCtrlBase *getSubCtrl (sint32 /* x */, sint32 /* y */) { return this; } /// Debug @@ -171,7 +176,9 @@ namespace NLGUI THotSpot _ToolTipPosRefAlt : 6; protected: void convertTooltipHotSpot(const char *prop, THotSpot &parentHS, THotSpot &childHS); + void convertTooltipHotSpot(const char *prop, THotSpot &HS ); static std::string TooltipHotSpotToString( THotSpot parent, THotSpot child ); + static std::string TooltipHotSpotToString( THotSpot HS ); void mapAHString( const std::string &key, const std::string &value ); std::string getAHString( const std::string &key ) const; @@ -179,6 +186,9 @@ namespace NLGUI static std::map< std::string, std::map< std::string, std::string > > AHCache; bool resizer; + + sint32 _EventX; + sint32 _EventY; }; } diff --git a/code/nel/include/nel/gui/ctrl_text_button.h b/code/nel/include/nel/gui/ctrl_text_button.h index 183b6a65e..4f5251a8b 100644 --- a/code/nel/include/nel/gui/ctrl_text_button.h +++ b/code/nel/include/nel/gui/ctrl_text_button.h @@ -51,6 +51,7 @@ namespace NLGUI // Init part virtual bool parse (xmlNodePtr cur,CInterfaceGroup * parentGroup); + virtual void checkCoords(); virtual void updateCoords(); virtual uint32 getMemory() { return (uint32)(sizeof(*this)+_Id.size()); } @@ -126,6 +127,7 @@ namespace NLGUI void onRemoved(); void onWidgetDeleted( CInterfaceElement *e ); + void moveBy( sint32 x, sint32 y ); protected: diff --git a/code/nel/include/nel/gui/dbgroup_combo_box.h b/code/nel/include/nel/gui/dbgroup_combo_box.h index 75208b1e3..e7be1de4b 100644 --- a/code/nel/include/nel/gui/dbgroup_combo_box.h +++ b/code/nel/include/nel/gui/dbgroup_combo_box.h @@ -60,7 +60,7 @@ namespace NLGUI void setText(uint i, const ucstring &text); void insertText(uint i, const ucstring &text); const ucstring &getText(uint i) const; - const uint &getTextId(uint i) const; + uint getTextId(uint i) const; uint getTextPos(uint nId) const; const ucstring &getTexture(uint i) const; void removeText(uint nPos); diff --git a/code/nel/include/nel/gui/dbview_number.h b/code/nel/include/nel/gui/dbview_number.h index 2c76a255d..bfa963fb6 100644 --- a/code/nel/include/nel/gui/dbview_number.h +++ b/code/nel/include/nel/gui/dbview_number.h @@ -55,9 +55,7 @@ namespace NLGUI static void forceLink(); protected: - - sint64 getVal() { if (_Modulo == 0) return (_Number.getSInt64() / _Divisor); - else return (_Number.getSInt64() / _Divisor)%_Modulo; } + sint64 getVal(); protected: diff --git a/code/nel/include/nel/gui/editor_selection_watcher.h b/code/nel/include/nel/gui/editor_selection_watcher.h index 415f4f9db..7e262bdf1 100644 --- a/code/nel/include/nel/gui/editor_selection_watcher.h +++ b/code/nel/include/nel/gui/editor_selection_watcher.h @@ -15,6 +15,7 @@ // along with this program. If not, see . #include +#include namespace NLGUI { @@ -24,7 +25,7 @@ namespace NLGUI public: /// Notifies the watcher about the change - virtual void selectionChanged( std::string &newSelection ) = 0; + virtual void selectionChanged() = 0; }; } diff --git a/code/nel/include/nel/gui/group_editbox.h b/code/nel/include/nel/gui/group_editbox.h index 7ea2ab529..771bdc482 100644 --- a/code/nel/include/nel/gui/group_editbox.h +++ b/code/nel/include/nel/gui/group_editbox.h @@ -283,6 +283,10 @@ namespace NLGUI sint32 _ViewTextDeltaX; + CViewText* getVT() const{ return _ViewText; } + + void createViewText(); + private: void setupDisplayText(); void makeTopWindow(); diff --git a/code/nel/include/nel/gui/group_editbox_decor.h b/code/nel/include/nel/gui/group_editbox_decor.h new file mode 100644 index 000000000..975177612 --- /dev/null +++ b/code/nel/include/nel/gui/group_editbox_decor.h @@ -0,0 +1,53 @@ +// Ryzom - MMORPG Framework +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef GROUP_EDITBOX_DECOR +#define GROUP_EDITBOX_DECOR + +#include "nel/gui/group_editbox.h" + +namespace NLGUI +{ + /// Decorated CGroupEditBox + class CGroupEditBoxDecor : public CGroupEditBox + { + public: + DECLARE_UI_CLASS( CGroupEditBoxDecor ) + + CGroupEditBoxDecor( const TCtorParam ¶m ); + ~CGroupEditBoxDecor(); + + void moveBy( sint32 x, sint32 y ); + + void setIdRecurse( const std::string &newID ); + + std::string getProperty( const std::string &name ) const; + void setProperty( const std::string &name, const std::string &value ); + xmlNodePtr serialize( xmlNodePtr parentNode, const char *type ) const; + bool parse( xmlNodePtr cur, CInterfaceGroup *parent ); + void draw(); + void updateCoords(); + + static void forceLink(); + + private: + class EBDPrivate *_Pvt; + }; +} + +#endif + diff --git a/code/nel/include/nel/gui/group_html.h b/code/nel/include/nel/gui/group_html.h index 3f5526197..4f9bee46c 100644 --- a/code/nel/include/nel/gui/group_html.h +++ b/code/nel/include/nel/gui/group_html.h @@ -17,7 +17,6 @@ #ifndef CL_GROUP_HTML_H #define CL_GROUP_HTML_H -#define CURL_STATICLIB 1 #include #include "nel/misc/types_nl.h" @@ -107,7 +106,7 @@ namespace NLGUI void refresh(); // submit form - void submitForm (uint formId, const char *submitButtonName); + void submitForm (uint formId, const char *submitButtonType, const char *submitButtonName, const char *submitButtonValue, sint32 x, sint32 y); // Browse error void browseError (const char *msg); @@ -285,7 +284,7 @@ namespace NLGUI void addImage(const char *image, bool globalColor, bool reloadImg=false); // Add a text area in the current paragraph - CInterfaceGroup *addTextArea (const std::string &templateName, const char *name, uint rows, uint cols, bool multiLine, const ucstring &content); + CInterfaceGroup *addTextArea (const std::string &templateName, const char *name, uint rows, uint cols, bool multiLine, const ucstring &content, uint maxlength); // Add a combo box in the current paragraph CDBGroupComboBox *addComboBox(const std::string &templateName, const char *name); @@ -328,7 +327,11 @@ namespace NLGUI bool _BrowseNextTime; bool _PostNextTime; uint _PostFormId; + std::string _PostFormSubmitType; std::string _PostFormSubmitButton; + std::string _PostFormSubmitValue; + sint32 _PostFormSubmitX; + sint32 _PostFormSubmitY; // Browsing.. bool _Browsing; @@ -528,7 +531,7 @@ namespace NLGUI CCellParams () : BgColor(0,0,0,0) { Align = CGroupCell::Left; - VAlign = CGroupCell::Top; + VAlign = CGroupCell::Middle; LeftMargin = 0; NoWrap = false; } @@ -557,6 +560,7 @@ namespace NLGUI std::string _TextAreaName; uint _TextAreaRow; uint _TextAreaCols; + uint _TextAreaMaxLength; // current mode is in select option bool _SelectOption; diff --git a/code/nel/include/nel/gui/group_menu.h b/code/nel/include/nel/gui/group_menu.h index 56b9fb0e3..420967347 100644 --- a/code/nel/include/nel/gui/group_menu.h +++ b/code/nel/include/nel/gui/group_menu.h @@ -381,6 +381,7 @@ namespace NLGUI bool _CloseSubMenuUsingPopModal; bool _Shadow; + bool _ShadowOutline; bool _Formatted; uint8 _Space; sint32 _FontSize; diff --git a/code/nel/include/nel/gui/group_table.h b/code/nel/include/nel/gui/group_table.h index 60d3d9e63..746078908 100644 --- a/code/nel/include/nel/gui/group_table.h +++ b/code/nel/include/nel/gui/group_table.h @@ -78,6 +78,9 @@ namespace NLGUI // The Width you want in pixel. This is the parameter sint32 WidthWanted; + sint32 ColSpan; + sint32 RowSpan; + sint32 TableColumnIndex; // The min height of the cell sint32 Height; @@ -142,6 +145,7 @@ namespace NLGUI // Table borders sint32 Border; + NLMISC::CRGBA BorderColor; sint32 CellPadding; sint32 CellSpacing; @@ -191,13 +195,14 @@ namespace NLGUI WidthMax = 0; WidthWanted = 0; TableRatio = 0; - Height = 0; + RowSpan = 1; } sint32 Width; sint32 Height; sint32 WidthWanted; sint32 WidthMax; float TableRatio; + sint32 RowSpan; }; // Table row diff --git a/code/nel/include/nel/gui/interface_element.h b/code/nel/include/nel/gui/interface_element.h index 764d165ef..e2f9ffc87 100644 --- a/code/nel/include/nel/gui/interface_element.h +++ b/code/nel/include/nel/gui/interface_element.h @@ -117,6 +117,7 @@ namespace NLGUI editorSelected = false; serializable = true; + _EditorSelectable = true; } // dtor @@ -233,6 +234,9 @@ namespace NLGUI virtual void setActive (bool state); + void setXReal( sint32 x ){ _XReal = x; } + void setYReal( sint32 y ){ _YReal = y; } + void setX (sint32 x) { _X = x; } void setXAndInvalidateCoords (sint32 x) { _X = x; invalidateCoords(); } @@ -488,8 +492,12 @@ namespace NLGUI void setEditorSelected( bool b ){ editorSelected = b; } bool isEditorSelected() const{ return editorSelected; } + void parsePosParent( const std::string &id ); void setPosParent( const std::string &id ); + void getPosParent( std::string &id ) const; + void parseSizeParent( const std::string &id ); void setSizeParent( const std::string &id ); + void getSizeParent( std::string &id ) const; void setSerializable( bool b ){ serializable = b; } bool IsSerializable() const{ return serializable; } @@ -505,11 +513,35 @@ namespace NLGUI /// Called when the widget is deleted, /// so other widgets in the group can check if it belongs to them - virtual void onWidgetDeleted( CInterfaceElement *e ){} + virtual void onWidgetDeleted( CInterfaceElement *e ); + + /// Move the element by x in the X direction and y in the Y direction + // Uses real coordinates + virtual void moveBy( sint32 x, sint32 y ) + { + _XReal += x; + _YReal += y; + } + + /// Retrieves the coordinates of the specified hotspot + void getHSCoords( const THotSpot &hs, sint32 &x, sint32 &y ) const; + + /// Tells which hotspot is the closest to the specified element + void getClosestHotSpot( const CInterfaceElement *other, THotSpot &hs ); + + /// Aligns the element to the other element specified + void alignTo( CInterfaceElement *other ); + + /// Specifies if the widget can be selected in the editor + void setEditorSelectable( bool b ){ _EditorSelectable = b; } + + /// Tells if the widget can be selected in the editor + bool isEditorSelectable() const{ return _EditorSelectable; } protected: bool editorSelected; + bool _EditorSelectable; static bool editorMode; diff --git a/code/nel/include/nel/gui/widget_addition_watcher.h b/code/nel/include/nel/gui/interface_factory.h similarity index 81% rename from code/nel/include/nel/gui/widget_addition_watcher.h rename to code/nel/include/nel/gui/interface_factory.h index a2717e398..bd7f8352a 100644 --- a/code/nel/include/nel/gui/widget_addition_watcher.h +++ b/code/nel/include/nel/gui/interface_factory.h @@ -14,19 +14,22 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -#ifndef WIDGET_ADD_WATCHER -#define WIDGET_ADD_WATCHER +#ifndef IFACE_FACTORY +#define IFACE_FACTORY #include namespace NLGUI { - class IWidgetAdditionWatcher + class CViewBase; + + /// Simple interface element ( widget ) factory + class CInterfaceFactory { public: - virtual void widgetAdded( const std::string &name ) = 0; + static CViewBase* createClass( const std::string &name ); }; } -#endif +#endif diff --git a/code/nel/include/nel/gui/interface_group.h b/code/nel/include/nel/gui/interface_group.h index f72bc6f1f..b9efd3357 100644 --- a/code/nel/include/nel/gui/interface_group.h +++ b/code/nel/include/nel/gui/interface_group.h @@ -57,6 +57,7 @@ namespace NLGUI CInterfaceElement* findFromShortId(const std::string &id); /// Dynamic creation + virtual void addElement (CInterfaceElement *child, sint eltOrder = -1 ); virtual void addView (CViewBase *child , sint eltOrder = -1); virtual void addCtrl (CCtrlBase *child, sint eltOrder = -1); virtual void addGroup (CInterfaceGroup *child, sint eltOrder = -1); @@ -79,6 +80,9 @@ namespace NLGUI bool delElement (const std::string &id, bool noWarning=false); bool delElement (CInterfaceElement *pIE, bool noWarning=false); + // Take the element from the group, but don't delete it! + CInterfaceElement* takeElement( CInterfaceElement *e ); + uint getNumGroup() const { return (uint)_ChildrenGroups.size(); } CInterfaceGroup *getGroup(uint index) const; @@ -324,6 +328,17 @@ namespace NLGUI void onWidgetDeleted( CInterfaceElement *e ); + void moveBy( sint32 x, sint32 y ); + + // Blows up the group, moves it's children to it's parent + bool explode(); + + /// Adjusts the group's size so that all elements are fully inside the borders + void spanElements(); + + /// Aligns the elements - used for forming groups + void alignElements(); + protected: void makeNewClip (sint32 &oldClipX, sint32 &oldClipY, sint32 &oldClipW, sint32 &oldClipH); diff --git a/code/nel/include/nel/gui/interface_options.h b/code/nel/include/nel/gui/interface_options.h index f52b9479a..da0ea7de8 100644 --- a/code/nel/include/nel/gui/interface_options.h +++ b/code/nel/include/nel/gui/interface_options.h @@ -150,16 +150,17 @@ namespace NLGUI sint32 TxId_E_Open, W_E_Open, H_E_Open; sint32 TxId_M_Open, W_M_Open, H_M_Open; - sint32 TxId_TL_HighLight; - sint32 TxId_T_HighLight; - sint32 TxId_TR_HighLight; - sint32 TxId_L_HighLight; - sint32 TxId_R_HighLight; - sint32 TxId_BL_HighLight; - sint32 TxId_B_HighLight; - sint32 TxId_BR_HighLight; - - sint32 HeaderH; + sint32 TxId_TL_HighLight, W_TL_HighLight, H_TL_HighLight; + sint32 TxId_T_HighLight, W_T_HighLight, H_T_HighLight; + sint32 TxId_TR_HighLight, W_TR_HighLight, H_TR_HighLight; + sint32 TxId_L_HighLight, W_L_HighLight, H_L_HighLight; + sint32 TxId_R_HighLight, W_R_HighLight, H_R_HighLight; + sint32 TxId_BL_HighLight, W_BL_HighLight, H_BL_HighLight; + sint32 TxId_B_HighLight, W_B_HighLight, H_B_HighLight; + sint32 TxId_BR_HighLight, W_BR_HighLight, H_BR_HighLight; + + sint32 HeaderH; + sint32 InsetT; // Offset height of top texture }; // *************************************************************************** diff --git a/code/nel/include/nel/gui/interface_parser.h b/code/nel/include/nel/gui/interface_parser.h index 2bf1df9a8..18ec9045a 100644 --- a/code/nel/include/nel/gui/interface_parser.h +++ b/code/nel/include/nel/gui/interface_parser.h @@ -28,6 +28,7 @@ #include "nel/gui/proc.h" #include "nel/gui/widget_manager.h" #include "nel/gui/link_data.h" +#include "nel/gui/variable_data.h" namespace NLGUI { @@ -100,20 +101,6 @@ namespace NLGUI virtual void setupOptions() = 0; }; - - struct VariableData - { - std::string entry; - std::string type; - std::string value; - uint32 size; - - VariableData() - { - size = 0; - } - }; - CInterfaceParser(); virtual ~CInterfaceParser(); @@ -353,7 +340,15 @@ namespace NLGUI std::map< std::string, std::string > pointerSettings; std::map< std::string, std::map< std::string, std::string > > keySettings; + std::string _WorkDir; + public: + /// Sets the working directory, where files should be looked for + void setWorkDir( const std::string &workdir ){ _WorkDir = workdir; } + + /// Looks up a file in either the working directory or using CPath::lookup + std::string lookup( const std::string &file ); + void initLUA(); void uninitLUA(); bool isLuaInitialized() const{ return luaInitialized; } @@ -378,6 +373,7 @@ namespace NLGUI void setEditorMode( bool b ){ editorMode = b; } + void setVariable( const VariableData &v ); bool serializeVariables( xmlNodePtr parentNode ) const; bool serializeProcs( xmlNodePtr parentNode ) const; bool serializePointerSettings( xmlNodePtr parentNode ) const; diff --git a/code/nel/include/nel/gui/interface_property.h b/code/nel/include/nel/gui/interface_property.h index 63a62ef0e..4ed6e701e 100644 --- a/code/nel/include/nel/gui/interface_property.h +++ b/code/nel/include/nel/gui/interface_property.h @@ -47,6 +47,15 @@ namespace NLGUI _VolatileValue = NULL; } + /// Tells if this property has a value + bool hasValue() const + { + if( _VolatileValue != NULL ) + return true; + else + return false; + } + NLMISC::CCDBNodeLeaf* getNodePtr() const { return _VolatileValue; diff --git a/code/nel/include/nel/gui/libwww.h b/code/nel/include/nel/gui/libwww.h index 8da217382..bb6b2da86 100644 --- a/code/nel/include/nel/gui/libwww.h +++ b/code/nel/include/nel/gui/libwww.h @@ -25,6 +25,8 @@ extern "C" #include "WWWInit.h" } +#include "nel/misc/rgba.h" + namespace NLGUI { class CCtrlBaseButton; @@ -79,6 +81,7 @@ namespace NLGUI HTML_ATTR(TABLE,ALIGN) = 0, HTML_ATTR(TABLE,BGCOLOR), HTML_ATTR(TABLE,BORDER), + HTML_ATTR(TABLE,BORDERCOLOR), HTML_ATTR(TABLE,CELLPADDING), HTML_ATTR(TABLE,CELLSPACING), HTML_ATTR(TABLE,CLASS), @@ -189,6 +192,7 @@ namespace NLGUI HTML_ATTR(TEXTAREA,DISABLED), HTML_ATTR(TEXTAREA,ID), HTML_ATTR(TEXTAREA,LANG), + HTML_ATTR(TEXTAREA,MAXLENGTH), HTML_ATTR(TEXTAREA,NAME), HTML_ATTR(TEXTAREA,READONLY), HTML_ATTR(TEXTAREA,ROWS), diff --git a/code/nel/include/nel/gui/lua_object.h b/code/nel/include/nel/gui/lua_object.h index 1564df080..2360f1609 100644 --- a/code/nel/include/nel/gui/lua_object.h +++ b/code/nel/include/nel/gui/lua_object.h @@ -285,8 +285,7 @@ namespace NLGUI class CLuaHashMapTraits { public: - static const size_t bucket_size = 4; - static const size_t min_buckets = 8; + enum { bucket_size = 4, min_buckets = 8, }; CLuaHashMapTraits() {} diff --git a/code/nel/include/nel/gui/parser.h b/code/nel/include/nel/gui/parser.h index db868f70d..bc53e402d 100644 --- a/code/nel/include/nel/gui/parser.h +++ b/code/nel/include/nel/gui/parser.h @@ -23,6 +23,7 @@ #include "nel/misc/types_nl.h" #include "nel/gui/proc.h" #include "nel/gui/link_data.h" +#include "nel/gui/variable_data.h" namespace NLGUI { @@ -83,11 +84,13 @@ namespace NLGUI virtual void removeLinkData( uint32 id ) = 0; virtual bool getLinkData( uint32 id, SLinkData &linkData ) = 0; virtual void updateLinkData( uint32 id, const SLinkData &linkData ) = 0; + virtual void setVariable( const VariableData &v ) = 0; virtual bool serializeVariables( xmlNodePtr parentNode ) const = 0; virtual bool serializeProcs( xmlNodePtr parentNode ) const = 0; virtual bool serializePointerSettings( xmlNodePtr parentNode ) const = 0; virtual bool serializeKeySettings( xmlNodePtr parentNode ) const = 0; virtual CViewBase* createClass( const std::string &name ) = 0; + virtual void setWorkDir( const std::string &workdir ) = 0; }; } diff --git a/code/nel/tools/3d/tile_edit/PIC/readpic.h b/code/nel/include/nel/gui/root_group.h similarity index 61% rename from code/nel/tools/3d/tile_edit/PIC/readpic.h rename to code/nel/include/nel/gui/root_group.h index 614eba224..58963a3b2 100644 --- a/code/nel/tools/3d/tile_edit/PIC/readpic.h +++ b/code/nel/include/nel/gui/root_group.h @@ -14,27 +14,33 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -#ifndef _READPIC_H_ -#define _READPIC_H_ - -#ifdef _MSC_VER -#pragma warning(disable:4786) -#endif +#ifndef ROOT_GROUP_H +#define ROOT_GROUP_H #include -#include +#include -#include -#include +#include "nel/gui/interface_group.h" -//============================================================ -// API. -//============================================================ +namespace NLGUI +{ + class CRootGroup : public CInterfaceGroup + { + public: + CRootGroup(const TCtorParam ¶m); + virtual ~CRootGroup(); -bool PIC_LoadPic(std::string Path, std::vector &Tampon, uint &Width, uint &Height); + virtual CInterfaceElement* getElement (const std::string &id); + virtual void addGroup (CInterfaceGroup *child, sint eltOrder = -1); + virtual bool delGroup (CInterfaceGroup *child, bool dontDelete = false); + private: + std::map< std::string, CInterfaceGroup* > _Accel; + }; +} + +#endif -#endif \ No newline at end of file diff --git a/code/nel/include/nel/gui/variable_data.h b/code/nel/include/nel/gui/variable_data.h new file mode 100644 index 000000000..cffba2bce --- /dev/null +++ b/code/nel/include/nel/gui/variable_data.h @@ -0,0 +1,41 @@ +// Ryzom - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef VARIABLE_DATA_H +#define VARIABLE_DATA_H + +#include "nel/misc/types_nl.h" + +namespace NLGUI +{ + struct VariableData + { + std::string entry; + std::string type; + std::string value; + uint32 size; + + VariableData() + { + size = 0; + } + }; + +} + + +#endif + diff --git a/code/nel/include/nel/gui/view_pointer_base.h b/code/nel/include/nel/gui/view_pointer_base.h index f18f29239..e772d934f 100644 --- a/code/nel/include/nel/gui/view_pointer_base.h +++ b/code/nel/include/nel/gui/view_pointer_base.h @@ -53,12 +53,14 @@ namespace NLGUI bool show() const {return _PointerVisible;} void draw(){} - + /// set button state void setButtonState(NLMISC::TMouseButton state) { _Buttons = state; } /// get buttons state NLMISC::TMouseButton getButtonState() const { return _Buttons; } + static const sint32 InvalidCoord = 0x80000000; + protected: // (x,y) is from the TopLeft corner of the window sint32 _PointerX; // Current pointer position (raw, before snapping) diff --git a/code/nel/include/nel/gui/view_renderer.h b/code/nel/include/nel/gui/view_renderer.h index 83ac4457e..fe5dad405 100644 --- a/code/nel/include/nel/gui/view_renderer.h +++ b/code/nel/include/nel/gui/view_renderer.h @@ -286,6 +286,12 @@ namespace NLGUI */ void flush (); + /// Retrives a texture + bool getTexture( NLMISC::CBitmap &bm, const std::string &name ); + + /// Retrieve the texture names + void getTextureNames( std::vector< std::string > &textures ); + /** * get a texture file pointer from a string name. O(logN) * \param id : the id of the texture diff --git a/code/nel/include/nel/gui/view_text.h b/code/nel/include/nel/gui/view_text.h index df3cf27e3..d4377f38e 100644 --- a/code/nel/include/nel/gui/view_text.h +++ b/code/nel/include/nel/gui/view_text.h @@ -48,7 +48,7 @@ namespace NLGUI /// Constructor CViewText (const std::string& id, const std::string Text="", sint FontSize=12, - NLMISC::CRGBA Color=NLMISC::CRGBA(255,255,255), bool Shadow=false); + NLMISC::CRGBA Color=NLMISC::CRGBA(255,255,255), bool Shadow=false, bool ShadowOutline=false); virtual ~CViewText(); @@ -83,6 +83,7 @@ namespace NLGUI void setFontSize (sint nFontSize); void setColor (const NLMISC::CRGBA &color); void setShadow (bool bShadow); + void setShadowOutline (bool bShadowOutline); void setShadowColor (const NLMISC::CRGBA &color); void setLineMaxW (sint nMaxW, bool invalidate=true); void setMultiLine (bool bMultiLine); @@ -102,6 +103,7 @@ namespace NLGUI sint getFontSize() const; NLMISC::CRGBA getColor() { return _Color; } bool getShadow() { return _Shadow; } + bool getShadowOutline() { return _ShadowOutline; } NLMISC::CRGBA getShadowColor() { return _ShadowColor; } sint getLineMaxW() const { return _LineMaxW; } bool getMultiLine() const { return _MultiLine; } @@ -202,7 +204,11 @@ namespace NLGUI REFLECT_EXPORT_END - virtual void serial(NLMISC::IStream &f); + virtual void serial(NLMISC::IStream &f); + + // Sets the parent element + // See the comment at the field + void setParentElm( CInterfaceElement *parent ){ _ParentElm = parent; } protected: std::string _HardtextFormat; @@ -225,6 +231,7 @@ namespace NLGUI NLMISC::CRGBA _Color; /// the shadow mode bool _Shadow; + bool _ShadowOutline; /// the case mode TCaseMode _CaseMode; /// the text shadow color @@ -379,6 +386,9 @@ namespace NLGUI /// Dynamic tooltips std::vector _Tooltips; + // Parent element is the element where this text belongs to + // For example: text button + CInterfaceElement *_ParentElm; private: void setup (); diff --git a/code/nel/include/nel/gui/widget_manager.h b/code/nel/include/nel/gui/widget_manager.h index 5fd75ac8a..6d2336047 100644 --- a/code/nel/include/nel/gui/widget_manager.h +++ b/code/nel/include/nel/gui/widget_manager.h @@ -75,6 +75,16 @@ namespace NLGUI virtual void process() = 0; }; + // Interface for event handlers that can be called when widgets are added or moved + class IWidgetWatcher + { + public: + IWidgetWatcher(){} + virtual ~IWidgetWatcher(){} + virtual void onWidgetAdded( const std::string &name ) = 0; + virtual void onWidgetMoved( const std::string &oldid, const std::string &newid ) = 0; + }; + /// Frame render times struct SInterfaceTimes { @@ -332,7 +342,13 @@ namespace NLGUI void drawViews( NL3D::UCamera camera ); bool handleEvent( const CEventDescriptor &evnt ); - + + bool handleSystemEvent( const CEventDescriptor &evnt ); + + bool handleKeyboardEvent( const CEventDescriptor &evnt ); + + bool handleMouseEvent( const CEventDescriptor &evnt ); + bool handleMouseMoveEvent( const CEventDescriptor &eventDesc ); // Relative move of pointer @@ -487,17 +503,33 @@ namespace NLGUI IParser* getParser() const{ return parser; } - std::string& getCurrentEditorSelection(){ return currentEditorSelection; } - void setCurrentEditorSelection( const std::string &name ); + /// Retrieves the Id of the currently selected widgets + void getEditorSelection( std::vector< std::string > &selection ); + + /// Adds the widget with the specified Id to the selected widgets + void selectWidget( const std::string &name ); + + /// Clears the selection + void clearEditorSelection(); + void notifySelectionWatchers(); void registerSelectionWatcher( IEditorSelectionWatcher *watcher ); void unregisterSelectionWatcher( IEditorSelectionWatcher *watcher ); - - void notifyAdditionWatchers( const std::string &widgetName ); - void registerAdditionWatcher( IWidgetAdditionWatcher *watcher ); - void unregisterAdditionWatcher( IWidgetAdditionWatcher *watcher ); + + + void onWidgetAdded( const std::string &id ); + void onWidgetMoved( const std::string &oldid, const std::string &newid ); + void registerWidgetWatcher( IWidgetWatcher *watcher ); + void unregisterWidgetWatcher( IWidgetWatcher *watcher ); CInterfaceElement* addWidgetToGroup( std::string &group, std::string &widgetClass, std::string &widgetName ); + + void setGroupSelection( bool b ){ _GroupSelection = b; } + bool groupSelection(); + bool unGroupSelection(); + void setMultiSelection( bool b ){ multiSelection = b; } + + bool createNewGUI( const std::string &project, const std::string &window ); private: CWidgetManager(); @@ -526,6 +558,11 @@ namespace NLGUI NLMISC::CRefPtr< CViewBase > _CapturedView; + NLMISC::CRefPtr< CInterfaceElement > draggedElement; // the element that we're currently dragging + + bool startDragging(); + void stopDragging(); + // What is under pointer std::vector< CViewBase* > _ViewsUnderPointer; std::vector< CCtrlBase* > _CtrlsUnderPointer; @@ -583,10 +620,12 @@ namespace NLGUI std::vector< INewScreenSizeHandler* > newScreenSizeHandlers; std::vector< IOnWidgetsDrawnHandler* > onWidgetsDrawnHandlers; std::vector< IEditorSelectionWatcher* > selectionWatchers; - std::vector< IWidgetAdditionWatcher* > additionWatchers; + std::vector< IWidgetWatcher* > widgetWatchers; - - std::string currentEditorSelection; + std::vector< std::string > editorSelection; + bool _GroupSelection; + bool multiSelection; + uint32 _WidgetCount; }; } diff --git a/code/nel/include/nel/misc/app_context.h b/code/nel/include/nel/misc/app_context.h index 8bbf9499d..df9165baf 100644 --- a/code/nel/include/nel/misc/app_context.h +++ b/code/nel/include/nel/misc/app_context.h @@ -88,6 +88,8 @@ namespace NLMISC virtual void setNoAssert(bool noAssert) =0; virtual bool getAlreadyCreateSharedAmongThreads() =0; virtual void setAlreadyCreateSharedAmongThreads(bool b) =0; + virtual bool isWindowedApplication() = 0; + virtual void setWindowedApplication(bool b = true) = 0; //@} protected: /// Called by derived class to finalize initialisation of context @@ -131,6 +133,8 @@ namespace NLMISC virtual void setNoAssert(bool noAssert); virtual bool getAlreadyCreateSharedAmongThreads(); virtual void setAlreadyCreateSharedAmongThreads(bool b); + virtual bool isWindowedApplication(); + virtual void setWindowedApplication(bool b); private: /// Singleton registry @@ -147,7 +151,7 @@ namespace NLMISC bool DebugNeedAssert; bool NoAssert; bool AlreadyCreateSharedAmongThreads; - + bool WindowedApplication; }; /** This class implements the context interface for the a library module. @@ -184,6 +188,9 @@ namespace NLMISC virtual void setNoAssert(bool noAssert); virtual bool getAlreadyCreateSharedAmongThreads(); virtual void setAlreadyCreateSharedAmongThreads(bool b); + virtual bool isWindowedApplication(); + virtual void setWindowedApplication(bool b); + private: /// Pointer to the application context. INelContext *_ApplicationContext; diff --git a/code/nel/include/nel/misc/callback.h b/code/nel/include/nel/misc/callback.h new file mode 100644 index 000000000..ca5140f6f --- /dev/null +++ b/code/nel/include/nel/misc/callback.h @@ -0,0 +1,327 @@ +/* + +Copyright (c) 2009-2014, Jan BOON +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#ifndef NLMISC_CALLBACK_H +#define NLMISC_CALLBACK_H +#include + +// STL includes + +// NeL includes +#include + +// Project includes + +namespace NLMISC { + +#define NLMISC_CALLBACK_TEMPLATE \ +/** \ + * \brief NLMISC_CALLBACK_ARGS_CLASS \ + * \date 2009-03-03 18:09GMT \ + * \author Jan BOON \ + * Callback template \ + */ \ +template \ +class NLMISC_CALLBACK_ARGS_CLASS \ +{ \ + /* Very simple reference counting callback base */ \ + class CCallbackBase \ + { \ + public: \ + CCallbackBase() : m_RefCount(0) \ + { \ + \ + } \ + \ + virtual ~CCallbackBase() \ + { \ + nlassert(!m_RefCount); \ + } \ + \ + void refAdd() \ + { \ + ++m_RefCount; \ + } \ + \ + void refRemove() \ + { \ + --m_RefCount; \ + if (!m_RefCount) \ + delete this; \ + } \ + \ + virtual TReturn callback(NLMISC_CALLBACK_ARGS_DECL) = 0; \ + \ + virtual bool equals(const CCallbackBase *callbackBase) = 0; \ + \ + /* disable copy */ \ + CCallbackBase(const CCallbackBase &); \ + CCallbackBase &operator=(const CCallbackBase &); \ + \ + private: \ + uint m_RefCount; \ + }; \ + \ + typedef TReturn TCallbackFunction(NLMISC_CALLBACK_ARGS_DECL); \ + class CCallbackFunction : public CCallbackBase \ + { \ + public: \ + CCallbackFunction(TCallbackFunction *callbackFunction) : m_CallbackFunction(callbackFunction) \ + { \ + nlassert(m_CallbackFunction); \ + } \ + \ + virtual ~CCallbackFunction() \ + { \ + m_CallbackFunction = NULL; \ + } \ + \ + virtual TReturn callback(NLMISC_CALLBACK_ARGS_DECL) \ + { \ + return m_CallbackFunction(NLMISC_CALLBACK_ARGS_IMPL); \ + } \ + \ + virtual bool equals(const CCallbackBase *callbackBase) \ + { \ + const CCallbackFunction *callbackFunction = \ + dynamic_cast(callbackBase); \ + if (!callbackFunction) return false; \ + return m_CallbackFunction == callbackFunction->m_CallbackFunction; \ + } \ + \ + private: \ + TCallbackFunction *m_CallbackFunction; \ + }; \ + \ + template \ + class CCallbackMethod : public CCallbackBase \ + { \ + typedef TReturn (TClass::*TCallbackMethod)(NLMISC_CALLBACK_ARGS_DECL); \ + public: \ + CCallbackMethod(TClass *callbackObject, TCallbackMethod callbackMethod) : m_CallbackObject(callbackObject), m_CallbackMethod(callbackMethod) \ + { \ + nlassert(m_CallbackObject); \ + nlassert(m_CallbackMethod); \ + } \ + \ + virtual ~CCallbackMethod() \ + { \ + m_CallbackObject = NULL; \ + m_CallbackMethod = NULL; \ + } \ + \ + virtual TReturn callback(NLMISC_CALLBACK_ARGS_DECL) \ + { \ + return (m_CallbackObject->*m_CallbackMethod)(NLMISC_CALLBACK_ARGS_IMPL); \ + } \ + \ + virtual bool equals(const CCallbackBase *callbackBase) \ + { \ + const CCallbackMethod *callbackMethod = \ + dynamic_cast(callbackBase); \ + if (!callbackMethod) return false; \ + return m_CallbackObject == callbackMethod->m_CallbackObject \ + && m_CallbackMethod == callbackMethod->m_CallbackMethod; \ + } \ + \ + private: \ + TClass *m_CallbackObject; \ + TCallbackMethod m_CallbackMethod; \ + }; \ + \ +public: \ + CCallback() : m_CallbackBase(NULL) \ + { \ + \ + } \ + \ + CCallback(TCallbackFunction *callbackFunction) : m_CallbackBase(new CCallbackFunction(callbackFunction)) \ + { \ + nlassert(m_CallbackBase); \ + m_CallbackBase->refAdd(); \ + } \ + \ + template \ + CCallback(TClass *callbackObject, TReturn (TClass::*callbackMethod)(NLMISC_CALLBACK_ARGS_DECL)) : m_CallbackBase(new CCallbackMethod(callbackObject, callbackMethod)) \ + { \ + nlassert(m_CallbackBase); \ + m_CallbackBase->refAdd(); \ + } \ + \ + CCallback(const CCallback &callback) \ + { \ + m_CallbackBase = callback.m_CallbackBase; \ + if (m_CallbackBase) \ + m_CallbackBase->refAdd(); \ + } \ + \ + CCallback &operator=(const CCallback &callback) \ + { \ + if (m_CallbackBase != callback.m_CallbackBase) \ + { \ + if (m_CallbackBase) \ + m_CallbackBase->refRemove(); \ + m_CallbackBase = callback.m_CallbackBase; \ + if (m_CallbackBase) \ + m_CallbackBase->refAdd(); \ + } \ + return *this; \ + } \ + \ + ~CCallback() \ + { \ + if (m_CallbackBase) \ + { \ + m_CallbackBase->refRemove(); \ + m_CallbackBase = NULL; \ + } \ + } \ + \ + TReturn callback(NLMISC_CALLBACK_ARGS_DECL) \ + { \ + nlassert(m_CallbackBase); \ + return m_CallbackBase->callback(NLMISC_CALLBACK_ARGS_IMPL); \ + } \ + \ + TReturn operator()(NLMISC_CALLBACK_ARGS_DECL) \ + { \ + nlassert(m_CallbackBase); \ + return m_CallbackBase->callback(NLMISC_CALLBACK_ARGS_IMPL); \ + } \ + \ + bool valid() const \ + { \ + return m_CallbackBase != NULL; \ + } \ + \ + operator bool() const \ + { \ + return m_CallbackBase != NULL; \ + } \ + \ + bool operator==(const CCallback &callback) \ + { \ + return m_CallbackBase->equals(callback.m_CallbackBase); \ + } \ + \ +private: \ + CCallbackBase *m_CallbackBase; \ + \ +}; /* class CCallback */ \ + +template +class CCallback; + +#define NLMISC_CALLBACK_ARGS_CLASS CCallback +#define NLMISC_CALLBACK_ARGS_TYPENAME +#define NLMISC_CALLBACK_ARGS_DECL +#define NLMISC_CALLBACK_ARGS_IMPL +NLMISC_CALLBACK_TEMPLATE +#undef NLMISC_CALLBACK_ARGS_CLASS +#undef NLMISC_CALLBACK_ARGS_TYPENAME +#undef NLMISC_CALLBACK_ARGS_DECL +#undef NLMISC_CALLBACK_ARGS_IMPL + +#define NLMISC_CALLBACK_ARGS_CLASS CCallback +#define NLMISC_CALLBACK_ARGS_TYPENAME , typename TArgsA +#define NLMISC_CALLBACK_ARGS_DECL TArgsA argsA +#define NLMISC_CALLBACK_ARGS_IMPL argsA +NLMISC_CALLBACK_TEMPLATE +#undef NLMISC_CALLBACK_ARGS_CLASS +#undef NLMISC_CALLBACK_ARGS_TYPENAME +#undef NLMISC_CALLBACK_ARGS_DECL +#undef NLMISC_CALLBACK_ARGS_IMPL + +#define NLMISC_CALLBACK_ARGS_CLASS CCallback +#define NLMISC_CALLBACK_ARGS_TYPENAME , typename TArgsA, typename TArgsB +#define NLMISC_CALLBACK_ARGS_DECL TArgsA argsA, TArgsB argsB +#define NLMISC_CALLBACK_ARGS_IMPL argsA, argsB +NLMISC_CALLBACK_TEMPLATE +#undef NLMISC_CALLBACK_ARGS_CLASS +#undef NLMISC_CALLBACK_ARGS_TYPENAME +#undef NLMISC_CALLBACK_ARGS_DECL +#undef NLMISC_CALLBACK_ARGS_IMPL + +#define NLMISC_CALLBACK_ARGS_CLASS CCallback +#define NLMISC_CALLBACK_ARGS_TYPENAME , typename TArgsA, typename TArgsB, typename TArgsC +#define NLMISC_CALLBACK_ARGS_DECL TArgsA argsA, TArgsB argsB, TArgsC argsC +#define NLMISC_CALLBACK_ARGS_IMPL argsA, argsB, argsC +NLMISC_CALLBACK_TEMPLATE +#undef NLMISC_CALLBACK_ARGS_CLASS +#undef NLMISC_CALLBACK_ARGS_TYPENAME +#undef NLMISC_CALLBACK_ARGS_DECL +#undef NLMISC_CALLBACK_ARGS_IMPL + +#define NLMISC_CALLBACK_ARGS_CLASS CCallback +#define NLMISC_CALLBACK_ARGS_TYPENAME , typename TArgsA, typename TArgsB, typename TArgsC, typename TArgsD +#define NLMISC_CALLBACK_ARGS_DECL TArgsA argsA, TArgsB argsB, TArgsC argsC, TArgsD argsD +#define NLMISC_CALLBACK_ARGS_IMPL argsA, argsB, argsC, argsD +NLMISC_CALLBACK_TEMPLATE +#undef NLMISC_CALLBACK_ARGS_CLASS +#undef NLMISC_CALLBACK_ARGS_TYPENAME +#undef NLMISC_CALLBACK_ARGS_DECL +#undef NLMISC_CALLBACK_ARGS_IMPL + +#define NLMISC_CALLBACK_ARGS_CLASS CCallback +#define NLMISC_CALLBACK_ARGS_TYPENAME , typename TArgsA, typename TArgsB, typename TArgsC, typename TArgsD, typename TArgsE +#define NLMISC_CALLBACK_ARGS_DECL TArgsA argsA, TArgsB argsB, TArgsC argsC, TArgsD argsD, TArgsE argsE +#define NLMISC_CALLBACK_ARGS_IMPL argsA, argsB, argsC, argsD, argsE +NLMISC_CALLBACK_TEMPLATE +#undef NLMISC_CALLBACK_ARGS_CLASS +#undef NLMISC_CALLBACK_ARGS_TYPENAME +#undef NLMISC_CALLBACK_ARGS_DECL +#undef NLMISC_CALLBACK_ARGS_IMPL + +#define NLMISC_CALLBACK_ARGS_CLASS CCallback +#define NLMISC_CALLBACK_ARGS_TYPENAME , typename TArgsA, typename TArgsB, typename TArgsC, typename TArgsD, typename TArgsE, typename TArgsF +#define NLMISC_CALLBACK_ARGS_DECL TArgsA argsA, TArgsB argsB, TArgsC argsC, TArgsD argsD, TArgsE argsE, TArgsF argsF +#define NLMISC_CALLBACK_ARGS_IMPL argsA, argsB, argsC, argsD, argsE, argsF +NLMISC_CALLBACK_TEMPLATE +#undef NLMISC_CALLBACK_ARGS_CLASS +#undef NLMISC_CALLBACK_ARGS_TYPENAME +#undef NLMISC_CALLBACK_ARGS_DECL +#undef NLMISC_CALLBACK_ARGS_IMPL + +#define NLMISC_CALLBACK_ARGS_CLASS CCallback +#define NLMISC_CALLBACK_ARGS_TYPENAME , typename TArgsA, typename TArgsB, typename TArgsC, typename TArgsD, typename TArgsE, typename TArgsF, typename TArgsG +#define NLMISC_CALLBACK_ARGS_DECL TArgsA argsA, TArgsB argsB, TArgsC argsC, TArgsD argsD, TArgsE argsE, TArgsF argsF, TArgsG argsG +#define NLMISC_CALLBACK_ARGS_IMPL argsA, argsB, argsC, argsD, argsE, argsF, argsG +NLMISC_CALLBACK_TEMPLATE +#undef NLMISC_CALLBACK_ARGS_CLASS +#undef NLMISC_CALLBACK_ARGS_TYPENAME +#undef NLMISC_CALLBACK_ARGS_DECL +#undef NLMISC_CALLBACK_ARGS_IMPL +#undef NLMISC_CALLBACK_ARGS_CLASSNAME + +#undef NLMISC_CALLBACK_TEMPLATE + +} /* namespace NLMISC */ + +#endif /* #ifndef NLMISC_CALLBACK_H */ + +/* end of file */ diff --git a/code/nel/include/nel/misc/class_id.h b/code/nel/include/nel/misc/class_id.h index 10235bb6c..8b0cbd407 100644 --- a/code/nel/include/nel/misc/class_id.h +++ b/code/nel/include/nel/misc/class_id.h @@ -69,8 +69,7 @@ public: class CClassIdHashMapTraits { public: - static const size_t bucket_size = 4; - static const size_t min_buckets = 8; + enum { bucket_size = 4, min_buckets = 8, }; inline size_t operator() ( const CClassId& classId ) const { return ((((uint64)classId >> 32)|0xFFFFFFFF) ^ (((uint64)classId|0xFFFFFFFF) & 0xFFFFFFFF)); diff --git a/code/nel/include/nel/misc/common.h b/code/nel/include/nel/misc/common.h index 26458a540..c2a40cc0f 100644 --- a/code/nel/include/nel/misc/common.h +++ b/code/nel/include/nel/misc/common.h @@ -347,7 +347,7 @@ std::string formatThousands(const std::string& s); /// This function executes a program in the background and returns instantly (used for example to launch services in AES). /// The program will be launched in the current directory -bool launchProgram (const std::string &programName, const std::string &arguments); +bool launchProgram (const std::string &programName, const std::string &arguments, bool log = true); /// This function kills a program using his pid (on unix, it uses the kill() POSIX function) bool killProgram(uint32 pid); diff --git a/code/nel/include/nel/misc/debug.h b/code/nel/include/nel/misc/debug.h index 690d340a3..8d2483e4e 100644 --- a/code/nel/include/nel/misc/debug.h +++ b/code/nel/include/nel/misc/debug.h @@ -350,8 +350,10 @@ void setCrashAlreadyReported(bool state); */ // removed because we always check assert (even in release mode) #if defined (NL_OS_WINDOWS) && defined (NL_DEBUG) -#if defined (NL_OS_WINDOWS) -#define NLMISC_BREAKPOINT __debugbreak(); +#if defined(NL_OS_WINDOWS) +#define NLMISC_BREAKPOINT __debugbreak() +#elif defined(NL_OS_UNIX) && defined(NL_COMP_GCC) +#define NLMISC_BREAKPOINT __builtin_trap() #else #define NLMISC_BREAKPOINT abort() #endif diff --git a/code/nel/include/nel/misc/di_event_emitter.h b/code/nel/include/nel/misc/di_event_emitter.h deleted file mode 100644 index a2592e565..000000000 --- a/code/nel/include/nel/misc/di_event_emitter.h +++ /dev/null @@ -1,202 +0,0 @@ -// NeL - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// 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_DI_EVENT_EMITTER_H -#define NL_DI_EVENT_EMITTER_H - - - -#include "types_nl.h" - - -#ifdef NL_OS_WINDOWS - - -#define DIRECTINPUT_VERSION 0x0800 - -#include "input_device_server.h" -#include "input_device_manager.h" -#include "event_emitter.h" -#include "smart_ptr.h" -#include "events.h" -#include "rect.h" -#include "game_device.h" -#define NOMINMAX -#include -#include - - - -namespace NLMISC -{ - - -class CWinEventEmitter; -class CDIKeyboard; -class CDIMouse; -struct IMouseDevice; -struct IKeyboardDevice; - -// -struct EDirectInput : public EInputDevice -{ - EDirectInput(const char *reason) : EInputDevice(reason) {} -}; -// -struct EDirectInputLibNotFound : public EDirectInput -{ - EDirectInputLibNotFound() : EDirectInput("can't found the direct input dll") {} -}; -// -struct EDirectInputInitFailed : public EDirectInput -{ - EDirectInputInitFailed() : EDirectInput("Direct input initialization failed") {} -}; -// -struct EDirectInputCooperativeLevelFailed : public EDirectInput -{ - EDirectInputCooperativeLevelFailed() : EDirectInput("Direct Input Device Cooperative level couldn't be set") {} -}; - - -// Class to represent Direct Inputs events -struct CDIEvent : public IInputDeviceEvent -{ - virtual bool operator < (const IInputDeviceEvent &ide) const - { - // just compare the dates - return Datas.dwTimeStamp < (safe_cast(&ide))->Datas.dwTimeStamp; - } - DIDEVICEOBJECTDATA Datas; -}; - -/** - * This manage events by using DirectInput8. - * This should be polled regularly. - * This can be mixed with a CWinEmitter (for example, you may have mouse using direct input, and keyboard using standard messages) - * \author Nicolas Vizerie - * \author Nevrax France - * \date 2002 - */ -class CDIEventEmitter : public IEventEmitter, public IInputDeviceManager -{ -public: - /** Build a Direct Input Event Emitter object. An exception containing the reason is thrown if the initialization failed. - * The obtained object must be released by deleting it. - * \param hinst the instance of the application. - * \param hwnd the main window of the application. - * \param we A windows eventsemitter. Can be NULL. Needed if you want to mix WIN32 events and Direct Input events - * (for example, a Direct Input Mouse and a Win32 Keyboard) - */ - static CDIEventEmitter *create(HINSTANCE hinst, HWND hwnd, CWinEventEmitter *we); - ~CDIEventEmitter(); -public: - - /// This poll the direct input state, directly storing the result in the given server, or keeping the result in internal server if NULL. - void poll(CEventServer *server = NULL); - - ///\name From IDeviceManager, access to devices - //@{ - // Test if a mouse has been created (by a call to getMouseDeivce) - virtual bool isMouseCreated() { return _Mouse != NULL; } - /** Create the mouse device if needed (one active at a time for that object, repeated calls returns the same pointer) and get an interface on it. An exception if thrown if it couldn't be obtained. - * If this object has a pointer on a win32 emiter, Win32 mouse messages are replaced by this mouse messages. - */ - virtual IMouseDevice *getMouseDevice(bool hardware) throw(EInputDevice); - /// remove the direct input mouse - virtual void releaseMouse(); - /** Create the keyboard device if needed (one active at a time for that object, repeated calls returns the same pointer) and get an interface on it. - * If this object has a pointer on a win32 emiter, Win32 keyboard messages are replaced by this keyboard messages. - * NB: A direct input has no notion of localization or key combinations. See keyboard_device.h for more infos - */ - virtual IKeyboardDevice *getKeyboardDevice() throw(EInputDevice); - /// remove the direct input keyboard - virtual void releaseKeyboard(); - // Enumerates current game devices (gamepads, joystick etc.). The result is stored in the given vector - virtual void enumerateGameDevice(TDeviceDescVect &descs) throw(EInputDevice); - // Create the given game device from its instance name. It also means that it will begin to sends inputs - virtual IGameDevice *createGameDevice(const std::string &instanceName) throw(EInputDevice); - // Release the given game device - virtual void releaseGameDevice(IGameDevice *); - //@} - - /// from IEventEmitter - virtual void submitEvents(CEventServer &server, bool allWindows); - virtual void emulateMouseRawMode(bool enable); - - // Build a TMouseButton value from the current buttons state - TMouseButton buildButtonsFlags() const; - // Build a TMouseButton value (but with no mouse values) - TMouseButton buildKeyboardButtonFlags() const - { - return (TMouseButton) (buildButtonsFlags() & (ctrlButton|shiftButton|altButton)); - } - -//================================================================ -//================================================================ -//================================================================ -private: - typedef HRESULT (WINAPI * TPDirectInput8Create) (HINSTANCE hinst, DWORD dwVersion, REFIID riidltf, LPVOID* ppvOut, LPUNKNOWN punkOuter); - // Private internal server message, used to stored all messages internally before to dispatch them, when no server is supplied to poll(... - class CDIEventServer : CEventServer - { - friend class CDIEventEmitter; - public: - void setServer (CEventServer *server) - { - _Server = server; - } - private: - bool pumpEvent(CEvent *event) - { - CEventServer::pumpEvent(event); - _Server->postEvent (event); - return false; - } - private: - CEventServer *_Server; - }; -private: - HWND _hWnd; - TMouseButton _ButtonsFlags; - NLMISC::CRefPtr _WE; - static HMODULE _DirectInputLibHandle; - static TPDirectInput8Create _PDirectInput8Create; - static uint _NumCreatedInterfaces; -private: - static bool loadLib(); - static void unloadLib(); -//==== -private: - CDIEventServer _InternalServer; - CInputDeviceServer _DeviceServer; - IDirectInput8 *_DInput8; - CDIMouse *_Mouse; - CDIKeyboard *_Keyboard; -private: - CDIEventEmitter(HWND hwnd, CWinEventEmitter *we); -}; - - - -} // NLMISC - -#endif // NL_WINDOWS - - -#endif // NL_DX_EVENT_EMITTER_H - -/* End of dx_event_emitter.h */ diff --git a/code/nel/include/nel/misc/dummy_window.h b/code/nel/include/nel/misc/dummy_window.h index bd205f0a0..81ef078f9 100644 --- a/code/nel/include/nel/misc/dummy_window.h +++ b/code/nel/include/nel/misc/dummy_window.h @@ -22,6 +22,21 @@ #ifdef NL_OS_WINDOWS // for win32 os only +#ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +#endif +#ifndef _WIN32_WINDOWS +# define _WIN32_WINDOWS 0x0410 +#endif +#ifndef _WIN32_WINNT +# define _WIN32_WINNT 0x0400 +#endif +#ifndef WINVER +# define WINVER 0x0400 +#endif +#ifndef NOMINMAX +# define NOMINMAX +#endif #include diff --git a/code/nel/include/nel/misc/entity_id.h b/code/nel/include/nel/misc/entity_id.h index 027fe28c7..b4e40909e 100644 --- a/code/nel/include/nel/misc/entity_id.h +++ b/code/nel/include/nel/misc/entity_id.h @@ -575,8 +575,7 @@ public: // Traits for hash_map using CEntityId struct CEntityIdHashMapTraits { - static const size_t bucket_size = 4; - static const size_t min_buckets = 8; + enum { bucket_size = 4, min_buckets = 8, }; CEntityIdHashMapTraits() { } size_t operator() (const NLMISC::CEntityId &id ) const { diff --git a/code/nel/include/nel/misc/event_emitter.h b/code/nel/include/nel/misc/event_emitter.h index 224e5159f..eab005b82 100644 --- a/code/nel/include/nel/misc/event_emitter.h +++ b/code/nel/include/nel/misc/event_emitter.h @@ -49,19 +49,6 @@ public: * \param server */ virtual void submitEvents(CEventServer & server, bool allWindows) = 0; - - /** - * Instruct the event emitter to send CGDMouseMove instead of CEventMouseMove. - * - * On windows, the mouse device can be set into RawMode. Using this mode, - * CGDMouseMove events (only containing the raw movement delta) are emitted - * instead of the normal CEventMouseMove events (containing the mouse position). - * - * On Linux and Mac OS X, there is no MouseDevice implementation, all the - * events are created by the event emitter. So the event emitter has to - * emulate the mouse raw mode. - */ - virtual void emulateMouseRawMode(bool) = 0; }; diff --git a/code/nel/include/nel/misc/event_emitter_multi.h b/code/nel/include/nel/misc/event_emitter_multi.h index 3c6860e53..e41ee2055 100644 --- a/code/nel/include/nel/misc/event_emitter_multi.h +++ b/code/nel/include/nel/misc/event_emitter_multi.h @@ -47,7 +47,6 @@ public: const IEventEmitter *getEmitter(uint index) const; /// From IEventEmitter. This call submitEvents on all the emitters virtual void submitEvents(CEventServer &server, bool allWindows); - virtual void emulateMouseRawMode(bool enable); virtual bool copyTextToClipboard(const ucstring &text); virtual bool pasteTextFromClipboard(ucstring &text); diff --git a/code/nel/include/nel/misc/fixed_size_allocator.h b/code/nel/include/nel/misc/fixed_size_allocator.h index 9eb1d8a10..079c54bc0 100644 --- a/code/nel/include/nel/misc/fixed_size_allocator.h +++ b/code/nel/include/nel/misc/fixed_size_allocator.h @@ -53,7 +53,8 @@ public: uint getNumAllocatedBlocks() const { return _NumAlloc; } private: class CChunk; - class CNode + + class NL_ALIGN(NL_DEFAULT_MEMORY_ALIGNMENT) CNode { public: CChunk *Chunk; // the Chunk this node belongs to. diff --git a/code/nel/include/nel/misc/game_device.h b/code/nel/include/nel/misc/game_device.h deleted file mode 100644 index 605c4fb53..000000000 --- a/code/nel/include/nel/misc/game_device.h +++ /dev/null @@ -1,114 +0,0 @@ -// NeL - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// 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_GAME_DEVICE_H -#define NL_GAME_DEVICE_H - -#include "types_nl.h" -#include "input_device.h" -#include -#include - - -namespace NLMISC -{ - -/// Describe a game device -struct CGameDeviceDesc -{ - // type of the device - enum TDevType { GamePad, Joystick, DontKnow, DevTypeLast } DevType; - // Friendly name for the instance. For example, "Joystick 1." - std::string InstanceName; - // Friendly name for the product - std::string ProductName; - // Tells whether this device is connected - bool Connected; -}; - -// a list of game device description -typedef std::vector TDeviceDescVect; - -/// for devices comparison. The 'Connected' field is ignored. -inline bool operator == (const CGameDeviceDesc &lhs, const CGameDeviceDesc &rhs) -{ - return lhs.InstanceName == rhs.InstanceName && lhs.ProductName == rhs.ProductName; -} -// -inline bool operator != (const CGameDeviceDesc &lhs, const CGameDeviceDesc &rhs) -{ - return !(lhs == rhs); -} - - -/** - * This abstract a joystick or gamepad - * \author Nicolas Vizerie - * \author Nevrax France - * \date 2002 - */ -struct IGameDevice : public IInputDevice -{ - enum TAxis { XAxis = 0, YAxis, ZAxis, /* translation */ - RXAxis, RYAxis, RZAxis, /* rotations */ - MaxNumAxis - }; - - /// Get a general description of this device - virtual const CGameDeviceDesc &getDescription() const = 0; - - ///\name Controls presence - //@{ - // returns the number of buttons available on this game device - virtual uint getNumButtons() const = 0; - /** Check if the given axe is present on this game device - * NB : only absolute axis are managed - */ - virtual bool hasAxis(TAxis axis) const = 0; - // Check the number of sliders presents on this game device - virtual uint getNumSliders() const = 0; - // Check the number of point of views controls present on this game device - virtual uint getNumPOV() const = 0; - //@} - - ///\name Controls names. Must ensure that controls are present before calling these methods. - //@{ - virtual const char *getButtonName(uint index) const = 0; - virtual const char *getAxisName(TAxis axis) const = 0; - virtual const char *getSliderName(uint index) const = 0; - virtual const char *getPOVName(uint index) const = 0; - //@} - - ///\name Controls state. Must ensure that controls are present before calling these methods. - //@{ - // Return true if the given button is pushed. - virtual bool getButtonState(uint index) const = 0; - // Return a value in [-1, 1] for a translation axis, or an orientation. - virtual float getAxisValue(TAxis axis) const = 0; - // Return a value in [0, 1] - virtual float getSliderPos(uint index) const = 0; - // Return a CCW angle in degrees - virtual float getPOVAngle(uint index) const = 0; - //@} -}; - - -} // NLMISC - - -#endif // NL_GAME_DEVICE_H - -/* End of GAME_device.h */ diff --git a/code/nel/include/nel/misc/game_device_events.h b/code/nel/include/nel/misc/game_device_events.h deleted file mode 100644 index 6ddee4589..000000000 --- a/code/nel/include/nel/misc/game_device_events.h +++ /dev/null @@ -1,209 +0,0 @@ -// NeL - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// 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_GAME_DEVICE_EVENT_H -#define NL_GAME_DEVICE_EVENT_H - -#include "types_nl.h" -#include "events.h" -#include "game_device.h" - - - - -namespace NLMISC -{ - -struct IMouseDevice; -struct IGameDevice; - -const CClassId EventGDMouseMove(0x12142bc4, 0x43c73e74); -const CClassId EventGDButtonDownId(0x57141957, 0x3efb143a); -const CClassId EventGDButtonUpId(0x16105e06, 0x302536b2); -const CClassId EventGDAxisMovedId(0x073306, 0x41173626); -const CClassId EventGDSliderMovedId(0x68776586, 0x394a6916); -const CClassId EventGDPOVChanged(0x362851b9, 0x395c4d61); - - -//========================================================================================== -/// A raw mouse move message, expressed in mickeys (relative values) -class CGDMouseMove : public CEvent -{ -public: - IMouseDevice *MD; - sint X, Y; -public: - CGDMouseMove(IEventEmitter *emitter, IMouseDevice *md, sint x, sint y) : CEvent(emitter, EventGDMouseMove), MD(md), X(x), Y(y) - {} - - virtual CEvent *clone() const {return new CGDMouseMove(*this);} -}; - - -//========================================================================================== -/** - * An event from a game device (joystick, joypad ...) - */ -class CGameDeviceEvent : public CEvent -{ -public: - /// the game device this event come from - IGameDevice *GameDevice; -public: - CGameDeviceEvent( - IGameDevice *gameDevice, - IEventEmitter *emitter, - const CClassId &classId - ) - : CEvent(emitter, classId), - GameDevice(gameDevice) - {} -}; - - -//========================================================================================== -/** A button state has changed - */ -class CGDButton : public CGameDeviceEvent -{ -public: - // index of the buttons that has been pushed - uint ButtonIndex; - bool Pushed; -public: - /// - CGDButton( - uint buttonIndex, - bool pushed, - IGameDevice *gameDevice, - IEventEmitter *emitter, - const CClassId &classId - ) - : CGameDeviceEvent(gameDevice, emitter, classId), - ButtonIndex(buttonIndex), - Pushed(pushed) - {} -}; - - -//========================================================================================== -/** A button has been pushed - */ -class CGDButtonDown : public CGDButton -{ -public: - /// - CGDButtonDown(uint buttonIndex, IGameDevice *gameDevice, IEventEmitter *emitter) - : CGDButton(buttonIndex, true, gameDevice, emitter, EventGDButtonDownId) - {} - - virtual CEvent *clone() const {return new CGDButtonDown(*this);} -}; - -//========================================================================================== -/** A button has been released - */ -class CGDButtonUp : public CGDButton -{ -public: - /// - CGDButtonUp(uint buttonIndex, IGameDevice *gameDevice, IEventEmitter *emitter) - : CGDButton(buttonIndex, false, gameDevice, emitter, EventGDButtonUpId) - {} - - virtual CEvent *clone() const {return new CGDButtonUp(*this);} -}; - -//========================================================================================== -/// An axis has moved -class CGDAxisMoved : public CGameDeviceEvent -{ -public: - IGameDevice::TAxis Axis; - // current position of the axis, ranges from -1.f to 1.f - float Value; -public: - CGDAxisMoved( - IGameDevice::TAxis axis, - float value, - IGameDevice *gameDevice, - IEventEmitter *emitter - ) - : CGameDeviceEvent(gameDevice, emitter, EventGDAxisMovedId), - Axis(axis), - Value(value) - {} - - virtual CEvent *clone() const {return new CGDAxisMoved(*this);} -}; - - -//========================================================================================== -/// A slider position has changed -class CGDSliderMoved : public CGameDeviceEvent -{ -public: - uint SliderIndex; - // current position of the slider, ranges from 0.f to 1.f - float SliderPos; -public: - CGDSliderMoved( - float sliderPos, - uint sliderIndex, - IGameDevice *gameDevice, - IEventEmitter *emitter - ) - : CGameDeviceEvent(gameDevice, emitter, EventGDSliderMovedId), - SliderIndex(sliderIndex), - SliderPos(sliderPos) - {} - - virtual CEvent *clone() const {return new CGDSliderMoved(*this);} -}; - -//========================================================================================== -/// A point of view control changed -class CGDPOVChanged : public CGameDeviceEvent -{ -public: - uint POVIndex; - bool Centered; - // The POV angle, in degrees (CW) - float POVAngle; -public: - CGDPOVChanged( - bool centered, - float povAngle, - uint povIndex, - IGameDevice *gameDevice, - IEventEmitter *emitter - ) - : CGameDeviceEvent(gameDevice, emitter, EventGDPOVChanged), - POVIndex(povIndex), - Centered(centered), - POVAngle(povAngle) - {} - - virtual CEvent *clone() const {return new CGDPOVChanged(*this);} -}; - - -} // NLMISC - - -#endif // NL_GAME_DEVICE_EVENT_H - -/* End of game_device_event.h */ diff --git a/code/nel/include/nel/misc/gtk_displayer.h b/code/nel/include/nel/misc/gtk_displayer.h index 88dd3acc8..e2d35c83c 100644 --- a/code/nel/include/nel/misc/gtk_displayer.h +++ b/code/nel/include/nel/misc/gtk_displayer.h @@ -42,11 +42,7 @@ class CGtkDisplayer : public NLMISC::CWindowDisplayer { public: - CGtkDisplayer (const char *displayerName = "") : CWindowDisplayer(displayerName) - { - needSlashR = false; - createLabel ("@Clear|CLEAR"); - } + CGtkDisplayer (const char *displayerName = ""); virtual ~CGtkDisplayer (); diff --git a/code/nel/include/nel/misc/hierarchical_timer.h b/code/nel/include/nel/misc/hierarchical_timer.h index 10f9b461e..1c1818c69 100644 --- a/code/nel/include/nel/misc/hierarchical_timer.h +++ b/code/nel/include/nel/misc/hierarchical_timer.h @@ -74,7 +74,7 @@ namespace NLMISC { -#ifdef NL_OS_WINDOWS +#ifdef NL_COMP_VC // Visual C++ warning : ebp maybe modified # pragma warning(disable:4731) #endif diff --git a/code/nel/include/nel/misc/i_xml.h b/code/nel/include/nel/misc/i_xml.h index a9452e341..cf2527e21 100644 --- a/code/nel/include/nel/misc/i_xml.h +++ b/code/nel/include/nel/misc/i_xml.h @@ -232,6 +232,9 @@ private: // If not NULL, binary mode detected, use this stream in serials IStream *_BinaryStream; + + // System dependant structure for locale + void* _Locale; }; diff --git a/code/nel/include/nel/misc/input_device.h b/code/nel/include/nel/misc/input_device.h deleted file mode 100644 index b07a0128e..000000000 --- a/code/nel/include/nel/misc/input_device.h +++ /dev/null @@ -1,84 +0,0 @@ -// NeL - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// 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_INPUT_DEVICE_H -#define NL_INPUT_DEVICE_H - -#include "types_nl.h" - - -namespace NLMISC -{ - - -class CEventServer; -class CInputDeviceServer; -struct IInputDeviceEvent; - - -/** - * Base class that wrap to a device - * \author Nicolas Vizerie - * \author Nevrax France - * \date 2002 - */ - -struct IInputDevice -{ - /** Set the buffer size for this device (the number of samples it can retains). - * This return true if the size could be set - */ - virtual bool setBufferSize(uint size) = 0; - /// Get the buffer size for this device - virtual uint getBufferSize() const = 0; - - ///\name Device server specifics. You usually don't want to call these - //@{ - /** For device server usage : - * Called at the beginning of each events retrieval. - * If a device doesn't support buffered datas, the state changes can be directly send to the event server. - * The default does nothing. - */ - virtual void begin(CEventServer * /* server */) {} - - /** For device server usage : - * Poll all events from that device, and notify them to the given device server, so that they can be sorted between devices. - * This retrieves messages, but do not process them. - */ - virtual void poll(CInputDeviceServer *dev) = 0; - /** For device server usage : - * Process an event (eventually update this device state), and translate the message to a IEventServerMessage - */ - virtual void submit(IInputDeviceEvent *deviceEvent, CEventServer *server) = 0; - /** For device server usage : - * Says that the next message is for another device, or that it is the last message that will be received. - * This allow to pack several messages in one (for example, to sum up mouse moves until a click occurs) - * The default does nothing. - * The next message can be used to get a time stamp for example. It may be NULL is no next message is available - */ - virtual void transitionOccured(CEventServer * /* server */, const IInputDeviceEvent * /* nextMessage */) {} - //@} - - // dtor - virtual ~IInputDevice() {} -}; - -} // NLMISC - - -#endif // NL_INPUT_DEVICE_H - -/* End of input_device.h */ diff --git a/code/nel/include/nel/misc/input_device_manager.h b/code/nel/include/nel/misc/input_device_manager.h deleted file mode 100644 index a23437696..000000000 --- a/code/nel/include/nel/misc/input_device_manager.h +++ /dev/null @@ -1,69 +0,0 @@ -// NeL - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// 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_INPUT_DEVICE_MANAGER_H -#define NL_INPUT_DEVICE_MANAGER_H - -#include "types_nl.h" -#include "game_device.h" -#include "common.h" - -namespace NLMISC -{ - - -struct IMouseDevice; -struct IKeyboardDevice; - - - -struct EInputDevice : public Exception -{ - EInputDevice(const char *reason) : Exception(reason) {} -}; - - -/** Interface for objects that give low level access to devices (mouse, keyboard, joypads and joysticks). - * Generally an object implementing this interface will send the appropriate events when a device is 'created'. - * (Example of implementation : a direct input event emitter) - */ -struct IInputDeviceManager -{ - // Test if a mouse has been created (by a call to getMouseDeivce) - virtual bool isMouseCreated() = 0; - /// Create the low level mouse device if needed (one active at a time for that object, repeated calls returns the same pointer). An exception if thrown if it couldn't be obtained. - virtual IMouseDevice *getMouseDevice(bool hardware) throw(EInputDevice) = 0; - /// remove the low level mouse - virtual void releaseMouse() = 0; - /// Create the low level keyboard device if needed (one active at a time for that object, repeated calls returns the same pointer). An exception if thrown if it couldn't be obtained. - virtual IKeyboardDevice *getKeyboardDevice() throw(EInputDevice) = 0; - /// remove the low level keyboard - virtual void releaseKeyboard() = 0; - // Enumerates current game devices (gamepads, joystick etc.). The result is stored in the given vector - virtual void enumerateGameDevice(TDeviceDescVect &descs) throw(EInputDevice) = 0; - // Create the given game device interface from its instance name. It also means that it will begin to sends events. - virtual IGameDevice *createGameDevice(const std::string &instanceName) throw(EInputDevice) = 0; - // Release the given game device. - virtual void releaseGameDevice(IGameDevice *gd) = 0; -}; - - -} // NLMISC - - -#endif // NL_INPUT_DEVICE_MANAGER_H - -/* End of device_manager.h */ diff --git a/code/nel/include/nel/misc/input_device_server.h b/code/nel/include/nel/misc/input_device_server.h deleted file mode 100644 index 45c3db77d..000000000 --- a/code/nel/include/nel/misc/input_device_server.h +++ /dev/null @@ -1,84 +0,0 @@ -// NeL - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// 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_INPUT_DEVICE_SERVER_H -#define NL_INPUT_DEVICE_SERVER_H - -#include "types_nl.h" -#include - - -namespace NLMISC -{ - -class CEventServer; -struct IInputDevice; -struct IInputDeviceEvent; - - -/** Base class for an input device server. Unlike an event server, it manages several devices, and can sort their events (by date for example). - * It keeps a list of active devices. - * It can poll datas from every active device. - * It can sort devices messages to submit them in correct order to a CEventServer. - */ - -class CInputDeviceServer -{ -public: - /// register a device into this device server. - void registerDevice(IInputDevice *device); - /// remove a device from this server (but does not delete it). - void removeDevice(IInputDevice *device); - // returns the number of registered devices - uint getNumDevices() const { return (uint)_Devices.size(); } - // return a device - IInputDevice *getDevice(uint index) { return _Devices[index]; } - /// Test whether the given device is handled by this server. - bool isDevice(IInputDevice *device) const; - /// Retrieve datas from the devices, and submit them to the given CEventServer. - void poll(CEventServer *server); - /// Allow an input device to register an event. The event will then be deleted by this server - void submitEvent(IInputDeviceEvent *deviceEvent); - // dtor - virtual ~CInputDeviceServer() {} -private: - typedef std::vector TDeviceCont; - typedef std::vector TEventCont; -private: - TDeviceCont _Devices; - TEventCont _Events; -}; - - - - -/** An event from an input device. - */ -struct IInputDeviceEvent -{ - IInputDevice *Emitter; // the input device that emitted that event - // Used to sort events by time stamp. - virtual bool operator < (const IInputDeviceEvent &IInputDeviceEvent) const = 0; - virtual ~IInputDeviceEvent() {} -}; - - -} // NLMISC - - -#endif // NL_INPUT_DEVICE_SERVER_H - -/* End of input_device_server.h */ 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 f65767bce..c23a52412 100644 --- a/code/nel/include/nel/misc/inter_window_msg_queue.h +++ b/code/nel/include/nel/misc/inter_window_msg_queue.h @@ -27,6 +27,21 @@ #include "nel/misc/mem_stream.h" #include "nel/misc/dummy_window.h" +#ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +#endif +#ifndef _WIN32_WINDOWS +# define _WIN32_WINDOWS 0x0410 +#endif +#ifndef _WIN32_WINNT +# define _WIN32_WINNT 0x0400 +#endif +#ifndef WINVER +# define WINVER 0x0400 +#endif +#ifndef NOMINMAX +# define NOMINMAX +#endif #include namespace NLMISC @@ -220,7 +235,7 @@ private: static TOldWinProcMap _OldWinProcMap; - bool initInternal(HINSTANCE hInstance, HWND ownerWindow, uint32 localId, uint32 foreignId = NULL); + bool initInternal(HINSTANCE hInstance, HWND ownerWindow, uint32 localId, uint32 foreignId = 0); private: static LRESULT CALLBACK listenerProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); diff --git a/code/nel/include/nel/misc/keyboard_device.h b/code/nel/include/nel/misc/keyboard_device.h deleted file mode 100644 index bf3b2af8d..000000000 --- a/code/nel/include/nel/misc/keyboard_device.h +++ /dev/null @@ -1,63 +0,0 @@ -// NeL - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// 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_KEYBOARD_DEVICE_H -#define NL_KEYBOARD_DEVICE_H - -#include "types_nl.h" -#include "events.h" -#include "input_device.h" - - - -namespace NLMISC -{ - -/** Gives access to low level keyboard parameters - * - 'Shift' messages are replaced by RShift and LShift msg. - * - 'Control' messages are replaced by 'RControl' and 'LControl' msg. - * - 'Menu' (alternate) messages are replaced by 'RMenu' and 'LMenu' msg. - */ -struct IKeyboardDevice : public IInputDevice -{ - /// Max number of supported keys - enum { NumKeys = 256 }; - /// Get the delay before key repeat, in milliseconds - virtual uint getKeyRepeatDelay() const = 0; - /// Get the delay before key repeat, in milliseconds - virtual void setKeyRepeatDelay(uint delay) = 0; - /// Get the period before key repeat, in milliseconds - virtual uint getKeyRepeatPeriod() const = 0; - /// Get the period before key repeat, in milliseconds - virtual void setKeyRepeatPeriod(uint period) = 0; - /// Set a set of keys for which repetition is disabled - virtual void disableRepetition(const TKey *keyTab, uint numKey) = 0; - /// Get the number of disabled keys - virtual uint getNumDisabledRepetition() const = 0; - /** Get the disabled keys and stores in the given tab. - * NB: must ensure the destination table has the right size - * \see getNumDisabledKeys() - */ - virtual void getDisabledRepetitions(TKey *destTab) const = 0; -}; - - -} // NLMISC - - -#endif // NL_KEYBOARD_DEVICE_H - -/* End of keyboard_device.h */ diff --git a/code/nel/include/nel/misc/matrix.h b/code/nel/include/nel/misc/matrix.h index 700eb4a14..649d53324 100644 --- a/code/nel/include/nel/misc/matrix.h +++ b/code/nel/include/nel/misc/matrix.h @@ -53,7 +53,8 @@ class CPlane; * \author Nevrax France * \date 2000 */ -class CMatrix + +class NL_ALIGN_SSE2 CMatrix { public: /// Rotation Order. diff --git a/code/nel/include/nel/misc/mouse_device.h b/code/nel/include/nel/misc/mouse_device.h deleted file mode 100644 index 8ae181cdd..000000000 --- a/code/nel/include/nel/misc/mouse_device.h +++ /dev/null @@ -1,130 +0,0 @@ -// NeL - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// 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_MOUSE_DEVICE_H -#define NL_MOUSE_DEVICE_H - -#include "types_nl.h" -#include "input_device.h" - - - -namespace NLMISC -{ - -class CRect; - -/// An interface to a low level mouse device -struct IMouseDevice : public IInputDevice -{ - enum TAxisMode { Raw, Clamped, AxisModeLast }; - enum TAxis { XAxis = 0, YAxis = 1, AxisLast }; - enum TMessageMode { NormalMode, RawMode, MessageModeLast }; - - ///\name Messages - //@{ - /** Tells what messages should be sent : - * DEFAULT is 'raw' messages - * Raw messages : - no clamping nor frames applied - * - no speed applied - * - no factor applied - * - CGDMouseMove messages are sent - * - Move expressed in mickeys - * Normal messages : - CEventMouseMove messages are sent - * - A frame may clamp one or both axis - * - The mouse speed can be changed - */ - virtual void setMessagesMode(TMessageMode mode) = 0; - /// retrieve what kinds of messages are sent - virtual TMessageMode getMessagesMode() const = 0; - //@} - - ///\name Mouse MOVE, valid only - //@{ - /** Set the mode of axis of the mouse. This can be raw, or clamped. In clamped mode, a frame is used to limit the move. - * NB : invalid in raw message mode - * \see setMouseFrame(const CRect &rect) - */ - virtual void setMouseMode(TAxis axis, TAxisMode axisMode) = 0; - /** returns the mode of the mouse for the given axis. - * NB : invalid in raw message mode - */ - virtual TAxisMode getMouseMode(TAxis axis) const = 0; - /** Set the mouse speed. It must be in the ]0, +inf] range, 1 gives the natural mouse speed. - * NB : invalid in raw message mode - */ - virtual void setMouseSpeed(float speed) = 0; - /** Get the mouse speed. - * NB : invalid in raw message mode - */ - virtual float getMouseSpeed() const = 0; - /** Set the mouse acceleration. It is the threshold in mickey, when start the acceleration. 0 means not acceleration. - */ - virtual void setMouseAcceleration(uint speed) = 0; - /** Get the mouse acceleration. - */ - virtual uint getMouseAcceleration() const = 0; - /** Set the current frame in which the mouse can move, expressed in pixels. - * NB do not forget to call setMouseFactors if you want the results to be reported in the 0-1 range. - * NB : invalid in raw message mode. - * \see setMouseFactors - */ - virtual void setMouseFrame(const CRect &rect) = 0; - /** Gives factor by which the mouse coordinates must be multiplied before an event is sent. - * The default factor is 1. - * NB : invalid in raw message mode. - * - * Example : this set a frame of 800x600 and reports event in the [0, 1] range. - * \code - * mouse->setMouseFrame(800, 600); - * mouse->setMouseMode(XAxis, IMouseDevice::Clamped); - * mouse->setMouseMode(YAxis, IMouseDevice::Clamped); - * mouse->setFactors(1.f / 800, 1.f / 600); - * \endcode - */ - virtual void setFactors(float xFactor, float yFactor) = 0; - /** Get the x factor, use to multiply the mouse position before an event is sent. - * NB : invalid in raw message mode. - * \see setFactors() - */ - virtual float getXFactor() const = 0; - /** Get the y factor, use to multiply the mouse position before an event is sent. - * NB : invalid in raw message mode. - * \see setFactors() - */ - virtual float getYFactor() const = 0; - //@} - - // Get the current frame used for limiting mouse movements - virtual const CRect &getMouseFrame() const = 0; - // Set the maximum delay for a double click to be taken in account (in ms). - virtual void setDoubleClickDelay(uint ms) = 0; - // Get the maximum delay for double click (in ms) - virtual uint getDoubleClickDelay() const = 0; - // Force the position of the mouse, expressed in pixels - virtual void setMousePos(float x, float y) = 0; - - /// From a delta of a mouse position input (eg from CEventMouseMove), deduce delta in mickeys (eg: like received from a CGDMouseMove) - virtual void convertStdMouseMoveInMickeys(float &dx, float &dy) const = 0; -}; - - -} // NLMISC - - -#endif // NL_MOUSE_DEVICE_H - -/* End of u_mouse_device.h */ diff --git a/code/nel/include/nel/misc/mutex.h b/code/nel/include/nel/misc/mutex.h index adbc7e7e5..cb7e9a188 100644 --- a/code/nel/include/nel/misc/mutex.h +++ b/code/nel/include/nel/misc/mutex.h @@ -28,7 +28,11 @@ # endif #elif defined(NL_OS_UNIX) # include // PThread -# include // PThread POSIX semaphores +# ifdef NL_OS_MAC +# include +# else +# include // PThread POSIX semaphores +# endif # include # define __forceinline # ifdef NL_OS_MAC @@ -532,8 +536,10 @@ private: #ifdef NL_OS_WINDOWS TNelRtlCriticalSection _Cs; -#elif defined NL_OS_UNIX - sem_t _Sem; +#elif defined(NL_OS_MAC) + dispatch_semaphore_t _Sem; +#elif defined(NL_OS_UNIX) + sem_t _Sem; #else # error "No fair mutex implementation for this OS" #endif diff --git a/code/nel/include/nel/misc/o_xml.h b/code/nel/include/nel/misc/o_xml.h index 5933b7ebc..a532f0342 100644 --- a/code/nel/include/nel/misc/o_xml.h +++ b/code/nel/include/nel/misc/o_xml.h @@ -178,6 +178,9 @@ private: // Error message std::string _ErrorString; + + // System dependant structure for locale + void* _Locale; }; diff --git a/code/nel/include/nel/misc/object_vector.h b/code/nel/include/nel/misc/object_vector.h index a544a62b5..ea9be81e2 100644 --- a/code/nel/include/nel/misc/object_vector.h +++ b/code/nel/include/nel/misc/object_vector.h @@ -29,6 +29,12 @@ # endif // NLMISC_HEAP_ALLOCATION_NDEBUG #endif // NL_USE_DEFAULT_MEMORY_MANAGER +#ifndef NL_OV_USE_NEW_ALLOCATOR +# ifdef NL_HAS_SSE2 +# define NL_OV_USE_NEW_ALLOCATOR +# endif // NL_HAS_SSE2 +#endif // NL_OV_USE_NEW_ALLOCATOR + namespace NLMISC { diff --git a/code/nel/include/nel/misc/p_thread.h b/code/nel/include/nel/misc/p_thread.h index 4f0a9aa63..01f476d7b 100644 --- a/code/nel/include/nel/misc/p_thread.h +++ b/code/nel/include/nel/misc/p_thread.h @@ -39,9 +39,9 @@ class CPThread : public IThread public: enum TThreadState { - ThreadStateNone, - ThreadStateRunning, - ThreadStateFinished, + ThreadStateNone, + ThreadStateRunning, + ThreadStateFinished, }; /// Constructor diff --git a/code/nel/include/nel/misc/path.h b/code/nel/include/nel/misc/path.h index 73652a581..383a0553c 100644 --- a/code/nel/include/nel/misc/path.h +++ b/code/nel/include/nel/misc/path.h @@ -200,6 +200,10 @@ public: */ void getFileListByName(const std::string &extension, const std::string &name, std::vector &filenames); + /** Create a list of file having the requested string in the path and the requested extension. + */ + void getFileListByPath(const std::string &extension, const std::string &path, std::vector &filenames); + /** Make a path relative to another if possible, else doesn't change it. * \param basePath is the base path to be relative to. * \param relativePath is the path to make relative to basePath. @@ -339,7 +343,7 @@ public: /** Adds a search path. * The path is a directory "c:/temp" all files in the directory will be included (and recursively if asked) * - * Alternative directories are not pre-cached (instead of non Alternative files) and will used when a file is not found in the standard directories. + * Alternative directories are not pre-cached (instead of non Alternative files) and will be used when a file is not found in the standard directories. * For example, local data will be in the cached directories and server repository files will be in the Alternative files. If a new file is not * found in the local data, we'll try to find it on the repository. * @@ -492,6 +496,10 @@ public: */ static void getFileListByName(const std::string &extension, const std::string &name, std::vector &filenames); + /** Create a list of file having the requested string in the path and the requested extension + */ + static void getFileListByPath(const std::string &extension, const std::string &path, std::vector &filenames); + /** Make a path relative to another if possible, else doesn't change it. * \param basePath is the base path to be relative to. * \param relativePath is the path to make relative to basePath. @@ -499,6 +507,13 @@ public: */ static bool makePathRelative (const char *basePath, std::string &relativePath); + /** Make path absolute + * \param relativePath - The relative path + * \param directory - the directory to which the path is relative to + * returns the absolute path, or empty if something went wrong. + */ + static std::string makePathAbsolute (const std::string &relativePath, const std::string &directory ); + /** If File in this list is added more than one in an addSearchPath, it doesn't launch a warning. */ static void addIgnoredDoubleFile(const std::string &ignoredFile); diff --git a/code/nel/include/nel/misc/report.h b/code/nel/include/nel/misc/report.h index 11745b6e3..55a1c2dbf 100644 --- a/code/nel/include/nel/misc/report.h +++ b/code/nel/include/nel/misc/report.h @@ -21,25 +21,38 @@ namespace NLMISC { -/** Display a custom message box. +#if FINAL_VERSION +#define NL_REPORT_SYNCHRONOUS false +#define NL_REPORT_DEFAULT NLMISC::ReportAbort +#else +#define NL_REPORT_SYNCHRONOUS true +#define NL_REPORT_DEFAULT NLMISC::ReportBreak +#endif + +enum TReportResult +{ + // See also crash_report_widget.h EReturnValue + ReportAlwaysIgnore = 21, + ReportIgnore = 22, + ReportAbort = 23, + ReportBreak = 24 +}; + +/** Display a crash report * - * \param title set the title of the report. If empty, it'll display "NeL report". - * \param header message displayed before the edit text box. If empty, it displays the default message. - * \param body message displayed in the edit text box. This string will be sent by email. - * \param debugButton 0 for disabling it, 1 for enable with default behaviors (generate a breakpoint), 2 for enable with no behavior + * \param title set the title of the report. If empty, it'll display "NeL report" + * \param subject extended title of the report + * \param body message displayed in the edit text box. This string will be sent to the crash report tool + * \param attachment binary file to attach. This is a filename + * \param synchronous use system() and wait for the crash tool exit code, passes -dev flag; otherwise return defaultResult immediately + * \param sendReport hide 'dont send' button, or auto enable 'send report' checkbox * - * - * - * \return the button clicked or error + * \return the button clicked or defaultResult */ +TReportResult report(const std::string &title, const std::string &subject, const std::string &body, const std::string &attachment, bool synchronous, bool sendReport, TReportResult defaultResult); -enum TReportResult { ReportDebug, ReportIgnore, ReportQuit, ReportError }; - -TReportResult report (const std::string &title, const std::string &header, const std::string &subject, const std::string &body, bool enableCheckIgnore, uint debugButton, bool ignoreButton, sint quitButton, bool sendReportButton, bool &ignoreNextTime, const std::string &attachedFile = ""); - -/** call this in the main of your appli to enable email: setReportEmailFunction (sendEmail); - */ -void setReportEmailFunction (void *emailFunction); +/// Set the Url of the web service used to post crash reports to. String is copied +void setReportPostUrl(const char *postUrl); } // NLMISC diff --git a/code/nel/include/nel/misc/sheet_id.h b/code/nel/include/nel/misc/sheet_id.h index 869a61af6..b11e97188 100644 --- a/code/nel/include/nel/misc/sheet_id.h +++ b/code/nel/include/nel/misc/sheet_id.h @@ -248,8 +248,7 @@ private : class CSheetIdHashMapTraits { public: - static const size_t bucket_size = 4; - static const size_t min_buckets = 8; + enum { bucket_size = 4, min_buckets = 8, }; inline size_t operator() ( const CSheetId& sheetId ) const { return sheetId.asInt() >> 5; diff --git a/code/nel/include/nel/misc/sstring.h b/code/nel/include/nel/misc/sstring.h index fdeebcfc8..c9ebff721 100644 --- a/code/nel/include/nel/misc/sstring.h +++ b/code/nel/include/nel/misc/sstring.h @@ -937,21 +937,21 @@ inline CSString operator+(const CSString& s0,const CSString& s1) */ inline CSString operator+(char s0,const CSString& s1) { - return CSString(s0)+s1; + return CSString(s0) + s1.c_str(); } inline CSString operator+(const char* s0,const CSString& s1) { - return CSString(s0)+s1; + return CSString(s0) + s1.c_str(); } -#ifndef NL_COMP_VC10 +#if !defined(NL_COMP_VC) || (NL_COMP_VC_VERSION <= 100) // TODO: check if it can be disabled for other compilers too inline CSString operator+(const std::string& s0,const CSString& s1) { return s0+static_cast(s1); } -#endif // NL_COMP_VC10 +#endif } // NLMISC diff --git a/code/nel/include/nel/misc/string_common.h b/code/nel/include/nel/misc/string_common.h index 4a455247d..2d2a7e676 100644 --- a/code/nel/include/nel/misc/string_common.h +++ b/code/nel/include/nel/misc/string_common.h @@ -264,6 +264,40 @@ inline bool fromString(const std::string &str, bool &val) return true; } +inline bool fromString(const char *str, uint32 &val) { if (strstr(str, "-") != NULL) { val = 0; return false; } char *end; unsigned long v; errno = 0; v = strtoul(str, &end, 10); if (errno || v > UINT_MAX || end == str) { val = 0; return false; } else { val = (uint32)v; return true; } } +inline bool fromString(const char *str, sint32 &val) { char *end; long v; errno = 0; v = strtol(str, &end, 10); if (errno || v > INT_MAX || v < INT_MIN || end == str) { val = 0; return false; } else { val = (sint32)v; return true; } } +inline bool fromString(const char *str, uint8 &val) { char *end; long v; errno = 0; v = strtol(str, &end, 10); if (errno || v > UCHAR_MAX || v < 0 || end == str) { val = 0; return false; } else { val = (uint8)v; return true; } } +inline bool fromString(const char *str, sint8 &val) { char *end; long v; errno = 0; v = strtol(str, &end, 10); if (errno || v > SCHAR_MAX || v < SCHAR_MIN || end == str) { val = 0; return false; } else { val = (sint8)v; return true; } } +inline bool fromString(const char *str, uint16 &val) { char *end; long v; errno = 0; v = strtol(str, &end, 10); if (errno || v > USHRT_MAX || v < 0 || end == str) { val = 0; return false; } else { val = (uint16)v; return true; } } +inline bool fromString(const char *str, sint16 &val) { char *end; long v; errno = 0; v = strtol(str, &end, 10); if (errno || v > SHRT_MAX || v < SHRT_MIN || end == str) { val = 0; return false; } else { val = (sint16)v; return true; } } +inline bool fromString(const char *str, uint64 &val) { bool ret = sscanf(str, "%"NL_I64"u", &val) == 1; if (!ret) val = 0; return ret; } +inline bool fromString(const char *str, sint64 &val) { bool ret = sscanf(str, "%"NL_I64"d", &val) == 1; if (!ret) val = 0; return ret; } +inline bool fromString(const char *str, float &val) { bool ret = sscanf(str, "%f", &val) == 1; if (!ret) val = 0.0f; return ret; } +inline bool fromString(const char *str, double &val) { bool ret = sscanf(str, "%lf", &val) == 1; if (!ret) val = 0.0; return ret; } + +inline bool fromString(const char *str, bool &val) +{ + switch (str[0]) + { + case '1': + case 't': + case 'y': + case 'T': + case 'Y': + val = true; + return true; + case '0': + case 'f': + case 'n': + case 'F': + case 'N': + val = false; + return true; + } + + return false; +} + inline bool fromString(const std::string &str, std::string &val) { val = str; return true; } // stl vectors of bool use bit reference and not real bools, so define the operator for bit reference diff --git a/code/nel/include/nel/misc/string_mapper.h b/code/nel/include/nel/misc/string_mapper.h index 36a73ed4d..1f62dd123 100644 --- a/code/nel/include/nel/misc/string_mapper.h +++ b/code/nel/include/nel/misc/string_mapper.h @@ -39,8 +39,7 @@ typedef const std::string *TStringId; // Traits for hash_map using CStringId struct CStringIdHashMapTraits { - static const size_t bucket_size = 4; - static const size_t min_buckets = 8; + enum { bucket_size = 4, min_buckets = 8, }; CStringIdHashMapTraits() { } size_t operator() (const NLMISC::TStringId &stringId) const { diff --git a/code/nel/include/nel/misc/system_utils.h b/code/nel/include/nel/misc/system_utils.h index 9b3c5a971..78fd011c6 100644 --- a/code/nel/include/nel/misc/system_utils.h +++ b/code/nel/include/nel/misc/system_utils.h @@ -77,6 +77,10 @@ public: /// Get desktop current color depth without using UDriver. static uint getCurrentColorDepth(); + + /// Detect whether the current process is a windowed application. Return true if definitely yes, false if unknown + static bool detectWindowedApplication(); + }; } // NLMISC diff --git a/code/nel/include/nel/misc/types_nl.h b/code/nel/include/nel/misc/types_nl.h index 5c3b80475..2461cb5e6 100644 --- a/code/nel/include/nel/misc/types_nl.h +++ b/code/nel/include/nel/misc/types_nl.h @@ -53,7 +53,10 @@ # endif # ifdef _MSC_VER # define NL_COMP_VC -# if _MSC_VER >= 1700 +# if _MSC_VER >= 1800 +# define NL_COMP_VC12 +# define NL_COMP_VC_VERSION 120 +# elif _MSC_VER >= 1700 # define NL_COMP_VC11 # define NL_COMP_VC_VERSION 110 # elif _MSC_VER >= 1600 @@ -86,6 +89,10 @@ # define NL_COMP_VC_VERSION 60 # define NL_COMP_NEED_PARAM_ON_METHOD # endif +# elif defined(__MINGW32__) +# define NL_COMP_MINGW +# define NL_COMP_GCC +# define NL_NO_ASM # endif # if defined(_HAS_TR1) && (_HAS_TR1 + 0) // VC9 TR1 feature pack or later # define NL_ISO_STDTR1_AVAILABLE @@ -93,9 +100,13 @@ # define NL_ISO_STDTR1_NAMESPACE std::tr1 # endif # ifdef _DEBUG -# define NL_DEBUG +# ifndef NL_DEBUG +# define NL_DEBUG +# endif # elif defined (NDEBUG) -# define NL_RELEASE +# ifndef NL_RELEASE +# define NL_RELEASE +# endif # else # error "Don't know the compilation mode" # endif @@ -109,7 +120,9 @@ # define _WIN32_WINNT 0x0600 // force VISTA minimal version in 64 bits # endif // define NOMINMAX to be sure that windows includes will not define min max macros, but instead, use the stl template -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif #else # ifdef __APPLE__ # define NL_OS_MAC @@ -142,7 +155,7 @@ // // NL_ISO_TEMPLATE_SPEC can be used in front of an instanciated class-template member data definition, // because sometimes MSVC++ 6 produces an error C2908 with a definition with template <>. -#if defined(NL_OS_WINDOWS) || (defined(__GNUC__) && ((__GNUC__ < 3) || (__GNUC__ == 3 && __GNUC_MINOR__ <= 3))) +#if defined(NL_COMP_VC) || (defined(__GNUC__) && ((__GNUC__ < 3) || (__GNUC__ == 3 && __GNUC_MINOR__ <= 3))) # define NL_ISO_SYNTAX 0 # define NL_ISO_TEMPLATE_SPEC #else @@ -328,6 +341,61 @@ typedef unsigned int uint; // at least 32bits (depend of processor) #endif // NL_OS_UNIX + +// #ifdef NL_ENABLE_FORCE_INLINE +# ifdef NL_COMP_VC +# define NL_FORCE_INLINE __forceinline +# elif defined(NL_COMP_GCC) +# define NL_FORCE_INLINE inline __attribute__((always_inline)) +# else +# define NL_FORCE_INLINE inline +# endif +// #else +// # define NL_FORCE_INLINE inline +// #endif + + +#ifdef NL_COMP_VC +#define NL_ALIGN(nb) __declspec(align(nb)) +#else +#define NL_ALIGN(nb) __attribute__((aligned(nb))) +#endif + +#ifdef NL_OS_WINDOWS +#include +#include +#include +inline void *aligned_malloc(size_t size, size_t alignment) { return _aligned_malloc(size, alignment); } +inline void aligned_free(void *ptr) { _aligned_free(ptr); } +#elif defined(NL_OS_MAC) +// under Mac OS X, malloc is already aligned for SSE and Altivec (16 bytes alignment) +inline void *aligned_malloc(size_t size, size_t alignment) { return malloc(size); } +inline void aligned_free(void *ptr) { free(ptr); } +#else +#include +inline void *aligned_malloc(size_t size, size_t alignment) { return memalign(alignment, size); } +inline void aligned_free(void *ptr) { free(ptr); } +#endif /* NL_COMP_ */ + + +#ifdef NL_HAS_SSE2 + +#define NL_DEFAULT_MEMORY_ALIGNMENT 16 +#define NL_ALIGN_SSE2 NL_ALIGN(NL_DEFAULT_MEMORY_ALIGNMENT) + +extern void *operator new(size_t size) throw(std::bad_alloc); +extern void *operator new[](size_t size) throw(std::bad_alloc); +extern void operator delete(void *p) throw(); +extern void operator delete[](void *p) throw(); + +#else /* NL_HAS_SSE2 */ + +#define NL_DEFAULT_MEMORY_ALIGNMENT 4 +#define NL_ALIGN_SSE2 + +#endif /* NL_HAS_SSE2 */ + + // CHashMap, CHashSet and CHashMultiMap definitions #if defined(_STLPORT_VERSION) // STLport detected # include @@ -349,6 +417,12 @@ typedef unsigned int uint; // at least 32bits (depend of processor) # define CHashMap stdext::hash_map # define CHashSet stdext::hash_set # define CHashMultiMap stdext::hash_multimap +#elif defined(NL_COMP_VC) && (NL_COMP_VC_VERSION >= 120) +# include +# include +# define CHashMap ::std::hash_map +# define CHashSet ::std::hash_set +# define CHashMultiMap ::std::hash_multimap #elif defined(NL_COMP_GCC) // GCC4 # include # include @@ -388,8 +462,12 @@ typedef uint16 ucchar; // To define a 64bits constant; ie: UINT64_CONSTANT(0x123456781234) -#ifdef NL_OS_WINDOWS -# if defined(NL_COMP_VC) && (NL_COMP_VC_VERSION >= 80) +#ifdef NL_COMP_VC +# if (NL_COMP_VC_VERSION >= 120) +# define INT64_CONSTANT(c) (c##LL) +# define SINT64_CONSTANT(c) (c##LL) +# define UINT64_CONSTANT(c) (c##ULL) +# elif (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/ucstring.h b/code/nel/include/nel/misc/ucstring.h index e6d7544b1..88e599c1a 100644 --- a/code/nel/include/nel/misc/ucstring.h +++ b/code/nel/include/nel/misc/ucstring.h @@ -355,8 +355,7 @@ namespace NLMISC // Traits for hash_map using CEntityId struct CUCStringHashMapTraits { - static const size_t bucket_size = 4; - static const size_t min_buckets = 8; + enum { bucket_size = 4, min_buckets = 8, }; CUCStringHashMapTraits() { } size_t operator() (const ucstring &id ) const { diff --git a/code/nel/include/nel/misc/win_displayer.h b/code/nel/include/nel/misc/win_displayer.h index 0bd16fa40..f450055a9 100644 --- a/code/nel/include/nel/misc/win_displayer.h +++ b/code/nel/include/nel/misc/win_displayer.h @@ -21,8 +21,21 @@ #ifdef NL_OS_WINDOWS -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers -#define NOMINMAX +#ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +#endif +#ifndef _WIN32_WINDOWS +# define _WIN32_WINDOWS 0x0410 +#endif +#ifndef _WIN32_WINNT +# define _WIN32_WINNT 0x0400 +#endif +#ifndef WINVER +# define WINVER 0x0400 +#endif +#ifndef NOMINMAX +# define NOMINMAX +#endif #include #include "displayer.h" @@ -44,11 +57,7 @@ class CWinDisplayer : public NLMISC::CWindowDisplayer { public: - CWinDisplayer (const char *displayerName = "") : CWindowDisplayer(displayerName), Exit(false) - { - needSlashR = true; - createLabel ("@Clear|CLEAR"); - } + CWinDisplayer(const char *displayerName = ""); virtual ~CWinDisplayer (); diff --git a/code/nel/include/nel/misc/win_event_emitter.h b/code/nel/include/nel/misc/win_event_emitter.h index 756dfbaee..1b361485f 100644 --- a/code/nel/include/nel/misc/win_event_emitter.h +++ b/code/nel/include/nel/misc/win_event_emitter.h @@ -100,8 +100,6 @@ public: */ bool processMessage (HWND hWnd, uint32 msg, WPARAM wParam, LPARAM lParam, CEventServer *server=NULL); - void emulateMouseRawMode(bool enable); - private: CWinEventServer _InternalServer; HWND _HWnd; diff --git a/code/nel/include/nel/misc/xml_auto_ptr.h b/code/nel/include/nel/misc/xml_auto_ptr.h index eacde74da..8e0c3adb7 100644 --- a/code/nel/include/nel/misc/xml_auto_ptr.h +++ b/code/nel/include/nel/misc/xml_auto_ptr.h @@ -31,7 +31,7 @@ public: ~CXMLAutoPtr() { destroy(); } operator const char *() const { return _Value; } operator bool() const { return _Value != NULL; } - operator std::string() const { return std::string(_Value); } + inline std::string str() const { return _Value; } bool operator ! () const { return _Value == NULL; } operator const unsigned char *() const { return (const unsigned char *) _Value; } char operator * () const { nlassert(_Value); return *_Value; } diff --git a/code/nel/include/nel/net/buf_sock.h b/code/nel/include/nel/net/buf_sock.h index 947f6bff6..5a2f3c074 100644 --- a/code/nel/include/nel/net/buf_sock.h +++ b/code/nel/include/nel/net/buf_sock.h @@ -50,10 +50,10 @@ public: virtual ~CBufSock(); /// Sets the application identifier - void setAppId( uint64 id ) { _AppId = id; } + void setAppId( uintptr_t id ) { _AppId = id; } /// Returns the application identifier - uint64 appId() const { return _AppId; } + uintptr_t appId() const { return _AppId; } /// Returns a string with the characteristics of the object std::string asString() const; @@ -256,7 +256,7 @@ private: NLMISC::CObjectVector _ReadyToSendBuffer; TBlockSize _RTSBIndex; - uint64 _AppId; + uintptr_t _AppId; // Connected state (from the user's point of view, i.e. changed when the connection/disconnection event is at the front of the receive queue) bool _ConnectedState; diff --git a/code/nel/include/nel/net/service.h b/code/nel/include/nel/net/service.h index c74688799..8c7a52c63 100644 --- a/code/nel/include/nel/net/service.h +++ b/code/nel/include/nel/net/service.h @@ -218,13 +218,13 @@ public: static bool isServiceInitialized() { return _Instance != NULL; } /// Returns the current service short name (ie: TS) - const std::string &getServiceShortName () const { return _ShortName; }; + const std::string &getServiceShortName () const { return _ShortName; } /// Returns the current service long name (ie: test_serivce) - const std::string &getServiceLongName () const { return _LongName; }; + const std::string &getServiceLongName () const { return _LongName; } /// Returns the current service alias name setted by AES - const std::string &getServiceAliasName () const { return _AliasName; }; + const std::string &getServiceAliasName () const { return _AliasName; } /// Returns the current service unified name that is alias/short-id or short-id if alias is empty std::string getServiceUnifiedName () const; @@ -242,10 +242,10 @@ public: uint32 getLaunchingDate () const; /// Return true if this service don't use the NS (naming service) - bool getDontUseNS() const { return _DontUseNS; }; + bool getDontUseNS() const { return _DontUseNS; } /// Return true if this service don't use the AES (admin executor service) - bool getDontUseAES() const { return _DontUseAES; }; + bool getDontUseAES() const { return _DontUseAES; } /// Returns arguments of the program pass from the user to the program using parameters (ie: "myprog param1 param2") const NLMISC::CVectorSString &getArgs () const { return _Args; } diff --git a/code/nel/include/nel/sound/containers.h b/code/nel/include/nel/sound/containers.h index 63e134077..57387e91e 100644 --- a/code/nel/include/nel/sound/containers.h +++ b/code/nel/include/nel/sound/containers.h @@ -42,8 +42,7 @@ namespace NLSOUND { template struct THashPtr : public std::unary_function { - static const size_t bucket_size = 4; - static const size_t min_buckets = 8; + enum { bucket_size = 4, min_buckets = 8, }; size_t operator () (const Pointer &ptr) const { //CHashSet::hasher h; diff --git a/code/nel/include/nel/sound/context_sound.h b/code/nel/include/nel/sound/context_sound.h index 13683ac56..8424ee087 100644 --- a/code/nel/include/nel/sound/context_sound.h +++ b/code/nel/include/nel/sound/context_sound.h @@ -82,8 +82,7 @@ struct CContextMatcher struct CHash : public std::unary_function { - static const size_t bucket_size = 4; - static const size_t min_buckets = 8; + enum { bucket_size = 4, min_buckets = 8, }; size_t operator () (const CContextMatcher &patternMatcher) const { return patternMatcher.getHashValue(); diff --git a/code/nel/samples/3d/cegui/NeLDriver.h b/code/nel/samples/3d/cegui/NeLDriver.h index 7f73d0cd0..1dd867536 100644 --- a/code/nel/samples/3d/cegui/NeLDriver.h +++ b/code/nel/samples/3d/cegui/NeLDriver.h @@ -34,8 +34,8 @@ extern uint16 gScreenHeight; class NeLDriver { public: - NeLDriver(NL3D::UDriver *driver) { m_Driver=driver; } - virtual ~NeLDriver() { ; } + NeLDriver(NL3D::UDriver *driver):m_Driver(driver), m_TextContext(NULL), m_Scene(NULL) { } + virtual ~NeLDriver() { } void init(); void update(); diff --git a/code/nel/samples/3d/cluster_viewer/main.cpp b/code/nel/samples/3d/cluster_viewer/main.cpp index e48ad3528..d7956adbe 100644 --- a/code/nel/samples/3d/cluster_viewer/main.cpp +++ b/code/nel/samples/3d/cluster_viewer/main.cpp @@ -38,7 +38,9 @@ #include "nel/3d/event_mouse_listener.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #endif // NL_OS_WINDOWS @@ -360,7 +362,7 @@ int main() } ++itAcc; } - if ((vCluster.size() == 0) && (DispCS[0].pIG == pCurIG)) + if (vCluster.empty() && (DispCS[0].pIG == pCurIG)) { vCluster.push_back (pClipTrav->RootCluster); } diff --git a/code/nel/samples/3d/font/main.cpp b/code/nel/samples/3d/font/main.cpp index df6cebdde..b4b5cc3c9 100644 --- a/code/nel/samples/3d/font/main.cpp +++ b/code/nel/samples/3d/font/main.cpp @@ -30,7 +30,9 @@ #include "nel/3d/driver_user.h" #ifdef NL_OS_WINDOWS - #define NOMINMAX + #ifndef NL_COMP_MINGW + #define NOMINMAX + #endif #include #endif // NL_OS_WINDOWS diff --git a/code/nel/samples/3d/nel_qt/configuration.cpp b/code/nel/samples/3d/nel_qt/configuration.cpp index f35502a67..9bbe62736 100644 --- a/code/nel/samples/3d/nel_qt/configuration.cpp +++ b/code/nel/samples/3d/nel_qt/configuration.cpp @@ -47,7 +47,7 @@ CConfiguration::~CConfiguration() void CConfiguration::init() { // verify data - nlassert(!m_ConfigCallbacks.size()); + nlassert(m_ConfigCallbacks.empty()); // load config m_ConfigFile.load(NLQT_CONFIG_FILE); diff --git a/code/nel/samples/3d/nel_qt/qtcolorpicker_cpp.h b/code/nel/samples/3d/nel_qt/qtcolorpicker_cpp.h index b143f9f3c..2386ff939 100644 --- a/code/nel/samples/3d/nel_qt/qtcolorpicker_cpp.h +++ b/code/nel/samples/3d/nel_qt/qtcolorpicker_cpp.h @@ -543,14 +543,17 @@ ColorPickerPopup::ColorPickerPopup(int width, bool withColorDialog, setMouseTracking(true); cols = width; - if (withColorDialog) { - moreButton = new ColorPickerButton(this); - moreButton->setFixedWidth(24); - moreButton->setFixedHeight(21); - moreButton->setFrameRect(QRect(2, 2, 20, 17)); - connect(moreButton, SIGNAL(clicked()), SLOT(getColorFromDialog())); - } else { - moreButton = 0; + if (withColorDialog) + { + moreButton = new ColorPickerButton(this); + moreButton->setFixedWidth(24); + moreButton->setFixedHeight(21); + moreButton->setFrameRect(QRect(2, 2, 20, 17)); + connect(moreButton, SIGNAL(clicked()), SLOT(getColorFromDialog())); + } + else + { + moreButton = 0; } eventLoop = 0; @@ -1059,15 +1062,20 @@ void ColorPickerButton::mouseReleaseEvent(QMouseEvent *) void ColorPickerButton::keyPressEvent(QKeyEvent *e) { if (e->key() == Qt::Key_Up - || e->key() == Qt::Key_Down - || e->key() == Qt::Key_Left - || e->key() == Qt::Key_Right) { - qApp->sendEvent(parent(), e); - } else if (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Space || e->key() == Qt::Key_Return) { - setFrameShadow(Sunken); - update(); - } else { - QFrame::keyPressEvent(e); + || e->key() == Qt::Key_Down + || e->key() == Qt::Key_Left + || e->key() == Qt::Key_Right) + { + qApp->sendEvent(parent(), e); + } + else if (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Space || e->key() == Qt::Key_Return) + { + setFrameShadow(Sunken); + update(); + } + else + { + QFrame::keyPressEvent(e); } } @@ -1077,16 +1085,21 @@ void ColorPickerButton::keyPressEvent(QKeyEvent *e) void ColorPickerButton::keyReleaseEvent(QKeyEvent *e) { if (e->key() == Qt::Key_Up - || e->key() == Qt::Key_Down - || e->key() == Qt::Key_Left - || e->key() == Qt::Key_Right) { - qApp->sendEvent(parent(), e); - } else if (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Space || e->key() == Qt::Key_Return) { - setFrameShadow(Raised); - repaint(); - emit clicked(); - } else { - QFrame::keyReleaseEvent(e); + || e->key() == Qt::Key_Down + || e->key() == Qt::Key_Left + || e->key() == Qt::Key_Right) + { + qApp->sendEvent(parent(), e); + } + else if (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Space || e->key() == Qt::Key_Return) + { + setFrameShadow(Raised); + repaint(); + emit clicked(); + } + else + { + QFrame::keyReleaseEvent(e); } } diff --git a/code/nel/samples/3d/shape_viewer/main.cpp b/code/nel/samples/3d/shape_viewer/main.cpp index 6127b7207..d1bd4825f 100644 --- a/code/nel/samples/3d/shape_viewer/main.cpp +++ b/code/nel/samples/3d/shape_viewer/main.cpp @@ -29,7 +29,9 @@ #include #ifdef NL_OS_WINDOWS - #define NOMINMAX + #ifndef NL_COMP_MINGW + #define NOMINMAX + #endif #include #endif // NL_OS_WINDOWS diff --git a/code/nel/samples/misc/CMakeLists.txt b/code/nel/samples/misc/CMakeLists.txt index 753b418ae..d00a54952 100644 --- a/code/nel/samples/misc/CMakeLists.txt +++ b/code/nel/samples/misc/CMakeLists.txt @@ -1,3 +1,4 @@ +ADD_SUBDIRECTORY(callback) ADD_SUBDIRECTORY(command) ADD_SUBDIRECTORY(configfile) ADD_SUBDIRECTORY(debug) diff --git a/code/nel/samples/misc/callback/CMakeLists.txt b/code/nel/samples/misc/callback/CMakeLists.txt new file mode 100644 index 000000000..62626b0a7 --- /dev/null +++ b/code/nel/samples/misc/callback/CMakeLists.txt @@ -0,0 +1,9 @@ +FILE(GLOB SRC *.cpp) + +ADD_EXECUTABLE(nl_sample_callback ${SRC}) + +TARGET_LINK_LIBRARIES(nl_sample_callback nelmisc) +NL_DEFAULT_PROPS(nl_sample_callback "NeL, Samples, Misc: Callback") +NL_ADD_RUNTIME_FLAGS(nl_sample_callback) + +INSTALL(TARGETS nl_sample_callback RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT samplesmisc) diff --git a/code/nel/samples/misc/callback/main.cpp b/code/nel/samples/misc/callback/main.cpp new file mode 100644 index 000000000..157f3b259 --- /dev/null +++ b/code/nel/samples/misc/callback/main.cpp @@ -0,0 +1,62 @@ +/* + +Copyright (c) 2014, Jan BOON +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#include +#include + +class CTestClass +{ +public: + void helloWorld(int y) + { + nldebug("Method call: %i, %i", y, x); + } + int x; +}; + +void functionCall(int i) +{ + nldebug("Function call: %i", i); +} + +typedef NLMISC::CCallback TCallbackType; + +int main(int argc, char **argv) +{ + CTestClass tc; + tc.x = 42; + + TCallbackType cbMethod = TCallbackType(&tc, &CTestClass::helloWorld); + TCallbackType cbFunction = TCallbackType(functionCall); + cbMethod(100); + cbFunction(99); + + getchar(); + + return EXIT_SUCCESS; +} diff --git a/code/nel/samples/misc/debug/main.cpp b/code/nel/samples/misc/debug/main.cpp index 6ee31754f..5850cb2b3 100644 --- a/code/nel/samples/misc/debug/main.cpp +++ b/code/nel/samples/misc/debug/main.cpp @@ -18,11 +18,16 @@ #include // contains all debug features -#include "nel/misc/debug.h" +#include +#include -using namespace NLMISC; +void repeatederror() +{ + // hit always ignore to surpress this error for the duration of the program + nlassert(false && "hit always ignore"); +} -int main (int /* argc */, char ** /* argv */) +int main(int /* argc */, char ** /* argv */) { // all debug functions have different behaviors in debug and in release mode. // in general, in debug mode, all debug functions are active, they display @@ -36,20 +41,24 @@ int main (int /* argc */, char ** /* argv */) // in release mode, this function does nothing by default. you have to add a displayer // manually, or put true in the parameter to say to the function that you want it to // add the default displayers - createDebug (); + NLMISC::createDebug(); + + // enable the crash report tool + NLMISC::INelContext::getInstance().setWindowedApplication(true); + NLMISC::setReportPostUrl("http://ryzomcore.org/crash_report/"); // display debug information, that will be skipped in release mode. - nldebug ("nldebug() %d", 1); + nldebug("nldebug() %d", 1); // display the string - nlinfo ("nlinfo() %d", 2); + nlinfo("nlinfo() %d", 2); // when something not normal, but that the program can manage, occurs, call nlwarning() - nlwarning ("nlwarning() %d", 3); + nlwarning("nlwarning() %d", 3); // nlassert() is like assert but do more powerful things. in release mode, the test is // not executed and nothing will happen. (Press F5 in Visual C++ to continue the execution) - nlassert (true == false); + nlassert(true == false); // in a switch case or when you want that the program never executes a part of code, use stop. // in release, nlstop does nothing. in debug mode, @@ -61,16 +70,20 @@ int main (int /* argc */, char ** /* argv */) // occurs. (In Visual C++ press F5 to continue) try { - nlerror ("nlerror() %d", 4); + nlerror("nlerror() %d", 4); } - catch(const EFatalError &) + catch (const NLMISC::EFatalError &) { // just continue... - nlinfo ("nlerror() generated an EFatalError exception, just ignore it"); + nlinfo("nlerror() generated an EFatalError exception, just ignore it"); } + // keep repeating the same error + for (int i = 0; i < 32; ++i) + repeatederror(); + printf("\nPress to exit\n"); - getchar (); + getchar(); return EXIT_SUCCESS; } diff --git a/code/nel/samples/net/chat/kbhit.cpp b/code/nel/samples/net/chat/kbhit.cpp index b463d4566..177fd1d29 100644 --- a/code/nel/samples/net/chat/kbhit.cpp +++ b/code/nel/samples/net/chat/kbhit.cpp @@ -14,7 +14,9 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -#ifdef __GNUC__ +#include "nel/misc/types_nl.h" + +#ifndef NL_OS_WINDOWS #include "kbhit.h" #include #include // for read() diff --git a/code/nel/samples/net/chat/server.cpp b/code/nel/samples/net/chat/server.cpp index c3976d857..9b85b65e5 100644 --- a/code/nel/samples/net/chat/server.cpp +++ b/code/nel/samples/net/chat/server.cpp @@ -24,7 +24,9 @@ #include "nel/net/callback_server.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #endif // NL_OS_WINDOWS diff --git a/code/nel/samples/net/class_transport/ai_service.cpp b/code/nel/samples/net/class_transport/ai_service.cpp index 9be3a7080..371c8ff1b 100644 --- a/code/nel/samples/net/class_transport/ai_service.cpp +++ b/code/nel/samples/net/class_transport/ai_service.cpp @@ -37,7 +37,9 @@ #include "nel/net/transport_class.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #endif // NL_OS_WINDOWS diff --git a/code/nel/samples/net/class_transport/gd_service.cpp b/code/nel/samples/net/class_transport/gd_service.cpp index 0df811488..7d6eff3e2 100644 --- a/code/nel/samples/net/class_transport/gd_service.cpp +++ b/code/nel/samples/net/class_transport/gd_service.cpp @@ -37,7 +37,9 @@ #include "nel/net/transport_class.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #endif // NL_OS_WINDOWS diff --git a/code/nel/samples/net/login_system/frontend_service.cpp b/code/nel/samples/net/login_system/frontend_service.cpp index 18f525076..351282a8a 100644 --- a/code/nel/samples/net/login_system/frontend_service.cpp +++ b/code/nel/samples/net/login_system/frontend_service.cpp @@ -34,7 +34,9 @@ #include "nel/net/login_server.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #endif // NL_OS_WINDOWS diff --git a/code/nel/samples/net/udp/bench_service.cpp b/code/nel/samples/net/udp/bench_service.cpp index d7da69516..190347d4b 100644 --- a/code/nel/samples/net/udp/bench_service.cpp +++ b/code/nel/samples/net/udp/bench_service.cpp @@ -43,7 +43,9 @@ #include "receive_task.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #endif // NL_OS_WINDOWS @@ -96,8 +98,7 @@ struct CClient struct TInetAddressHash { - static const size_t bucket_size = 4; - static const size_t min_buckets = 8; + enum { bucket_size = 4, min_buckets = 8, }; inline bool operator() (const NLNET::CInetAddress &x1, const NLNET::CInetAddress &x2) const { diff --git a/code/nel/samples/net/udp/receive_task.cpp b/code/nel/samples/net/udp/receive_task.cpp index 5e50869d3..4ca68fd4e 100644 --- a/code/nel/samples/net/udp/receive_task.cpp +++ b/code/nel/samples/net/udp/receive_task.cpp @@ -18,7 +18,9 @@ #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #elif defined NL_OS_UNIX diff --git a/code/nel/src/3d/CMakeLists.txt b/code/nel/src/3d/CMakeLists.txt index fff343915..21184eb12 100644 --- a/code/nel/src/3d/CMakeLists.txt +++ b/code/nel/src/3d/CMakeLists.txt @@ -562,8 +562,13 @@ SOURCE_GROUP(Fx\\Particles\\lights FILES ps_light.cpp ../../include/nel/3d/ps_light.h) SOURCE_GROUP(Fx\\2d FILES + render_target_manager.cpp + ../../include/nel/3d/render_target_manager.h bloom_effect.cpp ../../include/nel/3d/bloom_effect.h + fxaa.cpp + fxaa_program.h + ../../include/nel/3d/fxaa.h deform_2d.cpp ../../include/nel/3d/deform_2d.h heat_haze.cpp @@ -700,6 +705,9 @@ SOURCE_GROUP(Stereo FILES stereo_ovr.cpp stereo_ovr_fp.cpp ../../include/nel/3d/stereo_ovr.h + stereo_ovr_04.cpp + stereo_ovr_04_program.h + ../../include/nel/3d/stereo_ovr_04.h stereo_libvr.cpp ../../include/nel/3d/stereo_libvr.h stereo_debugger.cpp diff --git a/code/nel/src/3d/bloom_effect.cpp b/code/nel/src/3d/bloom_effect.cpp index 7809aba2c..c468349ac 100644 --- a/code/nel/src/3d/bloom_effect.cpp +++ b/code/nel/src/3d/bloom_effect.cpp @@ -72,79 +72,47 @@ CBloomEffect::CBloomEffect() _SquareBloom = true; _DensityBloom = 128; _Init = false; - _InitBloomEffect = false; + + _BlurFinalTex = NULL; + _BlurHorizontalTex = NULL; } //----------------------------------------------------------------------------------------------------------- CBloomEffect::~CBloomEffect() { - if(_Init) + if (_Init) { - if(!_DisplayInitMat.empty()) - { - _DisplayInitMat.getObjectPtr()->setTexture(0, NULL); - if (_Driver) _Driver->deleteMaterial(_DisplayInitMat); - } - _InitText = NULL; - - if(!_DisplayBlurMat.empty()) + if (!_DisplayBlurMat.empty()) { - _DisplayBlurMat.getObjectPtr()->setTexture(0, NULL); if (_Driver) _Driver->deleteMaterial(_DisplayBlurMat); } - if(!_DisplaySquareBlurMat.empty()) + + if (!_DisplaySquareBlurMat.empty()) { - _DisplaySquareBlurMat.getObjectPtr()->setTexture(0, NULL); - _DisplaySquareBlurMat.getObjectPtr()->setTexture(1, NULL); if (_Driver) _Driver->deleteMaterial(_DisplaySquareBlurMat); } - if(!_BlurMat.empty()) + if (!_BlurMat.empty()) { - _BlurMat.getObjectPtr()->setTexture(0, NULL); - _BlurMat.getObjectPtr()->setTexture(1, NULL); - _BlurMat.getObjectPtr()->setTexture(2, NULL); - _BlurMat.getObjectPtr()->setTexture(3, NULL); if (_Driver) _Driver->deleteMaterial(_BlurMat); } - - _BlurHorizontalTex = NULL; - _BlurFinalTex = NULL; } } //----------------------------------------------------------------------------------------------------------- -void CBloomEffect::init(bool initBloomEffect) -{ - _InitBloomEffect = initBloomEffect; - - if(((CDriverUser *)_Driver)->getDriver()->supportBloomEffect()) - init(); -} - -//----------------------------------------------------------------------------------------------------------- - void CBloomEffect::init() { - _WndWidth = _Driver->getWindowWidth(); - _WndHeight = _Driver->getWindowHeight(); + if (!((CDriverUser *)_Driver)->getDriver()->supportBloomEffect()) + return; + + CDriverUser *dru = static_cast(_Driver); + IDriver *drv = dru->getDriver(); _BlurWidth = 256; _BlurHeight = 256; - // initialize textures - _InitText = NULL; - _BlurHorizontalTex = NULL; - _BlurFinalTex = NULL; - if(_InitBloomEffect) - { - initTexture(_InitText, false, _WndWidth, _WndHeight); - } - initTexture(_BlurFinalTex, true, _BlurWidth, _BlurHeight); - initTexture(_BlurHorizontalTex, true, _BlurWidth, _BlurHeight); - // initialize blur material _BlurMat = _Driver->createMaterial(); CMaterial * matObject = _BlurMat.getObjectPtr(); @@ -187,22 +155,6 @@ void CBloomEffect::init() matObject->texEnvArg1RGB(3, CMaterial::Constant, CMaterial::SrcColor); matObject->texEnvArg2RGB(3, CMaterial::Previous, CMaterial::SrcColor); - // initialize display materials - if(_InitBloomEffect) - { - _DisplayInitMat = _Driver->createMaterial(); - CMaterial * matObjectInit = _DisplayInitMat.getObjectPtr(); - _DisplayInitMat.initUnlit(); - _DisplayInitMat.setColor(CRGBA::White); - _DisplayInitMat.setBlend (false); - _DisplayInitMat.setAlphaTest (false); - matObjectInit->setBlendFunc (CMaterial::one, CMaterial::zero); - matObjectInit->setZWrite(false); - matObjectInit->setZFunc(CMaterial::always); - matObjectInit->setDoubleSided(true); - matObjectInit->setTexture(0, _InitText); - } - // initialize linear blur material _DisplayBlurMat = _Driver->createMaterial(); CMaterial * matObjectFinal = _DisplayBlurMat.getObjectPtr(); @@ -214,7 +166,7 @@ void CBloomEffect::init() matObjectFinal->setZFunc(CMaterial::always); matObjectFinal->setDoubleSided(true); - matObjectFinal->setTexture(0, _BlurFinalTex); + // matObjectFinal->setTexture(0, _BlurFinalTex); matObjectFinal->texEnvOpRGB(0, CMaterial::Modulate); matObjectFinal->texEnvArg0RGB(0, CMaterial::Texture, CMaterial::SrcColor); matObjectFinal->texEnvArg1RGB(0, CMaterial::Constant, CMaterial::SrcColor); @@ -230,163 +182,93 @@ void CBloomEffect::init() matObjectFinal->setZFunc(CMaterial::always); matObjectFinal->setDoubleSided(true); - matObjectFinal->setTexture(0, _BlurFinalTex); matObjectFinal->texEnvOpRGB(0, CMaterial::Modulate); matObjectFinal->texEnvArg0RGB(0, CMaterial::Texture, CMaterial::SrcColor); matObjectFinal->texEnvArg1RGB(0, CMaterial::Constant, CMaterial::SrcColor); - matObjectFinal->setTexture(1, _BlurFinalTex); matObjectFinal->texEnvOpRGB(1, CMaterial::Modulate); matObjectFinal->texEnvArg0RGB(1, CMaterial::Texture, CMaterial::SrcColor); matObjectFinal->texEnvArg1RGB(1, CMaterial::Previous, CMaterial::SrcColor); // initialize quads - _DisplayQuad.V0 = CVector(0.f, 0.f, 0.5f); - _DisplayQuad.V1 = CVector(1.f, 0.f, 0.5f); - _DisplayQuad.V2 = CVector(1.f, 1.f, 0.5f); - _DisplayQuad.V3 = CVector(0.f, 1.f, 0.5f); - _BlurQuad.V0 = CVector(-1.f, -1.f, 0.5f); _BlurQuad.V1 = CVector(1.f, -1.f, 0.5f); _BlurQuad.V2 = CVector(1.f, 1.f, 0.5f); _BlurQuad.V3 = CVector(-1.f, 1.f, 0.5f); - - _Init = true; -} - -//----------------------------------------------------------------------------------------------------------- - -void CBloomEffect::initTexture(CSmartPtr & tex, bool isMode2D, uint32 width, uint32 height) -{ - NL3D::IDriver *drvInternal = ((CDriverUser *) _Driver)->getDriver(); - - tex = new CTextureBloom(); - tex->setReleasable(false); - tex->resize(width, height); - tex->setFilterMode(ITexture::Linear, ITexture::LinearMipMapOff); - tex->setWrapS(ITexture::Clamp); - tex->setWrapT(ITexture::Clamp); - ((CTextureBloom *)tex.getPtr())->mode2D(isMode2D); - if(tex->TextureDrvShare==NULL || tex->TextureDrvShare->DrvTexture.getPtr()==NULL) + if (drv->textureCoordinateAlternativeMode()) { - tex->setRenderTarget(true); - drvInternal->setupTexture(*tex); + _BlurQuad.Uv0 = CUV(0.f, 1.f); + _BlurQuad.Uv1 = CUV(1.f, 1.f); + _BlurQuad.Uv2 = CUV(1.f, 0.f); + _BlurQuad.Uv3 = CUV(0.f, 0.f); + } + else + { + _BlurQuad.Uv0 = CUV(0.f, 0.f); + _BlurQuad.Uv1 = CUV(1.f, 0.f); + _BlurQuad.Uv2 = CUV(1.f, 1.f); + _BlurQuad.Uv3 = CUV(0.f, 1.f); } + + _Init = true; } //----------------------------------------------------------------------------------------------------------- -void CBloomEffect::initBloom() // clientcfg +void CBloomEffect::applyBloom() { - if(!((CDriverUser *)_Driver)->getDriver()->supportBloomEffect()) + if (!((CDriverUser *)_Driver)->getDriver()->supportBloomEffect()) return; // don't activate bloom when PolygonMode is different from Filled if (_Driver->getPolygonMode() != UDriver::Filled) return; - if(_Driver->getWindowWidth()==0 || _Driver->getWindowHeight()==0) + if (_Driver->getWindowWidth()==0 || _Driver->getWindowHeight()==0) return; - if(!_Init) + if (!_Init) init(); - _OriginalRenderTarget = static_cast(_Driver)->getDriver()->getRenderTarget(); - - // if window resize, reinitialize textures - if(_WndWidth!=_Driver->getWindowWidth() || _WndHeight!=_Driver->getWindowHeight()) - { - _WndWidth = _Driver->getWindowWidth(); - _WndHeight = _Driver->getWindowHeight(); - - if(_InitBloomEffect) - { - // release old SmartPtr - _DisplayInitMat.getObjectPtr()->setTexture(0, NULL); - _InitText = NULL; - - initTexture(_InitText, false, _WndWidth, _WndHeight); - - _DisplayInitMat.getObjectPtr()->setTexture(0, _InitText); - } - - bool reinitBlurTextures = false; - if(_WndWidth<_BlurWidth || _WndHeight<_BlurHeight) - { - _BlurWidth = raiseToNextPowerOf2(_WndWidth)/2; - _BlurHeight = raiseToNextPowerOf2(_WndHeight)/2; - - reinitBlurTextures = true; - } - - if(_WndWidth>256 && _BlurWidth!=256) - { - _BlurWidth = 256; - reinitBlurTextures = true; - } - - if(_WndHeight>256 && _BlurHeight!=256) - { - _BlurHeight = 256; - reinitBlurTextures = true; - } - - if(reinitBlurTextures) - { - // release old SmartPtr - _DisplayBlurMat.getObjectPtr()->setTexture(0, NULL); - - _DisplaySquareBlurMat.getObjectPtr()->setTexture(0, NULL); - _DisplaySquareBlurMat.getObjectPtr()->setTexture(1, NULL); - - _BlurMat.getObjectPtr()->setTexture(0, NULL); - _BlurMat.getObjectPtr()->setTexture(1, NULL); - _BlurMat.getObjectPtr()->setTexture(2, NULL); - _BlurMat.getObjectPtr()->setTexture(3, NULL); + CDriverUser *dru = static_cast(_Driver); + IDriver *drv = dru->getDriver(); - _BlurHorizontalTex = NULL; - _BlurFinalTex = NULL; + // backup + bool fogEnabled = _Driver->fogEnabled(); + _Driver->enableFog(false); - initTexture(_BlurFinalTex, true, _BlurWidth, _BlurHeight); - initTexture(_BlurHorizontalTex, true, _BlurWidth, _BlurHeight); - - _DisplayBlurMat.getObjectPtr()->setTexture(0, _BlurFinalTex); - - _DisplaySquareBlurMat.getObjectPtr()->setTexture(0, _BlurFinalTex); - _DisplaySquareBlurMat.getObjectPtr()->setTexture(1, _BlurFinalTex); - } - } + NL3D::ITexture *renderTarget = drv->getRenderTarget(); + nlassert(renderTarget); + nlassert(renderTarget->isBloomTexture()); - if (!_OriginalRenderTarget) - { - NL3D::CTextureUser txt = (_InitBloomEffect) ? (CTextureUser(_InitText)) : (CTextureUser()); - if(!(static_cast(_Driver)->setRenderTarget(txt, 0, 0, _WndWidth, _WndHeight))) - { - nlwarning("setRenderTarget return false with initial texture for bloom effect\n"); - return; - } - } -} + uint width = renderTarget->getWidth(); + uint height = renderTarget->getHeight(); + bool mode2D = static_cast(renderTarget)->isMode2D(); + nlassert(renderTarget->getUploadFormat() == ITexture::Auto); -//----------------------------------------------------------------------------------------------------------- + if (width >= 256) _BlurWidth = 256; + else _BlurWidth = raiseToNextPowerOf2(width) / 2; + if (height >= 256) _BlurHeight = 256; + else _BlurHeight = raiseToNextPowerOf2(height) / 2; -void CBloomEffect::endBloom() // clientcfg -{ - if(!_Driver->supportBloomEffect() || !_Init) - return; + nlassert(!_BlurFinalTex); + _BlurFinalTex = _Driver->getRenderTargetManager().getRenderTarget(_BlurWidth, _BlurHeight, true); + nlassert(!_BlurHorizontalTex); + _BlurHorizontalTex = _Driver->getRenderTargetManager().getRenderTarget(_BlurWidth, _BlurHeight, true); - // don't activate bloom when PolygonMode is different from Filled - if (_Driver->getPolygonMode() != UDriver::Filled) return; + _DisplayBlurMat.getObjectPtr()->setTexture(0, _BlurFinalTex->getITexture()); + _DisplaySquareBlurMat.getObjectPtr()->setTexture(0, _BlurFinalTex->getITexture()); + _DisplaySquareBlurMat.getObjectPtr()->setTexture(1, _BlurFinalTex->getITexture()); - if(_Driver->getWindowWidth()==0 || _Driver->getWindowHeight()==0) - return; + CTextureUser texNull; + dru->setRenderTarget(texNull); - CTextureUser txt1 = _OriginalRenderTarget ? CTextureUser(_OriginalRenderTarget) : ((_InitBloomEffect) ? (CTextureUser(_InitText)) : (CTextureUser())); - CTextureUser txt2(_BlurFinalTex); - CRect rect1(0, 0, _WndWidth, _WndHeight); + // Stretch original render target into blur texture + CTextureUser txt1(renderTarget); + CTextureUser txt2(_BlurFinalTex->getITexture()); + CRect rect1(0, 0, width, height); CRect rect2(0, 0, _BlurWidth, _BlurHeight); - // stretch rect - ((CDriverUser *) _Driver)->stretchRect(_Scene, txt1 , rect1, - txt2, rect2); + dru->stretchRect(_Scene, txt1, rect1, txt2, rect2); + _Driver->setMatrixMode2D11(); // horizontal blur pass doBlur(true); @@ -395,7 +277,27 @@ void CBloomEffect::endBloom() // clientcfg doBlur(false); // apply blur with a blend operation + drv->setRenderTarget(renderTarget); + _Driver->setMatrixMode2D11(); applyBlur(); + + // cleanup material texture references + _DisplayBlurMat.getObjectPtr()->setTexture(0, NULL); + _DisplaySquareBlurMat.getObjectPtr()->setTexture(0, NULL); + _DisplaySquareBlurMat.getObjectPtr()->setTexture(1, NULL); + _BlurMat.getObjectPtr()->setTexture(0, NULL); + _BlurMat.getObjectPtr()->setTexture(1, NULL); + _BlurMat.getObjectPtr()->setTexture(2, NULL); + _BlurMat.getObjectPtr()->setTexture(3, NULL); + + // restore + _Driver->enableFog(fogEnabled); + + // recycle render targets + _Driver->getRenderTargetManager().recycleRenderTarget(_BlurFinalTex); + _BlurFinalTex = NULL; + _Driver->getRenderTargetManager().recycleRenderTarget(_BlurHorizontalTex); + _BlurHorizontalTex = NULL; } //----------------------------------------------------------------------------------------------------------- @@ -404,49 +306,6 @@ void CBloomEffect::applyBlur() { NL3D::IDriver *drvInternal = ((CDriverUser *) _Driver)->getDriver(); - /*if (_OriginalRenderTarget) - { - CTextureUser txt(_OriginalRenderTarget); - if(!(static_cast(_Driver)->setRenderTarget(txt, 0, 0, _WndWidth, _WndHeight))) - { - nlwarning("setRenderTarget return false with original render target for bloom effect\n"); - return; - } - } - // in opengl, display in init texture - else if(_InitBloomEffect) - { - CTextureUser txt(_InitText); - if(!(static_cast(_Driver)->setRenderTarget(txt, 0, 0, _WndWidth, _WndHeight))) - { - nlwarning("setRenderTarget return false with initial texture for bloom effect\n"); - return; - } - }*/ - CTextureUser txtApply = _OriginalRenderTarget ? CTextureUser(_OriginalRenderTarget) : ((_InitBloomEffect) ? (CTextureUser(_InitText)) : (CTextureUser())); - if(!(static_cast(_Driver)->setRenderTarget(txtApply, 0, 0, _WndWidth, _WndHeight))) - { - nlwarning("setRenderTarget return false with initial texture for bloom effect\n"); - return; - } - - // display blur texture - // initialize blur texture coordinates - if(_InitBloomEffect) - { - _BlurQuad.Uv0 = CUV(0.f, 0.f); - _BlurQuad.Uv1 = CUV(1.f, 0.f); - _BlurQuad.Uv2 = CUV(1.f, 1.f); - _BlurQuad.Uv3 = CUV(0.f, 1.f); - } - else - { - _BlurQuad.Uv0 = CUV(0.f, 1.f); - _BlurQuad.Uv1 = CUV(1.f, 1.f); - _BlurQuad.Uv2 = CUV(1.f, 0.f); - _BlurQuad.Uv3 = CUV(0.f, 0.f); - } - // initialize vertex program drvInternal->activeVertexProgram(TextureOffsetVertexProgram); drvInternal->setUniform4f(IDriver::VertexProgram, 8, 255.f, 255.f, 255.f, 255.f); @@ -469,59 +328,12 @@ void CBloomEffect::applyBlur() matObjectFinal->texConstantColor(0, constCoeff); // display quad - UCamera pCam = _Scene->getCam(); - _Driver->setMatrixMode2D11(); _Driver->drawQuad(_BlurQuad, displayBlurMat); - _Driver->setMatrixMode3D(pCam); // disable vertex program drvInternal->activeVertexProgram(NULL); } -//----------------------------------------------------------------------------------------------------------- - -void CBloomEffect::endInterfacesDisplayBloom() // clientcfg -{ - // Render from render target to screen if necessary. - // Don't do this when the blend was done to the screen or when rendering to a user provided rendertarget. - if ((_OriginalRenderTarget.getPtr() == NULL) && _InitBloomEffect) - { - if(!_Driver->supportBloomEffect() || !_Init) - return; - - // don't activate bloom when PolygonMode is different from Filled - if (_Driver->getPolygonMode() != UDriver::Filled) return; - - if(_Driver->getWindowWidth()==0 || _Driver->getWindowHeight()==0) - return; - - NL3D::IDriver *drvInternal = ((CDriverUser *) _Driver)->getDriver(); - CTextureUser txtNull; - ((CDriverUser *)_Driver)->setRenderTarget(txtNull, 0, 0, 0, 0); - - // initialize texture coordinates - float newU = drvInternal->isTextureRectangle(_InitText) ? (float)_WndWidth : 1.f; - float newV = drvInternal->isTextureRectangle(_InitText) ? (float)_WndHeight : 1.f; - - _DisplayQuad.Uv0 = CUV(0.f, 0.f); - _DisplayQuad.Uv1 = CUV(newU, 0.f); - _DisplayQuad.Uv2 = CUV(newU, newV); - _DisplayQuad.Uv3 = CUV(0.f, newV); - - // init material texture -// CMaterial * matObjectInit = _DisplayInitMat.getObjectPtr(); - - // display - UCamera pCam = _Scene->getCam(); - _Driver->setMatrixMode2D11(); - _Driver->drawQuad(_DisplayQuad, _DisplayInitMat); - _Driver->setMatrixMode3D(pCam); - } - - _OriginalRenderTarget = NULL; -} - - //----------------------------------------------------------------------------------------------------------- void CBloomEffect::doBlur(bool horizontalBlur) @@ -531,17 +343,17 @@ void CBloomEffect::doBlur(bool horizontalBlur) ITexture * endTexture; // set displayed texture and render target texture of the pass - if(horizontalBlur) + if (horizontalBlur) { blurVec = CVector2f(1.f, 0.f); - startTexture = _BlurFinalTex; - endTexture = _BlurHorizontalTex; + startTexture = _BlurFinalTex->getITexture(); + endTexture = _BlurHorizontalTex->getITexture(); } else { blurVec = CVector2f(0.f, 1.f); - startTexture = _BlurHorizontalTex; - endTexture = _BlurFinalTex; + startTexture = _BlurHorizontalTex->getITexture(); + endTexture = _BlurFinalTex->getITexture(); } NL3D::IDriver *drvInternal = ((CDriverUser *) _Driver)->getDriver(); @@ -552,6 +364,7 @@ void CBloomEffect::doBlur(bool horizontalBlur) nlwarning("setRenderTarget return false with blur texture for bloom effect\n"); return; } + _Driver->setMatrixMode2D11(); // initialize vertex program drvInternal->activeVertexProgram(TextureOffsetVertexProgram); @@ -561,20 +374,30 @@ void CBloomEffect::doBlur(bool horizontalBlur) // set several decal constants in order to obtain in the render target texture a mix of color // of a texel and its neighbored texels on the axe of the pass. float decalL, decal2L, decalR, decal2R; - if(_InitBloomEffect) + if (drvInternal->textureCoordinateAlternativeMode()) + { + if (horizontalBlur) + { + decalL = 0.5f; + decal2L = -0.5f; + decalR = 1.5f; + decal2R = 2.5f; + } + else + { + decalL = 0.0f; + decal2L = -1.0f; + decalR = 1.0f; + decal2R = 2.0f; + } + } + else { decalL = -0.5f; decal2L = -1.5f; decalR = 0.5f; decal2R = 1.5f; } - else - { - decalL = 0.f; - decal2L = -1.f; - decalR = 1.f; - decal2R = 2.f; - } drvInternal->setUniform2f(IDriver::VertexProgram, 10, (decalR/(float)_BlurWidth)*blurVec.x, (decalR/(float)_BlurHeight)*blurVec.y); drvInternal->setUniform2f(IDriver::VertexProgram, 11, (decal2R/(float)_BlurWidth)*blurVec.x, (decal2R/(float)_BlurHeight)*blurVec.y); drvInternal->setUniform2f(IDriver::VertexProgram, 12, (decalL/(float)_BlurWidth)*blurVec.x, (decalL/(float)_BlurHeight)*blurVec.y); @@ -587,22 +410,13 @@ void CBloomEffect::doBlur(bool horizontalBlur) matObject->setTexture(2, startTexture); matObject->setTexture(3, startTexture); - // initialize quad - _BlurQuad.Uv0 = CUV(0.0f, 0.0f); - _BlurQuad.Uv1 = CUV(1.f, 0.0f); - _BlurQuad.Uv2 = CUV(1.f, 1.f); - _BlurQuad.Uv3 = CUV(0.0f, 1.f); - // display - UCamera pCam = _Scene->getCam(); - _Driver->setMatrixMode2D11(); _Driver->drawQuad(_BlurQuad, _BlurMat); // disable render target and vertex program drvInternal->activeVertexProgram(NULL); CTextureUser cu; ((CDriverUser *)_Driver)->setRenderTarget(cu, 0, 0, 0, 0); - _Driver->setMatrixMode3D(pCam); } }; // NL3D diff --git a/code/nel/src/3d/computed_string.cpp b/code/nel/src/3d/computed_string.cpp index a57191cc0..1a9fefba5 100644 --- a/code/nel/src/3d/computed_string.cpp +++ b/code/nel/src/3d/computed_string.cpp @@ -143,11 +143,13 @@ void CComputedString::render2D (IDriver& driver, /*------------------------------------------------------------------*\ render3D() \*------------------------------------------------------------------*/ -void CComputedString::render3D (IDriver& driver,CMatrix matrix,THotSpot hotspot) +void CComputedString::render3D (IDriver& driver, const CMatrix &matrixp, THotSpot hotspot) { if (Vertices.getNumVertices() == 0) return; + CMatrix matrix = matrixp; + // get window size uint32 wndWidth, wndHeight; driver.getWindowSize(wndWidth, wndHeight); diff --git a/code/nel/src/3d/driver.cpp b/code/nel/src/3d/driver.cpp index 2bfb0ea1f..791172700 100644 --- a/code/nel/src/3d/driver.cpp +++ b/code/nel/src/3d/driver.cpp @@ -32,7 +32,7 @@ namespace NL3D { // *************************************************************************** -const uint32 IDriver::InterfaceVersion = 0x6d; // gpu program interface +const uint32 IDriver::InterfaceVersion = 0x6e; // gpu program interface // *************************************************************************** IDriver::IDriver() : _SyncTexDrvInfos( "IDriver::_SyncTexDrvInfos" ) @@ -123,8 +123,9 @@ bool IDriver::release(void) // *************************************************************************** -GfxMode::GfxMode(uint16 w, uint16 h, uint8 d, bool windowed, bool offscreen, uint frequency, sint8 aa) +GfxMode::GfxMode(uint16 w, uint16 h, uint8 d, bool windowed, bool offscreen, uint frequency, sint8 aa, const std::string &displayDevice) { + DisplayDevice = displayDevice; Windowed = windowed; Width = w; Height = h; diff --git a/code/nel/src/3d/driver/direct3d/CMakeLists.txt b/code/nel/src/3d/driver/direct3d/CMakeLists.txt index ede76f06c..ccdb8cb10 100644 --- a/code/nel/src/3d/driver/direct3d/CMakeLists.txt +++ b/code/nel/src/3d/driver/direct3d/CMakeLists.txt @@ -10,7 +10,7 @@ NL_DEFAULT_PROPS(nel_drv_direct3d_win "NeL, Driver, Video: Direct3D") NL_ADD_RUNTIME_FLAGS(nel_drv_direct3d_win) NL_ADD_LIB_SUFFIX(nel_drv_direct3d_win) -ADD_DEFINITIONS(/Ddriver_direct3d_EXPORTS) +ADD_DEFINITIONS(-DRIVER_DIRECT3D_EXPORTS) IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nel_drv_direct3d_win ${CMAKE_CURRENT_SOURCE_DIR}/stddirect3d.h ${CMAKE_CURRENT_SOURCE_DIR}/stddirect3d.cpp) diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp index 864406205..8a7be80d2 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp @@ -25,8 +25,6 @@ #include "nel/3d/light.h" #include "nel/3d/index_buffer.h" #include "nel/misc/rect.h" -#include "nel/misc/di_event_emitter.h" -#include "nel/misc/mouse_device.h" #include "nel/misc/dynloadlib.h" #include "nel/3d/viewport.h" #include "nel/3d/scissor.h" @@ -110,6 +108,10 @@ IDriver* createD3DDriverInstance () #else +#ifdef NL_COMP_MINGW +extern "C" +{ +#endif __declspec(dllexport) IDriver* NL3D_createIDriverInstance () { return new CDriverD3D; @@ -119,7 +121,9 @@ __declspec(dllexport) uint32 NL3D_interfaceVersion () { return IDriver::InterfaceVersion; } - +#ifdef NL_COMP_MINGW +} +#endif #endif /*static*/ bool CDriverD3D::_CacheTest[CacheTest_Count] = @@ -379,7 +383,7 @@ void CDriverD3D::resetRenderVariables() } for (i=0; iGetAdapterIdentifier(gAdapter,0,&Identifier); - + if (strstr(Identifier.Description,"PerfHUD") != 0) { nlinfo ("Setting up with PerfHUD"); @@ -1481,7 +1489,7 @@ bool CDriverD3D::setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool r break; } } - #endif WITH_PERFHUD + #endif /* WITH_PERFHUD */ // Create the D3D device HRESULT result = _D3D->CreateDevice (adapter, _Rasterizer, _HWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING|D3DCREATE_PUREDEVICE, ¶meters, &_DeviceInterface); if (result != D3D_OK) @@ -1505,10 +1513,6 @@ bool CDriverD3D::setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool r } } - - -// _D3D->CreateDevice (adapter, _Rasterizer, _HWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, ¶meters, &_DeviceInterface); - // Check some caps D3DCAPS9 caps; if (_DeviceInterface->GetDeviceCaps(&caps) == D3D_OK) @@ -1633,20 +1637,6 @@ bool CDriverD3D::setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool r // Setup the event emitter, and try to retrieve a direct input interface _EventEmitter.addEmitter(we, true /*must delete*/); // the main emitter - // Try to get direct input - try - { - NLMISC::CDIEventEmitter *diee = NLMISC::CDIEventEmitter::create(GetModuleHandle(NULL), _HWnd, we); - if (diee) - { - _EventEmitter.addEmitter(diee, true); - } - } - catch(const EDirectInput &e) - { - nlinfo(e.what()); - } - // Init some variables _ForceDXTCCompression = false; _AnisotropicFilter = 0; @@ -2006,13 +1996,6 @@ bool CDriverD3D::swapBuffers() // todo hulud volatile //_DeviceInterface->SetStreamSource(0, _VolatileVertexBufferRAM[1]->VertexBuffer, 0, 12); - // Is direct input running ? - if (_EventEmitter.getNumEmitters() > 1) - { - // flush direct input messages if any - NLMISC::safe_cast(_EventEmitter.getEmitter(1))->poll(); - } - // End now if (!endScene()) { @@ -2655,7 +2638,8 @@ bool CDriverD3D::reset (const GfxMode& mode) #ifndef NL_NO_ASM CFpuRestorer fpuRestorer; // fpu control word is changed by "Reset" #endif - if (_Rasterizer!=D3DDEVTYPE_REF) { + if (_Rasterizer!=D3DDEVTYPE_REF) + { HRESULT hr = _DeviceInterface->Reset (¶meters); if (hr != D3D_OK) { diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d.def b/code/nel/src/3d/driver/direct3d/driver_direct3d.def index 2e32d9601..7e6b29b2e 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d.def +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d.def @@ -1,2 +1,4 @@ -EXPORTS NL3D_createIDriverInstance -EXPORTS NL3D_interfaceVersion \ No newline at end of file +LIBRARY nel_drv_direct3d_win_r +EXPORTS + NL3D_createIDriverInstance + NL3D_interfaceVersion \ No newline at end of file diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d.h b/code/nel/src/3d/driver/direct3d/driver_direct3d.h index 1055e105c..039b6f3ed 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d.h +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d.h @@ -839,7 +839,7 @@ public: // *************************************************************************** // Mode initialisation, requests - virtual bool init (uint windowIcon = 0, emptyProc exitFunc = 0); + virtual bool init (uintptr_t windowIcon = 0, emptyProc exitFunc = 0); virtual bool setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool resizeable) throw(EBadDisplay); virtual bool release(); virtual bool setMode(const GfxMode& mode); @@ -944,6 +944,7 @@ public: virtual ITexture *getRenderTarget() const; virtual bool copyTargetToTexture (ITexture *tex, uint32 offsetx, uint32 offsety, uint32 x, uint32 y, uint32 width, uint32 height, uint32 mipmapLevel); + virtual bool textureCoordinateAlternativeMode() const { return true; }; virtual bool getRenderTargetSize (uint32 &width, uint32 &height); virtual bool fillBuffer (CBitmap &bitmap); @@ -953,7 +954,7 @@ public: virtual void setSwapVBLInterval(uint interval); virtual uint getSwapVBLInterval(); virtual void swapTextureHandle(ITexture &tex0, ITexture &tex1); - virtual uint getTextureHandle(const ITexture&tex); + virtual uintptr_t getTextureHandle(const ITexture&tex); // Matrix, viewport and frustum virtual void setFrustum(float left, float right, float bottom, float top, float znear, float zfar, bool perspective = true); @@ -1033,11 +1034,6 @@ public: // Change default scale for all cursors virtual void setCursorScale(float scale); - virtual NLMISC::IMouseDevice *enableLowLevelMouse(bool enable, bool exclusive); - virtual NLMISC::IKeyboardDevice *enableLowLevelKeyboard(bool enable); - virtual NLMISC::IInputDeviceManager *getLowLevelInputDeviceManager(); - virtual uint getDoubleClickDelay(bool hardwareMouse); - // Lights virtual uint getMaxLight () const; virtual void setLight (uint8 num, const CLight& light); @@ -1893,7 +1889,7 @@ public: H_AUTO_D3D(CDriverD3D_setSamplerState); nlassert (_DeviceInterface); nlassert (sampler 1) - diee = NLMISC::safe_cast(_EventEmitter.getEmitter(1)); - - if (enable) - { - try - { - if (diee) - res = diee->getMouseDevice(exclusive); - } - catch (const EDirectInput &) - { - } - } - else - { - if (diee) - diee->releaseMouse(); - } - - return res; -} - -// *************************************************************************** -NLMISC::IKeyboardDevice* CDriverD3D::enableLowLevelKeyboard(bool enable) -{ - H_AUTO_D3D(CDriverD3D_enableLowLevelKeyboard); - - NLMISC::IKeyboardDevice *res = NULL; - - NLMISC::CDIEventEmitter *diee = NULL; - - if (_EventEmitter.getNumEmitters() > 1) - diee = NLMISC::safe_cast(_EventEmitter.getEmitter(1)); - - if (enable) - { - try - { - if (diee) - res = diee->getKeyboardDevice(); - } - catch (const EDirectInput &) - { - } - } - else - { - if (diee) - diee->releaseKeyboard(); - } - - return res; -} - -// *************************************************************************** -NLMISC::IInputDeviceManager* CDriverD3D::getLowLevelInputDeviceManager() -{ - H_AUTO_D3D(CDriverD3D_getLowLevelInputDeviceManager); - - NLMISC::IInputDeviceManager *res = NULL; - - if (_EventEmitter.getNumEmitters() > 1) - res = NLMISC::safe_cast(_EventEmitter.getEmitter(1)); - - return res; -} - -// *************************************************************************** -uint CDriverD3D::getDoubleClickDelay(bool hardwareMouse) -{ - H_AUTO_D3D(CDriverD3D_getDoubleClickDelay); - - uint res = 250; - - NLMISC::IMouseDevice *md = NULL; - - if (_EventEmitter.getNumEmitters() >= 2) - { - NLMISC::CDIEventEmitter *diee = NLMISC::safe_cast(_EventEmitter.getEmitter(1)); - if (diee->isMouseCreated()) - { - try - { - md = diee->getMouseDevice(hardwareMouse); - } - catch (const EDirectInput &) - { - // could not get device .. - } - } - } - - if (md) - { - res = md->getDoubleClickDelay(); - } - else - { - // try to read the good value from windows - res = ::GetDoubleClickTime(); - } - - return res; -} - bool CDriverD3D::convertBitmapToCursor(const NLMISC::CBitmap &bitmap, nlCursor &cursor, uint iconWidth, uint iconHeight, uint iconDepth, const NLMISC::CRGBA &col, sint hotSpotX, sint hotSpotY) { return convertBitmapToIcon(bitmap, cursor, iconWidth, iconHeight, iconDepth, col, hotSpotX, hotSpotY, true); diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_light.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_light.cpp index 4ad5b46c0..d3bb62e64 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_light.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_light.cpp @@ -20,8 +20,6 @@ #include "nel/3d/light.h" #include "nel/3d/index_buffer.h" #include "nel/misc/rect.h" -#include "nel/misc/di_event_emitter.h" -#include "nel/misc/mouse_device.h" #include "nel/3d/viewport.h" #include "nel/3d/scissor.h" #include "nel/3d/u_driver.h" diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_material.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_material.cpp index 40d01039b..f22cba111 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_material.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_material.cpp @@ -21,8 +21,6 @@ #include "nel/3d/index_buffer.h" #include "nel/3d/texture_bump.h" #include "nel/misc/rect.h" -#include "nel/misc/di_event_emitter.h" -#include "nel/misc/mouse_device.h" #include "nel/3d/viewport.h" #include "nel/3d/scissor.h" #include "nel/3d/u_driver.h" @@ -648,7 +646,7 @@ bool CDriverD3D::setupMaterial(CMaterial &mat) // Must separate texture setup and texture activation in 2 "for"... // because setupTexture() may disable all stage. - if (matShader == CMaterial::Normal + if (matShader == CMaterial::Normal || ((matShader == CMaterial::Program) && (_PixelProgramUser->features().MaterialFlags & CProgramFeatures::TextureStages)) ) { @@ -670,7 +668,7 @@ bool CDriverD3D::setupMaterial(CMaterial &mat) // Don't do it also for Specular because the EnvFunction and the TexGen may be special. { H_AUTO_D3D(CDriverD3D_setupMaterial_normalShaderActivateTextures) - if (matShader == CMaterial::Normal + if (matShader == CMaterial::Normal || ((matShader == CMaterial::Program) && (_PixelProgramUser->features().MaterialFlags & CProgramFeatures::TextureStages)) ) { diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_matrix.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_matrix.cpp index 87b047476..c5b479de0 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_matrix.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_matrix.cpp @@ -20,8 +20,6 @@ #include "nel/3d/light.h" #include "nel/3d/index_buffer.h" #include "nel/misc/rect.h" -#include "nel/misc/di_event_emitter.h" -#include "nel/misc/mouse_device.h" #include "nel/3d/viewport.h" #include "nel/3d/scissor.h" #include "nel/3d/u_driver.h" diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_render.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_render.cpp index 313fb2344..939dc1dc9 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_render.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_render.cpp @@ -20,8 +20,6 @@ #include "nel/3d/light.h" #include "nel/3d/index_buffer.h" #include "nel/misc/rect.h" -#include "nel/misc/di_event_emitter.h" -#include "nel/misc/mouse_device.h" #include "nel/misc/fast_mem.h" #include "nel/3d/viewport.h" #include "nel/3d/scissor.h" 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 87f41678b..ad5de53c1 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp @@ -20,8 +20,6 @@ #include "nel/3d/light.h" #include "nel/3d/index_buffer.h" #include "nel/misc/rect.h" -#include "nel/misc/di_event_emitter.h" -#include "nel/misc/mouse_device.h" #include "nel/3d/viewport.h" #include "nel/3d/scissor.h" #include "nel/3d/u_driver.h" @@ -1091,7 +1089,7 @@ void CDriverD3D::swapTextureHandle(ITexture &tex0, ITexture &tex1) // *************************************************************************** -uint CDriverD3D::getTextureHandle(const ITexture &tex) +uintptr_t CDriverD3D::getTextureHandle(const ITexture &tex) { H_AUTO_D3D(CDriverD3D_getTextureHandle) // If DrvShare not setuped @@ -1104,7 +1102,7 @@ uint CDriverD3D::getTextureHandle(const ITexture &tex) if(!d3dtext) return 0; - return (uint)(d3dtext->Texture); + return (uintptr_t)(d3dtext->Texture); } // *************************************************************************** diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_vertex.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_vertex.cpp index 9882a5ce1..d37c272a2 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_vertex.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_vertex.cpp @@ -20,8 +20,6 @@ #include "nel/3d/light.h" #include "nel/3d/index_buffer.h" #include "nel/misc/rect.h" -#include "nel/misc/di_event_emitter.h" -#include "nel/misc/mouse_device.h" #include "nel/3d/viewport.h" #include "nel/3d/scissor.h" #include "nel/3d/u_driver.h" @@ -59,7 +57,7 @@ CVBDrvInfosD3D::CVBDrvInfosD3D(CDriverD3D *drv, ItVBDrvInfoPtrList it, CVertexBu // *************************************************************************** -extern uint vertexCount=0; +uint vertexCount=0; CVBDrvInfosD3D::~CVBDrvInfosD3D() { @@ -173,7 +171,7 @@ uint8 *CVBDrvInfosD3D::lock (uint begin, uint end, bool readOnly) void *pbData; if (VertexBuffer->Lock ( begin, end-begin, &pbData, readOnly?D3DLOCK_READONLY:0) != D3D_OK) - return false; + return NULL; // Lock Profile? if(driver->_VBHardProfiling /*&& Hardware*/) diff --git a/code/nel/src/3d/driver/direct3d/stddirect3d.h b/code/nel/src/3d/driver/direct3d/stddirect3d.h index a243bf816..c7b6f7f3e 100644 --- a/code/nel/src/3d/driver/direct3d/stddirect3d.h +++ b/code/nel/src/3d/driver/direct3d/stddirect3d.h @@ -19,7 +19,9 @@ #ifdef NL_OS_WINDOWS # define WIN32_LEAN_AND_MEAN -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #endif diff --git a/code/nel/src/3d/driver/opengl/CMakeLists.txt b/code/nel/src/3d/driver/opengl/CMakeLists.txt index aea202e8b..12e20fbb3 100644 --- a/code/nel/src/3d/driver/opengl/CMakeLists.txt +++ b/code/nel/src/3d/driver/opengl/CMakeLists.txt @@ -37,7 +37,7 @@ NL_ADD_RUNTIME_FLAGS(${NLDRV_OGL_LIB}) IF(WIN32) INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY}) - ADD_DEFINITIONS(/DDRIVER_OPENGL_EXPORTS) + ADD_DEFINITIONS(-DDRIVER_OPENGL_EXPORTS) ENDIF(WIN32) IF(APPLE) @@ -67,6 +67,16 @@ IF(UNIX AND NOT APPLE) ADD_DEFINITIONS(-DHAVE_XCURSOR) TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${X11_Xcursor_LIB}) ENDIF(X11_Xcursor_FOUND) + IF(X11_Xext_FOUND) + TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${X11_Xext_LIB}) + ENDIF(X11_Xext_FOUND) + # libraries needed to be linked while linking to static X11 libraries + FIND_LIBRARY(XCB_LIBRARY + NAMES xcb + HINTS ${X11_LIB_SEARCH_PATH}) + IF(XCB_LIBRARY) + TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${XCB_LIBRARY}) + ENDIF(XCB_LIBRARY) ENDIF(UNIX AND NOT APPLE) IF(WITH_PCH) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl.cpp b/code/nel/src/3d/driver/opengl/driver_opengl.cpp index e8cb57a22..35cf9c094 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl.cpp @@ -28,8 +28,6 @@ #include "nel/3d/light.h" #include "nel/3d/index_buffer.h" #include "nel/misc/rect.h" -#include "nel/misc/di_event_emitter.h" -#include "nel/misc/mouse_device.h" #include "nel/misc/hierarchical_timer.h" #include "nel/misc/dynloadlib.h" #include "driver_opengl_vertex_buffer_hard.h" @@ -108,7 +106,10 @@ IDriver* createGlDriverInstance () #else #ifdef NL_OS_WINDOWS - +#ifdef NL_COMP_MINGW +extern "C" +{ +#endif __declspec(dllexport) IDriver* NL3D_createIDriverInstance () { return new CDriverGL; @@ -118,7 +119,9 @@ __declspec(dllexport) uint32 NL3D_interfaceVersion () { return IDriver::InterfaceVersion; } - +#ifdef NL_COMP_MINGW +} +#endif #elif defined (NL_OS_UNIX) extern "C" @@ -432,11 +435,7 @@ bool CDriverGL::setupDisplay() glViewport(0,0,_CurrentMode.Width,_CurrentMode.Height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); -#ifdef USE_OPENGLES - glOrthof(0.f,_CurrentMode.Width,_CurrentMode.Height,0.f,-1.0f,1.0f); -#else glOrtho(0,_CurrentMode.Width,_CurrentMode.Height,0,-1.0f,1.0f); -#endif glMatrixMode(GL_MODELVIEW); glLoadIdentity(); #ifndef USE_OPENGLES @@ -479,6 +478,11 @@ bool CDriverGL::setupDisplay() #endif } + if (_Extensions.ARBFragmentShader) + { + _ForceNativeFragmentPrograms = false; + } + _VertexProgramEnabled= false; _PixelProgramEnabled= false; _LastSetupGLArrayVertexProgram= false; @@ -717,11 +721,7 @@ bool CDriverGL::activeFrameBufferObject(ITexture * tex) } else { -#ifdef USE_OPENGLES - nglBindFramebufferOES(GL_FRAMEBUFFER_OES, 0); -#else nglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); -#endif return true; } } @@ -926,14 +926,6 @@ bool CDriverGL::swapBuffers() } #endif -#ifdef NL_OS_WINDOWS - if (_EventEmitter.getNumEmitters() > 1) // is direct input running ? - { - // flush direct input messages if any - NLMISC::safe_cast(_EventEmitter.getEmitter(1))->poll(); - } -#endif - if (!_WndActive) { if (_AGPVertexArrayRange) _AGPVertexArrayRange->updateLostBuffers(); @@ -1032,6 +1024,8 @@ bool CDriverGL::release() // Call IDriver::release() before, to destroy textures, shaders and VBs... IDriver::release(); + nlassert(_DepthStencilFBOs.empty()); + _SwapBufferCounter = 0; // delete querries @@ -1075,7 +1069,7 @@ void CDriverGL::setupViewport (const class CViewport& viewport) // Setup gl viewport uint32 clientWidth, clientHeight; - getWindowSize(clientWidth, clientHeight); + getRenderTargetSize(clientWidth, clientHeight); // Backup the viewport _CurrViewport = viewport; @@ -1130,7 +1124,7 @@ void CDriverGL::setupScissor (const class CScissor& scissor) // Setup gl viewport uint32 clientWidth, clientHeight; - getWindowSize(clientWidth, clientHeight); + getRenderTargetSize(clientWidth, clientHeight); // Backup the scissor _CurrScissor= scissor; @@ -1499,7 +1493,7 @@ void CDriverGL::enableUsedTextureMemorySum (bool enable) H_AUTO_OGL(CDriverGL_enableUsedTextureMemorySum ) if (enable) - { + { nlinfo ("3D: PERFORMANCE INFO: enableUsedTextureMemorySum has been set to true in CDriverGL"); _TextureUsed.reserve(512); } @@ -2176,7 +2170,7 @@ void CDriverGL::flush() // *************************************************************************** void CDriverGL::setSwapVBLInterval(uint interval) { - H_AUTO_OGL(CDriverGL_setSwapVBLInterval) + H_AUTO_OGL(CDriverGL_setSwapVBLInterval); if (!_Initialized) return; @@ -2652,7 +2646,7 @@ void CDriverGL::checkTextureOn() const bool CDriverGL::supportOcclusionQuery() const { H_AUTO_OGL(CDriverGL_supportOcclusionQuery) - return _Extensions.NVOcclusionQuery; + return _Extensions.NVOcclusionQuery || _Extensions.ARBOcclusionQuery; } // *************************************************************************** @@ -2683,11 +2677,14 @@ bool CDriverGL::supportFrameBufferObject() const IOcclusionQuery *CDriverGL::createOcclusionQuery() { H_AUTO_OGL(CDriverGL_createOcclusionQuery) - nlassert(_Extensions.NVOcclusionQuery); + nlassert(_Extensions.NVOcclusionQuery || _Extensions.ARBOcclusionQuery); #ifndef USE_OPENGLES GLuint id; - nglGenOcclusionQueriesNV(1, &id); + if (_Extensions.NVOcclusionQuery) + nglGenOcclusionQueriesNV(1, &id); + else + nglGenQueriesARB(1, &id); if (id == 0) return NULL; COcclusionQueryGL *oqgl = new COcclusionQueryGL; oqgl->Driver = this; @@ -2714,7 +2711,10 @@ void CDriverGL::deleteOcclusionQuery(IOcclusionQuery *oq) oqgl->Driver = NULL; nlassert(oqgl->ID != 0); GLuint id = oqgl->ID; - nglDeleteOcclusionQueriesNV(1, &id); + if (_Extensions.NVOcclusionQuery) + nglDeleteOcclusionQueriesNV(1, &id); + else + nglDeleteQueriesARB(1, &id); _OcclusionQueryList.erase(oqgl->Iterator); if (oqgl == _CurrentOcclusionQuery) { @@ -2733,7 +2733,10 @@ void COcclusionQueryGL::begin() nlassert(Driver); nlassert(Driver->_CurrentOcclusionQuery == NULL); // only one query at a time nlassert(ID); - nglBeginOcclusionQueryNV(ID); + if (Driver->_Extensions.NVOcclusionQuery) + nglBeginOcclusionQueryNV(ID); + else + nglBeginQueryARB(GL_SAMPLES_PASSED, ID); Driver->_CurrentOcclusionQuery = this; OcclusionType = NotAvailable; VisibleCount = 0; @@ -2749,7 +2752,10 @@ void COcclusionQueryGL::end() nlassert(Driver); nlassert(Driver->_CurrentOcclusionQuery == this); // only one query at a time nlassert(ID); - nglEndOcclusionQueryNV(); + if (Driver->_Extensions.NVOcclusionQuery) + nglEndOcclusionQueryNV(); + else + nglEndQueryARB(GL_SAMPLES_PASSED); Driver->_CurrentOcclusionQuery = NULL; #endif } @@ -2765,15 +2771,29 @@ IOcclusionQuery::TOcclusionType COcclusionQueryGL::getOcclusionType() nlassert(Driver->_CurrentOcclusionQuery != this); // can't query result between a begin/end pair! if (OcclusionType == NotAvailable) { - GLuint result; - // retrieve result - nglGetOcclusionQueryuivNV(ID, GL_PIXEL_COUNT_AVAILABLE_NV, &result); - if (result != GL_FALSE) + if (Driver->_Extensions.NVOcclusionQuery) + { + GLuint result; + // retrieve result + nglGetOcclusionQueryuivNV(ID, GL_PIXEL_COUNT_AVAILABLE_NV, &result); + if (result != GL_FALSE) + { + nglGetOcclusionQueryuivNV(ID, GL_PIXEL_COUNT_NV, &result); + OcclusionType = result != 0 ? NotOccluded : Occluded; + VisibleCount = (uint) result; + // Note : we could return the exact number of pixels that passed the z-test, but this value is not supported by all implementation (Direct3D ...) + } + } + else { - nglGetOcclusionQueryuivNV(ID, GL_PIXEL_COUNT_NV, &result); - OcclusionType = result != 0 ? NotOccluded : Occluded; - VisibleCount = (uint) result; - // Note : we could return the exact number of pixels that passed the z-test, but this value is not supported by all implementation (Direct3D ...) + GLuint result; + nglGetQueryObjectuivARB(ID, GL_QUERY_RESULT_AVAILABLE, &result); + if (result != GL_FALSE) + { + nglGetQueryObjectuivARB(ID, GL_QUERY_RESULT, &result); + OcclusionType = result != 0 ? NotOccluded : Occluded; + VisibleCount = (uint) result; + } } } #endif diff --git a/code/nel/src/3d/driver/opengl/driver_opengl.def b/code/nel/src/3d/driver/opengl/driver_opengl.def index bfe648552..369389fa9 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl.def +++ b/code/nel/src/3d/driver/opengl/driver_opengl.def @@ -1,2 +1,4 @@ -EXPORTS NL3D_createIDriverInstance -EXPORTS NL3D_interfaceVersion +LIBRARY nel_drv_opengl_win_r +EXPORTS + NL3D_createIDriverInstance + NL3D_interfaceVersion \ No newline at end of file diff --git a/code/nel/src/3d/driver/opengl/driver_opengl.h b/code/nel/src/3d/driver/opengl/driver_opengl.h index 57f73b0b6..c4540b9da 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl.h +++ b/code/nel/src/3d/driver/opengl/driver_opengl.h @@ -146,6 +146,23 @@ public: virtual uint getVisibleCount(); }; +// *************************************************************************** +class CDepthStencilFBO : public NLMISC::CRefCount +{ +public: + CDepthStencilFBO(CDriverGL *driver, uint width, uint height); + ~CDepthStencilFBO(); + + uint Width; + uint Height; + + GLuint DepthFBOId; + GLuint StencilFBOId; + +private: + CDriverGL *m_Driver; +}; + // *************************************************************************** class CTextureDrvInfosGL : public ITextureDrvInfos { @@ -173,12 +190,9 @@ public: GLuint FBOId; // depth stencil FBO id - GLuint DepthFBOId; - GLuint StencilFBOId; - - bool InitFBO; bool AttachDepthStencil; - bool UsePackedDepthStencil; + NLMISC::CSmartPtr DepthStencilFBO; + bool InitFBO; // The current wrap modes assigned to the texture. ITexture::TWrapMode WrapS; @@ -304,7 +318,7 @@ public: virtual bool isLost() const { return false; } // there's no notion of 'lost device" in OpenGL - virtual bool init (uint windowIcon = 0, emptyProc exitFunc = 0); + virtual bool init (uintptr_t windowIcon = 0, emptyProc exitFunc = 0); virtual void disableHardwareVertexProgram(); virtual void disableHardwarePixelProgram(); @@ -527,14 +541,6 @@ public: // Change default scale for all cursors virtual void setCursorScale(float scale); - virtual NLMISC::IMouseDevice *enableLowLevelMouse(bool enable, bool exclusive); - - virtual NLMISC::IKeyboardDevice *enableLowLevelKeyboard(bool enable); - - virtual NLMISC::IInputDeviceManager *getLowLevelInputDeviceManager(); - - virtual uint getDoubleClickDelay(bool hardwareMouse); - virtual void getWindowSize (uint32 &width, uint32 &height); virtual void getWindowPos (sint32 &x, sint32 &y); @@ -566,6 +572,8 @@ public: virtual bool copyTargetToTexture (ITexture *tex, uint32 offsetx, uint32 offsety, uint32 x, uint32 y, uint32 width, uint32 height, uint32 mipmapLevel); + virtual bool textureCoordinateAlternativeMode() const { return false; }; + virtual bool getRenderTargetSize (uint32 &width, uint32 &height); @@ -632,7 +640,7 @@ public: virtual void swapTextureHandle(ITexture &tex0, ITexture &tex1); - virtual uint getTextureHandle(const ITexture&tex); + virtual uintptr_t getTextureHandle(const ITexture&tex); /// \name Material multipass. /** NB: setupMaterial() must be called before thoses methods. @@ -693,6 +701,7 @@ private: friend class CTextureDrvInfosGL; friend class CVertexProgamDrvInfosGL; friend class CPixelProgamDrvInfosGL; + friend class CDepthStencilFBO; private: // Version of the driver. Not the interface version!! Increment when implementation of the driver change. @@ -888,8 +897,11 @@ private: // viewport before call to setRenderTarget, if BFO extension is supported CViewport _OldViewport; + // Current FBO render target CSmartPtr _RenderTargetFBO; + // Share the same backbuffer for FBO render targets with window size + std::vector _DepthStencilFBOs; // Num lights return by GL_MAX_LIGHTS uint _MaxDriverLight; @@ -1591,6 +1603,7 @@ private: // @} // misc public: + friend class COcclusionQueryGL; static GLenum NLCubeFaceToGLCubeFace[6]; static CMaterial::CTexEnv _TexEnvReplace; // occlusion query 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 3ded67d62..1a660f9c7 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_extension.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_extension.cpp @@ -372,6 +372,10 @@ PFNGLUNMAPBUFFERARBPROC nglUnmapBufferARB; PFNGLGETBUFFERPARAMETERIVARBPROC nglGetBufferParameterivARB; PFNGLGETBUFFERPOINTERVARBPROC nglGetBufferPointervARB; +// GL_ARB_map_buffer_range +PFNGLMAPBUFFERRANGEPROC nglMapBufferRange; +PFNGLFLUSHMAPPEDBUFFERRANGEPROC nglFlushMappedBufferRange; + // GL_ARB_vertex_program PFNGLVERTEXATTRIB1SARBPROC nglVertexAttrib1sARB; PFNGLVERTEXATTRIB1FARBPROC nglVertexAttrib1fARB; @@ -445,6 +449,16 @@ PFNGLENDOCCLUSIONQUERYNVPROC nglEndOcclusionQueryNV; PFNGLGETOCCLUSIONQUERYIVNVPROC nglGetOcclusionQueryivNV; PFNGLGETOCCLUSIONQUERYUIVNVPROC nglGetOcclusionQueryuivNV; +// ARB_occlusion_query +PFNGLGENQUERIESARBPROC nglGenQueriesARB; +PFNGLDELETEQUERIESARBPROC nglDeleteQueriesARB; +PFNGLISQUERYARBPROC nglIsQueryARB; +PFNGLBEGINQUERYARBPROC nglBeginQueryARB; +PFNGLENDQUERYARBPROC nglEndQueryARB; +PFNGLGETQUERYIVARBPROC nglGetQueryivARB; +PFNGLGETQUERYOBJECTIVARBPROC nglGetQueryObjectivARB; +PFNGLGETQUERYOBJECTUIVARBPROC nglGetQueryObjectuivARB; + // GL_EXT_framebuffer_object PFNGLISRENDERBUFFEREXTPROC nglIsRenderbufferEXT; PFNGLISFRAMEBUFFEREXTPROC nglIsFramebufferEXT; @@ -1235,6 +1249,15 @@ static bool setupNVFragmentProgram2(const char *glext) return true; } +// ********************************* +static bool setupARBFragmentShader(const char *glext) +{ + H_AUTO_OGL(setupNVFragmentProgram2); + CHECK_EXT("GL_ARB_fragment_shader"); + + return true; +} + // *************************************************************************** static bool setupARBVertexBufferObject(const char *glext) { @@ -1259,6 +1282,21 @@ static bool setupARBVertexBufferObject(const char *glext) return true; } +// *************************************************************************** +static bool setupARBMapBufferRange(const char *glext) +{ + H_AUTO_OGL(setupARBMapBufferRange); + +#ifndef USE_OPENGLES + CHECK_EXT("GL_ARB_map_buffer_range"); + + CHECK_ADDRESS(PFNGLMAPBUFFERRANGEPROC, glMapBufferRange); + CHECK_ADDRESS(PFNGLFLUSHMAPPEDBUFFERRANGEPROC, glFlushMappedBufferRange); +#endif + + return true; +} + // *************************************************************************** static bool setupARBVertexProgram(const char *glext) { @@ -1352,6 +1390,26 @@ static bool setupNVOcclusionQuery(const char *glext) return true; } +// *************************************************************************** +static bool setupARBOcclusionQuery(const char *glext) +{ + H_AUTO_OGL(setupARBOcclusionQuery); + CHECK_EXT("ARB_occlusion_query"); + +#ifndef USE_OPENGLES + CHECK_ADDRESS(PFNGLGENQUERIESARBPROC, glGenQueriesARB); + CHECK_ADDRESS(PFNGLDELETEQUERIESARBPROC, glDeleteQueriesARB); + CHECK_ADDRESS(PFNGLISQUERYARBPROC, glIsQueryARB); + CHECK_ADDRESS(PFNGLBEGINQUERYARBPROC, glBeginQueryARB); + CHECK_ADDRESS(PFNGLENDQUERYARBPROC, glEndQueryARB); + CHECK_ADDRESS(PFNGLGETQUERYIVARBPROC, glGetQueryivARB); + CHECK_ADDRESS(PFNGLGETQUERYOBJECTIVARBPROC, glGetQueryObjectivARB); + CHECK_ADDRESS(PFNGLGETQUERYOBJECTUIVARBPROC, glGetQueryObjectuivARB); +#endif + + return true; +} + // *************************************************************************** static bool setupNVTextureRectangle(const char *glext) @@ -1578,7 +1636,7 @@ void registerGlExtensions(CGlExtensions &ext) { ext.NVVertexProgram = setupNVVertexProgram(glext); ext.EXTVertexShader = setupEXTVertexShader(glext); - ext.ARBVertexProgram= setupARBVertexProgram(glext); + ext.ARBVertexProgram = setupARBVertexProgram(glext); } else { @@ -1593,6 +1651,7 @@ void registerGlExtensions(CGlExtensions &ext) { ext.ARBFragmentProgram = setupARBFragmentProgram(glext); ext.NVFragmentProgram2 = setupNVFragmentProgram2(glext); + ext.ARBFragmentShader = setupARBFragmentShader(glext); } else { @@ -1644,6 +1703,9 @@ void registerGlExtensions(CGlExtensions &ext) // Check NV_occlusion_query ext.NVOcclusionQuery = setupNVOcclusionQuery(glext); + // Check ARB_occlusion_query + ext.ARBOcclusionQuery = setupARBOcclusionQuery(glext); + // Check GL_NV_texture_rectangle ext.NVTextureRectangle = setupNVTextureRectangle(glext); @@ -1692,9 +1754,13 @@ void registerGlExtensions(CGlExtensions &ext) // ARB extensions // ------------- - if(!ext.DisableHardwareVertexArrayAGP) + if (!ext.DisableHardwareVertexArrayAGP) { ext.ARBVertexBufferObject = setupARBVertexBufferObject(glext); + if (ext.ARBVertexBufferObject) + { + ext.ARBMapBufferRange = setupARBMapBufferRange(glext); + } } // fix for radeon 7200 -> disable agp 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 938473029..868a0eaf4 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_extension.h +++ b/code/nel/src/3d/driver/opengl/driver_opengl_extension.h @@ -58,6 +58,7 @@ struct CGlExtensions bool EXTVertexShader; bool NVTextureShader; bool NVOcclusionQuery; + bool ARBOcclusionQuery; bool NVTextureRectangle; bool EXTTextureRectangle; bool ARBTextureRectangle; @@ -99,9 +100,11 @@ struct CGlExtensions bool ARBTextureCompression; bool ARBFragmentProgram; bool ARBVertexBufferObject; + bool ARBMapBufferRange; bool ARBVertexProgram; bool ARBTextureNonPowerOfTwo; bool ARBMultisample; + bool ARBFragmentShader; // NV Pixel Programs bool NVFragmentProgram2; @@ -167,6 +170,7 @@ public: EXTVertexShader= false; ARBFragmentProgram = false; ARBVertexBufferObject = false; + ARBMapBufferRange = false; ARBVertexProgram = false; NVTextureRectangle = false; EXTTextureRectangle = false; @@ -175,7 +179,9 @@ public: ARBTextureRectangle = false; ARBTextureNonPowerOfTwo = false; ARBMultisample = false; + ARBFragmentShader = false; NVOcclusionQuery = false; + ARBOcclusionQuery = false; FrameBufferObject = false; FrameBufferBlit = false; FrameBufferMultisample = false; @@ -237,6 +243,7 @@ public: result += EXTSecondaryColor ? "EXTSecondaryColor " : ""; result += EXTBlendColor ? "EXTBlendColor " : ""; result += NVOcclusionQuery ? "NVOcclusionQuery " : ""; + result += ARBOcclusionQuery ? "ARBOcclusionQuery " : ""; result += NVStateVARWithoutFlush ? "NVStateVARWithoutFlush " : ""; result += ARBMultisample ? "ARBMultisample " : ""; result += NVXGPUMemoryInfo ? "NVXGPUMemoryInfo " : ""; @@ -262,6 +269,7 @@ public: result += ATIVertexArrayObject ? "ATIVertexArrayObject " : ""; result += ATIVertexAttribArrayObject ? "ATIVertexAttribArrayObject " : ""; result += ARBVertexBufferObject ? "ARBVertexBufferObject " : ""; + result += ARBMapBufferRange ? "ARBMapBufferRange " : ""; result += ATIMapObjectBuffer ? "ATIMapObjectBuffer " : ""; result += "\n FBO: "; @@ -654,7 +662,10 @@ extern PFNGLUNMAPBUFFERARBPROC nglUnmapBufferARB; extern PFNGLGETBUFFERPARAMETERIVARBPROC nglGetBufferParameterivARB; extern PFNGLGETBUFFERPOINTERVARBPROC nglGetBufferPointervARB; - +// GL_ARB_map_buffer_range +//================================== +extern PFNGLMAPBUFFERRANGEPROC nglMapBufferRange; +extern PFNGLFLUSHMAPPEDBUFFERRANGEPROC nglFlushMappedBufferRange; // GL_ARB_vertex_program //================================== @@ -731,7 +742,16 @@ extern PFNGLENDOCCLUSIONQUERYNVPROC nglEndOcclusionQueryNV; extern PFNGLGETOCCLUSIONQUERYIVNVPROC nglGetOcclusionQueryivNV; extern PFNGLGETOCCLUSIONQUERYUIVNVPROC nglGetOcclusionQueryuivNV; - +// ARB_occlusion_query +//================================== +extern PFNGLGENQUERIESARBPROC nglGenQueriesARB; +extern PFNGLDELETEQUERIESARBPROC nglDeleteQueriesARB; +extern PFNGLISQUERYARBPROC nglIsQueryARB; +extern PFNGLBEGINQUERYARBPROC nglBeginQueryARB; +extern PFNGLENDQUERYARBPROC nglEndQueryARB; +extern PFNGLGETQUERYIVARBPROC nglGetQueryivARB; +extern PFNGLGETQUERYOBJECTIVARBPROC nglGetQueryObjectivARB; +extern PFNGLGETQUERYOBJECTUIVARBPROC nglGetQueryObjectuivARB; #ifdef NL_OS_WINDOWS 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 41d2c1366..31ca00961 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 @@ -40,6 +40,24 @@ extern "C" { #define GL_ADD_SIGNED_EXT GL_ADD_SIGNED #define GL_INTERPOLATE_EXT GL_INTERPOLATE #define GL_BUMP_ENVMAP_ATI GL_INTERPOLATE +#define GL_FRAMEBUFFER_EXT GL_FRAMEBUFFER_OES +#define GL_RENDERBUFFER_EXT GL_RENDERBUFFER_OES +#define GL_DEPTH24_STENCIL8_EXT GL_DEPTH24_STENCIL8_OES +#define GL_DEPTH_COMPONENT24 GL_DEPTH_COMPONENT24_OES +#define GL_COLOR_ATTACHMENT0_EXT GL_COLOR_ATTACHMENT0_OES +#define GL_DEPTH_ATTACHMENT_EXT GL_DEPTH_ATTACHMENT_OES +#define GL_STENCIL_ATTACHMENT_EXT GL_STENCIL_ATTACHMENT_OES +#define GL_ARRAY_BUFFER_ARB GL_ARRAY_BUFFER +#define GL_TEXTURE0_ARB GL_TEXTURE0 + +#define GL_ALPHA8 GL_ALPHA +#define GL_LUMINANCE8_ALPHA8 GL_LUMINANCE_ALPHA +#define GL_LUMINANCE8 GL_LUMINANCE +#define GL_RGBA8 GL_RGBA +#define GL_RGB8 GL_RGB + +#define GL_STATIC_DRAW_ARB GL_STATIC_DRAW +#define GL_DYNAMIC_DRAW_ARB GL_DYNAMIC_DRAW #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 @@ -48,6 +66,31 @@ extern "C" { #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 +#define nglGenRenderbuffersEXT nglGenRenderbuffersOES +#define nglBindRenderbufferEXT nglBindRenderbufferOES +#define nglDeleteRenderbuffersEXT nglDeleteRenderbuffersOES +#define nglRenderbufferStorageEXT nglRenderbufferStorageOES +#define nglGenFramebuffersEXT nglGenFramebuffersOES +#define nglBindFramebufferEXT nglBindFramebufferOES +#define nglFramebufferTexture2DEXT nglFramebufferTexture2DOES +#define nglFramebufferRenderbufferEXT nglFramebufferRenderbufferOES +#define nglCheckFramebufferStatusEXT nglCheckFramebufferStatusOES +#define nglDeleteBuffersARB glDeleteBuffers +#define nglIsBufferARB glIsBuffer +#define nglDeleteRenderbuffersEXT nglDeleteRenderbuffersOES +#define nglBindFramebufferEXT nglBindFramebufferOES +#define nglDeleteFramebuffersEXT nglDeleteFramebuffersOES +#define nglUnmapBufferARB nglUnmapBufferOES +#define nglActiveTextureARB glActiveTexture +#define nglClientActiveTextureARB glClientActiveTexture +#define nglBindBufferARB glBindBuffer +#define nglGenBuffersARB glGenBuffers +#define nglBufferDataARB glBufferData + +#define glFrustum glFrustumf +#define glOrtho glOrthof +#define glDepthRange glDepthRangef + #else #if defined(NL_OS_MAC) 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 d1cd1fb60..cbd1bcd9a 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_inputs.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_inputs.cpp @@ -27,8 +27,6 @@ # endif // HAVE_XCURSOR #endif // defined(NL_OS_UNIX) && !defined(NL_OS_MAC) -#include "nel/misc/mouse_device.h" -#include "nel/misc/di_event_emitter.h" #include "nel/3d/u_driver.h" #include "nel/misc/file.h" @@ -666,149 +664,6 @@ bool CDriverGL::isSystemCursorCaptured() #endif } -// *************************************************************************** -NLMISC::IMouseDevice* CDriverGL::enableLowLevelMouse(bool enable, bool exclusive) -{ - H_AUTO_OGL(CDriverGL_enableLowLevelMouse); - - NLMISC::IMouseDevice *res = NULL; - -#ifdef NL_OS_WINDOWS - - NLMISC::CDIEventEmitter *diee = NULL; - - if (_EventEmitter.getNumEmitters() > 1) - diee = NLMISC::safe_cast(_EventEmitter.getEmitter(1)); - - if (enable) - { - try - { - if (diee) - res = diee->getMouseDevice(exclusive); - } - catch (const EDirectInput &) - { - } - } - else - { - if (diee) - diee->releaseMouse(); - } - -#elif defined(NL_OS_MAC) -#elif defined (NL_OS_UNIX) -#endif - - return res; -} - -// *************************************************************************** -NLMISC::IKeyboardDevice* CDriverGL::enableLowLevelKeyboard(bool enable) -{ - H_AUTO_OGL(CDriverGL_enableLowLevelKeyboard); - - NLMISC::IKeyboardDevice *res = NULL; - -#ifdef NL_OS_WINDOWS - - NLMISC::CDIEventEmitter *diee = NULL; - - if (_EventEmitter.getNumEmitters() > 1) - diee = NLMISC::safe_cast(_EventEmitter.getEmitter(1)); - - if (enable) - { - try - { - if (diee) - res = diee->getKeyboardDevice(); - } - catch (const EDirectInput &) - { - } - } - else - { - if (diee) - diee->releaseKeyboard(); - } - -#elif defined(NL_OS_MAC) -#elif defined (NL_OS_UNIX) -#endif - - return res; -} - -// *************************************************************************** -NLMISC::IInputDeviceManager* CDriverGL::getLowLevelInputDeviceManager() -{ - H_AUTO_OGL(CDriverGL_getLowLevelInputDeviceManager); - - NLMISC::IInputDeviceManager *res = NULL; - -#ifdef NL_OS_WINDOWS - - if (_EventEmitter.getNumEmitters() > 1) - res = NLMISC::safe_cast(_EventEmitter.getEmitter(1)); - -#elif defined(NL_OS_MAC) -#elif defined (NL_OS_UNIX) -#endif - - return res; -} - -// *************************************************************************** -uint CDriverGL::getDoubleClickDelay(bool hardwareMouse) -{ - H_AUTO_OGL(CDriverGL_getDoubleClickDelay); - - uint res = 250; - -#ifdef NL_OS_WINDOWS - - NLMISC::IMouseDevice *md = NULL; - - if (_EventEmitter.getNumEmitters() >= 2) - { - NLMISC::CDIEventEmitter *diee = NLMISC::safe_cast(_EventEmitter.getEmitter(1)); - if (diee->isMouseCreated()) - { - try - { - md = diee->getMouseDevice(hardwareMouse); - } - catch (const EDirectInput &) - { - // could not get device .. - } - } - } - - if (md) - { - res = md->getDoubleClickDelay(); - } - else - { - // try to read the good value from windows - res = ::GetDoubleClickTime(); - } - -#elif defined(NL_OS_MAC) - // TODO: Missing Mac Implementation for getDoubleClickDelay -#elif defined (NL_OS_UNIX) - - // TODO for Linux - -#endif - - return res; -} - bool CDriverGL::getBestCursorSize(uint srcWidth, uint srcHeight, uint &dstWidth, uint &dstHeight) { #ifdef NL_OS_WINDOWS 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 ed43fe8c3..95c8e61f2 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_material.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_material.cpp @@ -403,7 +403,7 @@ bool CDriverGL::setupMaterial(CMaterial& mat) // Must setup textures each frame. (need to test if touched). // Must separate texture setup and texture activation in 2 "for"... // because setupTexture() may disable all stage. - if (matShader != CMaterial::Water + if (matShader != CMaterial::Water && ((matShader != CMaterial::Program) || (_LastSetuppedPP->features().MaterialFlags & CProgramFeatures::TextureStages)) ) { @@ -2087,14 +2087,16 @@ void CDriverGL::setupCloudPass (uint /* pass */) glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_ALPHA_NV, GL_SRC_ALPHA); activateTexEnvColor (1, mat.getColor()); } - else + else if (ATICloudShaderHandle) { // TODO : for now the state is not cached in _CurrentTexEnvSpecial nglBindFragmentShaderATI(ATICloudShaderHandle); glEnable(GL_FRAGMENT_SHADER_ATI); float cst[4] = { 0.f, 0.f, 0.f, mat.getColor().A / 255.f }; nglSetFragmentShaderConstantATI(GL_CON_0_ATI, cst); - /* + } + else + { _DriverGLStates.activeTextureARB(0); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT); // Operator. @@ -2130,7 +2132,6 @@ void CDriverGL::setupCloudPass (uint /* pass */) glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_SRC_COLOR); glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_EXT, GL_CONSTANT_EXT ); glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_EXT, GL_SRC_ALPHA); - */ } #endif } diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_matrix.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_matrix.cpp index 855c10c21..41575024c 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_matrix.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_matrix.cpp @@ -37,19 +37,11 @@ void CDriverGL::setFrustum(float left, float right, float bottom, float top, flo if (perspective) { -#ifdef USE_OPENGLES - glFrustumf(left,right,bottom,top,znear,zfar); -#else glFrustum(left,right,bottom,top,znear,zfar); -#endif } else { -#ifdef USE_OPENGLES - glOrthof(left,right,bottom,top,znear,zfar); -#else glOrtho(left,right,bottom,top,znear,zfar); -#endif } _ProjMatDirty = true; 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 60a0609dc..8ec7a6bc8 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_states.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_states.cpp @@ -155,11 +155,7 @@ void CDriverGLStates::forceDefaults(uint nbStages) for(stage=0;stagesupportPackedDepthStencil(); TextureUsedIdx = 0; } @@ -97,96 +93,77 @@ CTextureDrvInfosGL::~CTextureDrvInfosGL() { _Driver->_TextureUsed[TextureUsedIdx] = NULL; } +} + +CDepthStencilFBO::CDepthStencilFBO(CDriverGL *driver, uint width, uint height) +{ + nldebug("3D: Init shared FBO"); + + m_Driver = driver; + Width = width; + Height = height; + + bool packedDepthStencil = driver->supportPackedDepthStencil(); + nglGenRenderbuffersEXT(1, &DepthFBOId); + if (packedDepthStencil) + StencilFBOId = DepthFBOId; + else + nglGenRenderbuffersEXT(1, &StencilFBOId); - if(InitFBO) + if (packedDepthStencil) { -#ifdef USE_OPENGLES - nglDeleteFramebuffersOES(1, &FBOId); - if(AttachDepthStencil) - { - nglDeleteRenderbuffersOES(1, &DepthFBOId); - if(!UsePackedDepthStencil) - nglDeleteRenderbuffersOES(1, &StencilFBOId); - } -#else - nglDeleteFramebuffersEXT(1, &FBOId); - if(AttachDepthStencil) - { - nglDeleteRenderbuffersEXT(1, &DepthFBOId); - if(!UsePackedDepthStencil) - nglDeleteRenderbuffersEXT(1, &StencilFBOId); - } -#endif + //nldebug("3D: using packed depth stencil"); + nglBindRenderbufferEXT(GL_RENDERBUFFER_EXT, StencilFBOId); + nglRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH24_STENCIL8_EXT, width, height); + } + else + { + nglBindRenderbufferEXT(GL_RENDERBUFFER_EXT, DepthFBOId); + nglRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24, width, height); + /* + nglBindRenderbufferEXT(GL_RENDERBUFFER_EXT, StencilFBOId); + nglRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_STENCIL_INDEX8_EXT, width, height); + */ + } + + nlassert(DepthFBOId); + nlassert(StencilFBOId); + + driver->_DepthStencilFBOs.push_back(this); +} + +CDepthStencilFBO::~CDepthStencilFBO() +{ + // driver remove + m_Driver->_DepthStencilFBOs.erase(std::find(m_Driver->_DepthStencilFBOs.begin(), m_Driver->_DepthStencilFBOs.end(), this)); + + if (DepthFBOId) + { + nldebug("3D: Release shared FBO"); + nglDeleteRenderbuffersEXT(1, &DepthFBOId); + if (StencilFBOId == DepthFBOId) + StencilFBOId = 0; + DepthFBOId = 0; + } + if (StencilFBOId) + { + nglDeleteRenderbuffersEXT(1, &StencilFBOId); + StencilFBOId = 0; } } // *************************************************************************** bool CTextureDrvInfosGL::initFrameBufferObject(ITexture * tex) { - if(!InitFBO) + if (!InitFBO) { - if(tex->isBloomTexture()) + if (tex->isBloomTexture()) { AttachDepthStencil = !((CTextureBloom*)tex)->isMode2D(); } -#ifdef USE_OPENGLES - // generate IDs - nglGenFramebuffersOES(1, &FBOId); - if(AttachDepthStencil) - { - nglGenRenderbuffersOES(1, &DepthFBOId); - if(UsePackedDepthStencil) - StencilFBOId = DepthFBOId; - else - nglGenRenderbuffersOES(1, &StencilFBOId); - } - - //nldebug("3D: using depth %d and stencil %d", DepthFBOId, StencilFBOId); - - // initialize FBO - nglBindFramebufferOES(GL_FRAMEBUFFER_OES, FBOId); - nglFramebufferTexture2DOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, TextureMode, ID, 0); - - // attach depth/stencil render to FBO - // note: for some still unkown reason it's impossible to add - // a stencil buffer as shown in the respective docs (see - // opengl.org extension registry). Until a safe approach to add - // them is found, there will be no attached stencil for the time - // being, aside of using packed depth+stencil buffers. - if(AttachDepthStencil) - { - if(UsePackedDepthStencil) - { - //nldebug("3D: using packed depth stencil"); - nglBindRenderbufferOES(GL_RENDERBUFFER_OES, StencilFBOId); - nglRenderbufferStorageOES(GL_RENDERBUFFER_OES, GL_DEPTH24_STENCIL8_OES, tex->getWidth(), tex->getHeight()); - } - else - { - nglBindRenderbufferOES(GL_RENDERBUFFER_OES, DepthFBOId); - nglRenderbufferStorageOES(GL_RENDERBUFFER_OES, GL_DEPTH_COMPONENT24_OES, tex->getWidth(), tex->getHeight()); - /* - nglBindRenderbufferEXT(GL_RENDERBUFFER_OES, StencilFBOId); - nglRenderbufferStorageEXT(GL_RENDERBUFFER_OES, GL_STENCIL_INDEX8_EXT, tex->getWidth(), tex->getHeight()); - */ - } - nglFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_DEPTH_ATTACHMENT_OES, GL_RENDERBUFFER_OES, DepthFBOId); - nldebug("3D: glFramebufferRenderbufferExt(depth:24) = %X", nglCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES)); - nglFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_STENCIL_ATTACHMENT_OES, GL_RENDERBUFFER_OES, StencilFBOId); - nldebug("3D: glFramebufferRenderbufferExt(stencil:8) = %X", nglCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES)); - } -#else // generate IDs nglGenFramebuffersEXT(1, &FBOId); - if(AttachDepthStencil) - { - nglGenRenderbuffersEXT(1, &DepthFBOId); - if(UsePackedDepthStencil) - StencilFBOId = DepthFBOId; - else - nglGenRenderbuffersEXT(1, &StencilFBOId); - } //nldebug("3D: using depth %d and stencil %d", DepthFBOId, StencilFBOId); @@ -194,45 +171,32 @@ bool CTextureDrvInfosGL::initFrameBufferObject(ITexture * tex) nglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, FBOId); nglFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, TextureMode, ID, 0); - // attach depth/stencil render to FBO - // note: for some still unkown reason it's impossible to add - // a stencil buffer as shown in the respective docs (see - // opengl.org extension registry). Until a safe approach to add - // them is found, there will be no attached stencil for the time - // being, aside of using packed depth+stencil buffers. - if(AttachDepthStencil) + // attach depth stencil + if (AttachDepthStencil) { - if(UsePackedDepthStencil) + for (std::vector::iterator it(_Driver->_DepthStencilFBOs.begin()), end(_Driver->_DepthStencilFBOs.end()); it != end; ++it) { - //nldebug("3D: using packed depth stencil"); - nglBindRenderbufferEXT(GL_RENDERBUFFER_EXT, StencilFBOId); - nglRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH24_STENCIL8_EXT, tex->getWidth(), tex->getHeight()); + if ((*it)->Width == tex->getWidth() && (*it)->Height == tex->getHeight()) + { + DepthStencilFBO = (*it); + break; + } } - else + if (!DepthStencilFBO) { - nglBindRenderbufferEXT(GL_RENDERBUFFER_EXT, DepthFBOId); - nglRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24, tex->getWidth(), tex->getHeight()); - /* - nglBindRenderbufferEXT(GL_RENDERBUFFER_EXT, StencilFBOId); - nglRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_STENCIL_INDEX8_EXT, tex->getWidth(), tex->getHeight()); - */ + DepthStencilFBO = new CDepthStencilFBO(_Driver, tex->getWidth(), tex->getHeight()); } nglFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, - GL_RENDERBUFFER_EXT, DepthFBOId); + GL_RENDERBUFFER_EXT, DepthStencilFBO->DepthFBOId); nldebug("3D: glFramebufferRenderbufferExt(depth:24) = %X", nglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT)); nglFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, - GL_RENDERBUFFER_EXT, StencilFBOId); + GL_RENDERBUFFER_EXT, DepthStencilFBO->StencilFBOId); nldebug("3D: glFramebufferRenderbufferExt(stencil:8) = %X", nglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT)); } -#endif // check status - GLenum status; -#ifdef USE_OPENGLES - status = (GLenum) nglCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES); -#else - status = (GLenum) nglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); -#endif + GLenum status = (GLenum) nglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); + switch(status) { #ifdef GL_FRAMEBUFFER_COMPLETE_EXT case GL_FRAMEBUFFER_COMPLETE_EXT: @@ -332,24 +296,11 @@ bool CTextureDrvInfosGL::initFrameBufferObject(ITexture * tex) // clean up resources if allocation failed if (!InitFBO) { -#ifdef USE_OPENGLES - nglDeleteFramebuffersOES(1, &FBOId); -#else nglDeleteFramebuffersEXT(1, &FBOId); -#endif + if (AttachDepthStencil) { -#ifdef USE_OPENGLES - nglDeleteRenderbuffersOES(1, &DepthFBOId); -#else - nglDeleteRenderbuffersEXT(1, &DepthFBOId); -#endif - if(!UsePackedDepthStencil) -#ifdef USE_OPENGLES - nglDeleteRenderbuffersOES(1, &StencilFBOId); -#else - nglDeleteRenderbuffersEXT(1, &StencilFBOId); -#endif + DepthStencilFBO = NULL; } } @@ -366,22 +317,14 @@ bool CTextureDrvInfosGL::activeFrameBufferObject(ITexture * tex) if(initFrameBufferObject(tex)) { glBindTexture(TextureMode, 0); -#ifdef USE_OPENGLES - nglBindFramebufferOES(GL_FRAMEBUFFER_OES, FBOId); -#else nglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, FBOId); -#endif } else return false; } else { -#ifdef USE_OPENGLES - nglBindFramebufferOES(GL_FRAMEBUFFER_OES, 0); -#else nglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); -#endif } return true; @@ -489,11 +432,7 @@ GLint CDriverGL::getGlTextureFormat(ITexture& tex, bool &compressed) break; } -#ifdef USE_OPENGLES - return GL_RGBA; -#else return GL_RGBA8; -#endif } // *************************************************************************** @@ -502,11 +441,7 @@ static GLint getGlSrcTextureFormat(ITexture &tex, GLint glfmt) H_AUTO_OGL(getGlSrcTextureFormat) // Is destination format is alpha or lumiance ? -#ifdef USE_OPENGLES - if ((glfmt==GL_ALPHA)||(glfmt==GL_LUMINANCE_ALPHA)||(glfmt==GL_LUMINANCE)) -#else if ((glfmt==GL_ALPHA8)||(glfmt==GL_LUMINANCE8_ALPHA8)||(glfmt==GL_LUMINANCE8)) -#endif { switch(tex.getPixelFormat()) { @@ -559,19 +494,9 @@ uint CDriverGL::computeMipMapMemoryUsage(uint w, uint h, GLint glfmt) const H_AUTO_OGL(CDriverGL_computeMipMapMemoryUsage) switch(glfmt) { -#ifdef GL_RGBA8 case GL_RGBA8: return w*h* 4; -#endif -#ifdef GL_RGBA - case GL_RGBA: return w*h* 4; -#endif // Well this is ugly, but simple :). GeForce 888 is stored as 32 bits. -#ifdef GL_RGB8 case GL_RGB8: return w*h* 4; -#endif -#ifdef GL_RGB - case GL_RGB: return w*h* 4; -#endif #ifdef GL_RGBA4 case GL_RGBA4: return w*h* 2; #endif @@ -581,24 +506,9 @@ uint CDriverGL::computeMipMapMemoryUsage(uint w, uint h, GLint glfmt) const #ifdef GL_RGB5 case GL_RGB5: return w*h* 2; #endif -#ifdef GL_LUMINANCE8 case GL_LUMINANCE8: return w*h* 1; -#endif -#ifdef GL_LUMINANCE - case GL_LUMINANCE: return w*h* 1; -#endif -#ifdef GL_ALPHA8 case GL_ALPHA8: return w*h* 1; -#endif -#ifdef GL_ALPHA - case GL_ALPHA: return w*h* 1; -#endif -#ifdef GL_LUMINANCE8_ALPHA8 case GL_LUMINANCE8_ALPHA8: return w*h* 2; -#endif -#ifdef GL_LUMINANCE_ALPHA - case GL_LUMINANCE_ALPHA: return w*h* 2; -#endif #ifdef GL_COMPRESSED_RGB_S3TC_DXT1_EXT case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: return w*h /2; #endif @@ -2260,16 +2170,13 @@ void CDriverGL::swapTextureHandle(ITexture &tex0, ITexture &tex1) swap(t0->MinFilter, t1->MinFilter); swap(t0->TextureMode, t1->TextureMode); swap(t0->FBOId, t1->FBOId); - swap(t0->DepthFBOId, t1->DepthFBOId); - swap(t0->StencilFBOId, t1->StencilFBOId); + swap(t0->DepthStencilFBO, t1->DepthStencilFBO); swap(t0->InitFBO, t1->InitFBO); - swap(t0->AttachDepthStencil, t1->AttachDepthStencil); - swap(t0->UsePackedDepthStencil, t1->UsePackedDepthStencil); } // *************************************************************************** -uint CDriverGL::getTextureHandle(const ITexture &tex) +uintptr_t CDriverGL::getTextureHandle(const ITexture &tex) { H_AUTO_OGL(CDriverGL_getTextureHandle) // If DrvShare not setuped @@ -2314,11 +2221,16 @@ bool CDriverGL::setRenderTarget (ITexture *tex, uint32 x, uint32 y, uint32 width if(tex->isBloomTexture() && supportBloomEffect()) { + // NOTE: No support for mip map level here! + uint32 w, h; getWindowSize(w, h); getViewport(_OldViewport); + if (!width) width = tex->getWidth(); + if (!height) height = tex->getHeight(); + CViewport newVP; newVP.init(0, 0, ((float)width/(float)w), ((float)height/(float)h)); setupViewport(newVP); @@ -2401,10 +2313,11 @@ bool CDriverGL::copyTargetToTexture (ITexture *tex, bool CDriverGL::getRenderTargetSize (uint32 &width, uint32 &height) { H_AUTO_OGL(CDriverGL_getRenderTargetSize) - if (_TextureTarget) + NLMISC::CSmartPtr tex = _RenderTargetFBO ? _RenderTargetFBO : (_TextureTarget ? _TextureTarget : NULL); + if (tex) { - width = _TextureTarget->getWidth(); - height = _TextureTarget->getHeight(); + width = tex->getWidth(); + height = tex->getHeight(); } else { diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp index c71e82ce4..cab62f094 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp @@ -147,9 +147,9 @@ bool CDriverGL::setupVertexBuffer(CVertexBuffer& VB) CVBDrvInfosGL *info = new CVBDrvInfosGL(this, it, &VB); *it= VB.DrvInfos = info; - // Preferred memory + // Preferred memory, AGPVolatile only goes through when ARBMapBufferRange is available CVertexBuffer::TPreferredMemory preferred = VB.getPreferredMemory (); - if ((preferred == CVertexBuffer::RAMVolatile) || (preferred == CVertexBuffer::AGPVolatile)) + if ((preferred == CVertexBuffer::RAMVolatile) || (preferred == CVertexBuffer::AGPVolatile && !_Extensions.ARBMapBufferRange)) preferred = CVertexBuffer::RAMPreferred; const uint size = VB.capacity()*VB.getVertexSize(); uint preferredMemory = _Extensions.DisableHardwareVertexArrayAGP ? CVertexBuffer::RAMPreferred : preferred; @@ -159,6 +159,12 @@ bool CDriverGL::setupVertexBuffer(CVertexBuffer& VB) info->_VBHard = createVertexBufferHard(size, VB.capacity(), (CVertexBuffer::TPreferredMemory)preferredMemory, &VB); if (info->_VBHard) break; + + if ((CVertexBuffer::TPreferredMemory)preferredMemory == CVertexBuffer::AGPVolatile) + { + preferredMemory = CVertexBuffer::RAMPreferred; + break; + } preferredMemory--; } @@ -170,7 +176,7 @@ bool CDriverGL::setupVertexBuffer(CVertexBuffer& VB) } // Upload the data - VB.setLocation ((CVertexBuffer::TLocation)preferredMemory); + VB.setLocation(preferredMemory == CVertexBuffer::AGPVolatile ? CVertexBuffer::AGPResident : (CVertexBuffer::TLocation)preferredMemory); } } @@ -740,7 +746,7 @@ bool CDriverGL::supportVertexBufferHard() const bool CDriverGL::supportVolatileVertexBuffer() const { H_AUTO_OGL(CDriverGL_supportVolatileVertexBuffer) - return false; + return _Extensions.ARBMapBufferRange; } @@ -769,6 +775,7 @@ IVertexBufferHardGL *CDriverGL::createVertexBufferHard(uint size, uint numVertic IVertexArrayRange *vertexArrayRange= NULL; switch(vbType) { + case CVertexBuffer::AGPVolatile: case CVertexBuffer::AGPPreferred: vertexArrayRange= _AGPVertexArrayRange; break; 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 79c55ea16..25c7da614 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 @@ -1174,6 +1174,9 @@ bool CVertexArrayRangeARB::allocate(uint32 size, CVertexBuffer::TPreferredMemory switch(vbType) { + case CVertexBuffer::AGPVolatile: + glBufferDataARB(GL_ARRAY_BUFFER_ARB, size, NULL, GL_STREAM_DRAW_ARB); + break; case CVertexBuffer::AGPPreferred: glBufferDataARB(GL_ARRAY_BUFFER_ARB, size, NULL, GL_DYNAMIC_DRAW_ARB); break; @@ -1213,21 +1216,19 @@ IVertexBufferHardGL *CVertexArrayRangeARB::createVBHardGL(uint size, CVertexBuff GLuint vertexBufferID; glGetError(); -#ifdef USE_OPENGLES - glGenBuffers(1, &vertexBufferID); -#else nglGenBuffersARB(1, &vertexBufferID); -#endif if (glGetError() != GL_NO_ERROR) return NULL; _Driver->_DriverGLStates.forceBindARBVertexBuffer(vertexBufferID); - switch(_VBType) + CVertexBuffer::TPreferredMemory preferred = vb->getPreferredMemory(); + switch (preferred) { - case CVertexBuffer::AGPPreferred: + case CVertexBuffer::AGPVolatile: #ifdef USE_OPENGLES + // TODO: GL_STREAM_DRAW doesn't exist in OpenGL ES 1.x glBufferData(GL_ARRAY_BUFFER, size, NULL, GL_DYNAMIC_DRAW); #else - nglBufferDataARB(GL_ARRAY_BUFFER_ARB, size, NULL, GL_DYNAMIC_DRAW_ARB); + nglBufferDataARB(GL_ARRAY_BUFFER_ARB, size, NULL, GL_STREAM_DRAW_ARB); #endif break; case CVertexBuffer::StaticPreferred: @@ -1244,22 +1245,23 @@ IVertexBufferHardGL *CVertexArrayRangeARB::createVBHardGL(uint size, CVertexBuff nglBufferDataARB(GL_ARRAY_BUFFER_ARB, size, NULL, GL_DYNAMIC_DRAW_ARB); #endif break; + // case CVertexBuffer::AGPPreferred: default: - nlassert(0); +#ifdef USE_OPENGLES + glBufferData(GL_ARRAY_BUFFER, size, NULL, GL_DYNAMIC_DRAW); +#else + nglBufferDataARB(GL_ARRAY_BUFFER_ARB, size, NULL, GL_DYNAMIC_DRAW_ARB); +#endif break; } if (glGetError() != GL_NO_ERROR) { -#ifdef USE_OPENGLES - glDeleteBuffers(1, &vertexBufferID); -#else nglDeleteBuffersARB(1, &vertexBufferID); -#endif return NULL; } CVertexBufferHardARB *newVbHard= new CVertexBufferHardARB(_Driver, vb); - newVbHard->initGL(vertexBufferID, this, _VBType); + newVbHard->initGL(vertexBufferID, this, preferred); _Driver->_DriverGLStates.forceBindARBVertexBuffer(0); return newVbHard; } @@ -1297,13 +1299,10 @@ void CVertexArrayRangeARB::updateLostBuffers() { nlassert((*it)->_VertexObjectId); GLuint id = (GLuint) (*it)->_VertexObjectId; -#ifdef USE_OPENGLES - nlassert(glIsBuffer(id)); - glDeleteBuffers(1, &id); -#else + nlassert(nglIsBufferARB(id)); nglDeleteBuffersARB(1, &id); -#endif + (*it)->_VertexObjectId = 0; (*it)->VB->setLocation(CVertexBuffer::NotResident); } @@ -1352,13 +1351,8 @@ CVertexBufferHardARB::~CVertexBufferHardARB() if (_VertexObjectId) { GLuint id = (GLuint) _VertexObjectId; -#ifdef USE_OPENGLES - nlassert(glIsBuffer(id)); - glDeleteBuffers(1, &id); -#else nlassert(nglIsBufferARB(id)); nglDeleteBuffersARB(1, &id); -#endif } if (_VertexArrayRange) { @@ -1393,6 +1387,7 @@ void *CVertexBufferHardARB::lock() H_AUTO_OGL(CVertexBufferHardARB_lock); if (_VertexPtr) return _VertexPtr; // already locked + const uint size = VB->getNumVertices() * VB->getVertexSize(); if (_Invalid) { if (VB->getLocation() != CVertexBuffer::NotResident) @@ -1402,55 +1397,42 @@ void *CVertexBufferHardARB::lock() } // recreate a vb GLuint vertexBufferID; - -#ifdef USE_OPENGLES - glGenBuffers(1, &vertexBufferID); -#else nglGenBuffersARB(1, &vertexBufferID); -#endif if (glGetError() != GL_NO_ERROR) { _Driver->incrementResetCounter(); return &_DummyVB[0]; } - const uint size = VB->getNumVertices() * VB->getVertexSize(); _Driver->_DriverGLStates.forceBindARBVertexBuffer(vertexBufferID); switch(_MemType) { - case CVertexBuffer::AGPPreferred: + case CVertexBuffer::AGPVolatile: #ifdef USE_OPENGLES + // TODO: GL_STREAM_DRAW doesn't exist in OpenGL ES 1.x glBufferData(GL_ARRAY_BUFFER, size, NULL, GL_DYNAMIC_DRAW); #else - nglBufferDataARB(GL_ARRAY_BUFFER_ARB, size, NULL, GL_DYNAMIC_DRAW_ARB); + nglBufferDataARB(GL_ARRAY_BUFFER_ARB, size, NULL, GL_STREAM_DRAW_ARB); #endif break; case CVertexBuffer::StaticPreferred: if (_Driver->getStaticMemoryToVRAM()) -#ifdef USE_OPENGLES - glBufferData(GL_ARRAY_BUFFER, size, NULL, GL_STATIC_DRAW); -#else nglBufferDataARB(GL_ARRAY_BUFFER_ARB, size, NULL, GL_STATIC_DRAW_ARB); -#endif else -#ifdef USE_OPENGLES - glBufferData(GL_ARRAY_BUFFER, size, NULL, GL_DYNAMIC_DRAW); -#else nglBufferDataARB(GL_ARRAY_BUFFER_ARB, size, NULL, GL_DYNAMIC_DRAW_ARB); -#endif break; + // case CVertexBuffer::AGPPreferred: default: - nlassert(0); + nglBufferDataARB(GL_ARRAY_BUFFER_ARB, size, NULL, GL_DYNAMIC_DRAW_ARB); + break; } if (glGetError() != GL_NO_ERROR) { _Driver->incrementResetCounter(); -#ifdef USE_OPENGLES - glDeleteBuffers(1, &vertexBufferID); -#else + nglDeleteBuffersARB(1, &vertexBufferID); -#endif + return &_DummyVB[0];; } _VertexObjectId = vertexBufferID; @@ -1499,7 +1481,14 @@ void *CVertexBufferHardARB::lock() _LastBufferSize = size; } #else - _VertexPtr = nglMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); + if (_MemType == CVertexBuffer::AGPVolatile) + { + _VertexPtr = nglMapBufferRange(GL_ARRAY_BUFFER, 0, size, GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT); + } + else + { + _VertexPtr = nglMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); + } if (!_VertexPtr) { nglUnmapBufferARB(GL_ARRAY_BUFFER_ARB); @@ -1546,12 +1535,10 @@ void CVertexBufferHardARB::unlock() #ifdef USE_OPENGLES if (_Driver->_Extensions.OESMapBuffer) +#endif { - unmapOk = nglUnmapBufferOES(GL_ARRAY_BUFFER); + unmapOk = nglUnmapBufferARB(GL_ARRAY_BUFFER_ARB); } -#else - unmapOk = nglUnmapBufferARB(GL_ARRAY_BUFFER_ARB); -#endif #ifdef NL_DEBUG _Unmapping = false; 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 5470ec5c5..22bc5ff5a 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 @@ -453,7 +453,6 @@ bool CDriverGL::setupEXTVertexShader(const CVPParser::TProgram &program, GLuint // clear last error GLenum glError = glGetError(); - //variants[EVSSecondaryColorVariant] = nglGenSymbolsEXT(GL_VECTOR_EXT, GL_VARIANT_EXT, GL_NORMALIZED_RANGE_EXT, 1); //variants[EVSSecondaryColorVariant] = nglGenSymbolsEXT(GL_VECTOR_EXT, GL_VARIANT_EXT, GL_NORMALIZED_RANGE_EXT, 1); // allocate the symbols diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp index 07c800cdc..943371fd9 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp @@ -38,8 +38,6 @@ # define _NET_WM_STATE_ADD 1 #endif // NL_OS_UNIX -#include "nel/misc/mouse_device.h" -#include "nel/misc/di_event_emitter.h" #include "nel/3d/u_driver.h" #include "nel/misc/file.h" @@ -255,7 +253,7 @@ bool GlWndProc(CDriverGL *driver, XEvent &e) unsigned long nitems_return = 0; unsigned long bytes_after_return = 0; long *data = NULL; - + int status = XGetWindowProperty(driver->_dpy, driver->_win, XA_FRAME_EXTENTS, 0, 4, False, XA_CARDINAL, &type_return, &format_return, &nitems_return, &bytes_after_return, (unsigned char**)&data); // succeeded to retrieve decoration size @@ -270,7 +268,7 @@ bool GlWndProc(CDriverGL *driver, XEvent &e) driver->_DecorationWidth = e.xconfigure.x - driver->_WindowX; driver->_DecorationHeight = e.xconfigure.y - driver->_WindowY; } - + // don't allow negative decoration sizes if (driver->_DecorationWidth < 0) driver->_DecorationWidth = 0; if (driver->_DecorationHeight < 0) driver->_DecorationHeight = 0; @@ -296,7 +294,7 @@ bool GlWndProc(CDriverGL *driver, XEvent &e) #endif // NL_OS_UNIX // *************************************************************************** -bool CDriverGL::init (uint windowIcon, emptyProc exitFunc) +bool CDriverGL::init (uintptr_t windowIcon, emptyProc exitFunc) { H_AUTO_OGL(CDriverGL_init) @@ -465,6 +463,7 @@ bool CDriverGL::unInit() { nlwarning("Can't unregister NLClass"); } + _Registered = 0; // Restaure monitor color parameters if (_NeedToRestaureGammaRamp) @@ -604,6 +603,9 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re { H_AUTO_OGL(CDriverGL_setDisplay) + if (!mode.OffScreen) + NLMISC::INelContext::getInstance().setWindowedApplication(true); + _win = EmptyWindow; _CurrentMode = mode; @@ -628,10 +630,15 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re // Offscreen mode ? if (_CurrentMode.OffScreen) { -#if 0 - if (!createWindow(mode)) - return false; + if (!createWindow(mode)) return false; + + HWND tmpHWND = _win; + int width = mode.Width; + int height = mode.Height; +#ifdef USE_OPENGLES + // TODO: implement for OpenGL ES 1.x +#else // resize the window RECT rc; SetRect (&rc, 0, 0, width, height); @@ -940,20 +947,6 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re // setup the event emitter, and try to retrieve a direct input interface _EventEmitter.addEmitter(we, true /*must delete*/); // the main emitter - /// try to get direct input - try - { - NLMISC::CDIEventEmitter *diee = NLMISC::CDIEventEmitter::create(GetModuleHandle(NULL), _win, we); - if (diee) - { - _EventEmitter.addEmitter(diee, true); - } - } - catch(const EDirectInput &e) - { - nlinfo(e.what()); - } - #elif defined(NL_OS_MAC) if (wnd == EmptyWindow) @@ -1452,8 +1445,17 @@ bool CDriverGL::createWindow(const GfxMode &mode) #ifdef NL_OS_WINDOWS // create the OpenGL window - window = CreateWindowW(L"NLClass", L"NeL Window", WS_OVERLAPPEDWINDOW|WS_CLIPCHILDREN|WS_CLIPSIBLINGS, - CW_USEDEFAULT, CW_USEDEFAULT, mode.Width, mode.Height, HWND_DESKTOP, NULL, GetModuleHandle(NULL), NULL); + DWORD dwStyle = WS_OVERLAPPEDWINDOW|WS_CLIPCHILDREN|WS_CLIPSIBLINGS; + int pos = CW_USEDEFAULT; + HWND hwndParent = HWND_DESKTOP; + if (mode.OffScreen) + { + dwStyle &= ~WS_VISIBLE; + pos = 0; + hwndParent = NULL; + } + window = CreateWindowW(L"NLClass", L"NeL Window", dwStyle, + pos, pos, mode.Width, mode.Height, hwndParent, NULL, GetModuleHandle(NULL), NULL); if (window == EmptyWindow) { @@ -1484,7 +1486,7 @@ bool CDriverGL::createWindow(const GfxMode &mode) [[CocoaApplicationDelegate alloc] initWithDriver:this]; // set the application delegate, this will handle window/app close events - [NSApp setDelegate:appDelegate]; + [NSApp setDelegate:(id)appDelegate]; // bind the close button of the window to applicationShouldTerminate id closeButton = [cocoa_window standardWindowButton:NSWindowCloseButton]; @@ -1864,6 +1866,19 @@ bool CDriverGL::setMode(const GfxMode& mode) if (!_DestroyWindow) return true; +#if defined(NL_OS_WINDOWS) + // save relative cursor + POINT cursorPos; + cursorPos.x = 0; + cursorPos.y = 0; + + BOOL cursorPosOk = isSystemCursorInClientArea() + && GetCursorPos(&cursorPos) + && ScreenToClient(_win, &cursorPos); + sint curX = (sint)cursorPos.x * (sint)mode.Width; + sint curY = (sint)cursorPos.y * (sint)mode.Height; +#endif + if (!setScreenMode(mode)) return false; @@ -1883,6 +1898,17 @@ bool CDriverGL::setMode(const GfxMode& mode) case 32: _ColorDepth = ColorDepth32; break; } +#if defined(NL_OS_WINDOWS) + // restore relative cursor + if (cursorPosOk) + { + cursorPos.x = curX / (sint)mode.Width; + cursorPos.y = curY / (sint)mode.Height; + ClientToScreen(_win, &cursorPos); + SetCursorPos(cursorPos.x, cursorPos.y); + } +#endif + // set color depth for custom cursor updateCursor(true); @@ -2298,7 +2324,19 @@ void CDriverGL::setWindowPos(sint32 x, sint32 y) #ifdef NL_OS_WINDOWS - SetWindowPos(_win, NULL, x, y, 0, 0, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSIZE); + // save relative cursor + POINT cursorPos; + BOOL cursorPosOk = isSystemCursorInClientArea() + && GetCursorPos(&cursorPos) + && ScreenToClient(_win, &cursorPos); + + SetWindowPos(_win, NULL, x, y, 0, 0, /*SWP_NOZORDER | SWP_NOACTIVATE |*/ SWP_NOSIZE); + + if (cursorPosOk) + { + ClientToScreen(_win, &cursorPos); + SetCursorPos(cursorPos.x, cursorPos.y); + } #elif defined(NL_OS_MAC) // get the rect (position, size) of the screen with menu bar @@ -2469,7 +2507,7 @@ bool CDriverGL::createContext() if (_EglContext == EGL_NO_CONTEXT) { return false; - } + } // Make the context current if (!eglMakeCurrent(_EglDisplay, _EglSurface, _EglSurface, _EglContext)) diff --git a/code/nel/src/3d/driver/opengl/mac/cocoa_event_emitter.cpp b/code/nel/src/3d/driver/opengl/mac/cocoa_event_emitter.cpp index d290e0cee..6206d94c3 100644 --- a/code/nel/src/3d/driver/opengl/mac/cocoa_event_emitter.cpp +++ b/code/nel/src/3d/driver/opengl/mac/cocoa_event_emitter.cpp @@ -270,28 +270,14 @@ bool CCocoaEventEmitter::processMessage(NSEvent* event, CEventServer* server) return false; } - // first event about mouse movement after setting to emulateRawMode - if(_setToEmulateRawMode && - (event.type == NSMouseMoved || - event.type == NSLeftMouseDragged || - event.type == NSRightMouseDragged)) - { - // do not report because it reflects wrapping pointer to 0.5/0.5 - _setToEmulateRawMode = false; - return false; - } - // convert the modifiers for nel to pass them with the events - NLMISC::TKeyButton modifiers = - modifierFlagsToNelKeyButton([event modifierFlags]); + NLMISC::TKeyButton modifiers = modifierFlagsToNelKeyButton([event modifierFlags]); switch(event.type) { case NSLeftMouseDown: { - server->postEvent(new NLMISC::CEventMouseDown( - mousePos.x, mousePos.y, - (NLMISC::TMouseButton)(NLMISC::leftButton | modifiers), this)); + server->postEvent(new NLMISC::CEventMouseDown(mousePos.x, mousePos.y, (NLMISC::TMouseButton)(NLMISC::leftButton | modifiers), this)); } break; case NSLeftMouseUp: @@ -319,15 +305,7 @@ bool CCocoaEventEmitter::processMessage(NSEvent* event, CEventServer* server) { NLMISC::CEvent* nelEvent; - // when emulating raw mode, send the delta in a CGDMouseMove event - if(_emulateRawMode) - nelEvent = new NLMISC::CGDMouseMove( - this, NULL /* no mouse device */, event.deltaX, -event.deltaY); - - // normally send position in a CEventMouseMove - else - nelEvent = new NLMISC::CEventMouseMove( - mousePos.x, mousePos.y, (NLMISC::TMouseButton)modifiers, this); + nelEvent = new NLMISC::CEventMouseMove(mousePos.x, mousePos.y, (NLMISC::TMouseButton)modifiers, this); server->postEvent(nelEvent); break; @@ -336,15 +314,7 @@ bool CCocoaEventEmitter::processMessage(NSEvent* event, CEventServer* server) { NLMISC::CEvent* nelEvent; - // when emulating raw mode, send the delta in a CGDMouseMove event - if(_emulateRawMode) - nelEvent = new NLMISC::CGDMouseMove( - this, NULL /* no mouse device */, event.deltaX, -event.deltaY); - - // normally send position in a CEventMouseMove - else - nelEvent = new NLMISC::CEventMouseMove(mousePos.x, mousePos.y, - (NLMISC::TMouseButton)(NLMISC::leftButton | modifiers), this); + nelEvent = new NLMISC::CEventMouseMove(mousePos.x, mousePos.y, (NLMISC::TMouseButton)(NLMISC::leftButton | modifiers), this); server->postEvent(nelEvent); break; @@ -353,15 +323,7 @@ bool CCocoaEventEmitter::processMessage(NSEvent* event, CEventServer* server) { NLMISC::CEvent* nelEvent; - // when emulating raw mode, send the delta in a CGDMouseMove event - if(_emulateRawMode) - nelEvent = new NLMISC::CGDMouseMove( - this, NULL /* no mouse device */, event.deltaX, -event.deltaY); - - // normally send position in a CEventMouseMove - else - nelEvent = new NLMISC::CEventMouseMove(mousePos.x, mousePos.y, - (NLMISC::TMouseButton)(NLMISC::rightButton | modifiers), this); + nelEvent = new NLMISC::CEventMouseMove(mousePos.x, mousePos.y, (NLMISC::TMouseButton)(NLMISC::rightButton | modifiers), this); server->postEvent(nelEvent); break; @@ -434,12 +396,6 @@ bool CCocoaEventEmitter::processMessage(NSEvent* event, CEventServer* server) } } - if(_emulateRawMode && _driver && (event.type == NSMouseMoved || - event.type == NSLeftMouseDragged || event.type == NSRightMouseDragged)) - { - _driver->setMousePos(0.5, 0.5); - } - return true; } @@ -492,17 +448,4 @@ void CCocoaEventEmitter::submitEvents(CEventServer& server, bool /* allWins */) _server = &server; } -void CCocoaEventEmitter::emulateMouseRawMode(bool enable) -{ - _emulateRawMode = enable; - - if(_emulateRawMode) - { - _setToEmulateRawMode = true; - - if(_driver) - _driver->setMousePos(0.5, 0.5); - } -} - } diff --git a/code/nel/src/3d/driver/opengl/mac/cocoa_event_emitter.h b/code/nel/src/3d/driver/opengl/mac/cocoa_event_emitter.h index 7e46fc6de..960614ef4 100644 --- a/code/nel/src/3d/driver/opengl/mac/cocoa_event_emitter.h +++ b/code/nel/src/3d/driver/opengl/mac/cocoa_event_emitter.h @@ -20,20 +20,17 @@ #include "nel/misc/event_emitter.h" #include "nel/misc/event_server.h" #include "nel/misc/events.h" -#include "nel/misc/game_device_events.h" #include "nel/3d/driver.h" #import "cocoa_opengl_view.h" #include #import -namespace NLMISC +namespace NLMISC { class CCocoaEventEmitter : public IEventEmitter { - bool _emulateRawMode; - bool _setToEmulateRawMode; bool _eventLoop; NL3D::IDriver* _driver; CocoaOpenGLView* _glView; @@ -42,9 +39,7 @@ class CCocoaEventEmitter : public IEventEmitter CEventServer* _server; public: - CCocoaEventEmitter() : - _emulateRawMode(false), - _setToEmulateRawMode(false), + CCocoaEventEmitter() : _driver(NULL), _glView(nil), _server(NULL) { } @@ -52,7 +47,6 @@ public: void init(NL3D::IDriver*, CocoaOpenGLView*, bool eventLoop); bool processMessage(NSEvent* event, CEventServer* server = NULL); virtual void submitEvents(CEventServer& server, bool allWindows); - virtual void emulateMouseRawMode(bool enable); bool handleQuitRequest(); virtual bool copyTextToClipboard(const ucstring &text); diff --git a/code/nel/src/3d/driver/opengl/stdopengl.h b/code/nel/src/3d/driver/opengl/stdopengl.h index 544829b19..ab4eb8316 100644 --- a/code/nel/src/3d/driver/opengl/stdopengl.h +++ b/code/nel/src/3d/driver/opengl/stdopengl.h @@ -37,7 +37,9 @@ #ifdef NL_OS_WINDOWS # define WIN32_LEAN_AND_MEAN -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include # include #endif @@ -81,7 +83,6 @@ #include "nel/misc/event_emitter_multi.h" #include "nel/misc/time_nl.h" #include "nel/misc/rect.h" -#include "nel/misc/mouse_device.h" #include "nel/misc/dynloadlib.h" #include "nel/misc/file.h" diff --git a/code/nel/src/3d/driver/opengl/unix_event_emitter.cpp b/code/nel/src/3d/driver/opengl/unix_event_emitter.cpp index c3a8552ac..be0736bae 100644 --- a/code/nel/src/3d/driver/opengl/unix_event_emitter.cpp +++ b/code/nel/src/3d/driver/opengl/unix_event_emitter.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include "nel/misc/debug.h" @@ -37,7 +37,7 @@ static Atom XA_WM_DELETE_WINDOW = 0; namespace NLMISC { -CUnixEventEmitter::CUnixEventEmitter ():_dpy(NULL), _win(0), _emulateRawMode(false), _driver(NULL) +CUnixEventEmitter::CUnixEventEmitter ():_dpy(NULL), _win(0), _driver(NULL) { _im = 0; _ic = 0; @@ -158,25 +158,6 @@ static Bool isMouseMoveEvent(Display *display, XEvent *event, XPointer arg) return (event->type == MotionNotify); } -void CUnixEventEmitter::emulateMouseRawMode(bool enable) -{ - _emulateRawMode = enable; - - if(_emulateRawMode) - { - XWindowAttributes xwa; - XGetWindowAttributes(_dpy, _win, &xwa); - XWarpPointer(_dpy, None, _win, None, None, None, None, - (xwa.width / 2), (xwa.height / 2)); - - // remove all outstanding mouse move events, they happened before the mouse - // was pulled back to 0.5 / 0.5, so a wrong movement delta would be - // reported otherwise - XEvent event; - while(XCheckIfEvent(_dpy, &event, &isMouseMoveEvent, NULL)) { }; - } -} - #ifndef AltMask # ifdef NL_OS_MAC # define AltMask (8192) @@ -512,33 +493,13 @@ bool CUnixEventEmitter::processMessage (XEvent &event, CEventServer *server) { TMouseButton button=getMouseButton (event.xbutton.state); - // if raw mode should be emulated - if(_emulateRawMode) - { - // when we just wrapped back the pointer to 0.5 / 0.5, ignore event - if(event.xbutton.x == xwa.width / 2 && event.xbutton.y == xwa.height / 2) - break; - - // post a CGDMouseMove with the movement delta to the event server - server->postEvent( - new CGDMouseMove(this, NULL /* no mouse device */, - event.xbutton.x - (xwa.width / 2), - (xwa.height / 2) - event.xbutton.y)); - - // move the pointer back to the center of the window - XWarpPointer(_dpy, None, _win, None, None, None, None, - (xwa.width / 2), (xwa.height / 2)); - } - // if in normal mouse mode - else - { - // get the relative mouse position - float fX = (float) event.xbutton.x / (float) xwa.width; - float fY = 1.0f - (float) event.xbutton.y / (float) xwa.height; + // get the relative mouse position + float fX = (float) event.xbutton.x / (float) xwa.width; + float fY = 1.0f - (float) event.xbutton.y / (float) xwa.height; + + // post a normal mouse move event to the event server + server->postEvent (new CEventMouseMove (fX, fY, button, this)); - // post a normal mouse move event to the event server - server->postEvent (new CEventMouseMove (fX, fY, button, this)); - } break; } case KeyPress: diff --git a/code/nel/src/3d/driver/opengl/unix_event_emitter.h b/code/nel/src/3d/driver/opengl/unix_event_emitter.h index 362ed2086..493c4ad35 100644 --- a/code/nel/src/3d/driver/opengl/unix_event_emitter.h +++ b/code/nel/src/3d/driver/opengl/unix_event_emitter.h @@ -20,7 +20,6 @@ #include "nel/misc/types_nl.h" #include "nel/misc/event_emitter.h" #include "nel/misc/events.h" -#include "nel/misc/game_device_events.h" #include "nel/3d/driver.h" @@ -56,11 +55,6 @@ public: */ virtual void submitEvents(CEventServer & server, bool allWindows); - /** - * enable or disable mouse raw mode - */ - virtual void emulateMouseRawMode(bool emulate); - /** * process input-related events (mouse and keyboard) */ @@ -106,7 +100,6 @@ private: std::map _PressedKeys; XIM _im; XIC _ic; - bool _emulateRawMode; NL3D::IDriver* _driver; CUnixEventServer _InternalServer; ucstring _CopiedString; diff --git a/code/nel/src/3d/driver_user.cpp b/code/nel/src/3d/driver_user.cpp index e5d814755..017a2b6dc 100644 --- a/code/nel/src/3d/driver_user.cpp +++ b/code/nel/src/3d/driver_user.cpp @@ -82,13 +82,13 @@ void UDriver::setMatrixMode2D43() } // *************************************************************************** -UDriver *UDriver::createDriver(uint windowIcon, bool direct3d, emptyProc exitFunc) +UDriver *UDriver::createDriver(uintptr_t windowIcon, bool direct3d, emptyProc exitFunc) { return new CDriverUser (windowIcon, direct3d ? CDriverUser::Direct3d:CDriverUser::OpenGl, exitFunc); } // *************************************************************************** -UDriver *UDriver::createDriver(uint windowIcon, TDriver driver, emptyProc exitFunc) +UDriver *UDriver::createDriver(uintptr_t windowIcon, TDriver driver, emptyProc exitFunc) { return new CDriverUser (windowIcon, (CDriverUser::TDriver)driver, exitFunc); } @@ -110,11 +110,7 @@ void UDriver::purgeMemory() // *************************************************************************** -bool CDriverUser::_StaticInit= false; - - -// *************************************************************************** -CDriverUser::CDriverUser (uint windowIcon, TDriver driver, emptyProc exitFunc) +CDriverUser::CDriverUser (uintptr_t windowIcon, TDriver driver, emptyProc exitFunc) { // The enum of IDriver and UDriver MUST be the same!!! nlassert((uint)IDriver::idCount == (uint)UDriver::idCount); @@ -122,16 +118,7 @@ CDriverUser::CDriverUser (uint windowIcon, TDriver driver, emptyProc exitFunc) nlassert((uint)IDriver::iconCount == (uint)UDriver::iconCount); - // Static Initialisation. - if(!_StaticInit) - { - _StaticInit= true; - // Register basic serial. - NL3D::registerSerial3d(); - - // Register basic csene. - CScene::registerBasics(); - } + NL3D::init3d(); _Driver = NULL; @@ -192,8 +179,11 @@ CDriverUser::CDriverUser (uint windowIcon, TDriver driver, emptyProc exitFunc) _PBTri.lock (iba); iba.setTri(0, 0, 1, 2); + _RenderTargetManager.m_Driver = this; _ShapeBank._DriverUser = this; + _EffectRenderTarget = NULL; + NL_SET_IB_NAME(_PBLine, "CDriverUser::_PBLine"); NL_SET_IB_NAME(_PBTri, "CDriverUser::_PBTri"); } @@ -246,7 +236,7 @@ bool CDriverUser::setDisplay(nlWindow wnd, const CMode &mode, bool show, bool NL3D_HAUTO_UI_DRIVER; // window init. - if (_Driver->setDisplay(wnd, GfxMode(mode.Width, mode.Height, mode.Depth, mode.Windowed, false, mode.Frequency, mode.AntiAlias), show, resizeable)) + if (_Driver->setDisplay(wnd, GfxMode(mode.Width, mode.Height, mode.Depth, mode.Windowed, false, mode.Frequency, mode.AntiAlias, mode.DisplayDevice), show, resizeable)) { // Always true nlverify (activate()); @@ -290,7 +280,7 @@ bool CDriverUser::setDisplay(nlWindow wnd, const CMode &mode, bool show, bool // *************************************************************************** bool CDriverUser::setMode(const CMode& mode) { - return _Driver->setMode(GfxMode(mode.Width, mode.Height, mode.Depth, mode.Windowed, false, mode.Frequency, mode.AntiAlias)); + return _Driver->setMode(GfxMode(mode.Width, mode.Height, mode.Depth, mode.Windowed, false, mode.Frequency, mode.AntiAlias, mode.DisplayDevice)); } // ---------------------------------------------------------------------------- @@ -316,7 +306,7 @@ bool CDriverUser::getModes(std::vector &modes) bool res = _Driver->getModes(vTmp); modes.clear(); for (uint i = 0; i < vTmp.size(); ++i) - modes.push_back(CMode(vTmp[i].Width, vTmp[i].Height, vTmp[i].Depth, vTmp[i].Windowed, vTmp[i].Frequency, vTmp[i].AntiAlias)); + modes.push_back(CMode(vTmp[i].Width, vTmp[i].Height, vTmp[i].Depth, vTmp[i].Windowed, vTmp[i].Frequency, vTmp[i].AntiAlias, vTmp[i].DisplayDevice)); std::sort(modes.begin(), modes.end(), CModeSorter()); @@ -1357,6 +1347,7 @@ void CDriverUser::swapBuffers() NL3D_HAUTO_SWAP_DRIVER; _Driver->swapBuffers(); + _RenderTargetManager.cleanup(); } // *************************************************************************** @@ -1609,36 +1600,6 @@ bool CDriverUser::fillBuffer (CBitmap &bitmap) // *************************************************************************** // *************************************************************************** -NLMISC::IMouseDevice *CDriverUser::enableLowLevelMouse(bool enable, bool exclusive) -{ - NL3D_HAUTO_UI_DRIVER; - - return _Driver->enableLowLevelMouse(enable, exclusive); -} -NLMISC::IKeyboardDevice *CDriverUser::enableLowLevelKeyboard(bool enable) -{ - NL3D_HAUTO_UI_DRIVER; - - return _Driver->enableLowLevelKeyboard(enable); -} - -void CDriverUser::emulateMouseRawMode(bool enable) -{ - _Driver->getEventEmitter()->emulateMouseRawMode(enable); -} - -uint CDriverUser::getDoubleClickDelay(bool hardwareMouse) -{ - NL3D_HAUTO_UI_DRIVER; - return _Driver->getDoubleClickDelay(hardwareMouse); -} - -NLMISC::IInputDeviceManager *CDriverUser::getLowLevelInputDeviceManager() -{ - NL3D_HAUTO_UI_DRIVER; - - return _Driver->getLowLevelInputDeviceManager(); -} void CDriverUser::showCursor (bool b) { NL3D_HAUTO_UI_DRIVER; @@ -1974,9 +1935,7 @@ bool CDriverUser::setRenderTarget(class UTexture & uTex, uint32 x, uint32 y, uin bool result = _Driver->setRenderTarget(tex, x, y, width, height, mipmapLevel, cubeFace); - CViewport currentViewport; - _Driver->getViewport(currentViewport); - setViewport(currentViewport); + setupMatrixContext(); return result; } diff --git a/code/nel/src/3d/driver_user2.cpp b/code/nel/src/3d/driver_user2.cpp index 990175dd4..1b46ab607 100644 --- a/code/nel/src/3d/driver_user2.cpp +++ b/code/nel/src/3d/driver_user2.cpp @@ -73,6 +73,77 @@ void CDriverUser::deleteScene(UScene *scene) _Scenes.erase((CSceneUser*)scene, "deleteScene(): Bad scene ptr"); } +// *************************************************************************** + +void CDriverUser::beginDefaultRenderTarget(uint32 width, uint32 height) +{ + if (_MatRenderTarget.empty()) + { + _MatRenderTarget.attach(&_MatRenderTargetInt); + UMaterial &umat = _MatRenderTarget; + CMaterial &mat = _MatRenderTargetInt; + umat.initUnlit(); + umat.setColor(CRGBA::White); + umat.setBlend(false); + umat.setAlphaTest(false); + mat.setBlendFunc(CMaterial::one, CMaterial::zero); + mat.setZWrite(false); + mat.setZFunc(CMaterial::always); + mat.setDoubleSided(true); + + _RenderTargetQuad.V0 = CVector(0.f, 0.f, 0.5f); + _RenderTargetQuad.V1 = CVector(1.f, 0.f, 0.5f); + _RenderTargetQuad.V2 = CVector(1.f, 1.f, 0.5f); + _RenderTargetQuad.V3 = CVector(0.f, 1.f, 0.5f); + _RenderTargetQuad.Uv0 = CUV(0.f, 0.f); + _RenderTargetQuad.Uv1 = CUV(1.f, 0.f); + _RenderTargetQuad.Uv2 = CUV(1.f, 1.f); + _RenderTargetQuad.Uv3 = CUV(0.f, 1.f); + } + + nlassert(!_EffectRenderTarget); + if (width == 0 || height == 0) + getWindowSize(width, height); + _EffectRenderTarget = getRenderTargetManager().getRenderTarget(width, height); + setRenderTarget(*_EffectRenderTarget); +} + +// *************************************************************************** + +void CDriverUser::endDefaultRenderTarget(UScene *scene) +{ + nlassert(_EffectRenderTarget); + + CTextureUser texNull; + setRenderTarget(texNull); + + _MatRenderTarget.getObjectPtr()->setTexture(0, _EffectRenderTarget->getITexture()); + + UCamera pCam; + if (scene) + { + pCam = scene->getCam(); + } + CViewport oldVp = getViewport(); + CViewport vp = CViewport(); + setViewport(vp); + setMatrixMode2D11(); + bool fog = fogEnabled(); + enableFog(false); + drawQuad(_RenderTargetQuad, _MatRenderTarget); + enableFog(fog); + setViewport(oldVp); + if (scene) + { + setMatrixMode3D(pCam); + } + + _MatRenderTarget.getObjectPtr()->setTexture(0, NULL); + + getRenderTargetManager().recycleRenderTarget(_EffectRenderTarget); + _EffectRenderTarget = NULL; +} + // *************************************************************************** UTextContext *CDriverUser::createTextContext(const std::string fontFileName, const std::string fontExFileName) { diff --git a/code/nel/src/3d/dru.cpp b/code/nel/src/3d/dru.cpp index 321429b2d..22d207682 100644 --- a/code/nel/src/3d/dru.cpp +++ b/code/nel/src/3d/dru.cpp @@ -35,7 +35,9 @@ #endif // HAVE_CONFIG_H #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #else // NL_OS_WINDOWS # include @@ -253,6 +255,7 @@ void CDRU::drawBitmap (float x, float y, float width, float height, ITexture& te if (vb.getName().empty()) vb.setName("CDRU::drawBitmap"); vb.setVertexFormat (CVertexBuffer::PositionFlag|CVertexBuffer::TexCoord0Flag); vb.setNumVertices (4); + vb.setPreferredMemory (CVertexBuffer::RAMVolatile, false); { CVertexBufferReadWrite vba; vb.lock (vba); @@ -271,6 +274,7 @@ void CDRU::drawBitmap (float x, float y, float width, float height, ITexture& te if (pb.getName().empty()) NL_SET_IB_NAME(pb, "CDRU::drawBitmap"); pb.setFormat(NL_DEFAULT_INDEX_BUFFER_FORMAT); pb.setNumIndexes (6); + pb.setPreferredMemory (CIndexBuffer::RAMVolatile, false); { CIndexBufferReadWrite iba; pb.lock (iba); @@ -305,6 +309,7 @@ void CDRU::drawLine (float x0, float y0, float x1, float y1, IDriver& driver, CR if (vb.getName().empty()) vb.setName("CDRU::drawLine"); vb.setVertexFormat (CVertexBuffer::PositionFlag); vb.setNumVertices (2); + vb.setPreferredMemory (CVertexBuffer::RAMVolatile, false); { CVertexBufferReadWrite vba; vb.lock (vba); @@ -317,6 +322,7 @@ void CDRU::drawLine (float x0, float y0, float x1, float y1, IDriver& driver, CR if (pb.getName().empty()) NL_SET_IB_NAME(pb, "CDRU::drawLine"); pb.setFormat(NL_DEFAULT_INDEX_BUFFER_FORMAT); pb.setNumIndexes (2); + pb.setPreferredMemory (CIndexBuffer::RAMVolatile, false); { CIndexBufferReadWrite iba; pb.lock (iba); @@ -350,6 +356,7 @@ void CDRU::drawTriangle (float x0, float y0, float x1, float y1, float x2, float if (vb.getName().empty()) vb.setName("CDRU::drawTriangle"); vb.setVertexFormat (CVertexBuffer::PositionFlag); vb.setNumVertices (3); + vb.setPreferredMemory (CVertexBuffer::RAMVolatile, false); { CVertexBufferReadWrite vba; vb.lock (vba); @@ -363,6 +370,7 @@ void CDRU::drawTriangle (float x0, float y0, float x1, float y1, float x2, float if (pb.getName().empty()) NL_SET_IB_NAME(pb, "CDRU::drawTriangle"); pb.setFormat(NL_DEFAULT_INDEX_BUFFER_FORMAT); pb.setNumIndexes (3); + pb.setPreferredMemory (CIndexBuffer::RAMVolatile, false); { CIndexBufferReadWrite iba; pb.lock (iba); @@ -397,6 +405,7 @@ void CDRU::drawQuad (float x0, float y0, float x1, float y1, IDriver& driver, CR if (vb.getName().empty()) vb.setName("CDRU::drawQuad"); vb.setVertexFormat (CVertexBuffer::PositionFlag); vb.setNumVertices (4); + vb.setPreferredMemory (CVertexBuffer::RAMVolatile, false); { CVertexBufferReadWrite vba; vb.lock (vba); @@ -433,6 +442,7 @@ void CDRU::drawQuad (float xcenter, float ycenter, float radius, IDriver& driver if (vb.getName().empty()) vb.setName("CDRU::drawQuad"); vb.setVertexFormat (CVertexBuffer::PositionFlag); vb.setNumVertices (4); + vb.setPreferredMemory (CVertexBuffer::RAMVolatile, false); { CVertexBufferReadWrite vba; vb.lock (vba); @@ -482,10 +492,12 @@ void CDRU::drawTrianglesUnlit(const NLMISC::CTriangleUV *trilist, sint ntris, if (vb.getName().empty()) vb.setName("CDRU::drawTrianglesUnlit"); vb.setVertexFormat (CVertexBuffer::PositionFlag | CVertexBuffer::TexCoord0Flag); vb.setNumVertices (ntris*3); + vb.setPreferredMemory (CVertexBuffer::RAMVolatile, false); static CIndexBuffer pb; pb.setFormat(NL_DEFAULT_INDEX_BUFFER_FORMAT); pb.setNumIndexes(ntris*3); + pb.setPreferredMemory (CIndexBuffer::RAMVolatile, false); if (pb.getFormat() == CIndexBuffer::Indices16) { nlassert(ntris * 3 <= 0xffff); @@ -530,10 +542,12 @@ void CDRU::drawLinesUnlit(const NLMISC::CLine *linelist, sint nlines, CMateria if (vb.getName().empty()) vb.setName("CDRU::drawLinesUnlit"); vb.setVertexFormat (CVertexBuffer::PositionFlag); vb.setNumVertices (nlines*2); + vb.setPreferredMemory (CVertexBuffer::RAMVolatile, false); static CIndexBuffer pb; pb.setFormat(NL_DEFAULT_INDEX_BUFFER_FORMAT); pb.setNumIndexes(nlines*2); + pb.setPreferredMemory (CIndexBuffer::RAMVolatile, false); { @@ -601,6 +615,7 @@ void CDRU::drawQuad (float x0, float y0, float x1, float y1, CRGBA col0, CRGBA if (vb.getName().empty()) vb.setName("CDRU::drawQuad"); vb.setVertexFormat (CVertexBuffer::PositionFlag|CVertexBuffer::PrimaryColorFlag); vb.setNumVertices (4); + vb.setPreferredMemory (CVertexBuffer::RAMVolatile, false); { CVertexBufferReadWrite vba; vb.lock (vba); diff --git a/code/nel/src/3d/fasthls_modifier.cpp b/code/nel/src/3d/fasthls_modifier.cpp index 5195ddb5a..2790e1442 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_VC) && NL_COMP_VC_VERSION >= 71 +#if defined(NL_COMP_VC) && (NL_COMP_VC_VERSION >= 71) # pragma warning( push ) # pragma warning( disable : 4799 ) #endif @@ -124,7 +124,6 @@ uint16 CFastHLSModifier::applyHLSMod(uint16 colorIn, uint8 dHue, uint dLum, uin static uint64 mmBlank = 0; static uint64 mmOne = INT64_CONSTANT(0x00FF00FF00FF00FF); static uint64 mmGray = INT64_CONSTANT(0x0080008000800080); - static uint64 mmInterpBufer[4]= {0,0,0,INT64_CONSTANT(0x00FF00FF00FF00FF)}; /* dLum is actually 0xFFFFFF00 + realDLum @@ -136,6 +135,8 @@ uint16 CFastHLSModifier::applyHLSMod(uint16 colorIn, uint8 dHue, uint dLum, uin #if defined(NL_OS_WINDOWS) && !defined(NL_NO_ASM) if(CSystemInfo::hasMMX()) { + static uint64 mmInterpBufer[4]= {0,0,0,INT64_CONSTANT(0x00FF00FF00FF00FF)}; + __asm { mov edi, offset mmInterpBufer @@ -262,7 +263,7 @@ uint16 CFastHLSModifier::applyHLSMod(uint16 colorIn, uint8 dHue, uint dLum, uin #pragma managed(pop) #endif -#if defined(NL_COMP_VC) && NL_COMP_VC_VERSION >= 71 +#if defined(NL_COMP_VC) && (NL_COMP_VC_VERSION >= 71) # pragma warning( pop ) #endif diff --git a/code/nel/src/3d/flare_model.cpp b/code/nel/src/3d/flare_model.cpp index 6c422aac9..f964a9102 100644 --- a/code/nel/src/3d/flare_model.cpp +++ b/code/nel/src/3d/flare_model.cpp @@ -271,7 +271,7 @@ void CFlareModel::traverseRender() float depthRangeNear, depthRangeFar; drv->getDepthRange(depthRangeNear, depthRangeFar); z = (depthRangeFar - depthRangeNear) * z + depthRangeNear; - if (!v.size() || z > v[0]) // test against z-buffer + if (v.empty() || z > v[0]) // test against z-buffer { visibilityRatio = 0.f; } diff --git a/code/nel/src/3d/fxaa.cpp b/code/nel/src/3d/fxaa.cpp new file mode 100644 index 000000000..89d1c59cd --- /dev/null +++ b/code/nel/src/3d/fxaa.cpp @@ -0,0 +1,291 @@ +/** + * \file fxaa.cpp + * \brief CFXAA + * \date 2014-08-03 21:41GMT + * \author Jan Boon (Kaetemi) + * CFXAA + */ + +/* + * Copyright (C) 2014 by authors + * + * This file is part of NL3D. + * NL3D is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * NL3D is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General + * Public License for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with NL3D. If not, see + * . + */ + +#include +#include + +// STL includes + +// NeL includes +// #include + +// Project includes +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; +// using namespace NLMISC; + +namespace NL3D { + +namespace { + +#include "fxaa_program.h" + +} /* anonymous namespace */ + +CFXAA::CFXAA(NL3D::UDriver *driver) : m_Driver(driver), m_PP(NULL), m_VP(NULL), m_Width(~0), m_Height(~0) +{ + nldebug("3D: Create FXAA"); + + CDriverUser *dru = static_cast(driver); + NL3D::IDriver *drv = (dru)->getDriver(); + + if (drv->supportBloomEffect() && drv->supportNonPowerOfTwoTextures()) + { + m_PP = new CPixelProgram(); + // arbfp1 + { + IProgram::CSource *source = new IProgram::CSource(); + source->Features.MaterialFlags = CProgramFeatures::TextureStages; + source->Profile = IProgram::arbfp1; + source->setSourcePtr(a_arbfp1); + m_PP->addSource(source); + } + // ps_2_0 + { + IProgram::CSource *source = new IProgram::CSource(); + source->Features.MaterialFlags = CProgramFeatures::TextureStages; + source->Profile = IProgram::ps_2_0; + source->setSourcePtr(a_ps_2_0); + m_PP->addSource(source); + } + if (!drv->compilePixelProgram(m_PP)) + { + nlwarning("3D: No supported pixel program for FXAA effect"); + + delete m_PP; + m_PP = NULL; + } + else + { + nldebug("3D: FXAA pixel program available"); + } + } + + if (!m_PP) + { + return; + } + + // create vp + { + m_VP = new CVertexProgram(); + // nelvp + { + IProgram::CSource *source = new IProgram::CSource(); + source->Features.MaterialFlags = CProgramFeatures::TextureStages; + source->Profile = IProgram::nelvp; + source->setSourcePtr(a_nelvp); + m_VP->addSource(source); + } + if (!drv->compileVertexProgram(m_VP)) + { + nlwarning("3D: No supported vertex program for FXAA effect"); + + delete m_VP; + m_VP = NULL; + delete m_PP; + m_PP = NULL; + } + else + { + nldebug("3D: FXAA vertex program available"); + } + } + + if (!m_VP) + { + return; + } + + // create material and vb + { + m_Mat = m_Driver->createMaterial(); + m_Mat.initUnlit(); + m_Mat.setColor(CRGBA::White); + m_Mat.setBlend (false); + m_Mat.setAlphaTest (false); + NL3D::CMaterial *mat = m_Mat.getObjectPtr(); + mat->setShader(NL3D::CMaterial::Normal); + mat->setBlendFunc(CMaterial::one, CMaterial::zero); + mat->setZWrite(false); + mat->setZFunc(CMaterial::always); + mat->setDoubleSided(true); + + m_QuadUV.V0 = CVector(0.f, 0.f, 0.5f); + m_QuadUV.V1 = CVector(1.f, 0.f, 0.5f); + m_QuadUV.V2 = CVector(1.f, 1.f, 0.5f); + m_QuadUV.V3 = CVector(0.f, 1.f, 0.5f); + + /*if (drv->textureCoordinateAlternativeMode()) + { + m_QuadUV.Uv0 = CUV(0.f, 1.f); + m_QuadUV.Uv1 = CUV(1.f, 1.f); + m_QuadUV.Uv2 = CUV(1.f, 0.f); + m_QuadUV.Uv3 = CUV(0.f, 0.f); + } + else + {*/ + m_QuadUV.Uv0 = CUV(0.f, 0.f); + m_QuadUV.Uv1 = CUV(1.f, 0.f); + m_QuadUV.Uv2 = CUV(1.f, 1.f); + m_QuadUV.Uv3 = CUV(0.f, 1.f); + /*}*/ + + /*CVertexBuffer &vb = m_VB; + vb.clearValueEx(); + vb.addValueEx(CVertexBuffer::Position, CVertexBuffer::Float3); + vb.addValueEx(CVertexBuffer::TexCoord0, CVertexBuffer::Float2); + vb.addValueEx(CVertexBuffer::TexCoord1, CVertexBuffer::Float4); + vb.initEx(); + vb.setPreferredMemory(CVertexBuffer::RAMVolatile, false); + vb.setNumVertices(4);*/ + } +} + +CFXAA::~CFXAA() +{ + nldebug("3D: Destroy FXAA"); + + if (!m_Mat.empty()) + { + m_Driver->deleteMaterial(m_Mat); + } + + delete m_VP; + m_VP = NULL; + delete m_PP; + m_PP = NULL; + + m_Driver = NULL; +} + +void CFXAA::applyEffect() +{ + if (!m_PP) + return; + + CDriverUser *dru = static_cast(m_Driver); + IDriver *drv = dru->getDriver(); + + // backup + bool fogEnabled = m_Driver->fogEnabled(); + m_Driver->enableFog(false); + + NL3D::ITexture *renderTarget = drv->getRenderTarget(); + nlassert(renderTarget); + nlassert(renderTarget->isBloomTexture()); + + uint width = renderTarget->getWidth(); + uint height = renderTarget->getHeight(); + bool mode2D = static_cast(renderTarget)->isMode2D(); + nlassert(renderTarget->getUploadFormat() == ITexture::Auto); + + float fwidth = (float)width; + float fheight = (float)height; + float pwidth = 1.0f / fwidth; + float pheight = 1.0f / fheight; + float hpwidth = pwidth * 0.5f; + float hpheight = pheight * 0.5f; + float n = 0.5f; + + //if (width != m_Width || height != m_Height) + /*{ + // Build VB + m_Width = width; + m_Height = height; + CVertexBufferReadWrite vba; + m_VB.lock(vba); + vba.setValueFloat3Ex(CVertexBuffer::Position, 0, 0.f, 0.f, 0.5f); // BL + vba.setValueFloat3Ex(CVertexBuffer::Position, 1, 1.f, 0.f, 0.5f); // BR + vba.setValueFloat3Ex(CVertexBuffer::Position, 2, 1.f, 1.f, 0.5f); // TR + vba.setValueFloat3Ex(CVertexBuffer::Position, 3, 0.f, 1.f, 0.5f); // TL + vba.setValueFloat2Ex(CVertexBuffer::TexCoord0, 0, 0.f, 0.f); + vba.setValueFloat2Ex(CVertexBuffer::TexCoord0, 1, 1.f, 0.f); + vba.setValueFloat2Ex(CVertexBuffer::TexCoord0, 2, 1.f, 1.f); + vba.setValueFloat2Ex(CVertexBuffer::TexCoord0, 3, 0.f, 1.f); + vba.setValueFloat4Ex(CVertexBuffer::TexCoord1, 0, 0.f - hpwidth, 0.f - hpheight, 0.f + hpwidth, 0.f + hpheight); + vba.setValueFloat4Ex(CVertexBuffer::TexCoord1, 1, 1.f - hpwidth, 0.f - hpheight, 1.f + hpwidth, 0.f + hpheight); + vba.setValueFloat4Ex(CVertexBuffer::TexCoord1, 2, 1.f - hpwidth, 1.f - hpheight, 1.f + hpwidth, 1.f + hpheight); + vba.setValueFloat4Ex(CVertexBuffer::TexCoord1, 3, 0.f - hpwidth, 1.f - hpheight, 0.f + hpwidth, 1.f + hpheight); + }*/ + + // create render target + CTextureUser *otherRenderTarget = m_Driver->getRenderTargetManager().getRenderTarget(width, height, mode2D); + + // swap render target + CTextureUser texNull; + dru->setRenderTarget(texNull); + drv->swapTextureHandle(*renderTarget, *otherRenderTarget->getITexture()); + drv->setRenderTarget(renderTarget); + m_Driver->setMatrixMode2D11(); + + // debug + // m_Driver->clearBuffers(CRGBA(128, 128, 128, 128)); + + // activate program + bool vpok = drv->activeVertexProgram(m_VP); + nlassert(vpok); + bool ppok = drv->activePixelProgram(m_PP); + nlassert(ppok); + /*drv->setUniform4f(IDriver::PixelProgram, 0, -n / fwidth, -n / fheight, n / fwidth, n / fheight); // fxaaConsoleRcpFrameOpt + drv->setUniform4f(IDriver::PixelProgram, 1, -2.0f / fwidth, -2.0f / fheight, 2.0f / fwidth, 2.0f / fheight); // fxaaConsoleRcpFrameOpt2*/ + drv->setUniform2f(IDriver::PixelProgram, 0, 1.0f / fwidth, 1.0f / fheight); // fxaaQualityRcpFrame + drv->setUniform1f(IDriver::PixelProgram, 1, 0.75f); // fxaaQualitySubpix + drv->setUniform1f(IDriver::PixelProgram, 2, 0.166f); // fxaaQualityEdgeThreshold + drv->setUniform1f(IDriver::PixelProgram, 3, 0.0833f); // fxaaQualityEdgeThresholdMin + drv->setUniformMatrix(IDriver::VertexProgram, 0, IDriver::ModelViewProjection, IDriver::Identity); + // drv->setUniform4f(IDriver::VertexProgram, 9, -hpwidth, -hpheight, hpwidth, hpheight); + + // render effect + m_Mat.getObjectPtr()->setTexture(0, otherRenderTarget->getITexture()); + /*drv->activeVertexBuffer(m_VB); + drv->renderRawQuads(*m_Mat.getObjectPtr(), 0, 1);*/ + m_Driver->drawQuad(m_QuadUV, m_Mat); + m_Mat.getObjectPtr()->setTexture(0, NULL); + + // deactivate program + drv->activeVertexProgram(NULL); + drv->activePixelProgram(NULL); + + // restore + m_Driver->enableFog(fogEnabled); + + // recycle render target + m_Driver->getRenderTargetManager().recycleRenderTarget(otherRenderTarget); +} + +} /* namespace NL3D */ + +/* end of file */ diff --git a/code/nel/src/3d/fxaa_program.h b/code/nel/src/3d/fxaa_program.h new file mode 100644 index 000000000..a6bf847ef --- /dev/null +++ b/code/nel/src/3d/fxaa_program.h @@ -0,0 +1,994 @@ + +const char *a_nelvp = + "!!VP1.0\n" + "DP4 o[HPOS].x, c[0], v[OPOS];\n" + "DP4 o[HPOS].y, c[1], v[OPOS];\n" + "DP4 o[HPOS].z, c[2], v[OPOS];\n" + "DP4 o[HPOS].w, c[3], v[OPOS];\n" + "MOV o[TEX0].xy, v[TEX0];\n" + // "ADD o[TEX1], v[TEX0].xyxy, c[9];\n" + "END\n"; + +const char *a_arbfp1_test = + "!!ARBfp1.0\n" + "OPTION ARB_precision_hint_fastest;\n" + "TEX result.color, fragment.texcoord[1].zwzw, texture[0], 2D;\n" + "END\n"; + +const char *a_arbfp1 = + "!!ARBfp1.0\n" + "OPTION ARB_precision_hint_fastest;\n" + /*"# cgc version 3.1.0013, build date Apr 18 2012\n" + "# command line args: -profile arbfp1 -O3 -fastmath -fastprecision\n" + "# source file: fxaa_pp.cg\n" + "#vendor NVIDIA Corporation\n" + "#version 3.1.0.13\n" + "#profile arbfp1\n" + "#program fxaa_pp\n" + "#semantic fxaa_pp.fxaaQualityRcpFrame\n" + "#semantic fxaa_pp.fxaaQualitySubpix\n" + "#semantic fxaa_pp.fxaaQualityEdgeThreshold\n" + "#semantic fxaa_pp.fxaaQualityEdgeThresholdMin\n" + "#semantic fxaa_pp.nlTex0 : TEX0\n" + "#var float2 pos : $vin.TEXCOORD0 : TEX0 : 0 : 1\n" + "#var float2 fxaaQualityRcpFrame : : c[0] : 2 : 1\n" + "#var float fxaaQualitySubpix : : c[1] : 3 : 1\n" + "#var float fxaaQualityEdgeThreshold : : c[2] : 4 : 1\n" + "#var float fxaaQualityEdgeThresholdMin : : c[3] : 5 : 1\n" + "#var sampler2D nlTex0 : TEX0 : texunit 0 : 6 : 1\n" + "#var float4 oCol : $vout.COLOR : COL : 7 : 1\n" + "#const c[4] = 0 -1 1 -2\n" + "#const c[5] = 2 0.5 0.25 1.5\n" + "#const c[6] = 4 12 0.083333336 3\n"*/ + "PARAM c[7] = { program.env[0..3],\n" + " { 0, -1, 1, -2 },\n" + " { 2, 0.5, 0.25, 1.5 },\n" + " { 4, 12, 0.083333336, 3 } };\n" + "TEMP R0;\n" + "TEMP R1;\n" + "TEMP R2;\n" + "TEMP R3;\n" + "TEMP R4;\n" + "TEMP R5;\n" + "TEMP R6;\n" + "TEMP R7;\n" + "TEMP R8;\n" + "TEMP R9;\n" + "MOV R3.xyz, c[4];\n" + "MAD R2.zw, R3.xyyz, c[0].xyxy, fragment.texcoord[0].xyxy;\n" + "MAD R0.xy, R3, c[0], fragment.texcoord[0];\n" + "MAD R1.xy, R3.zyzw, c[0], fragment.texcoord[0];\n" + "TEX R5.y, R1, texture[0], 2D;\n" + "MAD R1.xy, R3.zxzw, c[0], fragment.texcoord[0];\n" + "ADD R0.zw, fragment.texcoord[0].xyxy, -c[0].xyxy;\n" + "TEX R4.y, R0.zwzw, texture[0], 2D;\n" + "TEX R6.y, R2.zwzw, texture[0], 2D;\n" + "TEX R8, fragment.texcoord[0], texture[0], 2D;\n" + "TEX R1.y, R1, texture[0], 2D;\n" + "TEX R0.y, R0, texture[0], 2D;\n" + "ADD R0.z, R4.y, R5.y;\n" + "MAD R1.z, R0.y, c[4].w, R0;\n" + "MAD R0.zw, R3.xyyx, c[0].xyxy, fragment.texcoord[0].xyxy;\n" + "TEX R2.y, R0.zwzw, texture[0], 2D;\n" + "ADD R0.x, R2.y, R1.y;\n" + "ABS R0.w, R1.z;\n" + "ADD R1.zw, fragment.texcoord[0].xyxy, c[0].xyxy;\n" + "TEX R7.y, R1.zwzw, texture[0], 2D;\n" + "MAD R0.z, R8.y, c[4].w, R0.x;\n" + "ABS R0.z, R0;\n" + "MAD R2.x, R0.z, c[5], R0.w;\n" + "MAD R0.zw, R3.xyxz, c[0].xyxy, fragment.texcoord[0].xyxy;\n" + "TEX R3.y, R0.zwzw, texture[0], 2D;\n" + "ADD R0.z, R0.y, R3.y;\n" + "ADD R1.x, R6.y, R7.y;\n" + "MAD R0.w, R3.y, c[4], R1.x;\n" + "MAD R1.x, R8.y, c[4].w, R0.z;\n" + "ABS R0.w, R0;\n" + "ADD R2.x, R0.w, R2;\n" + "ADD R2.w, R4.y, R6.y;\n" + "ADD R0.w, R5.y, R7.y;\n" + "ABS R1.z, R1.x;\n" + "MAD R1.x, R1.y, c[4].w, R0.w;\n" + "ABS R1.w, R1.x;\n" + "MAD R1.x, R2.y, c[4].w, R2.w;\n" + "MAD R1.z, R1, c[5].x, R1.w;\n" + "ABS R1.x, R1;\n" + "ADD R1.x, R1, R1.z;\n" + "SGE R4.x, R1, R2;\n" + "MAX R1.x, R3.y, R8.y;\n" + "MAX R1.z, R1.y, R1.x;\n" + "MAX R1.x, R0.y, R2.y;\n" + "MAX R1.x, R1, R1.z;\n" + "MIN R1.z, R3.y, R8.y;\n" + "MIN R1.w, R1.y, R1.z;\n" + "MIN R1.z, R0.y, R2.y;\n" + "MIN R1.z, R1, R1.w;\n" + "MUL R2.x, R1, c[2];\n" + "ADD R3.z, R1.x, -R1;\n" + "ABS R3.w, R4.x;\n" + "MAX R1.w, R2.x, c[3].x;\n" + "ADD R2.z, R3, -R1.w;\n" + "CMP R2.x, R2.z, c[4], c[4].z;\n" + "CMP R1.x, -R3.w, c[4], c[4].z;\n" + "MUL R3.w, R2.x, R1.x;\n" + "CMP R1.z, -R3.w, R1.y, R3.y;\n" + "ADD R1.y, -R8, R1.z;\n" + "CMP R1.w, -R3, R2.y, R0.y;\n" + "ADD R0.y, -R8, R1.w;\n" + "MUL R4.x, R2, R4;\n" + "CMP R3.y, -R3.w, c[0], R3.x;\n" + "ABS R4.w, R1.y;\n" + "ABS R4.z, R0.y;\n" + "SGE R0.y, R4.z, R4.w;\n" + "MUL R1.y, R2.x, R0;\n" + "ABS R0.y, R0;\n" + "CMP R4.y, -R0, c[4].x, c[4].z;\n" + "ABS R0.y, R1.x;\n" + "CMP R0.y, -R0, c[4].x, c[4].z;\n" + "MUL R1.x, R2, R0.y;\n" + "CMP R2.y, -R4.x, c[0], c[0].x;\n" + "CMP R2.y, -R1, -R2, R2;\n" + "MAD R1.y, R2, c[5], fragment.texcoord[0];\n" + "CMP R5.z, -R4.x, R1.y, fragment.texcoord[0].y;\n" + "ADD R5.y, R5.z, -R3;\n" + "MAD R0.y, R2, c[5], fragment.texcoord[0].x;\n" + "CMP R3.x, -R1, c[0], R3;\n" + "CMP R6.x, -R3.w, R0.y, fragment.texcoord[0];\n" + "ADD R5.w, R5.z, R3.y;\n" + "ADD R1.x, R6, -R3;\n" + "MOV R1.y, R5;\n" + "TEX R0.y, R1, texture[0], 2D;\n" + "MUL R1.y, R2.x, R4;\n" + "ADD R0.x, R0.z, R0;\n" + "ADD R0.w, R2, R0;\n" + "MAD R0.z, R0.x, c[5].x, R0.w;\n" + "ADD R1.w, R8.y, R1;\n" + "ADD R1.z, R8.y, R1;\n" + "CMP R4.y, -R1, R1.z, R1.w;\n" + "ADD R1.z, R6.x, R3.x;\n" + "MAD R5.x, -R4.y, c[5].y, R0.y;\n" + "MOV R1.w, R5;\n" + "TEX R0.y, R1.zwzw, texture[0], 2D;\n" + "MAX R1.w, R4.z, R4;\n" + "MAD R1.y, -R4, c[5], R0;\n" + "MUL R4.z, R1.w, c[5];\n" + "ABS R0.y, R1;\n" + "SGE R1.w, R0.y, R4.z;\n" + "ABS R6.y, R5.x;\n" + "SGE R0.y, R6, R4.z;\n" + "ABS R1.w, R1;\n" + "CMP R6.y, -R1.w, c[4].x, c[4].z;\n" + "ABS R0.y, R0;\n" + "CMP R5.z, -R0.y, c[4].x, c[4];\n" + "ADD_SAT R0.y, R5.z, R6;\n" + "MUL R4.w, R2.x, R0.y;\n" + "MUL R0.y, R2.x, R6;\n" + "MAD R1.w, R3.y, c[5], R5;\n" + "CMP R6.x, -R0.y, R1.w, R5.w;\n" + "MAD R6.z, R3.x, c[5].w, R1;\n" + "CMP R1.z, -R0.y, R6, R1;\n" + "MOV R1.w, R6.x;\n" + "TEX R0.y, R1.zwzw, texture[0], 2D;\n" + "MUL R1.w, R4, R6.y;\n" + "CMP R6.y, -R1.w, R0, R1;\n" + "MUL R0.y, R2.x, R5.z;\n" + "MAD R1.y, -R3, c[5].w, R5;\n" + "CMP R5.w, -R0.y, R1.y, R5.y;\n" + "MAD R6.z, -R3.x, c[5].w, R1.x;\n" + "CMP R1.x, -R0.y, R6.z, R1;\n" + "MOV R1.y, R5.w;\n" + "TEX R0.y, R1, texture[0], 2D;\n" + "MUL R5.y, R4.w, R5.z;\n" + "CMP R0.y, -R5, R0, R5.x;\n" + "MAD R5.x, -R4.y, c[5].y, R0.y;\n" + "CMP R5.z, -R5.y, R5.x, R0.y;\n" + "MAD R1.y, -R4, c[5], R6;\n" + "CMP R1.y, -R1.w, R1, R6;\n" + "ABS R1.w, R1.y;\n" + "SGE R1.w, R1, R4.z;\n" + "ABS R0.y, R5.z;\n" + "SGE R0.y, R0, R4.z;\n" + "ABS R1.w, R1;\n" + "CMP R6.y, -R1.w, c[4].x, c[4].z;\n" + "ABS R0.y, R0;\n" + "CMP R5.y, -R0, c[4].x, c[4].z;\n" + "ADD_SAT R0.y, R5, R6;\n" + "MUL R5.x, R4.w, R0.y;\n" + "MUL R0.y, R4.w, R6;\n" + "MAD R1.w, R3.y, c[5].x, R6.x;\n" + "CMP R6.x, -R0.y, R1.w, R6;\n" + "MAD R6.z, R3.x, c[5].x, R1;\n" + "CMP R1.z, -R0.y, R6, R1;\n" + "MOV R1.w, R6.x;\n" + "TEX R0.y, R1.zwzw, texture[0], 2D;\n" + "MUL R1.w, R5.x, R6.y;\n" + "CMP R6.y, -R1.w, R0, R1;\n" + "MUL R0.y, R4.w, R5;\n" + "MAD R1.y, -R3, c[5].x, R5.w;\n" + "CMP R4.w, -R0.y, R1.y, R5;\n" + "MAD R6.z, -R3.x, c[5].x, R1.x;\n" + "CMP R1.x, -R0.y, R6.z, R1;\n" + "MOV R1.y, R4.w;\n" + "TEX R0.y, R1, texture[0], 2D;\n" + "MUL R5.y, R5.x, R5;\n" + "CMP R0.y, -R5, R0, R5.z;\n" + "MAD R5.z, -R4.y, c[5].y, R0.y;\n" + "CMP R5.w, -R5.y, R5.z, R0.y;\n" + "MAD R1.y, -R4, c[5], R6;\n" + "CMP R1.y, -R1.w, R1, R6;\n" + "ABS R1.w, R1.y;\n" + "SGE R1.w, R1, R4.z;\n" + "ABS R1.w, R1;\n" + "CMP R6.y, -R1.w, c[4].x, c[4].z;\n" + "ABS R0.y, R5.w;\n" + "SGE R0.y, R0, R4.z;\n" + "ABS R0.y, R0;\n" + "CMP R5.y, -R0, c[4].x, c[4].z;\n" + "ADD_SAT R0.y, R5, R6;\n" + "MUL R5.z, R5.x, R0.y;\n" + "MUL R0.y, R5.x, R6;\n" + "MAD R1.w, R3.y, c[6].x, R6.x;\n" + "CMP R6.x, -R0.y, R1.w, R6;\n" + "MAD R6.z, R3.x, c[6].x, R1;\n" + "CMP R1.z, -R0.y, R6, R1;\n" + "MOV R1.w, R6.x;\n" + "TEX R0.y, R1.zwzw, texture[0], 2D;\n" + "MUL R1.w, R5.z, R6.y;\n" + "CMP R6.y, -R1.w, R0, R1;\n" + "MUL R0.y, R5.x, R5;\n" + "MAD R1.y, -R3, c[6].x, R4.w;\n" + "CMP R4.w, -R0.y, R1.y, R4;\n" + "MAD R5.x, -R3, c[6], R1;\n" + "CMP R1.x, -R0.y, R5, R1;\n" + "MOV R1.y, R4.w;\n" + "TEX R0.y, R1, texture[0], 2D;\n" + "MUL R1.y, R5.z, R5;\n" + "CMP R5.x, -R1.y, R0.y, R5.w;\n" + "MAD R5.y, -R4, c[5], R5.x;\n" + "CMP R1.y, -R1, R5, R5.x;\n" + "MAD R0.y, -R4, c[5], R6;\n" + "CMP R0.y, -R1.w, R0, R6;\n" + "ABS R5.x, R0.y;\n" + "ABS R1.w, R1.y;\n" + "SGE R1.w, R1, R4.z;\n" + "SGE R5.x, R5, R4.z;\n" + "ABS R4.z, R5.x;\n" + "ABS R1.w, R1;\n" + "CMP R4.z, -R4, c[4].x, c[4];\n" + "CMP R1.w, -R1, c[4].x, c[4].z;\n" + "MUL R4.z, R5, R4;\n" + "MAD R5.y, R3.x, c[6], R1.z;\n" + "CMP R5.y, -R4.z, R5, R1.z;\n" + "MAD R5.x, R3.y, c[6].y, R6;\n" + "CMP R1.z, -R4, R5.x, R6.x;\n" + "MUL R1.w, R5.z, R1;\n" + "ADD R4.z, -fragment.texcoord[0].x, R5.y;\n" + "ADD R1.z, -fragment.texcoord[0].y, R1;\n" + "CMP R1.z, -R3.w, R1, R4;\n" + "MAD R4.z, -R3.x, c[6].y, R1.x;\n" + "MAD R3.x, -R3.y, c[6].y, R4.w;\n" + "CMP R3.y, -R1.w, R4.z, R1.x;\n" + "CMP R1.x, -R1.w, R3, R4.w;\n" + "ADD R1.w, fragment.texcoord[0].x, -R3.y;\n" + "ADD R1.x, fragment.texcoord[0].y, -R1;\n" + "CMP R1.x, -R3.w, R1, R1.w;\n" + "SLT R1.w, R1.x, R1.z;\n" + "ADD R3.x, R1, R1.z;\n" + "ABS R1.w, R1;\n" + "MIN R1.x, R1, R1.z;\n" + "CMP R1.w, -R1, c[4].x, c[4].z;\n" + "MUL R1.z, R2.x, R1.w;\n" + "RCP R3.x, R3.x;\n" + "MAD R1.x, R1, -R3, c[5].y;\n" + "MUL R1.w, R4.y, c[5].y;\n" + "SLT R3.x, R1.y, c[4];\n" + "SLT R1.y, R8, R1.w;\n" + "SLT R0.y, R0, c[4].x;\n" + "ADD R0.y, R0, -R1;\n" + "ADD R1.y, -R1, R3.x;\n" + "ABS R0.y, R0;\n" + "ABS R1.y, R1;\n" + "CMP R0.y, -R0, c[4].z, c[4].x;\n" + "CMP R1.y, -R1, c[4].z, c[4].x;\n" + "CMP R0.x, -R1.z, R0.y, R1.y;\n" + "MAD R0.y, R0.z, c[6].z, -R8;\n" + "ABS R0.x, R0;\n" + "CMP R0.x, -R0, c[4], c[4].z;\n" + "MUL R0.x, R2, R0;\n" + "CMP R0.x, -R0, c[4], R1;\n" + "RCP R0.z, R3.z;\n" + "ABS R0.y, R0;\n" + "MUL_SAT R0.y, R0, R0.z;\n" + "MUL R0.z, R0.y, c[4].w;\n" + "ADD R0.z, R0, c[6].w;\n" + "MUL R0.y, R0, R0;\n" + "MUL R0.y, R0.z, R0;\n" + "MUL R0.y, R0, R0;\n" + "MUL R0.y, R0, c[1].x;\n" + "MAX R0.x, R0, R0.y;\n" + "MAD R0.y, R0.x, R2, fragment.texcoord[0];\n" + "MAD R0.z, R0.x, R2.y, fragment.texcoord[0].x;\n" + "CMP R0.x, -R3.w, R0.z, fragment.texcoord[0];\n" + "CMP R0.y, -R4.x, R0, fragment.texcoord[0];\n" + "TEX R0.xyz, R0, texture[0], 2D;\n" + "CMP R1, R2.z, R8, R9;\n" + "MOV R0.w, R8.y;\n" + "CMP result.color, -R2.x, R0, R1;\n" + "END\n"; + /*"# 260 instructions, 10 R-regs\n" + "\n"*/ + +const char *a_arbfp1_ps3 = + "!!ARBfp1.0\n" + "OPTION ARB_precision_hint_fastest;\n" + //# cgc version 3.1.0013, build date Apr 18 2012 + //# command line args: -profile arbfp1 -O3 -fastmath -fastprecision + //# source file: fxaa_fp.cg + //#vendor NVIDIA Corporation + //#version 3.1.0.13 + //#profile arbfp1 + //#program fxaa_fp + //#semantic fxaa_fp.fxaaConsoleRcpFrameOpt + //#semantic fxaa_fp.fxaaConsoleRcpFrameOpt2 + //#semantic fxaa_fp.nlTex0 : TEX0 + //#var float2 pos : $vin.TEXCOORD0 : TEX0 : 0 : 1 + //#var float4 fxaaConsolePosPos : $vin.TEXCOORD1 : TEX1 : 1 : 1 + //#var float4 fxaaConsoleRcpFrameOpt : : c[0] : 2 : 1 + //#var float4 fxaaConsoleRcpFrameOpt2 : : c[1] : 3 : 1 + //#var sampler2D nlTex0 : TEX0 : texunit 0 : 4 : 1 + //#var float4 oCol : $vout.COLOR : COL : 5 : 1 + //#const c[2] = 0.125 0 -2 2 + //#const c[3] = 0.001953125 0.5 + "PARAM c[4] = { program.env[0..1],\n" + " { 0.125, 0, -2, 2 },\n" + " { 0.001953125, 0.5 } };\n" + "TEMP R0;\n" + "TEMP R1;\n" + "TEMP R2;\n" + "TEMP R3;\n" + "TEMP R4;\n" + "TEMP R5;\n" + "TEX R1.w, fragment.texcoord[1].zyzw, texture[0], 2D;\n" + "ADD R0.x, R1.w, c[3];\n" + "TEX R0.w, fragment.texcoord[1].xwzw, texture[0], 2D;\n" + "TEX R1.w, fragment.texcoord[1], texture[0], 2D;\n" + "ADD R0.y, -R0.x, R0.w;\n" + "ADD R0.z, R1.w, R0.y;\n" + "TEX R2.w, fragment.texcoord[1].zwzw, texture[0], 2D;\n" + "ADD R0.y, -R1.w, R0;\n" + "ADD R1.x, R2.w, R0.y;\n" + "ADD R1.y, R0.z, -R2.w;\n" + "MUL R2.xy, R1, R1;\n" + "ADD R0.y, R2.x, R2;\n" + "RSQ R0.y, R0.y;\n" + "MUL R2.xy, R0.y, R1;\n" + "MAD R3.xy, R2, c[0].zwzw, fragment.texcoord[0];\n" + "ABS R0.z, R2.y;\n" + "ABS R0.y, R2.x;\n" + "MIN R0.y, R0, R0.z;\n" + "RCP R0.y, R0.y;\n" + "MUL R1.xy, R0.y, R2;\n" + "MUL R1.xy, R1, c[2].x;\n" + "MIN R1.xy, R1, c[2].w;\n" + "TEX R4, R3, texture[0], 2D;\n" + "MAD R2.xy, -R2, c[0].zwzw, fragment.texcoord[0];\n" + "TEX R3, R2, texture[0], 2D;\n" + "ADD R3, R3, R4;\n" + "MAX R1.xy, R1, c[2].z;\n" + "MAD R2.xy, R1, c[1].zwzw, fragment.texcoord[0];\n" + "MUL R5, R3, c[3].y;\n" + "MAD R1.xy, -R1, c[1].zwzw, fragment.texcoord[0];\n" + "MIN R0.z, R0.x, R2.w;\n" + "MIN R0.y, R0.w, R1.w;\n" + "MIN R0.y, R0, R0.z;\n" + "MAX R0.z, R0.x, R2.w;\n" + "MAX R0.x, R0.w, R1.w;\n" + "MAX R0.x, R0, R0.z;\n" + "TEX R4, R2, texture[0], 2D;\n" + "TEX R3, R1, texture[0], 2D;\n" + "ADD R3, R3, R4;\n" + "MAD R3, R3, c[3].y, R5;\n" + "MUL R3, R3, c[3].y;\n" + "SLT R0.z, R0.x, R3.w;\n" + "SLT R0.x, R3.w, R0.y;\n" + "ADD_SAT R0.x, R0, R0.z;\n" + "CMP result.color, -R0.x, R5, R3;\n" + "END\n"; + //# 45 instructions, 6 R-regs + +const char *a_arbfp1_earlyexit = + "!!ARBfp1.0\n" + "OPTION ARB_precision_hint_fastest;\n" + //"# cgc version 3.1.0013, build date Apr 18 2012\n" + //"# command line args: -profile arbfp1\n" + //"# source file: fxaa_fp.cg\n" + //"#vendor NVIDIA Corporation\n" + //"#version 3.1.0.13\n" + //"#profile arbfp1\n" + //"#program fxaa_fp\n" + //"#semantic fxaa_fp.fxaaConsoleRcpFrameOpt\n" + //"#semantic fxaa_fp.fxaaConsoleRcpFrameOpt2\n" + //"#semantic fxaa_fp.nlTex0 : TEX0\n" + //"#var float2 pos : $vin.TEXCOORD0 : TEX0 : 0 : 1\n" + //"#var float4 fxaaConsolePosPos : $vin.TEXCOORD1 : TEX1 : 1 : 1\n" + //"#var float4 fxaaConsoleRcpFrameOpt : : c[0] : 2 : 1\n" + //"#var float4 fxaaConsoleRcpFrameOpt2 : : c[1] : 3 : 1\n" + //"#var sampler2D nlTex0 : TEX0 : texunit 0 : 4 : 1\n" + //"#var float4 oCol : $vout.COLOR : COL : 5 : 1\n" + //"#const c[2] = 0.125 0 8 0.001953125\n" + //"#const c[3] = -2 2 0.5\n" + "PARAM c[4] = { program.env[0..1],\n" + " { 0.125, 0, 8, 0.001953125 },\n" + " { -2, 2, 0.5 } };\n" + "TEMP R0;\n" + "TEMP R1;\n" + "TEMP R2;\n" + "TEMP R3;\n" + "TEMP R4;\n" + "TEMP R5;\n" + "TEX R0.w, fragment.texcoord[1].zyzw, texture[0], 2D;\n" + "ADD R0.x, R0.w, c[2].w;\n" + "TEX R1.w, fragment.texcoord[1].xwzw, texture[0], 2D;\n" + "TEX R0.w, fragment.texcoord[1], texture[0], 2D;\n" + "ADD R0.y, R1.w, -R0.x;\n" + "ADD R0.z, R0.w, R0.y;\n" + "TEX R2.w, fragment.texcoord[1].zwzw, texture[0], 2D;\n" + "ADD R0.y, -R0.w, R0;\n" + "ADD R1.z, -R2.w, R0;\n" + "ADD R1.x, R2.w, R0.y;\n" + "MOV R1.y, c[2];\n" + "DP3 R0.y, R1, R1;\n" + "RSQ R0.y, R0.y;\n" + "MUL R2.xy, R0.y, R1.xzzw;\n" + "MAD R3.xy, R2, c[0].zwzw, fragment.texcoord[0];\n" + "ABS R0.z, R2.y;\n" + "ABS R0.y, R2.x;\n" + "MIN R0.y, R0, R0.z;\n" + "RCP R0.y, R0.y;\n" + "MUL R1.xy, R0.y, R2;\n" + "MUL R1.xy, R1, c[2].x;\n" + "MIN R1.xy, R1, c[3].y;\n" + "MIN R0.y, R0.w, R1.w;\n" + "TEX R4, R3, texture[0], 2D;\n" + "MAD R2.xy, -R2, c[0].zwzw, fragment.texcoord[0];\n" + "TEX R3, R2, texture[0], 2D;\n" + "ADD R3, R3, R4;\n" + "MAX R1.xy, R1, c[3].x;\n" + "MAD R2.xy, R1, c[1].zwzw, fragment.texcoord[0];\n" + "MAD R1.xy, -R1, c[1].zwzw, fragment.texcoord[0];\n" + "MUL R5, R3, c[3].z;\n" + "TEX R4, R2, texture[0], 2D;\n" + "TEX R3, R1, texture[0], 2D;\n" + "MIN R0.z, R0.x, R2.w;\n" + "MIN R1.x, R0.y, R0.z;\n" + "MAX R0.y, R0.x, R2.w;\n" + "MAX R0.x, R0.w, R1.w;\n" + "MAX R2.x, R0, R0.y;\n" + "ADD R3, R3, R4;\n" + "MAD R3, R3, c[3].z, R5;\n" + "MUL R3, R3, c[3].z;\n" + "SLT R1.z, R2.x, R3.w;\n" + "SLT R1.y, R3.w, R1.x;\n" + "TEX R0, fragment.texcoord[0], texture[0], 2D;\n" + "ADD_SAT R1.y, R1, R1.z;\n" + "MIN R1.z, R0.w, R1.x;\n" + "MAX R1.x, R2, R0.w;\n" + "ADD R2.y, R1.x, -R1.z;\n" + "CMP R1, -R1.y, R5, R3;\n" + "MAD R2.x, R2.y, c[2].z, -R2;\n" + "CMP result.color, R2.x, R0, R1;\n" + "END\n"; + //"# 51 instructions, 6 R-regs\n" + +const char *a_ps_2_0_test_t0 = + "ps_2_x\n" + "dcl_2d s0\n" + "dcl t0.xyz\n" + "mov r0.xy, t0.xy\n" + "texld r0, r0, s0\n" + "mov oC0, r0\n"; + +const char *a_ps_2_0_test_avg = + "ps_2_x\n" + "dcl_2d s0\n" + "def c0, 0.25000000, 0, 0, 0\n" + "dcl t1\n" + "mov r0.xy, t1.xwzw\n" + "mov r1.xy, t1.zyzw\n" + "texld r0, r0, s0\n" + "texld r1, r1, s0\n" + "add r2, r1, r0\n" + "mov r0.xy, t1.zwzw\n" + "texld r1, t1, s0\n" + "texld r0, r0, s0\n" + "add r1, r2, r1\n" + "add r0, r1, r0\n" + "mul r0, r0, c0.x\n" + "mov oC0, r0\n"; + +const char *a_ps_2_0 = + "ps_2_x\n" + /*"// cgc version 3.1.0013, build date Apr 18 2012\n" + "// command line args: -profile ps_2_x -O3 -fastmath -fastprecision\n" + "// source file: fxaa_pp.cg\n" + "//vendor NVIDIA Corporation\n" + "//version 3.1.0.13\n" + "//profile ps_2_x\n" + "//program fxaa_pp\n" + "//semantic fxaa_pp.fxaaQualityRcpFrame\n" + "//semantic fxaa_pp.fxaaQualitySubpix\n" + "//semantic fxaa_pp.fxaaQualityEdgeThreshold\n" + "//semantic fxaa_pp.fxaaQualityEdgeThresholdMin\n" + "//semantic fxaa_pp.nlTex0 : TEX0\n" + "//var float2 pos : $vin.TEXCOORD0 : TEX0 : 0 : 1\n" + "//var float2 fxaaQualityRcpFrame : : c[0] : 2 : 1\n" + "//var float fxaaQualitySubpix : : c[1] : 3 : 1\n" + "//var float fxaaQualityEdgeThreshold : : c[2] : 4 : 1\n" + "//var float fxaaQualityEdgeThresholdMin : : c[3] : 5 : 1\n" + "//var sampler2D nlTex0 : TEX0 : texunit 0 : 6 : 1\n" + "//var float4 oCol : $vout.COLOR : COL : 7 : 1\n" + "//const c[4] = 0 -1 1 -2\n" + "//const c[5] = 2 0.5 0.25 1.5\n" + "//const c[6] = 4 12 0.083333336\n" + "//const c[7] = -2 3\n"*/ + "dcl_2d s0\n" + "def c4, 0.00000000, -1.00000000, 1.00000000, -2.00000000\n" + "def c5, 2.00000000, 0.50000000, 0.25000000, 1.50000000\n" + "def c6, 4.00000000, 12.00000000, 0.08333334, 0\n" + "def c7, -2.00000000, 3.00000000, 0, 0\n" + "dcl t0.xy\n" + "mov r0.zw, c0.xyxy\n" + "mad r3.xy, c4.zxzw, r0.zwzw, t0\n" + "texld r7, r3, s0\n" + "texld r1, t0, s0\n" + "mov r0.xy, c0\n" + "mad r0.xy, c4.yxzw, r0, t0\n" + "texld r8, r0, s0\n" + "mov r0.xy, c0\n" + "mad r0.xy, c4, r0, t0\n" + "texld r9, r0, s0\n" + "add r0.xy, t0, -c0\n" + "texld r5, r0, s0\n" + "mov r3.xy, c0\n" + "mad r3.xy, c4.zyzw, r3, t0\n" + "texld r3, r3, s0\n" + "add r7.x, r8.y, r7.y\n" + "mad r0.z, r1.y, c4.w, r7.x\n" + "add r0.x, r5.y, r3.y\n" + "mad r0.w, r9.y, c4, r0.x\n" + "mov r0.xy, c0\n" + "mad r0.xy, c4.xzzw, r0, t0\n" + "texld r6, r0, s0\n" + "add r5.x, r9.y, r6.y\n" + "abs r0.z, r0\n" + "abs r0.w, r0\n" + "mad r3.x, r0.z, c5, r0.w\n" + "mov r0.zw, c0.xyxy\n" + "mad r4.xy, c4.yzzw, r0.zwzw, t0\n" + "texld r4, r4, s0\n" + "add r0.xy, t0, c0\n" + "texld r0, r0, s0\n" + "add r4.x, r5.y, r4.y\n" + "add r5.y, r3, r0\n" + "add r0.x, r4.y, r0.y\n" + "mad r0.x, r6.y, c4.w, r0\n" + "abs r0.x, r0\n" + "add r0.w, r0.x, r3.x\n" + "mad r0.x, r8.y, c4.w, r4\n" + "mad r0.z, r7.y, c4.w, r5.y\n" + "mad r0.y, r1, c4.w, r5.x\n" + "abs r0.z, r0\n" + "abs r0.y, r0\n" + "mad r0.y, r0, c5.x, r0.z\n" + "abs r0.x, r0\n" + "add r0.x, r0, r0.y\n" + "add r0.x, r0, -r0.w\n" + "cmp r3.y, r0.x, c4.z, c4.x\n" + "max r0.y, r6, r1\n" + "max r0.z, r7.y, r0.y\n" + "max r0.y, r9, r8\n" + "max r0.y, r0, r0.z\n" + "min r0.z, r6.y, r1.y\n" + "min r0.w, r7.y, r0.z\n" + "min r0.z, r9.y, r8.y\n" + "min r0.z, r0, r0.w\n" + "mul r3.x, r0.y, c2\n" + "abs_pp r0.x, r3.y\n" + "add r4.y, r0, -r0.z\n" + "max r0.w, r3.x, c3.x\n" + "add r4.z, r4.y, -r0.w\n" + "cmp_pp r4.w, r4.z, c4.z, c4.x\n" + "mul_pp r5.w, r4, r3.y\n" + "cmp_pp r0.y, -r0.x, c4.z, c4.x\n" + "mul_pp r5.z, r4.w, r0.y\n" + "cmp_pp r3.x, -r0, c4, c4.z\n" + "cmp r6.w, -r5.z, r6.y, r7.y\n" + "cmp r7.w, -r5.z, r9.y, r8.y\n" + "add r0.z, -r1.y, r6.w\n" + "add r0.y, -r1, r7.w\n" + "abs r9.z, r0\n" + "abs r7.y, r0\n" + "add r0.y, r7, -r9.z\n" + "cmp r0.y, r0, c4.z, c4.x\n" + "max r7.y, r7, r9.z\n" + "mul_pp r0.z, r4.w, r0.y\n" + "cmp r0.w, -r5, c0.x, c0.y\n" + "cmp r6.x, -r0.z, r0.w, -r0.w\n" + "mov r0.z, c0.y\n" + "cmp r6.y, -r5.z, c4.x, r0.z\n" + "mad r0.w, r6.x, c5.y, t0.y\n" + "cmp r0.z, -r5.w, t0.y, r0.w\n" + "add r8.z, r0, r6.y\n" + "add r7.z, r0, -r6.y\n" + "mov r9.y, r7.z\n" + "mov r8.y, r8.z\n" + "mad r0.w, r6.x, c5.y, t0.x\n" + "mov r0.x, c0\n" + "mul_pp r3.x, r4.w, r3\n" + "cmp r6.z, -r3.x, c4.x, r0.x\n" + "cmp r0.x, -r5.z, t0, r0.w\n" + "add r9.x, r0, -r6.z\n" + "texld r3, r9, s0\n" + "add r8.x, r0, r6.z\n" + "abs_pp r3.x, r0.y\n" + "texld r0, r8, s0\n" + "cmp_pp r0.x, -r3, c4.z, c4\n" + "add r0.w, r1.y, r6\n" + "add r0.z, r1.y, r7.w\n" + "mul_pp r0.x, r4.w, r0\n" + "cmp r6.w, -r0.x, r0.z, r0\n" + "mad r7.w, -r6, c5.y, r0.y\n" + "mad r8.w, -r6, c5.y, r3.y\n" + "abs r0.y, r7.w\n" + "abs r0.x, r8.w\n" + "mad r0.x, -r7.y, c5.z, r0\n" + "mad r0.y, -r7, c5.z, r0\n" + "cmp r0.x, r0, c4.z, c4\n" + "abs_pp r0.x, r0\n" + "cmp_pp r9.z, -r0.x, c4, c4.x\n" + "cmp r0.y, r0, c4.z, c4.x\n" + "abs_pp r0.y, r0\n" + "cmp_pp r9.w, -r0.y, c4.z, c4.x\n" + "mul_pp r0.x, r4.w, r9.z\n" + "mad r0.y, -r6, c5.w, r7.z\n" + "cmp r7.z, -r0.x, r7, r0.y\n" + "mad r0.z, -r6, c5.w, r9.x\n" + "cmp r9.x, -r0, r9, r0.z\n" + "mov r9.y, r7.z\n" + "texld r3, r9, s0\n" + "add_pp_sat r3.z, r9, r9.w\n" + "mul_pp r0.x, r4.w, r9.w\n" + "mad r0.y, r6, c5.w, r8.z\n" + "cmp r3.x, -r0, r8.z, r0.y\n" + "mad r0.z, r6, c5.w, r8.x\n" + "mul_pp r8.z, r4.w, r3\n" + "cmp r8.x, -r0, r8, r0.z\n" + "mov r8.y, r3.x\n" + "texld r0, r8, s0\n" + "mul_pp r0.w, r8.z, r9\n" + "cmp r3.z, -r0.w, r7.w, r0.y\n" + "mul_pp r0.x, r8.z, r9.z\n" + "cmp r0.y, -r0.x, r8.w, r3\n" + "mad r0.z, -r6.w, c5.y, r0.y\n" + "cmp r8.w, -r0.x, r0.y, r0.z\n" + "mad r3.y, -r6.w, c5, r3.z\n" + "cmp r9.w, -r0, r3.z, r3.y\n" + "abs r0.y, r9.w\n" + "abs r0.x, r8.w\n" + "mad r0.y, -r7, c5.z, r0\n" + "mad r0.x, -r7.y, c5.z, r0\n" + "cmp r0.y, r0, c4.z, c4.x\n" + "abs_pp r0.y, r0\n" + "cmp_pp r10.x, -r0.y, c4.z, c4\n" + "cmp r0.x, r0, c4.z, c4\n" + "abs_pp r0.x, r0\n" + "cmp_pp r9.z, -r0.x, c4, c4.x\n" + "mul_pp r0.x, r8.z, r10\n" + "mad r0.y, r6, c5.x, r3.x\n" + "cmp r7.w, -r0.x, r3.x, r0.y\n" + "mad r0.z, r6, c5.x, r8.x\n" + "cmp r8.x, -r0, r8, r0.z\n" + "mov r8.y, r7.w\n" + "texld r0, r8, s0\n" + "mul_pp r0.w, r8.z, r9.z\n" + "mad r3.x, -r6.z, c5, r9\n" + "mad r0.x, -r6.y, c5, r7.z\n" + "cmp r0.x, -r0.w, r7.z, r0\n" + "add_pp_sat r0.z, r9, r10.x\n" + "mul_pp r7.z, r8, r0\n" + "cmp r9.x, -r0.w, r9, r3\n" + "mov r9.y, r0.x\n" + "texld r3, r9, s0\n" + "mul_pp r0.z, r7, r9\n" + "cmp r0.w, -r0.z, r8, r3.y\n" + "mul_pp r3.x, r7.z, r10\n" + "cmp r3.y, -r3.x, r9.w, r0\n" + "mad r0.y, -r6.w, c5, r0.w\n" + "cmp r8.z, -r0, r0.w, r0.y\n" + "mad r3.z, -r6.w, c5.y, r3.y\n" + "cmp r9.z, -r3.x, r3.y, r3\n" + "abs r0.y, r8.z\n" + "abs r0.z, r9\n" + "mad r0.y, -r7, c5.z, r0\n" + "mad r0.z, -r7.y, c5, r0\n" + "cmp r0.y, r0, c4.z, c4.x\n" + "abs_pp r0.y, r0\n" + "cmp_pp r8.w, -r0.y, c4.z, c4.x\n" + "cmp r0.z, r0, c4, c4.x\n" + "abs_pp r0.z, r0\n" + "cmp_pp r9.w, -r0.z, c4.z, c4.x\n" + "mul_pp r0.y, r7.z, r8.w\n" + "mad r0.z, -r6.y, c6.x, r0.x\n" + "cmp r10.x, -r0.y, r0, r0.z\n" + "mad r0.w, -r6.z, c6.x, r9.x\n" + "cmp r9.x, -r0.y, r9, r0.w\n" + "mov r9.y, r10.x\n" + "texld r3, r9, s0\n" + "mul_pp r0.x, r7.z, r9.w\n" + "mad r0.z, r6, c6.x, r8.x\n" + "mad r0.y, r6, c6.x, r7.w\n" + "cmp r3.x, -r0, r7.w, r0.y\n" + "cmp r8.x, -r0, r8, r0.z\n" + "mov r8.y, r3.x\n" + "texld r0, r8, s0\n" + "add_pp_sat r3.z, r8.w, r9.w\n" + "mul_pp r0.x, r7.z, r3.z\n" + "mul_pp r3.z, r0.x, r9.w\n" + "cmp r0.y, -r3.z, r9.z, r0\n" + "mul_pp r0.z, r0.x, r8.w\n" + "cmp r0.w, -r0.z, r8.z, r3.y\n" + "mad r3.w, -r6, c5.y, r0.y\n" + "cmp r0.y, -r3.z, r0, r3.w\n" + "mad r3.y, -r6.w, c5, r0.w\n" + "cmp r0.z, -r0, r0.w, r3.y\n" + "abs r3.y, r0\n" + "abs r0.w, r0.z\n" + "mad r3.y, -r7, c5.z, r3\n" + "mad r0.w, -r7.y, c5.z, r0\n" + "cmp r3.y, r3, c4.z, c4.x\n" + "abs_pp r3.y, r3\n" + "cmp r0.w, r0, c4.z, c4.x\n" + "cmp_pp r3.z, -r3.y, c4, c4.x\n" + "abs_pp r0.w, r0\n" + "cmp_pp r3.y, -r0.w, c4.z, c4.x\n" + "mul_pp r0.w, r0.x, r3.z\n" + "mul_pp r0.x, r0, r3.y\n" + "mad r3.w, r6.y, c6.y, r3.x\n" + "cmp r3.x, -r0.w, r3, r3.w\n" + "mad r3.z, r6, c6.y, r8.x\n" + "cmp r0.w, -r0, r8.x, r3.z\n" + "mad r3.y, -r6, c6, r10.x\n" + "cmp r3.y, -r0.x, r10.x, r3\n" + "add r3.x, -t0.y, r3\n" + "add r0.w, -t0.x, r0\n" + "cmp r0.w, -r5.z, r0, r3.x\n" + "mad r3.x, -r6.z, c6.y, r9\n" + "cmp r0.x, -r0, r9, r3\n" + "add r3.x, t0.y, -r3.y\n" + "add r0.x, t0, -r0\n" + "cmp r0.x, -r5.z, r0, r3\n" + "add r3.x, r0, -r0.w\n" + "add r3.y, r0.x, r0.w\n" + "cmp r3.x, r3, c4, c4.z\n" + "abs_pp r3.x, r3\n" + "min r0.x, r0, r0.w\n" + "cmp_pp r3.x, -r3, c4.z, c4\n" + "mul_pp r0.w, r4, r3.x\n" + "rcp r3.y, r3.y\n" + "mad r0.x, r0, -r3.y, c5.y\n" + "cmp r3.y, r0, c4.x, c4.z\n" + "mad r3.x, -r6.w, c5.y, r1.y\n" + "cmp r3.x, r3, c4, c4.z\n" + "cmp r0.y, r0.z, c4.x, c4.z\n" + "add_pp r0.z, -r3.x, r3.y\n" + "add_pp r0.y, r0, -r3.x\n" + "abs_pp r0.y, r0\n" + "abs_pp r0.z, r0\n" + "cmp_pp r0.z, -r0, c4.x, c4\n" + "cmp_pp r0.y, -r0, c4.x, c4.z\n" + "cmp_pp r0.y, -r0.w, r0, r0.z\n" + "abs_pp r0.y, r0\n" + "cmp_pp r0.y, -r0, c4.z, c4.x\n" + "mul_pp r0.y, r4.w, r0\n" + "rcp r0.w, r4.y\n" + "cmp r0.x, -r0.y, r0, c4\n" + "add r3.y, r4.x, r5\n" + "add r3.x, r5, r7\n" + "mad r3.x, r3, c5, r3.y\n" + "mad r0.z, r3.x, c6, -r1.y\n" + "abs r0.z, r0\n" + "mul_sat r0.z, r0, r0.w\n" + "mul r0.w, r0.z, r0.z\n" + "mad r0.z, r0, c7.x, c7.y\n" + "mul r0.z, r0, r0.w\n" + "mul r0.z, r0, r0\n" + "mul r0.z, r0, c1.x\n" + "max r0.x, r0, r0.z\n" + "mad r0.y, r0.x, r6.x, t0\n" + "mad r0.z, r0.x, r6.x, t0.x\n" + "cmp r0.x, -r5.z, t0, r0.z\n" + "cmp r0.y, -r5.w, t0, r0\n" + "texld r0, r0, s0\n" + "mov r0.w, r1.y\n" + "cmp r1, r4.z, r2, r1\n" + "cmp r0, -r4.w, r1, r0\n" + "mov oC0, r0\n"; + +const char *a_ps_2_0_ps3 = + "ps_2_0\n" + // cgc version 3.1.0013, build date Apr 18 2012 + // command line args: -profile ps_2_0 -O3 -fastmath -fastprecision + // source file: fxaa_pp.cg + //vendor NVIDIA Corporation + //version 3.1.0.13 + //profile ps_2_0 + //program fxaa_pp + //semantic fxaa_pp.fxaaConsoleRcpFrameOpt + //semantic fxaa_pp.fxaaConsoleRcpFrameOpt2 + //semantic fxaa_pp.nlTex0 : TEX0 + //var float2 pos : $vin.TEXCOORD0 : TEX0 : 0 : 1 + //var float4 fxaaConsolePosPos : $vin.TEXCOORD1 : TEX1 : 1 : 1 + //var float4 fxaaConsoleRcpFrameOpt : : c[0] : 2 : 1 + //var float4 fxaaConsoleRcpFrameOpt2 : : c[1] : 3 : 1 + //var sampler2D nlTex0 : TEX0 : texunit 0 : 4 : 1 + //var float4 oCol : $vout.COLOR : COL : 5 : 1 + //const c[2] = 0.001953125 0.125 2 -2 + //const c[3] = 0.5 0 1 + "dcl_2d s0\n" + "def c2, 0.00195313, 0.12500000, 2.00000000, -2.00000000\n" + "def c3, 0.50000000, 0.00000000, 1.00000000, 0\n" + "dcl t1\n" + "dcl t0.xy\n" + "texld r5, t1, s0\n" + "mov r1.y, t1.w\n" + "mov r1.x, t1.z\n" + "mov r2.xy, r1\n" + "mov r0.y, t1.w\n" + "mov r0.x, t1\n" + "mov r1.y, t1\n" + "mov r1.x, t1.z\n" + "texld r1, r1, s0\n" + "texld r0, r0, s0\n" + "texld r6, r2, s0\n" + "add r0.x, r1.w, c2\n" + "add r2.x, -r0, r0.w\n" + "add r1.x, r5.w, r2\n" + "add r2.z, r1.x, -r6.w\n" + "add r2.x, -r5.w, r2\n" + "add r2.x, r6.w, r2\n" + "mov r3.x, r2\n" + "mov r3.y, r2.z\n" + "mov r2.y, r2.z\n" + "mov r1.y, r2.z\n" + "mov r1.x, r2\n" + "mul r1.xy, r3, r1\n" + "add r1.x, r1, r1.y\n" + "rsq r1.x, r1.x\n" + "mul r4.xy, r1.x, r2\n" + "abs r2.x, r4.y\n" + "abs r1.x, r4\n" + "min r1.x, r1, r2\n" + "rcp r1.x, r1.x\n" + "mul r1.xy, r1.x, r4\n" + "mul r1.xy, r1, c2.y\n" + "min r1.xy, r1, c2.z\n" + "max r2.xy, r1, c2.w\n" + "mov r1.y, c1.w\n" + "mov r1.x, c1.z\n" + "mad r3.xy, r2, r1, t0\n" + "mov r1.y, c1.w\n" + "mov r1.x, c1.z\n" + "mad r5.xy, -r2, r1, t0\n" + "mov r1.y, c0.w\n" + "mov r1.x, c0.z\n" + "mad r2.xy, -r4, r1, t0\n" + "mov r1.y, c0.w\n" + "mov r1.x, c0.z\n" + "mad r1.xy, r4, r1, t0\n" + "texld r4, r5, s0\n" + "texld r3, r3, s0\n" + "texld r1, r1, s0\n" + "texld r2, r2, s0\n" + "add r1, r2, r1\n" + "mul r2, r1, c3.x\n" + "add r1, r4, r3\n" + "max r3.x, r0, r6.w\n" + "mad r1, r1, c3.x, r2\n" + "mul r4, r1, c3.x\n" + "max r1.x, r0.w, r5.w\n" + "max r1.x, r1, r3\n" + "add r1.x, -r4.w, r1\n" + "min r3.x, r0.w, r5.w\n" + "min r0.x, r0, r6.w\n" + "min r0.x, r3, r0\n" + "add r0.x, r4.w, -r0\n" + "cmp r1.x, r1, c3.y, c3.z\n" + "cmp r0.x, r0, c3.y, c3.z\n" + "add_pp_sat r0.x, r0, r1\n" + "cmp r0, -r0.x, r4, r2\n" + "mov oC0, r0\n"; + +const char *a_ps_2_0_earlyexit = + "ps_2_x\n" + // cgc version 3.1.0013, build date Apr 18 2012 + // command line args: -profile ps_2_x + // source file: fxaa_fp.cg + //vendor NVIDIA Corporation + //version 3.1.0.13 + //profile ps_2_x + //program fxaa_fp + //semantic fxaa_fp.fxaaConsoleRcpFrameOpt + //semantic fxaa_fp.fxaaConsoleRcpFrameOpt2 + //semantic fxaa_fp.nlTex0 : TEX0 + //var float2 pos : $vin.TEXCOORD0 : TEX0 : 0 : 1 + //var float4 fxaaConsolePosPos : $vin.TEXCOORD1 : TEX1 : 1 : 1 + //var float4 fxaaConsoleRcpFrameOpt : : c[0] : 2 : 1 + //var float4 fxaaConsoleRcpFrameOpt2 : : c[1] : 3 : 1 + //var sampler2D nlTex0 : TEX0 : texunit 0 : 4 : 1 + //var float4 oCol : $vout.COLOR : COL : 5 : 1 + //const c[2] = 0.001953125 0 0.125 2 + //const c[3] = -2 0.5 0 1 + //const c[4] = 8 + "dcl_2d s0\n" + "def c2, 0.00195313, 0.00000000, 0.12500000, 2.00000000\n" + "def c3, -2.00000000, 0.50000000, 0.00000000, 1.00000000\n" + "def c4, 8.00000000, 0, 0, 0\n" + "dcl t1\n" + "dcl t0.xy\n" + "mov r0.xy, t1.zyzw\n" + "texld r0, r0, s0\n" + "mov r0.xy, t1.xwzw\n" + "texld r5, t1, s0\n" + "texld r4, r0, s0\n" + "add r4.x, r0.w, c2\n" + "mov r0.xy, t1.zwzw\n" + "texld r3, r0, s0\n" + "add r0.w, r4, -r4.x\n" + "add r0.x, r5.w, r0.w\n" + "add r0.z, -r3.w, r0.x\n" + "add r0.x, -r5.w, r0.w\n" + "add r0.x, r3.w, r0\n" + "mov r0.y, c2\n" + "dp3 r0.y, r0, r0\n" + "rsq r0.y, r0.y\n" + "mul r0.zw, r0.y, r0.xyxz\n" + "mad r1.xy, -r0.zwzw, c0.zwzw, t0\n" + "texld r1, r1, s0\n" + "abs r0.y, r0.w\n" + "abs r0.x, r0.z\n" + "min r0.x, r0, r0.y\n" + "rcp r0.x, r0.x\n" + "mul r0.xy, r0.x, r0.zwzw\n" + "mul r0.xy, r0, c2.z\n" + "min r2.xy, r0, c2.w\n" + "mad r0.xy, r0.zwzw, c0.zwzw, t0\n" + "texld r0, r0, s0\n" + "add r0, r1, r0\n" + "max r1.xy, r2, c3.x\n" + "mul r2, r0, c3.y\n" + "mad r0.xy, r1, c1.zwzw, t0\n" + "mad r1.xy, -r1, c1.zwzw, t0\n" + "texld r0, r0, s0\n" + "texld r1, r1, s0\n" + "add r0, r1, r0\n" + "mad r0, r0, c3.y, r2\n" + "mul r1, r0, c3.y\n" + "min r0.y, r4.x, r3.w\n" + "min r0.x, r5.w, r4.w\n" + "min r3.y, r0.x, r0\n" + "add r0.x, -r3.y, r1.w\n" + "max r0.z, r4.x, r3.w\n" + "max r0.y, r5.w, r4.w\n" + "max r3.x, r0.y, r0.z\n" + "cmp r3.z, r0.x, c3, c3.w\n" + "add r3.w, r3.x, -r1\n" + "cmp r3.w, r3, c3.z, c3\n" + "add_pp_sat r3.z, r3, r3.w\n" + "texld r0, t0, s0\n" + "min r3.w, r0, r3.y\n" + "max r3.y, r3.x, r0.w\n" + "cmp r1, -r3.z, r1, r2\n" + "add r3.y, r3, -r3.w\n" + "mad r2.x, r3.y, c4, -r3\n" + "cmp r0, r2.x, r1, r0\n" + "mov oC0, r0\n"; diff --git a/code/nel/src/3d/init_3d.cpp b/code/nel/src/3d/init_3d.cpp index bd8dffdfd..b2bf2c05e 100644 --- a/code/nel/src/3d/init_3d.cpp +++ b/code/nel/src/3d/init_3d.cpp @@ -19,19 +19,35 @@ #include "nel/3d/init_3d.h" #include +#include "nel/3d/scene.h" +#include "nel/3d/register_3d.h" + +namespace +{ +static bool _Initialized = false; +} namespace NL3D { void init3d () { + + if( _Initialized ) + return; + // Init for windows #ifdef NL_OS_WINDOWS // Enable FPU exceptions // Enable divid by zero and overflow exception - _control87 (_EM_INVALID|_EM_DENORMAL/*|_EM_ZERODIVIDE|_EM_OVERFLOW*/|_EM_UNDERFLOW|_EM_INEXACT, _MCW_EM); + //_control87 (_EM_INVALID|_EM_DENORMAL/*|_EM_ZERODIVIDE|_EM_OVERFLOW*/|_EM_UNDERFLOW|_EM_INEXACT, _MCW_EM); #endif // NL_OS_WINDOWS + + NL3D::registerSerial3d(); + CScene::registerBasics(); + + _Initialized = true; } } // NL3D diff --git a/code/nel/src/3d/instance_lighter.cpp b/code/nel/src/3d/instance_lighter.cpp index f754ebb8b..d21f80e4e 100644 --- a/code/nel/src/3d/instance_lighter.cpp +++ b/code/nel/src/3d/instance_lighter.cpp @@ -408,6 +408,12 @@ void CInstanceLighter::light (const CInstanceGroup &igIn, CInstanceGroup &igOut, string name= _Instances[i].Name; bool shapeFound= true; + if (toLower (CFile::getExtension (name)) == "pacs_prim") + { + nlwarning("EXPORT BUG: Can't read %s (not a shape), should not be part of .ig!", name.c_str()); + continue; + } + // Try to find the shape in the UseShapeMap. std::map::const_iterator iteMap= lightDesc.UserShapeMap.find (name); diff --git a/code/nel/src/3d/landscape.cpp b/code/nel/src/3d/landscape.cpp index 154f6f847..ccdeabc34 100644 --- a/code/nel/src/3d/landscape.cpp +++ b/code/nel/src/3d/landscape.cpp @@ -583,7 +583,6 @@ void CLandscape::setDriver(IDriver *drv) // Does the driver has sufficient requirements for Vegetable??? // only if VP supported by GPU, and Only if max vertices allowed. _DriverOkForVegetable = _VertexShaderOk && (_Driver->getMaxVerticesByVertexBufferHard()>=(uint)NL3D_LANDSCAPE_VEGETABLE_MAX_AGP_VERTEX_MAX); - } } diff --git a/code/nel/src/3d/landscapevb_allocator.cpp b/code/nel/src/3d/landscapevb_allocator.cpp index 2c30cc19b..51714b88d 100644 --- a/code/nel/src/3d/landscapevb_allocator.cpp +++ b/code/nel/src/3d/landscapevb_allocator.cpp @@ -611,7 +611,6 @@ void CLandscapeVBAllocator::setupVBFormatAndVertexProgram(bool withVertexProgr nlverify(_Driver->compileVertexProgram(_VertexProgram[1])); } } - } diff --git a/code/nel/src/3d/lod_character_shape.cpp b/code/nel/src/3d/lod_character_shape.cpp index 6250f2fb5..02d15ce03 100644 --- a/code/nel/src/3d/lod_character_shape.cpp +++ b/code/nel/src/3d/lod_character_shape.cpp @@ -354,7 +354,7 @@ void CLodCharacterShape::buildMesh(const std::string &name, const CLodCharacte const vector &normals= lodBuild.Normals; nlassert(numVertices>0); - nlassert(triangleIndices.size()>0); + nlassert(!triangleIndices.empty()); nlassert((triangleIndices.size()%3)==0); nlassert(skinWeights.size() == numVertices); nlassert(uvs.size() == numVertices); diff --git a/code/nel/src/3d/mesh_mrm_skin.cpp b/code/nel/src/3d/mesh_mrm_skin.cpp index 13e8bdd21..23ff04fee 100644 --- a/code/nel/src/3d/mesh_mrm_skin.cpp +++ b/code/nel/src/3d/mesh_mrm_skin.cpp @@ -16,6 +16,10 @@ #include "std3d.h" +#ifdef NL_HAS_SSE2 +# include +#endif + #include "nel/misc/bsphere.h" #include "nel/misc/fast_mem.h" #include "nel/misc/system_info.h" @@ -39,124 +43,6 @@ namespace NL3D { -// *************************************************************************** -// *************************************************************************** -// CMatrix3x4SSE array correctly aligned -// *************************************************************************** -// *************************************************************************** - - - -// *************************************************************************** -#define NL3D_SSE_ALIGNEMENT 16 -/** - * A CMatrix3x4SSE array correctly aligned - * NB: SSE is no more used (no speed gain, some memory problem), but keep it for possible future usage. - */ -class CMatrix3x4SSEArray -{ -private: - void *_AllocData; - void *_Data; - uint _Size; - uint _Capacity; - -public: - CMatrix3x4SSEArray() - { - _AllocData= NULL; - _Data= NULL; - _Size= 0; - _Capacity= 0; - } - ~CMatrix3x4SSEArray() - { - clear(); - } - CMatrix3x4SSEArray(const CMatrix3x4SSEArray &other) - { - _AllocData= NULL; - _Data= NULL; - _Size= 0; - _Capacity= 0; - *this= other; - } - CMatrix3x4SSEArray &operator=(const CMatrix3x4SSEArray &other) - { - if( this == &other) - return *this; - resize(other.size()); - // copy data from aligned pointers to aligned pointers. - memcpy(_Data, other._Data, size() * sizeof(CMatrix3x4SSE) ); - - return *this; - } - - - CMatrix3x4SSE *getPtr() - { - return (CMatrix3x4SSE*)_Data; - } - - void clear() - { - delete [] ((uint8 *)_AllocData); - _AllocData= NULL; - _Data= NULL; - _Size= 0; - _Capacity= 0; - } - - void resize(uint n) - { - // reserve ?? - if(n>_Capacity) - reserve( max(2*_Capacity, n)); - _Size= n; - } - - void reserve(uint n) - { - if(n==0) - clear(); - else if(n>_Capacity) - { - // Alloc new data. - void *newAllocData; - void *newData; - - // Alloc for alignement. - newAllocData= new uint8 [n * sizeof(CMatrix3x4SSE) + NL3D_SSE_ALIGNEMENT-1]; - if(newAllocData==NULL) - throw Exception("SSE Allocation Failed"); - - // Align ptr - newData= (void*) ( ((ptrdiff_t)newAllocData+NL3D_SSE_ALIGNEMENT-1) & (~(NL3D_SSE_ALIGNEMENT-1)) ); - - // copy valid data from old to new. - memcpy(newData, _Data, size() * sizeof(CMatrix3x4SSE) ); - - // release old. - if(_AllocData) - delete [] ((uint8*)_AllocData); - - // change ptrs and capacity. - _Data= newData; - _AllocData= newAllocData; - _Capacity= n; - - // TestYoyo - //nlwarning("YOYO Tst SSE P4: %X, %d", _Data, n); - } - } - - uint size() const {return _Size;} - - - CMatrix3x4SSE &operator[](uint i) {return ((CMatrix3x4SSE*)_Data)[i];} -}; - - // *************************************************************************** // *************************************************************************** diff --git a/code/nel/src/3d/mesh_mrm_skin_template.cpp b/code/nel/src/3d/mesh_mrm_skin_template.cpp index 1958cae90..4a9e11106 100644 --- a/code/nel/src/3d/mesh_mrm_skin_template.cpp +++ b/code/nel/src/3d/mesh_mrm_skin_template.cpp @@ -39,7 +39,23 @@ static void applyArraySkinNormalT(uint numMatrixes, uint32 *infPtr, CMesh::CSkin { /* Prefetch all vertex/normal before, it is to be faster. */ -#if defined(NL_OS_WINDOWS) && !defined(NL_NO_ASM) +#ifdef NL_HAS_SSE2 + { + uint nInfTmp= nInf; + uint32 *infTmpPtr= infPtr; + for(;nInfTmp>0;nInfTmp--, infTmpPtr++) + { + uint index= *infTmpPtr; + CMesh::CSkinWeight *srcSkin= srcSkinPtr + index; + CVector *srcVertex= srcVertexPtr + index; + CVector *srcNormal= srcNormalPtr + index; + + _mm_prefetch((const char *)(void *)srcSkin, _MM_HINT_T1); + _mm_prefetch((const char *)(void *)srcVertex, _MM_HINT_T1); + _mm_prefetch((const char *)(void *)srcNormal, _MM_HINT_T1); + } + } +#elif defined(NL_OS_WINDOWS) && !defined(NL_NO_ASM) { uint nInfTmp= nInf; uint32 *infTmpPtr= infPtr; @@ -176,7 +192,25 @@ static void applyArraySkinTangentSpaceT(uint numMatrixes, uint32 *infPtr, CMesh: { /* Prefetch all vertex/normal/tgSpace before, it is faster. */ -#if defined(NL_OS_WINDOWS) && !defined(NL_NO_ASM) +#ifdef NL_HAS_SSE2 + { + uint nInfTmp= nInf; + uint32 *infTmpPtr= infPtr; + for(;nInfTmp>0;nInfTmp--, infTmpPtr++) + { + uint index= *infTmpPtr; + CMesh::CSkinWeight *srcSkin= srcSkinPtr + index; + CVector *srcVertex= srcVertexPtr + index; + CVector *srcNormal= srcNormalPtr + index; + CVector *srcTgSpace= tgSpacePtr + index; + + _mm_prefetch((const char *)(void *)srcSkin, _MM_HINT_T1); + _mm_prefetch((const char *)(void *)srcVertex, _MM_HINT_T1); + _mm_prefetch((const char *)(void *)srcNormal, _MM_HINT_T1); + _mm_prefetch((const char *)(void *)srcTgSpace, _MM_HINT_T1); + } + } +#elif defined(NL_OS_WINDOWS) && !defined(NL_NO_ASM) { uint nInfTmp= nInf; uint32 *infTmpPtr= infPtr; diff --git a/code/nel/src/3d/mesh_mrm_skinned.cpp b/code/nel/src/3d/mesh_mrm_skinned.cpp index 2b1c3beb6..6af29bf73 100644 --- a/code/nel/src/3d/mesh_mrm_skinned.cpp +++ b/code/nel/src/3d/mesh_mrm_skinned.cpp @@ -2247,123 +2247,6 @@ void CMeshMRMSkinnedGeom::getSkinWeights (std::vector &skinW } } -// *************************************************************************** -// *************************************************************************** -// CMatrix3x4SSE array correctly aligned -// *************************************************************************** -// *************************************************************************** - - - -// *************************************************************************** -#define NL3D_SSE_ALIGNEMENT 16 -/** - * A CMatrix3x4SSEArray array correctly aligned - * NB: SSE is no more used (no speed gain, some memory problem), but keep it for possible future usage. - */ -class CMatrix3x4SSEArray -{ -private: - void *_AllocData; - void *_Data; - uint _Size; - uint _Capacity; - -public: - CMatrix3x4SSEArray() - { - _AllocData= NULL; - _Data= NULL; - _Size= 0; - _Capacity= 0; - } - ~CMatrix3x4SSEArray() - { - clear(); - } - CMatrix3x4SSEArray(const CMatrix3x4SSEArray &other) - { - _AllocData= NULL; - _Data= NULL; - _Size= 0; - _Capacity= 0; - *this= other; - } - CMatrix3x4SSEArray &operator=(const CMatrix3x4SSEArray &other) - { - if( this == &other) - return *this; - resize(other.size()); - // copy data from aligned pointers to aligned pointers. - memcpy(_Data, other._Data, size() * sizeof(CMatrix3x4SSE) ); - - return *this; - } - - - CMatrix3x4SSE *getPtr() - { - return (CMatrix3x4SSE*)_Data; - } - - void clear() - { - delete [] ((uint8 *) _AllocData); - _AllocData= NULL; - _Data= NULL; - _Size= 0; - _Capacity= 0; - } - - void resize(uint n) - { - // reserve ?? - if(n>_Capacity) - reserve( max(2*_Capacity, n)); - _Size= n; - } - - void reserve(uint n) - { - if(n==0) - clear(); - else if(n>_Capacity) - { - // Alloc new data. - void *newAllocData; - void *newData; - - // Alloc for alignement. - newAllocData= new uint8 [n * sizeof(CMatrix3x4SSE) + NL3D_SSE_ALIGNEMENT-1]; - if(newAllocData==NULL) - throw Exception("SSE Allocation Failed"); - - // Align ptr - newData= (void*) ( ((ptrdiff_t)newAllocData+NL3D_SSE_ALIGNEMENT-1) & (~(NL3D_SSE_ALIGNEMENT-1)) ); - - // copy valid data from old to new. - memcpy(newData, _Data, size() * sizeof(CMatrix3x4SSE) ); - - // release old. - if(_AllocData) - delete [] ((uint8*)_AllocData); - - // change ptrs and capacity. - _Data= newData; - _AllocData= newAllocData; - _Capacity= n; - - // TestYoyo - //nlwarning("YOYO Tst SSE P4: %X, %d", _Data, n); - } - } - - uint size() const {return _Size;} - - - CMatrix3x4SSE &operator[](uint i) {return ((CMatrix3x4SSE*)_Data)[i];} -}; - // *************************************************************************** // *************************************************************************** diff --git a/code/nel/src/3d/meshvp_wind_tree.cpp b/code/nel/src/3d/meshvp_wind_tree.cpp index 0d2e91363..1e3d215a3 100644 --- a/code/nel/src/3d/meshvp_wind_tree.cpp +++ b/code/nel/src/3d/meshvp_wind_tree.cpp @@ -392,7 +392,6 @@ bool CMeshVPWindTree::begin(IDriver *driver, CScene *scene, CMeshBaseInstance *m sint numPls= renderTrav->getNumVPLights()-1; clamp(numPls, 0, CRenderTrav::MaxVPLight-1); - // Enable normalize only if requested by user. Because lighting don't manage correct "scale lighting" uint idVP= (SpecularLighting?2:0) + (driver->isForceNormalize()?1:0) ; // correct VP id for correct unmber of pls. @@ -523,7 +522,7 @@ void CMeshVPWindTree::beginMBRInstance(IDriver *driver, CScene *scene, CMeshBase idVP = numPls*4 + idVP; // re-activate VP if idVP different from last setup - if(idVP != _LastMBRIdVP) + if (idVP != _LastMBRIdVP) { _LastMBRIdVP= idVP; driver->activeVertexProgram(_VertexProgram[_LastMBRIdVP]); diff --git a/code/nel/src/3d/particle_system.cpp b/code/nel/src/3d/particle_system.cpp index 3b25c3e1e..f6060640b 100644 --- a/code/nel/src/3d/particle_system.cpp +++ b/code/nel/src/3d/particle_system.cpp @@ -422,6 +422,11 @@ void CParticleSystem::step(TPass pass, TAnimationTime ellapsedTime, CParticleSys NL_PS_FUNC_MAIN(CParticleSystem_step) CHECK_INTEGRITY OwnerModel = &model; + if (!_CoordSystemInfo.Matrix) + { + nlwarning("3D: BUG: CParticleSystem::step -> !_CoordSystemInfo.Matrix"); + return; + } nlassert(_CoordSystemInfo.Matrix); // matrix not set for position of system if (_UserCoordSystemInfo) { diff --git a/code/nel/src/3d/program.cpp b/code/nel/src/3d/program.cpp index facf877fc..390fdf314 100644 --- a/code/nel/src/3d/program.cpp +++ b/code/nel/src/3d/program.cpp @@ -94,7 +94,7 @@ const char *CProgramIndex::Names[NUM_UNIFORMS] = void IProgram::buildInfo(CSource *source) { - nlassert(!m_Source); + // nlassert(!m_Source); // VALID: When deleting driver and creating new one. m_Source = source; diff --git a/code/nel/src/3d/render_target_manager.cpp b/code/nel/src/3d/render_target_manager.cpp new file mode 100644 index 000000000..0c4daa507 --- /dev/null +++ b/code/nel/src/3d/render_target_manager.cpp @@ -0,0 +1,162 @@ +/** + * \file render_target_manager.cpp + * \brief CRenderTargetManager + * \date 2014-07-30 21:30GMT + * \author Jan Boon (Kaetemi) + * CRenderTargetManager + */ + +/* + * Copyright (C) 2014 by authors + * + * This file is part of NL3D. + * NL3D is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * NL3D is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General + * Public License for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with NL3D. If not, see + * . + */ + +#include +#include + +// STL includes +#include + +// NeL includes +// #include +#include +#include +#include +#include +#include +#include +#include + +// Project includes + +using namespace std; +// using namespace NLMISC; + +namespace NL3D { + +struct CRenderTargetDescInt +{ +public: + // Options + uint Width; + uint Height; + bool Mode2D; + UTexture::TUploadFormat Format; + + // Data + NL3D::CTextureUser *TextureUser; + NLMISC::CSmartPtr TextureInterface; + bool InUse; + bool Used; +}; + +CRenderTargetManager::CRenderTargetManager() : m_Driver(NULL) +{ + +} + +CRenderTargetManager::~CRenderTargetManager() +{ + // Call twice to reset counters and cleanup + cleanup(); + cleanup(); +} + +NL3D::CTextureUser *CRenderTargetManager::getRenderTarget(uint width, uint height, bool mode2D, UTexture::TUploadFormat format) +{ + // Find or create a render target, short loop so no real optimization + for (std::vector::iterator it(m_RenderTargets.begin()), end(m_RenderTargets.end()); it != end; ++it) + { + CRenderTargetDescInt *desc = *it; + if (!desc->InUse && desc->Width == width && desc->Height == height && desc->Mode2D == mode2D && desc->Format == format) + { + desc->InUse = true; + desc->Used = true; + return desc->TextureUser; + } + } + + nldebug("3D: Create new render target (%u x %u)", width, height); + NL3D::IDriver *drvInternal = (static_cast(m_Driver))->getDriver(); + CRenderTargetDescInt *desc = new CRenderTargetDescInt(); + CTextureBloom *tex = new CTextureBloom(); // LOL + tex->mode2D(mode2D); + desc->TextureInterface = tex; + desc->TextureInterface->setRenderTarget(true); + desc->TextureInterface->setReleasable(false); + desc->TextureInterface->setUploadFormat((ITexture::TUploadFormat)(uint32)format); + desc->TextureInterface->resize(width, height); + desc->TextureInterface->setFilterMode(ITexture::Linear, ITexture::LinearMipMapOff); + desc->TextureInterface->setWrapS(ITexture::Clamp); + desc->TextureInterface->setWrapT(ITexture::Clamp); + drvInternal->setupTexture(*desc->TextureInterface); + desc->TextureUser = new CTextureUser(desc->TextureInterface); + nlassert(!drvInternal->isTextureRectangle(desc->TextureInterface)); // Not allowed, we only support NPOT for render targets now. + desc->Width = width; + desc->Height = height; + desc->Mode2D = mode2D; + desc->Format = format; + desc->Used = true; + desc->InUse = true; + m_RenderTargets.push_back(desc); + return desc->TextureUser; +} + +void CRenderTargetManager::recycleRenderTarget(NL3D::CTextureUser *renderTarget) +{ + for (std::vector::iterator it(m_RenderTargets.begin()), end(m_RenderTargets.end()); it != end; ++it) + { + CRenderTargetDescInt *desc = *it; + if (desc->TextureUser == renderTarget) + { + desc->InUse = false; + return; + } + } + nlerror("3D: Render target not found"); +} + +void CRenderTargetManager::cleanup() +{ + for (sint i = 0; i < (sint)m_RenderTargets.size(); ++i) + { + CRenderTargetDescInt *desc = m_RenderTargets[i]; + nlassert(!desc->InUse); // Assert for debugging, to not allow textures being carried over between frames. Optional assert + if (!desc->InUse) + { + if (!desc->Used) + { + // No longer in use + nldebug("3D: Release render target (%u x %u)", desc->Width, desc->Height); + delete desc->TextureUser; + desc->TextureUser = NULL; + desc->TextureInterface = NULL; // CSmartPtr + m_RenderTargets.erase(m_RenderTargets.begin() + i); + --i; + } + else + { + // Flag for next round + desc->Used = false; + } + } + } +} + +} /* namespace NL3D */ + +/* end of file */ diff --git a/code/nel/src/3d/render_trav.cpp b/code/nel/src/3d/render_trav.cpp index e7dfe89b1..026e80e9c 100644 --- a/code/nel/src/3d/render_trav.cpp +++ b/code/nel/src/3d/render_trav.cpp @@ -92,7 +92,7 @@ CRenderTrav::CRenderTrav() // *************************************************************************** -void CRenderTrav::traverse(UScene::TRenderPart renderPart, bool newRender) +void CRenderTrav::traverse(UScene::TRenderPart renderPart, bool newRender, bool generateShadows) { #ifdef NL_DEBUG_RENDER_TRAV nlwarning("Render trave begin"); @@ -279,7 +279,8 @@ void CRenderTrav::traverse(UScene::TRenderPart renderPart, bool newRender) */ // Generate ShadowMaps - _ShadowMapManager.renderGenerate(Scene); + if (generateShadows) + _ShadowMapManager.renderGenerate(Scene); // Render the Landscape renderLandscapes(); diff --git a/code/nel/src/3d/scene.cpp b/code/nel/src/3d/scene.cpp index fb2d476ac..7c552efd4 100644 --- a/code/nel/src/3d/scene.cpp +++ b/code/nel/src/3d/scene.cpp @@ -158,7 +158,7 @@ CScene::CScene(bool bSmallScene) : LightTrav(bSmallScene) _MaxSkeletonsInNotCLodForm= 20; - _FilterRenderFlags= std::numeric_limits::max(); + _FilterRenderFlags = std::numeric_limits::max(); _NextRenderProfile= false; @@ -353,28 +353,31 @@ void CScene::beginPartRender() // *************************************************************************** -void CScene::endPartRender() +void CScene::endPartRender(bool keepTrav) { nlassert(_IsRendering); - - // Delete model deleted during the rendering _IsRendering = false; - uint i; - for (i=0; i<_ToDelete.size(); i++) - deleteModel (_ToDelete[i]); - _ToDelete.clear (); - - // Special for SkeletonSpawnScript animation. create models spawned now - flushSSSModelRequests(); - - // Particle system handling (remove the resources of those which are too far, as their clusters may not have been parsed). - // Note that only a few of them are tested at each call - _ParticleSystemManager.refreshModels(ClipTrav.WorldFrustumPyramid, ClipTrav.CamPos); - // Waiting Instance handling - double deltaT = _DeltaSystemTimeBetweenRender; - clamp (deltaT, 0.01, 0.1); - updateWaitingInstances(deltaT); + if (!keepTrav) + { + // Delete model deleted during the rendering + uint i; + for (i=0; i<_ToDelete.size(); i++) + deleteModel (_ToDelete[i]); + _ToDelete.clear (); + + // Special for SkeletonSpawnScript animation. create models spawned now + flushSSSModelRequests(); + + // Particle system handling (remove the resources of those which are too far, as their clusters may not have been parsed). + // Note that only a few of them are tested at each call + _ParticleSystemManager.refreshModels(ClipTrav.WorldFrustumPyramid, ClipTrav.CamPos); + + // Waiting Instance handling + double deltaT = _DeltaSystemTimeBetweenRender; + clamp (deltaT, 0.01, 0.1); + updateWaitingInstances(deltaT); + } // Reset profiling _NextRenderProfile= false; @@ -555,7 +558,7 @@ void CScene::endPartRender() // *************************************************************************** -void CScene::renderPart(UScene::TRenderPart rp, bool doHrcPass) +void CScene::renderPart(UScene::TRenderPart rp, bool doHrcPass, bool doTrav, bool keepTrav) { nlassert(_IsRendering); @@ -569,17 +572,21 @@ void CScene::renderPart(UScene::TRenderPart rp, bool doHrcPass) // if first part to be rendered, do the start stuff if (_RenderedPart == UScene::RenderNothing) { - // update water envmap - //updateWaterEnvmap(); RenderTrav.clearWaterModelList(); - _FirstFlare = NULL; - double fNewGlobalSystemTime = NLMISC::CTime::ticksToSecond(NLMISC::CTime::getPerformanceTime()); - if(_GlobalSystemTime==0) - _DeltaSystemTimeBetweenRender= 0.020; - else - _DeltaSystemTimeBetweenRender= fNewGlobalSystemTime - _GlobalSystemTime; - _GlobalSystemTime = fNewGlobalSystemTime; + if (doTrav) + { + // update water envmap + //updateWaterEnvmap(); + _FirstFlare = NULL; + + double fNewGlobalSystemTime = NLMISC::CTime::ticksToSecond(NLMISC::CTime::getPerformanceTime()); + if(_GlobalSystemTime==0) + _DeltaSystemTimeBetweenRender= 0.020; + else + _DeltaSystemTimeBetweenRender= fNewGlobalSystemTime - _GlobalSystemTime; + _GlobalSystemTime = fNewGlobalSystemTime; + } // ++ _NumRender; // @@ -609,49 +616,67 @@ void CScene::renderPart(UScene::TRenderPart rp, bool doHrcPass) // **** For all render traversals, traverse them (except the Hrc one), in ascending order. if( doHrcPass ) HrcTrav.traverse(); + else + HrcTrav._MovingObjects.clear(); // Set Cam World Matrix for all trav that need it ClipTrav.setCamMatrix(CurrentCamera->getWorldMatrix()); RenderTrav.setCamMatrix (CurrentCamera->getWorldMatrix()); LoadBalancingTrav.setCamMatrix (CurrentCamera->getWorldMatrix()); - // clip ClipTrav.traverse(); + // animDetail AnimDetailTrav.traverse(); + // loadBalance LoadBalancingTrav.traverse(); - // - if (_RequestParticlesAnimate) + + if (doTrav) { - _ParticleSystemManager.processAnimate(_EllapsedTime); // deals with permanently animated particle systems - _RequestParticlesAnimate = false; + // + if (_RequestParticlesAnimate) + { + _ParticleSystemManager.processAnimate(_EllapsedTime); // deals with permanently animated particle systems + _RequestParticlesAnimate = false; + } } + // Light LightTrav.traverse(); } // render - RenderTrav.traverse(rp, _RenderedPart == UScene::RenderNothing); - // Always must clear shadow caster (if render did not work because of IDriver::isLost()) - RenderTrav.getShadowMapManager().clearAllShadowCasters(); + RenderTrav.traverse(rp, (_RenderedPart == UScene::RenderNothing), doTrav); + if (!keepTrav) + { + // Always must clear shadow caster (if render did not work because of IDriver::isLost()) + RenderTrav.getShadowMapManager().clearAllShadowCasters(); + } // render flare if (rp & UScene::RenderFlare) { - if (_FirstFlare) + if (doTrav) { - IDriver *drv = getDriver(); - CFlareModel::updateOcclusionQueryBegin(drv); - CFlareModel *currFlare = _FirstFlare; - do + if (_FirstFlare) { - currFlare->updateOcclusionQuery(drv); - currFlare = currFlare->Next; + IDriver *drv = getDriver(); + CFlareModel::updateOcclusionQueryBegin(drv); + CFlareModel *currFlare = _FirstFlare; + do + { + currFlare->updateOcclusionQuery(drv); + currFlare = currFlare->Next; + } + while(currFlare); + CFlareModel::updateOcclusionQueryEnd(drv); } - while(currFlare); - CFlareModel::updateOcclusionQueryEnd(drv); + } + else + { + _FirstFlare = NULL; } } _RenderedPart = (UScene::TRenderPart) (_RenderedPart | rp); diff --git a/code/nel/src/3d/scene_group.cpp b/code/nel/src/3d/scene_group.cpp index d539278cd..fa67230d4 100644 --- a/code/nel/src/3d/scene_group.cpp +++ b/code/nel/src/3d/scene_group.cpp @@ -753,7 +753,13 @@ bool CInstanceGroup::addToSceneWhenAllShapesLoaded (CScene& scene, IDriver *driv { _Instances[i]->clipUnlinkFromAll(); for (j = 0; j < _InstancesInfos[i].Clusters.size(); ++j) - _ClusterInstances[_InstancesInfos[i].Clusters[j]]->clipAddChild( _Instances[i] ); + { + uint32 clusterInst = _InstancesInfos[i].Clusters[j]; + if (clusterInst < _ClusterInstances.size()) + _ClusterInstances[clusterInst]->clipAddChild( _Instances[i] ); + else + nlwarning("IG: BUG: Cluster infos size %u, indexing %u", (uint32)_ClusterInstances.size(), clusterInst); + } // For the first time we have to set all the instances to NOT move (and not be rebinded) _Instances[i]->freeze(); _Instances[i]->setClusterSystem (this); diff --git a/code/nel/src/3d/scene_user.cpp b/code/nel/src/3d/scene_user.cpp index 908e6a090..0df2439de 100644 --- a/code/nel/src/3d/scene_user.cpp +++ b/code/nel/src/3d/scene_user.cpp @@ -517,7 +517,7 @@ void CSceneUser::beginPartRender() } // *************************************************************************** -void CSceneUser::renderPart(TRenderPart rp) +void CSceneUser::renderPart(TRenderPart rp, bool doHrcPass, bool doTrav, bool keepTrav) { // render the scene. @@ -526,18 +526,18 @@ void CSceneUser::renderPart(TRenderPart rp) if(_Scene.getCam() == NULL) nlerror("render(): try to render with no camera linked (may have been deleted)"); - _Scene.renderPart(rp, true); + _Scene.renderPart(rp, doHrcPass, doTrav, keepTrav); } } // *************************************************************************** -void CSceneUser::endPartRender(bool updateWaitingInstancesFlag, bool restoreMatrixContextAfterRender) +void CSceneUser::endPartRender(bool updateWaitingInstancesFlag, bool restoreMatrixContextAfterRender, bool keepTrav) { // render the scene. { NL3D_HAUTO_RENDER_SCENE_END - _Scene.endPartRender(); + _Scene.endPartRender(keepTrav); } if (updateWaitingInstancesFlag) updateWaitingInstances(); diff --git a/code/nel/src/3d/shaders/compile.bat b/code/nel/src/3d/shaders/compile.bat new file mode 100644 index 000000000..06306a0da --- /dev/null +++ b/code/nel/src/3d/shaders/compile.bat @@ -0,0 +1,3 @@ +cgc -entry fxaa_pp fxaa_pp.cg -profile arbfp1 -O3 -fastmath -fastprecision -o fxaa_pp_arbfp1.txt +cgc -entry fxaa_pp fxaa_pp.cg -profile ps_2_x -O3 -fastmath -fastprecision -o fxaa_pp_ps_2_0.txt +cgc -entry fxaa_vp fxaa_vp.cg -profile arbvp1 -fastmath -fastprecision -o fxaa_vp_arbvp1.txt \ No newline at end of file diff --git a/code/nel/src/3d/shaders/fxaa3_11.h b/code/nel/src/3d/shaders/fxaa3_11.h new file mode 100644 index 000000000..7cdc32c70 --- /dev/null +++ b/code/nel/src/3d/shaders/fxaa3_11.h @@ -0,0 +1,2046 @@ +/*============================================================================ + + +NVIDIA FXAA 3.11 by TIMOTHY LOTTES + + +------------------------------------------------------------------------------ +COPYRIGHT (C) 2010, 2011 NVIDIA CORPORATION. ALL RIGHTS RESERVED. +------------------------------------------------------------------------------ +TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED +*AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA +OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR +CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR +LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, +OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE +THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + +------------------------------------------------------------------------------ +INTEGRATION CHECKLIST +------------------------------------------------------------------------------ +(1.) +In the shader source, setup defines for the desired configuration. +When providing multiple shaders (for different presets), +simply setup the defines differently in multiple files. +Example, + +#define FXAA_PC 1 +#define FXAA_HLSL_5 1 +#define FXAA_QUALITY__PRESET 12 + +Or, + +#define FXAA_360 1 +Or, + +#define FXAA_PS3 1 +Etc. + +(2.) +Then include this file, + +#include "Fxaa3_11.h" + +(3.) +Then call the FXAA pixel shader from within your desired shader. +Look at the FXAA Quality FxaaPixelShader() for docs on inputs. +As for FXAA 3.11 all inputs for all shaders are the same +to enable easy porting between platforms. + +return FxaaPixelShader(...); + +(4.) +Insure pass prior to FXAA outputs RGBL (see next section). +Or use, + +#define FXAA_GREEN_AS_LUMA 1 + +(5.) +Setup engine to provide the following constants +which are used in the FxaaPixelShader() inputs, + +FxaaFloat2 fxaaQualityRcpFrame, +FxaaFloat4 fxaaConsoleRcpFrameOpt, +FxaaFloat4 fxaaConsoleRcpFrameOpt2, +FxaaFloat4 fxaaConsole360RcpFrameOpt2, +FxaaFloat fxaaQualitySubpix, +FxaaFloat fxaaQualityEdgeThreshold, +FxaaFloat fxaaQualityEdgeThresholdMin, +FxaaFloat fxaaConsoleEdgeSharpness, +FxaaFloat fxaaConsoleEdgeThreshold, +FxaaFloat fxaaConsoleEdgeThresholdMin, +FxaaFloat4 fxaaConsole360ConstDir + +Look at the FXAA Quality FxaaPixelShader() for docs on inputs. + +(6.) +Have FXAA vertex shader run as a full screen triangle, +and output "pos" and "fxaaConsolePosPos" +such that inputs in the pixel shader provide, + +// {xy} = center of pixel +FxaaFloat2 pos, + +// {xy__} = upper left of pixel +// {__zw} = lower right of pixel +FxaaFloat4 fxaaConsolePosPos, + +(7.) +Insure the texture sampler(s) used by FXAA are set to bilinear filtering. + + +------------------------------------------------------------------------------ +INTEGRATION - RGBL AND COLORSPACE +------------------------------------------------------------------------------ +FXAA3 requires RGBL as input unless the following is set, + +#define FXAA_GREEN_AS_LUMA 1 + +In which case the engine uses green in place of luma, +and requires RGB input is in a non-linear colorspace. + +RGB should be LDR (low dynamic range). +Specifically do FXAA after tonemapping. + +RGB data as returned by a texture fetch can be non-linear, +or linear when FXAA_GREEN_AS_LUMA is not set. +Note an "sRGB format" texture counts as linear, +because the result of a texture fetch is linear data. +Regular "RGBA8" textures in the sRGB colorspace are non-linear. + +If FXAA_GREEN_AS_LUMA is not set, +luma must be stored in the alpha channel prior to running FXAA. +This luma should be in a perceptual space (could be gamma 2.0). +Example pass before FXAA where output is gamma 2.0 encoded, + +color.rgb = ToneMap(color.rgb); // linear color output +color.rgb = sqrt(color.rgb); // gamma 2.0 color output +return color; + +To use FXAA, + +color.rgb = ToneMap(color.rgb); // linear color output +color.rgb = sqrt(color.rgb); // gamma 2.0 color output +color.a = dot(color.rgb, FxaaFloat3(0.299, 0.587, 0.114)); // compute luma +return color; + +Another example where output is linear encoded, +say for instance writing to an sRGB formated render target, +where the render target does the conversion back to sRGB after blending, + +color.rgb = ToneMap(color.rgb); // linear color output +return color; + +To use FXAA, + +color.rgb = ToneMap(color.rgb); // linear color output +color.a = sqrt(dot(color.rgb, FxaaFloat3(0.299, 0.587, 0.114))); // compute luma +return color; + +Getting luma correct is required for the algorithm to work correctly. + + +------------------------------------------------------------------------------ +BEING LINEARLY CORRECT? +------------------------------------------------------------------------------ +Applying FXAA to a framebuffer with linear RGB color will look worse. +This is very counter intuitive, but happends to be true in this case. +The reason is because dithering artifacts will be more visiable +in a linear colorspace. + + +------------------------------------------------------------------------------ +COMPLEX INTEGRATION +------------------------------------------------------------------------------ +Q. What if the engine is blending into RGB before wanting to run FXAA? + +A. In the last opaque pass prior to FXAA, +have the pass write out luma into alpha. +Then blend into RGB only. +FXAA should be able to run ok +assuming the blending pass did not any add aliasing. +This should be the common case for particles and common blending passes. + +A. Or use FXAA_GREEN_AS_LUMA. + +============================================================================*/ + +/*============================================================================ + +INTEGRATION KNOBS + +============================================================================*/ +// +// FXAA_PS3 and FXAA_360 choose the console algorithm (FXAA3 CONSOLE). +// FXAA_360_OPT is a prototype for the new optimized 360 version. +// +// 1 = Use API. +// 0 = Don't use API. +// +/*--------------------------------------------------------------------------*/ +#ifndef FXAA_PS3 +#define FXAA_PS3 0 +#endif +/*--------------------------------------------------------------------------*/ +#ifndef FXAA_360 +#define FXAA_360 0 +#endif +/*--------------------------------------------------------------------------*/ +#ifndef FXAA_360_OPT +#define FXAA_360_OPT 0 +#endif +/*==========================================================================*/ +#ifndef FXAA_PC +// +// FXAA Quality +// The high quality PC algorithm. +// +#define FXAA_PC 0 +#endif +/*--------------------------------------------------------------------------*/ +#ifndef FXAA_PC_CONSOLE +// +// The console algorithm for PC is included +// for developers targeting really low spec machines. +// Likely better to just run FXAA_PC, and use a really low preset. +// +#define FXAA_PC_CONSOLE 0 +#endif +/*--------------------------------------------------------------------------*/ +#ifndef FXAA_GLSL_120 +#define FXAA_GLSL_120 0 +#endif +/*--------------------------------------------------------------------------*/ +#ifndef FXAA_GLSL_130 +#define FXAA_GLSL_130 0 +#endif +/*--------------------------------------------------------------------------*/ +#ifndef FXAA_HLSL_3 +#define FXAA_HLSL_3 0 +#endif +/*--------------------------------------------------------------------------*/ +#ifndef FXAA_HLSL_4 +#define FXAA_HLSL_4 0 +#endif +/*--------------------------------------------------------------------------*/ +#ifndef FXAA_HLSL_5 +#define FXAA_HLSL_5 0 +#endif +/*==========================================================================*/ +#ifndef FXAA_GREEN_AS_LUMA +// +// For those using non-linear color, +// and either not able to get luma in alpha, or not wanting to, +// this enables FXAA to run using green as a proxy for luma. +// So with this enabled, no need to pack luma in alpha. +// +// This will turn off AA on anything which lacks some amount of green. +// Pure red and blue or combination of only R and B, will get no AA. +// +// Might want to lower the settings for both, +// fxaaConsoleEdgeThresholdMin +// fxaaQualityEdgeThresholdMin +// In order to insure AA does not get turned off on colors +// which contain a minor amount of green. +// +// 1 = On. +// 0 = Off. +// +#define FXAA_GREEN_AS_LUMA 0 +#endif +/*--------------------------------------------------------------------------*/ +#ifndef FXAA_EARLY_EXIT +// +// Controls algorithm's early exit path. +// On PS3 turning this ON adds 2 cycles to the shader. +// On 360 turning this OFF adds 10ths of a millisecond to the shader. +// Turning this off on console will result in a more blurry image. +// So this defaults to on. +// +// 1 = On. +// 0 = Off. +// +#define FXAA_EARLY_EXIT 1 +#endif +/*--------------------------------------------------------------------------*/ +#ifndef FXAA_DISCARD +// +// Only valid for PC OpenGL currently. +// Probably will not work when FXAA_GREEN_AS_LUMA = 1. +// +// 1 = Use discard on pixels which don't need AA. +// For APIs which enable concurrent TEX+ROP from same surface. +// 0 = Return unchanged color on pixels which don't need AA. +// +#define FXAA_DISCARD 0 +#endif +/*--------------------------------------------------------------------------*/ +#ifndef FXAA_FAST_PIXEL_OFFSET +// +// Used for GLSL 120 only. +// +// 1 = GL API supports fast pixel offsets +// 0 = do not use fast pixel offsets +// +#ifdef GL_EXT_gpu_shader4 +#define FXAA_FAST_PIXEL_OFFSET 1 +#endif +#ifdef GL_NV_gpu_shader5 +#define FXAA_FAST_PIXEL_OFFSET 1 +#endif +#ifdef GL_ARB_gpu_shader5 +#define FXAA_FAST_PIXEL_OFFSET 1 +#endif +#ifndef FXAA_FAST_PIXEL_OFFSET +#define FXAA_FAST_PIXEL_OFFSET 0 +#endif +#endif +/*--------------------------------------------------------------------------*/ +#ifndef FXAA_GATHER4_ALPHA +// +// 1 = API supports gather4 on alpha channel. +// 0 = API does not support gather4 on alpha channel. +// +#if (FXAA_HLSL_5 == 1) +#define FXAA_GATHER4_ALPHA 1 +#endif +#ifdef GL_ARB_gpu_shader5 +#define FXAA_GATHER4_ALPHA 1 +#endif +#ifdef GL_NV_gpu_shader5 +#define FXAA_GATHER4_ALPHA 1 +#endif +#ifndef FXAA_GATHER4_ALPHA +#define FXAA_GATHER4_ALPHA 0 +#endif +#endif + +/*============================================================================ +FXAA CONSOLE PS3 - TUNING KNOBS +============================================================================*/ +#ifndef FXAA_CONSOLE__PS3_EDGE_SHARPNESS +// +// Consoles the sharpness of edges on PS3 only. +// Non-PS3 tuning is done with shader input. +// +// Due to the PS3 being ALU bound, +// there are only two safe values here: 4 and 8. +// These options use the shaders ability to a free *|/ by 2|4|8. +// +// 8.0 is sharper +// 4.0 is softer +// 2.0 is really soft (good for vector graphics inputs) +// +#if 1 +#define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 8.0 +#endif +#if 0 +#define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 4.0 +#endif +#if 0 +#define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 2.0 +#endif +#endif +/*--------------------------------------------------------------------------*/ +#ifndef FXAA_CONSOLE__PS3_EDGE_THRESHOLD +// +// Only effects PS3. +// Non-PS3 tuning is done with shader input. +// +// The minimum amount of local contrast required to apply algorithm. +// The console setting has a different mapping than the quality setting. +// +// This only applies when FXAA_EARLY_EXIT is 1. +// +// Due to the PS3 being ALU bound, +// there are only two safe values here: 0.25 and 0.125. +// These options use the shaders ability to a free *|/ by 2|4|8. +// +// 0.125 leaves less aliasing, but is softer +// 0.25 leaves more aliasing, and is sharper +// +#if 1 +#define FXAA_CONSOLE__PS3_EDGE_THRESHOLD 0.125 +#else +#define FXAA_CONSOLE__PS3_EDGE_THRESHOLD 0.25 +#endif +#endif + +/*============================================================================ +FXAA QUALITY - TUNING KNOBS +------------------------------------------------------------------------------ +NOTE the other tuning knobs are now in the shader function inputs! +============================================================================*/ +#ifndef FXAA_QUALITY__PRESET +// +// Choose the quality preset. +// This needs to be compiled into the shader as it effects code. +// Best option to include multiple presets is to +// in each shader define the preset, then include this file. +// +// OPTIONS +// ----------------------------------------------------------------------- +// 10 to 15 - default medium dither (10=fastest, 15=highest quality) +// 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality) +// 39 - no dither, very expensive +// +// NOTES +// ----------------------------------------------------------------------- +// 12 = slightly faster then FXAA 3.9 and higher edge quality (default) +// 13 = about same speed as FXAA 3.9 and better than 12 +// 23 = closest to FXAA 3.9 visually and performance wise +// _ = the lowest digit is directly related to performance +// _ = the highest digit is directly related to style +// +#define FXAA_QUALITY__PRESET 12 +#endif + + +/*============================================================================ + +FXAA QUALITY - PRESETS + +============================================================================*/ + +/*============================================================================ +FXAA QUALITY - MEDIUM DITHER PRESETS +============================================================================*/ +#if (FXAA_QUALITY__PRESET == 10) +#define FXAA_QUALITY__PS 3 +#define FXAA_QUALITY__P0 1.5 +#define FXAA_QUALITY__P1 3.0 +#define FXAA_QUALITY__P2 12.0 +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PRESET == 11) +#define FXAA_QUALITY__PS 4 +#define FXAA_QUALITY__P0 1.0 +#define FXAA_QUALITY__P1 1.5 +#define FXAA_QUALITY__P2 3.0 +#define FXAA_QUALITY__P3 12.0 +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PRESET == 12) +#define FXAA_QUALITY__PS 5 +#define FXAA_QUALITY__P0 1.0 +#define FXAA_QUALITY__P1 1.5 +#define FXAA_QUALITY__P2 2.0 +#define FXAA_QUALITY__P3 4.0 +#define FXAA_QUALITY__P4 12.0 +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PRESET == 13) +#define FXAA_QUALITY__PS 6 +#define FXAA_QUALITY__P0 1.0 +#define FXAA_QUALITY__P1 1.5 +#define FXAA_QUALITY__P2 2.0 +#define FXAA_QUALITY__P3 2.0 +#define FXAA_QUALITY__P4 4.0 +#define FXAA_QUALITY__P5 12.0 +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PRESET == 14) +#define FXAA_QUALITY__PS 7 +#define FXAA_QUALITY__P0 1.0 +#define FXAA_QUALITY__P1 1.5 +#define FXAA_QUALITY__P2 2.0 +#define FXAA_QUALITY__P3 2.0 +#define FXAA_QUALITY__P4 2.0 +#define FXAA_QUALITY__P5 4.0 +#define FXAA_QUALITY__P6 12.0 +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PRESET == 15) +#define FXAA_QUALITY__PS 8 +#define FXAA_QUALITY__P0 1.0 +#define FXAA_QUALITY__P1 1.5 +#define FXAA_QUALITY__P2 2.0 +#define FXAA_QUALITY__P3 2.0 +#define FXAA_QUALITY__P4 2.0 +#define FXAA_QUALITY__P5 2.0 +#define FXAA_QUALITY__P6 4.0 +#define FXAA_QUALITY__P7 12.0 +#endif + +/*============================================================================ +FXAA QUALITY - LOW DITHER PRESETS +============================================================================*/ +#if (FXAA_QUALITY__PRESET == 20) +#define FXAA_QUALITY__PS 3 +#define FXAA_QUALITY__P0 1.5 +#define FXAA_QUALITY__P1 2.0 +#define FXAA_QUALITY__P2 8.0 +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PRESET == 21) +#define FXAA_QUALITY__PS 4 +#define FXAA_QUALITY__P0 1.0 +#define FXAA_QUALITY__P1 1.5 +#define FXAA_QUALITY__P2 2.0 +#define FXAA_QUALITY__P3 8.0 +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PRESET == 22) +#define FXAA_QUALITY__PS 5 +#define FXAA_QUALITY__P0 1.0 +#define FXAA_QUALITY__P1 1.5 +#define FXAA_QUALITY__P2 2.0 +#define FXAA_QUALITY__P3 2.0 +#define FXAA_QUALITY__P4 8.0 +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PRESET == 23) +#define FXAA_QUALITY__PS 6 +#define FXAA_QUALITY__P0 1.0 +#define FXAA_QUALITY__P1 1.5 +#define FXAA_QUALITY__P2 2.0 +#define FXAA_QUALITY__P3 2.0 +#define FXAA_QUALITY__P4 2.0 +#define FXAA_QUALITY__P5 8.0 +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PRESET == 24) +#define FXAA_QUALITY__PS 7 +#define FXAA_QUALITY__P0 1.0 +#define FXAA_QUALITY__P1 1.5 +#define FXAA_QUALITY__P2 2.0 +#define FXAA_QUALITY__P3 2.0 +#define FXAA_QUALITY__P4 2.0 +#define FXAA_QUALITY__P5 3.0 +#define FXAA_QUALITY__P6 8.0 +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PRESET == 25) +#define FXAA_QUALITY__PS 8 +#define FXAA_QUALITY__P0 1.0 +#define FXAA_QUALITY__P1 1.5 +#define FXAA_QUALITY__P2 2.0 +#define FXAA_QUALITY__P3 2.0 +#define FXAA_QUALITY__P4 2.0 +#define FXAA_QUALITY__P5 2.0 +#define FXAA_QUALITY__P6 4.0 +#define FXAA_QUALITY__P7 8.0 +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PRESET == 26) +#define FXAA_QUALITY__PS 9 +#define FXAA_QUALITY__P0 1.0 +#define FXAA_QUALITY__P1 1.5 +#define FXAA_QUALITY__P2 2.0 +#define FXAA_QUALITY__P3 2.0 +#define FXAA_QUALITY__P4 2.0 +#define FXAA_QUALITY__P5 2.0 +#define FXAA_QUALITY__P6 2.0 +#define FXAA_QUALITY__P7 4.0 +#define FXAA_QUALITY__P8 8.0 +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PRESET == 27) +#define FXAA_QUALITY__PS 10 +#define FXAA_QUALITY__P0 1.0 +#define FXAA_QUALITY__P1 1.5 +#define FXAA_QUALITY__P2 2.0 +#define FXAA_QUALITY__P3 2.0 +#define FXAA_QUALITY__P4 2.0 +#define FXAA_QUALITY__P5 2.0 +#define FXAA_QUALITY__P6 2.0 +#define FXAA_QUALITY__P7 2.0 +#define FXAA_QUALITY__P8 4.0 +#define FXAA_QUALITY__P9 8.0 +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PRESET == 28) +#define FXAA_QUALITY__PS 11 +#define FXAA_QUALITY__P0 1.0 +#define FXAA_QUALITY__P1 1.5 +#define FXAA_QUALITY__P2 2.0 +#define FXAA_QUALITY__P3 2.0 +#define FXAA_QUALITY__P4 2.0 +#define FXAA_QUALITY__P5 2.0 +#define FXAA_QUALITY__P6 2.0 +#define FXAA_QUALITY__P7 2.0 +#define FXAA_QUALITY__P8 2.0 +#define FXAA_QUALITY__P9 4.0 +#define FXAA_QUALITY__P10 8.0 +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PRESET == 29) +#define FXAA_QUALITY__PS 12 +#define FXAA_QUALITY__P0 1.0 +#define FXAA_QUALITY__P1 1.5 +#define FXAA_QUALITY__P2 2.0 +#define FXAA_QUALITY__P3 2.0 +#define FXAA_QUALITY__P4 2.0 +#define FXAA_QUALITY__P5 2.0 +#define FXAA_QUALITY__P6 2.0 +#define FXAA_QUALITY__P7 2.0 +#define FXAA_QUALITY__P8 2.0 +#define FXAA_QUALITY__P9 2.0 +#define FXAA_QUALITY__P10 4.0 +#define FXAA_QUALITY__P11 8.0 +#endif + +/*============================================================================ +FXAA QUALITY - EXTREME QUALITY +============================================================================*/ +#if (FXAA_QUALITY__PRESET == 39) +#define FXAA_QUALITY__PS 12 +#define FXAA_QUALITY__P0 1.0 +#define FXAA_QUALITY__P1 1.0 +#define FXAA_QUALITY__P2 1.0 +#define FXAA_QUALITY__P3 1.0 +#define FXAA_QUALITY__P4 1.0 +#define FXAA_QUALITY__P5 1.5 +#define FXAA_QUALITY__P6 2.0 +#define FXAA_QUALITY__P7 2.0 +#define FXAA_QUALITY__P8 2.0 +#define FXAA_QUALITY__P9 2.0 +#define FXAA_QUALITY__P10 4.0 +#define FXAA_QUALITY__P11 8.0 +#endif + + + +/*============================================================================ + +API PORTING + +============================================================================*/ +#if (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1) +#define FxaaBool bool +#define FxaaDiscard discard +#define FxaaFloat float +#define FxaaFloat2 vec2 +#define FxaaFloat3 vec3 +#define FxaaFloat4 vec4 +#define FxaaHalf float +#define FxaaHalf2 vec2 +#define FxaaHalf3 vec3 +#define FxaaHalf4 vec4 +#define FxaaInt2 ivec2 +#define FxaaSat(x) clamp(x, 0.0, 1.0) +#define FxaaTex sampler2D +#else +#define FxaaBool bool +#define FxaaDiscard clip(-1) +#define FxaaFloat float +#define FxaaFloat2 float2 +#define FxaaFloat3 float3 +#define FxaaFloat4 float4 +#define FxaaHalf half +#define FxaaHalf2 half2 +#define FxaaHalf3 half3 +#define FxaaHalf4 half4 +#define FxaaSat(x) saturate(x) +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_GLSL_120 == 1) +// Requires, +// #version 120 +// And at least, +// #extension GL_EXT_gpu_shader4 : enable +// (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9) +#define FxaaTexTop(t, p) texture2DLod(t, p, 0.0) +#if (FXAA_FAST_PIXEL_OFFSET == 1) +#define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o) +#else +#define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0) +#endif +#if (FXAA_GATHER4_ALPHA == 1) +// use #extension GL_ARB_gpu_shader5 : enable +#define FxaaTexAlpha4(t, p) textureGather(t, p, 3) +#define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3) +#define FxaaTexGreen4(t, p) textureGather(t, p, 1) +#define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1) +#endif +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_GLSL_130 == 1) +// Requires "#version 130" or better +#define FxaaTexTop(t, p) textureLod(t, p, 0.0) +#define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o) +#if (FXAA_GATHER4_ALPHA == 1) +// use #extension GL_ARB_gpu_shader5 : enable +#define FxaaTexAlpha4(t, p) textureGather(t, p, 3) +#define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3) +#define FxaaTexGreen4(t, p) textureGather(t, p, 1) +#define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1) +#endif +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_HLSL_3 == 1) || (FXAA_360 == 1) || (FXAA_PS3 == 1) +#define FxaaInt2 float2 +#define FxaaTex sampler2D +#define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0)) +#define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0)) +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_HLSL_4 == 1) +#define FxaaInt2 int2 +struct FxaaTex { SamplerState smpl; Texture2D tex; }; +#define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0) +#define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o) +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_HLSL_5 == 1) +#define FxaaInt2 int2 +struct FxaaTex { SamplerState smpl; Texture2D tex; }; +#define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0) +#define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o) +#define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p) +#define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o) +#define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p) +#define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o) +#endif + +#undef FxaaTexTop +#define FxaaTexTop(t, p) tex2D(t, p) +#undef FxaaTexOff +#define FxaaTexOff(t, p, o, r) tex2D(t, p + (o * r)) + +/*============================================================================ +GREEN AS LUMA OPTION SUPPORT FUNCTION +============================================================================*/ +#if (FXAA_GREEN_AS_LUMA == 0) +FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; } +#else +FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; } +#endif + + + + +/*============================================================================ + +FXAA3 QUALITY - PC + +============================================================================*/ +#if (FXAA_PC == 1) +/*--------------------------------------------------------------------------*/ +FxaaFloat4 FxaaPixelShader( +// +// Use noperspective interpolation here (turn off perspective interpolation). +// {xy} = center of pixel +FxaaFloat2 pos, +// +// Used only for FXAA Console, and not used on the 360 version. +// Use noperspective interpolation here (turn off perspective interpolation). +// {xy__} = upper left of pixel +// {__zw} = lower right of pixel +//FxaaFloat4 fxaaConsolePosPos, +// +// Input color texture. +// {rgb_} = color in linear or perceptual color space +// if (FXAA_GREEN_AS_LUMA == 0) +// {___a} = luma in perceptual color space (not linear) +FxaaTex tex, +// +// Only used on the optimized 360 version of FXAA Console. +// For everything but 360, just use the same input here as for "tex". +// For 360, same texture, just alias with a 2nd sampler. +// This sampler needs to have an exponent bias of -1. +//FxaaTex fxaaConsole360TexExpBiasNegOne, +// +// Only used on the optimized 360 version of FXAA Console. +// For everything but 360, just use the same input here as for "tex". +// For 360, same texture, just alias with a 3nd sampler. +// This sampler needs to have an exponent bias of -2. +//FxaaTex fxaaConsole360TexExpBiasNegTwo, +// +// Only used on FXAA Quality. +// This must be from a constant/uniform. +// {x_} = 1.0/screenWidthInPixels +// {_y} = 1.0/screenHeightInPixels +FxaaFloat2 fxaaQualityRcpFrame, +// +// Only used on FXAA Console. +// This must be from a constant/uniform. +// This effects sub-pixel AA quality and inversely sharpness. +// Where N ranges between, +// N = 0.50 (default) +// N = 0.33 (sharper) +// {x___} = -N/screenWidthInPixels +// {_y__} = -N/screenHeightInPixels +// {__z_} = N/screenWidthInPixels +// {___w} = N/screenHeightInPixels +//FxaaFloat4 fxaaConsoleRcpFrameOpt, +// +// Only used on FXAA Console. +// Not used on 360, but used on PS3 and PC. +// This must be from a constant/uniform. +// {x___} = -2.0/screenWidthInPixels +// {_y__} = -2.0/screenHeightInPixels +// {__z_} = 2.0/screenWidthInPixels +// {___w} = 2.0/screenHeightInPixels +//FxaaFloat4 fxaaConsoleRcpFrameOpt2, +// +// Only used on FXAA Console. +// Only used on 360 in place of fxaaConsoleRcpFrameOpt2. +// This must be from a constant/uniform. +// {x___} = 8.0/screenWidthInPixels +// {_y__} = 8.0/screenHeightInPixels +// {__z_} = -4.0/screenWidthInPixels +// {___w} = -4.0/screenHeightInPixels +//FxaaFloat4 fxaaConsole360RcpFrameOpt2, +// +// Only used on FXAA Quality. +// This used to be the FXAA_QUALITY__SUBPIX define. +// It is here now to allow easier tuning. +// Choose the amount of sub-pixel aliasing removal. +// This can effect sharpness. +// 1.00 - upper limit (softer) +// 0.75 - default amount of filtering +// 0.50 - lower limit (sharper, less sub-pixel aliasing removal) +// 0.25 - almost off +// 0.00 - completely off +FxaaFloat fxaaQualitySubpix, +// +// Only used on FXAA Quality. +// This used to be the FXAA_QUALITY__EDGE_THRESHOLD define. +// It is here now to allow easier tuning. +// The minimum amount of local contrast required to apply algorithm. +// 0.333 - too little (faster) +// 0.250 - low quality +// 0.166 - default +// 0.125 - high quality +// 0.063 - overkill (slower) +FxaaFloat fxaaQualityEdgeThreshold, +// +// Only used on FXAA Quality. +// This used to be the FXAA_QUALITY__EDGE_THRESHOLD_MIN define. +// It is here now to allow easier tuning. +// Trims the algorithm from processing darks. +// 0.0833 - upper limit (default, the start of visible unfiltered edges) +// 0.0625 - high quality (faster) +// 0.0312 - visible limit (slower) +// Special notes when using FXAA_GREEN_AS_LUMA, +// Likely want to set this to zero. +// As colors that are mostly not-green +// will appear very dark in the green channel! +// Tune by looking at mostly non-green content, +// then start at zero and increase until aliasing is a problem. +FxaaFloat fxaaQualityEdgeThresholdMin +// +// Only used on FXAA Console. +// This used to be the FXAA_CONSOLE__EDGE_SHARPNESS define. +// It is here now to allow easier tuning. +// This does not effect PS3, as this needs to be compiled in. +// Use FXAA_CONSOLE__PS3_EDGE_SHARPNESS for PS3. +// Due to the PS3 being ALU bound, +// there are only three safe values here: 2 and 4 and 8. +// These options use the shaders ability to a free *|/ by 2|4|8. +// For all other platforms can be a non-power of two. +// 8.0 is sharper (default!!!) +// 4.0 is softer +// 2.0 is really soft (good only for vector graphics inputs) +//FxaaFloat fxaaConsoleEdgeSharpness, +// +// Only used on FXAA Console. +// This used to be the FXAA_CONSOLE__EDGE_THRESHOLD define. +// It is here now to allow easier tuning. +// This does not effect PS3, as this needs to be compiled in. +// Use FXAA_CONSOLE__PS3_EDGE_THRESHOLD for PS3. +// Due to the PS3 being ALU bound, +// there are only two safe values here: 1/4 and 1/8. +// These options use the shaders ability to a free *|/ by 2|4|8. +// The console setting has a different mapping than the quality setting. +// Other platforms can use other values. +// 0.125 leaves less aliasing, but is softer (default!!!) +// 0.25 leaves more aliasing, and is sharper +//FxaaFloat fxaaConsoleEdgeThreshold, +// +// Only used on FXAA Console. +// This used to be the FXAA_CONSOLE__EDGE_THRESHOLD_MIN define. +// It is here now to allow easier tuning. +// Trims the algorithm from processing darks. +// The console setting has a different mapping than the quality setting. +// This only applies when FXAA_EARLY_EXIT is 1. +// This does not apply to PS3, +// PS3 was simplified to avoid more shader instructions. +// 0.06 - faster but more aliasing in darks +// 0.05 - default +// 0.04 - slower and less aliasing in darks +// Special notes when using FXAA_GREEN_AS_LUMA, +// Likely want to set this to zero. +// As colors that are mostly not-green +// will appear very dark in the green channel! +// Tune by looking at mostly non-green content, +// then start at zero and increase until aliasing is a problem. +//FxaaFloat fxaaConsoleEdgeThresholdMin, +// +// Extra constants for 360 FXAA Console only. +// Use zeros or anything else for other platforms. +// These must be in physical constant registers and NOT immedates. +// Immedates will result in compiler un-optimizing. +// {xyzw} = float4(1.0, -1.0, 0.25, -0.25) +//FxaaFloat4 fxaaConsole360ConstDir +) { +/*--------------------------------------------------------------------------*/ +FxaaFloat2 posM; +posM.x = pos.x; +posM.y = pos.y; +#if (FXAA_GATHER4_ALPHA == 1) +#if (FXAA_DISCARD == 0) +FxaaFloat4 rgbyM = FxaaTexTop(tex, posM); +#if (FXAA_GREEN_AS_LUMA == 0) +#define lumaM rgbyM.w +#else +#define lumaM rgbyM.y +#endif +#endif +#if (FXAA_GREEN_AS_LUMA == 0) +FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM); +FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1)); +#else +FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM); +FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1)); +#endif +#if (FXAA_DISCARD == 1) +#define lumaM luma4A.w +#endif +#define lumaE luma4A.z +#define lumaS luma4A.x +#define lumaSE luma4A.y +#define lumaNW luma4B.w +#define lumaN luma4B.z +#define lumaW luma4B.x +#else +FxaaFloat4 rgbyM = FxaaTexTop(tex, posM); +#if (FXAA_GREEN_AS_LUMA == 0) +#define lumaM rgbyM.w +#else +#define lumaM rgbyM.y +#endif +FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy)); +FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy)); +FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy)); +FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy)); +#endif +/*--------------------------------------------------------------------------*/ +FxaaFloat maxSM = max(lumaS, lumaM); +FxaaFloat minSM = min(lumaS, lumaM); +FxaaFloat maxESM = max(lumaE, maxSM); +FxaaFloat minESM = min(lumaE, minSM); +FxaaFloat maxWN = max(lumaN, lumaW); +FxaaFloat minWN = min(lumaN, lumaW); +FxaaFloat rangeMax = max(maxWN, maxESM); +FxaaFloat rangeMin = min(minWN, minESM); +FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold; +FxaaFloat range = rangeMax - rangeMin; +FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled); +FxaaBool earlyExit = range < rangeMaxClamped; +/*--------------------------------------------------------------------------*/ +if(earlyExit) +#if (FXAA_DISCARD == 1) +FxaaDiscard; +#else +return rgbyM; +#endif +/*--------------------------------------------------------------------------*/ +#if (FXAA_GATHER4_ALPHA == 0) +FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy)); +FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy)); +FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy)); +FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy)); +#else +FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy)); +FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy)); +#endif +/*--------------------------------------------------------------------------*/ +FxaaFloat lumaNS = lumaN + lumaS; +FxaaFloat lumaWE = lumaW + lumaE; +FxaaFloat subpixRcpRange = 1.0/range; +FxaaFloat subpixNSWE = lumaNS + lumaWE; +FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS; +FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE; +/*--------------------------------------------------------------------------*/ +FxaaFloat lumaNESE = lumaNE + lumaSE; +FxaaFloat lumaNWNE = lumaNW + lumaNE; +FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE; +FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE; +/*--------------------------------------------------------------------------*/ +FxaaFloat lumaNWSW = lumaNW + lumaSW; +FxaaFloat lumaSWSE = lumaSW + lumaSE; +FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2); +FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2); +FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW; +FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE; +FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4; +FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4; +/*--------------------------------------------------------------------------*/ +FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE; +FxaaFloat lengthSign = fxaaQualityRcpFrame.x; +FxaaBool horzSpan = edgeHorz >= edgeVert; +FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE; +/*--------------------------------------------------------------------------*/ +if(!horzSpan) lumaN = lumaW; +if(!horzSpan) lumaS = lumaE; +if(horzSpan) lengthSign = fxaaQualityRcpFrame.y; +FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM; +/*--------------------------------------------------------------------------*/ +FxaaFloat gradientN = lumaN - lumaM; +FxaaFloat gradientS = lumaS - lumaM; +FxaaFloat lumaNN = lumaN + lumaM; +FxaaFloat lumaSS = lumaS + lumaM; +FxaaBool pairN = abs(gradientN) >= abs(gradientS); +FxaaFloat gradient = max(abs(gradientN), abs(gradientS)); +if(pairN) lengthSign = -lengthSign; +FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange); +/*--------------------------------------------------------------------------*/ +FxaaFloat2 posB; +posB.x = posM.x; +posB.y = posM.y; +FxaaFloat2 offNP; +offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x; +offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y; +if(!horzSpan) posB.x += lengthSign * 0.5; +if( horzSpan) posB.y += lengthSign * 0.5; +/*--------------------------------------------------------------------------*/ +FxaaFloat2 posN; +posN.x = posB.x - offNP.x * FXAA_QUALITY__P0; +posN.y = posB.y - offNP.y * FXAA_QUALITY__P0; +FxaaFloat2 posP; +posP.x = posB.x + offNP.x * FXAA_QUALITY__P0; +posP.y = posB.y + offNP.y * FXAA_QUALITY__P0; +FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0; +FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN)); +FxaaFloat subpixE = subpixC * subpixC; +FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP)); +/*--------------------------------------------------------------------------*/ +if(!pairN) lumaNN = lumaSS; +FxaaFloat gradientScaled = gradient * 1.0/4.0; +FxaaFloat lumaMM = lumaM - lumaNN * 0.5; +FxaaFloat subpixF = subpixD * subpixE; +FxaaBool lumaMLTZero = lumaMM < 0.0; +/*--------------------------------------------------------------------------*/ +lumaEndN -= lumaNN * 0.5; +lumaEndP -= lumaNN * 0.5; +FxaaBool doneN = abs(lumaEndN) >= gradientScaled; +FxaaBool doneP = abs(lumaEndP) >= gradientScaled; +if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P1; +if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P1; +FxaaBool doneNP = (!doneN) || (!doneP); +if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P1; +if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P1; +/*--------------------------------------------------------------------------*/ +if(doneNP) { +if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); +if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); +if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; +if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; +doneN = abs(lumaEndN) >= gradientScaled; +doneP = abs(lumaEndP) >= gradientScaled; +if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P2; +if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P2; +doneNP = (!doneN) || (!doneP); +if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P2; +if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P2; +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PS > 3) +if(doneNP) { +if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); +if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); +if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; +if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; +doneN = abs(lumaEndN) >= gradientScaled; +doneP = abs(lumaEndP) >= gradientScaled; +if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P3; +if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P3; +doneNP = (!doneN) || (!doneP); +if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P3; +if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P3; +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PS > 4) +if(doneNP) { +if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); +if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); +if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; +if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; +doneN = abs(lumaEndN) >= gradientScaled; +doneP = abs(lumaEndP) >= gradientScaled; +if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P4; +if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P4; +doneNP = (!doneN) || (!doneP); +if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P4; +if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P4; +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PS > 5) +if(doneNP) { +if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); +if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); +if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; +if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; +doneN = abs(lumaEndN) >= gradientScaled; +doneP = abs(lumaEndP) >= gradientScaled; +if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P5; +if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P5; +doneNP = (!doneN) || (!doneP); +if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P5; +if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P5; +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PS > 6) +if(doneNP) { +if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); +if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); +if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; +if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; +doneN = abs(lumaEndN) >= gradientScaled; +doneP = abs(lumaEndP) >= gradientScaled; +if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P6; +if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P6; +doneNP = (!doneN) || (!doneP); +if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P6; +if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P6; +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PS > 7) +if(doneNP) { +if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); +if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); +if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; +if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; +doneN = abs(lumaEndN) >= gradientScaled; +doneP = abs(lumaEndP) >= gradientScaled; +if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P7; +if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P7; +doneNP = (!doneN) || (!doneP); +if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P7; +if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P7; +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PS > 8) +if(doneNP) { +if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); +if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); +if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; +if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; +doneN = abs(lumaEndN) >= gradientScaled; +doneP = abs(lumaEndP) >= gradientScaled; +if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P8; +if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P8; +doneNP = (!doneN) || (!doneP); +if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P8; +if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P8; +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PS > 9) +if(doneNP) { +if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); +if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); +if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; +if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; +doneN = abs(lumaEndN) >= gradientScaled; +doneP = abs(lumaEndP) >= gradientScaled; +if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P9; +if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P9; +doneNP = (!doneN) || (!doneP); +if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P9; +if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P9; +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PS > 10) +if(doneNP) { +if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); +if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); +if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; +if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; +doneN = abs(lumaEndN) >= gradientScaled; +doneP = abs(lumaEndP) >= gradientScaled; +if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P10; +if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P10; +doneNP = (!doneN) || (!doneP); +if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P10; +if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P10; +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PS > 11) +if(doneNP) { +if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); +if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); +if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; +if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; +doneN = abs(lumaEndN) >= gradientScaled; +doneP = abs(lumaEndP) >= gradientScaled; +if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P11; +if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P11; +doneNP = (!doneN) || (!doneP); +if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P11; +if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P11; +/*--------------------------------------------------------------------------*/ +#if (FXAA_QUALITY__PS > 12) +if(doneNP) { +if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); +if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); +if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; +if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; +doneN = abs(lumaEndN) >= gradientScaled; +doneP = abs(lumaEndP) >= gradientScaled; +if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P12; +if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P12; +doneNP = (!doneN) || (!doneP); +if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P12; +if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P12; +/*--------------------------------------------------------------------------*/ +} +#endif +/*--------------------------------------------------------------------------*/ +} +#endif +/*--------------------------------------------------------------------------*/ +} +#endif +/*--------------------------------------------------------------------------*/ +} +#endif +/*--------------------------------------------------------------------------*/ +} +#endif +/*--------------------------------------------------------------------------*/ +} +#endif +/*--------------------------------------------------------------------------*/ +} +#endif +/*--------------------------------------------------------------------------*/ +} +#endif +/*--------------------------------------------------------------------------*/ +} +#endif +/*--------------------------------------------------------------------------*/ +} +#endif +/*--------------------------------------------------------------------------*/ +} +/*--------------------------------------------------------------------------*/ +FxaaFloat dstN = posM.x - posN.x; +FxaaFloat dstP = posP.x - posM.x; +if(!horzSpan) dstN = posM.y - posN.y; +if(!horzSpan) dstP = posP.y - posM.y; +/*--------------------------------------------------------------------------*/ +FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero; +FxaaFloat spanLength = (dstP + dstN); +FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero; +FxaaFloat spanLengthRcp = 1.0/spanLength; +/*--------------------------------------------------------------------------*/ +FxaaBool directionN = dstN < dstP; +FxaaFloat dst = min(dstN, dstP); +FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP; +FxaaFloat subpixG = subpixF * subpixF; +FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5; +FxaaFloat subpixH = subpixG * fxaaQualitySubpix; +/*--------------------------------------------------------------------------*/ +FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0; +FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH); +if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign; +if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign; +#if (FXAA_DISCARD == 1) +return FxaaTexTop(tex, posM); +#else +return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM); +#endif +} +/*==========================================================================*/ +#endif + + + + +/*============================================================================ + +FXAA3 CONSOLE - PC VERSION +------------------------------------------------------------------------------ +Instead of using this on PC, I'd suggest just using FXAA Quality with +#define FXAA_QUALITY__PRESET 10 +Or +#define FXAA_QUALITY__PRESET 20 +Either are higher qualilty and almost as fast as this on modern PC GPUs. +============================================================================*/ +#if (FXAA_PC_CONSOLE == 1) +/*--------------------------------------------------------------------------*/ +FxaaFloat4 FxaaPixelShader( +// See FXAA Quality FxaaPixelShader() source for docs on Inputs! +FxaaFloat2 pos, +FxaaFloat4 fxaaConsolePosPos, +FxaaTex tex, +FxaaTex fxaaConsole360TexExpBiasNegOne, +FxaaTex fxaaConsole360TexExpBiasNegTwo, +FxaaFloat2 fxaaQualityRcpFrame, +FxaaFloat4 fxaaConsoleRcpFrameOpt, +FxaaFloat4 fxaaConsoleRcpFrameOpt2, +FxaaFloat4 fxaaConsole360RcpFrameOpt2, +FxaaFloat fxaaQualitySubpix, +FxaaFloat fxaaQualityEdgeThreshold, +FxaaFloat fxaaQualityEdgeThresholdMin, +FxaaFloat fxaaConsoleEdgeSharpness, +FxaaFloat fxaaConsoleEdgeThreshold, +FxaaFloat fxaaConsoleEdgeThresholdMin, +FxaaFloat4 fxaaConsole360ConstDir +) { +/*--------------------------------------------------------------------------*/ +FxaaFloat lumaNw = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.xy)); +FxaaFloat lumaSw = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.xw)); +FxaaFloat lumaNe = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.zy)); +FxaaFloat lumaSe = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.zw)); +/*--------------------------------------------------------------------------*/ +FxaaFloat4 rgbyM = FxaaTexTop(tex, pos.xy); +#if (FXAA_GREEN_AS_LUMA == 0) +FxaaFloat lumaM = rgbyM.w; +#else +FxaaFloat lumaM = rgbyM.y; +#endif +/*--------------------------------------------------------------------------*/ +FxaaFloat lumaMaxNwSw = max(lumaNw, lumaSw); +lumaNe += 1.0/384.0; +FxaaFloat lumaMinNwSw = min(lumaNw, lumaSw); +/*--------------------------------------------------------------------------*/ +FxaaFloat lumaMaxNeSe = max(lumaNe, lumaSe); +FxaaFloat lumaMinNeSe = min(lumaNe, lumaSe); +/*--------------------------------------------------------------------------*/ +FxaaFloat lumaMax = max(lumaMaxNeSe, lumaMaxNwSw); +FxaaFloat lumaMin = min(lumaMinNeSe, lumaMinNwSw); +/*--------------------------------------------------------------------------*/ +FxaaFloat lumaMaxScaled = lumaMax * fxaaConsoleEdgeThreshold; +/*--------------------------------------------------------------------------*/ +FxaaFloat lumaMinM = min(lumaMin, lumaM); +FxaaFloat lumaMaxScaledClamped = max(fxaaConsoleEdgeThresholdMin, lumaMaxScaled); +FxaaFloat lumaMaxM = max(lumaMax, lumaM); +FxaaFloat dirSwMinusNe = lumaSw - lumaNe; +FxaaFloat lumaMaxSubMinM = lumaMaxM - lumaMinM; +FxaaFloat dirSeMinusNw = lumaSe - lumaNw; +if(lumaMaxSubMinM < lumaMaxScaledClamped) return rgbyM; +/*--------------------------------------------------------------------------*/ +FxaaFloat2 dir; +dir.x = dirSwMinusNe + dirSeMinusNw; +dir.y = dirSwMinusNe - dirSeMinusNw; +/*--------------------------------------------------------------------------*/ +FxaaFloat2 dir1 = normalize(dir.xy); +FxaaFloat4 rgbyN1 = FxaaTexTop(tex, pos.xy - dir1 * fxaaConsoleRcpFrameOpt.zw); +FxaaFloat4 rgbyP1 = FxaaTexTop(tex, pos.xy + dir1 * fxaaConsoleRcpFrameOpt.zw); +/*--------------------------------------------------------------------------*/ +FxaaFloat dirAbsMinTimesC = min(abs(dir1.x), abs(dir1.y)) * fxaaConsoleEdgeSharpness; +FxaaFloat2 dir2 = clamp(dir1.xy / dirAbsMinTimesC, -2.0, 2.0); +/*--------------------------------------------------------------------------*/ +FxaaFloat4 rgbyN2 = FxaaTexTop(tex, pos.xy - dir2 * fxaaConsoleRcpFrameOpt2.zw); +FxaaFloat4 rgbyP2 = FxaaTexTop(tex, pos.xy + dir2 * fxaaConsoleRcpFrameOpt2.zw); +/*--------------------------------------------------------------------------*/ +FxaaFloat4 rgbyA = rgbyN1 + rgbyP1; +FxaaFloat4 rgbyB = ((rgbyN2 + rgbyP2) * 0.25) + (rgbyA * 0.25); +/*--------------------------------------------------------------------------*/ +#if (FXAA_GREEN_AS_LUMA == 0) +FxaaBool twoTap = (rgbyB.w < lumaMin) || (rgbyB.w > lumaMax); +#else +FxaaBool twoTap = (rgbyB.y < lumaMin) || (rgbyB.y > lumaMax); +#endif +if(twoTap) rgbyB.xyz = rgbyA.xyz * 0.5; +return rgbyB; } +/*==========================================================================*/ +#endif + + + +/*============================================================================ + +FXAA3 CONSOLE - 360 PIXEL SHADER + +------------------------------------------------------------------------------ +This optimized version thanks to suggestions from Andy Luedke. +Should be fully tex bound in all cases. +As of the FXAA 3.11 release, I have still not tested this code, +however I fixed a bug which was in both FXAA 3.9 and FXAA 3.10. +And note this is replacing the old unoptimized version. +If it does not work, please let me know so I can fix it. +============================================================================*/ +#if (FXAA_360 == 1) +/*--------------------------------------------------------------------------*/ +[reduceTempRegUsage(4)] +float4 FxaaPixelShader( +// See FXAA Quality FxaaPixelShader() source for docs on Inputs! +FxaaFloat2 pos, +FxaaFloat4 fxaaConsolePosPos, +FxaaTex tex, +FxaaTex fxaaConsole360TexExpBiasNegOne, +FxaaTex fxaaConsole360TexExpBiasNegTwo, +FxaaFloat2 fxaaQualityRcpFrame, +FxaaFloat4 fxaaConsoleRcpFrameOpt, +FxaaFloat4 fxaaConsoleRcpFrameOpt2, +FxaaFloat4 fxaaConsole360RcpFrameOpt2, +FxaaFloat fxaaQualitySubpix, +FxaaFloat fxaaQualityEdgeThreshold, +FxaaFloat fxaaQualityEdgeThresholdMin, +FxaaFloat fxaaConsoleEdgeSharpness, +FxaaFloat fxaaConsoleEdgeThreshold, +FxaaFloat fxaaConsoleEdgeThresholdMin, +FxaaFloat4 fxaaConsole360ConstDir +) { +/*--------------------------------------------------------------------------*/ +float4 lumaNwNeSwSe; +#if (FXAA_GREEN_AS_LUMA == 0) +asm { +tfetch2D lumaNwNeSwSe.w___, tex, pos.xy, OffsetX = -0.5, OffsetY = -0.5, UseComputedLOD=false +tfetch2D lumaNwNeSwSe._w__, tex, pos.xy, OffsetX = 0.5, OffsetY = -0.5, UseComputedLOD=false +tfetch2D lumaNwNeSwSe.__w_, tex, pos.xy, OffsetX = -0.5, OffsetY = 0.5, UseComputedLOD=false +tfetch2D lumaNwNeSwSe.___w, tex, pos.xy, OffsetX = 0.5, OffsetY = 0.5, UseComputedLOD=false +}; +#else +asm { +tfetch2D lumaNwNeSwSe.y___, tex, pos.xy, OffsetX = -0.5, OffsetY = -0.5, UseComputedLOD=false +tfetch2D lumaNwNeSwSe._y__, tex, pos.xy, OffsetX = 0.5, OffsetY = -0.5, UseComputedLOD=false +tfetch2D lumaNwNeSwSe.__y_, tex, pos.xy, OffsetX = -0.5, OffsetY = 0.5, UseComputedLOD=false +tfetch2D lumaNwNeSwSe.___y, tex, pos.xy, OffsetX = 0.5, OffsetY = 0.5, UseComputedLOD=false +}; +#endif +/*--------------------------------------------------------------------------*/ +lumaNwNeSwSe.y += 1.0/384.0; +float2 lumaMinTemp = min(lumaNwNeSwSe.xy, lumaNwNeSwSe.zw); +float2 lumaMaxTemp = max(lumaNwNeSwSe.xy, lumaNwNeSwSe.zw); +float lumaMin = min(lumaMinTemp.x, lumaMinTemp.y); +float lumaMax = max(lumaMaxTemp.x, lumaMaxTemp.y); +/*--------------------------------------------------------------------------*/ +float4 rgbyM = tex2Dlod(tex, float4(pos.xy, 0.0, 0.0)); +#if (FXAA_GREEN_AS_LUMA == 0) +float lumaMinM = min(lumaMin, rgbyM.w); +float lumaMaxM = max(lumaMax, rgbyM.w); +#else +float lumaMinM = min(lumaMin, rgbyM.y); +float lumaMaxM = max(lumaMax, rgbyM.y); +#endif +if((lumaMaxM - lumaMinM) < max(fxaaConsoleEdgeThresholdMin, lumaMax * fxaaConsoleEdgeThreshold)) return rgbyM; +/*--------------------------------------------------------------------------*/ +float2 dir; +dir.x = dot(lumaNwNeSwSe, fxaaConsole360ConstDir.yyxx); +dir.y = dot(lumaNwNeSwSe, fxaaConsole360ConstDir.xyxy); +dir = normalize(dir); +/*--------------------------------------------------------------------------*/ +float4 dir1 = dir.xyxy * fxaaConsoleRcpFrameOpt.xyzw; +/*--------------------------------------------------------------------------*/ +float4 dir2; +float dirAbsMinTimesC = min(abs(dir.x), abs(dir.y)) * fxaaConsoleEdgeSharpness; +dir2 = saturate(fxaaConsole360ConstDir.zzww * dir.xyxy / dirAbsMinTimesC + 0.5); +dir2 = dir2 * fxaaConsole360RcpFrameOpt2.xyxy + fxaaConsole360RcpFrameOpt2.zwzw; +/*--------------------------------------------------------------------------*/ +float4 rgbyN1 = tex2Dlod(fxaaConsole360TexExpBiasNegOne, float4(pos.xy + dir1.xy, 0.0, 0.0)); +float4 rgbyP1 = tex2Dlod(fxaaConsole360TexExpBiasNegOne, float4(pos.xy + dir1.zw, 0.0, 0.0)); +float4 rgbyN2 = tex2Dlod(fxaaConsole360TexExpBiasNegTwo, float4(pos.xy + dir2.xy, 0.0, 0.0)); +float4 rgbyP2 = tex2Dlod(fxaaConsole360TexExpBiasNegTwo, float4(pos.xy + dir2.zw, 0.0, 0.0)); +/*--------------------------------------------------------------------------*/ +float4 rgbyA = rgbyN1 + rgbyP1; +float4 rgbyB = rgbyN2 + rgbyP2 + rgbyA * 0.5; +/*--------------------------------------------------------------------------*/ +float4 rgbyR = ((FxaaLuma(rgbyB) - lumaMax) > 0.0) ? rgbyA : rgbyB; +rgbyR = ((FxaaLuma(rgbyB) - lumaMin) > 0.0) ? rgbyR : rgbyA; +return rgbyR; } +/*==========================================================================*/ +#endif + + + +/*============================================================================ + +FXAA3 CONSOLE - OPTIMIZED PS3 PIXEL SHADER (NO EARLY EXIT) + +============================================================================== +The code below does not exactly match the assembly. +I have a feeling that 12 cycles is possible, but was not able to get there. +Might have to increase register count to get full performance. +Note this shader does not use perspective interpolation. + +Use the following cgc options, + +--fenable-bx2 --fastmath --fastprecision --nofloatbindings + +------------------------------------------------------------------------------ +NVSHADERPERF OUTPUT +------------------------------------------------------------------------------ +For reference and to aid in debug, output of NVShaderPerf should match this, + +Shader to schedule: +0: texpkb h0.w(TRUE), v5.zyxx, #0 +2: addh h2.z(TRUE), h0.w, constant(0.001953, 0.000000, 0.000000, 0.000000).x +4: texpkb h0.w(TRUE), v5.xwxx, #0 +6: addh h0.z(TRUE), -h2, h0.w +7: texpkb h1.w(TRUE), v5, #0 +9: addh h0.x(TRUE), h0.z, -h1.w +10: addh h3.w(TRUE), h0.z, h1 +11: texpkb h2.w(TRUE), v5.zwzz, #0 +13: addh h0.z(TRUE), h3.w, -h2.w +14: addh h0.x(TRUE), h2.w, h0 +15: nrmh h1.xz(TRUE), h0_n +16: minh_m8 h0.x(TRUE), |h1|, |h1.z| +17: maxh h4.w(TRUE), h0, h1 +18: divx h2.xy(TRUE), h1_n.xzzw, h0_n +19: movr r1.zw(TRUE), v4.xxxy +20: madr r2.xz(TRUE), -h1, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).zzww, r1.zzww +22: minh h5.w(TRUE), h0, h1 +23: texpkb h0(TRUE), r2.xzxx, #0 +25: madr r0.zw(TRUE), h1.xzxz, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w), r1 +27: maxh h4.x(TRUE), h2.z, h2.w +28: texpkb h1(TRUE), r0.zwzz, #0 +30: addh_d2 h1(TRUE), h0, h1 +31: madr r0.xy(TRUE), -h2, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz +33: texpkb h0(TRUE), r0, #0 +35: minh h4.z(TRUE), h2, h2.w +36: fenct TRUE +37: madr r1.xy(TRUE), h2, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz +39: texpkb h2(TRUE), r1, #0 +41: addh_d2 h0(TRUE), h0, h2 +42: maxh h2.w(TRUE), h4, h4.x +43: minh h2.x(TRUE), h5.w, h4.z +44: addh_d2 h0(TRUE), h0, h1 +45: slth h2.x(TRUE), h0.w, h2 +46: sgth h2.w(TRUE), h0, h2 +47: movh h0(TRUE), h0 +48: addx.c0 rc(TRUE), h2, h2.w +49: movh h0(c0.NE.x), h1 + +IPU0 ------ Simplified schedule: -------- +Pass | Unit | uOp | PC: Op +-----+--------+------+------------------------- +1 | SCT0/1 | mov | 0: TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0; +| TEX | txl | 0: TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0; +| SCB1 | add | 2: ADDh h2.z, h0.--w-, const.--x-; +| | | +2 | SCT0/1 | mov | 4: TXLr h0.w, g[TEX1].xwxx, const.xxxx, TEX0; +| TEX | txl | 4: TXLr h0.w, g[TEX1].xwxx, const.xxxx, TEX0; +| SCB1 | add | 6: ADDh h0.z,-h2, h0.--w-; +| | | +3 | SCT0/1 | mov | 7: TXLr h1.w, g[TEX1], const.xxxx, TEX0; +| TEX | txl | 7: TXLr h1.w, g[TEX1], const.xxxx, TEX0; +| SCB0 | add | 9: ADDh h0.x, h0.z---,-h1.w---; +| SCB1 | add | 10: ADDh h3.w, h0.---z, h1; +| | | +4 | SCT0/1 | mov | 11: TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0; +| TEX | txl | 11: TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0; +| SCB0 | add | 14: ADDh h0.x, h2.w---, h0; +| SCB1 | add | 13: ADDh h0.z, h3.--w-,-h2.--w-; +| | | +5 | SCT1 | mov | 15: NRMh h1.xz, h0; +| SRB | nrm | 15: NRMh h1.xz, h0; +| SCB0 | min | 16: MINh*8 h0.x, |h1|, |h1.z---|; +| SCB1 | max | 17: MAXh h4.w, h0, h1; +| | | +6 | SCT0 | div | 18: DIVx h2.xy, h1.xz--, h0; +| SCT1 | mov | 19: MOVr r1.zw, g[TEX0].--xy; +| SCB0 | mad | 20: MADr r2.xz,-h1, const.z-w-, r1.z-w-; +| SCB1 | min | 22: MINh h5.w, h0, h1; +| | | +7 | SCT0/1 | mov | 23: TXLr h0, r2.xzxx, const.xxxx, TEX0; +| TEX | txl | 23: TXLr h0, r2.xzxx, const.xxxx, TEX0; +| SCB0 | max | 27: MAXh h4.x, h2.z---, h2.w---; +| SCB1 | mad | 25: MADr r0.zw, h1.--xz, const, r1; +| | | +8 | SCT0/1 | mov | 28: TXLr h1, r0.zwzz, const.xxxx, TEX0; +| TEX | txl | 28: TXLr h1, r0.zwzz, const.xxxx, TEX0; +| SCB0/1 | add | 30: ADDh/2 h1, h0, h1; +| | | +9 | SCT0 | mad | 31: MADr r0.xy,-h2, const.xy--, r1.zw--; +| SCT1 | mov | 33: TXLr h0, r0, const.zzzz, TEX0; +| TEX | txl | 33: TXLr h0, r0, const.zzzz, TEX0; +| SCB1 | min | 35: MINh h4.z, h2, h2.--w-; +| | | +10 | SCT0 | mad | 37: MADr r1.xy, h2, const.xy--, r1.zw--; +| SCT1 | mov | 39: TXLr h2, r1, const.zzzz, TEX0; +| TEX | txl | 39: TXLr h2, r1, const.zzzz, TEX0; +| SCB0/1 | add | 41: ADDh/2 h0, h0, h2; +| | | +11 | SCT0 | min | 43: MINh h2.x, h5.w---, h4.z---; +| SCT1 | max | 42: MAXh h2.w, h4, h4.---x; +| SCB0/1 | add | 44: ADDh/2 h0, h0, h1; +| | | +12 | SCT0 | set | 45: SLTh h2.x, h0.w---, h2; +| SCT1 | set | 46: SGTh h2.w, h0, h2; +| SCB0/1 | mul | 47: MOVh h0, h0; +| | | +13 | SCT0 | mad | 48: ADDxc0_s rc, h2, h2.w---; +| SCB0/1 | mul | 49: MOVh h0(NE0.xxxx), h1; +Pass SCT TEX SCB +1: 0% 100% 25% +2: 0% 100% 25% +3: 0% 100% 50% +4: 0% 100% 50% +5: 0% 0% 50% +6: 100% 0% 75% +7: 0% 100% 75% +8: 0% 100% 100% +9: 0% 100% 25% +10: 0% 100% 100% +11: 50% 0% 100% +12: 50% 0% 100% +13: 25% 0% 100% + +MEAN: 17% 61% 67% + +Pass SCT0 SCT1 TEX SCB0 SCB1 +1: 0% 0% 100% 0% 100% +2: 0% 0% 100% 0% 100% +3: 0% 0% 100% 100% 100% +4: 0% 0% 100% 100% 100% +5: 0% 0% 0% 100% 100% +6: 100% 100% 0% 100% 100% +7: 0% 0% 100% 100% 100% +8: 0% 0% 100% 100% 100% +9: 0% 0% 100% 0% 100% +10: 0% 0% 100% 100% 100% +11: 100% 100% 0% 100% 100% +12: 100% 100% 0% 100% 100% +13: 100% 0% 0% 100% 100% + +MEAN: 30% 23% 61% 76% 100% +Fragment Performance Setup: Driver RSX Compiler, GPU RSX, Flags 0x5 +Results 13 cycles, 3 r regs, 923,076,923 pixels/s +============================================================================*/ +#if (FXAA_PS3 == 1) && (FXAA_EARLY_EXIT == 0) +/*--------------------------------------------------------------------------*/ +#pragma regcount 7 +#pragma disablepc all +//#pragma option O3 +//#pragma option OutColorPrec=fp16 +#pragma texformat default RGBA8 +/*==========================================================================*/ +half4 FxaaPixelShader( +// See FXAA Quality FxaaPixelShader() source for docs on Inputs! +FxaaFloat2 pos, +FxaaFloat4 fxaaConsolePosPos, +FxaaTex tex, +//FxaaTex fxaaConsole360TexExpBiasNegOne, +//FxaaTex fxaaConsole360TexExpBiasNegTwo, +//FxaaFloat2 fxaaQualityRcpFrame, +FxaaFloat4 fxaaConsoleRcpFrameOpt, +FxaaFloat4 fxaaConsoleRcpFrameOpt2 +//FxaaFloat4 fxaaConsole360RcpFrameOpt2, +//FxaaFloat fxaaQualitySubpix, +//FxaaFloat fxaaQualityEdgeThreshold, +//FxaaFloat fxaaQualityEdgeThresholdMin, +//FxaaFloat fxaaConsoleEdgeSharpness, +//FxaaFloat fxaaConsoleEdgeThreshold, +//FxaaFloat fxaaConsoleEdgeThresholdMin, +//FxaaFloat4 fxaaConsole360ConstDir +) { +/*--------------------------------------------------------------------------*/ +// (1) +half4 dir; +half4 lumaNe = tex2D(tex, fxaaConsolePosPos.zy); // h4tex2Dlod(tex, half4(fxaaConsolePosPos.zy, 0, 0)); +#if (FXAA_GREEN_AS_LUMA == 0) +lumaNe.w += half(1.0/512.0); +dir.x = -lumaNe.w; +dir.z = -lumaNe.w; +#else +lumaNe.y += half(1.0/512.0); +dir.x = -lumaNe.y; +dir.z = -lumaNe.y; +#endif +/*--------------------------------------------------------------------------*/ +// (2) +half4 lumaSw = tex2D(tex, fxaaConsolePosPos.xw); // h4tex2Dlod(tex, half4(fxaaConsolePosPos.xw, 0, 0)); +#if (FXAA_GREEN_AS_LUMA == 0) +dir.x += lumaSw.w; +dir.z += lumaSw.w; +#else +dir.x += lumaSw.y; +dir.z += lumaSw.y; +#endif +/*--------------------------------------------------------------------------*/ +// (3) +half4 lumaNw = tex2D(tex, fxaaConsolePosPos.xy); // h4tex2Dlod(tex, half4(fxaaConsolePosPos.xy, 0, 0)); +#if (FXAA_GREEN_AS_LUMA == 0) +dir.x -= lumaNw.w; +dir.z += lumaNw.w; +#else +dir.x -= lumaNw.y; +dir.z += lumaNw.y; +#endif +/*--------------------------------------------------------------------------*/ +// (4) +half4 lumaSe = tex2D(tex, fxaaConsolePosPos.zw); // h4tex2Dlod(tex, half4(fxaaConsolePosPos.zw, 0, 0)); +#if (FXAA_GREEN_AS_LUMA == 0) +dir.x += lumaSe.w; +dir.z -= lumaSe.w; +#else +dir.x += lumaSe.y; +dir.z -= lumaSe.y; +#endif +/*--------------------------------------------------------------------------*/ +// (5) +half4 dir1_pos; +dir1_pos.xy = normalize(dir.xz); +half dirAbsMinTimesC = min(abs(dir1_pos.x), abs(dir1_pos.y)) * half(FXAA_CONSOLE__PS3_EDGE_SHARPNESS); +/*--------------------------------------------------------------------------*/ +// (6) +half4 dir2_pos; +dir2_pos.xy = clamp(dir1_pos.xy / dirAbsMinTimesC, half(-2.0), half(2.0)); +dir1_pos.zw = pos.xy; +dir2_pos.zw = pos.xy; +half4 temp1N; +temp1N.xy = dir1_pos.zw - dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw; +/*--------------------------------------------------------------------------*/ +// (7) +temp1N = tex2D(tex, temp1N.xy); // h4tex2Dlod(tex, half4(temp1N.xy, 0.0, 0.0)); +half4 rgby1; +rgby1.xy = dir1_pos.zw + dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw; +/*--------------------------------------------------------------------------*/ +// (8) +rgby1 = tex2D(tex, rgby1.xy); // h4tex2Dlod(tex, half4(rgby1.xy, 0.0, 0.0)); +rgby1 = (temp1N + rgby1) * 0.5; +/*--------------------------------------------------------------------------*/ +// (9) +half4 temp2N; +temp2N.xy = dir2_pos.zw - dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw; +temp2N = tex2D(tex, temp2N.xy); // h4tex2Dlod(tex, half4(temp2N.xy, 0.0, 0.0)); +/*--------------------------------------------------------------------------*/ +// (10) +half4 rgby2; +rgby2.xy = dir2_pos.zw + dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw; +rgby2 = tex2D(tex, rgby2.xy); // h4tex2Dlod(tex, half4(rgby2.xy, 0.0, 0.0)); +rgby2 = (temp2N + rgby2) * 0.5; +/*--------------------------------------------------------------------------*/ +// (11) +// compilier moves these scalar ops up to other cycles +#if (FXAA_GREEN_AS_LUMA == 0) +half lumaMin = min(min(lumaNw.w, lumaSw.w), min(lumaNe.w, lumaSe.w)); +half lumaMax = max(max(lumaNw.w, lumaSw.w), max(lumaNe.w, lumaSe.w)); +#else +half lumaMin = min(min(lumaNw.y, lumaSw.y), min(lumaNe.y, lumaSe.y)); +half lumaMax = max(max(lumaNw.y, lumaSw.y), max(lumaNe.y, lumaSe.y)); +#endif +rgby2 = (rgby2 + rgby1) * 0.5; +/*--------------------------------------------------------------------------*/ +// (12) +#if (FXAA_GREEN_AS_LUMA == 0) +bool twoTapLt = rgby2.w < lumaMin; +bool twoTapGt = rgby2.w > lumaMax; +#else +bool twoTapLt = rgby2.y < lumaMin; +bool twoTapGt = rgby2.y > lumaMax; +#endif +/*--------------------------------------------------------------------------*/ +// (13) +if(twoTapLt || twoTapGt) rgby2 = rgby1; +/*--------------------------------------------------------------------------*/ +return rgby2; } +/*==========================================================================*/ +#endif + + + +/*============================================================================ + +FXAA3 CONSOLE - OPTIMIZED PS3 PIXEL SHADER (WITH EARLY EXIT) + +============================================================================== +The code mostly matches the assembly. +I have a feeling that 14 cycles is possible, but was not able to get there. +Might have to increase register count to get full performance. +Note this shader does not use perspective interpolation. + +Use the following cgc options, + +--fenable-bx2 --fastmath --fastprecision --nofloatbindings + +Use of FXAA_GREEN_AS_LUMA currently adds a cycle (16 clks). +Will look at fixing this for FXAA 3.12. +------------------------------------------------------------------------------ +NVSHADERPERF OUTPUT +------------------------------------------------------------------------------ +For reference and to aid in debug, output of NVShaderPerf should match this, + +Shader to schedule: +0: texpkb h0.w(TRUE), v5.zyxx, #0 +2: addh h2.y(TRUE), h0.w, constant(0.001953, 0.000000, 0.000000, 0.000000).x +4: texpkb h1.w(TRUE), v5.xwxx, #0 +6: addh h0.x(TRUE), h1.w, -h2.y +7: texpkb h2.w(TRUE), v5.zwzz, #0 +9: minh h4.w(TRUE), h2.y, h2 +10: maxh h5.x(TRUE), h2.y, h2.w +11: texpkb h0.w(TRUE), v5, #0 +13: addh h3.w(TRUE), -h0, h0.x +14: addh h0.x(TRUE), h0.w, h0 +15: addh h0.z(TRUE), -h2.w, h0.x +16: addh h0.x(TRUE), h2.w, h3.w +17: minh h5.y(TRUE), h0.w, h1.w +18: nrmh h2.xz(TRUE), h0_n +19: minh_m8 h2.w(TRUE), |h2.x|, |h2.z| +20: divx h4.xy(TRUE), h2_n.xzzw, h2_n.w +21: movr r1.zw(TRUE), v4.xxxy +22: maxh h2.w(TRUE), h0, h1 +23: fenct TRUE +24: madr r0.xy(TRUE), -h2.xzzw, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).zwzz, r1.zwzz +26: texpkb h0(TRUE), r0, #0 +28: maxh h5.x(TRUE), h2.w, h5 +29: minh h5.w(TRUE), h5.y, h4 +30: madr r1.xy(TRUE), h2.xzzw, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).zwzz, r1.zwzz +32: texpkb h2(TRUE), r1, #0 +34: addh_d2 h2(TRUE), h0, h2 +35: texpkb h1(TRUE), v4, #0 +37: maxh h5.y(TRUE), h5.x, h1.w +38: minh h4.w(TRUE), h1, h5 +39: madr r0.xy(TRUE), -h4, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz +41: texpkb h0(TRUE), r0, #0 +43: addh_m8 h5.z(TRUE), h5.y, -h4.w +44: madr r2.xy(TRUE), h4, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz +46: texpkb h3(TRUE), r2, #0 +48: addh_d2 h0(TRUE), h0, h3 +49: addh_d2 h3(TRUE), h0, h2 +50: movh h0(TRUE), h3 +51: slth h3.x(TRUE), h3.w, h5.w +52: sgth h3.w(TRUE), h3, h5.x +53: addx.c0 rc(TRUE), h3.x, h3 +54: slth.c0 rc(TRUE), h5.z, h5 +55: movh h0(c0.NE.w), h2 +56: movh h0(c0.NE.x), h1 + +IPU0 ------ Simplified schedule: -------- +Pass | Unit | uOp | PC: Op +-----+--------+------+------------------------- +1 | SCT0/1 | mov | 0: TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0; +| TEX | txl | 0: TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0; +| SCB0 | add | 2: ADDh h2.y, h0.-w--, const.-x--; +| | | +2 | SCT0/1 | mov | 4: TXLr h1.w, g[TEX1].xwxx, const.xxxx, TEX0; +| TEX | txl | 4: TXLr h1.w, g[TEX1].xwxx, const.xxxx, TEX0; +| SCB0 | add | 6: ADDh h0.x, h1.w---,-h2.y---; +| | | +3 | SCT0/1 | mov | 7: TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0; +| TEX | txl | 7: TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0; +| SCB0 | max | 10: MAXh h5.x, h2.y---, h2.w---; +| SCB1 | min | 9: MINh h4.w, h2.---y, h2; +| | | +4 | SCT0/1 | mov | 11: TXLr h0.w, g[TEX1], const.xxxx, TEX0; +| TEX | txl | 11: TXLr h0.w, g[TEX1], const.xxxx, TEX0; +| SCB0 | add | 14: ADDh h0.x, h0.w---, h0; +| SCB1 | add | 13: ADDh h3.w,-h0, h0.---x; +| | | +5 | SCT0 | mad | 16: ADDh h0.x, h2.w---, h3.w---; +| SCT1 | mad | 15: ADDh h0.z,-h2.--w-, h0.--x-; +| SCB0 | min | 17: MINh h5.y, h0.-w--, h1.-w--; +| | | +6 | SCT1 | mov | 18: NRMh h2.xz, h0; +| SRB | nrm | 18: NRMh h2.xz, h0; +| SCB1 | min | 19: MINh*8 h2.w, |h2.---x|, |h2.---z|; +| | | +7 | SCT0 | div | 20: DIVx h4.xy, h2.xz--, h2.ww--; +| SCT1 | mov | 21: MOVr r1.zw, g[TEX0].--xy; +| SCB1 | max | 22: MAXh h2.w, h0, h1; +| | | +8 | SCT0 | mad | 24: MADr r0.xy,-h2.xz--, const.zw--, r1.zw--; +| SCT1 | mov | 26: TXLr h0, r0, const.xxxx, TEX0; +| TEX | txl | 26: TXLr h0, r0, const.xxxx, TEX0; +| SCB0 | max | 28: MAXh h5.x, h2.w---, h5; +| SCB1 | min | 29: MINh h5.w, h5.---y, h4; +| | | +9 | SCT0 | mad | 30: MADr r1.xy, h2.xz--, const.zw--, r1.zw--; +| SCT1 | mov | 32: TXLr h2, r1, const.xxxx, TEX0; +| TEX | txl | 32: TXLr h2, r1, const.xxxx, TEX0; +| SCB0/1 | add | 34: ADDh/2 h2, h0, h2; +| | | +10 | SCT0/1 | mov | 35: TXLr h1, g[TEX0], const.xxxx, TEX0; +| TEX | txl | 35: TXLr h1, g[TEX0], const.xxxx, TEX0; +| SCB0 | max | 37: MAXh h5.y, h5.-x--, h1.-w--; +| SCB1 | min | 38: MINh h4.w, h1, h5; +| | | +11 | SCT0 | mad | 39: MADr r0.xy,-h4, const.xy--, r1.zw--; +| SCT1 | mov | 41: TXLr h0, r0, const.zzzz, TEX0; +| TEX | txl | 41: TXLr h0, r0, const.zzzz, TEX0; +| SCB0 | mad | 44: MADr r2.xy, h4, const.xy--, r1.zw--; +| SCB1 | add | 43: ADDh*8 h5.z, h5.--y-,-h4.--w-; +| | | +12 | SCT0/1 | mov | 46: TXLr h3, r2, const.xxxx, TEX0; +| TEX | txl | 46: TXLr h3, r2, const.xxxx, TEX0; +| SCB0/1 | add | 48: ADDh/2 h0, h0, h3; +| | | +13 | SCT0/1 | mad | 49: ADDh/2 h3, h0, h2; +| SCB0/1 | mul | 50: MOVh h0, h3; +| | | +14 | SCT0 | set | 51: SLTh h3.x, h3.w---, h5.w---; +| SCT1 | set | 52: SGTh h3.w, h3, h5.---x; +| SCB0 | set | 54: SLThc0 rc, h5.z---, h5; +| SCB1 | add | 53: ADDxc0_s rc, h3.---x, h3; +| | | +15 | SCT0/1 | mul | 55: MOVh h0(NE0.wwww), h2; +| SCB0/1 | mul | 56: MOVh h0(NE0.xxxx), h1; +Pass SCT TEX SCB +1: 0% 100% 25% +2: 0% 100% 25% +3: 0% 100% 50% +4: 0% 100% 50% +5: 50% 0% 25% +6: 0% 0% 25% +7: 100% 0% 25% +8: 0% 100% 50% +9: 0% 100% 100% +10: 0% 100% 50% +11: 0% 100% 75% +12: 0% 100% 100% +13: 100% 0% 100% +14: 50% 0% 50% +15: 100% 0% 100% + +MEAN: 26% 60% 56% + +Pass SCT0 SCT1 TEX SCB0 SCB1 +1: 0% 0% 100% 100% 0% +2: 0% 0% 100% 100% 0% +3: 0% 0% 100% 100% 100% +4: 0% 0% 100% 100% 100% +5: 100% 100% 0% 100% 0% +6: 0% 0% 0% 0% 100% +7: 100% 100% 0% 0% 100% +8: 0% 0% 100% 100% 100% +9: 0% 0% 100% 100% 100% +10: 0% 0% 100% 100% 100% +11: 0% 0% 100% 100% 100% +12: 0% 0% 100% 100% 100% +13: 100% 100% 0% 100% 100% +14: 100% 100% 0% 100% 100% +15: 100% 100% 0% 100% 100% + +MEAN: 33% 33% 60% 86% 80% +Fragment Performance Setup: Driver RSX Compiler, GPU RSX, Flags 0x5 +Results 15 cycles, 3 r regs, 800,000,000 pixels/s +============================================================================*/ +#if (FXAA_PS3 == 1) && (FXAA_EARLY_EXIT == 1) +/*--------------------------------------------------------------------------*/ +#pragma regcount 7 +#pragma disablepc all +//#pragma option O2 +//#pragma option OutColorPrec=fp16 +#pragma texformat default RGBA8 +/*==========================================================================*/ +half4 FxaaPixelShader( +// See FXAA Quality FxaaPixelShader() source for docs on Inputs! +FxaaFloat2 pos, +FxaaFloat4 fxaaConsolePosPos, +FxaaTex tex, +//FxaaTex fxaaConsole360TexExpBiasNegOne, +//FxaaTex fxaaConsole360TexExpBiasNegTwo, +//FxaaFloat2 fxaaQualityRcpFrame, +FxaaFloat4 fxaaConsoleRcpFrameOpt, +FxaaFloat4 fxaaConsoleRcpFrameOpt2 +//FxaaFloat4 fxaaConsole360RcpFrameOpt, +//FxaaFloat fxaaQualitySubpix, +//FxaaFloat fxaaQualityEdgeThreshold, +//FxaaFloat fxaaQualityEdgeThresholdMin, +//FxaaFloat fxaaConsoleEdgeSharpness, +//FxaaFloat fxaaConsoleEdgeThreshold, +//FxaaFloat fxaaConsoleEdgeThresholdMin, +//FxaaFloat4 fxaaConsole360ConstDir +) { +/*--------------------------------------------------------------------------*/ +// (1) +half4 rgbyNe = tex2D(tex, fxaaConsolePosPos.zy); // h4tex2Dlod(tex, half4(fxaaConsolePosPos.zy, 0, 0)); +#if (FXAA_GREEN_AS_LUMA == 0) +half lumaNe = rgbyNe.w + half(1.0/512.0); +#else +half lumaNe = rgbyNe.y + half(1.0/512.0); +#endif +/*--------------------------------------------------------------------------*/ +// (2) +half4 lumaSw = tex2D(tex, fxaaConsolePosPos.xw); // h4tex2Dlod(tex, half4(fxaaConsolePosPos.xw, 0, 0)); +#if (FXAA_GREEN_AS_LUMA == 0) +half lumaSwNegNe = lumaSw.w - lumaNe; +#else +half lumaSwNegNe = lumaSw.y - lumaNe; +#endif +/*--------------------------------------------------------------------------*/ +// (3) +half4 lumaNw = tex2D(tex, fxaaConsolePosPos.xy); // h4tex2Dlod(tex, half4(fxaaConsolePosPos.xy, 0, 0)); +#if (FXAA_GREEN_AS_LUMA == 0) +half lumaMaxNwSw = max(lumaNw.w, lumaSw.w); +half lumaMinNwSw = min(lumaNw.w, lumaSw.w); +#else +half lumaMaxNwSw = max(lumaNw.y, lumaSw.y); +half lumaMinNwSw = min(lumaNw.y, lumaSw.y); +#endif +/*--------------------------------------------------------------------------*/ +// (4) +half4 lumaSe = tex2D(tex, fxaaConsolePosPos.zw); // h4tex2Dlod(tex, half4(fxaaConsolePosPos.zw, 0, 0)); +#if (FXAA_GREEN_AS_LUMA == 0) +half dirZ = lumaNw.w + lumaSwNegNe; +half dirX = -lumaNw.w + lumaSwNegNe; +#else +half dirZ = lumaNw.y + lumaSwNegNe; +half dirX = -lumaNw.y + lumaSwNegNe; +#endif +/*--------------------------------------------------------------------------*/ +// (5) +half3 dir; +dir.y = 0.0; +#if (FXAA_GREEN_AS_LUMA == 0) +dir.x = lumaSe.w + dirX; +dir.z = -lumaSe.w + dirZ; +half lumaMinNeSe = min(lumaNe, lumaSe.w); +#else +dir.x = lumaSe.y + dirX; +dir.z = -lumaSe.y + dirZ; +half lumaMinNeSe = min(lumaNe, lumaSe.y); +#endif +/*--------------------------------------------------------------------------*/ +// (6) +half4 dir1_pos; +dir1_pos.xy = normalize(dir).xz; +half dirAbsMinTimes8 = min(abs(dir1_pos.x), abs(dir1_pos.y)) * half(FXAA_CONSOLE__PS3_EDGE_SHARPNESS); +/*--------------------------------------------------------------------------*/ +// (7) +half4 dir2_pos; +dir2_pos.xy = clamp(dir1_pos.xy / dirAbsMinTimes8, half(-2.0), half(2.0)); +dir1_pos.zw = pos.xy; +dir2_pos.zw = pos.xy; +#if (FXAA_GREEN_AS_LUMA == 0) +half lumaMaxNeSe = max(lumaNe, lumaSe.w); +#else +half lumaMaxNeSe = max(lumaNe, lumaSe.y); +#endif +/*--------------------------------------------------------------------------*/ +// (8) +half4 temp1N; +temp1N.xy = dir1_pos.zw - dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw; +temp1N = tex2D(tex, temp1N.xy); // h4tex2Dlod(tex, half4(temp1N.xy, 0.0, 0.0)); +half lumaMax = max(lumaMaxNwSw, lumaMaxNeSe); +half lumaMin = min(lumaMinNwSw, lumaMinNeSe); +/*--------------------------------------------------------------------------*/ +// (9) +half4 rgby1; +rgby1.xy = dir1_pos.zw + dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw; +rgby1 = tex2D(tex, rgby1.xy); // h4tex2Dlod(tex, half4(rgby1.xy, 0.0, 0.0)); +rgby1 = (temp1N + rgby1) * 0.5; +/*--------------------------------------------------------------------------*/ +// (10) +half4 rgbyM = tex2D(tex, pos.xy); // h4tex2Dlod(tex, half4(pos.xy, 0.0, 0.0)); +#if (FXAA_GREEN_AS_LUMA == 0) +half lumaMaxM = max(lumaMax, rgbyM.w); +half lumaMinM = min(lumaMin, rgbyM.w); +#else +half lumaMaxM = max(lumaMax, rgbyM.y); +half lumaMinM = min(lumaMin, rgbyM.y); +#endif +/*--------------------------------------------------------------------------*/ +// (11) +half4 temp2N; +temp2N.xy = dir2_pos.zw - dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw; +temp2N = tex2D(tex, temp2N.xy); // h4tex2Dlod(tex, half4(temp2N.xy, 0.0, 0.0)); +half4 rgby2; +rgby2.xy = dir2_pos.zw + dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw; +half lumaRangeM = (lumaMaxM - lumaMinM) / FXAA_CONSOLE__PS3_EDGE_THRESHOLD; +/*--------------------------------------------------------------------------*/ +// (12) +rgby2 = tex2D(tex, rgby2.xy); // h4tex2Dlod(tex, half4(rgby2.xy, 0.0, 0.0)); +rgby2 = (temp2N + rgby2) * 0.5; +/*--------------------------------------------------------------------------*/ +// (13) +rgby2 = (rgby2 + rgby1) * 0.5; +/*--------------------------------------------------------------------------*/ +// (14) +#if (FXAA_GREEN_AS_LUMA == 0) +bool twoTapLt = rgby2.w < lumaMin; +bool twoTapGt = rgby2.w > lumaMax; +#else +bool twoTapLt = rgby2.y < lumaMin; +bool twoTapGt = rgby2.y > lumaMax; +#endif +bool earlyExit = lumaRangeM < lumaMax; +bool twoTap = twoTapLt || twoTapGt; +/*--------------------------------------------------------------------------*/ +// (15) +if(twoTap) rgby2 = rgby1; +if(earlyExit) rgby2 = rgbyM; +/*--------------------------------------------------------------------------*/ +return rgby2; } +/*==========================================================================*/ +#endif \ No newline at end of file diff --git a/code/nel/src/3d/shaders/fxaa_pp.cg b/code/nel/src/3d/shaders/fxaa_pp.cg new file mode 100644 index 000000000..49622f206 --- /dev/null +++ b/code/nel/src/3d/shaders/fxaa_pp.cg @@ -0,0 +1,91 @@ + +#define FXAA_PC 1 +#define FXAA_HLSL_3 1 +#define FXAA_QUALITY__PRESET 12 +#define FXAA_EARLY_EXIT 0 +#define FXAA_GREEN_AS_LUMA 1 + +#define h4tex2Dlod tex2Dlod +#define half4 float4 +#define half3 float3 +#define half2 float2 +#define half float + +#include "fxaa3_11.h" + +void fxaa_pp( + // Per fragment parameters + float2 pos : TEXCOORD0, +#if (FXAA_PS3 == 1) + float4 fxaaConsolePosPos : TEXCOORD1, +#endif + + // Fragment program constants +#if (FXAA_PC == 1) + uniform float2 fxaaQualityRcpFrame, + uniform float fxaaQualitySubpix, + uniform float fxaaQualityEdgeThreshold, + uniform float fxaaQualityEdgeThresholdMin, +#else + uniform float4 fxaaConsoleRcpFrameOpt, + uniform float4 fxaaConsoleRcpFrameOpt2, +#endif + uniform sampler2D nlTex0 : TEX0, + + // Output color + out float4 oCol : COLOR +) +{ +#if (FXAA_PC == 1) + oCol = FxaaPixelShader( + pos, + nlTex0, + fxaaQualityRcpFrame, + fxaaQualitySubpix, + fxaaQualityEdgeThreshold, + fxaaQualityEdgeThresholdMin + ); +#else + oCol = FxaaPixelShader( + pos, + fxaaConsolePosPos, + nlTex0, + fxaaConsoleRcpFrameOpt, + fxaaConsoleRcpFrameOpt2 + ); +#endif +} + +/* +Have FXAA vertex shader run as a full screen triangle, +and output "pos" and "fxaaConsolePosPos" +such that inputs in the pixel shader provide, + +// {xy} = center of pixel +FxaaFloat2 pos, + +// {xy__} = upper left of pixel +// {__zw} = lower right of pixel +FxaaFloat4 fxaaConsolePosPos, +*/ + +// fxaaConsoleRcpFrameOpt: +// Only used on FXAA Console. +// This must be from a constant/uniform. +// This effects sub-pixel AA quality and inversely sharpness. +// Where N ranges between, +// N = 0.50 (default) +// N = 0.33 (sharper) +// {x___} = -N/screenWidthInPixels +// {_y__} = -N/screenHeightInPixels +// {__z_} = N/screenWidthInPixels +// {___w} = N/screenHeightInPixels + +// fxaaConsoleRcpFrameOpt2: +// Only used on FXAA Console. +// Not used on 360, but used on PS3 and PC. +// This must be from a constant/uniform. +// {x___} = -2.0/screenWidthInPixels +// {_y__} = -2.0/screenHeightInPixels +// {__z_} = 2.0/screenWidthInPixels +// {___w} = 2.0/screenHeightInPixels diff --git a/code/nel/src/3d/shaders/fxaa_pp_arbfp1.txt b/code/nel/src/3d/shaders/fxaa_pp_arbfp1.txt new file mode 100644 index 000000000..5a498ed61 --- /dev/null +++ b/code/nel/src/3d/shaders/fxaa_pp_arbfp1.txt @@ -0,0 +1,300 @@ +!!ARBfp1.0 +OPTION ARB_precision_hint_fastest; +# cgc version 3.1.0013, build date Apr 18 2012 +# command line args: -profile arbfp1 -O3 -fastmath -fastprecision +# source file: fxaa_pp.cg +#vendor NVIDIA Corporation +#version 3.1.0.13 +#profile arbfp1 +#program fxaa_pp +#semantic fxaa_pp.fxaaQualityRcpFrame +#semantic fxaa_pp.fxaaQualitySubpix +#semantic fxaa_pp.fxaaQualityEdgeThreshold +#semantic fxaa_pp.fxaaQualityEdgeThresholdMin +#semantic fxaa_pp.nlTex0 : TEX0 +#var float2 pos : $vin.TEXCOORD0 : TEX0 : 0 : 1 +#var float2 fxaaQualityRcpFrame : : c[0] : 1 : 1 +#var float fxaaQualitySubpix : : c[1] : 2 : 1 +#var float fxaaQualityEdgeThreshold : : c[2] : 3 : 1 +#var float fxaaQualityEdgeThresholdMin : : c[3] : 4 : 1 +#var sampler2D nlTex0 : TEX0 : texunit 0 : 5 : 1 +#var float4 oCol : $vout.COLOR : COL : 6 : 1 +#const c[4] = 0 -1 1 -2 +#const c[5] = 2 0.5 0.25 1.5 +#const c[6] = 4 12 0.083333336 3 +PARAM c[7] = { program.local[0..3], + { 0, -1, 1, -2 }, + { 2, 0.5, 0.25, 1.5 }, + { 4, 12, 0.083333336, 3 } }; +TEMP R0; +TEMP R1; +TEMP R2; +TEMP R3; +TEMP R4; +TEMP R5; +TEMP R6; +TEMP R7; +TEMP R8; +TEMP R9; +MOV R3.xyz, c[4]; +MAD R2.zw, R3.xyyz, c[0].xyxy, fragment.texcoord[0].xyxy; +MAD R0.xy, R3, c[0], fragment.texcoord[0]; +MAD R1.xy, R3.zyzw, c[0], fragment.texcoord[0]; +TEX R5.y, R1, texture[0], 2D; +MAD R1.xy, R3.zxzw, c[0], fragment.texcoord[0]; +ADD R0.zw, fragment.texcoord[0].xyxy, -c[0].xyxy; +TEX R4.y, R0.zwzw, texture[0], 2D; +TEX R6.y, R2.zwzw, texture[0], 2D; +TEX R8, fragment.texcoord[0], texture[0], 2D; +TEX R1.y, R1, texture[0], 2D; +TEX R0.y, R0, texture[0], 2D; +ADD R0.z, R4.y, R5.y; +MAD R1.z, R0.y, c[4].w, R0; +MAD R0.zw, R3.xyyx, c[0].xyxy, fragment.texcoord[0].xyxy; +TEX R2.y, R0.zwzw, texture[0], 2D; +ADD R0.x, R2.y, R1.y; +ABS R0.w, R1.z; +ADD R1.zw, fragment.texcoord[0].xyxy, c[0].xyxy; +TEX R7.y, R1.zwzw, texture[0], 2D; +MAD R0.z, R8.y, c[4].w, R0.x; +ABS R0.z, R0; +MAD R2.x, R0.z, c[5], R0.w; +MAD R0.zw, R3.xyxz, c[0].xyxy, fragment.texcoord[0].xyxy; +TEX R3.y, R0.zwzw, texture[0], 2D; +ADD R0.z, R0.y, R3.y; +ADD R1.x, R6.y, R7.y; +MAD R0.w, R3.y, c[4], R1.x; +MAD R1.x, R8.y, c[4].w, R0.z; +ABS R0.w, R0; +ADD R2.x, R0.w, R2; +ADD R2.w, R4.y, R6.y; +ADD R0.w, R5.y, R7.y; +ABS R1.z, R1.x; +MAD R1.x, R1.y, c[4].w, R0.w; +ABS R1.w, R1.x; +MAD R1.x, R2.y, c[4].w, R2.w; +MAD R1.z, R1, c[5].x, R1.w; +ABS R1.x, R1; +ADD R1.x, R1, R1.z; +SGE R4.x, R1, R2; +MAX R1.x, R3.y, R8.y; +MAX R1.z, R1.y, R1.x; +MAX R1.x, R0.y, R2.y; +MAX R1.x, R1, R1.z; +MIN R1.z, R3.y, R8.y; +MIN R1.w, R1.y, R1.z; +MIN R1.z, R0.y, R2.y; +MIN R1.z, R1, R1.w; +MUL R2.x, R1, c[2]; +ADD R3.z, R1.x, -R1; +ABS R3.w, R4.x; +MAX R1.w, R2.x, c[3].x; +ADD R2.z, R3, -R1.w; +CMP R2.x, R2.z, c[4], c[4].z; +CMP R1.x, -R3.w, c[4], c[4].z; +MUL R3.w, R2.x, R1.x; +CMP R1.z, -R3.w, R1.y, R3.y; +ADD R1.y, -R8, R1.z; +CMP R1.w, -R3, R2.y, R0.y; +ADD R0.y, -R8, R1.w; +MUL R4.x, R2, R4; +CMP R3.y, -R3.w, c[0], R3.x; +ABS R4.w, R1.y; +ABS R4.z, R0.y; +SGE R0.y, R4.z, R4.w; +MUL R1.y, R2.x, R0; +ABS R0.y, R0; +CMP R4.y, -R0, c[4].x, c[4].z; +ABS R0.y, R1.x; +CMP R0.y, -R0, c[4].x, c[4].z; +MUL R1.x, R2, R0.y; +CMP R2.y, -R4.x, c[0], c[0].x; +CMP R2.y, -R1, -R2, R2; +MAD R1.y, R2, c[5], fragment.texcoord[0]; +CMP R5.z, -R4.x, R1.y, fragment.texcoord[0].y; +ADD R5.y, R5.z, -R3; +MAD R0.y, R2, c[5], fragment.texcoord[0].x; +CMP R3.x, -R1, c[0], R3; +CMP R6.x, -R3.w, R0.y, fragment.texcoord[0]; +ADD R5.w, R5.z, R3.y; +ADD R1.x, R6, -R3; +MOV R1.y, R5; +TEX R0.y, R1, texture[0], 2D; +MUL R1.y, R2.x, R4; +ADD R0.x, R0.z, R0; +ADD R0.w, R2, R0; +MAD R0.z, R0.x, c[5].x, R0.w; +ADD R1.w, R8.y, R1; +ADD R1.z, R8.y, R1; +CMP R4.y, -R1, R1.z, R1.w; +ADD R1.z, R6.x, R3.x; +MAD R5.x, -R4.y, c[5].y, R0.y; +MOV R1.w, R5; +TEX R0.y, R1.zwzw, texture[0], 2D; +MAX R1.w, R4.z, R4; +MAD R1.y, -R4, c[5], R0; +MUL R4.z, R1.w, c[5]; +ABS R0.y, R1; +SGE R1.w, R0.y, R4.z; +ABS R6.y, R5.x; +SGE R0.y, R6, R4.z; +ABS R1.w, R1; +CMP R6.y, -R1.w, c[4].x, c[4].z; +ABS R0.y, R0; +CMP R5.z, -R0.y, c[4].x, c[4]; +ADD_SAT R0.y, R5.z, R6; +MUL R4.w, R2.x, R0.y; +MUL R0.y, R2.x, R6; +MAD R1.w, R3.y, c[5], R5; +CMP R6.x, -R0.y, R1.w, R5.w; +MAD R6.z, R3.x, c[5].w, R1; +CMP R1.z, -R0.y, R6, R1; +MOV R1.w, R6.x; +TEX R0.y, R1.zwzw, texture[0], 2D; +MUL R1.w, R4, R6.y; +CMP R6.y, -R1.w, R0, R1; +MUL R0.y, R2.x, R5.z; +MAD R1.y, -R3, c[5].w, R5; +CMP R5.w, -R0.y, R1.y, R5.y; +MAD R6.z, -R3.x, c[5].w, R1.x; +CMP R1.x, -R0.y, R6.z, R1; +MOV R1.y, R5.w; +TEX R0.y, R1, texture[0], 2D; +MUL R5.y, R4.w, R5.z; +CMP R0.y, -R5, R0, R5.x; +MAD R5.x, -R4.y, c[5].y, R0.y; +CMP R5.z, -R5.y, R5.x, R0.y; +MAD R1.y, -R4, c[5], R6; +CMP R1.y, -R1.w, R1, R6; +ABS R1.w, R1.y; +SGE R1.w, R1, R4.z; +ABS R0.y, R5.z; +SGE R0.y, R0, R4.z; +ABS R1.w, R1; +CMP R6.y, -R1.w, c[4].x, c[4].z; +ABS R0.y, R0; +CMP R5.y, -R0, c[4].x, c[4].z; +ADD_SAT R0.y, R5, R6; +MUL R5.x, R4.w, R0.y; +MUL R0.y, R4.w, R6; +MAD R1.w, R3.y, c[5].x, R6.x; +CMP R6.x, -R0.y, R1.w, R6; +MAD R6.z, R3.x, c[5].x, R1; +CMP R1.z, -R0.y, R6, R1; +MOV R1.w, R6.x; +TEX R0.y, R1.zwzw, texture[0], 2D; +MUL R1.w, R5.x, R6.y; +CMP R6.y, -R1.w, R0, R1; +MUL R0.y, R4.w, R5; +MAD R1.y, -R3, c[5].x, R5.w; +CMP R4.w, -R0.y, R1.y, R5; +MAD R6.z, -R3.x, c[5].x, R1.x; +CMP R1.x, -R0.y, R6.z, R1; +MOV R1.y, R4.w; +TEX R0.y, R1, texture[0], 2D; +MUL R5.y, R5.x, R5; +CMP R0.y, -R5, R0, R5.z; +MAD R5.z, -R4.y, c[5].y, R0.y; +CMP R5.w, -R5.y, R5.z, R0.y; +MAD R1.y, -R4, c[5], R6; +CMP R1.y, -R1.w, R1, R6; +ABS R1.w, R1.y; +SGE R1.w, R1, R4.z; +ABS R1.w, R1; +CMP R6.y, -R1.w, c[4].x, c[4].z; +ABS R0.y, R5.w; +SGE R0.y, R0, R4.z; +ABS R0.y, R0; +CMP R5.y, -R0, c[4].x, c[4].z; +ADD_SAT R0.y, R5, R6; +MUL R5.z, R5.x, R0.y; +MUL R0.y, R5.x, R6; +MAD R1.w, R3.y, c[6].x, R6.x; +CMP R6.x, -R0.y, R1.w, R6; +MAD R6.z, R3.x, c[6].x, R1; +CMP R1.z, -R0.y, R6, R1; +MOV R1.w, R6.x; +TEX R0.y, R1.zwzw, texture[0], 2D; +MUL R1.w, R5.z, R6.y; +CMP R6.y, -R1.w, R0, R1; +MUL R0.y, R5.x, R5; +MAD R1.y, -R3, c[6].x, R4.w; +CMP R4.w, -R0.y, R1.y, R4; +MAD R5.x, -R3, c[6], R1; +CMP R1.x, -R0.y, R5, R1; +MOV R1.y, R4.w; +TEX R0.y, R1, texture[0], 2D; +MUL R1.y, R5.z, R5; +CMP R5.x, -R1.y, R0.y, R5.w; +MAD R5.y, -R4, c[5], R5.x; +CMP R1.y, -R1, R5, R5.x; +MAD R0.y, -R4, c[5], R6; +CMP R0.y, -R1.w, R0, R6; +ABS R5.x, R0.y; +ABS R1.w, R1.y; +SGE R1.w, R1, R4.z; +SGE R5.x, R5, R4.z; +ABS R4.z, R5.x; +ABS R1.w, R1; +CMP R4.z, -R4, c[4].x, c[4]; +CMP R1.w, -R1, c[4].x, c[4].z; +MUL R4.z, R5, R4; +MAD R5.y, R3.x, c[6], R1.z; +CMP R5.y, -R4.z, R5, R1.z; +MAD R5.x, R3.y, c[6].y, R6; +CMP R1.z, -R4, R5.x, R6.x; +MUL R1.w, R5.z, R1; +ADD R4.z, -fragment.texcoord[0].x, R5.y; +ADD R1.z, -fragment.texcoord[0].y, R1; +CMP R1.z, -R3.w, R1, R4; +MAD R4.z, -R3.x, c[6].y, R1.x; +MAD R3.x, -R3.y, c[6].y, R4.w; +CMP R3.y, -R1.w, R4.z, R1.x; +CMP R1.x, -R1.w, R3, R4.w; +ADD R1.w, fragment.texcoord[0].x, -R3.y; +ADD R1.x, fragment.texcoord[0].y, -R1; +CMP R1.x, -R3.w, R1, R1.w; +SLT R1.w, R1.x, R1.z; +ADD R3.x, R1, R1.z; +ABS R1.w, R1; +MIN R1.x, R1, R1.z; +CMP R1.w, -R1, c[4].x, c[4].z; +MUL R1.z, R2.x, R1.w; +RCP R3.x, R3.x; +MAD R1.x, R1, -R3, c[5].y; +MUL R1.w, R4.y, c[5].y; +SLT R3.x, R1.y, c[4]; +SLT R1.y, R8, R1.w; +SLT R0.y, R0, c[4].x; +ADD R0.y, R0, -R1; +ADD R1.y, -R1, R3.x; +ABS R0.y, R0; +ABS R1.y, R1; +CMP R0.y, -R0, c[4].z, c[4].x; +CMP R1.y, -R1, c[4].z, c[4].x; +CMP R0.x, -R1.z, R0.y, R1.y; +MAD R0.y, R0.z, c[6].z, -R8; +ABS R0.x, R0; +CMP R0.x, -R0, c[4], c[4].z; +MUL R0.x, R2, R0; +CMP R0.x, -R0, c[4], R1; +RCP R0.z, R3.z; +ABS R0.y, R0; +MUL_SAT R0.y, R0, R0.z; +MUL R0.z, R0.y, c[4].w; +ADD R0.z, R0, c[6].w; +MUL R0.y, R0, R0; +MUL R0.y, R0.z, R0; +MUL R0.y, R0, R0; +MUL R0.y, R0, c[1].x; +MAX R0.x, R0, R0.y; +MAD R0.y, R0.x, R2, fragment.texcoord[0]; +MAD R0.z, R0.x, R2.y, fragment.texcoord[0].x; +CMP R0.x, -R3.w, R0.z, fragment.texcoord[0]; +CMP R0.y, -R4.x, R0, fragment.texcoord[0]; +TEX R0.xyz, R0, texture[0], 2D; +CMP R1, R2.z, R8, R9; +MOV R0.w, R8.y; +CMP result.color, -R2.x, R0, R1; +END +# 260 instructions, 10 R-regs diff --git a/code/nel/src/3d/shaders/fxaa_pp_ps_2_0.txt b/code/nel/src/3d/shaders/fxaa_pp_ps_2_0.txt new file mode 100644 index 000000000..de51eba42 --- /dev/null +++ b/code/nel/src/3d/shaders/fxaa_pp_ps_2_0.txt @@ -0,0 +1,306 @@ +ps_2_x +// cgc version 3.1.0013, build date Apr 18 2012 +// command line args: -profile ps_2_x -O3 -fastmath -fastprecision +// source file: fxaa_pp.cg +//vendor NVIDIA Corporation +//version 3.1.0.13 +//profile ps_2_x +//program fxaa_pp +//semantic fxaa_pp.fxaaQualityRcpFrame +//semantic fxaa_pp.fxaaQualitySubpix +//semantic fxaa_pp.fxaaQualityEdgeThreshold +//semantic fxaa_pp.fxaaQualityEdgeThresholdMin +//semantic fxaa_pp.nlTex0 : TEX0 +//var float2 pos : $vin.TEXCOORD0 : TEX0 : 0 : 1 +//var float2 fxaaQualityRcpFrame : : c[0] : 1 : 1 +//var float fxaaQualitySubpix : : c[1] : 2 : 1 +//var float fxaaQualityEdgeThreshold : : c[2] : 3 : 1 +//var float fxaaQualityEdgeThresholdMin : : c[3] : 4 : 1 +//var sampler2D nlTex0 : TEX0 : texunit 0 : 5 : 1 +//var float4 oCol : $vout.COLOR : COL : 6 : 1 +//const c[4] = 0 -1 1 -2 +//const c[5] = 2 0.5 0.25 1.5 +//const c[6] = 4 12 0.083333336 +//const c[7] = -2 3 +dcl_2d s0 +def c4, 0.00000000, -1.00000000, 1.00000000, -2.00000000 +def c5, 2.00000000, 0.50000000, 0.25000000, 1.50000000 +def c6, 4.00000000, 12.00000000, 0.08333334, 0 +def c7, -2.00000000, 3.00000000, 0, 0 +dcl t0.xy +mov r0.zw, c0.xyxy +mad r3.xy, c4.zxzw, r0.zwzw, t0 +texld r7, r3, s0 +texld r1, t0, s0 +mov r0.xy, c0 +mad r0.xy, c4.yxzw, r0, t0 +texld r8, r0, s0 +mov r0.xy, c0 +mad r0.xy, c4, r0, t0 +texld r9, r0, s0 +add r0.xy, t0, -c0 +texld r5, r0, s0 +mov r3.xy, c0 +mad r3.xy, c4.zyzw, r3, t0 +texld r3, r3, s0 +add r7.x, r8.y, r7.y +mad r0.z, r1.y, c4.w, r7.x +add r0.x, r5.y, r3.y +mad r0.w, r9.y, c4, r0.x +mov r0.xy, c0 +mad r0.xy, c4.xzzw, r0, t0 +texld r6, r0, s0 +add r5.x, r9.y, r6.y +abs r0.z, r0 +abs r0.w, r0 +mad r3.x, r0.z, c5, r0.w +mov r0.zw, c0.xyxy +mad r4.xy, c4.yzzw, r0.zwzw, t0 +texld r4, r4, s0 +add r0.xy, t0, c0 +texld r0, r0, s0 +add r4.x, r5.y, r4.y +add r5.y, r3, r0 +add r0.x, r4.y, r0.y +mad r0.x, r6.y, c4.w, r0 +abs r0.x, r0 +add r0.w, r0.x, r3.x +mad r0.x, r8.y, c4.w, r4 +mad r0.z, r7.y, c4.w, r5.y +mad r0.y, r1, c4.w, r5.x +abs r0.z, r0 +abs r0.y, r0 +mad r0.y, r0, c5.x, r0.z +abs r0.x, r0 +add r0.x, r0, r0.y +add r0.x, r0, -r0.w +cmp r3.y, r0.x, c4.z, c4.x +max r0.y, r6, r1 +max r0.z, r7.y, r0.y +max r0.y, r9, r8 +max r0.y, r0, r0.z +min r0.z, r6.y, r1.y +min r0.w, r7.y, r0.z +min r0.z, r9.y, r8.y +min r0.z, r0, r0.w +mul r3.x, r0.y, c2 +abs_pp r0.x, r3.y +add r4.y, r0, -r0.z +max r0.w, r3.x, c3.x +add r4.z, r4.y, -r0.w +cmp_pp r4.w, r4.z, c4.z, c4.x +mul_pp r5.w, r4, r3.y +cmp_pp r0.y, -r0.x, c4.z, c4.x +mul_pp r5.z, r4.w, r0.y +cmp_pp r3.x, -r0, c4, c4.z +cmp r6.w, -r5.z, r6.y, r7.y +cmp r7.w, -r5.z, r9.y, r8.y +add r0.z, -r1.y, r6.w +add r0.y, -r1, r7.w +abs r9.z, r0 +abs r7.y, r0 +add r0.y, r7, -r9.z +cmp r0.y, r0, c4.z, c4.x +max r7.y, r7, r9.z +mul_pp r0.z, r4.w, r0.y +cmp r0.w, -r5, c0.x, c0.y +cmp r6.x, -r0.z, r0.w, -r0.w +mov r0.z, c0.y +cmp r6.y, -r5.z, c4.x, r0.z +mad r0.w, r6.x, c5.y, t0.y +cmp r0.z, -r5.w, t0.y, r0.w +add r8.z, r0, r6.y +add r7.z, r0, -r6.y +mov r9.y, r7.z +mov r8.y, r8.z +mad r0.w, r6.x, c5.y, t0.x +mov r0.x, c0 +mul_pp r3.x, r4.w, r3 +cmp r6.z, -r3.x, c4.x, r0.x +cmp r0.x, -r5.z, t0, r0.w +add r9.x, r0, -r6.z +texld r3, r9, s0 +add r8.x, r0, r6.z +abs_pp r3.x, r0.y +texld r0, r8, s0 +cmp_pp r0.x, -r3, c4.z, c4 +add r0.w, r1.y, r6 +add r0.z, r1.y, r7.w +mul_pp r0.x, r4.w, r0 +cmp r6.w, -r0.x, r0.z, r0 +mad r7.w, -r6, c5.y, r0.y +mad r8.w, -r6, c5.y, r3.y +abs r0.y, r7.w +abs r0.x, r8.w +mad r0.x, -r7.y, c5.z, r0 +mad r0.y, -r7, c5.z, r0 +cmp r0.x, r0, c4.z, c4 +abs_pp r0.x, r0 +cmp_pp r9.z, -r0.x, c4, c4.x +cmp r0.y, r0, c4.z, c4.x +abs_pp r0.y, r0 +cmp_pp r9.w, -r0.y, c4.z, c4.x +mul_pp r0.x, r4.w, r9.z +mad r0.y, -r6, c5.w, r7.z +cmp r7.z, -r0.x, r7, r0.y +mad r0.z, -r6, c5.w, r9.x +cmp r9.x, -r0, r9, r0.z +mov r9.y, r7.z +texld r3, r9, s0 +add_pp_sat r3.z, r9, r9.w +mul_pp r0.x, r4.w, r9.w +mad r0.y, r6, c5.w, r8.z +cmp r3.x, -r0, r8.z, r0.y +mad r0.z, r6, c5.w, r8.x +mul_pp r8.z, r4.w, r3 +cmp r8.x, -r0, r8, r0.z +mov r8.y, r3.x +texld r0, r8, s0 +mul_pp r0.w, r8.z, r9 +cmp r3.z, -r0.w, r7.w, r0.y +mul_pp r0.x, r8.z, r9.z +cmp r0.y, -r0.x, r8.w, r3 +mad r0.z, -r6.w, c5.y, r0.y +cmp r8.w, -r0.x, r0.y, r0.z +mad r3.y, -r6.w, c5, r3.z +cmp r9.w, -r0, r3.z, r3.y +abs r0.y, r9.w +abs r0.x, r8.w +mad r0.y, -r7, c5.z, r0 +mad r0.x, -r7.y, c5.z, r0 +cmp r0.y, r0, c4.z, c4.x +abs_pp r0.y, r0 +cmp_pp r10.x, -r0.y, c4.z, c4 +cmp r0.x, r0, c4.z, c4 +abs_pp r0.x, r0 +cmp_pp r9.z, -r0.x, c4, c4.x +mul_pp r0.x, r8.z, r10 +mad r0.y, r6, c5.x, r3.x +cmp r7.w, -r0.x, r3.x, r0.y +mad r0.z, r6, c5.x, r8.x +cmp r8.x, -r0, r8, r0.z +mov r8.y, r7.w +texld r0, r8, s0 +mul_pp r0.w, r8.z, r9.z +mad r3.x, -r6.z, c5, r9 +mad r0.x, -r6.y, c5, r7.z +cmp r0.x, -r0.w, r7.z, r0 +add_pp_sat r0.z, r9, r10.x +mul_pp r7.z, r8, r0 +cmp r9.x, -r0.w, r9, r3 +mov r9.y, r0.x +texld r3, r9, s0 +mul_pp r0.z, r7, r9 +cmp r0.w, -r0.z, r8, r3.y +mul_pp r3.x, r7.z, r10 +cmp r3.y, -r3.x, r9.w, r0 +mad r0.y, -r6.w, c5, r0.w +cmp r8.z, -r0, r0.w, r0.y +mad r3.z, -r6.w, c5.y, r3.y +cmp r9.z, -r3.x, r3.y, r3 +abs r0.y, r8.z +abs r0.z, r9 +mad r0.y, -r7, c5.z, r0 +mad r0.z, -r7.y, c5, r0 +cmp r0.y, r0, c4.z, c4.x +abs_pp r0.y, r0 +cmp_pp r8.w, -r0.y, c4.z, c4.x +cmp r0.z, r0, c4, c4.x +abs_pp r0.z, r0 +cmp_pp r9.w, -r0.z, c4.z, c4.x +mul_pp r0.y, r7.z, r8.w +mad r0.z, -r6.y, c6.x, r0.x +cmp r10.x, -r0.y, r0, r0.z +mad r0.w, -r6.z, c6.x, r9.x +cmp r9.x, -r0.y, r9, r0.w +mov r9.y, r10.x +texld r3, r9, s0 +mul_pp r0.x, r7.z, r9.w +mad r0.z, r6, c6.x, r8.x +mad r0.y, r6, c6.x, r7.w +cmp r3.x, -r0, r7.w, r0.y +cmp r8.x, -r0, r8, r0.z +mov r8.y, r3.x +texld r0, r8, s0 +add_pp_sat r3.z, r8.w, r9.w +mul_pp r0.x, r7.z, r3.z +mul_pp r3.z, r0.x, r9.w +cmp r0.y, -r3.z, r9.z, r0 +mul_pp r0.z, r0.x, r8.w +cmp r0.w, -r0.z, r8.z, r3.y +mad r3.w, -r6, c5.y, r0.y +cmp r0.y, -r3.z, r0, r3.w +mad r3.y, -r6.w, c5, r0.w +cmp r0.z, -r0, r0.w, r3.y +abs r3.y, r0 +abs r0.w, r0.z +mad r3.y, -r7, c5.z, r3 +mad r0.w, -r7.y, c5.z, r0 +cmp r3.y, r3, c4.z, c4.x +abs_pp r3.y, r3 +cmp r0.w, r0, c4.z, c4.x +cmp_pp r3.z, -r3.y, c4, c4.x +abs_pp r0.w, r0 +cmp_pp r3.y, -r0.w, c4.z, c4.x +mul_pp r0.w, r0.x, r3.z +mul_pp r0.x, r0, r3.y +mad r3.w, r6.y, c6.y, r3.x +cmp r3.x, -r0.w, r3, r3.w +mad r3.z, r6, c6.y, r8.x +cmp r0.w, -r0, r8.x, r3.z +mad r3.y, -r6, c6, r10.x +cmp r3.y, -r0.x, r10.x, r3 +add r3.x, -t0.y, r3 +add r0.w, -t0.x, r0 +cmp r0.w, -r5.z, r0, r3.x +mad r3.x, -r6.z, c6.y, r9 +cmp r0.x, -r0, r9, r3 +add r3.x, t0.y, -r3.y +add r0.x, t0, -r0 +cmp r0.x, -r5.z, r0, r3 +add r3.x, r0, -r0.w +add r3.y, r0.x, r0.w +cmp r3.x, r3, c4, c4.z +abs_pp r3.x, r3 +min r0.x, r0, r0.w +cmp_pp r3.x, -r3, c4.z, c4 +mul_pp r0.w, r4, r3.x +rcp r3.y, r3.y +mad r0.x, r0, -r3.y, c5.y +cmp r3.y, r0, c4.x, c4.z +mad r3.x, -r6.w, c5.y, r1.y +cmp r3.x, r3, c4, c4.z +cmp r0.y, r0.z, c4.x, c4.z +add_pp r0.z, -r3.x, r3.y +add_pp r0.y, r0, -r3.x +abs_pp r0.y, r0 +abs_pp r0.z, r0 +cmp_pp r0.z, -r0, c4.x, c4 +cmp_pp r0.y, -r0, c4.x, c4.z +cmp_pp r0.y, -r0.w, r0, r0.z +abs_pp r0.y, r0 +cmp_pp r0.y, -r0, c4.z, c4.x +mul_pp r0.y, r4.w, r0 +rcp r0.w, r4.y +cmp r0.x, -r0.y, r0, c4 +add r3.y, r4.x, r5 +add r3.x, r5, r7 +mad r3.x, r3, c5, r3.y +mad r0.z, r3.x, c6, -r1.y +abs r0.z, r0 +mul_sat r0.z, r0, r0.w +mul r0.w, r0.z, r0.z +mad r0.z, r0, c7.x, c7.y +mul r0.z, r0, r0.w +mul r0.z, r0, r0 +mul r0.z, r0, c1.x +max r0.x, r0, r0.z +mad r0.y, r0.x, r6.x, t0 +mad r0.z, r0.x, r6.x, t0.x +cmp r0.x, -r5.z, t0, r0.z +cmp r0.y, -r5.w, t0, r0 +texld r0, r0, s0 +mov r0.w, r1.y +cmp r1, r4.z, r2, r1 +cmp r0, -r4.w, r1, r0 +mov oC0, r0 diff --git a/code/nel/src/3d/shaders/fxaa_vp.cg b/code/nel/src/3d/shaders/fxaa_vp.cg new file mode 100644 index 000000000..13c9c9bcb --- /dev/null +++ b/code/nel/src/3d/shaders/fxaa_vp.cg @@ -0,0 +1,20 @@ + +void fxaa_vp( + // Per vertex parameters + float3 position : POSITION, + float2 texCoord0 : TEXCOORD0, + + // Vertex program constants + uniform float4x4 modelViewProjection, + uniform float4 fxaaConsolePosPos, + + // Output position + out float4 oPosition : POSITION, + out float2 oTexCoord0 : TEXCOORD0, + out float4 oTexCoord1 : TEXCOORD1 +) +{ + oPosition = mul(modelViewProjection, float4(position, 0.0)); + oTexCoord0 = texCoord0; + oTexCoord1 = texCoord0.xyxy + fxaaConsolePosPos; +} diff --git a/code/nel/src/3d/shaders/fxaa_vp_arbvp1.txt b/code/nel/src/3d/shaders/fxaa_vp_arbvp1.txt new file mode 100644 index 000000000..6c8530ae0 --- /dev/null +++ b/code/nel/src/3d/shaders/fxaa_vp_arbvp1.txt @@ -0,0 +1,31 @@ +!!ARBvp1.0 +# cgc version 3.1.0013, build date Apr 18 2012 +# command line args: -profile arbvp1 -fastmath -fastprecision +# source file: fxaa_vp.cg +#vendor NVIDIA Corporation +#version 3.1.0.13 +#profile arbvp1 +#program fxaa_vp +#semantic fxaa_vp.modelViewProjection +#semantic fxaa_vp.fxaaConsolePosPos +#var float3 position : $vin.POSITION : POSITION : 0 : 1 +#var float2 texCoord0 : $vin.TEXCOORD0 : TEXCOORD0 : 1 : 1 +#var float4x4 modelViewProjection : : c[1], 4 : 2 : 1 +#var float4 fxaaConsolePosPos : : c[5] : 3 : 1 +#var float4 oPosition : $vout.POSITION : HPOS : 4 : 1 +#var float2 oTexCoord0 : $vout.TEXCOORD0 : TEX0 : 5 : 1 +#var float4 oTexCoord1 : $vout.TEXCOORD1 : TEX1 : 6 : 1 +#const c[0] = 0 +PARAM c[6] = { { 0 }, + program.local[1..5] }; +TEMP R0; +MOV R0.w, c[0].x; +MOV R0.xyz, vertex.position; +DP4 result.position.w, R0, c[4]; +DP4 result.position.z, R0, c[3]; +DP4 result.position.y, R0, c[2]; +DP4 result.position.x, R0, c[1]; +ADD result.texcoord[1], vertex.texcoord[0].xyxy, c[5]; +MOV result.texcoord[0].xy, vertex.texcoord[0]; +END +# 8 instructions, 1 R-regs diff --git a/code/nel/src/3d/shaders/readme.txt b/code/nel/src/3d/shaders/readme.txt new file mode 100644 index 000000000..fe657f6e5 --- /dev/null +++ b/code/nel/src/3d/shaders/readme.txt @@ -0,0 +1,4 @@ +Compiled shaders are embedded in the source. +Must compile and re-embed manually. + +FXAA is in public domain. \ No newline at end of file diff --git a/code/nel/src/3d/shadow_map_manager.cpp b/code/nel/src/3d/shadow_map_manager.cpp index 383a28184..0c9f7ba8b 100644 --- a/code/nel/src/3d/shadow_map_manager.cpp +++ b/code/nel/src/3d/shadow_map_manager.cpp @@ -244,7 +244,7 @@ void CShadowMapManager::addShadowReceiver(CTransform *model) void CShadowMapManager::renderGenerate(CScene *scene) { H_AUTO( NL3D_ShadowManager_Generate ); - + // Each frame, do a small garbage collector for unused free textures. garbageShadowTextures(scene); diff --git a/code/nel/src/3d/stereo_debugger.cpp b/code/nel/src/3d/stereo_debugger.cpp index 34a348c80..6650e1c2b 100644 --- a/code/nel/src/3d/stereo_debugger.cpp +++ b/code/nel/src/3d/stereo_debugger.cpp @@ -26,7 +26,7 @@ */ #if !FINAL_VERSION -#include +#include "std3d.h" #include // STL includes @@ -42,6 +42,7 @@ #include #include #include +#include using namespace std; // using namespace NLMISC; @@ -137,8 +138,6 @@ CStereoDebugger::CStereoDebugger() : m_Driver(NULL), m_Stage(0), m_SubStage(0), CStereoDebugger::~CStereoDebugger() { - releaseTextures(); - if (!m_Mat.empty()) { m_Driver->deleteMaterial(m_Mat); @@ -188,8 +187,6 @@ void CStereoDebugger::setDriver(NL3D::UDriver *driver) if (m_PixelProgram) { - initTextures(); - m_Mat = m_Driver->createMaterial(); m_Mat.initUnlit(); m_Mat.setColor(CRGBA::White); @@ -202,8 +199,6 @@ void CStereoDebugger::setDriver(NL3D::UDriver *driver) mat->setZFunc(CMaterial::always); mat->setDoubleSided(true); - setTextures(); - m_QuadUV.V0 = CVector(0.f, 0.f, 0.5f); m_QuadUV.V1 = CVector(1.f, 0.f, 0.5f); m_QuadUV.V2 = CVector(1.f, 1.f, 0.5f); @@ -216,6 +211,42 @@ void CStereoDebugger::setDriver(NL3D::UDriver *driver) } } +bool CStereoDebugger::attachToDisplay() +{ + return false; +} + +void CStereoDebugger::detachFromDisplay() +{ + +} + +void CStereoDebugger::getTextures() +{ + nlassert(!m_LeftTexU); + nlassert(!m_RightTexU); + uint32 width, height; + m_Driver->getWindowSize(width, height); + m_LeftTexU = m_Driver->getRenderTargetManager().getRenderTarget(width, height); + m_RightTexU = m_Driver->getRenderTargetManager().getRenderTarget(width, height); + NL3D::CMaterial *mat = m_Mat.getObjectPtr(); + mat->setTexture(0, m_LeftTexU->getITexture()); + mat->setTexture(1, m_RightTexU->getITexture()); +} + +void CStereoDebugger::recycleTextures() +{ + nlassert(m_LeftTexU); + nlassert(m_RightTexU); + m_Mat.getObjectPtr()->setTexture(0, NULL); + m_Mat.getObjectPtr()->setTexture(1, NULL); + m_Driver->getRenderTargetManager().recycleRenderTarget(m_LeftTexU); + m_Driver->getRenderTargetManager().recycleRenderTarget(m_RightTexU); + m_LeftTexU = NULL; + m_RightTexU = NULL; +} + +/* void CStereoDebugger::releaseTextures() { if (!m_Mat.empty()) @@ -233,7 +264,7 @@ void CStereoDebugger::releaseTextures() m_RightTexU = NULL; m_RightTex = NULL; // CSmartPtr } - +*//* void CStereoDebugger::initTextures() { uint32 width, height; @@ -261,15 +292,15 @@ void CStereoDebugger::initTextures() drvInternal->setupTexture(*m_RightTex); m_RightTexU = new CTextureUser(m_RightTex); nlassert(!drvInternal->isTextureRectangle(m_RightTex)); // not allowed -} - +}*/ +/* void CStereoDebugger::setTextures() { NL3D::CMaterial *mat = m_Mat.getObjectPtr(); mat->setTexture(0, m_LeftTex); mat->setTexture(1, m_RightTex); -} - +}*/ +/* void CStereoDebugger::verifyTextures() { if (m_Driver) @@ -287,7 +318,7 @@ void CStereoDebugger::verifyTextures() setTextures(); } } -} +}*/ /// Gets the required screen resolution for this device bool CStereoDebugger::getScreenResolution(uint &width, uint &height) @@ -307,6 +338,12 @@ void CStereoDebugger::getClippingFrustum(uint cid, NL3D::UCamera *camera) const // do nothing } +/// Get the original frustum of the camera +void CStereoDebugger::getOriginalFrustum(uint cid, NL3D::UCamera *camera) const +{ + // do nothing, as we never modified it +} + /// Is there a next pass bool CStereoDebugger::nextPass() { @@ -388,6 +425,12 @@ bool CStereoDebugger::wantScene() return m_Stage != 3; } +/// The 3D scene end (after multiple wantScene) +bool CStereoDebugger::wantSceneEffects() +{ + return m_Stage != 3; +} + /// Interface within the 3D scene bool CStereoDebugger::wantInterface3D() { @@ -402,11 +445,22 @@ bool CStereoDebugger::wantInterface2D() return m_Stage == 3; } +bool CStereoDebugger::isSceneFirst() +{ + return m_Stage != 3; +} + +bool CStereoDebugger::isSceneLast() +{ + return m_Stage != 3; +} + /// Returns true if a new render target was set, always fase if not using render targets bool CStereoDebugger::beginRenderTarget() { if (m_Stage != 3 && m_Driver && (m_Driver->getPolygonMode() == UDriver::Filled)) { + if (!m_LeftTexU) getTextures(); if (m_Stage % 2) static_cast(m_Driver)->setRenderTarget(*m_RightTexU, 0, 0, 0, 0); else static_cast(m_Driver)->setRenderTarget(*m_LeftTexU, 0, 0, 0, 0); return true; @@ -430,14 +484,15 @@ bool CStereoDebugger::endRenderTarget() uint32 width, height; NL3D::IDriver *drvInternal = (static_cast(m_Driver))->getDriver(); NL3D::CMaterial *mat = m_Mat.getObjectPtr(); - mat->setTexture(0, m_LeftTex); - mat->setTexture(1, m_RightTex); + mat->setTexture(0, m_LeftTexU->getITexture()); + mat->setTexture(1, m_RightTexU->getITexture()); drvInternal->activePixelProgram(m_PixelProgram); m_Driver->drawQuad(m_QuadUV, m_Mat); drvInternal->activePixelProgram(NULL); m_Driver->enableFog(fogEnabled); + recycleTextures(); return true; } diff --git a/code/nel/src/3d/stereo_display.cpp b/code/nel/src/3d/stereo_display.cpp index eace867fc..2a79c1039 100644 --- a/code/nel/src/3d/stereo_display.cpp +++ b/code/nel/src/3d/stereo_display.cpp @@ -25,7 +25,7 @@ * . */ -#include +#include "std3d.h" #include // STL includes @@ -35,6 +35,7 @@ // Project includes #include +#include #include #include diff --git a/code/nel/src/3d/stereo_hmd.cpp b/code/nel/src/3d/stereo_hmd.cpp index d28017482..25249e2b4 100644 --- a/code/nel/src/3d/stereo_hmd.cpp +++ b/code/nel/src/3d/stereo_hmd.cpp @@ -25,7 +25,7 @@ * . */ -#include +#include "std3d.h" #include // STL includes diff --git a/code/nel/src/3d/stereo_libvr.cpp b/code/nel/src/3d/stereo_libvr.cpp index 44a5a0a5a..c655f959c 100644 --- a/code/nel/src/3d/stereo_libvr.cpp +++ b/code/nel/src/3d/stereo_libvr.cpp @@ -27,7 +27,7 @@ #ifdef HAVE_LIBVR -#include +#include "std3d.h" #include #include diff --git a/code/nel/src/3d/stereo_ovr.cpp b/code/nel/src/3d/stereo_ovr.cpp index 402d9b2d0..073490dc0 100644 --- a/code/nel/src/3d/stereo_ovr.cpp +++ b/code/nel/src/3d/stereo_ovr.cpp @@ -41,15 +41,16 @@ * so, delete this exception statement from your version. */ -#ifdef HAVE_LIBOVR +#ifdef HAVE_LIBOVR_02 -#include +#include "std3d.h" #include // STL includes #include // External includes +#define OVR_NO_STDINT #include // NeL includes @@ -169,7 +170,7 @@ public: OVR::HMDInfo HMDInfo; }; -CStereoOVR::CStereoOVR(const CStereoOVRDeviceHandle *handle) : m_Stage(0), m_SubStage(0), m_OrientationCached(false), m_Driver(NULL), m_BarrelTexU(NULL), m_PixelProgram(NULL), m_EyePosition(0.0f, 0.09f, 0.15f), m_Scale(1.0f) +CStereoOVR::CStereoOVR(const CStereoOVRDeviceHandle *handle) : m_Stage(0), m_SubStage(0), m_OrientationCached(false), m_Driver(NULL), m_SceneTexture(NULL), m_GUITexture(NULL), m_PixelProgram(NULL), m_EyePosition(0.0f, 0.09f, 0.15f), m_Scale(1.0f) { ++s_DeviceCounter; m_DevicePtr = new CStereoOVRDevicePtr(); @@ -213,9 +214,6 @@ CStereoOVR::~CStereoOVR() m_BarrelMat.getObjectPtr()->setTexture(0, NULL); m_Driver->deleteMaterial(m_BarrelMat); } - delete m_BarrelTexU; - m_BarrelTexU = NULL; - m_BarrelTex = NULL; // CSmartPtr delete m_PixelProgram; m_PixelProgram = NULL; @@ -340,7 +338,7 @@ void CStereoOVR::setDriver(NL3D::UDriver *driver) { m_Driver = driver; - m_BarrelTex = new CTextureBloom(); // lol bloom + /*m_BarrelTex = new CTextureBloom(); // lol bloom m_BarrelTex->setRenderTarget(true); m_BarrelTex->setReleasable(false); m_BarrelTex->resize(m_DevicePtr->HMDInfo.HResolution, m_DevicePtr->HMDInfo.VResolution); @@ -348,7 +346,7 @@ void CStereoOVR::setDriver(NL3D::UDriver *driver) m_BarrelTex->setWrapS(ITexture::Clamp); m_BarrelTex->setWrapT(ITexture::Clamp); drvInternal->setupTexture(*m_BarrelTex); - m_BarrelTexU = new CTextureUser(m_BarrelTex); + m_BarrelTexU = new CTextureUser(m_BarrelTex);*/ m_BarrelMat = m_Driver->createMaterial(); m_BarrelMat.initUnlit(); @@ -361,7 +359,7 @@ void CStereoOVR::setDriver(NL3D::UDriver *driver) barrelMat->setZWrite(false); barrelMat->setZFunc(CMaterial::always); barrelMat->setDoubleSided(true); - barrelMat->setTexture(0, m_BarrelTex); + // barrelMat->setTexture(0, m_BarrelTex); m_BarrelQuadLeft.V0 = CVector(0.f, 0.f, 0.5f); m_BarrelQuadLeft.V1 = CVector(0.5f, 0.f, 0.5f); @@ -373,7 +371,7 @@ void CStereoOVR::setDriver(NL3D::UDriver *driver) m_BarrelQuadRight.V2 = CVector(1.f, 1.f, 0.5f); m_BarrelQuadRight.V3 = CVector(0.5f, 1.f, 0.5f); - nlassert(!drvInternal->isTextureRectangle(m_BarrelTex)); // not allowed + // nlassert(!drvInternal->isTextureRectangle(m_BarrelTex)); // not allowed m_BarrelQuadLeft.Uv0 = CUV(0.f, 0.f); m_BarrelQuadLeft.Uv1 = CUV(0.5f, 0.f); @@ -400,6 +398,8 @@ bool CStereoOVR::getScreenResolution(uint &width, uint &height) void CStereoOVR::initCamera(uint cid, const NL3D::UCamera *camera) { + m_OriginalFrustum[cid] = camera->getFrustum(); + float ar = (float)m_DevicePtr->HMDInfo.HResolution / ((float)m_DevicePtr->HMDInfo.VResolution * 2.0f); float fov = 2.0f * atanf((m_DevicePtr->HMDInfo.HScreenSize * 0.5f * 0.5f) / (m_DevicePtr->HMDInfo.EyeToScreenDistance)); //(float)NLMISC::Pi/2.f; // 2.0f * atanf(m_DevicePtr->HMDInfo.VScreenSize / 2.0f * m_DevicePtr->HMDInfo.EyeToScreenDistance); m_LeftFrustum[cid].initPerspective(fov, ar, camera->getFrustum().Near, camera->getFrustum().Far); @@ -427,6 +427,12 @@ void CStereoOVR::getClippingFrustum(uint cid, NL3D::UCamera *camera) const camera->setFrustum(m_ClippingFrustum[cid]); } +/// Get the original frustum of the camera +void CStereoOVR::getOriginalFrustum(uint cid, NL3D::UCamera *camera) const +{ + camera->setFrustum(m_OriginalFrustum[cid]); +} + void CStereoOVR::updateCamera(uint cid, const NL3D::UCamera *camera) { if (camera->getFrustum().Near != m_LeftFrustum[cid].Near @@ -440,53 +446,59 @@ bool CStereoOVR::nextPass() // Do not allow weird stuff. uint32 width, height; m_Driver->getWindowSize(width, height); - nlassert(width == m_DevicePtr->HMDInfo.HResolution); - nlassert(height == m_DevicePtr->HMDInfo.VResolution); + // nlassert(width == m_DevicePtr->HMDInfo.HResolution); + // nlassert(height == m_DevicePtr->HMDInfo.VResolution); if (m_Driver->getPolygonMode() == UDriver::Filled) { - switch (m_Stage) + switch (m_Stage) // Previous stage { case 0: + m_Stage += 2; + m_SubStage = 0; + // stage 2: + // draw interface 2d (onto render target) + return true; + case 2: ++m_Stage; m_SubStage = 0; - // stage 1: + // stage 3: // (initBloom) // clear buffer // draw scene left return true; - case 1: + case 3: ++m_Stage; m_SubStage = 0; - // stage 2: + // stage 4: // draw scene right return true; - case 2: + case 4: ++m_Stage; m_SubStage = 0; - // stage 3: + // stage 5: // (endBloom) // draw interface 3d left return true; - case 3: + case 5: ++m_Stage; m_SubStage = 0; - // stage 4: + // stage 6: // draw interface 3d right return true; - case 4: + /*case 6: ++m_Stage; m_SubStage = 0; - // stage 5: + // stage 7: // (endInterfacesDisplayBloom) // draw interface 2d left return true; - case 5: + case 7: ++m_Stage; m_SubStage = 0; - // stage 6: + // stage 8: // draw interface 2d right - return true; + return true;*/ case 6: m_Stage = 0; m_SubStage = 0; @@ -518,26 +530,30 @@ bool CStereoOVR::nextPass() const NL3D::CViewport &CStereoOVR::getCurrentViewport() const { - if (m_Stage % 2) return m_LeftViewport; + if (m_Stage == 2) return m_RegularViewport; + else if (m_Stage % 2) return m_LeftViewport; else return m_RightViewport; } const NL3D::CFrustum &CStereoOVR::getCurrentFrustum(uint cid) const { - if (m_Stage % 2) return m_LeftFrustum[cid]; + if (m_Stage == 2) return m_OriginalFrustum[cid]; + else if (m_Stage % 2) return m_LeftFrustum[cid]; else return m_RightFrustum[cid]; } void CStereoOVR::getCurrentFrustum(uint cid, NL3D::UCamera *camera) const { - if (m_Stage % 2) camera->setFrustum(m_LeftFrustum[cid]); + if (m_Stage == 2) camera->setFrustum(m_OriginalFrustum[cid]); + else if (m_Stage % 2) camera->setFrustum(m_LeftFrustum[cid]); else camera->setFrustum(m_RightFrustum[cid]); } void CStereoOVR::getCurrentMatrix(uint cid, NL3D::UCamera *camera) const { CMatrix translate; - if (m_Stage % 2) translate.translate(CVector((m_DevicePtr->HMDInfo.InterpupillaryDistance * m_Scale) * -0.5f, 0.f, 0.f)); + if (m_Stage == 2) { } + else if (m_Stage % 2) translate.translate(CVector((m_DevicePtr->HMDInfo.InterpupillaryDistance * m_Scale) * -0.5f, 0.f, 0.f)); else translate.translate(CVector((m_DevicePtr->HMDInfo.InterpupillaryDistance * m_Scale) * 0.5f, 0.f, 0.f)); CMatrix mat = m_CameraMatrix[cid] * translate; if (camera->getTransformMode() == NL3D::UTransformable::RotQuat) @@ -556,7 +572,7 @@ bool CStereoOVR::wantClear() { switch (m_Stage) { - case 1: + case 3: m_SubStage = 1; return true; } @@ -567,8 +583,8 @@ bool CStereoOVR::wantScene() { switch (m_Stage) { - case 1: - case 2: + case 3: + case 4: m_SubStage = 2; return true; } @@ -579,8 +595,8 @@ bool CStereoOVR::wantInterface3D() { switch (m_Stage) { - case 3: - case 4: + case 5: + case 6: m_SubStage = 3; return true; } @@ -591,37 +607,225 @@ bool CStereoOVR::wantInterface2D() { switch (m_Stage) { - case 5: - case 6: + case 2: m_SubStage = 4; return true; } return m_Driver->getPolygonMode() != UDriver::Filled; } - /// Returns non-NULL if a new render target was set bool CStereoOVR::beginRenderTarget() { // render target always set before driver clear // nlassert(m_SubStage <= 1); - if (m_Driver && m_Stage == 1 && (m_Driver->getPolygonMode() == UDriver::Filled)) + + // Set GUI render target + if (m_Driver && m_Stage == 2 && (m_Driver->getPolygonMode() == UDriver::Filled)) { - static_cast(m_Driver)->setRenderTarget(*m_BarrelTexU, 0, 0, 0, 0); + nlassert(!m_GUITexture); + uint32 width, height; + m_Driver->getWindowSize(width, height); + m_GUITexture = m_Driver->getRenderTargetManager().getRenderTarget(width, height, true, UTexture::RGBA8888); + static_cast(m_Driver)->setRenderTarget(*m_GUITexture); + m_Driver->clearBuffers(NLMISC::CRGBA(0, 0, 0, 0)); return true; } + + // Begin 3D scene render target + if (m_Driver && m_Stage == 3 && (m_Driver->getPolygonMode() == UDriver::Filled)) + { + nlassert(!m_SceneTexture); + uint32 width, height; + m_Driver->getWindowSize(width, height); // Temporary limitation, TODO: scaling! + m_SceneTexture = m_Driver->getRenderTargetManager().getRenderTarget(width, height); + static_cast(m_Driver)->setRenderTarget(*m_SceneTexture); + return true; + } + return false; } +void CStereoOVR::setInterfaceMatrix(const NL3D::CMatrix &matrix) +{ + m_InterfaceCameraMatrix = matrix; +} + +void CStereoOVR::renderGUI() +{ + + /*CMatrix mat; + mat.translate(m_InterfaceCameraMatrix.getPos()); + CVector dir = m_InterfaceCameraMatrix.getJ(); + dir.z = 0; + dir.normalize(); + if (dir.y < 0) + mat.rotateZ(float(NLMISC::Pi+asin(dir.x))); + else + mat.rotateZ(float(NLMISC::Pi+NLMISC::Pi-asin(dir.x))); + m_Driver->setModelMatrix(mat);*/ + m_Driver->setModelMatrix(m_InterfaceCameraMatrix); + + { + NLMISC::CLine line(NLMISC::CVector(0, 5, 2), NLMISC::CVector(0, 5, 3)); + + NL3D::UMaterial mat = m_Driver->createMaterial(); + mat.setZWrite(false); + // mat.setZFunc(UMaterial::always); // Not nice! + mat.setDoubleSided(true); + mat.setColor(NLMISC::CRGBA::Red); + mat.setBlend(false); + + m_Driver->drawLine(line, mat); + + m_Driver->deleteMaterial(mat); + } + + { + nlassert(m_GUITexture); + + NLMISC::CQuadUV quad; + + NL3D::UMaterial umat = m_Driver->createMaterial(); + umat.initUnlit(); + umat.setColor(NLMISC::CRGBA::White); + umat.setDoubleSided(true); + umat.setBlend(true); + umat.setAlphaTest(false); + NL3D::CMaterial *mat = umat.getObjectPtr(); + mat->setShader(NL3D::CMaterial::Normal); + mat->setBlendFunc(CMaterial::one, CMaterial::TBlend::invsrcalpha); + mat->setZWrite(false); + // mat->setZFunc(CMaterial::always); // Not nice + mat->setDoubleSided(true); + mat->setTexture(0, m_GUITexture->getITexture()); + + // user options + float scale = 1.0f; + float distance = 1.5f; + float offcenter = 0.75f; + + float height = scale * distance * 2.0f; + + uint32 winw, winh; + m_Driver->getWindowSize(winw, winh); + float width = height * (float)winw / (float)winh; + + float bottom = -(height * 0.5f); + float top = (height * 0.5f); + + NLMISC::CQuadUV quadUV; + quadUV.V0 = CVector(-(width * 0.5f), distance, -(height * 0.5f)); + quadUV.V1 = CVector((width * 0.5f), distance, -(height * 0.5f)); + quadUV.V2 = CVector((width * 0.5f), distance, (height * 0.5f)); + quadUV.V3 = CVector(-(width * 0.5f), distance, (height * 0.5f)); + quadUV.Uv0 = CUV(0.f, 0.f); + quadUV.Uv1 = CUV(1.f, 0.f); + quadUV.Uv2 = CUV(1.f, 1.f); + quadUV.Uv3 = CUV(0.f, 1.f); + + const uint nbQuads = 128; + static CVertexBuffer vb; + static CIndexBuffer ib; + + vb.setVertexFormat(CVertexBuffer::PositionFlag | CVertexBuffer::TexCoord0Flag); + vb.setPreferredMemory(CVertexBuffer::RAMVolatile, false); + vb.setNumVertices((nbQuads + 1) * 2); + + { + CVertexBufferReadWrite vba; + vb.lock(vba); + float radius = distance + offcenter; + float relWidth = width / radius; + float quadWidth = relWidth / (float)nbQuads; + for (uint i = 0; i < nbQuads + 1; ++i) + { + uint vi0 = i * 2; + uint vi1 = vi0 + 1; + float lineH = -(relWidth * 0.5f) + quadWidth * (float)i; + float lineUV = (float)i / (float)(nbQuads); + float left = sin(lineH) * radius; + float forward = cos(lineH) * radius; + vba.setVertexCoord(vi0, left, forward - offcenter, bottom); + vba.setTexCoord(vi0, 0, lineUV, 0.0f); + vba.setVertexCoord(vi1, left, forward - offcenter, top); + vba.setTexCoord(vi1, 0, lineUV, 1.0f); + } + } + + ib.setFormat(NL_DEFAULT_INDEX_BUFFER_FORMAT); + ib.setPreferredMemory(CIndexBuffer::RAMVolatile, false); + ib.setNumIndexes(nbQuads * 6); + + { + CIndexBufferReadWrite iba; + ib.lock(iba); + for (uint i = 0; i < nbQuads; ++i) + { + uint ti0 = i * 2; + uint ti1 = ti0 + 1; + uint bl = ti0; + uint tl = ti0 + 1; + uint br = ti0 + 2; + uint tr = ti0 + 3; + iba.setTri(ti0 * 3, bl, tl, br); + iba.setTri(ti1 * 3, br, tl, tr); + } + } + + IDriver *driver = static_cast(m_Driver)->getDriver(); + // m_Driver->setPolygonMode(UDriver::Line); + driver->activeVertexBuffer(vb); + driver->activeIndexBuffer(ib); + driver->renderTriangles(*umat.getObjectPtr(), 0, nbQuads * 2); //renderRawQuads(umat, 0, 128); + // m_Driver->setPolygonMode(UDriver::Filled); + + // m_Driver->drawQuad(quadUV, umat); + + m_Driver->deleteMaterial(umat); + } +} + /// Returns true if a render target was fully drawn bool CStereoOVR::endRenderTarget() { // after rendering of course // nlassert(m_SubStage > 1); + + // End GUI render target + if (m_Driver && m_Stage == 2 && (m_Driver->getPolygonMode() == UDriver::Filled)) + { + // End GUI render target + nlassert(m_GUITexture); + CTextureUser texNull; + (static_cast(m_Driver))->setRenderTarget(texNull); + } + + // End of 3D Interface pass left + if (m_Driver && m_Stage == 5 && (m_Driver->getPolygonMode() == UDriver::Filled)) + { + // Render 2D GUI in 3D space, assume existing camera is OK + renderGUI(); + } + + // End of 3D Interface pass right + if (m_Driver && m_Stage == 6 && (m_Driver->getPolygonMode() == UDriver::Filled)) + { + // Render 2D GUI in 3D space, assume existing camera is OK + renderGUI(); + + // Recycle render target + m_Driver->getRenderTargetManager().recycleRenderTarget(m_GUITexture); + m_GUITexture = NULL; + } + + // End 3D scene render target if (m_Driver && m_Stage == 6 && (m_Driver->getPolygonMode() == UDriver::Filled)) // set to 4 to turn off distortion of 2d gui { - CTextureUser cu; - (static_cast(m_Driver))->setRenderTarget(cu); + nlassert(m_SceneTexture); + + CTextureUser texNull; + (static_cast(m_Driver))->setRenderTarget(texNull); bool fogEnabled = m_Driver->fogEnabled(); m_Driver->enableFog(false); @@ -632,7 +836,7 @@ bool CStereoOVR::endRenderTarget() m_Driver->getWindowSize(width, height); NL3D::IDriver *drvInternal = (static_cast(m_Driver))->getDriver(); NL3D::CMaterial *barrelMat = m_BarrelMat.getObjectPtr(); - barrelMat->setTexture(0, m_BarrelTex); + barrelMat->setTexture(0, m_SceneTexture->getITexture()); drvInternal->activePixelProgram(m_PixelProgram); @@ -697,8 +901,13 @@ bool CStereoOVR::endRenderTarget() drvInternal->activePixelProgram(NULL); m_Driver->enableFog(fogEnabled); + // Recycle render target + m_Driver->getRenderTargetManager().recycleRenderTarget(m_SceneTexture); + m_SceneTexture = NULL; + return true; } + return false; } diff --git a/code/nel/src/3d/stereo_ovr_04.cpp b/code/nel/src/3d/stereo_ovr_04.cpp new file mode 100644 index 000000000..121855fb8 --- /dev/null +++ b/code/nel/src/3d/stereo_ovr_04.cpp @@ -0,0 +1,1312 @@ +/** + * \file stereo_ovr.cpp + * \brief CStereoOVR + * \date 2014-08-04 16:21GMT + * \author Jan Boon (Kaetemi) + * CStereoOVR + */ + +/* + * Copyright (C) 2014 by authors + * + * This file is part of NL3D. + * NL3D is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * NL3D is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General + * Public License for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with NL3D. If not, see + * . + * + * Linking this library statically or dynamically with other modules + * is making a combined work based on this library. Thus, the terms + * and conditions of the GNU General Public License cover the whole + * combination. + * + * As a special exception, the copyright holders of this library give + * you permission to link this library with the Oculus SDK to produce + * an executable, regardless of the license terms of the Oculus SDK, + * and distribute linked combinations including the two, provided that + * you also meet the terms and conditions of the license of the Oculus + * SDK. You must obey the GNU General Public License in all respects + * for all of the code used other than the Oculus SDK. If you modify + * this file, you may extend this exception to your version of the + * file, but you are not obligated to do so. If you do not wish to do + * so, delete this exception statement from your version. + */ + +#ifdef HAVE_LIBOVR + +#include "std3d.h" +#include + +// STL includes +#include + +// External includes +#define OVR_NO_STDINT +#include + +// NeL includes +// #include +#include +#include +#include +#include +#include +#include +#include + +// Project includes + +using namespace std; +// using namespace NLMISC; + +namespace NL3D { + +namespace { + +#include "stereo_ovr_04_program.h" + +class CStereoOVRSystem +{ +public: + CStereoOVRSystem() : m_InitOk(false) + { + + } + + ~CStereoOVRSystem() + { + if (m_InitOk) + { + nlwarning("OVR: Not all resources were released before exit"); + Release(); + } + } + + bool Init() + { + if (!m_InitOk) + { + nldebug("OVR: Initialize"); + m_InitOk = ovr_Initialize(); + nlassert(m_InitOk); + } + + return m_InitOk; + } + + void Release() + { + if (m_InitOk) + { + nldebug("OVR: Release"); + ovr_Shutdown(); + m_InitOk = false; + } + } + +private: + bool m_InitOk; + +}; + +CStereoOVRSystem s_StereoOVRSystem; + +sint s_DeviceCounter = 0; +uint s_DetectId = 0; + +} + +class CStereoOVRDeviceFactory : public IStereoDeviceFactory +{ +public: + uint DeviceIndex; + uint DetectId; + + bool DebugDevice; + ovrHmdType DebugDeviceType; + + IStereoDisplay *createDevice() const + { + CStereoOVR *stereo = new CStereoOVR(this); + if (stereo->isDeviceCreated()) + return stereo; + delete stereo; + return NULL; + } +}; + +static NLMISC::CVector2f toTex(NLMISC::CVector2f texCoord, NLMISC::CVector2f uvScaleOffset[2]) +{ + // return(EyeToSourceUVScale * flattened + EyeToSourceUVOffset); + NLMISC::CVector2f vec = NLMISC::CVector2f(texCoord.x * uvScaleOffset[0].x, texCoord.y * uvScaleOffset[0].y) + uvScaleOffset[1]; + // some trial and error voodoo, sorry + vec = (vec + NLMISC::CVector2f(1, 1)) * 0.5f; + vec.y = 1.0f - vec.y; + vec.x = 1.0f - vec.x; + vec.x += 0.5f; + vec.y *= 2.0f; + + vec.x = 1.0f - vec.x; + + return vec; +} + +static float lerp(float f0, float f1, float factor) +{ + return (f1 * factor) + (f0 * (1.0f - factor)); +} + +CStereoOVR::CStereoOVR(const CStereoOVRDeviceFactory *factory) : m_DevicePtr(NULL), m_Stage(0), m_SubStage(0), m_OrientationCached(false), m_Driver(NULL), m_SceneTexture(NULL), m_GUITexture(NULL), m_EyePosition(0.0f, 0.09f, 0.15f), m_Scale(1.0f), m_AttachedDisplay(false) +{ + nlctassert(NL_OVR_EYE_COUNT == ovrEye_Count); + + if (factory->DetectId != s_DetectId) + { + nlwarning("OVR: Previous device info structures become invalid after listing devices"); + return; + } + + m_DebugDevice = factory->DebugDevice; + if (factory->DebugDevice) m_DevicePtr = ovrHmd_CreateDebug(factory->DebugDeviceType); + else m_DevicePtr = ovrHmd_Create(factory->DeviceIndex); + + if (!m_DevicePtr) + { + nlwarning("OVR: Device not created"); + return; + } + + ++s_DeviceCounter; + + // nldebug("OVR: HScreenSize: %f, VScreenSize: %f", m_DevicePtr->HMDInfo.HScreenSize, m_DevicePtr->HMDInfo.VScreenSize); // No more support for physically non-square pixels? + // nldebug("OVR: VScreenCenter: %f", m_DevicePtr->HMDInfo.VScreenCenter); + // nldebug("OVR: EyeToScreenDistance: %f", m_DevicePtr->HMDInfo.EyeToScreenDistance); + // nldebug("OVR: LensSeparationDistance: %f", m_DevicePtr->HMDInfo.LensSeparationDistance); + // nldebug("OVR: InterpupillaryDistance: %f", m_DevicePtr->HMDInfo.InterpupillaryDistance); + nldebug("OVR: Resolution.w: %i, Resolution.h: %i", m_DevicePtr->Resolution.w, m_DevicePtr->Resolution.h); + // nldebug("OVR: DistortionK[0]: %f, DistortionK[1]: %f", m_DevicePtr->HMDInfo.DistortionK[0], m_DevicePtr->HMDInfo.DistortionK[1]); + // nldebug("OVR: DistortionK[2]: %f, DistortionK[3]: %f", m_DevicePtr->HMDInfo.DistortionK[2], m_DevicePtr->HMDInfo.DistortionK[3]); + + if (!ovrHmd_ConfigureTracking(m_DevicePtr, + ovrTrackingCap_Orientation | ovrTrackingCap_MagYawCorrection, // | ovrTrackingCap_Position + ovrTrackingCap_Orientation)) + { + nlwarning("OVR: Cannot configure tracking"); + ovrHmd_Destroy(m_DevicePtr); + m_DevicePtr = NULL; + --s_DeviceCounter; + return; + } + + float nativeWidth = m_DevicePtr->Resolution.w; + float nativeHeight = m_DevicePtr->Resolution.h; + + // get render descriptions for default fov + ovrEyeRenderDesc eyeRenderDesc[ovrEye_Count]; + eyeRenderDesc[ovrEye_Left] = ovrHmd_GetRenderDesc(m_DevicePtr, ovrEye_Left, m_DevicePtr->DefaultEyeFov[ovrEye_Left]); + eyeRenderDesc[ovrEye_Right] = ovrHmd_GetRenderDesc(m_DevicePtr, ovrEye_Right, m_DevicePtr->DefaultEyeFov[ovrEye_Right]); + nldebug("OVR: LEFT DistortedViewport: x: %i, y: %i, w: %i, h: %i", eyeRenderDesc[0].DistortedViewport.Pos.x, eyeRenderDesc[0].DistortedViewport.Pos.y, eyeRenderDesc[0].DistortedViewport.Size.w, eyeRenderDesc[0].DistortedViewport.Size.h); + nldebug("OVR: LEFT PixelsPerTanAngleAtCenter: x: %f, y: %f ", eyeRenderDesc[0].PixelsPerTanAngleAtCenter.x, eyeRenderDesc[0].PixelsPerTanAngleAtCenter.y); + nldebug("OVR: LEFT ViewAdjust: x: %f, y: %f, z: %f ", eyeRenderDesc[0].ViewAdjust.x, eyeRenderDesc[0].ViewAdjust.y, eyeRenderDesc[0].ViewAdjust.z); + nldebug("OVR: RIGHT DistortedViewport: x: %i, y: %i, w: %i, h: %i", eyeRenderDesc[1].DistortedViewport.Pos.x, eyeRenderDesc[1].DistortedViewport.Pos.y, eyeRenderDesc[1].DistortedViewport.Size.w, eyeRenderDesc[1].DistortedViewport.Size.h); + nldebug("OVR: RIGHT PixelsPerTanAngleAtCenter: x: %f, y: %f ", eyeRenderDesc[1].PixelsPerTanAngleAtCenter.x, eyeRenderDesc[1].PixelsPerTanAngleAtCenter.y); + nldebug("OVR: RIGHT ViewAdjust: x: %f, y: %f, z: %f ", eyeRenderDesc[1].ViewAdjust.x, eyeRenderDesc[1].ViewAdjust.y, eyeRenderDesc[1].ViewAdjust.z); + + // 2014/08/04 19:54:25 DBG a60 snowballs_client.exe stereo_ovr_04.cpp 171 NL3D::CStereoOVR::CStereoOVR : OVR: Resolution.w: 1280, Resolution.h: 800 + // 2014/08/04 19:54:25 DBG a60 snowballs_client.exe stereo_ovr_04.cpp 189 NL3D::CStereoOVR::CStereoOVR : OVR: LEFT DistortedViewport: x: 0, y: 0, w: 640, h: 800 + // 2014/08/04 19:54:25 DBG a60 snowballs_client.exe stereo_ovr_04.cpp 190 NL3D::CStereoOVR::CStereoOVR : OVR: LEFT PixelsPerTanAngleAtCenter: x: 363.247864, y: 363.247864 + // 2014/08/04 19:54:25 DBG a60 snowballs_client.exe stereo_ovr_04.cpp 191 NL3D::CStereoOVR::CStereoOVR : OVR: LEFT ViewAdjust: x: 0.031800, y: 0.000000, z: 0.000000 + // 2014/08/04 19:55:46 DBG 2e18 snowballs_client.exe stereo_ovr_04.cpp 192 NL3D::CStereoOVR::CStereoOVR : OVR: RIGHT DistortedViewport: x: 640, y: 0, w: 640, h: 800 + // 2014/08/04 19:55:46 DBG 2e18 snowballs_client.exe stereo_ovr_04.cpp 193 NL3D::CStereoOVR::CStereoOVR : OVR: RIGHT PixelsPerTanAngleAtCenter: x: 363.247864, y: 363.247864 + // 2014/08/04 19:55:46 DBG 2e18 snowballs_client.exe stereo_ovr_04.cpp 194 NL3D::CStereoOVR::CStereoOVR : OVR: RIGHT ViewAdjust: x: -0.031868, y: 0.000000, z: 0.000000 + + // find out the recommended render target size + ovrSizei fovTextureSize[ovrEye_Count]; + fovTextureSize[ovrEye_Left] = ovrHmd_GetFovTextureSize(m_DevicePtr, ovrEye_Left, eyeRenderDesc[ovrEye_Left].Fov, 1.0f); + fovTextureSize[ovrEye_Right] = ovrHmd_GetFovTextureSize(m_DevicePtr, ovrEye_Right, eyeRenderDesc[ovrEye_Right].Fov, 1.0f); + m_RenderTargetWidth = fovTextureSize[ovrEye_Left].w + fovTextureSize[ovrEye_Right].w; + m_RenderTargetHeight = max(fovTextureSize[ovrEye_Left].h, fovTextureSize[ovrEye_Right].h); + nldebug("OVR: RenderTarget: w: %u, h: %u", m_RenderTargetWidth, m_RenderTargetHeight); + + // 2014/08/04 20:22:03 DBG 30e4 snowballs_client.exe stereo_ovr_04.cpp 213 NL3D::CStereoOVR::CStereoOVR : OVR: RenderTarget: w: 2414, h: 1870 // That looks a bit excessive... + + for (uint eye = 0; eye < ovrEye_Count; ++eye) + { + ovrFovPort &fov = eyeRenderDesc[eye].Fov; + + // store data + m_EyeViewAdjustX[eye] = -eyeRenderDesc[eye].ViewAdjust.x; + + // setup viewport + m_EyeViewport[eye].init( + (float)eyeRenderDesc[eye].DistortedViewport.Pos.x / nativeWidth, + (float)eyeRenderDesc[eye].DistortedViewport.Pos.y / nativeHeight, + (float)eyeRenderDesc[eye].DistortedViewport.Size.w / nativeWidth, + (float)eyeRenderDesc[eye].DistortedViewport.Size.h / nativeHeight); + nldebug("OVR: EyeViewport: x: %f, y: %f, w: %f, h: %f", m_EyeViewport[eye].getX(), m_EyeViewport[eye].getY(), m_EyeViewport[eye].getWidth(), m_EyeViewport[eye].getHeight()); + ovrRecti eyeViewport; + eyeViewport.Pos.x = (eyeRenderDesc[eye].DistortedViewport.Pos.x * m_RenderTargetWidth) / m_DevicePtr->Resolution.w; + eyeViewport.Pos.y = (eyeRenderDesc[eye].DistortedViewport.Pos.y * m_RenderTargetHeight) / m_DevicePtr->Resolution.h; + eyeViewport.Size.w = (eyeRenderDesc[eye].DistortedViewport.Size.w * m_RenderTargetWidth) / m_DevicePtr->Resolution.w; + eyeViewport.Size.h = (eyeRenderDesc[eye].DistortedViewport.Size.h * m_RenderTargetHeight) / m_DevicePtr->Resolution.h; + + // calculate hfov and ar + /*float combinedTanHalfFovHorizontal = max(fov.LeftTan, fov.RightTan); + float combinedTanHalfFovVertical = max(fov.UpTan, fov.DownTan); + float horizontalFullFovInRadians = 2.0f * atanf (combinedTanHalfFovHorizontal); + float aspectRatio = combinedTanHalfFovHorizontal / combinedTanHalfFovVertical; + float m_EyeHFov[NL_OVR_EYE_COUNT]; + float m_EyeAR[NL_OVR_EYE_COUNT]; + m_EyeHFov[eye] = horizontalFullFovInRadians; + m_EyeAR[eye] = aspectRatio; + nldebug("OVR: HFOV: %f, AR: %f", horizontalFullFovInRadians, aspectRatio); + m_EyeFrustumBase[eye].initPerspective(m_EyeHFov[eye], m_EyeAR[eye], 1.0f, 100.f); + nldebug("OVR: FOV: Left: %f, Right: %f, Down: %f, Up: %f", // DOUBLE CHECK + m_EyeFrustumBase[eye].Left, m_EyeFrustumBase[eye].Right, m_EyeFrustumBase[eye].Bottom, m_EyeFrustumBase[eye].Top);*/ + m_EyeFrustumBase[eye].init( + -fov.LeftTan, // OVR provides positive values + fov.RightTan, // DEBUG: If renders shifted left and right, swap left and right + -fov.DownTan, + fov.UpTan, // DEBUG: If renders shifted up or down, swap down and up + 1.0f, // dummy + 100.f, // dummy + true); + nldebug("OVR: FOV: Left: %f, Right: %f, Down: %f, Up: %f", + m_EyeFrustumBase[eye].Left, m_EyeFrustumBase[eye].Right, m_EyeFrustumBase[eye].Bottom, m_EyeFrustumBase[eye].Top); + + // get distortion mesh + ovrDistortionMesh meshData; + ovrHmd_CreateDistortionMesh(m_DevicePtr, (ovrEyeType)eye, fov, + ovrDistortionCap_Chromatic /*| ovrDistortionCap_TimeWarp*/ | ovrDistortionCap_Vignette, // I believe the timewarp gimmick screws with parallax + &meshData); + ovrVector2f uvScaleOffset[2]; + + // get parameters for programs + ovrHmd_GetRenderScaleAndOffset(fov, + fovTextureSize[eye], eyeViewport, + (ovrVector2f *)uvScaleOffset); + m_EyeUVScaleOffset[eye][0] = NLMISC::CVector2f(uvScaleOffset[0].x, uvScaleOffset[0].y); + m_EyeUVScaleOffset[eye][1] = NLMISC::CVector2f(uvScaleOffset[1].x, uvScaleOffset[1].y); + + // chroma bugfix + float chromaFactor = 1.00f; + if (m_DevicePtr->Type == ovrHmd_DK2) + chromaFactor = 0.75f; + + // create distortion mesh vertex buffer + m_VB[eye].setVertexFormat(CVertexBuffer::PositionFlag | CVertexBuffer::TexCoord0Flag | CVertexBuffer::TexCoord1Flag | CVertexBuffer::TexCoord2Flag | CVertexBuffer::PrimaryColorFlag); + m_VB[eye].setPreferredMemory(CVertexBuffer::StaticPreferred, true); + m_VB[eye].setNumVertices(meshData.VertexCount); + { + CVertexBufferReadWrite vba; + m_VB[eye].lock(vba); + for (uint i = 0; i < meshData.VertexCount; ++i) + { + ovrDistortionVertex &ov = meshData.pVertexData[i]; + vba.setVertexCoord(i, (ov.ScreenPosNDC.x + 1.0f) * 0.5f, (ov.ScreenPosNDC.y + 1.0f) * 0.5f, 0.5f); + NLMISC::CVector2f texR( + lerp(ov.TanEyeAnglesG.x, ov.TanEyeAnglesR.x, chromaFactor), + lerp(ov.TanEyeAnglesG.y, ov.TanEyeAnglesR.y, chromaFactor)); + NLMISC::CVector2f texG(ov.TanEyeAnglesG.x, ov.TanEyeAnglesG.y); + NLMISC::CVector2f texB( + lerp(ov.TanEyeAnglesG.x, ov.TanEyeAnglesB.x, chromaFactor), + lerp(ov.TanEyeAnglesG.y, ov.TanEyeAnglesB.y, chromaFactor)); + texR = toTex(texR, m_EyeUVScaleOffset[eye]); + texG = toTex(texG, m_EyeUVScaleOffset[eye]); + texB = toTex(texB, m_EyeUVScaleOffset[eye]); + vba.setTexCoord(i, 0, texR.x, texR.y); + vba.setTexCoord(i, 1, texG.x, texG.y); + vba.setTexCoord(i, 2, texB.x, texB.y); + NLMISC::CRGBA color; + color.R = color.G = color.B = (uint8)(ov.VignetteFactor * 255.99f); + color.A = 255; // (uint8)(ov.TimeWarpFactor * 255.99f); + vba.setColor(i, color); + } + } + + // create distortion mesh index buffer + m_IB[eye].setFormat(NL_DEFAULT_INDEX_BUFFER_FORMAT); + m_IB[eye].setPreferredMemory(CIndexBuffer::StaticPreferred, true); + m_IB[eye].setNumIndexes(meshData.IndexCount); + { + CIndexBufferReadWrite iba; + m_IB[eye].lock(iba); + for (uint i = 0; i + 2 < meshData.IndexCount; i += 3) + { + nlassert(meshData.pIndexData[i] < meshData.VertexCount); + nlassert(meshData.pIndexData[i + 1] < meshData.VertexCount); + nlassert(meshData.pIndexData[i + 2] < meshData.VertexCount); + iba.setTri(i, meshData.pIndexData[i], meshData.pIndexData[i + 1], meshData.pIndexData[i + 2]); + } + } + + // set tri count + m_NbTris[eye] = meshData.IndexCount / 3; + + // destroy ovr distortion mesh + ovrHmd_DestroyDistortionMesh(&meshData); + } + + // 2014/08/04 20:22:03 DBG 30e4 snowballs_client.exe stereo_ovr_04.cpp 222 NL3D::CStereoOVR::CStereoOVR : OVR: EyeViewport: x: 0.000000, y: 0.000000, w: 0.500000, h: 1.000000 + // 2014/08/04 22:28:39 DBG 3040 snowballs_client.exe stereo_ovr_04.cpp 235 NL3D::CStereoOVR::CStereoOVR : OVR: HFOV: 2.339905, AR: 0.916641 + // 2014/08/04 20:22:03 DBG 30e4 snowballs_client.exe stereo_ovr_04.cpp 222 NL3D::CStereoOVR::CStereoOVR : OVR: EyeViewport: x: 0.500000, y: 0.000000, w: 0.500000, h: 1.000000 + // 2014/08/04 22:28:39 DBG 3040 snowballs_client.exe stereo_ovr_04.cpp 235 NL3D::CStereoOVR::CStereoOVR : OVR: HFOV: 2.339905, AR: 0.916641 + + ovrHmd_RecenterPose(m_DevicePtr); + + // DEBUG EARLY EXIT + /*nldebug("OVR: Early exit"); + ovrHmd_Destroy(m_DevicePtr); + m_DevicePtr = NULL; + --s_DeviceCounter;*/ +} + +CStereoOVR::~CStereoOVR() +{ + if (m_AttachedDisplay) + { + detachFromDisplay(); + } + + if (!m_UnlitMat.empty()) + { + m_Driver->deleteMaterial(m_UnlitMat); + } + + m_Driver = NULL; + + if (m_DevicePtr) + { + ovrHmd_Destroy(m_DevicePtr); + m_DevicePtr = NULL; + --s_DeviceCounter; + } +} + +void CStereoOVR::setDriver(NL3D::UDriver *driver) +{ + m_Driver = driver; + + CDriverUser *dru = static_cast(driver); + IDriver *drv = dru->getDriver(); + + m_UnlitMat = m_Driver->createMaterial(); + m_UnlitMat.initUnlit(); + m_UnlitMat.setColor(CRGBA::White); + m_UnlitMat.setBlend (false); + m_UnlitMat.setAlphaTest (false); + NL3D::CMaterial *unlitMat = m_UnlitMat.getObjectPtr(); + unlitMat->setShader(NL3D::CMaterial::Normal); + unlitMat->setBlendFunc(CMaterial::one, CMaterial::zero); + unlitMat->setZWrite(false); + unlitMat->setZFunc(CMaterial::always); + unlitMat->setDoubleSided(true); + + unlitMat->texConstantColor(0, NLMISC::CRGBA(255, 0, 0, 0)); + unlitMat->texConstantColor(1, NLMISC::CRGBA(0, 255, 0, 0)); + unlitMat->texConstantColor(2, NLMISC::CRGBA(0, 0, 255, 0)); + + m_UnlitMat.texEnvArg0RGB(0, UMaterial::Texture, UMaterial::SrcColor); + m_UnlitMat.texEnvArg1RGB(0, UMaterial::Constant, UMaterial::SrcColor); + m_UnlitMat.texEnvOpRGB(0, UMaterial::Modulate); + + m_UnlitMat.texEnvArg0RGB(1, UMaterial::Texture, UMaterial::SrcColor); + m_UnlitMat.texEnvArg1RGB(1, UMaterial::Constant, UMaterial::SrcColor); + m_UnlitMat.texEnvArg2RGB(1, UMaterial::Previous, UMaterial::SrcColor); + m_UnlitMat.texEnvOpRGB(1, UMaterial::Mad); + + m_UnlitMat.texEnvArg0RGB(2, UMaterial::Texture, UMaterial::SrcColor); + m_UnlitMat.texEnvArg1RGB(2, UMaterial::Constant, UMaterial::SrcColor); + m_UnlitMat.texEnvArg2RGB(2, UMaterial::Previous, UMaterial::SrcColor); + m_UnlitMat.texEnvOpRGB(2, UMaterial::Mad); + + m_UnlitMat.texEnvArg0RGB(3, UMaterial::Previous, UMaterial::SrcColor); + m_UnlitMat.texEnvArg1RGB(3, UMaterial::Diffuse, UMaterial::SrcColor); + m_UnlitMat.texEnvOpRGB(3, UMaterial::Modulate); +} + +bool CStereoOVR::getScreenResolution(uint &width, uint &height) +{ + if (m_DevicePtr) + { + width = m_DevicePtr->Resolution.w; + height = m_DevicePtr->Resolution.h; + return true; + } + return false; +} + +bool CStereoOVR::attachToDisplay() +{ + nldebug("OVR: Attach to display '%s'", m_DevicePtr->DisplayDeviceName); + + if (m_DebugDevice) + return false; + + if (!m_AttachedDisplay) + { + m_Driver->getCurrentScreenMode(m_OriginalMode); + m_Driver->getWindowPos(m_OriginalWinPosX, m_OriginalWinPosY); + } + +#if defined(NL_OS_WINDOWS) + if ((m_DevicePtr->HmdCaps & ovrHmdCap_ExtendDesktop) != ovrHmdCap_ExtendDesktop) + { + nldebug("OVR: Direct Rift"); + CDriverUser *dru = static_cast(m_Driver); + IDriver *drv = dru->getDriver(); + m_AttachedDisplay = ovrHmd_AttachToWindow(m_DevicePtr, (void *)drv->getDisplay(), NULL, NULL); + if (!m_AttachedDisplay) + nlwarning("OVR: Direct Rift failed!"); + } + else +#endif + { + nldebug("OVR: Extended Rift"); + UDriver::CMode mode; + mode.DisplayDevice = m_DevicePtr->DisplayDeviceName; + mode.Windowed = false; + mode.Width = m_DevicePtr->Resolution.w; + mode.Height = m_DevicePtr->Resolution.h; + m_Driver->setMode(mode); + m_AttachedDisplay = true; + } + + return m_AttachedDisplay; +} + +void CStereoOVR::detachFromDisplay() +{ + /*if (!m_OriginalMode.Windowed) + { + m_OriginalMode.Windowed = true; + m_Driver->setMode(m_OriginalMode); + m_OriginalMode.Windowed = false; + }*/ + m_Driver->setMode(m_OriginalMode); + m_Driver->setWindowPos(m_OriginalWinPosX, m_OriginalWinPosY); + m_AttachedDisplay = false; +} + +void CStereoOVR::initCamera(uint cid, const NL3D::UCamera *camera) +{ + m_OriginalFrustum[cid] = camera->getFrustum(); + + /*m_LeftFrustum[cid] = m_OriginalFrustum[cid]; + m_RightFrustum[cid] = m_OriginalFrustum[cid]; + m_ClippingFrustum[cid] = m_OriginalFrustum[cid]; + return;*/ + + m_LeftFrustum[cid].init( + m_EyeFrustumBase[ovrEye_Left].Left * camera->getFrustum().Near, + m_EyeFrustumBase[ovrEye_Left].Right * camera->getFrustum().Near, + m_EyeFrustumBase[ovrEye_Left].Bottom * camera->getFrustum().Near, + m_EyeFrustumBase[ovrEye_Left].Top * camera->getFrustum().Near, + camera->getFrustum().Near, + camera->getFrustum().Far, + true); + + m_RightFrustum[cid].init( + m_EyeFrustumBase[ovrEye_Right].Left * camera->getFrustum().Near, + m_EyeFrustumBase[ovrEye_Right].Right * camera->getFrustum().Near, + m_EyeFrustumBase[ovrEye_Right].Bottom * camera->getFrustum().Near, + m_EyeFrustumBase[ovrEye_Right].Top * camera->getFrustum().Near, + camera->getFrustum().Near, + camera->getFrustum().Far, + true); + + m_ClippingFrustum[cid].init( + min(m_EyeFrustumBase[ovrEye_Left].Left, m_EyeFrustumBase[ovrEye_Right].Left) * camera->getFrustum().Near, + max(m_EyeFrustumBase[ovrEye_Left].Right, m_EyeFrustumBase[ovrEye_Right].Right) * camera->getFrustum().Near, + min(m_EyeFrustumBase[ovrEye_Left].Bottom, m_EyeFrustumBase[ovrEye_Right].Bottom) * camera->getFrustum().Near, + max(m_EyeFrustumBase[ovrEye_Left].Top, m_EyeFrustumBase[ovrEye_Right].Top) * camera->getFrustum().Near, + camera->getFrustum().Near, + camera->getFrustum().Far, + true); +} + +/// Get the frustum to use for clipping +void CStereoOVR::getClippingFrustum(uint cid, NL3D::UCamera *camera) const +{ + camera->setFrustum(m_ClippingFrustum[cid]); +} + +/// Get the original frustum of the camera +void CStereoOVR::getOriginalFrustum(uint cid, NL3D::UCamera *camera) const +{ + camera->setFrustum(m_OriginalFrustum[cid]); +} + +void CStereoOVR::updateCamera(uint cid, const NL3D::UCamera *camera) +{ + if (camera->getFrustum().Near != m_LeftFrustum[cid].Near + || camera->getFrustum().Far != m_LeftFrustum[cid].Far) + CStereoOVR::initCamera(cid, camera); + m_CameraMatrix[cid] = camera->getMatrix(); +} + +bool CStereoOVR::nextPass() +{ + if (m_Driver->getPolygonMode() == UDriver::Filled) + { + switch (m_Stage) // Previous stage + { + case 0: + m_Stage += 2; + m_SubStage = 0; + // stage 2: + // draw interface 2d (onto render target) + return true; + case 2: + ++m_Stage; + m_SubStage = 0; + // stage 3: + // (initBloom) + // clear buffer + // draw scene left + return true; + case 3: + ++m_Stage; + m_SubStage = 0; + // stage 4: + // draw scene right + return true; + case 4: + ++m_Stage; + m_SubStage = 0; + // stage 5: + // (endBloom) + // draw interface 3d left + return true; + case 5: + ++m_Stage; + m_SubStage = 0; + // stage 6: + // draw interface 3d right + return true; + /*case 6: + ++m_Stage; + m_SubStage = 0; + // stage 7: + // (endInterfacesDisplayBloom) + // draw interface 2d left + return true; + case 7: + ++m_Stage; + m_SubStage = 0; + // stage 8: + // draw interface 2d right + return true;*/ + case 6: + m_Stage = 0; + m_SubStage = 0; + // present + m_OrientationCached = false; + return false; + } + } + else + { + switch (m_Stage) + { + case 0: + ++m_Stage; + m_SubStage = 0; + return true; + case 1: + m_Stage = 0; + m_SubStage = 0; + return false; + } + } + nlerror("Invalid stage"); + m_Stage = 0; + m_SubStage = 0; + m_OrientationCached = false; + return false; +} + +const NL3D::CViewport &CStereoOVR::getCurrentViewport() const +{ + if (m_Stage == 2) return m_RegularViewport; + else if (m_Stage % 2) return m_EyeViewport[ovrEye_Left]; + else return m_EyeViewport[ovrEye_Right]; +} + +const NL3D::CFrustum &CStereoOVR::getCurrentFrustum(uint cid) const +{ + if (m_Stage == 2) return m_OriginalFrustum[cid]; + else if (m_Stage % 2) return m_LeftFrustum[cid]; + else return m_RightFrustum[cid]; +} + +void CStereoOVR::getCurrentFrustum(uint cid, NL3D::UCamera *camera) const +{ + if (m_Stage == 2) camera->setFrustum(m_OriginalFrustum[cid]); + else if (m_Stage % 2) camera->setFrustum(m_LeftFrustum[cid]); + else camera->setFrustum(m_RightFrustum[cid]); +} + +void CStereoOVR::getCurrentMatrix(uint cid, NL3D::UCamera *camera) const +{ + CMatrix translate; + if (m_Stage == 2) { } + else if (m_Stage % 2) translate.translate(CVector(m_EyeViewAdjustX[ovrEye_Left] * m_Scale, 0.f, 0.f)); // ok + else translate.translate(CVector(m_EyeViewAdjustX[ovrEye_Right] * m_Scale, 0.f, 0.f)); // ok + CMatrix mat = m_CameraMatrix[cid] * translate; + if (camera->getTransformMode() == NL3D::UTransformable::RotQuat) + { + camera->setPos(mat.getPos()); + camera->setRotQuat(mat.getRot()); + } + else + { + // camera->setTransformMode(NL3D::UTransformable::DirectMatrix); + camera->setMatrix(mat); + } +} + +bool CStereoOVR::wantClear() +{ + switch (m_Stage) + { + case 3: + m_SubStage = 1; + return true; + } + return m_Driver->getPolygonMode() != UDriver::Filled; +} + +bool CStereoOVR::wantScene() +{ + switch (m_Stage) + { + case 3: + case 4: + m_SubStage = 2; + return true; + } + return m_Driver->getPolygonMode() != UDriver::Filled; +} + +bool CStereoOVR::wantSceneEffects() +{ + switch (m_Stage) + { + case 4: + return true; + } + return m_Driver->getPolygonMode() != UDriver::Filled; +} + +bool CStereoOVR::wantInterface3D() +{ + switch (m_Stage) + { + case 5: + case 6: + m_SubStage = 3; + return true; + } + return m_Driver->getPolygonMode() != UDriver::Filled; +} + +bool CStereoOVR::wantInterface2D() +{ + switch (m_Stage) + { + case 2: + m_SubStage = 4; + return true; + } + return m_Driver->getPolygonMode() != UDriver::Filled; +} + +bool CStereoOVR::isSceneFirst() +{ + switch (m_Stage) + { + case 3: + return true; + case 4: + return false; + } + return m_Driver->getPolygonMode() != UDriver::Filled; +} + +bool CStereoOVR::isSceneLast() +{ + switch (m_Stage) + { + case 3: + return false; + case 4: + return true; + } + return m_Driver->getPolygonMode() != UDriver::Filled; +} + +/// Returns non-NULL if a new render target was set +bool CStereoOVR::beginRenderTarget() +{ + // render target always set before driver clear + // nlassert(m_SubStage <= 1); + + // Set GUI render target + if (m_Driver && m_Stage == 2 && (m_Driver->getPolygonMode() == UDriver::Filled)) + { + nlassert(!m_GUITexture); + uint32 width, height; + m_Driver->getWindowSize(width, height); + m_GUITexture = m_Driver->getRenderTargetManager().getRenderTarget(width, height, true, UTexture::RGBA8888); + static_cast(m_Driver)->setRenderTarget(*m_GUITexture); + m_Driver->clearBuffers(NLMISC::CRGBA(0, 0, 0, 0)); + return true; + } + + // Begin 3D scene render target + if (m_Driver && m_Stage == 3 && (m_Driver->getPolygonMode() == UDriver::Filled)) + { + nlassert(!m_SceneTexture); + m_SceneTexture = m_Driver->getRenderTargetManager().getRenderTarget(m_RenderTargetWidth, m_RenderTargetHeight); + static_cast(m_Driver)->setRenderTarget(*m_SceneTexture); + return true; + /*nldebug("OVR: Begin render target");*/ + //m_Driver->beginDefaultRenderTarget(m_RenderTargetWidth, m_RenderTargetHeight); // DEBUG + //return true; + } + + return false; +} + +void CStereoOVR::setInterfaceMatrix(const NL3D::CMatrix &matrix) +{ + m_InterfaceCameraMatrix = matrix; +} + +void CStereoOVR::renderGUI() +{ + m_Driver->setModelMatrix(m_InterfaceCameraMatrix); +/* + { + NLMISC::CLine line(NLMISC::CVector(0, 5, 2), NLMISC::CVector(0, 5, 3)); + + NL3D::UMaterial mat = m_Driver->createMaterial(); + mat.setZWrite(false); + // mat.setZFunc(UMaterial::always); // Not nice! + mat.setDoubleSided(true); + mat.setColor(NLMISC::CRGBA::Red); + mat.setBlend(false); + + m_Driver->drawLine(line, mat); + + m_Driver->deleteMaterial(mat); + } + + { + NL3D::UMaterial mat = m_Driver->createMaterial(); + mat.setZWrite(false); + mat.setZFunc(UMaterial::always); // Not nice! + mat.setDoubleSided(true); + mat.setBlend(false); + NLMISC::CLine line; + + mat.setColor(NLMISC::CRGBA::Red); + line = NLMISC::CLine(NLMISC::CVector(0, 3, -3), NLMISC::CVector(0, 3, 3)); // YPos + m_Driver->drawLine(line, mat); + + mat.setColor(NLMISC::CRGBA::Green); + line = NLMISC::CLine(NLMISC::CVector(3, 0, -3), NLMISC::CVector(3, 0, 3)); // XPos + m_Driver->drawLine(line, mat); + + mat.setColor(NLMISC::CRGBA::Magenta); + line = NLMISC::CLine(NLMISC::CVector(0, -3, -3), NLMISC::CVector(0, -3, 3)); // YNeg + m_Driver->drawLine(line, mat); + + mat.setColor(NLMISC::CRGBA::Cyan); + line = NLMISC::CLine(NLMISC::CVector(-3, 0, -3), NLMISC::CVector(-3, 0, 3)); // XNeg + m_Driver->drawLine(line, mat); + + mat.setColor(NLMISC::CRGBA::Blue); + line = NLMISC::CLine(NLMISC::CVector(0, -3, 3), NLMISC::CVector(0, 3, 3)); // ZPos + m_Driver->drawLine(line, mat); + + mat.setColor(NLMISC::CRGBA::Blue); + line = NLMISC::CLine(NLMISC::CVector(0, -3, -3), NLMISC::CVector(0, 3, -3)); // ZNeg + m_Driver->drawLine(line, mat); + + m_Driver->deleteMaterial(mat); + } + */ + { + nlassert(m_GUITexture); + + NLMISC::CQuadUV quad; + + NL3D::UMaterial umat = m_Driver->createMaterial(); + umat.initUnlit(); + umat.setColor(NLMISC::CRGBA::White); + umat.setDoubleSided(true); + umat.setBlend(true); + umat.setAlphaTest(false); + NL3D::CMaterial *mat = umat.getObjectPtr(); + mat->setShader(NL3D::CMaterial::Normal); + mat->setBlendFunc(CMaterial::one, CMaterial::invsrcalpha); + mat->setZWrite(false); + // mat->setZFunc(CMaterial::always); // Not nice + mat->setDoubleSided(true); + mat->setTexture(0, m_GUITexture->getITexture()); + + // user options + float scale = 1.0f; + float distance = 1.5f; + float offcenter = 0.75f; + + float height = scale * distance * 2.0f; + + uint32 winw, winh; + m_Driver->getWindowSize(winw, winh); + float width = height * (float)winw / (float)winh; + + float bottom = -(height * 0.5f); + float top = (height * 0.5f); + + NLMISC::CQuadUV quadUV; + quadUV.V0 = CVector(-(width * 0.5f), distance, -(height * 0.5f)); + quadUV.V1 = CVector((width * 0.5f), distance, -(height * 0.5f)); + quadUV.V2 = CVector((width * 0.5f), distance, (height * 0.5f)); + quadUV.V3 = CVector(-(width * 0.5f), distance, (height * 0.5f)); + quadUV.Uv0 = CUV(0.f, 0.f); + quadUV.Uv1 = CUV(1.f, 0.f); + quadUV.Uv2 = CUV(1.f, 1.f); + quadUV.Uv3 = CUV(0.f, 1.f); + + const uint nbQuads = 128; + static CVertexBuffer vb; + static CIndexBuffer ib; + + vb.setVertexFormat(CVertexBuffer::PositionFlag | CVertexBuffer::TexCoord0Flag); + vb.setPreferredMemory(CVertexBuffer::RAMVolatile, false); + vb.setNumVertices((nbQuads + 1) * 2); + + { + CVertexBufferReadWrite vba; + vb.lock(vba); + float radius = distance + offcenter; + float relWidth = width / radius; + float quadWidth = relWidth / (float)nbQuads; + for (uint i = 0; i < nbQuads + 1; ++i) + { + uint vi0 = i * 2; + uint vi1 = vi0 + 1; + float lineH = -(relWidth * 0.5f) + quadWidth * (float)i; + float lineUV = (float)i / (float)(nbQuads); + float left = sin(lineH) * radius; + float forward = cos(lineH) * radius; + vba.setVertexCoord(vi0, left, forward - offcenter, bottom); + vba.setTexCoord(vi0, 0, lineUV, 0.0f); + vba.setVertexCoord(vi1, left, forward - offcenter, top); + vba.setTexCoord(vi1, 0, lineUV, 1.0f); + } + } + + ib.setFormat(NL_DEFAULT_INDEX_BUFFER_FORMAT); + ib.setPreferredMemory(CIndexBuffer::RAMVolatile, false); + ib.setNumIndexes(nbQuads * 6); + + { + CIndexBufferReadWrite iba; + ib.lock(iba); + for (uint i = 0; i < nbQuads; ++i) + { + uint ti0 = i * 2; + uint ti1 = ti0 + 1; + uint bl = ti0; + uint tl = ti0 + 1; + uint br = ti0 + 2; + uint tr = ti0 + 3; + iba.setTri(ti0 * 3, bl, tl, br); + iba.setTri(ti1 * 3, br, tl, tr); + } + } + + IDriver *driver = static_cast(m_Driver)->getDriver(); + // m_Driver->setPolygonMode(UDriver::Line); + driver->activeVertexBuffer(vb); + driver->activeIndexBuffer(ib); + driver->renderTriangles(*umat.getObjectPtr(), 0, nbQuads * 2); //renderRawQuads(umat, 0, 128); + // m_Driver->setPolygonMode(UDriver::Filled); + + // m_Driver->drawQuad(quadUV, umat); + + m_Driver->deleteMaterial(umat); + + /*{ + // nldebug("Render GUI lines"); + NL3D::UMaterial rmat = m_Driver->createMaterial(); + rmat.setZWrite(false); + rmat.setZFunc(UMaterial::always); // Not nice! + rmat.setDoubleSided(true); + rmat.setColor(NLMISC::CRGBA::Red); + rmat.setBlend(false); + + m_Driver->setPolygonMode(UDriver::Line); + driver->activeVertexBuffer(vb); + driver->activeIndexBuffer(ib); + driver->renderTriangles(*rmat.getObjectPtr(), 0, nbQuads * 2); + m_Driver->setPolygonMode(UDriver::Filled); + + m_Driver->deleteMaterial(rmat); + }*/ + } +} + +/// Returns true if a render target was fully drawn +bool CStereoOVR::endRenderTarget() +{ + // after rendering of course + // nlassert(m_SubStage > 1); + + // End GUI render target + if (m_Driver && m_Stage == 2 && (m_Driver->getPolygonMode() == UDriver::Filled)) + { + // End GUI render target + nlassert(m_GUITexture); + CTextureUser texNull; + (static_cast(m_Driver))->setRenderTarget(texNull); + } + + // End of 3D Interface pass left + if (m_Driver && m_Stage == 5 && (m_Driver->getPolygonMode() == UDriver::Filled)) + { + // Render 2D GUI in 3D space, assume existing camera is OK + renderGUI(); + } + + // End of 3D Interface pass right + if (m_Driver && m_Stage == 6 && (m_Driver->getPolygonMode() == UDriver::Filled)) + { + // Render 2D GUI in 3D space, assume existing camera is OK + renderGUI(); + + // Recycle render target + m_Driver->getRenderTargetManager().recycleRenderTarget(m_GUITexture); + m_GUITexture = NULL; + } + + // End 3D scene render target + if (m_Driver && m_Stage == 6 && (m_Driver->getPolygonMode() == UDriver::Filled)) + { + nlassert(m_SceneTexture); + + //nldebug("OVR: End render target"); + // m_Driver->endDefaultRenderTarget(NULL); // DEBUG + + // end render target + CTextureUser texNull; + (static_cast(m_Driver))->setRenderTarget(texNull); + + // backup + bool fogEnabled = m_Driver->fogEnabled(); + m_Driver->enableFog(false); + + // must clear everything to black (can we get a mesh to only handle the parts outside of the distortion mesh?) + m_Driver->clearRGBABuffer(CRGBA(0, 0, 0, 255)); + + CDriverUser *dru = static_cast(m_Driver); + IDriver *drv = dru->getDriver(); + + // set matrix mode + CViewport vp; + m_Driver->setViewport(vp); + m_Driver->setMatrixMode2D11(); + + for (uint eye = 0; eye < ovrEye_Count; ++eye) + { + CMaterial *mat = m_UnlitMat.getObjectPtr(); + mat->setTexture(0, m_SceneTexture->getITexture()); + mat->setTexture(1, m_SceneTexture->getITexture()); + mat->setTexture(2, m_SceneTexture->getITexture()); + mat->setTexture(3, m_SceneTexture->getITexture()); + + //m_Driver->setPolygonMode(UDriver::Line); + drv->activeVertexBuffer(m_VB[eye]); + drv->activeIndexBuffer(m_IB[eye]); + drv->renderTriangles(*mat, 0, m_NbTris[eye]); + //m_Driver->setPolygonMode(UDriver::Filled); + + mat->setTexture(0, NULL); + mat->setTexture(1, NULL); + mat->setTexture(2, NULL); + mat->setTexture(3, NULL); + } + + // restore + m_Driver->enableFog(fogEnabled); + + // recycle render target + m_Driver->getRenderTargetManager().recycleRenderTarget(m_SceneTexture); + m_SceneTexture = NULL; + + return true; + } + + /*if (m_Driver && m_Stage == 6 && (m_Driver->getPolygonMode() == UDriver::Filled)) // set to 4 to turn off distortion of 2d gui + { + nlassert(m_SceneTexture); + + CTextureUser texNull; + (static_cast(m_Driver))->setRenderTarget(texNull); + bool fogEnabled = m_Driver->fogEnabled(); + m_Driver->enableFog(false); + + m_Driver->setMatrixMode2D11(); + CViewport vp = CViewport(); + m_Driver->setViewport(vp); + uint32 width, height; + m_Driver->getWindowSize(width, height); + NL3D::IDriver *drvInternal = (static_cast(m_Driver))->getDriver(); + NL3D::CMaterial *barrelMat = m_BarrelMat.getObjectPtr(); + barrelMat->setTexture(0, m_SceneTexture->getITexture()); + + drvInternal->activePixelProgram(m_PixelProgram); + + float w = float(m_BarrelQuadLeft.V1.x),// / float(width), + h = float(m_BarrelQuadLeft.V2.y),// / float(height), + x = float(m_BarrelQuadLeft.V0.x),/// / float(width), + y = float(m_BarrelQuadLeft.V0.y);// / float(height); + + float lensOffset = m_DevicePtr->HMDInfo.LensSeparationDistance * 0.5f; + float lensShift = m_DevicePtr->HMDInfo.HScreenSize * 0.25f - lensOffset; + float lensViewportShift = 4.0f * lensShift / m_DevicePtr->HMDInfo.HScreenSize; + + float lensCenterX = x + (w + lensViewportShift * 0.5f) * 0.5f; + float lensCenterY = y + h * 0.5f; + float screenCenterX = x + w * 0.5f; + float screenCenterY = y + h * 0.5f; + float scaleX = (w / 2); + float scaleY = (h / 2); + float scaleInX = (2 / w); + float scaleInY = (2 / h); + + + drvInternal->setUniform2f(IDriver::PixelProgram, + m_PixelProgram->ovrIndices().LensCenter, + lensCenterX, lensCenterY); + + drvInternal->setUniform2f(IDriver::PixelProgram, + m_PixelProgram->ovrIndices().ScreenCenter, + screenCenterX, screenCenterY); + + drvInternal->setUniform2f(IDriver::PixelProgram, + m_PixelProgram->ovrIndices().Scale, + scaleX, scaleY); + + drvInternal->setUniform2f(IDriver::PixelProgram, + m_PixelProgram->ovrIndices().ScaleIn, + scaleInX, scaleInY); + + + drvInternal->setUniform4fv(IDriver::PixelProgram, + m_PixelProgram->ovrIndices().HmdWarpParam, + 1, m_DevicePtr->HMDInfo.DistortionK); + + m_Driver->drawQuad(m_BarrelQuadLeft, m_BarrelMat); + + x = w; + lensCenterX = x + (w - lensViewportShift * 0.5f) * 0.5f; + screenCenterX = x + w * 0.5f; + + + drvInternal->setUniform2f(IDriver::PixelProgram, + m_PixelProgram->ovrIndices().LensCenter, + lensCenterX, lensCenterY); + + drvInternal->setUniform2f(IDriver::PixelProgram, + m_PixelProgram->ovrIndices().ScreenCenter, + screenCenterX, screenCenterY); + + + m_Driver->drawQuad(m_BarrelQuadRight, m_BarrelMat); + + drvInternal->activePixelProgram(NULL); + m_Driver->enableFog(fogEnabled); + + // Recycle render target + m_Driver->getRenderTargetManager().recycleRenderTarget(m_SceneTexture); + m_SceneTexture = NULL; + + return true; + }*/ + + return false; +} + +NLMISC::CQuat CStereoOVR::getOrientation() const +{ + // broken + + /*NLMISC::CQuat quat; + quat.identity(); + return quat;*/ + + if (m_OrientationCached) + return m_OrientationCache; + + ovrTrackingState ts = ovrHmd_GetTrackingState(m_DevicePtr, ovr_GetTimeInSeconds()); // TODO: Predict forward + if (ts.StatusFlags & ovrStatus_OrientationTracked) + { + // get just the orientation + ovrQuatf quatovr = ts.HeadPose.ThePose.Orientation; + NLMISC::CMatrix coordsys; + float csys[] = { + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, -1.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f, + }; + coordsys.set(csys); + NLMISC::CMatrix matovr; + matovr.setRot(NLMISC::CQuat(quatovr.x, quatovr.y, quatovr.z, quatovr.w)); + NLMISC::CMatrix matr; + // matr.rotateZ(NLMISC::Pi); // uncomment when backwards ... + matr.rotateX(NLMISC::Pi * 0.5f); // fix this properly... :) (note: removing this allows you to use rift while lying down) + NLMISC::CMatrix matnel = matr * matovr * coordsys; + NLMISC::CQuat finalquat = matnel.getRot(); + m_OrientationCache = finalquat; + m_OrientationCached = true; + return finalquat; + } + else + { + if (!m_DebugDevice) + nlwarning("OVR: No orientation returned"); + // return old orientation + m_OrientationCached = true; + return m_OrientationCache; + } +} + +/// Get GUI shift +void CStereoOVR::getInterface2DShift(uint cid, float &x, float &y, float distance) const +{ + +} + +void CStereoOVR::setEyePosition(const NLMISC::CVector &v) +{ + m_EyePosition = v; +} + +const NLMISC::CVector &CStereoOVR::getEyePosition() const +{ + return m_EyePosition; +} + +void CStereoOVR::setScale(float s) +{ + m_EyePosition = m_EyePosition * (s / m_Scale); + m_Scale = s; +} + + + +void CStereoOVR::listDevices(std::vector &devicesOut) +{ + if (!s_StereoOVRSystem.Init()) + return; + + ++s_DetectId; + uint hmdDetect = ovrHmd_Detect(); + nldebug("OVR: Detected %u HMDs", hmdDetect); + + for (uint i = 0; i < hmdDetect; ++i) + { + devicesOut.resize(devicesOut.size() + 1); + CStereoDeviceInfo &deviceInfoOut = devicesOut[devicesOut.size() - 1]; + ovrHmd hmd = ovrHmd_Create(i); + CStereoOVRDeviceFactory *factory = new CStereoOVRDeviceFactory(); + factory->DetectId = s_DetectId; + factory->DeviceIndex = i; + factory->DebugDevice = false; + deviceInfoOut.Factory = factory; + deviceInfoOut.Class = CStereoDeviceInfo::StereoHMD; + deviceInfoOut.Library = CStereoDeviceInfo::OVR; + deviceInfoOut.Manufacturer = hmd->Manufacturer; + deviceInfoOut.ProductName = hmd->ProductName; + deviceInfoOut.AllowAuto = true; + deviceInfoOut.Serial = hmd->SerialNumber; + ovrHmd_Destroy(hmd); + } + +#if !FINAL_VERSION + // Debug DK1 + { + devicesOut.resize(devicesOut.size() + 1); + CStereoDeviceInfo &deviceInfoOut = devicesOut[devicesOut.size() - 1]; + ovrHmd hmd = ovrHmd_CreateDebug(ovrHmd_DK1); + CStereoOVRDeviceFactory *factory = new CStereoOVRDeviceFactory(); + factory->DetectId = s_DetectId; + factory->DebugDevice = true; + factory->DebugDeviceType = ovrHmd_DK1; + deviceInfoOut.Factory = factory; + deviceInfoOut.Class = CStereoDeviceInfo::StereoHMD; + deviceInfoOut.Library = CStereoDeviceInfo::OVR; + deviceInfoOut.Manufacturer = hmd->Manufacturer; + deviceInfoOut.ProductName = hmd->ProductName; + deviceInfoOut.AllowAuto = false; + deviceInfoOut.Serial = "OVR-DK1-DEBUG"; + ovrHmd_Destroy(hmd); + } + // Debug DK2 + { + devicesOut.resize(devicesOut.size() + 1); + CStereoDeviceInfo &deviceInfoOut = devicesOut[devicesOut.size() - 1]; + ovrHmd hmd = ovrHmd_CreateDebug(ovrHmd_DK2); + CStereoOVRDeviceFactory *factory = new CStereoOVRDeviceFactory(); + factory->DetectId = s_DetectId; + factory->DebugDevice = true; + factory->DebugDeviceType = ovrHmd_DK2; + deviceInfoOut.Factory = factory; + deviceInfoOut.Class = CStereoDeviceInfo::StereoHMD; + deviceInfoOut.Library = CStereoDeviceInfo::OVR; + deviceInfoOut.Manufacturer = hmd->Manufacturer; + deviceInfoOut.ProductName = hmd->ProductName; + deviceInfoOut.AllowAuto = false; + deviceInfoOut.Serial = "OVR-DK2-DEBUG"; + ovrHmd_Destroy(hmd); + } +#endif +} + +bool CStereoOVR::isLibraryInUse() +{ + nlassert(s_DeviceCounter >= 0); + return s_DeviceCounter > 0; +} + +void CStereoOVR::releaseLibrary() +{ + nlassert(s_DeviceCounter == 0); + s_StereoOVRSystem.Release(); +} + +bool CStereoOVR::isDeviceCreated() +{ + return m_DevicePtr != NULL; +} + +} /* namespace NL3D */ + +#endif /* HAVE_LIBOVR */ + +/* end of file */ diff --git a/code/nel/src/3d/stereo_ovr_04_program.h b/code/nel/src/3d/stereo_ovr_04_program.h new file mode 100644 index 000000000..f8c253aeb --- /dev/null +++ b/code/nel/src/3d/stereo_ovr_04_program.h @@ -0,0 +1,4 @@ + +// TODO + +/* end of file */ diff --git a/code/nel/src/3d/stereo_ovr_fp.cpp b/code/nel/src/3d/stereo_ovr_fp.cpp index 940be0bfe..84a74598e 100644 --- a/code/nel/src/3d/stereo_ovr_fp.cpp +++ b/code/nel/src/3d/stereo_ovr_fp.cpp @@ -21,6 +21,8 @@ limitations under the License. ************************************************************************************/ +#include "std3d.h" + namespace NL3D { const char *g_StereoOVR_fp40 = "!!ARBfp1.0\n" diff --git a/code/nel/src/3d/text_context.cpp b/code/nel/src/3d/text_context.cpp index 4b6e46c85..456ab77a6 100644 --- a/code/nel/src/3d/text_context.cpp +++ b/code/nel/src/3d/text_context.cpp @@ -40,6 +40,7 @@ CTextContext::CTextContext() _ScaleZ = 1.0f; _Shaded = false; + _ShadeOutline = false; _ShadeExtent = 0.001f; _ShadeColor = NLMISC::CRGBA(0,0,0); diff --git a/code/nel/src/3d/text_context_user.cpp b/code/nel/src/3d/text_context_user.cpp index 570c879f9..6ee880d91 100644 --- a/code/nel/src/3d/text_context_user.cpp +++ b/code/nel/src/3d/text_context_user.cpp @@ -148,6 +148,18 @@ bool CTextContextUser::getShaded() const return _TextContext.getShaded(); } +void CTextContextUser::setShadeOutline(bool b) +{ + H_AUTO2; + + _TextContext.setShadeOutline(b); +} +bool CTextContextUser::getShadeOutline() const +{ + H_AUTO2; + + return _TextContext.getShadeOutline(); +} void CTextContextUser::setShadeExtent(float shext) { H_AUTO2; diff --git a/code/nel/src/3d/transform.cpp b/code/nel/src/3d/transform.cpp index c12754c57..0ec65360d 100644 --- a/code/nel/src/3d/transform.cpp +++ b/code/nel/src/3d/transform.cpp @@ -113,7 +113,7 @@ CTransform::CTransform() _StateFlags= IsOpaque | IsUserLightable; // By default, always allow rendering of Transform Models. - _RenderFilterType= std::numeric_limits::max(); + _RenderFilterType = std::numeric_limits::max(); // By default, don't suport fast intersection detection _SupportFastIntersect= false; diff --git a/code/nel/src/3d/vertex_program_parse.cpp b/code/nel/src/3d/vertex_program_parse.cpp index 40ac2282e..0e144d54f 100644 --- a/code/nel/src/3d/vertex_program_parse.cpp +++ b/code/nel/src/3d/vertex_program_parse.cpp @@ -17,7 +17,86 @@ #include "std3d.h" #include "nel/3d/vertex_program_parse.h" - +enum TArguments +{ +#ifdef NL_LITTLE_ENDIAN + ADD = 1094992928, + ARL = 1095912480, + BFC0 = 1111900976, + BFC1 = 1111900977, + COL0 = 1129270320, + COL1 = 1129270321, + DP3 = 1146106656, + DP4 = 1146106912, + DST = 1146311712, + END = 1162757152, + EXP = 1163415584, + EXPP = 1163415632, + FOGC = 1179600707, + HPOS = 1213222739, + LIT = 1279874080, + LOG = 1280263968, + MAD = 1296122912, + MAX = 1296128032, + MIN = 1296649760, + MOV = 1297045024, + MUL = 1297435680, + NRML = 1314016588, + OPOS = 1330663251, + PSIZ = 1347635546, + RCP = 1380143136, + RSQ = 1381191968, + SGE = 1397179680, + SLT = 1397511200, + TEX0 = 1413830704, + TEX1 = 1413830705, + TEX2 = 1413830706, + TEX3 = 1413830707, + TEX4 = 1413830708, + TEX5 = 1413830709, + TEX6 = 1413830710, + TEX7 = 1413830711, + WGHT = 1464289364, +#else + ADD = 541344833, + ARL = 541872705, + BFC0 = 809715266, + BFC1 = 826492482, + COL0 = 810307395, + COL1 = 827084611, + DP3 = 540233796, + DP4 = 540299332, + DST = 542397252, + END = 541347397, + EXP = 542136389, + EXPP = 1347442757, + FOGC = 1128746822, + HPOS = 1397706824, + LIT = 542394700, + LOG = 541544268, + MAD = 541344077, + MAX = 542654797, + MIN = 542001485, + MOV = 542527309, + MUL = 541873485, + NRML = 1280135758, + OPOS = 1397706831, + PSIZ = 1514754896, + RCP = 542131026, + RSQ = 542200658, + SGE = 541411155, + SLT = 542395475, + TEX0 = 811091284, + TEX1 = 827868500, + TEX2 = 844645716, + TEX3 = 861422932, + TEX4 = 878200148, + TEX5 = 894977364, + TEX6 = 911754580, + TEX7 = 928531796, + WGHT = 1414022999, +#endif +}; //===================================== bool CVPParser::parseWriteMask(uint &mask, std::string &errorOutput) @@ -256,23 +335,23 @@ bool CVPParser::parseInputRegister(CVPOperand &operand, std::string &errorOutput strValue |= ((uint32) *_CurrChar) << (8 * (3 - k)); ++_CurrChar; } - switch (strValue) + switch ((TArguments)strValue) { - case 'OPOS': operand.Value.InputRegisterValue = CVPOperand::IPosition; break; - case 'WGHT': operand.Value.InputRegisterValue = CVPOperand::IWeight; break; - case 'NRML': operand.Value.InputRegisterValue = CVPOperand::INormal; break; - case 'COL0': operand.Value.InputRegisterValue = CVPOperand::IPrimaryColor; break; - case 'COL1': operand.Value.InputRegisterValue = CVPOperand::ISecondaryColor; break; - case 'FOGC': operand.Value.InputRegisterValue = CVPOperand::IFogCoord; break; + case OPOS: operand.Value.InputRegisterValue = CVPOperand::IPosition; break; + case WGHT: operand.Value.InputRegisterValue = CVPOperand::IWeight; break; + case NRML: operand.Value.InputRegisterValue = CVPOperand::INormal; break; + case COL0: operand.Value.InputRegisterValue = CVPOperand::IPrimaryColor; break; + case COL1: operand.Value.InputRegisterValue = CVPOperand::ISecondaryColor; break; + case FOGC: operand.Value.InputRegisterValue = CVPOperand::IFogCoord; break; // texture argument - case 'TEX0': - case 'TEX1': - case 'TEX2': - case 'TEX3': - case 'TEX4': - case 'TEX5': - case 'TEX6': - case 'TEX7': + case TEX0: + case TEX1: + case TEX2: + case TEX3: + case TEX4: + case TEX5: + case TEX6: + case TEX7: operand.Value.InputRegisterValue = (CVPOperand::EInputRegister) (((CVPOperand::ITex0 + strValue) & 0xff) - '0'); break; default: @@ -384,23 +463,23 @@ bool CVPParser::parseOutputRegister(CVPOperand &operand, std::string &errorOutpu ++_CurrChar; } // convert to enum - switch(strValue) + switch((TArguments)strValue) { - case 'HPOS': operand.Value.OutputRegisterValue = CVPOperand::OHPosition; break; - case 'COL0': operand.Value.OutputRegisterValue = CVPOperand::OPrimaryColor; break; - case 'COL1': operand.Value.OutputRegisterValue = CVPOperand::OSecondaryColor; break; - case 'BFC0': operand.Value.OutputRegisterValue = CVPOperand::OBackFacePrimaryColor; break; - case 'BFC1': operand.Value.OutputRegisterValue = CVPOperand::OBackFaceSecondaryColor; break; - case 'FOGC': operand.Value.OutputRegisterValue = CVPOperand::OFogCoord; break; - case 'PSIZ': operand.Value.OutputRegisterValue = CVPOperand::OPointSize; break; - case 'TEX0': operand.Value.OutputRegisterValue = CVPOperand::OTex0; break; - case 'TEX1': operand.Value.OutputRegisterValue = CVPOperand::OTex1; break; - case 'TEX2': operand.Value.OutputRegisterValue = CVPOperand::OTex2; break; - case 'TEX3': operand.Value.OutputRegisterValue = CVPOperand::OTex3; break; - case 'TEX4': operand.Value.OutputRegisterValue = CVPOperand::OTex4; break; - case 'TEX5': operand.Value.OutputRegisterValue = CVPOperand::OTex5; break; - case 'TEX6': operand.Value.OutputRegisterValue = CVPOperand::OTex6; break; - case 'TEX7': operand.Value.OutputRegisterValue = CVPOperand::OTex7; break; + case HPOS: operand.Value.OutputRegisterValue = CVPOperand::OHPosition; break; + case COL0: operand.Value.OutputRegisterValue = CVPOperand::OPrimaryColor; break; + case COL1: operand.Value.OutputRegisterValue = CVPOperand::OSecondaryColor; break; + case BFC0: operand.Value.OutputRegisterValue = CVPOperand::OBackFacePrimaryColor; break; + case BFC1: operand.Value.OutputRegisterValue = CVPOperand::OBackFaceSecondaryColor; break; + case FOGC: operand.Value.OutputRegisterValue = CVPOperand::OFogCoord; break; + case PSIZ: operand.Value.OutputRegisterValue = CVPOperand::OPointSize; break; + case TEX0: operand.Value.OutputRegisterValue = CVPOperand::OTex0; break; + case TEX1: operand.Value.OutputRegisterValue = CVPOperand::OTex1; break; + case TEX2: operand.Value.OutputRegisterValue = CVPOperand::OTex2; break; + case TEX3: operand.Value.OutputRegisterValue = CVPOperand::OTex3; break; + case TEX4: operand.Value.OutputRegisterValue = CVPOperand::OTex4; break; + case TEX5: operand.Value.OutputRegisterValue = CVPOperand::OTex5; break; + case TEX6: operand.Value.OutputRegisterValue = CVPOperand::OTex6; break; + case TEX7: operand.Value.OutputRegisterValue = CVPOperand::OTex7; break; default: errorOutput = "Can't read index for output register."; return false; @@ -753,9 +832,9 @@ bool CVPParser::parseInstruction(CVPInstruction &instr, std::string &errorOutput { instrStr |= (uint32) ' '; } - switch (instrStr) + switch ((TArguments)instrStr) { - case 'ARL ': + case ARL: instr.Opcode = CVPInstruction::ARL; if (!parseOp2(instr, errorOutput)) return false; if (!instr.Src1.Swizzle.isScalar()) @@ -764,7 +843,7 @@ bool CVPParser::parseInstruction(CVPInstruction &instr, std::string &errorOutput return false; } break; - case 'RSQ ': + case RSQ: instr.Opcode = CVPInstruction::RSQ; if (!parseOp2(instr, errorOutput)) return false; if (!instr.Src1.Swizzle.isScalar()) @@ -773,8 +852,8 @@ bool CVPParser::parseInstruction(CVPInstruction &instr, std::string &errorOutput return false; } break; - case 'EXP ': - case 'EXPP': + case EXP: + case EXPP: instr.Opcode = CVPInstruction::EXPP; if (!parseOp2(instr, errorOutput)) return false; if (!instr.Src1.Swizzle.isScalar()) @@ -789,7 +868,7 @@ bool CVPParser::parseInstruction(CVPInstruction &instr, std::string &errorOutput return false; }*/ break; - case 'LOG ': + case LOG: instr.Opcode = CVPInstruction::LOG; if (!parseOp2(instr, errorOutput)) return false; if (!instr.Src1.Swizzle.isScalar()) @@ -805,7 +884,7 @@ bool CVPParser::parseInstruction(CVPInstruction &instr, std::string &errorOutput } */ break; - case 'RCP ': + case RCP: instr.Opcode = CVPInstruction::RCP; if (!parseOp2(instr, errorOutput)) return false; if (!instr.Src1.Swizzle.isScalar()) @@ -815,60 +894,60 @@ bool CVPParser::parseInstruction(CVPInstruction &instr, std::string &errorOutput } break; ///////////////// - case 'MOV ': + case MOV: instr.Opcode = CVPInstruction::MOV; if (!parseOp2(instr, errorOutput)) return false; break; - case 'LIT ': + case LIT: instr.Opcode = CVPInstruction::LIT; if (!parseOp2(instr, errorOutput)) return false; break; ///////////////// - case 'MAD ': + case MAD: instr.Opcode = CVPInstruction::MAD; if (!parseOp4(instr, errorOutput)) return false; break; ///////////////// - case 'ADD ': + case ADD: instr.Opcode = CVPInstruction::ADD; if (!parseOp3(instr, errorOutput)) return false; break; ///////////////// - case 'MUL ': + case MUL: instr.Opcode = CVPInstruction::MUL; if (!parseOp3(instr, errorOutput)) return false; break; - case 'DP3 ': + case DP3: instr.Opcode = CVPInstruction::DP3; if (!parseOp3(instr, errorOutput)) return false; break; - case 'DP4 ': + case DP4: instr.Opcode = CVPInstruction::DP4; if (!parseOp3(instr, errorOutput)) return false; break; - case 'DST ': + case DST: instr.Opcode = CVPInstruction::DST; if (!parseOp3(instr, errorOutput)) return false; break; - case 'MIN ': + case MIN: instr.Opcode = CVPInstruction::MIN; if (!parseOp3(instr, errorOutput)) return false; break; - case 'MAX ': + case MAX: instr.Opcode = CVPInstruction::MAX; if (!parseOp3(instr, errorOutput)) return false; break; - case 'SLT ': + case SLT: instr.Opcode = CVPInstruction::SLT; if (!parseOp3(instr, errorOutput)) return false; break; - case 'SGE ': + case SGE: instr.Opcode = CVPInstruction::SGE; if (!parseOp3(instr, errorOutput)) return false; break; ///////////////// - case 'END ': + case END: endEncountered = true; return true; break; diff --git a/code/nel/src/3d/water_pool_manager.cpp b/code/nel/src/3d/water_pool_manager.cpp index b38068852..c377ff1f3 100644 --- a/code/nel/src/3d/water_pool_manager.cpp +++ b/code/nel/src/3d/water_pool_manager.cpp @@ -44,19 +44,19 @@ NLMISC_COMMAND(setWaterPool, "Setup a pool of water in the water pool manager", } if (numArgs == 3) { - whmb.FilterWeight = ::atof(args[2].c_str()); + NLMISC::fromString(args[2], whmb.FilterWeight); } if (numArgs == 4) { - whmb.UnitSize = ::atof(args[3].c_str()); + NLMISC::fromString(args[3], whmb.UnitSize); } if (numArgs == 5) { - whmb.WaveIntensity = ::atof(args[4].c_str()); + NLMISC::fromString(args[4], whmb.WaveIntensity); } if (numArgs == 4) { - whmb.WavePeriod = ::atof(args[5].c_str()); + NLMISC::fromString(args[5], whmb.WavePeriod); } // create the water pool GetWaterPoolManager().createWaterPool(whmb); diff --git a/code/nel/src/3d/zone_lighter.cpp b/code/nel/src/3d/zone_lighter.cpp index 1d7ec5a66..f5549e66a 100644 --- a/code/nel/src/3d/zone_lighter.cpp +++ b/code/nel/src/3d/zone_lighter.cpp @@ -37,7 +37,9 @@ #ifdef NL_OS_WINDOWS # define WIN32_LEAN_AND_MEAN -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include # include #endif // NL_OS_WINDOWS diff --git a/code/nel/src/3d/zone_search.cpp b/code/nel/src/3d/zone_search.cpp index cbadc8c39..f850d4377 100644 --- a/code/nel/src/3d/zone_search.cpp +++ b/code/nel/src/3d/zone_search.cpp @@ -73,7 +73,7 @@ pair CZoneSearch::getZoneName(uint x, uint y, uint cx, uint cy) sprintf(name, "%d_%c%c.zonel", zoneY, firstLetter, secondLetter); - return make_pair(string(name), distance); + return std::pair(string(name), distance); } diff --git a/code/nel/src/georges/form_dfn.cpp b/code/nel/src/georges/form_dfn.cpp index 715961a72..16ee74d5b 100644 --- a/code/nel/src/georges/form_dfn.cpp +++ b/code/nel/src/georges/form_dfn.cpp @@ -41,6 +41,21 @@ void warning (bool exception, const char *format, ... ); // *************************************************************************** +void CFormDfn::addEntry( const std::string &name ) +{ + CEntry entry; + entry.setName( name.c_str() ); + Entries.push_back( entry ); +} + +void CFormDfn::removeEntry( uint idx ) +{ + std::vector< CEntry >::iterator itr = Entries.begin() + idx; + Entries.erase( itr ); +} + +// *************************************************************************** + void CFormDfn::write (xmlDocPtr doc, const char *filename) { // Save filename @@ -463,6 +478,11 @@ void CFormDfn::CEntry::setType (CFormLoader &loader, const char *filename) Type = loader.loadType (filename); } +void CFormDfn::CEntry::setType( TEntryType type ) +{ + TypeElement = type; +} + // *************************************************************************** void CFormDfn::CEntry::setDfn (CFormLoader &loader, const char *filename) @@ -687,7 +707,7 @@ bool CFormDfn::getEntryIndexByName (uint &entry, const std::string &name) const } entryIndex++; } - entry=std::numeric_limits::max(); + entry = std::numeric_limits::max(); return false; } diff --git a/code/nel/src/georges/form_elm.cpp b/code/nel/src/georges/form_elm.cpp index 518782342..01e4010e2 100644 --- a/code/nel/src/georges/form_elm.cpp +++ b/code/nel/src/georges/form_elm.cpp @@ -231,7 +231,7 @@ bool CFormElm::isAtom () const const CType* CFormElm::getType () { warning (false, "getType", "This node is not an atom."); - return 0; + return NULL; } // *************************************************************************** @@ -3056,6 +3056,13 @@ void CFormElmAtom::setValue (const char *value) // *************************************************************************** +void CFormElmAtom::getValue (std::string &result) const +{ + result = Value; +} + +// *************************************************************************** + void CFormElmAtom::getFormName (std::string &result, const CFormElm *child) const { // Must be NULL diff --git a/code/nel/src/gui/CMakeLists.txt b/code/nel/src/gui/CMakeLists.txt index e3d501e23..32125791d 100644 --- a/code/nel/src/gui/CMakeLists.txt +++ b/code/nel/src/gui/CMakeLists.txt @@ -6,7 +6,7 @@ SOURCE_GROUP("src" FILES ${SRC}) NL_TARGET_LIB(nelgui ${SRC} ${HEADERS}) -INCLUDE_DIRECTORIES(${LUA_INCLUDE_DIR} ${LUABIND_INCLUDE_DIR} ${LIBWWW_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${LUA_INCLUDE_DIR} ${LUABIND_INCLUDE_DIR} ${LIBWWW_INCLUDE_DIR} ${CURL_INCLUDE_DIRS}) TARGET_LINK_LIBRARIES(nelgui nelmisc nel3d ${LUA_LIBRARIES} ${LUABIND_LIBRARIES} ${LIBXML2_LIBRARIES} ${LIBWWW_LIBRARIES} ${CURL_LIBRARIES}) SET_TARGET_PROPERTIES(nelgui PROPERTIES LINK_INTERFACE_LIBRARIES "") diff --git a/code/nel/src/gui/action_handler.cpp b/code/nel/src/gui/action_handler.cpp index 8b0d9c4ee..d7214ef06 100644 --- a/code/nel/src/gui/action_handler.cpp +++ b/code/nel/src/gui/action_handler.cpp @@ -111,6 +111,18 @@ namespace NLGUI } } + void CAHManager::getActionHandlers( std::vector< std::string > &handlers ) + { + handlers.clear(); + + std::map< string, IActionHandler* >::iterator itr = FactoryMap.begin(); + while( itr != FactoryMap.end() ) + { + handlers.push_back( itr->first ); + ++itr; + } + } + // ------------------------------------------------------------------------------------------------ IActionHandler* CAHManager::getAH(const std::string &name, std::string ¶ms) { diff --git a/code/nel/src/gui/ctrl_base.cpp b/code/nel/src/gui/ctrl_base.cpp index f0a2c2f89..5c250a0da 100644 --- a/code/nel/src/gui/ctrl_base.cpp +++ b/code/nel/src/gui/ctrl_base.cpp @@ -86,7 +86,7 @@ namespace NLGUI break; } - return ""; + return "control"; } CCtrlBase::TToolTipParentType CCtrlBase::stringToToolTipParent( const std::string &str ) @@ -220,28 +220,22 @@ namespace NLGUI else if( name == "tooltip_posref" ) { - std::string s; - if( ( _ToolTipParentPosRef == Hotspot_TTAuto ) && ( _ToolTipPosRef == Hotspot_TTAuto ) ) - return "auto"; - else{ - s = CInterfaceElement::HotSpotToString( _ToolTipParentPosRef ); - s += " "; - s += CInterfaceElement::HotSpotToString( _ToolTipPosRef ); - return s; - } + return TooltipHotSpotToString( _ToolTipPosRef ); + } + else + if( name == "tooltip_parent_posref" ) + { + return TooltipHotSpotToString( _ToolTipParentPosRef ); } else if( name == "tooltip_posref_alt" ) { - std::string s; - if( ( _ToolTipParentPosRefAlt == Hotspot_TTAuto ) && ( _ToolTipPosRefAlt == Hotspot_TTAuto ) ) - return "auto"; - else{ - s = CInterfaceElement::HotSpotToString( _ToolTipParentPosRefAlt ); - s += " "; - s += CInterfaceElement::HotSpotToString( _ToolTipPosRefAlt ); - return s; - } + return TooltipHotSpotToString( _ToolTipPosRefAlt ); + } + else + if( name == "tooltip_parent_posref_alt" ) + { + return TooltipHotSpotToString( _ToolTipParentPosRefAlt ); } else if( name == "instant_help" ) @@ -293,21 +287,65 @@ namespace NLGUI else if( name == "tooltip_posref" ) { - THotSpot parentHS; THotSpot HS; - convertTooltipHotSpot( value.c_str(), parentHS, HS ); - _ToolTipParentPosRef = parentHS; + convertTooltipHotSpot( value.c_str(), HS ); _ToolTipPosRef = HS; + + // When auto is set, both of them need to be auto + if( _ToolTipPosRef == Hotspot_TTAuto ) + _ToolTipParentPosRef = Hotspot_TTAuto; + else + if( _ToolTipParentPosRef == Hotspot_TTAuto ) + _ToolTipParentPosRef = _ToolTipPosRef; + + return; + } + else + if( name == "tooltip_parent_posref" ) + { + THotSpot HS; + convertTooltipHotSpot( value.c_str(), HS ); + _ToolTipParentPosRef = HS; + + // When auto is set, both of them need to be auto + if( _ToolTipParentPosRef == Hotspot_TTAuto ) + _ToolTipPosRef = Hotspot_TTAuto; + else + if( _ToolTipPosRef == Hotspot_TTAuto ) + _ToolTipPosRef = _ToolTipParentPosRef; + return; } else if( name == "tooltip_posref_alt" ) { - THotSpot parentHS; THotSpot HS; - convertTooltipHotSpot( value.c_str(), parentHS, HS ); - _ToolTipParentPosRefAlt = parentHS; + convertTooltipHotSpot( value.c_str(), HS ); _ToolTipPosRefAlt = HS; + + // When auto is set, both of them need to be auto + if( _ToolTipPosRefAlt == Hotspot_TTAuto ) + _ToolTipParentPosRefAlt = Hotspot_TTAuto; + else + if( _ToolTipParentPosRefAlt == Hotspot_TTAuto ) + _ToolTipPosRefAlt = _ToolTipParentPosRefAlt; + + return; + } + else + if( name == "tooltip_parent_posref_alt" ) + { + THotSpot HS; + convertTooltipHotSpot( value.c_str(), HS ); + _ToolTipParentPosRefAlt = HS; + + // When auto is set, both of them need to be auto + if( _ToolTipParentPosRefAlt == Hotspot_TTAuto ) + _ToolTipPosRefAlt = Hotspot_TTAuto; + else + if( _ToolTipPosRefAlt == Hotspot_TTAuto ) + _ToolTipPosRefAlt = _ToolTipParentPosRefAlt; + return; } else @@ -374,6 +412,21 @@ namespace NLGUI } } + void CCtrlBase::convertTooltipHotSpot(const char *prop, THotSpot &HS ) + { + if(prop) + { + const char *ptr = (const char*)prop; + if(stricmp(ptr, "auto")==0) + { + HS = Hotspot_TTAuto; + } + else if(strlen(ptr)==2) + { + HS = convertHotSpot(ptr); + } + } + } std::string CCtrlBase::TooltipHotSpotToString( THotSpot parent, THotSpot child ) { @@ -393,6 +446,20 @@ namespace NLGUI return s; } + std::string CCtrlBase::TooltipHotSpotToString( THotSpot HS ) + { + std::string s; + if( HS == Hotspot_TTAuto ) + { + s = "auto"; + } + else + { + s = HotSpotToString( HS ); + } + return s; + } + // *************************************************************************** bool CCtrlBase::emptyContextHelp() const { diff --git a/code/nel/src/gui/ctrl_base_button.cpp b/code/nel/src/gui/ctrl_base_button.cpp index 4f118cd51..673ea906d 100644 --- a/code/nel/src/gui/ctrl_base_button.cpp +++ b/code/nel/src/gui/ctrl_base_button.cpp @@ -701,6 +701,11 @@ namespace NLGUI //pIM->submitEvent ("button_click:"+getId()); } */ + + // top-right corner is EventX=0, EventY=0 + _EventX = eventDesc.getX() - _XReal; + _EventY = (_YReal + _HReal) - eventDesc.getY(); + runLeftClickAction(); if (CWidgetManager::getInstance()->getCapturePointerLeft() == NULL) return true; // event handler may release cpature from this object (if it is removed for example) diff --git a/code/nel/src/gui/ctrl_scroll.cpp b/code/nel/src/gui/ctrl_scroll.cpp index f534fc0a1..c29f73fea 100644 --- a/code/nel/src/gui/ctrl_scroll.cpp +++ b/code/nel/src/gui/ctrl_scroll.cpp @@ -519,17 +519,17 @@ namespace NLGUI // Read Action handlers prop = (char*) xmlGetProp( node, (xmlChar*)"onscroll" ); - if (prop) _AHOnScroll = NLMISC::strlwr(prop); + if (prop) _AHOnScroll = NLMISC::strlwr(prop.str()); prop = (char*) xmlGetProp( node, (xmlChar*)"params" ); if (prop) _AHOnScrollParams = string((const char*)prop); // prop = (char*) xmlGetProp( node, (xmlChar*)"onscrollend" ); - if (prop) _AHOnScrollEnd = NLMISC::strlwr(prop); + if (prop) _AHOnScrollEnd = NLMISC::strlwr(prop.str()); prop = (char*) xmlGetProp( node, (xmlChar*)"end_params" ); if (prop) _AHOnScrollEndParams = string((const char*)prop); // prop = (char*) xmlGetProp( node, (xmlChar*)"onscrollcancel" ); - if (prop) _AHOnScrollCancel = NLMISC::strlwr(prop); + if (prop) _AHOnScrollCancel = NLMISC::strlwr(prop.str()); prop = (char*) xmlGetProp( node, (xmlChar*)"cancel_params" ); if (prop) _AHOnScrollCancelParams = string((const char*)prop); @@ -538,9 +538,9 @@ namespace NLGUI prop = (char*) xmlGetProp( node, (xmlChar*)"target" ); if (prop) { - CInterfaceGroup *group = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(prop)); + CInterfaceGroup *group = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(prop.str())); if(group == NULL) - group = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(this->getId(), prop)); + group = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(this->getId(), prop.str())); if(group != NULL) setTarget (group); diff --git a/code/nel/src/gui/ctrl_text_button.cpp b/code/nel/src/gui/ctrl_text_button.cpp index cdf006a51..2fb19a9fc 100644 --- a/code/nel/src/gui/ctrl_text_button.cpp +++ b/code/nel/src/gui/ctrl_text_button.cpp @@ -23,6 +23,7 @@ #include "nel/gui/group_container_base.h" #include "nel/gui/lua_ihm.h" #include "nel/gui/widget_manager.h" +#include "nel/gui/interface_factory.h" #include "nel/misc/i18n.h" using namespace std; @@ -66,8 +67,6 @@ namespace NLGUI { if( _ViewText != NULL ) { - if( _Parent != NULL ) - _Parent->delView( _ViewText, true ); delete _ViewText; _ViewText = NULL; } @@ -149,11 +148,16 @@ namespace NLGUI } else if( name == "text_posref" ) + { + std::string pr; + pr = CInterfaceElement::HotSpotToString( _TextPosRef ); + return pr; + } + else + if( name == "text_parent_posref" ) { std::string pr; pr = CInterfaceElement::HotSpotToString( _TextParentPosRef ); - pr += " "; - pr += CInterfaceElement::HotSpotToString( _TextPosRef ); return pr; } else @@ -324,10 +328,13 @@ namespace NLGUI else if( name == "text_posref" ) { - THotSpot parent, posref; - CInterfaceElement::convertHotSpotCouple( value.c_str(), parent, posref ); - _TextPosRef = posref; - _TextParentPosRef = parent; + _TextPosRef = convertHotSpot( value.c_str() ); + return; + } + else + if( name == "text_parent_posref" ) + { + _TextParentPosRef = convertHotSpot( value.c_str() ); return; } else @@ -561,6 +568,7 @@ namespace NLGUI ((CViewTextID*)_ViewText)->parseTextIdOptions(cur); // Same RenderLayer as us. _ViewText->setRenderLayer(getRenderLayer()); + _ViewText->setParentElm(this); // Parse the hardText (if not text id) if(!_IsViewTextId) { @@ -855,9 +863,20 @@ namespace NLGUI } if(getFrozen() && getFrozenHalfTone()) _ViewText->setAlpha(_ViewText->getAlpha()>>2); + + _ViewText->draw(); } } + // *************************************************************************** + void CCtrlTextButton::checkCoords() + { + if( _ViewText != NULL ) + _ViewText->checkCoords(); + + CCtrlBaseButton::checkCoords(); + } + // *************************************************************************** void CCtrlTextButton::updateCoords() @@ -865,6 +884,9 @@ namespace NLGUI // Should have been setuped with addCtrl nlassert(_Setuped); + if( _Name == "==MARKED==" ) + bool marked = true; + // Compute Size according to bitmap and Text. if (!(_SizeRef & 1)) { @@ -878,6 +900,8 @@ namespace NLGUI } CViewBase::updateCoords(); + + _ViewText->updateCoords(); } // *************************************************************************** @@ -893,7 +917,7 @@ namespace NLGUI if( _ViewText == NULL ) { - CViewBase *v = CWidgetManager::getInstance()->getParser()->createClass( "text" ); + CViewBase *v = CInterfaceFactory::createClass( "text" ); nlassert( v != NULL ); _ViewText = dynamic_cast< CViewText* >( v ); _ViewText->setId( _Id + "_text" ); @@ -902,15 +926,13 @@ namespace NLGUI } // setup the viewText and add to parent - _ViewText->setParent (getParent()); + _ViewText->setParentElm (this); _ViewText->setParentPos (this); _ViewText->setParentPosRef (_TextParentPosRef); _ViewText->setPosRef (_TextPosRef); _ViewText->setActive(_Active); _ViewText->setX(_TextX); _ViewText->setY(_TextY); - - getParent()->addView(_ViewText); } // *************************************************************************** @@ -999,17 +1021,18 @@ namespace NLGUI // *************************************************************************** void CCtrlTextButton::onRemoved() { - if( _ViewText != NULL ) - { - if( _Parent != NULL ) - _Parent->delView( _ViewText, true ); - } } void CCtrlTextButton::onWidgetDeleted( CInterfaceElement *e ) { - if( e == _ViewText ) - _ViewText = NULL; + } + + void CCtrlTextButton::moveBy( sint32 x, sint32 y ) + { + CInterfaceElement::moveBy( x, y ); + + if( _ViewText != NULL ) + _ViewText->updateCoords(); } } diff --git a/code/nel/src/gui/dbgroup_combo_box.cpp b/code/nel/src/gui/dbgroup_combo_box.cpp index 61b8ec3e6..39ddd63c1 100644 --- a/code/nel/src/gui/dbgroup_combo_box.cpp +++ b/code/nel/src/gui/dbgroup_combo_box.cpp @@ -268,7 +268,7 @@ namespace NLGUI void CDBGroupComboBox::addText(const ucstring &text) { dirt(); - _Texts.push_back(make_pair(_Texts.size(), text)); + _Texts.push_back(make_pair((uint)_Texts.size(), text)); _Textures.push_back(std::string()); } @@ -330,7 +330,7 @@ namespace NLGUI } // *************************************************************************** - const uint &CDBGroupComboBox::getTextId(uint i) const + uint CDBGroupComboBox::getTextId(uint i) const { static uint null = 0; if(i<_Texts.size()) diff --git a/code/nel/src/gui/dbview_number.cpp b/code/nel/src/gui/dbview_number.cpp index a0b6dfb02..e844bf4c0 100644 --- a/code/nel/src/gui/dbview_number.cpp +++ b/code/nel/src/gui/dbview_number.cpp @@ -121,7 +121,7 @@ namespace NLGUI { sint64 i; if( fromString( value, i ) ) - _Divisor = i; + _Modulo = i; return; } else @@ -249,5 +249,16 @@ namespace NLGUI { } + sint64 CDBViewNumber::getVal() + { + if( !_Number.hasValue() ) + return 0; + + if( _Modulo == 0 ) + return _Number.getSInt64() / _Divisor; + else + return ( _Number.getSInt64() / _Divisor ) % _Modulo; + } + } diff --git a/code/nel/src/gui/dbview_quantity.cpp b/code/nel/src/gui/dbview_quantity.cpp index ad651f582..12dfce4b8 100644 --- a/code/nel/src/gui/dbview_quantity.cpp +++ b/code/nel/src/gui/dbview_quantity.cpp @@ -157,14 +157,17 @@ namespace NLGUI // *************************************************************************** void CDBViewQuantity::draw () { - // change text - sint32 val= _Number.getSInt32(); - sint32 valMax= _NumberMax.getSInt32(); - if(_Cache!=val || _CacheMax!=valMax) + if( _Number.hasValue() && _NumberMax.hasValue() ) { - _Cache= val; - _CacheMax=valMax; - buildTextFromCache(); + // change text + sint32 val= _Number.getSInt32(); + sint32 valMax= _NumberMax.getSInt32(); + if(_Cache!=val || _CacheMax!=valMax) + { + _Cache= val; + _CacheMax=valMax; + buildTextFromCache(); + } } // parent call diff --git a/code/nel/src/gui/group_container.cpp b/code/nel/src/gui/group_container.cpp index c3a7834c5..18a65bc5f 100644 --- a/code/nel/src/gui/group_container.cpp +++ b/code/nel/src/gui/group_container.cpp @@ -2373,7 +2373,7 @@ namespace NLGUI { setMaxH(_PopupMaxH); // _W is given by scripter-man - newH = pLayer->H_T; + newH = (pLayer->H_T - pLayer->InsetT); } else { @@ -2382,7 +2382,7 @@ namespace NLGUI _W = _Parent->getW(); } setMaxH (16384); // No scrollbar for container of layer > 0 - newH = pLayer->H_T; + newH = (pLayer->H_T - pLayer->InsetT); } if (_Opened) @@ -2396,11 +2396,11 @@ namespace NLGUI _HeaderOpened->setY (- newH); _HeaderOpened->setW (_W-(pLayer->W_L+pLayer->W_R)); _HeaderOpened->updateCoords(); - newH += max (_HeaderOpened->getHReal(), pLayer->getValSInt32 ("header_h")); + newH += max (_HeaderOpened->getHReal(), pLayer->HeaderH); } else { - newH += pLayer->getValSInt32 ("header_h"); + newH += pLayer->HeaderH; } newH -= (sint32) _ContentYOffset; @@ -2448,12 +2448,12 @@ namespace NLGUI if (_LayerSetup == 0) { // zeH is the height to substract to total height of the container to obtain height of the list - sint32 zeH = pLayer->H_T + pLayer->H_B_Open + pLayer->H_EM_Open; + sint32 zeH = (pLayer->H_T - pLayer->InsetT) + pLayer->H_B_Open + pLayer->H_EM_Open; if (_HeaderOpened != NULL) - zeH += max (_HeaderOpened->getHReal(), pLayer->getValSInt32 ("header_h")); + zeH += max (_HeaderOpened->getHReal(), pLayer->HeaderH); else - zeH += pLayer->getValSInt32 ("header_h"); + zeH += pLayer->HeaderH; if (_Content != NULL) zeH += _Content->getHReal(); @@ -2513,11 +2513,11 @@ namespace NLGUI _HeaderClosed->setY (-newH); _HeaderClosed->setW (_W-(pLayer->W_L+pLayer->W_R)); _HeaderClosed->updateCoords(); - newH += max (_HeaderClosed->getHReal(), pLayer->getValSInt32 ("header_h")); + newH += max (_HeaderClosed->getHReal(), pLayer->HeaderH); } else { - newH += pLayer->getValSInt32 ("header_h"); + newH += pLayer->HeaderH; } newH += pLayer->H_B; @@ -2731,7 +2731,8 @@ namespace NLGUI // h is the size of what is on top of the child list sint32 x, y, w, h; - h = pLayer->H_T + pLayer->H_B_Open; + bool bHasChild = (_List->getNbElement() > 0); + h = (pLayer->H_T - pLayer->InsetT) + (((!_Opened) || (!bHasChild)) ? pLayer->H_B : pLayer->H_B_Open); if (_Opened) { @@ -2749,7 +2750,6 @@ namespace NLGUI { h = _HReal; } - bool bHasChild = (_List->getNbElement() > 0); x = _XReal; y = _YReal+_HReal-h; @@ -2767,7 +2767,7 @@ namespace NLGUI // Top Right rVR.drawRotFlipBitmap (rl, x+w-pLayer->W_TR, y+h-pLayer->H_TR, pLayer->W_TR, pLayer->H_TR, 0, false, pLayer->TxId_TR, col); - if ((!_Opened) || (_Opened && !bHasChild)) + if ((!_Opened) || (!bHasChild)) { // Not opened // Left if (pLayer->Tile_L == 0) // Tiling ? @@ -2817,9 +2817,9 @@ namespace NLGUI rVR.drawRotFlipBitmap (rl, x+w-pLayer->W_BR_Open, y, pLayer->W_BR_Open, pLayer->H_BR_Open, 0, false, pLayer->TxId_BR_Open, col); // Content if (pLayer->Tile_Blank == 0) // Tiling ? - rVR.drawRotFlipBitmap (rl, x+pLayer->W_L, y+pLayer->H_B, w-(pLayer->W_R+pLayer->W_L), h-(pLayer->H_B_Open+pLayer->H_T), 0, false, pLayer->TxId_Blank, col); + rVR.drawRotFlipBitmap (rl, x+pLayer->W_L, y+pLayer->H_B_Open, w-(pLayer->W_R+pLayer->W_L), h-(pLayer->H_B_Open+pLayer->H_T), 0, false, pLayer->TxId_Blank, col); else - rVR.drawRotFlipBitmapTiled (rl, x+pLayer->W_L, y+pLayer->H_B, w-(pLayer->W_R+pLayer->W_L), h-(pLayer->H_B_Open+pLayer->H_T), 0, false, pLayer->TxId_Blank, pLayer->Tile_Blank-1, col); + rVR.drawRotFlipBitmapTiled (rl, x+pLayer->W_L, y+pLayer->H_B_Open, w-(pLayer->W_R+pLayer->W_L), h-(pLayer->H_B_Open+pLayer->H_T), 0, false, pLayer->TxId_Blank, pLayer->Tile_Blank-1, col); // ScrollBar Placement if (pLayer->Tile_M_Open == 0) // Tiling ? rVR.drawRotFlipBitmap (rl, x, _YReal+pLayer->H_EL_Open, pLayer->W_M_Open, _HReal-h-pLayer->H_EL_Open, 0, false, pLayer->TxId_M_Open, col); @@ -2848,7 +2848,7 @@ namespace NLGUI // Top Right rVR.drawRotFlipBitmap (rl, x+w-pLayer->W_TR, y+h-pLayer->H_TR, pLayer->W_TR, pLayer->H_TR, 0, false, pLayer->TxId_TR, col); - if ((!_Opened) || (_Opened && !bHasChild)) + if ((!_Opened) || (!bHasChild)) { // Left if (pLayer->Tile_L == 0) // Tiling ? @@ -2856,7 +2856,7 @@ namespace NLGUI else rVR.drawRotFlipBitmapTiled (rl, x, y+pLayer->H_BL, pLayer->W_L, h-(pLayer->H_BL+pLayer->H_TL), 0, false, pLayer->TxId_L, pLayer->Tile_L-1, col); // Right - if (pLayer->Tile_T == 0) // Tiling ? + if (pLayer->Tile_R == 0) // Tiling ? rVR.drawRotFlipBitmap (rl, x+w-pLayer->W_R, y+pLayer->H_BR, pLayer->W_R, h-(pLayer->H_BL+pLayer->H_TL), 0, false, pLayer->TxId_R, col); else rVR.drawRotFlipBitmapTiled (rl, x+w-pLayer->W_R, y+pLayer->H_BR, pLayer->W_R, h-(pLayer->H_BL+pLayer->H_TL), 0, false, pLayer->TxId_R, pLayer->Tile_R-1, col); @@ -3003,18 +3003,16 @@ namespace NLGUI col.A = nInverted; else col.A = max(_HighLightedAlpha, nInverted); - sint32 hw, hh; // size of highlight texture - rVR.getTextureSizeFromId(pLayer->TxId_TL_HighLight, hw, hh); // corners - rVR.drawRotFlipBitmap (_RenderLayer, x, y + h - hh, hw, hh, 0, false, pLayer->TxId_TL_HighLight, col); - rVR.drawRotFlipBitmap (_RenderLayer, x + _WReal - hw, y + h - hh, hw, hh, 0, false, pLayer->TxId_TR_HighLight, col); - rVR.drawRotFlipBitmap (_RenderLayer, x, _YReal, hw, hh, 0, false, pLayer->TxId_BL_HighLight, col); - rVR.drawRotFlipBitmap (_RenderLayer, x + _WReal - hw, _YReal, hw, hh, 0, false, pLayer->TxId_BR_HighLight, col); + rVR.drawRotFlipBitmap (_RenderLayer, x, y + h - pLayer->H_T_HighLight, pLayer->W_TL_HighLight, pLayer->H_TL_HighLight, 0, false, pLayer->TxId_TL_HighLight, col); + rVR.drawRotFlipBitmap (_RenderLayer, x + _WReal - pLayer->W_TR_HighLight, y + h - pLayer->H_T_HighLight, pLayer->W_TR_HighLight, pLayer->H_TR_HighLight, 0, false, pLayer->TxId_TR_HighLight, col); + rVR.drawRotFlipBitmap (_RenderLayer, x, _YReal, pLayer->W_BL_HighLight, pLayer->H_BL_HighLight, 0, false, pLayer->TxId_BL_HighLight, col); + rVR.drawRotFlipBitmap (_RenderLayer, x + _WReal - pLayer->W_BR_HighLight, _YReal, pLayer->W_BR_HighLight, pLayer->H_BR_HighLight, 0, false, pLayer->TxId_BR_HighLight, col); // border - rVR.drawRotFlipBitmap (_RenderLayer, x + hw, y + h - hh, _WReal - 2 * hw, hh, 0, false, pLayer->TxId_T_HighLight, col); - rVR.drawRotFlipBitmap (_RenderLayer, x + hw, _YReal, _WReal - 2 * hw, hh, 0, false, pLayer->TxId_B_HighLight, col); - rVR.drawRotFlipBitmap (_RenderLayer, x, _YReal + hh, hw, _HReal - 2 * hh, 0, false, pLayer->TxId_L_HighLight, col); - rVR.drawRotFlipBitmap (_RenderLayer, x + _WReal - hw, _YReal + hh, hw, _HReal - 2 * hh, 0, false, pLayer->TxId_R_HighLight, col); + rVR.drawRotFlipBitmap (_RenderLayer, x + pLayer->W_TL_HighLight, y + h - pLayer->H_T_HighLight, _WReal - pLayer->W_TL_HighLight - pLayer->W_TR_HighLight, pLayer->H_T_HighLight, 0, false, pLayer->TxId_T_HighLight, col); + rVR.drawRotFlipBitmap (_RenderLayer, x + pLayer->W_BL_HighLight, _YReal, _WReal - pLayer->W_BL_HighLight - pLayer->W_BR_HighLight, pLayer->H_B_HighLight, 0, false, pLayer->TxId_B_HighLight, col); + rVR.drawRotFlipBitmap (_RenderLayer, x, _YReal + pLayer->H_B_HighLight, pLayer->W_L_HighLight, _HReal - pLayer->H_T_HighLight - pLayer->H_B_HighLight, 0, false, pLayer->TxId_L_HighLight, col); + rVR.drawRotFlipBitmap (_RenderLayer, x + _WReal - pLayer->W_R_HighLight, _YReal + pLayer->H_B_HighLight, pLayer->W_R_HighLight, _HReal - pLayer->H_T_HighLight - pLayer->H_B_HighLight, 0, false, pLayer->TxId_R_HighLight, col); } @@ -3715,6 +3713,7 @@ namespace NLGUI _TitleOpened->setParentPosRef (Hotspot_TL); _TitleOpened->setPosRef (Hotspot_TL); _TitleOpened->setShadow (true); + _TitleOpened->setShadowOutline (false); _TitleOpened->setColor (CRGBA(255,255,255,255)); _TitleOpened->setModulateGlobalColor(getModulateGlobalColor()); _TitleOpened->setOverExtendViewText(_TitleOverExtendViewText); @@ -3766,6 +3765,7 @@ namespace NLGUI _TitleClosed->setParentPosRef (Hotspot_TL); _TitleClosed->setPosRef (Hotspot_TL); _TitleClosed->setShadow (true); + _TitleClosed->setShadowOutline (false); _TitleClosed->setColor (CRGBA(255,255,255,255)); _TitleClosed->setModulateGlobalColor(getModulateGlobalColor()); _TitleClosed->setOverExtendViewText(_TitleOverExtendViewText); diff --git a/code/nel/src/gui/group_editbox.cpp b/code/nel/src/gui/group_editbox.cpp index 751d9241b..f6d909119 100644 --- a/code/nel/src/gui/group_editbox.cpp +++ b/code/nel/src/gui/group_editbox.cpp @@ -27,7 +27,7 @@ #include "nel/gui/widget_manager.h" #include "nel/gui/view_renderer.h" #include "nel/gui/db_manager.h" -#include +#include "nel/gui/interface_factory.h" using namespace std; using namespace NLMISC; @@ -999,7 +999,8 @@ namespace NLGUI break; // OTHER default: - if ((rEDK.getChar() == KeyRETURN) && !_WantReturn) + bool isKeyRETURN = !rEDK.getKeyCtrl() && rEDK.getChar() == KeyRETURN; + if (isKeyRETURN && !_WantReturn) { // update historic. if(_MaxHistoric) @@ -1030,9 +1031,9 @@ namespace NLGUI // If the char is not alphanumeric -> return. // if(!isalnum(ec.Char)) // return - if( (rEDK.getChar()>=32) || (rEDK.getChar() == KeyRETURN) ) + if( (rEDK.getChar()>=32) || isKeyRETURN ) { - if (rEDK.getChar() == KeyRETURN) + if (isKeyRETURN) { ucstring copyStr= _InputString; if ((uint) std::count(copyStr.begin(), copyStr.end(), '\n') >= _MaxNumReturn) @@ -1049,7 +1050,7 @@ namespace NLGUI cutSelection(); } - ucchar c = (rEDK.getChar() == KeyRETURN)?'\n':rEDK.getChar(); + ucchar c = isKeyRETURN ? '\n' : rEDK.getChar(); if (isFiltered(c)) return; switch(_EntryType) { @@ -1128,7 +1129,7 @@ namespace NLGUI ++ _CursorPos; triggerOnChangeAH(); } - if (rEDK.getChar() == KeyRETURN) + if (isKeyRETURN) { CAHManager::getInstance()->runActionHandler(_AHOnEnter, this, _AHOnEnterParams); } @@ -1320,15 +1321,31 @@ namespace NLGUI } } + // if click, and not frozen, then get the focus + if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup && !_Frozen) + { + _SelectingText = false; + if (_SelectCursorPos == _CursorPos) + _CurrSelection = NULL; + + return true; + } + if (!isIn(eventDesc.getX(), eventDesc.getY())) return false; // if click, and not frozen, then get the focus if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftdown && !_Frozen) { + if( getEditorMode() ) + { + return CViewBase::handleEvent( event ); + } + _SelectingText = true; stopParentBlink(); CWidgetManager::getInstance()->setCaptureKeyboard (this); + CWidgetManager::getInstance()->setCapturePointerLeft (this); // set the right cursor position uint newCurPos; bool cursorAtPreviousLineEnd; @@ -1356,16 +1373,6 @@ namespace NLGUI return true; } - // if click, and not frozen, then get the focus - if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup && !_Frozen) - { - _SelectingText = false; - if (_SelectCursorPos == _CursorPos) - _CurrSelection = NULL; - - return true; - } - if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightdown) { CWidgetManager::getInstance()->setCapturePointerRight(this); @@ -1530,36 +1537,45 @@ namespace NLGUI CInterfaceGroup::clearViews(); } + // ---------------------------------------------------------------------------- + + void CGroupEditBox::createViewText() + { + nlwarning("Interface: CGroupEditBox: text 'edit_text' missing or bad type"); + nlwarning( "Trying to create a new 'edit_text' for %s", getId().c_str() ); + _ViewText = dynamic_cast< CViewText* >( CInterfaceFactory::createClass( "text" ) ); + if( _ViewText == NULL ) + { + nlwarning( "Failed to create new 'edit_text' for %s", getId().c_str() ); + return; + } + + _ViewText->setParent( this ); + _ViewText->setIdRecurse( "edit_text" ); + _ViewText->setHardText( "" ); + _ViewText->setPosRef( Hotspot_ML ); + _ViewText->setParentPosRef( Hotspot_ML ); + addView( _ViewText ); + + sint32 w,h; + w = std::max( sint32( _ViewText->getFontWidth() * _ViewText->getText().size() ), getW() ); + h = std::max( sint32( _ViewText->getFontHeight() ), getH() ); + + setH( h ); + setW( w ); + } + // ---------------------------------------------------------------------------- void CGroupEditBox::setup() { // bind to the controls - _ViewText = dynamic_cast(CInterfaceGroup::getView("edit_text")); + if( _ViewText == NULL ) + _ViewText = dynamic_cast(CInterfaceGroup::getView("edit_text")); if(_ViewText == NULL) - { - nlwarning("Interface: CGroupEditBox: text 'edit_text' missing or bad type"); - if( editorMode ) - { - nlwarning( "Trying to create a new 'edit_text' for %s", getId().c_str() ); - _ViewText = dynamic_cast< CViewText* >( CWidgetManager::getInstance()->getParser()->createClass( "text" ) ); - if( _ViewText != NULL ) - { - _ViewText->setParent( this ); - _ViewText->setIdRecurse( "edit_text" ); - _ViewText->setHardText( "sometext" ); - _ViewText->setPosRef( Hotspot_TL ); - _ViewText->setParentPosRef( Hotspot_TL ); - addView( _ViewText ); - - setH( _ViewText->getFontHeight() ); - setW( _ViewText->getFontWidth() * _ViewText->getText().size() ); - - } - else - nlwarning( "Failed to create new 'edit_text' for %s", getId().c_str() ); - } - } + createViewText(); + + _ViewText->setEditorSelectable( false ); // For MultiLine editbox, clip the end space, else weird when edit space at end of line (nothing happens) if(_ViewText) diff --git a/code/nel/src/gui/group_editbox_decor.cpp b/code/nel/src/gui/group_editbox_decor.cpp new file mode 100644 index 000000000..ae31513de --- /dev/null +++ b/code/nel/src/gui/group_editbox_decor.cpp @@ -0,0 +1,380 @@ +// Ryzom - MMORPG Framework +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "stdpch.h" +#include "nel/gui/group_editbox_decor.h" +#include "nel/gui/view_bitmap.h" +#include "nel/gui/view_text.h" + +namespace NLGUI +{ + class EBDPrivate + { + public: + enum Textures + { + BG, + L, + R, + TM, + BM, + TL, + TR, + BL, + BR, + TCOUNT + }; + + EBDPrivate() + { + for( int i = 0; i < TCOUNT; i++ ) + { + _Textures.push_back( new CViewBitmap( CViewBase::TCtorParam() ) ); + } + } + + ~EBDPrivate() + { + for( int i = 0; i < _Textures.size(); i++ ) + delete _Textures[ i ]; + _Textures.clear(); + } + + void draw() + { + for( int i = 0; i < _Textures.size(); i++ ) + { + CViewBitmap *bm = _Textures[ i ]; + bm->draw(); + } + } + + void updateCoords() + { + for( int i = 0; i < _Textures.size(); i++ ) + { + CViewBitmap *bm = _Textures[ i ]; + bm->fitTexture(); + } + + // W and H parameters depend on the sizes of the other textures + // Negative sizes mean that the sizes are that much smaller than the parent + sint32 w,h; + h = _Textures[ TL ]->getHReal() + _Textures[ BL ]->getHReal(); + h *= -1; + _Textures[ L ]->setH( h ); + + h = _Textures[ TR ]->getHReal() + _Textures[ BR ]->getHReal(); + h *= -1; + _Textures[ R ]->setH( h ); + + w = _Textures[ TL ]->getWReal() + _Textures[ TR ]->getWReal(); + w *= -1; + _Textures[ TM ]->setW( w ); + + w = _Textures[ BL ]->getWReal() + _Textures[ BR ]->getWReal(); + w *= -1; + _Textures[ BM ]->setW( w ); + + h = _Textures[ TM ]->getHReal() + _Textures[ BM ]->getHReal(); + h *= -1; + w = _Textures[ L ]->getWReal() + _Textures[ R ]->getWReal(); + w *= -1; + _Textures[ BG ]->setW( w ); + _Textures[ BG ]->setH( h ); + + for( int i = 0; i < _Textures.size(); i++ ) + { + CViewBitmap *bm = _Textures[ i ]; + bm->updateCoords(); + } + } + + void setup( CInterfaceGroup *parent ) + { + for( int i = 0; i < _Textures.size(); i++ ) + { + CViewBitmap *bm = _Textures[ i ]; + bm->setParent( parent ); + bm->setParentPos( parent ); + bm->setParentSize( parent ); + bm->setEditorSelectable( false ); + } + + _Textures[ TL ]->setPosRef( Hotspot_TL ); + _Textures[ TL ]->setParentPosRef( Hotspot_TL ); + + _Textures[ TM ]->setPosRef( Hotspot_TM ); + _Textures[ TM ]->setParentPosRef( Hotspot_TM ); + _Textures[ TM ]->setScale( true ); + _Textures[ TM ]->setSizeRef( "w" ); + + _Textures[ TR ]->setPosRef( Hotspot_TR ); + _Textures[ TR ]->setParentPosRef( Hotspot_TR ); + + _Textures[ BL ]->setPosRef( Hotspot_BL ); + _Textures[ BL ]->setParentPosRef( Hotspot_BL ); + + _Textures[ BM ]->setPosRef( Hotspot_BM ); + _Textures[ BM ]->setParentPosRef( Hotspot_BM ); + _Textures[ BM ]->setScale( true ); + _Textures[ BM ]->setSizeRef( "w" ); + + _Textures[ BR ]->setPosRef( Hotspot_BR ); + _Textures[ BR ]->setParentPosRef( Hotspot_BR ); + + _Textures[ L ]->setPosRef( Hotspot_ML ); + _Textures[ L ]->setParentPosRef( Hotspot_ML ); + _Textures[ L ]->setScale( true ); + _Textures[ L ]->setSizeRef( "h" ); + + _Textures[ R ]->setPosRef( Hotspot_MR ); + _Textures[ R ]->setParentPosRef( Hotspot_MR ); + _Textures[ R ]->setScale( true ); + _Textures[ R ]->setSizeRef( "h" ); + + _Textures[ BG ]->setPosRef( Hotspot_MM ); + _Textures[ BG ]->setParentPosRef( Hotspot_MM ); + _Textures[ BG ]->setScale( true ); + _Textures[ BG ]->setSizeRef( "wh" ); + } + + std::vector< CViewBitmap* > _Textures; + }; + + NLMISC_REGISTER_OBJECT( CViewBase, CGroupEditBoxDecor, std::string, "edit_box_decor" ); + + CGroupEditBoxDecor::CGroupEditBoxDecor( const TCtorParam ¶m ) : + CGroupEditBox( param ) + { + _Pvt = new EBDPrivate(); + _Pvt->setup( this ); + + createViewText(); + getVT()->setSerializable( false ); + getVT()->setEditorSelectable( false ); + } + + CGroupEditBoxDecor::~CGroupEditBoxDecor() + { + delete _Pvt; + _Pvt = NULL; + } + + void CGroupEditBoxDecor::moveBy( sint32 x, sint32 y ) + { + CInterfaceElement::moveBy( x, y ); + + _Pvt->updateCoords(); + } + + void CGroupEditBoxDecor::setIdRecurse( const std::string &newID ) + { + CInterfaceElement::setIdRecurse( newID ); + _ViewText->setIdRecurse( _ViewText->getShortId() ); + } + + std::string CGroupEditBoxDecor::getProperty( const std::string &name ) const + { + if( name == "tx_tl" ) + { + return _Pvt->_Textures[ EBDPrivate::TL ]->getTexture(); + } + else + if( name == "tx_tm" ) + { + return _Pvt->_Textures[ EBDPrivate::TM ]->getTexture(); + } + else + if( name == "tx_tr" ) + { + return _Pvt->_Textures[ EBDPrivate::TR ]->getTexture(); + } + else + if( name == "tx_bl" ) + { + return _Pvt->_Textures[ EBDPrivate::BL ]->getTexture(); + } + else + if( name == "tx_bm" ) + { + return _Pvt->_Textures[ EBDPrivate::BM ]->getTexture(); + } + else + if( name == "tx_br" ) + { + return _Pvt->_Textures[ EBDPrivate::BR ]->getTexture(); + } + else + if( name == "tx_l" ) + { + return _Pvt->_Textures[ EBDPrivate::L ]->getTexture(); + } + else + if( name == "tx_r" ) + { + return _Pvt->_Textures[ EBDPrivate::R ]->getTexture(); + } + else + if( name == "tx_bg" ) + { + return _Pvt->_Textures[ EBDPrivate::BG ]->getTexture(); + } + else + return CGroupEditBox::getProperty( name ); + } + + void CGroupEditBoxDecor::setProperty( const std::string &name, const std::string &value ) + { + if( name == "tx_tl" ) + { + _Pvt->_Textures[ EBDPrivate::TL ]->setTexture( value ); + } + else + if( name == "tx_tm" ) + { + _Pvt->_Textures[ EBDPrivate::TM ]->setTexture( value ); + } + else + if( name == "tx_tr" ) + { + _Pvt->_Textures[ EBDPrivate::TR ]->setTexture( value ); + } + else + if( name == "tx_bl" ) + { + _Pvt->_Textures[ EBDPrivate::BL ]->setTexture( value ); + } + else + if( name == "tx_bm" ) + { + _Pvt->_Textures[ EBDPrivate::BM ]->setTexture( value ); + } + else + if( name == "tx_br" ) + { + _Pvt->_Textures[ EBDPrivate::BR ]->setTexture( value ); + } + else + if( name == "tx_l" ) + { + _Pvt->_Textures[ EBDPrivate::L ]->setTexture( value ); + } + else + if( name == "tx_r" ) + { + _Pvt->_Textures[ EBDPrivate::R ]->setTexture( value ); + } + else + if( name == "tx_bg" ) + { + _Pvt->_Textures[ EBDPrivate::BG ]->setTexture( value ); + } + else + CGroupEditBox::setProperty( name, value ); + } + + xmlNodePtr CGroupEditBoxDecor::serialize( xmlNodePtr parentNode, const char *type ) const + { + xmlNodePtr node = CGroupEditBox::serialize( parentNode, type ); + if( node == NULL ) + return NULL; + + xmlSetProp( node, BAD_CAST "type", BAD_CAST "edit_box_decor" ); + xmlSetProp( node, BAD_CAST "tx_tl", BAD_CAST _Pvt->_Textures[ EBDPrivate::TL ]->getTexture().c_str() ); + xmlSetProp( node, BAD_CAST "tx_tr", BAD_CAST _Pvt->_Textures[ EBDPrivate::TR ]->getTexture().c_str() ); + xmlSetProp( node, BAD_CAST "tx_tm", BAD_CAST _Pvt->_Textures[ EBDPrivate::TM ]->getTexture().c_str() ); + xmlSetProp( node, BAD_CAST "tx_bl", BAD_CAST _Pvt->_Textures[ EBDPrivate::BL ]->getTexture().c_str() ); + xmlSetProp( node, BAD_CAST "tx_bm", BAD_CAST _Pvt->_Textures[ EBDPrivate::BM ]->getTexture().c_str() ); + xmlSetProp( node, BAD_CAST "tx_br", BAD_CAST _Pvt->_Textures[ EBDPrivate::BR ]->getTexture().c_str() ); + xmlSetProp( node, BAD_CAST "tx_l", BAD_CAST _Pvt->_Textures[ EBDPrivate::L ]->getTexture().c_str() ); + xmlSetProp( node, BAD_CAST "tx_r", BAD_CAST _Pvt->_Textures[ EBDPrivate::R ]->getTexture().c_str() ); + xmlSetProp( node, BAD_CAST "tx_bg", BAD_CAST _Pvt->_Textures[ EBDPrivate::BG ]->getTexture().c_str() ); + + return node; + } + + bool CGroupEditBoxDecor::parse( xmlNodePtr cur, CInterfaceGroup *parent ) + { + if( !CGroupEditBox::parse( cur, parent ) ) + return false; + + CXMLAutoPtr prop; + + prop = ( char* ) xmlGetProp( cur, BAD_CAST "tx_tl" ); + if( prop ) + _Pvt->_Textures[ EBDPrivate::TL ]->setTexture( ( const char* )prop ); + + prop = ( char* ) xmlGetProp( cur, BAD_CAST "tx_tm" ); + if( prop ) + _Pvt->_Textures[ EBDPrivate::TM ]->setTexture( ( const char* )prop ); + + prop = ( char* ) xmlGetProp( cur, BAD_CAST "tx_tr" ); + if( prop ) + _Pvt->_Textures[ EBDPrivate::TR ]->setTexture( ( const char* )prop ); + + prop = ( char* ) xmlGetProp( cur, BAD_CAST "tx_bl" ); + if( prop ) + _Pvt->_Textures[ EBDPrivate::BL ]->setTexture( ( const char* )prop ); + + prop = ( char* ) xmlGetProp( cur, BAD_CAST "tx_bm" ); + if( prop ) + _Pvt->_Textures[ EBDPrivate::BM ]->setTexture( ( const char* )prop ); + + prop = ( char* ) xmlGetProp( cur, BAD_CAST "tx_br" ); + if( prop ) + _Pvt->_Textures[ EBDPrivate::BR ]->setTexture( ( const char* )prop ); + + prop = ( char* ) xmlGetProp( cur, BAD_CAST "tx_l" ); + if( prop ) + _Pvt->_Textures[ EBDPrivate::L ]->setTexture( ( const char* )prop ); + + prop = ( char* ) xmlGetProp( cur, BAD_CAST "tx_r" ); + if( prop ) + _Pvt->_Textures[ EBDPrivate::R ]->setTexture( ( const char* )prop ); + + prop = ( char* ) xmlGetProp( cur, BAD_CAST "tx_bg" ); + if( prop ) + _Pvt->_Textures[ EBDPrivate::BG ]->setTexture( ( const char* )prop ); + + getVT()->setIdRecurse( "edit_text" ); + + return true; + } + + void CGroupEditBoxDecor::draw() + { + CGroupEditBox::draw(); + + _Pvt->draw(); + } + + void CGroupEditBoxDecor::updateCoords() + { + sint32 tw = _Pvt->_Textures[ EBDPrivate::L ]->getWReal(); + getVT()->setX( tw + 1 ); + + CGroupEditBox::updateCoords(); + _Pvt->updateCoords(); + } + + void CGroupEditBoxDecor::forceLink() + { + } +} + + diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 9f19f383a..656e36ca8 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -1217,7 +1217,7 @@ namespace NLGUI normal = value[MY_HTML_INPUT_SRC]; // Action handler parameters : "name=group_html_id|form=id_of_the_form|submit_button=button_name" - string param = "name=" + getId() + "|form=" + toString (_Forms.size()-1) + "|submit_button=" + name; + string param = "name=" + getId() + "|form=" + toString (_Forms.size()-1) + "|submit_button=" + name + "|submit_button_type=image"; // Add the ctrl button addButton (CCtrlButton::PushButton, name, normal, pushed.empty()?normal:pushed, over, @@ -1241,7 +1241,15 @@ namespace NLGUI text = value[MY_HTML_INPUT_VALUE]; // Action handler parameters : "name=group_html_id|form=id_of_the_form|submit_button=button_name" - string param = "name=" + getId() + "|form=" + toString (_Forms.size()-1) + "|submit_button=" + name; + string param = "name=" + getId() + "|form=" + toString (_Forms.size()-1) + "|submit_button=" + name + "|submit_button_type=submit"; + if (text.size() > 0) + { + // escape AH param separator + string tmp = text; + while(NLMISC::strFindReplace(tmp, "|", "|")) + ; + param = param + "|submit_button_value=" + tmp; + } // Add the ctrl button if (!_Paragraph) @@ -1289,16 +1297,19 @@ namespace NLGUI string name; ucstring ucValue; uint size = 120; + uint maxlength = 1024; if (present[MY_HTML_INPUT_NAME] && value[MY_HTML_INPUT_NAME]) name = value[MY_HTML_INPUT_NAME]; if (present[MY_HTML_INPUT_SIZE] && value[MY_HTML_INPUT_SIZE]) fromString(value[MY_HTML_INPUT_SIZE], size); if (present[MY_HTML_INPUT_VALUE] && value[MY_HTML_INPUT_VALUE]) ucValue.fromUtf8(value[MY_HTML_INPUT_VALUE]); + if (present[MY_HTML_INPUT_MAXLENGTH] && value[MY_HTML_INPUT_MAXLENGTH]) + fromString(value[MY_HTML_INPUT_MAXLENGTH], maxlength); string textTemplate(!templateName.empty() ? templateName : DefaultFormTextGroup); // Add the editbox - CInterfaceGroup *textArea = addTextArea (textTemplate, name.c_str (), 1, size/12, false, ucValue); + CInterfaceGroup *textArea = addTextArea (textTemplate, name.c_str (), 1, size/12, false, ucValue, maxlength); if (textArea) { // Add the text area to the form @@ -1450,6 +1461,8 @@ namespace NLGUI getPercentage (table->ForceWidthMin, table->TableRatio, value[MY_HTML_TABLE_WIDTH]); if (present[MY_HTML_TABLE_BORDER] && value[MY_HTML_TABLE_BORDER]) fromString(value[MY_HTML_TABLE_BORDER], table->Border); + if (present[MY_HTML_TABLE_BORDERCOLOR] && value[MY_HTML_TABLE_BORDERCOLOR]) + table->BorderColor = getColor (value[MY_HTML_TABLE_BORDERCOLOR]); if (present[MY_HTML_TABLE_CELLSPACING] && value[MY_HTML_TABLE_CELLSPACING]) fromString(value[MY_HTML_TABLE_CELLSPACING], table->CellSpacing); if (present[MY_HTML_TABLE_CELLPADDING] && value[MY_HTML_TABLE_CELLPADDING]) @@ -1514,11 +1527,19 @@ namespace NLGUI } } } + + if (present[MY_HTML_TD_COLSPAN] && value[MY_HTML_TD_COLSPAN]) + fromString(value[MY_HTML_TD_COLSPAN], _Cells.back()->ColSpan); + if (present[MY_HTML_TD_ROWSPAN] && value[MY_HTML_TD_ROWSPAN]) + fromString(value[MY_HTML_TD_ROWSPAN], _Cells.back()->RowSpan); + _Cells.back()->BgColor = _CellParams.back().BgColor; _Cells.back()->Align = _CellParams.back().Align; _Cells.back()->VAlign = _CellParams.back().VAlign; _Cells.back()->LeftMargin = _CellParams.back().LeftMargin; _Cells.back()->NoWrap = _CellParams.back().NoWrap; + _Cells.back()->ColSpan = std::max(1, _Cells.back()->ColSpan); + _Cells.back()->RowSpan = std::max(1, _Cells.back()->RowSpan); float temp; if (present[MY_HTML_TD_WIDTH] && value[MY_HTML_TD_WIDTH]) @@ -1553,12 +1574,15 @@ namespace NLGUI _TextAreaRow = 1; _TextAreaCols = 10; _TextAreaContent = ""; - if (present[HTML_TEXTAREA_NAME] && value[HTML_TEXTAREA_NAME]) - _TextAreaName = value[HTML_TEXTAREA_NAME]; - if (present[HTML_TEXTAREA_ROWS] && value[HTML_TEXTAREA_ROWS]) - fromString(value[HTML_TEXTAREA_ROWS], _TextAreaRow); - if (present[HTML_TEXTAREA_COLS] && value[HTML_TEXTAREA_COLS]) - fromString(value[HTML_TEXTAREA_COLS], _TextAreaCols); + _TextAreaMaxLength = 1024; + if (present[MY_HTML_TEXTAREA_NAME] && value[MY_HTML_TEXTAREA_NAME]) + _TextAreaName = value[MY_HTML_TEXTAREA_NAME]; + if (present[MY_HTML_TEXTAREA_ROWS] && value[MY_HTML_TEXTAREA_ROWS]) + fromString(value[MY_HTML_TEXTAREA_ROWS], _TextAreaRow); + if (present[MY_HTML_TEXTAREA_COLS] && value[MY_HTML_TEXTAREA_COLS]) + fromString(value[MY_HTML_TEXTAREA_COLS], _TextAreaCols); + if (present[MY_HTML_TEXTAREA_MAXLENGTH] && value[MY_HTML_TEXTAREA_MAXLENGTH]) + fromString(value[MY_HTML_TEXTAREA_MAXLENGTH], _TextAreaMaxLength); _TextAreaTemplate = !templateName.empty() ? templateName : DefaultFormTextAreaGroup; _TextArea = true; @@ -1675,21 +1699,19 @@ namespace NLGUI break; case HTML_TEXTAREA: { - // Add the editbox - // nlinfo("textarea temp '%s'", _TextAreaTemplate.c_str()); - // nlinfo("textarea name '%s'", _TextAreaName.c_str()); - // nlinfo("textarea %d %d", _TextAreaRow, _TextAreaCols); - // nlinfo("textarea content '%s'", _TextAreaContent.toUtf8().c_str()); - CInterfaceGroup *textArea = addTextArea (_TextAreaTemplate, _TextAreaName.c_str (), _TextAreaRow, _TextAreaCols, true, _TextAreaContent); - if (textArea) + _TextArea = false; + if (!(_Forms.empty())) { - // Add the text area to the form - CGroupHTML::CForm::CEntry entry; - entry.Name = _TextAreaName; - entry.TextArea = textArea; - _Forms.back().Entries.push_back (entry); + CInterfaceGroup *textArea = addTextArea (_TextAreaTemplate, _TextAreaName.c_str (), _TextAreaRow, _TextAreaCols, true, _TextAreaContent, _TextAreaMaxLength); + if (textArea) + { + // Add the text area to the form + CGroupHTML::CForm::CEntry entry; + entry.Name = _TextAreaName; + entry.TextArea = textArea; + _Forms.back().Entries.push_back (entry); + } } - _TextArea = false; } break; case HTML_TITLE: @@ -3149,116 +3171,62 @@ namespace NLGUI void CGroupHTML::addImage(const char *img, bool globalColor, bool reloadImg) { // In a paragraph ? - if (_Paragraph) + if (!_Paragraph) { - string finalUrl; + newParagraph (0); + paragraphChange (); + } + + string finalUrl; + // No more text in this text view + _CurrentViewLink = NULL; + + // Not added ? + CViewBitmap *newImage = new CViewBitmap (TCtorParam()); + + // + // 1/ try to load the image with the old system (local files in bnp) + // + string image = CFile::getPath(img) + CFile::getFilenameWithoutExtension(img) + ".tga"; + if (lookupLocalFile (finalUrl, image.c_str(), false)) + { + newImage->setRenderLayer(getRenderLayer()+1); + image = finalUrl; + } + else + { // - // 1/ try to load the image with the old system (local files in bnp) + // 2/ if it doesn't work, try to load the image in cache // - string image = CFile::getPath(img) + CFile::getFilenameWithoutExtension(img) + ".tga"; - if (lookupLocalFile (finalUrl, image.c_str(), false)) + image = localImageName(img); + if (!reloadImg && lookupLocalFile (finalUrl, image.c_str(), false)) { - // No more text in this text view - _CurrentViewLink = NULL; - - // Not added ? - CViewBitmap *newImage = new CViewBitmap (TCtorParam()); - /* todo link in image - if (getA()) - { - newImage->Link = getLink(); - newImage->setHTMLView (this); - }*/ - newImage->setRenderLayer(getRenderLayer()+1); - newImage->setTexture (finalUrl); - newImage->setModulateGlobalColor(globalColor); - - /* todo link in image - if (getA()) - getParagraph()->addChildLink(newImage); - else*/ - getParagraph()->addChild(newImage); - paragraphChange (); + // don't display image that are not power of 2 + uint32 w, h; + CBitmap::loadSize (image, w, h); + if (w == 0 || h == 0 || ((!NLMISC::isPowerOf2(w) || !NLMISC::isPowerOf2(h)) && !NL3D::CTextureFile::supportNonPowerOfTwoTextures())) + image.clear(); } else { // - // 2/ if it doesn't work, try to load the image in cache + // 3/ if it doesn't work, display a placeholder and ask to dl the image into the cache // - image = localImageName(img); - if (!reloadImg && lookupLocalFile (finalUrl, image.c_str(), false)) - { - // No more text in this text view - _CurrentViewLink = NULL; - - // Not added ? - CViewBitmap *newImage = new CViewBitmap (TCtorParam()); - /* todo link in image - if (getA()) - { - newImage->Link = getLink(); - newImage->setHTMLView (this); - }*/ - - // don't display image that are not power of 2 - uint32 w, h; - CBitmap::loadSize (image, w, h); - if (w == 0 || h == 0 || ((!NLMISC::isPowerOf2(w) || !NLMISC::isPowerOf2(h)) && !NL3D::CTextureFile::supportNonPowerOfTwoTextures())) - image.clear(); - - newImage->setTexture (image); - // newImage->setTexture (finalUrl); - newImage->setModulateGlobalColor(globalColor); - - /* todo link in image - if (getA()) - getParagraph()->addChildLink(newImage); - else*/ - getParagraph()->addChild(newImage); - paragraphChange (); - } - else - { - - // - // 3/ if it doesn't work, display a placeholder and ask to dl the image into the cache - // - image = "web_del.tga"; - if (lookupLocalFile (finalUrl, image.c_str(), false)) - { - // No more text in this text view - _CurrentViewLink = NULL; - - // Not added ? - CViewBitmap *newImage = new CViewBitmap (TCtorParam()); - /* todo link in image - if (getA()) - { - newImage->Link = getLink(); - newImage->setHTMLView (this); - }*/ - newImage->setTexture (image); - // newImage->setTexture (finalUrl); - newImage->setModulateGlobalColor(globalColor); - - addImageDownload(img, newImage); - - /* todo link in image - if (getA()) - getParagraph()->addChildLink(newImage); - else*/ - getParagraph()->addChild(newImage); - paragraphChange (); - } - } + image = "web_del.tga"; + addImageDownload(img, newImage); } } + newImage->setTexture (image); + newImage->setModulateGlobalColor(globalColor); + + getParagraph()->addChild(newImage); + paragraphChange (); } // *************************************************************************** - CInterfaceGroup *CGroupHTML::addTextArea(const std::string &templateName, const char *name, uint /* rows */, uint cols, bool multiLine, const ucstring &content) + CInterfaceGroup *CGroupHTML::addTextArea(const std::string &templateName, const char *name, uint /* rows */, uint cols, bool multiLine, const ucstring &content, uint maxlength) { // In a paragraph ? if (!_Paragraph) @@ -3280,7 +3248,8 @@ namespace NLGUI templateParams.push_back (std::pair ("multiline", multiLine?"true":"false")); templateParams.push_back (std::pair ("want_return", multiLine?"true":"false")); templateParams.push_back (std::pair ("enter_recover_focus", "false")); - templateParams.push_back (std::pair ("max_num_chars", "1024")); + if (maxlength > 0) + templateParams.push_back (std::pair ("max_num_chars", toString(maxlength))); CInterfaceGroup *textArea = CWidgetManager::getInstance()->getParser()->createGroupInstance (templateName.c_str(), getParagraph()->getId(), templateParams.empty()?NULL:&(templateParams[0]), (uint)templateParams.size()); @@ -3677,14 +3646,18 @@ namespace NLGUI // *************************************************************************** - void CGroupHTML::submitForm (uint formId, const char *submitButtonName) + void CGroupHTML::submitForm (uint formId, const char *submitButtonType, const char *submitButtonName, const char *submitButtonValue, sint32 x, sint32 y) { // Form id valid ? if (formId < _Forms.size()) { _PostNextTime = true; _PostFormId = formId; + _PostFormSubmitType = submitButtonType; _PostFormSubmitButton = submitButtonName; + _PostFormSubmitValue = submitButtonValue; + _PostFormSubmitX = x; + _PostFormSubmitY = y; } } @@ -3957,9 +3930,22 @@ namespace NLGUI } } - // Add the button coordinates - HTParseFormInput(formfields, (_PostFormSubmitButton + "_x=0").c_str()); - HTParseFormInput(formfields, (_PostFormSubmitButton + "_y=0").c_str()); + if (_PostFormSubmitType == "image") + { + // Add the button coordinates + if (_PostFormSubmitButton.find_first_of("[") == string::npos) + { + HTParseFormInput(formfields, (_PostFormSubmitButton + "_x=" + NLMISC::toString(_PostFormSubmitX)).c_str()); + HTParseFormInput(formfields, (_PostFormSubmitButton + "_y=" + NLMISC::toString(_PostFormSubmitY)).c_str()); + } + else + { + HTParseFormInput(formfields, (_PostFormSubmitButton + "=" + NLMISC::toString(_PostFormSubmitX)).c_str()); + HTParseFormInput(formfields, (_PostFormSubmitButton + "=" + NLMISC::toString(_PostFormSubmitY)).c_str()); + } + } + else + HTParseFormInput(formfields, (_PostFormSubmitButton + "=" + _PostFormSubmitValue).c_str()); // Add custom params addHTTPPostParams(formfields, _TrustedDomain); diff --git a/code/nel/src/gui/group_menu.cpp b/code/nel/src/gui/group_menu.cpp index 85ed1959e..ddd022310 100644 --- a/code/nel/src/gui/group_menu.cpp +++ b/code/nel/src/gui/group_menu.cpp @@ -1203,6 +1203,7 @@ namespace NLGUI pV->setColor (_GroupMenu->_Color); pV->setFontSize (_GroupMenu->_FontSize); pV->setShadow (_GroupMenu->_Shadow); + pV->setShadowOutline (_GroupMenu->_ShadowOutline); pV->setCheckable(checkable); pV->setChecked(checked); pV->setModulateGlobalColor(_GroupMenu->_ModulateGlobalColor); @@ -1282,6 +1283,7 @@ namespace NLGUI pV->setColor (_GroupMenu->_Color); pV->setFontSize (_GroupMenu->_FontSize); pV->setShadow (_GroupMenu->_Shadow); + pV->setShadowOutline (_GroupMenu->_ShadowOutline); pV->setCheckable(checkable); pV->setChecked(checked); pV->setModulateGlobalColor(_GroupMenu->_ModulateGlobalColor); @@ -1922,6 +1924,7 @@ namespace NLGUI _HighLightOver.set(128, 0, 0, 255); _FontSize = 12; _Shadow = false; + _ShadowOutline = false; _ResizeFromChildH = _ResizeFromChildW = true; _DisplayFrame = false; _RootMenu = NULL; @@ -1998,6 +2001,11 @@ namespace NLGUI return toString( _Shadow ); } else + if( name == "shadow_outline" ) + { + return toString( _ShadowOutline ); + } + else if( name == "formatted" ) { return toString( _Formatted ); @@ -2110,6 +2118,14 @@ namespace NLGUI return; } else + if( name == "shadow_outline" ) + { + bool b; + if( fromString( value, b ) ) + _ShadowOutline = b; + return; + } + else if( name == "formatted" ) { bool b; @@ -2152,6 +2168,7 @@ namespace NLGUI xmlSetProp( node, BAD_CAST "space", BAD_CAST toString( _Space ).c_str() ); xmlSetProp( node, BAD_CAST "fontsize", BAD_CAST toString( _FontSize ).c_str() ); xmlSetProp( node, BAD_CAST "shadow", BAD_CAST toString( _Shadow ).c_str() ); + xmlSetProp( node, BAD_CAST "shadow_outline", BAD_CAST toString( _ShadowOutline ).c_str() ); xmlSetProp( node, BAD_CAST "formatted", BAD_CAST toString( _Formatted ).c_str() ); if( _RootMenu == NULL ) @@ -2183,7 +2200,7 @@ namespace NLGUI if( editorMode ) _Extends = std::string( (const char*)prop ); - CGroupMenu *gm = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(prop)); + CGroupMenu *gm = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(prop.str())); if (!gm) { gm = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:" + std::string((const char*)prop))); @@ -2197,6 +2214,7 @@ namespace NLGUI _Color = gm->_Color; _ShadowColor = gm->_ShadowColor; _Shadow = gm->_Shadow; + _ShadowOutline = gm->_ShadowOutline; _FontSize = gm->_FontSize; _ColorOver = gm->_ColorOver; _ShadowColorOver = gm->_ShadowColorOver; @@ -2266,6 +2284,10 @@ namespace NLGUI if (prop) _Shadow = convertBool(prop); + prop = (char*) xmlGetProp( in, (xmlChar*)"shadow_outline" ); + if (prop) + _ShadowOutline = convertBool(prop); + prop = (char*) xmlGetProp( in, (xmlChar*)"formatted" ); if (prop) _Formatted = convertBool(prop); diff --git a/code/nel/src/gui/group_paragraph.cpp b/code/nel/src/gui/group_paragraph.cpp index 00ea5f3b7..9e065c878 100644 --- a/code/nel/src/gui/group_paragraph.cpp +++ b/code/nel/src/gui/group_paragraph.cpp @@ -209,6 +209,8 @@ namespace NLGUI } nlassert(false); + + return ""; } else if( name == "align" ) @@ -229,6 +231,8 @@ namespace NLGUI } nlassert(false); + + return ""; } else if( name == "space" ) diff --git a/code/nel/src/gui/group_table.cpp b/code/nel/src/gui/group_table.cpp index 9f019ed48..65ed2d93d 100644 --- a/code/nel/src/gui/group_table.cpp +++ b/code/nel/src/gui/group_table.cpp @@ -44,9 +44,12 @@ namespace NLGUI TableRatio = 0.f; WidthWanted = 0; Height = 0; + ColSpan = 1; + RowSpan = 1; + TableColumnIndex = 0; Group = new CInterfaceGroup(CViewBase::TCtorParam()); Align = Left; - VAlign = Top; + VAlign = Middle; LeftMargin = 0; NoWrap = false; IgnoreMaxWidth = false; @@ -89,6 +92,8 @@ namespace NLGUI } nlassert(false); + + return ""; } else if( name == "valign" ) @@ -106,6 +111,8 @@ namespace NLGUI } nlassert(false); + + return ""; } else if( name == "left_margin" ) @@ -245,6 +252,22 @@ namespace NLGUI AddChildW = b; return; } + else + if (name == "colspan" ) + { + sint32 i; + if (fromString( value, i ) ) + ColSpan = std::max(1, i); + return; + } + else + if (name == "rowspan" ) + { + sint32 i; + if (fromString( value, i ) ) + RowSpan = std::max(1, i); + return; + } else CInterfaceGroup::setProperty( name, value ); } @@ -306,6 +329,8 @@ namespace NLGUI xmlSetProp( node, BAD_CAST "ignore_max_width", BAD_CAST toString( IgnoreMaxWidth ).c_str() ); xmlSetProp( node, BAD_CAST "ignore_min_width", BAD_CAST toString( IgnoreMinWidth ).c_str() ); xmlSetProp( node, BAD_CAST "add_child_w", BAD_CAST toString( AddChildW ).c_str() ); + xmlSetProp( node, BAD_CAST "colspan", BAD_CAST toString( ColSpan ).c_str() ); + xmlSetProp( node, BAD_CAST "rowspan", BAD_CAST toString( RowSpan ).c_str() ); return node; } @@ -418,6 +443,22 @@ namespace NLGUI { AddChildW = convertBool(ptr); } + // + ptr = (char*) xmlGetProp( cur, (xmlChar*)"colspan" ); + if (ptr) + { + sint32 i; + if (fromString((const char*)ptr, i)) + ColSpan = std::max(1, i); + } + // + ptr = (char*) xmlGetProp( cur, (xmlChar*)"rowspan" ); + if (ptr) + { + sint32 i; + if (fromString((const char*)ptr, i)) + RowSpan = std::max(1, i); + } return true; } @@ -495,6 +536,29 @@ namespace NLGUI } } + // Get the parent table + if (getParent ()) + { + CGroupTable *table = static_cast (getParent ()); + if (table->Border) { + CRGBA lighter = blend(table->BorderColor, CRGBA::White, 0.5f); + + CRGBA borderColorTL; + borderColorTL.modulateFromColor (lighter, CWidgetManager::getInstance()->getGlobalColor()); + borderColorTL.A = (uint8) (((uint16) table->CurrentAlpha * (uint16) borderColorTL.A) >> 8); + + CRGBA borderColorBR; + borderColorBR.modulateFromColor (table->BorderColor, CWidgetManager::getInstance()->getGlobalColor()); + borderColorBR.A = (uint8) (((uint16) table->CurrentAlpha * (uint16) borderColorBR.A) >> 8); + + CViewRenderer &rVR = *CViewRenderer::getInstance(); + rVR.drawRotFlipBitmap (_RenderLayer, _XReal, _YReal, _WReal, 1, 0, false, rVR.getBlankTextureId(), borderColorTL ); + rVR.drawRotFlipBitmap (_RenderLayer, _XReal, _YReal, 1, _HReal, 0, false, rVR.getBlankTextureId(), borderColorBR ); + rVR.drawRotFlipBitmap (_RenderLayer, _XReal, _YReal+_HReal-1, _WReal, 1, 0, false, rVR.getBlankTextureId(), borderColorBR ); + rVR.drawRotFlipBitmap (_RenderLayer, _XReal+_WReal-1, _YReal, 1, _HReal, 0, false, rVR.getBlankTextureId(), borderColorTL ); + } + } + CInterfaceGroup::draw (); } @@ -555,8 +619,9 @@ namespace NLGUI TableRatio = 0.f; ForceWidthMin = 0; Border=0; - CellPadding=0; - CellSpacing=0; + BorderColor = CRGBA(32, 32, 32, 255); + CellPadding=1; + CellSpacing=2; ContinuousUpdate = false; } @@ -688,35 +753,75 @@ namespace NLGUI // New cell ? if (cell->NewLine) + { + while (column < _Columns.size()) + { + if (_Columns[column].RowSpan > 1) + _Columns[column].RowSpan--; + column++; + } column = 0; + } // Resize the array if (column>=_Columns.size()) _Columns.resize(column+1); + // Handle rowspan from previous row + while (_Columns[column].RowSpan > 1) + { + _Columns[column].RowSpan--; + column++; + // if previous row had less elements, then we missing columns + if (column>=_Columns.size()) + _Columns.resize(column+1); + } + + // remember column index for later use + cell->TableColumnIndex = column; + + // new column, set rowspan from current + _Columns[column].RowSpan = cell->RowSpan; + float colspan = 1.f / cell->ColSpan; + float rowspan = 1.f / cell->RowSpan; + // Update sizes - if (cellWidth > _Columns[column].Width) - _Columns[column].Width = cellWidth; - if (cell->WidthMax > _Columns[column].WidthMax) - _Columns[column].WidthMax = cell->WidthMax; - if (cell->TableRatio > _Columns[column].TableRatio) - _Columns[column].TableRatio = cell->TableRatio; - if (cell->WidthWanted + additionnalWidth > _Columns[column].WidthWanted) - _Columns[column].WidthWanted = cell->WidthWanted + additionnalWidth; - if (cell->Height > _Columns[column].Height) - _Columns[column].Height = cell->Height; + if (cellWidth*colspan > _Columns[column].Width) + _Columns[column].Width = cellWidth*colspan; + if (cell->WidthMax*colspan > _Columns[column].WidthMax) + _Columns[column].WidthMax = cell->WidthMax*colspan; + if (cell->TableRatio*colspan > _Columns[column].TableRatio) + _Columns[column].TableRatio = cell->TableRatio*colspan; + if (cell->WidthWanted*colspan + additionnalWidth > _Columns[column].WidthWanted) + _Columns[column].WidthWanted = (sint32)(cell->WidthWanted*colspan) + additionnalWidth; if (_Columns[column].WidthWanted + additionnalWidth) _Columns[column].WidthMax = _Columns[column].WidthWanted + additionnalWidth; if (_Columns[column].WidthWanted > _Columns[column].Width) _Columns[column].Width = _Columns[column].WidthWanted; + if (cell->ColSpan > 1) { + // copy this info to all spanned columns, create new columns as needed + uint newsize = column + cell->ColSpan - 1; + if (newsize >= _Columns.size()) + _Columns.resize(newsize+1); + for(uint span = 0; span < cell->ColSpan -1; span++){ + column++; + _Columns[column].Width = _Columns[column-1].Width; + _Columns[column].WidthMax = _Columns[column-1].WidthMax; + _Columns[column].TableRatio = _Columns[column-1].TableRatio; + _Columns[column].WidthWanted = _Columns[column-1].WidthWanted; + _Columns[column].RowSpan = _Columns[column-1].RowSpan; + } + } + // Next column column++; } // Width of cells and table borders - sint32 borderWidth = 2*Border + ((sint32)_Columns.size()+1) * CellSpacing + ((sint32)_Columns.size()*2) * CellPadding; + sint32 padding = CellPadding + (Border ? 1 : 0); + sint32 borderWidth = 2*Border + ((sint32)_Columns.size()+1) * CellSpacing + ((sint32)_Columns.size()*2) * padding; // Get the width sint32 tableWidthMax = ForceWidthMin?ForceWidthMin:_LastParentW; // getWReal(); @@ -798,7 +903,6 @@ namespace NLGUI // Some space ? space = finalWidth - tableWidth; - if (space > 0) { // Then add in wanted Width cells @@ -888,6 +992,18 @@ namespace NLGUI } } } + + // If there is still space left, then sum up column widths + // and add all the remaining space to final column. + if (space > 0) + { + sint32 innerWidth = 0; + for(i=0;i<_Columns.size();i++) + innerWidth += _Columns[i].Width; + + if (innerWidth > 0 && finalWidth > innerWidth) + _Columns[_Columns.size()-1].Width += finalWidth - innerWidth; + } } } } @@ -898,7 +1014,8 @@ namespace NLGUI column = 0; sint32 row = 0; - sint32 currentX = Border + CellSpacing + CellPadding; + sint32 currentX = Border + CellSpacing + padding; + _Rows.clear (); for (i=0; i<_Cells.size(); i++) { @@ -907,25 +1024,41 @@ namespace NLGUI if (cell->NewLine) { column = 0; - currentX = Border + CellSpacing + CellPadding; + currentX = Border + CellSpacing + padding; + _Rows.push_back(CRow()); } + if (cell->TableColumnIndex > 0) + { + // we have active rowspan, must add up 'skipped' columns + for( ; columnTableColumnIndex; column++) + currentX += _Columns[column].Width + padding*2 + CellSpacing; + } + // Set the x and width // Check align sint32 alignmentX = 0; sint32 widthReduceX = 0; - if (cell->WidthMax < _Columns[column].Width) + sint32 columnWidth = _Columns[column].Width; + if (cell->ColSpan > 1) + { + // scan ahead and add up column widths as they might be different + for(int j = 1; jColSpan; j++) + columnWidth += CellSpacing + padding*2 + _Columns[column+j].Width; + } + + if (cell->WidthMax < columnWidth) { switch (cell->Align) { case CGroupCell::Center: - alignmentX = (_Columns[column].Width - cell->WidthMax) / 2; + alignmentX = (columnWidth - cell->WidthMax) / 2; widthReduceX = alignmentX * 2; break; case CGroupCell::Right: - alignmentX = _Columns[column].Width - cell->WidthMax; + alignmentX = columnWidth - cell->WidthMax; widthReduceX = alignmentX; break; default: @@ -933,11 +1066,11 @@ namespace NLGUI } } - cell->setX(currentX); - cell->setW(_Columns[column].Width); + cell->setX(currentX - padding); + cell->setW(columnWidth + padding*2); - cell->Group->setX(alignmentX+cell->LeftMargin); - cell->Group->setW(_Columns[column].Width - widthReduceX); + cell->Group->setX(alignmentX + cell->LeftMargin + padding); + cell->Group->setW(columnWidth - widthReduceX); cell->Group->CInterfaceElement::updateCoords(); // Update coords to get H @@ -945,16 +1078,17 @@ namespace NLGUI cell->Group->updateCoords(); // Resize the row array - _Rows.back().Height = std::max(cell->Height, std::max(_Rows.back().Height, (sint32)cell->Group->getH())); + float rowspan = 1 / cell->RowSpan; + _Rows.back().Height = std::max((sint32)(cell->Height*rowspan), std::max(_Rows.back().Height, (sint32)(cell->Group->getH()*rowspan))); // Next column - currentX += _Columns[column].Width + 2*CellPadding + CellSpacing; - column ++; + currentX += columnWidth + 2*padding + CellSpacing; + column += cell->ColSpan; } // Set cell Y row = 0; - sint32 currentY = -(Border + CellSpacing + CellPadding); + sint32 currentY = -(Border + CellSpacing + padding); for (i=0; i<_Cells.size(); i++) { // New cell ? @@ -963,37 +1097,45 @@ namespace NLGUI { if (_Rows[row].Height != 0) { - currentY -= _Rows[row].Height + 2*CellPadding + CellSpacing; + currentY -= _Rows[row].Height + 2*padding + CellSpacing; } row++; } // Check align sint32 alignmentY = 0; - if ((sint32)cell->Group->getH() < _Rows[row].Height) + sint32 rowHeight = _Rows[row].Height; + if (cell->RowSpan > 1) + { + // we need to scan down and add up row heights + int k = std::min((sint32)_Rows.size(), row + cell->RowSpan); + for(int j=row+1; jGroup->getH() < rowHeight) { switch (cell->VAlign) { case CGroupCell::Middle: - alignmentY = (_Rows[row].Height - (sint32)cell->Group->getH()) / 2; + alignmentY = (rowHeight - (sint32)cell->Group->getH()) / 2; break; case CGroupCell::Bottom: - alignmentY = _Rows[row].Height - (sint32)cell->Group->getH(); + alignmentY = rowHeight - (sint32)cell->Group->getH(); break; default: break; } } - cell->setY(currentY); - cell->setH (_Rows[row].Height); - cell->Group->setY(-alignmentY); + cell->setY(currentY + padding); + cell->setH (rowHeight + 2*padding); + cell->Group->setY(-(alignmentY + padding)); } // Resize the table setW(finalWidth+borderWidth-_LastParentW); if (!_Rows.empty()) - currentY -= _Rows[row].Height + CellPadding + CellSpacing + Border; + currentY -= _Rows[row].Height + padding + CellSpacing + Border; setH(-currentY); // All done @@ -1173,60 +1315,66 @@ namespace NLGUI if (gr == NULL) CurrentAlpha = 255; - if (!_Columns.empty() && !_Rows.empty() && BgColor.A) + if (!_Columns.empty() && !_Rows.empty()) { - sint32 border = Border + CellSpacing + CellPadding; - if (border) + sint32 border = Border + CellSpacing; + if (border && BgColor.A) { CRGBA finalColor; finalColor.modulateFromColor (BgColor, CWidgetManager::getInstance()->getGlobalColor()); finalColor.A = CurrentAlpha; - // Draw the top and bottom lines + // Draw the top line CViewRenderer &rVR = *CViewRenderer::getInstance(); - rVR.drawRotFlipBitmap (_RenderLayer, _XReal, _YReal, _WReal, border, 0, false, rVR.getBlankTextureId(), finalColor); rVR.drawRotFlipBitmap (_RenderLayer, _XReal, _YReal-border+_HReal, _WReal, border, 0, false, rVR.getBlankTextureId(), finalColor); - // Draw the left and right lines - sint32 insideHeight = std::max((sint32)0, (sint32)_HReal - (sint32)2*border); - rVR.drawRotFlipBitmap (_RenderLayer, _XReal, _YReal+border, border, insideHeight, 0, false, rVR.getBlankTextureId(), finalColor); - rVR.drawRotFlipBitmap (_RenderLayer, _XReal+_WReal-border, _YReal+border, border, insideHeight, 0, false, rVR.getBlankTextureId(), finalColor); + // Draw the left line + sint32 insideHeight = std::max((sint32)0, (sint32)_HReal - (sint32)border); + rVR.drawRotFlipBitmap (_RenderLayer, _XReal, _YReal, border, insideHeight, 0, false, rVR.getBlankTextureId(), finalColor); // Draw the inside borders - sint32 insideWidth = 2*CellPadding + CellSpacing; - if (insideWidth) + if (CellSpacing) { - // Draw the inside verticals uint i; - sint32 x = _XReal + _Columns[0].Width + border; - for (i=1; i<_Columns.size(); i++) + sint32 x, y; + for (i=0; i<_Cells.size(); i++) { - rVR.drawRotFlipBitmap (_RenderLayer, x, _YReal+border, insideWidth, insideHeight, 0, false, rVR.getBlankTextureId(), finalColor); - x += _Columns[i].Width + insideWidth; + CGroupCell *cell = _Cells[i]; + + x = cell->getXReal(); + y = cell->getYReal() - CellSpacing; + // right + rVR.drawRotFlipBitmap (_RenderLayer, x + cell->getW(), y, CellSpacing, cell->getH() + CellSpacing, 0, false, rVR.getBlankTextureId(), finalColor); + // bottom + rVR.drawRotFlipBitmap (_RenderLayer, x, y, cell->getW(), CellSpacing, 0, false, rVR.getBlankTextureId(), finalColor); } + } - // Draw the inside horizontals - sint32 y = _YReal + _HReal - border - _Rows[0].Height; - if (_Rows[0].Height != 0) - { - y -= insideWidth; - } - for (i=1; i<_Rows.size(); i++) - { - uint j; - x = _XReal + border; - if (_Rows[i].Height != 0) - { - for (j=0; j<_Columns.size(); j++) - { - rVR.drawRotFlipBitmap (_RenderLayer, x, y, _Columns[j].Width, insideWidth, 0, false, rVR.getBlankTextureId(), finalColor); - x += _Columns[j].Width + insideWidth; - } - y -= _Rows[i].Height+ insideWidth; - } - } + } + if (Border) + { + CViewRenderer &rVR = *CViewRenderer::getInstance(); + + CRGBA borderColorTL; + CRGBA lighter = blend(BorderColor, CRGBA::White, 0.5f); + borderColorTL.modulateFromColor (lighter, CWidgetManager::getInstance()->getGlobalColor()); + borderColorTL.A = CurrentAlpha; + + CRGBA borderColorBR; + borderColorBR.modulateFromColor (BorderColor, CWidgetManager::getInstance()->getGlobalColor()); + borderColorBR.A = CurrentAlpha; + + // beveled table border + for (sint32 i=0; igetSystemOption(CWidgetManager::OptionMulCoefAnim).getValFloat(); double animValue; - fromString(value, animValue); + fromString(value.str(), animValue); // Depending on the type of the track add the key switch(_Type) diff --git a/code/nel/src/gui/interface_element.cpp b/code/nel/src/gui/interface_element.cpp index 15f9cf812..66eee038e 100644 --- a/code/nel/src/gui/interface_element.cpp +++ b/code/nel/src/gui/interface_element.cpp @@ -130,24 +130,33 @@ namespace NLGUI if( name == "posref" ) { std::string posref; - posref = HotSpotToString( getParentPosRef() ); - posref += " "; posref += HotSpotToString( getPosRef() ); return posref; } else + if( name == "parentposref" ) + { + std::string parentPosRef; + parentPosRef = HotSpotToString( getParentPosRef() ); + return parentPosRef; + } + else if( name == "sizeref" ) { return getSizeRefAsString( _SizeRef, _SizeDivW, _SizeDivH ); } if( name == "posparent" ) { - return CWidgetManager::getInstance()->getParser()->getParentPosAssociation( (CInterfaceElement*)this ); + std::string pp; + getPosParent( pp ); + return pp; } else if( name == "sizeparent" ) { - return CWidgetManager::getInstance()->getParser()->getParentSizeAssociation( (CInterfaceElement*)this ); + std::string sp; + getSizeParent( sp ); + return sp; } else if( name == "global_color" ) @@ -221,10 +230,15 @@ namespace NLGUI else if( name == "posref" ) { - convertHotSpotCouple( value.c_str(), _ParentPosRef, _PosRef ); + _PosRef = convertHotSpot( value.c_str() ); return; } else + if( name == "parentposref" ) + { + _ParentPosRef = convertHotSpot( value.c_str() ); + } + else if( name == "sizeref" ) { parseSizeRef( value.c_str() ); @@ -284,11 +298,13 @@ namespace NLGUI xmlNewProp( node, BAD_CAST "w", BAD_CAST toString( _W ).c_str() ); xmlNewProp( node, BAD_CAST "h", BAD_CAST toString( _H ).c_str() ); xmlNewProp( node, BAD_CAST "posref", BAD_CAST HotSpotCoupleToString( _ParentPosRef, _PosRef ).c_str() ); - xmlNewProp( node, BAD_CAST "posparent", - BAD_CAST CWidgetManager::getInstance()->getParser()->getParentPosAssociation( (CInterfaceElement*)this ).c_str() ); + + std::string pp; + getPosParent( pp ); + xmlNewProp( node, BAD_CAST "posparent", BAD_CAST pp.c_str() ); xmlNewProp( node, BAD_CAST "sizeref", BAD_CAST getSizeRefAsString().c_str() ); - xmlNewProp( node, BAD_CAST "sizeparent", - BAD_CAST CWidgetManager::getInstance()->getParser()->getParentSizeAssociation( (CInterfaceElement*)this ).c_str() ); + getSizeParent( pp ); + xmlNewProp( node, BAD_CAST "sizeparent", BAD_CAST pp.c_str() ); xmlNewProp( node, BAD_CAST "global_color", BAD_CAST toString( _ModulateGlobalColor ).c_str() ); xmlNewProp( node, BAD_CAST "render_layer", BAD_CAST toString( _RenderLayer ).c_str() ); @@ -372,13 +388,13 @@ namespace NLGUI ptr = (char*) xmlGetProp( cur, (xmlChar*)"posparent" ); if (ptr) { - setPosParent( std::string( (const char*)ptr ) ); + parsePosParent( (const char*)ptr ); } ptr = (char*) xmlGetProp( cur, (xmlChar*)"sizeparent" ); if (ptr) { - setSizeParent( std::string( (const char*)ptr ) ); + parseSizeParent( (const char*)ptr ); } ptr = (char*) xmlGetProp (cur, (xmlChar*)"sizeref"); @@ -1516,42 +1532,170 @@ namespace NLGUI return false; } + void CInterfaceElement::parsePosParent( const std::string &id ) + { + CInterfaceElement *p = getParent(); + + if( ( id == "parent" ) || ( id.empty() ) ) + { + setParentPos( p ); + return; + } + + std::string ppId; + + if( p != NULL ) + ppId = p->getId() + ":" + id; + else + ppId = std::string( "ui:" ) + id; + + CWidgetManager::getInstance()->getParser()->addParentPositionAssociation( this, ppId ); + } + void CInterfaceElement::setPosParent( const std::string &id ) { - std::string Id = stripId( id ); + // Parent or empty id simply means the group parent + if( ( id == "parent" ) || ( id.empty() ) ) + { + setParentPos( getParent() ); + return; + } + + CInterfaceElement *pp = NULL; - if( Id != "parent" ) + // Check if it's a short Id + std::string::size_type idx = id.find( "ui:" ); + if( idx == std::string::npos ) { - std::string idParent; - if( _Parent != NULL ) - idParent = _Parent->getId() + ":"; - else - idParent = "ui:"; - CWidgetManager::getInstance()->getParser()->addParentPositionAssociation( this, idParent + Id ); + // If it is, find the widget in the parent group and set as posparent + CInterfaceGroup *p = getParent(); + if( p != NULL ) + { + pp = p->findFromShortId( id ); + } + } + else + { + // If it is not, find using the widgetmanager + // TODO: refactor, shouldn't use a singleton + pp = CWidgetManager::getInstance()->getElementFromId( id ); + } + + if( pp != NULL ) + setParentPos( pp ); + + } + + void CInterfaceElement::getPosParent( std::string &id ) const + { + + // If there's no pos parent set, then the parent group is the pos parent + if( getParentPos() == NULL ) + { + id = "parent"; + return; + } + + // If pos parent and parent are the same then ofc the parent group is the pos parent... + CInterfaceElement *p = getParent(); + if( getParentPos() == p ) + { + id = "parent"; + return; + } + + // If parent is in the same group, use the short id + p = getParentPos(); + if( p->isInGroup( getParent() ) ) + { + id = p->getShortId(); + return; } + + // Otherwise use the full id + id = p->getId(); } - void CInterfaceElement::setSizeParent( const std::string &id ) + void CInterfaceElement::parseSizeParent( const std::string &id ) { - std::string Id = stripId( id ); - std::string idParent; + CInterfaceElement *p = getParent(); - if( Id != "parent" ) + if( ( id == "parent" ) || ( id.empty() ) ) { - if( _Parent != NULL ) - idParent = _Parent->getId() + ":"; - else - idParent = "ui:"; - CWidgetManager::getInstance()->getParser()->addParentSizeAssociation( this, idParent + Id ); + setParentSize( p ); + return; } + + std::string spId; + + if( p != NULL ) + spId = p->getId() + ":" + id; else + spId = std::string( "ui:" ) + id; + + CWidgetManager::getInstance()->getParser()->addParentSizeAssociation( this, spId ); + } + + void CInterfaceElement::setSizeParent( const std::string &id ) + { + // Parent or empty id simply means the group parent + if( ( id == "parent" ) || ( id.empty() ) ) { - if( _Parent != NULL ) + setParentSize( getParent() ); + return; + } + + CInterfaceElement *pp = NULL; + + // Check if it's a short Id + std::string::size_type idx = id.find( "ui:" ); + if( idx == std::string::npos ) + { + // If it is, find the widget in the parent group and set as posparent + CInterfaceGroup *p = getParent(); + if( p != NULL ) { - idParent = _Parent->getId(); - CWidgetManager::getInstance()->getParser()->addParentSizeAssociation( this, idParent ); + pp = p->findFromShortId( id ); } } + else + { + // If it is not, find using the widgetmanager + // TODO: refactor, shouldn't use a singleton + pp = CWidgetManager::getInstance()->getElementFromId( id ); + } + + if( pp != NULL ) + setParentSize( pp ); + } + + void CInterfaceElement::getSizeParent( std::string &id ) const + { + CInterfaceElement *p = getParentSize(); + + // If there's no parent set then the size parent is the parent + if( p == NULL ) + { + id = "parent"; + return; + } + + // If the size parent is the same as the group parent, then the size parent is the parent ofc + if( p == getParent() ) + { + id = "parent"; + return; + } + + // If the size parent is in the parent group, use the short Id + if( p->isInGroup( getParent() ) ) + { + id = p->getShortId(); + return; + } + + // Otherwise use the full Id + id = p->getId(); } void CInterfaceElement::registerDeletionWatcher( IDeletionWatcher *watcher ) @@ -1584,6 +1728,105 @@ namespace NLGUI } } + void CInterfaceElement::getHSCoords( const THotSpot &hs, sint32 &x, sint32 &y ) const + { + x = _XReal; + y = _YReal; + + if( ( hs & Hotspot_Mx ) != 0 ) + y += _HReal / 2; + else + if( ( hs & Hotspot_Tx ) != 0 ) + y += _HReal; + + + if( ( hs & Hotspot_xM ) != 0 ) + x += _WReal / 2; + else + if( ( hs & Hotspot_xR ) != 0 ) + x += _WReal; + } + + void CInterfaceElement::getClosestHotSpot( const CInterfaceElement *other, THotSpot &hs ) + { + /// Iterate over the following hotspots, calculate the distance and store the closest + + + static THotSpot hslist[] = + { + Hotspot_BL, + Hotspot_BR, + Hotspot_MM, + Hotspot_TL, + Hotspot_TR + }; + + int c = sizeof( hslist ) / sizeof( THotSpot ); + + int x,y,ox,oy,vx,vy; + float d; + float closestd = 9999999.0f; + THotSpot closestHS = Hotspot_TR; + + for( int i = 0; i < c; i++ ) + { + other->getHSCoords( hslist[ i ], ox, oy ); + getHSCoords( hslist[ i ], x, y ); + + // Make a vector between the two hotspots + vx = x - ox; + vy = y - oy; + + // Calculate length + d = sqrt( pow( vx, 2.0f ) + pow( vy, 2.0f ) ); + + // If these hotspots are the closest, store the hotspot + if( d < closestd ) + { + closestd = d; + closestHS = hslist[ i ]; + } + } + + hs = closestHS; + } + + void CInterfaceElement::alignTo( CInterfaceElement *other ) + { + if( other == this ) + return; + + // Check which hotspot is the closest + THotSpot hs; + other->getClosestHotSpot( this, hs ); + + // Get the hotspot coordinates + sint32 x, y, ox, oy; + getHSCoords( hs, x, y ); + other->getHSCoords( hs, ox, oy ); + + // Calculate the difference between the hotspot we found and our current position, + sint32 dx = ox - x; + sint32 dy = oy - y; + + // This difference is our offset, so we remain in the same position + setX( -1 * dx ); + setY( -1 * dy ); + + setPosRef( hs ); + setParentPosRef( hs ); + + invalidateCoords(); + } + + void CInterfaceElement::onWidgetDeleted( CInterfaceElement *e ) + { + if( e == getParentPos() ) + setParentPos( NULL ); + if( e == getParentSize() ) + setParentSize( NULL ); + } + CStringMapper* CStringShared::_UIStringMapper = NULL; diff --git a/code/nel/src/gui/interface_factory.cpp b/code/nel/src/gui/interface_factory.cpp new file mode 100644 index 000000000..ec914baa6 --- /dev/null +++ b/code/nel/src/gui/interface_factory.cpp @@ -0,0 +1,29 @@ +// Ryzom - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "nel/gui/interface_factory.h" +#include "nel/gui/view_base.h" +#include "nel/misc/factory.h" + +namespace NLGUI +{ + CViewBase* CInterfaceFactory::createClass( const std::string &name ) + { + return NLMISC_GET_FACTORY( CViewBase, std::string ).createObject( std::string( name ) , CViewBase::TCtorParam() ); + } +} + + diff --git a/code/nel/src/gui/interface_group.cpp b/code/nel/src/gui/interface_group.cpp index 5fa83e1c5..b5027a87c 100644 --- a/code/nel/src/gui/interface_group.cpp +++ b/code/nel/src/gui/interface_group.cpp @@ -312,7 +312,7 @@ namespace NLGUI ptr = (char*) xmlGetProp( cur, (xmlChar*)"max_sizeparent" ); if (ptr) { - string idparent = ptr; + string idparent = ptr.str(); idparent = NLMISC::strlwr(idparent); if (idparent != "parent") { @@ -911,6 +911,31 @@ namespace NLGUI } } + // ------------------------------------------------------------------------------------------------ + void CInterfaceGroup::addElement (CInterfaceElement *child, sint eltOrder /*= -1*/) + { + if (!child) + { + nlwarning(" : tried to add a NULL view"); + return; + } + + if( child->isGroup() ) + { + addGroup( static_cast< CInterfaceGroup* >( child ), eltOrder ); + } + else + if( child->isCtrl() ) + { + addCtrl( static_cast< CCtrlBase* >( child ), eltOrder ); + } + else + if( child->isView() ) + { + addView( static_cast< CViewBase* >( child ), eltOrder ); + } + } + // ------------------------------------------------------------------------------------------------ void CInterfaceGroup::addView (CViewBase *child, sint eltOrder /*= -1*/) { @@ -1312,6 +1337,11 @@ namespace NLGUI for (ite = _EltOrder.begin() ; ite != _EltOrder.end(); ite++) { CViewBase *pVB = *ite; + if( pVB->getName() == "=MARKED=" ) + { + nlinfo( "=MARKED=" ); + } + if (pVB->getActive()) pVB->draw(); } @@ -1638,6 +1668,32 @@ namespace NLGUI return delView(static_cast(pIE)); } + // ------------------------------------------------------------------------------------------------ + CInterfaceElement* CInterfaceGroup::takeElement( CInterfaceElement *e ) + { + bool ok = false; + + if( e->isGroup() ) + { + ok = delGroup( static_cast< CInterfaceGroup* >( e ), true ); + } + else + if( e->isCtrl() ) + { + ok = delCtrl( static_cast< CCtrlBase* >( e ), true ); + } + else + if( e->isView() ) + { + ok = delView( static_cast< CViewBase* >( e ), true ); + } + + if( ok ) + return e; + else + return NULL; + } + // ------------------------------------------------------------------------------------------------ bool CInterfaceGroup::isWindowUnder (sint32 x, sint32 y) { @@ -2488,5 +2544,101 @@ namespace NLGUI for( std::vector< CInterfaceGroup* >::iterator itr = _ChildrenGroups.begin(); itr != _ChildrenGroups.end(); ++itr ) (*itr)->onWidgetDeleted( e ); } + + void CInterfaceGroup::moveBy( sint32 x, sint32 y ) + { + CInterfaceElement::moveBy( x, y ); + + for( int i = 0; i < _EltOrder.size(); i++ ) + { + CViewBase *v = _EltOrder[ i ]; + v->updateCoords(); + } + } + + bool CInterfaceGroup::explode() + { + CInterfaceGroup *p = getParent(); + if( p == NULL ) + return false; + + std::string oldId; + + // Reparent children + for( sint32 i = 0; i < _EltOrder.size(); i++ ) + { + CInterfaceElement *e = _EltOrder[ i ]; + + oldId = e->getId(); + + e->setW( e->getWReal() ); + e->setH( e->getHReal() ); + e->setSizeRef( "" ); + + e->setParent( p ); + + e->setParentPos( p ); + e->setParentSize( p ); + e->alignTo( p ); + + p->addElement( e ); + e->setIdRecurse( e->getShortId() ); + + CWidgetManager::getInstance()->onWidgetMoved( oldId, e->getId() ); + } + + _EltOrder.clear(); + _Views.clear(); + _Controls.clear(); + _ChildrenGroups.clear(); + + return true; + } + + void CInterfaceGroup::spanElements() + { + sint32 minx = std::numeric_limits< sint32 >::max(); + sint32 miny = std::numeric_limits< sint32 >::max(); + sint32 maxx = std::numeric_limits< sint32 >::min(); + sint32 maxy = std::numeric_limits< sint32 >::min(); + + sint32 tlx,tly,brx,bry; + + // Find the min and max coordinates of the elements + for( int i = 0; i < _EltOrder.size(); i++ ) + { + CViewBase *v = _EltOrder[ i ]; + + v->getHSCoords( Hotspot_TL, tlx, tly ); + v->getHSCoords( Hotspot_BR, brx, bry ); + + if( tlx < minx ) + minx = tlx; + if( brx > maxx ) + maxx = brx; + if( bry < miny ) + miny = bry; + if( tly > maxy ) + maxy = tly; + } + + // Set the position and the width and height based on these coords + setW( maxx - minx ); + setH( maxy - miny ); + _WReal = getW(); + _HReal = getH(); + _XReal = minx; + _YReal = miny; + } + + void CInterfaceGroup::alignElements() + { + for( int i = 0; i < _EltOrder.size(); i++ ) + { + CViewBase *v = _EltOrder[ i ]; + v->alignTo( this ); + } + } + } diff --git a/code/nel/src/gui/interface_options.cpp b/code/nel/src/gui/interface_options.cpp index 9f70ceeff..3de015d65 100644 --- a/code/nel/src/gui/interface_options.cpp +++ b/code/nel/src/gui/interface_options.cpp @@ -271,16 +271,25 @@ namespace NLGUI // TxId_TL_HighLight = rVR.getTextureIdFromName (getValStr("tx_tl_highlight")); + rVR.getTextureSizeFromId(TxId_TL_HighLight, W_TL_HighLight, H_TL_HighLight); TxId_T_HighLight = rVR.getTextureIdFromName (getValStr("tx_t_highlight")); + rVR.getTextureSizeFromId(TxId_T_HighLight, W_T_HighLight, H_T_HighLight); TxId_TR_HighLight = rVR.getTextureIdFromName (getValStr("tx_tr_highlight")); + rVR.getTextureSizeFromId(TxId_TR_HighLight, W_TR_HighLight, H_TR_HighLight); TxId_L_HighLight = rVR.getTextureIdFromName (getValStr("tx_l_highlight")); + rVR.getTextureSizeFromId(TxId_L_HighLight, W_L_HighLight, H_L_HighLight); TxId_R_HighLight = rVR.getTextureIdFromName (getValStr("tx_r_highlight")); + rVR.getTextureSizeFromId(TxId_R_HighLight, W_R_HighLight, H_R_HighLight); TxId_BL_HighLight = rVR.getTextureIdFromName (getValStr("tx_bl_highlight")); + rVR.getTextureSizeFromId(TxId_BL_HighLight, W_BL_HighLight, H_BL_HighLight); TxId_B_HighLight = rVR.getTextureIdFromName (getValStr("tx_b_highlight")); + rVR.getTextureSizeFromId(TxId_B_HighLight, W_B_HighLight, H_B_HighLight); TxId_BR_HighLight = rVR.getTextureIdFromName (getValStr("tx_br_highlight")); + rVR.getTextureSizeFromId(TxId_BR_HighLight, W_BR_HighLight, H_BR_HighLight); // HeaderH = getValSInt32("header_h"); + InsetT = getValSInt32("inset_t"); return true; } diff --git a/code/nel/src/gui/interface_parser.cpp b/code/nel/src/gui/interface_parser.cpp index 3d7a1c849..1dbf62d51 100644 --- a/code/nel/src/gui/interface_parser.cpp +++ b/code/nel/src/gui/interface_parser.cpp @@ -37,6 +37,7 @@ #include "nel/gui/lua_helper.h" #include "nel/gui/lua_ihm.h" #include "nel/gui/lua_manager.h" +#include "nel/gui/root_group.h" #ifdef LUA_NEVRAX_VERSION #include "lua_ide_dll_nevrax/include/lua_ide_dll/ide_interface.h" // external debugger @@ -113,86 +114,6 @@ namespace NLGUI return node; } - - - // ---------------------------------------------------------------------------- - // CRootGroup - // ---------------------------------------------------------------------------- - - class CRootGroup : public CInterfaceGroup - { - public: - CRootGroup(const TCtorParam ¶m) - : CInterfaceGroup(param) - { } - - /// Destructor - virtual ~CRootGroup() { } - - virtual CInterfaceElement* getElement (const std::string &id) - { - if (_Id == id) - return this; - - if (id.substr(0, _Id.size()) != _Id) - return NULL; - - vector::const_iterator itv; - for (itv = _Views.begin(); itv != _Views.end(); itv++) - { - CViewBase *pVB = *itv; - if (pVB->getId() == id) - return pVB; - } - - vector::const_iterator itc; - for (itc = _Controls.begin(); itc != _Controls.end(); itc++) - { - CCtrlBase* ctrl = *itc; - if (ctrl->getId() == id) - return ctrl; - } - - // Accelerate - string sTmp = id; - sTmp = sTmp.substr(_Id.size()+1,sTmp.size()); - string::size_type pos = sTmp.find(':'); - if (pos != string::npos) - sTmp = sTmp.substr(0,pos); - - map::iterator it = _Accel.find(sTmp); - if (it != _Accel.end()) - { - CInterfaceGroup *pIG = it->second; - return pIG->getElement(id); - } - return NULL; - } - - virtual void addGroup (CInterfaceGroup *child, sint eltOrder = -1) - { - string sTmp = child->getId(); - sTmp = sTmp.substr(_Id.size()+1,sTmp.size()); - _Accel.insert(pair(sTmp, child)); - CInterfaceGroup::addGroup(child,eltOrder); - } - - virtual bool delGroup (CInterfaceGroup *child, bool dontDelete = false) - { - string sTmp = child->getId(); - sTmp = sTmp.substr(_Id.size()+1,sTmp.size()); - map::iterator it = _Accel.find(sTmp); - if (it != _Accel.end()) - { - _Accel.erase(it); - } - return CInterfaceGroup::delGroup(child,dontDelete); - } - - private: - map _Accel; - }; - // ---------------------------------------------------------------------------- // CInterfaceParser // ---------------------------------------------------------------------------- @@ -233,6 +154,22 @@ namespace NLGUI destStream.seek(0, NLMISC::IStream::begin); } + std::string CInterfaceParser::lookup( const std::string &file ) + { + std::string filename; + + if( editorMode && !_WorkDir.empty() ) + { + std::string wdpath = CPath::standardizePath( _WorkDir ) + file; + if( CFile::fileExists( wdpath ) ) + filename = wdpath; + } + if( filename.empty() ) + filename = CPath::lookup( file ); + + return filename; + } + // ---------------------------------------------------------------------------- bool CInterfaceParser::parseInterface (const std::vector & strings, bool reload, bool isFilename, bool checkInData) { @@ -270,7 +207,7 @@ namespace NLGUI { //get the first file document pointer firstFileName = *it; - string filename = CPath::lookup(firstFileName); + string filename = lookup( firstFileName ); bool isInData = false; string::size_type pos = filename.find ("@"); if (pos != string::npos) @@ -283,7 +220,7 @@ namespace NLGUI isInData = true; } - if ((needCheck && !isInData) || !file.open (CPath::lookup(firstFileName))) + if ((needCheck && !isInData) || !file.open (lookup(firstFileName))) { // todo hulud interface syntax error nlwarning ("could not open file %s, skipping xml parsing",firstFileName.c_str()); @@ -331,7 +268,7 @@ namespace NLGUI { saveParseResult = true; std::string archive = CPath::lookup(nextFileName + "_compressed", false, false); - std::string current = CPath::lookup(nextFileName, false, false); + std::string current = lookup(nextFileName); if (!archive.empty() && !current.empty()) { if (CFile::getFileModificationDate(current) <= CFile::getFileModificationDate(archive)) @@ -351,7 +288,7 @@ namespace NLGUI { if (isFilename) { - if (!file.open(CPath::lookup(nextFileName, false, false))) + if (!file.open(lookup(nextFileName))) { // todo hulud interface syntax error nlwarning ("could not open file %s, skipping xml parsing",nextFileName.c_str()); @@ -647,8 +584,7 @@ namespace NLGUI { if(!parseLUAScript(root)) { - nlwarning ("could not parse 'lua'"); - exit( EXIT_FAILURE ); + nlerror ("could not parse 'lua'"); } } else @@ -728,7 +664,7 @@ namespace NLGUI //if it begins with a #, it is a reference in the instance attribute if (strchr(ptr, '#') != NULL) { - string LastProp = ptr; + string LastProp = ptr.str(); string NewProp =""; string RepProp; @@ -860,7 +796,7 @@ namespace NLGUI return false; } sint32 size; - fromString(cSize, size); + fromString(cSize.str(), size); if (size <= 0) { // todo hulud interface syntax error @@ -993,7 +929,7 @@ namespace NLGUI nlwarning(" Can't read the expression for a link node"); return false; } - std::string expr = ptr; + std::string expr = ptr.str(); std::vector targets; @@ -1183,13 +1119,13 @@ namespace NLGUI nlinfo ("options has no name"); return false; } - string optionsName = ptr; + string optionsName = ptr.str(); // herit if possible ptr = (char*) xmlGetProp( cur, (xmlChar*)"herit" ); if (ptr) { - string optionsParentName = ptr; + string optionsParentName = ptr.str(); CInterfaceOptions *io = wm->getOptions( optionsParentName ); if( io != NULL ) options->copyBasicMap( *io ); @@ -1835,7 +1771,7 @@ namespace NLGUI { CInterfaceExprValue res; - if (CInterfaceExpr::eval(ptrVal2, res)) + if (CInterfaceExpr::eval(ptrVal2.str(), res)) { if (!res.toString()) { @@ -1871,7 +1807,7 @@ namespace NLGUI nlwarning ("no id in a procedure"); return false; } - string procId= ptr; + string procId= ptr.str(); if (_ProcedureMap.find(procId) != _ProcedureMap.end()) { @@ -2235,7 +2171,7 @@ namespace NLGUI //get the property value ptr = (char*)xmlGetProp( cur, props->name); nlassert(ptr); - string propVal= ptr; + string propVal= ptr.str(); string newPropVal; // solve define of this prop @@ -2392,7 +2328,7 @@ namespace NLGUI nlinfo ("anim has no id"); return false; } - string animId = ptr; + string animId = ptr.str(); pAnim = new CInterfaceAnim; if (pAnim->parse (cur, parentGroup)) @@ -3015,6 +2951,34 @@ namespace NLGUI itr->second = linkData; } + void CInterfaceParser::setVariable( const VariableData &v ) + { + CInterfaceProperty prop; + const std::string &type = v.type; + const std::string &value = v.value; + const std::string &entry = v.entry; + + if( type == "sint64" ) + prop.readSInt64( value.c_str(), entry ); + else + if( type == "sint32" ) + prop.readSInt32( value.c_str(), entry ); + else + if( type == "float" || type == "double" ) + prop.readDouble( value.c_str(), entry ); + else + if( type == "bool" ) + prop.readBool( value.c_str(), entry ); + else + if( type == "rgba" ) + prop.readRGBA( value.c_str(), entry ); + else + if( type == "hotspot" ) + prop.readHotSpot( value.c_str(), entry ); + + variableCache[ entry ] = v; + } + bool CInterfaceParser::serializeVariables( xmlNodePtr parentNode ) const { diff --git a/code/nel/src/gui/libwww.cpp b/code/nel/src/gui/libwww.cpp index 1e5f7a226..b17d1cccb 100644 --- a/code/nel/src/gui/libwww.cpp +++ b/code/nel/src/gui/libwww.cpp @@ -86,6 +86,7 @@ namespace NLGUI HTML_ATTR(TABLE,ALIGN), HTML_ATTR(TABLE,BGCOLOR), HTML_ATTR(TABLE,BORDER), + HTML_ATTR(TABLE,BORDERCOLOR), HTML_ATTR(TABLE,CELLPADDING), HTML_ATTR(TABLE,CELLSPACING), HTML_ATTR(TABLE,CLASS), @@ -201,6 +202,7 @@ namespace NLGUI HTML_ATTR(TEXTAREA,DISABLED), HTML_ATTR(TEXTAREA,ID), HTML_ATTR(TEXTAREA,LANG), + HTML_ATTR(TEXTAREA,MAXLENGTH), HTML_ATTR(TEXTAREA,NAME), HTML_ATTR(TEXTAREA,READONLY), HTML_ATTR(TEXTAREA,ROWS), diff --git a/code/nel/src/gui/libwww_nel_stream.cpp b/code/nel/src/gui/libwww_nel_stream.cpp index f6a45cf06..b7e218b30 100644 --- a/code/nel/src/gui/libwww_nel_stream.cpp +++ b/code/nel/src/gui/libwww_nel_stream.cpp @@ -21,7 +21,7 @@ extern "C" { - /* Library Includes */ +/* Library Includes */ #include "wwwsys.h" #include "WWWUtil.h" #include "WWWCore.h" @@ -41,8 +41,9 @@ using namespace NLMISC; extern "C" { - /* Final states have negative value */ -typedef enum _FileState { +/* Final states have negative value */ +typedef enum _FileState +{ FS_RETRY = -4, FS_ERROR = -3, FS_NO_DATA = -2, @@ -57,26 +58,29 @@ typedef enum _FileState { } FileState; /* This is the context structure for the this module */ -typedef struct _file_info { - FileState state; /* Current state of the connection */ - char * local; /* Local representation of file name */ - struct stat stat_info; /* Contains actual file chosen */ +typedef struct _file_info +{ + FileState state; /* Current state of the connection */ + char * local; /* Local representation of file name */ + struct stat stat_info; /* Contains actual file chosen */ HTNet * net; HTTimer * timer; } file_info; -struct _HTStream { +struct _HTStream +{ const HTStreamClass * isa; }; -struct _HTInputStream { +struct _HTInputStream +{ const HTInputStreamClass * isa; HTChannel * ch; HTHost * host; - char * write; /* Last byte written */ - char * read; /* Last byte read */ + char * write; /* Last byte written */ + char * read; /* Last byte read */ int b_read; - char data [INPUT_BUFFER_SIZE]; /* buffer */ + char data [INPUT_BUFFER_SIZE]; /* buffer */ }; PRIVATE int FileCleanup (HTRequest *req, int status) @@ -96,7 +100,7 @@ PRIVATE int FileCleanup (HTRequest *req, int status) } /* - ** Remove if we have registered a timer function as a callback + ** Remove if we have registered a timer function as a callback */ if (file->timer) { @@ -123,10 +127,8 @@ PUBLIC int HTLoadNeLFile (SOCKET soc, HTRequest * request) HTNet * net = HTRequest_net(request); HTParentAnchor * anchor = HTRequest_anchor(request); - HTTRACE(PROT_TRACE, "HTLoadFile.. Looking for `%s\'\n" _ - HTAnchor_physical(anchor)); - if ((file = (file_info *) HT_CALLOC(1, sizeof(file_info))) == NULL) - HT_OUTOFMEM((char*)"HTLoadFILE"); + HTTRACE(PROT_TRACE, "HTLoadFile.. Looking for `%s\'\n" _ HTAnchor_physical(anchor)); + if ((file = (file_info *) HT_CALLOC(1, sizeof(file_info))) == NULL) HT_OUTOFMEM("HTLoadFILE"); file->state = FS_BEGIN; file->net = net; HTNet_setContext(net, file); @@ -139,8 +141,8 @@ PUBLIC int HTLoadNeLFile (SOCKET soc, HTRequest * request) PRIVATE int ReturnEvent (HTTimer * timer, void * param, HTEventType /* type */) { file_info * file = (file_info *) param; - if (timer != file->timer) - HTDEBUGBREAK((char*)"File timer %p not in sync\n" _ timer); + if (timer != file->timer) HTDEBUGBREAK("File timer %p not in sync\n" _ timer); + HTTRACE(PROT_TRACE, "HTLoadFile.. Continuing %p with timer %p\n" _ file _ timer); /* @@ -163,7 +165,7 @@ PUBLIC int HTNeLFileOpen (HTNet * net, char * local, HTLocalMode /* mode */) if (!fp->open (local)) { - HTRequest_addSystemError(request, ERR_FATAL, errno, NO, (char*)"CIFile::open"); + HTRequest_addSystemError(request, ERR_FATAL, errno, NO, "CIFile::open"); return HT_ERROR; } @@ -186,7 +188,7 @@ PRIVATE int FileEvent (SOCKET /* soc */, void * pVoid, HTEventType type) { /* Interrupted */ HTRequest_addError(request, ERR_FATAL, NO, HTERR_INTERRUPTED, - NULL, 0, (char*)"HTLoadFile"); + NULL, 0, "HTLoadFile"); FileCleanup(request, HT_INTERRUPTED); return HT_OK; } @@ -202,7 +204,7 @@ PRIVATE int FileEvent (SOCKET /* soc */, void * pVoid, HTEventType type) /* We only support safe (GET, HEAD, etc) methods for the moment */ if (!HTMethod_isSafe(HTRequest_method(request))) { HTRequest_addError(request, ERR_FATAL, NO, HTERR_NOT_ALLOWED, - NULL, 0, (char*)"HTLoadFile"); + NULL, 0, "HTLoadFile"); file->state = FS_ERROR; break; } @@ -234,166 +236,188 @@ PRIVATE int FileEvent (SOCKET /* soc */, void * pVoid, HTEventType type) /* Create a new host object and link it to the net object */ { - HTHost * host = NULL; - if ((host = HTHost_new((char*)"localhost", 0)) == NULL) return HT_ERROR; - HTNet_setHost(net, host); - if (HTHost_addNet(host, net) == HT_PENDING) { - HTTRACE(PROT_TRACE, "HTLoadFile.. Pending...\n"); - /* move to the hack state */ - file->state = FS_PENDING; - return HT_OK; - } + HTHost * host = NULL; + if ((host = HTHost_new("localhost", 0)) == NULL) return HT_ERROR; + HTNet_setHost(net, host); + if (HTHost_addNet(host, net) == HT_PENDING) + { + HTTRACE(PROT_TRACE, "HTLoadFile.. Pending...\n"); + /* move to the hack state */ + file->state = FS_PENDING; + return HT_OK; + } } file->state = FS_DO_CN; break; case FS_PENDING: { - HTHost * host = NULL; - if ((host = HTHost_new((char*)"localhost", 0)) == NULL) return HT_ERROR; - HTNet_setHost(net, host); - if (HTHost_addNet(host, net) == HT_PENDING) { - HTTRACE(PROT_TRACE, "HTLoadFile.. Pending...\n"); - file->state = FS_PENDING; - return HT_OK; - } + HTHost * host = NULL; + if ((host = HTHost_new((char*)"localhost", 0)) == NULL) return HT_ERROR; + HTNet_setHost(net, host); + if (HTHost_addNet(host, net) == HT_PENDING) + { + HTTRACE(PROT_TRACE, "HTLoadFile.. Pending...\n"); + file->state = FS_PENDING; + return HT_OK; + } } file->state = FS_DO_CN; break; case FS_DO_CN: if (HTRequest_negotiation(request) && - HTMethod_isSafe(HTRequest_method(request))) { - - HTAnchor_setPhysical(anchor, file->local); - HTTRACE(PROT_TRACE, "Load File... Found `%s\'\n" _ file->local); - - } else { - if (HT_STAT(file->local, &file->stat_info) == -1) { - HTTRACE(PROT_TRACE, "Load File... Not found `%s\'\n" _ file->local); - HTRequest_addError(request, ERR_FATAL, NO, HTERR_NOT_FOUND, - NULL, 0, (char*)"HTLoadFile"); - file->state = FS_ERROR; - break; + HTMethod_isSafe(HTRequest_method(request))) + { + HTAnchor_setPhysical(anchor, file->local); + HTTRACE(PROT_TRACE, "Load File... Found `%s\'\n" _ file->local); } + else + { + if (HT_STAT(file->local, &file->stat_info) == -1) + { + HTTRACE(PROT_TRACE, "Load File... Not found `%s\'\n" _ file->local); + HTRequest_addError(request, ERR_FATAL, NO, HTERR_NOT_FOUND, NULL, 0, "HTLoadFile"); + file->state = FS_ERROR; + break; + } } - if (((file->stat_info.st_mode) & S_IFMT) == S_IFDIR) { - if (HTRequest_method(request) == METHOD_GET) - file->state = FS_PARSE_DIR; - else { - HTRequest_addError(request, ERR_INFO, NO, HTERR_NO_CONTENT, - NULL, 0, (char*)"HTLoadFile"); - file->state = FS_NO_DATA; - } - break; + if (((file->stat_info.st_mode) & S_IFMT) == S_IFDIR) + { + if (HTRequest_method(request) == METHOD_GET) + { + file->state = FS_PARSE_DIR; + } + else + { + HTRequest_addError(request, ERR_INFO, NO, HTERR_NO_CONTENT, NULL, 0, "HTLoadFile"); + file->state = FS_NO_DATA; + } + break; } { - BOOL editable = FALSE; - HTBind_getAnchorBindings(anchor); - if (editable) HTAnchor_appendAllow(anchor, METHOD_PUT); + BOOL editable = FALSE; + HTBind_getAnchorBindings(anchor); + if (editable) HTAnchor_appendAllow(anchor, METHOD_PUT); - /* Set the file size */ - CIFile nelFile; - if (nelFile.open (file->local)) - { - file->stat_info.st_size = nelFile.getFileSize(); - } - nelFile.close(); - - if (file->stat_info.st_size) - HTAnchor_setLength(anchor, file->stat_info.st_size); - - /* Set the file last modified time stamp */ - if (file->stat_info.st_mtime > 0) - HTAnchor_setLastModified(anchor, file->stat_info.st_mtime); - - /* Check to see if we can edit it */ - if (!editable && !file->stat_info.st_size) { - HTRequest_addError(request, ERR_INFO, NO, HTERR_NO_CONTENT, - NULL, 0, (char*)"HTLoadFile"); - file->state = FS_NO_DATA; - } else { - file->state = (HTRequest_method(request)==METHOD_GET) ? - FS_NEED_OPEN_FILE : FS_GOT_DATA; - } + /* Set the file size */ + CIFile nelFile; + if (nelFile.open (file->local)) + { + file->stat_info.st_size = nelFile.getFileSize(); + } + nelFile.close(); + + if (file->stat_info.st_size) + HTAnchor_setLength(anchor, file->stat_info.st_size); + + /* Set the file last modified time stamp */ + if (file->stat_info.st_mtime > 0) + HTAnchor_setLastModified(anchor, file->stat_info.st_mtime); + + /* Check to see if we can edit it */ + if (!editable && !file->stat_info.st_size) + { + HTRequest_addError(request, ERR_INFO, NO, HTERR_NO_CONTENT, NULL, 0, "HTLoadFile"); + file->state = FS_NO_DATA; + } + else + { + file->state = (HTRequest_method(request)==METHOD_GET) ? FS_NEED_OPEN_FILE : FS_GOT_DATA; + } } break; case FS_NEED_OPEN_FILE: status = HTNeLFileOpen(net, file->local, HT_FB_RDONLY); - if (status == HT_OK) { + if (status == HT_OK) { - HTStream * rstream = HTStreamStack(HTAnchor_format(anchor), - HTRequest_outputFormat(request), - HTRequest_outputStream(request), - request, YES); - HTNet_setReadStream(net, rstream); - HTRequest_setOutputConnected(request, YES); - } + { + HTStream * rstream = HTStreamStack(HTAnchor_format(anchor), + HTRequest_outputFormat(request), + HTRequest_outputStream(request), + request, YES); + HTNet_setReadStream(net, rstream); + HTRequest_setOutputConnected(request, YES); + } - { - HTOutputStream * output = HTNet_getOutput(net, NULL, 0); - HTRequest_setInputStream(request, (HTStream *) output); - } + { + HTOutputStream * output = HTNet_getOutput(net, NULL, 0); + HTRequest_setInputStream(request, (HTStream *) output); + } - if (HTRequest_isSource(request) && !HTRequest_destinationsReady(request)) - return HT_OK; - HTRequest_addError(request, ERR_INFO, NO, HTERR_OK, NULL, 0, - (char*)"HTLoadFile"); - file->state = FS_NEED_BODY; - - if (HTEvent_isCallbacksRegistered()) { - if (!HTRequest_preemptive(request)) { - if (!HTNet_preemptive(net)) { - HTTRACE(PROT_TRACE, "HTLoadFile.. Returning\n"); - HTHost_register(HTNet_host(net), net, HTEvent_READ); - } else if (!file->timer) { - HTTRACE(PROT_TRACE, "HTLoadFile.. Returning\n"); - file->timer = - HTTimer_new(NULL, ReturnEvent, file, 1, YES, NO); + if (HTRequest_isSource(request) && !HTRequest_destinationsReady(request)) return HT_OK; + + HTRequest_addError(request, ERR_INFO, NO, HTERR_OK, NULL, 0, "HTLoadFile"); + file->state = FS_NEED_BODY; + + if (HTEvent_isCallbacksRegistered()) + { + if (!HTRequest_preemptive(request)) + { + if (!HTNet_preemptive(net)) + { + HTTRACE(PROT_TRACE, "HTLoadFile.. Returning\n"); + HTHost_register(HTNet_host(net), net, HTEvent_READ); + } + else if (!file->timer) + { + HTTRACE(PROT_TRACE, "HTLoadFile.. Returning\n"); + file->timer = HTTimer_new(NULL, ReturnEvent, file, 1, YES, NO); + } + return HT_OK; + } } + } + else if (status == HT_WOULD_BLOCK || status == HT_PENDING) + { return HT_OK; - } } - } else if (status == HT_WOULD_BLOCK || status == HT_PENDING) - return HT_OK; - else { - HTRequest_addError(request, ERR_INFO, NO, HTERR_INTERNAL, - NULL, 0, (char*)"HTLoadFile"); - file->state = FS_ERROR; /* Error or interrupt */ + else + { + HTRequest_addError(request, ERR_INFO, NO, HTERR_INTERNAL, NULL, 0, "HTLoadFile"); + file->state = FS_ERROR; /* Error or interrupt */ } break; - case FS_NEED_BODY: + case FS_NEED_BODY: status = HTHost_read(HTNet_host(net), net); if (status == HT_WOULD_BLOCK) - return HT_OK; - else if (status == HT_LOADED || status == HT_CLOSED) { - file->state = FS_GOT_DATA; - } else { - HTRequest_addError(request, ERR_INFO, NO, HTERR_FORBIDDEN, - NULL, 0, (char*)"HTLoadFile"); - file->state = FS_ERROR; + { + return HT_OK; + } + else if (status == HT_LOADED || status == HT_CLOSED) + { + file->state = FS_GOT_DATA; + } + else + { + HTRequest_addError(request, ERR_INFO, NO, HTERR_FORBIDDEN, NULL, 0, "HTLoadFile"); + file->state = FS_ERROR; } break; case FS_TRY_FTP: { - char *url = HTAnchor_physical(anchor); - HTAnchor *anchor; - char *newname = NULL; - StrAllocCopy(newname, "ftp:"); - if (!strncmp(url, "file:", 5)) - StrAllocCat(newname, url+5); - else - StrAllocCat(newname, url); - anchor = HTAnchor_findAddress(newname); - HTRequest_setAnchor(request, anchor); - HT_FREE(newname); - FileCleanup(request, HT_IGNORE); - return HTLoad(request, YES); + char *url = HTAnchor_physical(anchor); + HTAnchor *anchor; + char *newname = NULL; + StrAllocCopy(newname, "ftp:"); + if (!strncmp(url, "file:", 5)) + { + StrAllocCat(newname, url+5); + } + else + { + StrAllocCat(newname, url); + } + anchor = HTAnchor_findAddress(newname); + HTRequest_setAnchor(request, anchor); + HT_FREE(newname); + FileCleanup(request, HT_IGNORE); + return HTLoad(request, YES); } break; @@ -461,7 +485,8 @@ PRIVATE int HTNeLReader_read (HTInputStream * me) { HTAlertCallback * cbf = HTAlert_find(HT_PROG_READ); HTNet_addBytesRead(net, me->b_read); - if (cbf) { + if (cbf) + { int tr = HTNet_bytesRead(net); (*cbf)(net->request, HT_PROG_READ, HT_MSG_NULL, NULL, &tr, NULL); } @@ -472,18 +497,28 @@ PRIVATE int HTNeLReader_read (HTInputStream * me) /* Now push the data down the stream */ if ((status = (*net->readStream->isa->put_block) - (net->readStream, me->data, me->b_read)) != HT_OK) { - if (status == HT_WOULD_BLOCK) { + (net->readStream, me->data, me->b_read)) != HT_OK) + { + if (status == HT_WOULD_BLOCK) + { HTTRACE(PROT_TRACE, "ANSI read... Target WOULD BLOCK\n"); return HT_WOULD_BLOCK; - } else if (status == HT_PAUSE) { + } + else if (status == HT_PAUSE) + { HTTRACE(PROT_TRACE, "ANSI read... Target PAUSED\n"); return HT_PAUSE; - } else if (status > 0) { /* Stream specific return code */ + } + else if (status > 0) + { + /* Stream specific return code */ HTTRACE(PROT_TRACE, "ANSI read... Target returns %d\n" _ status); me->write = me->data + me->b_read; return status; - } else { /* We have a real error */ + } + else + { + /* We have a real error */ HTTRACE(PROT_TRACE, "ANSI read... Target ERROR\n"); return status; } @@ -506,13 +541,15 @@ PRIVATE int HTNeLReader_close (HTInputStream * me) HTNet * net = HTHost_getReadNet(me->host); - if (net && net->readStream) { - if ((status = (*net->readStream->isa->_free)(net->readStream))==HT_WOULD_BLOCK) - return HT_WOULD_BLOCK; - net->readStream = NULL; + if (net && net->readStream) + { + if ((status = (*net->readStream->isa->_free)(net->readStream))==HT_WOULD_BLOCK) return HT_WOULD_BLOCK; + net->readStream = NULL; } + HTTRACE(STREAM_TRACE, "Socket read. FREEING....\n"); HT_FREE(me); + return status; } @@ -540,7 +577,8 @@ PRIVATE int HTNeLReader_free (HTInputStream * me) } HTNet * net = HTHost_getReadNet(me->host); - if (net && net->readStream) { + if (net && net->readStream) + { int status = (*net->readStream->isa->_free)(net->readStream); if (status == HT_OK) net->readStream = NULL; return status; @@ -551,7 +589,8 @@ PRIVATE int HTNeLReader_free (HTInputStream * me) PRIVATE int HTNeLReader_abort (HTInputStream * me, HTList * /* e */) { HTNet * net = HTHost_getReadNet(me->host); - if (net && net->readStream) { + if (net && net->readStream) + { int status = (*net->readStream->isa->abort)(net->readStream, NULL); if (status != HT_IGNORE) net->readStream = NULL; } @@ -560,7 +599,7 @@ PRIVATE int HTNeLReader_abort (HTInputStream * me, HTList * /* e */) PRIVATE const HTInputStreamClass HTNeLReader = { - (char*)"SocketReader", + "SocketReader", HTNeLReader_flush, HTNeLReader_free, HTNeLReader_abort, @@ -569,20 +608,20 @@ PRIVATE const HTInputStreamClass HTNeLReader = HTNeLReader_consumed }; -PUBLIC HTInputStream * HTNeLReader_new (HTHost * host, HTChannel * ch, - void * /* param */, int /* mode */) +PUBLIC HTInputStream * HTNeLReader_new (HTHost * host, HTChannel * ch, void * /* param */, int /* mode */) { - if (host && ch) { - HTInputStream * me = HTChannel_input(ch); - if (me == NULL) { - if ((me=(HTInputStream *) HT_CALLOC(1, sizeof(HTInputStream))) == NULL) - HT_OUTOFMEM((char*)"HTNeLReader_new"); - me->isa = &HTNeLReader; - me->ch = ch; - me->host = host; - HTTRACE(STREAM_TRACE, "Reader...... Created reader stream %p\n" _ me); - } - return me; + if (host && ch) + { + HTInputStream * me = HTChannel_input(ch); + if (me == NULL) + { + if ((me=(HTInputStream *) HT_CALLOC(1, sizeof(HTInputStream))) == NULL) HT_OUTOFMEM("HTNeLReader_new"); + me->isa = &HTNeLReader; + me->ch = ch; + me->host = host; + HTTRACE(STREAM_TRACE, "Reader...... Created reader stream %p\n" _ me); + } + return me; } return NULL; } diff --git a/code/nel/src/gui/link_hack.cpp b/code/nel/src/gui/link_hack.cpp index 1492012e1..3ecc6fb0a 100644 --- a/code/nel/src/gui/link_hack.cpp +++ b/code/nel/src/gui/link_hack.cpp @@ -20,12 +20,14 @@ #include "nel/gui/dbview_number.h" #include "nel/gui/dbview_quantity.h" #include "nel/gui/view_pointer.h" +#include "nel/gui/group_editbox_decor.h" namespace NLGUI { void ifexprufct_forcelink(); void force_link_dbgroup_select_number_cpp(); void force_link_dbgroup_combo_box_cpp(); + void force_link_group_wheel_cpp(); /// Necessary so the linker doesn't drop the code of these classes from the library void LinkHack() @@ -37,5 +39,7 @@ namespace NLGUI ifexprufct_forcelink(); force_link_dbgroup_select_number_cpp(); force_link_dbgroup_combo_box_cpp(); + force_link_group_wheel_cpp(); + CGroupEditBoxDecor::forceLink(); } } \ No newline at end of file diff --git a/code/nel/src/gui/lua_object.cpp b/code/nel/src/gui/lua_object.cpp index 3f8924517..a50569858 100644 --- a/code/nel/src/gui/lua_object.cpp +++ b/code/nel/src/gui/lua_object.cpp @@ -362,7 +362,7 @@ namespace NLGUI { nlassert(key); nlassert(isValid()); - if (!isTable()) throw ELuaNotATable(NLMISC::toString("Trying to set a function value '%p' at key %s on object '%s' of type %s (not a table).", value, key, getId().c_str(), getTypename())); + if (!isTable()) throw ELuaNotATable(NLMISC::toString("Trying to set a function value '%p' at key %s on object '%s' of type %s (not a table).", (void *)value, key, getId().c_str(), getTypename())); CLuaStackChecker lsc(_LuaState); push(); _LuaState->push(key); diff --git a/code/nel/src/gui/root_group.cpp b/code/nel/src/gui/root_group.cpp new file mode 100644 index 000000000..bffdd5579 --- /dev/null +++ b/code/nel/src/gui/root_group.cpp @@ -0,0 +1,94 @@ +// Ryzom - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + + +#include "nel/gui/root_group.h" +#include + +namespace NLGUI +{ + + CRootGroup::CRootGroup(const TCtorParam ¶m) : + CInterfaceGroup(param) + { + } + + CRootGroup::~CRootGroup() + { + } + + CInterfaceElement* CRootGroup::getElement (const std::string &id) + { + if (_Id == id) + return this; + + if (id.substr(0, _Id.size()) != _Id) + return NULL; + + std::vector::const_iterator itv; + for (itv = _Views.begin(); itv != _Views.end(); itv++) + { + CViewBase *pVB = *itv; + if (pVB->getId() == id) + return pVB; + } + + std::vector::const_iterator itc; + for (itc = _Controls.begin(); itc != _Controls.end(); itc++) + { + CCtrlBase* ctrl = *itc; + if (ctrl->getId() == id) + return ctrl; + } + + // Accelerate + std::string sTmp = id; + sTmp = sTmp.substr(_Id.size()+1,sTmp.size()); + std::string::size_type pos = sTmp.find(':'); + if (pos != std::string::npos) + sTmp = sTmp.substr(0,pos); + + std::map::iterator it = _Accel.find(sTmp); + if (it != _Accel.end()) + { + CInterfaceGroup *pIG = it->second; + return pIG->getElement(id); + } + return NULL; + } + + void CRootGroup::addGroup (CInterfaceGroup *child, sint eltOrder) + { + std::string sTmp = child->getId(); + sTmp = sTmp.substr(_Id.size()+1,sTmp.size()); + _Accel.insert(std::pair(sTmp, child)); + CInterfaceGroup::addGroup(child,eltOrder); + } + + bool CRootGroup::delGroup (CInterfaceGroup *child, bool dontDelete) + { + std::string sTmp = child->getId(); + sTmp = sTmp.substr(_Id.size()+1,sTmp.size()); + std::map::iterator it = _Accel.find(sTmp); + if (it != _Accel.end()) + { + _Accel.erase(it); + } + return CInterfaceGroup::delGroup(child,dontDelete); + } + +} + diff --git a/code/nel/src/gui/stdpch.h b/code/nel/src/gui/stdpch.h index 8ab2a3595..3270e6482 100644 --- a/code/nel/src/gui/stdpch.h +++ b/code/nel/src/gui/stdpch.h @@ -18,6 +18,7 @@ #define NELGUI_H #include +#include #include "nel/misc/types_nl.h" #include "nel/misc/algo.h" @@ -30,7 +31,9 @@ #include "nel/misc/hierarchical_timer.h" #ifdef NL_OS_WINDOWS - #define NOMINMAX + #ifndef NL_COMP_MINGW + # define NOMINMAX + #endif #include #include #endif diff --git a/code/nel/src/gui/view_base.cpp b/code/nel/src/gui/view_base.cpp index 05d958d3e..2b09061a9 100644 --- a/code/nel/src/gui/view_base.cpp +++ b/code/nel/src/gui/view_base.cpp @@ -57,7 +57,7 @@ namespace NLGUI { if( editorMode ) { - CWidgetManager::getInstance()->setCurrentEditorSelection( getId() ); + CWidgetManager::getInstance()->selectWidget( getId() ); return true; } } diff --git a/code/nel/src/gui/view_pointer_base.cpp b/code/nel/src/gui/view_pointer_base.cpp index 045329d35..e29af7858 100644 --- a/code/nel/src/gui/view_pointer_base.cpp +++ b/code/nel/src/gui/view_pointer_base.cpp @@ -25,7 +25,7 @@ namespace NLGUI CViewBase( param ), _Buttons( NLMISC::noButton ) { - _PointerX = _PointerY = _PointerOldX = _PointerOldY = _PointerDownX = _PointerDownY = 0; + _PointerX = _PointerY = _PointerOldX = _PointerOldY = _PointerDownX = _PointerDownY = InvalidCoord; _PointerDown = false; _PointerVisible = true; } diff --git a/code/nel/src/gui/view_renderer.cpp b/code/nel/src/gui/view_renderer.cpp index b2758c634..6e6675599 100644 --- a/code/nel/src/gui/view_renderer.cpp +++ b/code/nel/src/gui/view_renderer.cpp @@ -1064,6 +1064,46 @@ namespace NLGUI } } + bool CViewRenderer::getTexture( NLMISC::CBitmap &bm, const std::string &name ) + { + TTextureMap::const_iterator itr = _TextureMap.find( name ); + if( itr == _TextureMap.end() ) + return false; + + sint32 id = itr->second; + SImage *si = getSImage( id ); + NLMISC::CBitmap *src = si->GlobalTexturePtr->Texture->generateDatas(); + + if( src->getPixelFormat() != NLMISC::CBitmap::RGBA ) + return false; + + uint x0 = (uint)( si->UVMin.U * si->GlobalTexturePtr->Width ); + uint y0 = (uint)( si->UVMin.V * si->GlobalTexturePtr->Height ); + uint x1 = (uint)( si->UVMax.U * si->GlobalTexturePtr->Width ); + uint y1 = (uint)( si->UVMax.V * si->GlobalTexturePtr->Height ); + + if( x1 == x0 ) + return false; + + if( y1 == y0 ) + return false; + + bm.resize( x1 - x0, y1 - y0 ); + bm.blit( *src, x0, y0, ( x1 - x0 ), ( y1 - y0 ), 0, 0 ); + + return true; + } + + void CViewRenderer::getTextureNames( std::vector< std::string > &textures ) + { + TTextureMap::const_iterator itr = _TextureMap.begin(); + while( itr != _TextureMap.end() ) + { + textures.push_back( itr->first ); + ++itr; + } + } + /* * getTextureIdFromName */ diff --git a/code/nel/src/gui/view_text.cpp b/code/nel/src/gui/view_text.cpp index 6ff1930af..db069a29d 100644 --- a/code/nel/src/gui/view_text.cpp +++ b/code/nel/src/gui/view_text.cpp @@ -28,8 +28,6 @@ #include "nel/gui/lua_ihm.h" #include "nel/gui/view_pointer_base.h" -#include - using namespace std; using namespace NLMISC; using namespace NL3D; @@ -62,6 +60,7 @@ namespace NLGUI CWidgetManager::getInstance()->getSystemOption( CWidgetManager::OptionAddCoefFont ).getValSInt32(); _Color = CRGBA(255,255,255,255); _Shadow = false; + _ShadowOutline = false; _ShadowColor = CRGBA(0,0,0,255); _MultiLine = false; @@ -111,7 +110,7 @@ namespace NLGUI ///constructor // *************************************************************************** CViewText:: CViewText (const std::string& id, const std::string Text, sint FontSize, - NLMISC::CRGBA Color, bool Shadow) + NLMISC::CRGBA Color, bool Shadow, bool ShadowOutline) :CViewBase(TCtorParam()) { _Id = id; @@ -120,6 +119,7 @@ namespace NLGUI _FontSize = FontSize + CWidgetManager::getInstance()->getSystemOption( CWidgetManager::OptionAddCoefFont).getValSInt32(); _Color = Color; _Shadow = Shadow; + _ShadowOutline = ShadowOutline; setText(Text); computeFontSize (); } @@ -159,6 +159,7 @@ namespace NLGUI _FontSize = vt._FontSize; _Color = vt._Color; _Shadow = vt._Shadow; + _ShadowOutline = vt._ShadowOutline; _ShadowColor = vt._ShadowColor; _MultiLine = false; @@ -225,6 +226,11 @@ namespace NLGUI return toString( _Shadow ); } else + if( name == "shadow_outline" ) + { + return toString( _ShadowOutline ); + } + else if( name == "shadow_color" ) { return toString( _ShadowColor ); @@ -360,6 +366,14 @@ namespace NLGUI return true; } else + if( name == "shadow_outline" ) + { + bool b; + if( fromString( value, b ) ) + _ShadowOutline = b; + return true; + } + else if( name == "shadow_color" ) { CRGBA c; @@ -520,6 +534,7 @@ namespace NLGUI ).c_str() ); xmlSetProp( node, BAD_CAST "shadow", BAD_CAST toString( _Shadow ).c_str() ); + xmlSetProp( node, BAD_CAST "shadow_outline", BAD_CAST toString( _ShadowOutline ).c_str() ); xmlSetProp( node, BAD_CAST "shadow_color", BAD_CAST toString( _ShadowColor ).c_str() ); xmlSetProp( node, BAD_CAST "multi_line", BAD_CAST toString( _MultiLine ).c_str() ); @@ -604,6 +619,11 @@ namespace NLGUI if (prop) _Shadow = convertBool(prop); + prop = (char*) xmlGetProp( cur, (xmlChar*)"shadow_outline" ); + _ShadowOutline = false; + if (prop) + _ShadowOutline = convertBool(prop); + prop= (char*) xmlGetProp( cur, (xmlChar*)"shadow_color" ); _ShadowColor = CRGBA(0,0,0,255); if (prop) @@ -864,6 +884,7 @@ namespace NLGUI TextContext->setHotSpot (UTextContext::BottomLeft); TextContext->setShaded (_Shadow); + TextContext->setShadeOutline (_ShadowOutline); TextContext->setShadeColor (shcol); TextContext->setFontSize (_FontSize); @@ -978,6 +999,7 @@ namespace NLGUI TextContext->setHotSpot (UTextContext::BottomLeft); TextContext->setShaded (_Shadow); + TextContext->setShadeOutline (_ShadowOutline); TextContext->setShadeColor (shcol); TextContext->setFontSize (_FontSize); @@ -1146,6 +1168,14 @@ namespace NLGUI invalidateContent(); } + // *************************************************************************** + void CViewText::setShadowOutline (bool bShadowOutline) + { + _ShadowOutline = bShadowOutline; + computeFontSize (); + invalidateContent(); + } + // *************************************************************************** void CViewText::setShadowColor(const NLMISC::CRGBA & color) { @@ -1647,6 +1677,7 @@ namespace NLGUI TextContext->setHotSpot (UTextContext::BottomLeft); TextContext->setShaded (_Shadow); + TextContext->setShadeOutline (_ShadowOutline); TextContext->setFontSize (_FontSize); // default state @@ -1814,9 +1845,18 @@ namespace NLGUI if (_AutoClamp) { CViewBase::updateCoords (); - if (_Parent) + + // If there's no parent, try the parent of the parent element. + // Since we will be under the same group + CInterfaceGroup *parent = _Parent; + if( parent == NULL ) + { + if( _ParentElm != NULL ) + parent = _ParentElm->getParent(); + } + + if (parent) { - CInterfaceGroup *parent = _Parent; // avoid resizing parents to compute the limiter while (parent && (parent->getResizeFromChildW() || parent->isGroupList() )) { @@ -1958,6 +1998,7 @@ namespace NLGUI NL3D::UTextContext *TextContext = CViewRenderer::getTextContext(); TextContext->setHotSpot (UTextContext::BottomLeft); TextContext->setShaded (_Shadow); + TextContext->setShadeOutline (_ShadowOutline); TextContext->setFontSize (_FontSize); // CViewRenderer &rVR = *CViewRenderer::getInstance(); height = getFontHeight(); @@ -2089,6 +2130,7 @@ namespace NLGUI // setup the text context TextContext->setHotSpot (UTextContext::BottomLeft); TextContext->setShaded (_Shadow); + TextContext->setShadeOutline (_ShadowOutline); TextContext->setFontSize (_FontSize); // find the line where the character is // CViewRenderer &rVR = *CViewRenderer::getInstance(); @@ -2363,6 +2405,7 @@ namespace NLGUI NL3D::UTextContext *TextContext = CViewRenderer::getTextContext(); TextContext->setHotSpot (UTextContext::BottomLeft); TextContext->setShaded (_Shadow); + TextContext->setShadeOutline (_ShadowOutline); TextContext->setFontSize (_FontSize); TCharPos linePos = 0; @@ -2447,6 +2490,7 @@ namespace NLGUI NL3D::UTextContext *TextContext = CViewRenderer::getTextContext(); TextContext->setHotSpot (UTextContext::BottomLeft); TextContext->setShaded (_Shadow); + TextContext->setShadeOutline (_ShadowOutline); TextContext->setFontSize (_FontSize); // Current position in text @@ -2498,12 +2542,13 @@ namespace NLGUI NL3D::UTextContext *TextContext = CViewRenderer::getTextContext(); TextContext->setHotSpot (UTextContext::BottomLeft); TextContext->setShaded (_Shadow); + TextContext->setShadeOutline (_ShadowOutline); TextContext->setFontSize (_FontSize); // Letter size UTextContext::CStringInfo si = TextContext->getStringInfo(ucstring("|")); // for now we can't now that directly from UTextContext - _FontHeight = (uint) si.StringHeight + (_Shadow?1:0); - _FontLegHeight = (uint) si.StringLine + (_Shadow?1:0); + _FontHeight = (uint) si.StringHeight; // + (_Shadow?(_ShadowOutline?2:1):0); + _FontLegHeight = (uint) si.StringLine; // + (_Shadow?(_ShadowOutline?2:1):0); // Space width si = TextContext->getStringInfo(ucstring(" ")); @@ -2789,7 +2834,8 @@ namespace NLGUI pTooltip->setId(_Id+"_tt"+toString(i)); pTooltip->setAvoidResizeParent(avoidResizeParent()); pTooltip->setRenderLayer(getRenderLayer()); - pTooltip->setDefaultContextHelp(CI18N::get(tempTooltips[i].toString())); + bool isI18N = tempTooltips[i].size() >= 2 && tempTooltips[i][0] == 'u' && tempTooltips[i][1] == 'i'; + pTooltip->setDefaultContextHelp(isI18N ? CI18N::get(tempTooltips[i].toString()) : tempTooltips[i]); pTooltip->setParentPos(this); pTooltip->setParentPosRef(Hotspot_BR); pTooltip->setPosRef(Hotspot_BR); @@ -2960,6 +3006,7 @@ namespace NLGUI f.serial(_SpaceWidth); f.serial(_Color); f.serial(_Shadow); + f.serial(_ShadowOutline); f.serialEnum(_CaseMode); f.serial(_ShadowColor); f.serial(_LineMaxW); diff --git a/code/nel/src/gui/widget_manager.cpp b/code/nel/src/gui/widget_manager.cpp index 16357d373..b9efd50d5 100644 --- a/code/nel/src/gui/widget_manager.cpp +++ b/code/nel/src/gui/widget_manager.cpp @@ -34,8 +34,8 @@ #include "nel/gui/interface_expr.h" #include "nel/gui/reflect_register.h" #include "nel/gui/editor_selection_watcher.h" -#include "nel/gui/widget_addition_watcher.h" #include "nel/misc/events.h" +#include "nel/gui/root_group.h" namespace NLGUI { @@ -1036,12 +1036,14 @@ namespace NLGUI setCapturePointerLeft(NULL); setCapturePointerRight(NULL); _CapturedView = NULL; - + resetColorProps(); resetAlphaRolloverSpeedProps(); resetGlobalAlphasProps(); activeAnims.clear(); + + editorSelection.clear(); } @@ -1186,6 +1188,7 @@ namespace NLGUI vtDst->setColor (vtSrc->getColor()); vtDst->setModulateGlobalColor(vtSrc->getModulateGlobalColor()); vtDst->setShadow(vtSrc->getShadow()); + vtDst->setShadowOutline(vtSrc->getShadowOutline()); vtDst->setShadowColor(vtSrc->getShadowColor()); vtDst->setCaseMode(vtSrc->getCaseMode()); vtDst->setUnderlined(vtSrc->getUnderlined()); @@ -2039,6 +2042,12 @@ namespace NLGUI } } + if( draggedElement != NULL ) + { + CInterfaceElement *e = draggedElement; + static_cast< CViewBase* >( e )->draw(); + } + if ( (nPriority == WIN_PRIORITY_WORLD_SPACE) && !camera.empty()) { driver->setMatrixMode2D11(); @@ -2072,9 +2081,9 @@ namespace NLGUI if( CInterfaceElement::getEditorMode() ) { - if( !currentEditorSelection.empty() ) + for( int i = 0; i < editorSelection.size(); i++ ) { - CInterfaceElement *e = getElementFromId( currentEditorSelection ); + CInterfaceElement *e = getElementFromId( editorSelection[ i ] ); if( e != NULL ) e->drawHighlight(); } @@ -2096,276 +2105,328 @@ namespace NLGUI if( activeAnims[i]->isDisableButtons() ) return false; + bool handled = false; + + CViewPointer *_Pointer = static_cast< CViewPointer* >( getPointer() ); + if( evnt.getType() == CEventDescriptor::system ) { - const CEventDescriptorSystem &systemEvent = reinterpret_cast< const CEventDescriptorSystem& >( evnt ); - if( systemEvent.getEventTypeExtended() == CEventDescriptorSystem::setfocus ) + handleSystemEvent( evnt ); + } + else + if (evnt.getType() == CEventDescriptor::key) + { + handled = handleKeyboardEvent( evnt ); + } + else if (evnt.getType() == CEventDescriptor::mouse ) + { + handled = handleMouseEvent( evnt ); + } + + CDBManager::getInstance()->flushObserverCalls(); + + return handled; + } + + bool CWidgetManager::handleSystemEvent( const CEventDescriptor &evnt ) + { + const CEventDescriptorSystem &systemEvent = reinterpret_cast< const CEventDescriptorSystem& >( evnt ); + if( systemEvent.getEventTypeExtended() == CEventDescriptorSystem::setfocus ) + { + if( getCapturePointerLeft() != NULL ) { - if( getCapturePointerLeft() != NULL ) - { - getCapturePointerLeft()->handleEvent( evnt ); - setCapturePointerLeft( NULL ); - } + getCapturePointerLeft()->handleEvent( evnt ); + setCapturePointerLeft( NULL ); + } - if( getCapturePointerRight() != NULL ) - { - getCapturePointerRight()->handleEvent( evnt ); - setCapturePointerRight( NULL ); - } + if( getCapturePointerRight() != NULL ) + { + getCapturePointerRight()->handleEvent( evnt ); + setCapturePointerRight( NULL ); + } - if( _CapturedView != NULL ) - { - _CapturedView->handleEvent( evnt ); - _CapturedView = NULL; - } + if( _CapturedView != NULL ) + { + _CapturedView->handleEvent( evnt ); + _CapturedView = NULL; } } - bool handled = false; + return true; + } - CViewPointer *_Pointer = static_cast< CViewPointer* >( getPointer() ); + bool CWidgetManager::handleKeyboardEvent( const CEventDescriptor &evnt ) + { + bool handled = false; + + CEventDescriptorKey &eventDesc = (CEventDescriptorKey&)evnt; - if (evnt.getType() == CEventDescriptor::key) - { - CEventDescriptorKey &eventDesc = (CEventDescriptorKey&)evnt; - //_LastEventKeyDesc = eventDesc; + //_LastEventKeyDesc = eventDesc; - // Any Key event disable the ContextHelp - disableContextHelp(); + // Any Key event disable the ContextHelp + disableContextHelp(); - // Hide menu if the key is pushed - // if ((eventDesc.getKeyEventType() == CEventDescriptorKey::keydown) && !_ModalStack.empty() && !eventDesc.getKeyAlt() && !eventDesc.getKeyCtrl() && !eventDesc.getKeyShift()) - // Hide menu (or popup menu) is ESCAPE pressed - if( eventDesc.getKeyEventType() == CEventDescriptorKey::keychar && eventDesc.getChar() == NLMISC::KeyESCAPE ) + // Hide menu if the key is pushed +// if ((eventDesc.getKeyEventType() == CEventDescriptorKey::keydown) && !_ModalStack.empty() && !eventDesc.getKeyAlt() && !eventDesc.getKeyCtrl() && !eventDesc.getKeyShift()) + // Hide menu (or popup menu) is ESCAPE pressed + if( eventDesc.getKeyEventType() == CEventDescriptorKey::keychar && eventDesc.getChar() == NLMISC::KeyESCAPE ) + { + if( hasModal() ) { - if( hasModal() ) - { - SModalWndInfo mwi = getModal(); - if (mwi.ModalExitKeyPushed) - disableModalWindow(); - } + SModalWndInfo mwi = getModal(); + if (mwi.ModalExitKeyPushed) + disableModalWindow(); } + } - // Manage "quit window" If the Key is ESCAPE, no captureKeyboard - if( eventDesc.getKeyEventType() == CEventDescriptorKey::keychar && eventDesc.getChar() == NLMISC::KeyESCAPE ) + // Manage "quit window" If the Key is ESCAPE, no captureKeyboard + if( eventDesc.getKeyEventType() == CEventDescriptorKey::keychar && eventDesc.getChar() == NLMISC::KeyESCAPE ) + { + // Get the last escapable active top window. NB: this is ergonomically better. + CInterfaceGroup *win= getLastEscapableTopWindow(); + if( win ) { - // Get the last escapable active top window. NB: this is ergonomically better. - CInterfaceGroup *win= getLastEscapableTopWindow(); - if( win ) + // If the window is a modal, must pop it. + if( dynamic_cast(win) ) { - // If the window is a modal, must pop it. - if( dynamic_cast(win) ) - { - if(!win->getAHOnEscape().empty()) - CAHManager::getInstance()->runActionHandler(win->getAHOnEscape(), win, win->getAHOnEscapeParams()); - popModalWindow(); - handled= true; - } - // else just disable it. - // Special case: leave the escape Key to the CaptureKeyboard . - else if( !getCaptureKeyboard() ) - { - if(!win->getAHOnEscape().empty()) - CAHManager::getInstance()->runActionHandler(win->getAHOnEscape(), win, win->getAHOnEscapeParams()); - win->setActive(false); - handled= true; - } + if(!win->getAHOnEscape().empty()) + CAHManager::getInstance()->runActionHandler(win->getAHOnEscape(), win, win->getAHOnEscapeParams()); + popModalWindow(); + handled= true; + } + // else just disable it. + // Special case: leave the escape Key to the CaptureKeyboard . + else if( !getCaptureKeyboard() ) + { + if(!win->getAHOnEscape().empty()) + CAHManager::getInstance()->runActionHandler(win->getAHOnEscape(), win, win->getAHOnEscapeParams()); + win->setActive(false); + handled= true; } } + } - // Manage complex "Enter" - if (eventDesc.getKeyEventType() == CEventDescriptorKey::keychar && eventDesc.getChar() == NLMISC::KeyRETURN) + // Manage complex "Enter" + if( eventDesc.getKeyEventType() == CEventDescriptorKey::keychar && eventDesc.getChar() == NLMISC::KeyRETURN && !eventDesc.getKeyCtrl() ) + { + // If the top window has Enter AH + CInterfaceGroup *tw= getTopWindow(); + if(tw && !tw->getAHOnEnter().empty()) { - // If the top window has Enter AH - CInterfaceGroup *tw= getTopWindow(); - if(tw && !tw->getAHOnEnter().empty()) + // if the captured keyboard is in this Modal window, then must handle him in priority + if( getCaptureKeyboard() && getCaptureKeyboard()->getRootWindow()==tw) { - // if the captured keyboard is in this Modal window, then must handle him in priority - if( getCaptureKeyboard() && getCaptureKeyboard()->getRootWindow()==tw) - { - bool result = getCaptureKeyboard()->handleEvent(evnt); - CDBManager::getInstance()->flushObserverCalls(); - return result; - } - else - { - // The window or modal control the OnEnter. Execute, and don't go to the chat. - CAHManager::getInstance()->runActionHandler(tw->getAHOnEnter(), tw, tw->getAHOnEnterParams()); - handled= true; - } + bool result = getCaptureKeyboard()->handleEvent(evnt); + CDBManager::getInstance()->flushObserverCalls(); + return result; } + else + { + // The window or modal control the OnEnter. Execute, and don't go to the chat. + CAHManager::getInstance()->runActionHandler(tw->getAHOnEnter(), tw, tw->getAHOnEnterParams()); + handled= true; + } + } - // else the 'return' key bring back to the last edit box (if possible) - CCtrlBase *oldCapture = getOldCaptureKeyboard() ? getOldCaptureKeyboard() : getDefaultCaptureKeyboard(); - if ( getCaptureKeyboard() == NULL && oldCapture && !handled) + // else the 'return' key bring back to the last edit box (if possible) + CCtrlBase *oldCapture = getOldCaptureKeyboard() ? getOldCaptureKeyboard() : getDefaultCaptureKeyboard(); + if ( getCaptureKeyboard() == NULL && oldCapture && !handled) + { + /* If the editbox does not want to recover focus, then abort. This possibility is normaly avoided + through setCaptureKeyboard() which already test getRecoverFocusOnEnter(), but it is still possible + for the default capture (main chat) or the old captured window to not want to recover + (temporary Read Only chat for instance) + */ + if(!dynamic_cast(oldCapture) || + dynamic_cast(oldCapture)->getRecoverFocusOnEnter()) { - /* If the editbox does not want to recover focus, then abort. This possibility is normaly avoided - through setCaptureKeyboard() which already test getRecoverFocusOnEnter(), but it is still possible - for the default capture (main chat) or the old captured window to not want to recover - (temporary Read Only chat for instance) - */ - if(!dynamic_cast(oldCapture) || - dynamic_cast(oldCapture)->getRecoverFocusOnEnter()) + setCaptureKeyboard( oldCapture ); + notifyElementCaptured(getCaptureKeyboard() ); + // make sure all parent windows are active + CCtrlBase *cb = getCaptureKeyboard(); + CGroupContainer *lastContainer = NULL; + for(;;) { - setCaptureKeyboard( oldCapture ); - notifyElementCaptured(getCaptureKeyboard() ); - // make sure all parent windows are active - CCtrlBase *cb = getCaptureKeyboard(); - CGroupContainer *lastContainer = NULL; - for(;;) + CGroupContainer *gc = dynamic_cast(cb); + if (gc) lastContainer = gc; + cb->forceOpen(); + if (cb->getParent()) { - CGroupContainer *gc = dynamic_cast(cb); - if (gc) lastContainer = gc; - cb->forceOpen(); - if (cb->getParent()) - { - cb = cb->getParent(); - } - else - { - cb->invalidateCoords(); - break; - } + cb = cb->getParent(); } - if (lastContainer) + else { - setTopWindow(lastContainer); - lastContainer->enableBlink(1); + cb->invalidateCoords(); + break; } - handled= true; } + if (lastContainer) + { + setTopWindow(lastContainer); + lastContainer->enableBlink(1); + } + handled= true; } } + } - // General case: handle it in the Captured keyboard - if ( getCaptureKeyboard() != NULL && !handled) - { - bool result = getCaptureKeyboard()->handleEvent(evnt); - CDBManager::getInstance()->flushObserverCalls(); - return result; - } - - lastKeyEvent = eventDesc; + // General case: handle it in the Captured keyboard + if ( getCaptureKeyboard() != NULL && !handled) + { + bool result = getCaptureKeyboard()->handleEvent(evnt); + CDBManager::getInstance()->flushObserverCalls(); + return result; } - //////////////////////////////////////////////// Keyboard handling ends here //////////////////////////////////// + lastKeyEvent = eventDesc; - else if (evnt.getType() == CEventDescriptor::mouse ) - { - CEventDescriptorMouse &eventDesc = (CEventDescriptorMouse&)evnt; + return handled; + } - if( eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown ) - _Pointer->setButtonState( static_cast< NLMISC::TMouseButton >( _Pointer->getButtonState() | NLMISC::leftButton ) ); - else - if( eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown ) - _Pointer->setButtonState( static_cast< NLMISC::TMouseButton >( _Pointer->getButtonState() | NLMISC::rightButton ) ); - else - if( eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup ) - _Pointer->setButtonState( static_cast< NLMISC::TMouseButton >( _Pointer->getButtonState() & ~NLMISC::leftButton ) ); - if( eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightup ) - _Pointer->setButtonState( static_cast< NLMISC::TMouseButton >( _Pointer->getButtonState() & ~NLMISC::rightButton ) ); + bool CWidgetManager::handleMouseEvent( const CEventDescriptor &evnt ) + { + bool handled = false; - if( eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousemove ) - handleMouseMoveEvent( eventDesc ); + CEventDescriptorMouse &eventDesc = (CEventDescriptorMouse&)evnt; - eventDesc.setX( _Pointer->getX() ); - eventDesc.setY( _Pointer->getY() ); + if( eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown ) + _Pointer->setButtonState( static_cast< NLMISC::TMouseButton >( _Pointer->getButtonState() | NLMISC::leftButton ) ); + else + if( eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown ) + _Pointer->setButtonState( static_cast< NLMISC::TMouseButton >( _Pointer->getButtonState() | NLMISC::rightButton ) ); + else + if( eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup ) + _Pointer->setButtonState( static_cast< NLMISC::TMouseButton >( _Pointer->getButtonState() & ~NLMISC::leftButton ) ); + if( eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightup ) + _Pointer->setButtonState( static_cast< NLMISC::TMouseButton >( _Pointer->getButtonState() & ~NLMISC::rightButton ) ); - if( isMouseHandlingEnabled() ) - { - // First thing to do : Capture handling - if ( getCapturePointerLeft() != NULL) - handled|= getCapturePointerLeft()->handleEvent(evnt); + if( eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousemove ) + handleMouseMoveEvent( eventDesc ); - if ( getCapturePointerRight() != NULL && - getCapturePointerLeft() != getCapturePointerRight() ) - handled|= getCapturePointerRight()->handleEvent(evnt); + eventDesc.setX( _Pointer->getX() ); + eventDesc.setY( _Pointer->getY() ); - if( _CapturedView != NULL ) - _CapturedView->handleEvent( evnt ); + if( CInterfaceElement::getEditorMode() ) + { + // Let's pretend we've handled the event... or actually we have! + if( ( eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown ) || + ( eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightup ) ) + return true; + } - CInterfaceGroup *ptr = getWindowUnder (eventDesc.getX(), eventDesc.getY()); - setCurrentWindowUnder( ptr ); + if( isMouseHandlingEnabled() ) + { + // First thing to do : Capture handling + if ( getCapturePointerLeft() != NULL) + handled|= getCapturePointerLeft()->handleEvent(evnt); - // Any Mouse event but move disable the ContextHelp - if(eventDesc.getEventTypeExtended() != CEventDescriptorMouse::mousemove) - { - disableContextHelp(); - } + if ( getCapturePointerRight() != NULL && + getCapturePointerLeft() != getCapturePointerRight() ) + handled|= getCapturePointerRight()->handleEvent(evnt); + + if( _CapturedView != NULL && + _CapturedView != getCapturePointerLeft() && + _CapturedView != getCapturePointerRight() ) + _CapturedView->handleEvent( evnt ); + + CInterfaceGroup *ptr = getWindowUnder (eventDesc.getX(), eventDesc.getY()); + setCurrentWindowUnder( ptr ); - // get the group under the mouse - CInterfaceGroup *pNewCurrentWnd = getCurrentWindowUnder(); - setMouseOverWindow( pNewCurrentWnd != NULL ); + // Any Mouse event but move disable the ContextHelp + if(eventDesc.getEventTypeExtended() != CEventDescriptorMouse::mousemove) + { + disableContextHelp(); + } + // get the group under the mouse + CInterfaceGroup *pNewCurrentWnd = getCurrentWindowUnder(); + setMouseOverWindow( pNewCurrentWnd != NULL ); - NLMISC::CRefPtr clickedOutModalWindow; - // modal special features - if ( hasModal() ) + NLMISC::CRefPtr clickedOutModalWindow; + + // modal special features + if ( hasModal() ) + { + CWidgetManager::SModalWndInfo mwi = getModal(); + if(mwi.ModalWindow) { - CWidgetManager::SModalWndInfo mwi = getModal(); - if(mwi.ModalWindow) + // If we are not in "click out" mode so we dont handle controls other than those of the modal + if (pNewCurrentWnd != mwi.ModalWindow && !mwi.ModalExitClickOut) { - // If we are not in "click out" mode so we dont handle controls other than those of the modal - if (pNewCurrentWnd != mwi.ModalWindow && !mwi.ModalExitClickOut) - { - pNewCurrentWnd = NULL; - } - else + pNewCurrentWnd = NULL; + } + else + { + // If there is a handler on click out launch it + if (pNewCurrentWnd != mwi.ModalWindow) + if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown || + (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown)) + if (!mwi.ModalHandlerClickOut.empty()) + CAHManager::getInstance()->runActionHandler(mwi.ModalHandlerClickOut,NULL,mwi.ModalClickOutParams); + + // If the current window is not the modal and if must quit on click out + if(pNewCurrentWnd != mwi.ModalWindow && mwi.ModalExitClickOut) { - // If there is a handler on click out launch it - if (pNewCurrentWnd != mwi.ModalWindow) - if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown || - (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown)) - if (!mwi.ModalHandlerClickOut.empty()) - CAHManager::getInstance()->runActionHandler(mwi.ModalHandlerClickOut,NULL,mwi.ModalClickOutParams); - - // If the current window is not the modal and if must quit on click out - if(pNewCurrentWnd != mwi.ModalWindow && mwi.ModalExitClickOut) - { - // NB: don't force handle==true because to quit a modal does not avoid other actions + // NB: don't force handle==true because to quit a modal does not avoid other actions - // quit if click outside - if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown || - (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown)) + // quit if click outside + if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown || + (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown)) + { + clickedOutModalWindow = dynamic_cast((CInterfaceGroup*)mwi.ModalWindow); + // disable the modal + popModalWindow(); + if ( hasModal() ) { - clickedOutModalWindow = dynamic_cast((CInterfaceGroup*)mwi.ModalWindow); - // disable the modal - popModalWindow(); - if ( hasModal() ) - { - // don't handle event unless it is a previous modal window - if( !isPreviousModal( pNewCurrentWnd ) ) - pNewCurrentWnd = NULL; // can't handle event before we have left all modal windows - } - movePointer (0,0); // Reget controls under pointer + // don't handle event unless it is a previous modal window + if( !isPreviousModal( pNewCurrentWnd ) ) + pNewCurrentWnd = NULL; // can't handle event before we have left all modal windows } + movePointer (0,0); // Reget controls under pointer } } } } + } + + // Manage LeftClick. + if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown) + { + if ((pNewCurrentWnd != NULL) && (!hasModal()) && (pNewCurrentWnd->getOverlappable())) + { + CGroupContainer *pGC = dynamic_cast(pNewCurrentWnd); + if (pGC != NULL) + { + if (!pGC->isGrayed()) setTopWindow(pNewCurrentWnd); + } + else + { + setTopWindow(pNewCurrentWnd); + } + } - // Manage LeftClick. - if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown) + bool captured = false; + + // must not capture a new element if a sheet is currentlty being dragged. + // This may happen when alt-tab has been used => the sheet is dragged but the left button is up + if (!CCtrlDraggable::getDraggedSheet()) { - if ((pNewCurrentWnd != NULL) && (!hasModal()) && (pNewCurrentWnd->getOverlappable())) + if( CInterfaceElement::getEditorMode() && _GroupSelection ) { - CGroupContainer *pGC = dynamic_cast(pNewCurrentWnd); - if (pGC != NULL) + for( sint32 i = _GroupsUnderPointer.size() - 1; i >= 0; i-- ) { - if (!pGC->isGrayed()) setTopWindow(pNewCurrentWnd); - } - else - { - setTopWindow(pNewCurrentWnd); + CInterfaceGroup *g = _GroupsUnderPointer[ i ]; + if( ( g != NULL ) && ( g->isInGroup( pNewCurrentWnd ) ) ) + { + _CapturedView = g; + captured = true; + break; + } } } - bool captured = false; - - // must not capture a new element if a sheet is currentlty being dragged. - // This may happen when alt-tab has been used => the sheet is dragged but the left button is up - if (!CCtrlDraggable::getDraggedSheet()) + if( !captured ) { // Take the top most control. uint nMaxDepth = 0; @@ -2375,6 +2436,9 @@ namespace NLGUI CCtrlBase *ctrl= _CtrlsUnderPointer[i]; if (ctrl && ctrl->isCapturable() && ctrl->isInGroup( pNewCurrentWnd ) ) { + if( CInterfaceElement::getEditorMode() && !ctrl->isEditorSelectable() ) + continue; + uint d = ctrl->getDepth( pNewCurrentWnd ); if (d > nMaxDepth) { @@ -2384,168 +2448,184 @@ namespace NLGUI } } } + } - if( CInterfaceElement::getEditorMode() && !captured ) + if( CInterfaceElement::getEditorMode() && !captured ) + { + for( sint32 i = _ViewsUnderPointer.size()-1; i >= 0; i-- ) { - for( sint32 i = _ViewsUnderPointer.size()-1; i >= 0; i-- ) + CViewBase *v = _ViewsUnderPointer[i]; + if( ( v != NULL ) && v->isInGroup( pNewCurrentWnd ) ) { - CViewBase *v = _ViewsUnderPointer[i]; - if( ( v != NULL ) && v->isInGroup( pNewCurrentWnd ) ) - { - _CapturedView = v; - captured = true; - break; - } - } - } + if( CInterfaceElement::getEditorMode() && !v->isEditorSelectable() ) + continue; - notifyElementCaptured( getCapturePointerLeft() ); - if (clickedOutModalWindow && !clickedOutModalWindow->OnPostClickOut.empty()) - { - CAHManager::getInstance()->runActionHandler(clickedOutModalWindow->OnPostClickOut, getCapturePointerLeft(), clickedOutModalWindow->OnPostClickOutParams); + _CapturedView = v; + captured = true; + break; + } } } - //if found - if ( captured ) - { - // consider clicking on a control implies handling of the event. - handled= true; - // handle the capture - if( getCapturePointerLeft() != NULL ) - getCapturePointerLeft()->handleEvent(evnt); - else - _CapturedView->handleEvent( evnt ); + notifyElementCaptured( getCapturePointerLeft() ); + if (clickedOutModalWindow && !clickedOutModalWindow->OnPostClickOut.empty()) + { + CAHManager::getInstance()->runActionHandler(clickedOutModalWindow->OnPostClickOut, getCapturePointerLeft(), clickedOutModalWindow->OnPostClickOutParams); } } + //if found + if ( captured ) + { + // consider clicking on a control implies handling of the event. + handled= true; + + if( getCapturePointerLeft() != NULL ) + _CapturedView = getCapturePointerLeft(); + + // handle the capture + _CapturedView->handleEvent( evnt ); + } + else + { + if( CInterfaceElement::getEditorMode() ) + clearEditorSelection(); + } + } - // Manage RightClick - if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown) + // Manage RightClick + if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown) + { + if ((pNewCurrentWnd != NULL) && (!hasModal()) && (pNewCurrentWnd->getOverlappable())) { - if ((pNewCurrentWnd != NULL) && (!hasModal()) && (pNewCurrentWnd->getOverlappable())) + CGroupContainer *pGC = dynamic_cast(pNewCurrentWnd); + if (pGC != NULL) { - CGroupContainer *pGC = dynamic_cast(pNewCurrentWnd); - if (pGC != NULL) - { - if (!pGC->isGrayed()) setTopWindow(pNewCurrentWnd); - } - else - { - setTopWindow(pNewCurrentWnd); - } + if (!pGC->isGrayed()) setTopWindow(pNewCurrentWnd); } + else + { + setTopWindow(pNewCurrentWnd); + } + } - // Take the top most control. + // Take the top most control. + { + uint nMaxDepth = 0; + const std::vector< CCtrlBase* >& _CtrlsUnderPointer = getCtrlsUnderPointer(); + for (sint32 i = (sint32)_CtrlsUnderPointer.size()-1; i >= 0; i--) { - uint nMaxDepth = 0; - const std::vector< CCtrlBase* >& _CtrlsUnderPointer = getCtrlsUnderPointer(); - for (sint32 i = (sint32)_CtrlsUnderPointer.size()-1; i >= 0; i--) + CCtrlBase *ctrl= _CtrlsUnderPointer[i]; + if (ctrl && ctrl->isCapturable() && ctrl->isInGroup( pNewCurrentWnd ) ) { - CCtrlBase *ctrl= _CtrlsUnderPointer[i]; - if (ctrl && ctrl->isCapturable() && ctrl->isInGroup( pNewCurrentWnd ) ) + uint d = ctrl->getDepth( pNewCurrentWnd ); + if (d > nMaxDepth) { - uint d = ctrl->getDepth( pNewCurrentWnd ); - if (d > nMaxDepth) - { - nMaxDepth = d; - setCapturePointerRight( ctrl ); - } + nMaxDepth = d; + setCapturePointerRight( ctrl ); } } - notifyElementCaptured( getCapturePointerRight() ); - if (clickedOutModalWindow && !clickedOutModalWindow->OnPostClickOut.empty()) - { - CAHManager::getInstance()->runActionHandler(clickedOutModalWindow->OnPostClickOut, getCapturePointerRight(), clickedOutModalWindow->OnPostClickOutParams); - } } - //if found - if ( getCapturePointerRight() != NULL) + notifyElementCaptured( getCapturePointerRight() ); + if (clickedOutModalWindow && !clickedOutModalWindow->OnPostClickOut.empty()) { - // handle the capture - handled |= getCapturePointerRight()->handleEvent(evnt); + CAHManager::getInstance()->runActionHandler(clickedOutModalWindow->OnPostClickOut, getCapturePointerRight(), clickedOutModalWindow->OnPostClickOutParams); } } + //if found + if ( getCapturePointerRight() != NULL) + { + // handle the capture + handled |= getCapturePointerRight()->handleEvent(evnt); + } + } - if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightup) - { - if (!handled) - if (pNewCurrentWnd != NULL) - pNewCurrentWnd->handleEvent(evnt); - if ( getCapturePointerRight() != NULL) - { - setCapturePointerRight(NULL); - handled= true; - } + if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightup) + { + if (!handled) + if (pNewCurrentWnd != NULL) + pNewCurrentWnd->handleEvent(evnt); + if ( getCapturePointerRight() != NULL) + { + setCapturePointerRight(NULL); + handled= true; } + } - // window handling. if not handled by a control - if (!handled) + // window handling. if not handled by a control + if (!handled) + { + if (((pNewCurrentWnd != NULL) && !hasModal()) || + ((hasModal() && getModal().ModalWindow == pNewCurrentWnd))) { - if (((pNewCurrentWnd != NULL) && !hasModal()) || - ((hasModal() && getModal().ModalWindow == pNewCurrentWnd))) + CEventDescriptorMouse ev2 = eventDesc; + sint32 x= eventDesc.getX(), y = eventDesc.getY(); + if (pNewCurrentWnd) { - CEventDescriptorMouse ev2 = eventDesc; - sint32 x= eventDesc.getX(), y = eventDesc.getY(); - if (pNewCurrentWnd) - { - pNewCurrentWnd->absoluteToRelative (x, y); - ev2.setX (x); ev2.setY (y); - handled|= pNewCurrentWnd->handleEvent (ev2); - } - - // After handle event of a left click, may set window Top if movable (infos etc...) - //if( (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown) && pNewCurrentWnd->isMovable() ) - // setTopWindow(pNewCurrentWnd); + pNewCurrentWnd->absoluteToRelative (x, y); + ev2.setX (x); ev2.setY (y); + handled|= pNewCurrentWnd->handleEvent (ev2); } + + // After handle event of a left click, may set window Top if movable (infos etc...) + //if( (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown) && pNewCurrentWnd->isMovable() ) + // setTopWindow(pNewCurrentWnd); } + } - // Put here to let a chance to the window to handle if the capture dont - if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup) + // Put here to let a chance to the window to handle if the capture dont + if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup) + { + if ( getCapturePointerLeft() != NULL) { - if ( getCapturePointerLeft() != NULL) + if( !handled ) { - setCapturePointerLeft(NULL); - handled = true; + CCtrlBase *c = getCapturePointerLeft(); + c->handleEvent( evnt ); } + + setCapturePointerLeft(NULL); + handled = true; } + _CapturedView = NULL; + + if( CInterfaceElement::getEditorMode() ) + stopDragging(); + } + - // If the current window is the modal, may Modal quit. Do it after standard event handle - if(hasModal() && pNewCurrentWnd == getModal().ModalWindow) + // If the current window is the modal, may Modal quit. Do it after standard event handle + if(hasModal() && pNewCurrentWnd == getModal().ModalWindow) + { + // NB: don't force handle==true because to quit a modal does not avoid other actions + CWidgetManager::SModalWndInfo mwi = getModal(); + // and if must quit on click right + if(mwi.ModalExitClickR) { - // NB: don't force handle==true because to quit a modal does not avoid other actions - CWidgetManager::SModalWndInfo mwi = getModal(); - // and if must quit on click right - if(mwi.ModalExitClickR) - { - // quit if click right - if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightup) - // disable the modal - disableModalWindow(); - } - - // and if must quit on click left - if(mwi.ModalExitClickL) - { - // quit if click right - if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup) - // disable the modal - disableModalWindow(); - } + // quit if click right + if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightup) + // disable the modal + disableModalWindow(); } - // If the mouse is over a window, always consider the event is taken (avoid click behind) - handled|= isMouseOverWindow(); + // and if must quit on click left + if(mwi.ModalExitClickL) + { + // quit if click right + if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup) + // disable the modal + disableModalWindow(); + } } - } - CDBManager::getInstance()->flushObserverCalls(); + // If the mouse is over a window, always consider the event is taken (avoid click behind) + handled|= isMouseOverWindow(); + } return handled; } - bool CWidgetManager::handleMouseMoveEvent( const CEventDescriptor &eventDesc ) { if( getPointer() == NULL ) @@ -2580,8 +2660,76 @@ namespace NLGUI ve.setY( getPointer()->getY() ); } + if( CInterfaceElement::getEditorMode() ) + { + if( ( _CapturedView != NULL ) && ( draggedElement == NULL ) ) + { + startDragging(); + } + else + if( draggedElement != NULL ) + { + sint32 dx = newX - oldX; + sint32 dy = newY - oldY; + + draggedElement->moveBy( dx, dy ); + } + } + + return true; + } + + // ------------------------------------------------------------------------------------------------ + bool CWidgetManager::startDragging() + { + CInterfaceElement *e = NULL; + + CInterfaceGroup *g = _CapturedView->getParent(); + if( g != NULL ) + { + e = g->takeElement( _CapturedView ); + if( e == NULL ) + { + nlinfo( "Something went horribly wrong :(" ); + return false; + } + } + else + e = _CapturedView; + + e->setParent( NULL ); + draggedElement = e; + return true; } + + void CWidgetManager::stopDragging() + { + if( draggedElement != NULL ) + { + CInterfaceGroup *g = getGroupUnder( draggedElement->getXReal(), draggedElement->getYReal() ); + CInterfaceElement *e = draggedElement; + CInterfaceGroup *tw = getTopWindow(); + + if( g == NULL ) + g = tw; + + std::string oldid = e->getId(); + + e->setParent( g ); + e->setIdRecurse( e->getShortId() ); + e->setParentPos( g ); + e->setParentSize( g ); + g->addElement( e ); + + e->alignTo( g ); + //e->setName( "==MARKED==" ); + + draggedElement = NULL; + + onWidgetMoved( oldid, e->getId() ); + } + } // ------------------------------------------------------------------------------------------------ void CWidgetManager::movePointer (sint32 dx, sint32 dy) @@ -3211,25 +3359,53 @@ namespace NLGUI } } + void CWidgetManager::getEditorSelection( std::vector< std::string > &selection ) + { + selection.clear(); + for( int i = 0; i < editorSelection.size(); i++ ) + selection.push_back( editorSelection[ i ] ); + } - void CWidgetManager::setCurrentEditorSelection( const std::string &name ) + void CWidgetManager::selectWidget( const std::string &name ) { + std::vector< std::string >::iterator itr + = std::find( editorSelection.begin(), editorSelection.end(), name ); + CInterfaceElement *e = getElementFromId( name ); - if( e != NULL ) + + if( itr != editorSelection.end() ) { - if( !currentEditorSelection.empty() ) + // If multiselection is on unselect if already selected + if( multiSelection ) { - CInterfaceElement *prev = getElementFromId( currentEditorSelection ); - if( prev != NULL ) - prev->setEditorSelected( false ); + editorSelection.erase( itr ); + if( e != NULL ) + e->setEditorSelected( false ); } - e->setEditorSelected( true ); } else - if( !name.empty() ) - return; - - currentEditorSelection = name; + { + // Select if not yet selected + if( e != NULL ) + { + // If multiselection is off, we can only have 1 widget selected + if( !multiSelection ) + { + editorSelection.clear(); + } + + e->setEditorSelected( true ); + editorSelection.push_back( name ); + } + + } + + notifySelectionWatchers(); + } + + void CWidgetManager::clearEditorSelection() + { + editorSelection.clear(); notifySelectionWatchers(); } @@ -3238,7 +3414,7 @@ namespace NLGUI std::vector< IEditorSelectionWatcher* >::iterator itr = selectionWatchers.begin(); while( itr != selectionWatchers.end() ) { - (*itr)->selectionChanged( currentEditorSelection ); + (*itr)->selectionChanged(); ++itr; } } @@ -3267,36 +3443,46 @@ namespace NLGUI selectionWatchers.erase( itr ); } - void CWidgetManager::notifyAdditionWatchers( const std::string &widgetName ) + void CWidgetManager::onWidgetAdded( const std::string &id ) + { + std::vector< IWidgetWatcher* >::const_iterator itr = widgetWatchers.begin(); + while( itr != widgetWatchers.end() ) + { + (*itr)->onWidgetAdded( id ); + ++itr; + } + } + + void CWidgetManager::onWidgetMoved( const std::string &oldid, const std::string &newid ) { - std::vector< IWidgetAdditionWatcher* >::const_iterator itr = additionWatchers.begin(); - while( itr != additionWatchers.end() ) + std::vector< IWidgetWatcher* >::const_iterator itr = widgetWatchers.begin(); + while( itr != widgetWatchers.end() ) { - (*itr)->widgetAdded( widgetName ); + (*itr)->onWidgetMoved( oldid, newid ); ++itr; } } - void CWidgetManager::registerAdditionWatcher( IWidgetAdditionWatcher *watcher ) + void CWidgetManager::registerWidgetWatcher( IWidgetWatcher *watcher ) { - std::vector< IWidgetAdditionWatcher* >::const_iterator itr - = std::find( additionWatchers.begin(), additionWatchers.end(), watcher ); + std::vector< IWidgetWatcher* >::const_iterator itr + = std::find( widgetWatchers.begin(), widgetWatchers.end(), watcher ); // already exists - if( itr != additionWatchers.end() ) + if( itr != widgetWatchers.end() ) return; - additionWatchers.push_back( watcher ); + widgetWatchers.push_back( watcher ); } - void CWidgetManager::unregisterAdditionWatcher( IWidgetAdditionWatcher *watcher ) + void CWidgetManager::unregisterWidgetWatcher( IWidgetWatcher *watcher ) { - std::vector< IWidgetAdditionWatcher* >::iterator itr - = std::find( additionWatchers.begin(), additionWatchers.end(), watcher ); + std::vector< IWidgetWatcher* >::iterator itr + = std::find( widgetWatchers.begin(), widgetWatchers.end(), watcher ); // doesn't exist - if( itr == additionWatchers.end() ) + if( itr == widgetWatchers.end() ) return; - additionWatchers.erase( itr ); + widgetWatchers.erase( itr ); } CInterfaceElement* CWidgetManager::addWidgetToGroup( std::string &group, std::string &widgetClass, std::string &widgetName ) @@ -3329,11 +3515,165 @@ namespace NLGUI else g->addView( v ); - notifyAdditionWatchers( v->getId() ); + onWidgetAdded( v->getId() ); return v; } + bool CWidgetManager::groupSelection() + { + std::vector< CInterfaceElement* > elms; + + // Resolve the widget names + for( int i = 0; i < editorSelection.size(); i++ ) + { + CInterfaceElement *e = getElementFromId( editorSelection[ i ] ); + if( e != NULL ) + elms.push_back( e ); + } + + editorSelection.clear(); + + if( elms.empty() ) + return false; + + // Create the group as the subgroup of the top window + CInterfaceGroup *g = static_cast< CInterfaceGroup* >( getParser()->createClass( "interface_group" ) ); + getTopWindow()->addGroup( g ); + g->setParent( getTopWindow() ); + g->setIdRecurse( std::string( "group" ) + NLMISC::toString( _WidgetCount ) ); + _WidgetCount++; + onWidgetAdded( g->getId() ); + + std::string oldId; + + // Reparent the widgets to the new group + for( int i = 0; i < elms.size(); i++ ) + { + CInterfaceElement *e = elms[ i ]; + oldId = e->getId(); + CInterfaceGroup *p = e->getParent(); + if( p != NULL ) + p->takeElement( e ); + + g->addElement( e ); + e->setParent( g ); + e->setParentPos( g ); + e->setParentSize( g ); + e->setIdRecurse( e->getShortId() ); + + onWidgetMoved( oldId, e->getId() ); + } + elms.clear(); + + // Make sure widgets aren't clipped because the group isn't big enough + g->spanElements(); + // Make sure widgets are aligned + g->alignElements(); + // Align the new group to the top window + g->alignTo( getTopWindow() ); + + g->setActive( true ); + + return true; + } + + bool CWidgetManager::unGroupSelection() + { + if( editorSelection.size() != 1 ) + return false; + + // Does the element exist? + CInterfaceElement *e = getElementFromId( editorSelection[ 0 ] ); + if( e == NULL ) + return false; + + // Is the element a group? + CInterfaceGroup *g = dynamic_cast< CInterfaceGroup* >( e ); + if( g == NULL ) + return false; + + // Can't blow up a root group :( + CInterfaceGroup *p = g->getParent(); + if( p == NULL ) + return false; + + // KABOOM! + bool ok = g->explode(); + if( !ok ) + return false; + + p->delElement( g ); + + clearEditorSelection(); + + p->updateCoords(); + + return true; + } + + + bool CWidgetManager::createNewGUI( const std::string &project, const std::string &window ) + { + reset(); + + for( int i = 0; i < _MasterGroups.size(); i++ ) + delete _MasterGroups[i].Group; + _MasterGroups.clear(); + + // First create the master group + CRootGroup *root = new CRootGroup( CViewBase::TCtorParam() ); + + SMasterGroup mg; + mg.Group = root; + + root->setIdRecurse( project ); + root->setW( 1024 ); + root->setH( 768 ); + root->setActive( true ); + + // Create the first / main window + CInterfaceGroup *wnd = new CInterfaceGroup( CViewBase::TCtorParam() ); + wnd->setW( 1024 ); + wnd->setH( 768 ); + wnd->setParent( root ); + wnd->setParentPos( root ); + wnd->setParentSize( root ); + wnd->setPosRef( Hotspot_MM ); + wnd->setParentPosRef( Hotspot_MM ); + wnd->setIdRecurse( window ); + wnd->setActive( true ); + + // Add the window + root->addElement( wnd ); + mg.addWindow( wnd, wnd->getPriority() ); + _MasterGroups.push_back( mg ); + + _Pointer = new CViewPointer( CViewBase::TCtorParam() ); + + IParser *parser = getParser(); + + + // Set base color to white + VariableData v; + v.type = "sint32"; + v.value = "255"; + + v.entry = "UI:SAVE:COLOR:R"; + parser->setVariable( v ); + + v.entry = "UI:SAVE:COLOR:G"; + parser->setVariable( v ); + + v.entry = "UI:SAVE:COLOR:B"; + parser->setVariable( v ); + + v.entry = "UI:SAVE:COLOR:A"; + parser->setVariable( v ); + + return true; + } + CWidgetManager::CWidgetManager() { @@ -3372,7 +3712,9 @@ namespace NLGUI setScreenWH( 0, 0 ); - currentEditorSelection = ""; + _GroupSelection = false; + multiSelection = false; + _WidgetCount = 0; } CWidgetManager::~CWidgetManager() @@ -3386,6 +3728,8 @@ namespace NLGUI curContextHelp = NULL; CStringShared::deleteStringMapper(); + + editorSelection.clear(); } } diff --git a/code/nel/src/ligo/primitive.cpp b/code/nel/src/ligo/primitive.cpp index 9cf7df13f..ba9b69435 100644 --- a/code/nel/src/ligo/primitive.cpp +++ b/code/nel/src/ligo/primitive.cpp @@ -2738,8 +2738,17 @@ CPrimitiveContext::CPrimitiveContext(): } +static bool LIGORegistered = false; + + void Register () { + if( LIGORegistered ) + { + nlinfo( "LIGO classes have already been registered." ); + return; + } + NLMISC_REGISTER_CLASS(CPropertyString); NLMISC_REGISTER_CLASS(CPropertyStringArray); NLMISC_REGISTER_CLASS(CPropertyColor); @@ -2748,6 +2757,8 @@ void Register () NLMISC_REGISTER_CLASS(CPrimPath); NLMISC_REGISTER_CLASS(CPrimZone); NLMISC_REGISTER_CLASS(CPrimAlias); + + LIGORegistered = true; } // *************************************************************************** diff --git a/code/nel/src/ligo/stdligo.h b/code/nel/src/ligo/stdligo.h index 3c86f25e6..c8f4e2a9a 100644 --- a/code/nel/src/ligo/stdligo.h +++ b/code/nel/src/ligo/stdligo.h @@ -63,6 +63,8 @@ #include "nel/misc/file.h" #ifdef NL_OS_WINDOWS - #define NOMINMAX + #ifndef NL_COMP_MINGW + #define NOMINMAX + #endif #include #endif diff --git a/code/nel/src/ligo/zone_bank.cpp b/code/nel/src/ligo/zone_bank.cpp index ff24821af..a099168f8 100644 --- a/code/nel/src/ligo/zone_bank.cpp +++ b/code/nel/src/ligo/zone_bank.cpp @@ -25,7 +25,9 @@ #include "nel/misc/o_xml.h" #ifdef NL_OS_WINDOWS +#ifndef NL_COMP_MINGW #define NOMINMAX +#endif #include #endif // NL_OS_WINDOWS diff --git a/code/nel/src/misc/CMakeLists.txt b/code/nel/src/misc/CMakeLists.txt index dc5b87e2c..f40517f5b 100644 --- a/code/nel/src/misc/CMakeLists.txt +++ b/code/nel/src/misc/CMakeLists.txt @@ -1,6 +1,176 @@ FILE(GLOB SRC *.cpp *.h config_file/*.cpp config_file/*.h) FILE(GLOB HEADERS ../../include/nel/misc/*.h) +FILE(GLOB NLMISC_CDB + cdb.cpp ../../include/nel/misc/cdb.h + cdb_*.cpp ../../include/nel/misc/cdb_*.h +) + +FILE(GLOB NLMISC_EVENT + events.cpp ../../include/nel/misc/events.h + event_*.cpp ../../include/nel/misc/event_*.h + *_event_*.cpp ../../include/nel/misc/*_event_*.h +) + +FILE(GLOB NLMISC_DEBUG + debug.cpp ../../include/nel/misc/debug.h + report.cpp ../../include/nel/misc/report.h + log.cpp ../../include/nel/misc/log.h +) + +FILE(GLOB NLMISC_FILESYSTEM + async_file_manager.cpp ../../include/nel/misc/async_file_manager.h + file.cpp ../../include/nel/misc/file.h + path.cpp ../../include/nel/misc/path.h + big_file.cpp ../../include/nel/misc/big_file.h + *_xml.cpp ../../include/nel/misc/*_xml.h + xml_*.cpp ../../include/nel/misc/xml_*.h +) + +FILE(GLOB NLMISC_STREAM + *_stream.cpp ../../include/nel/misc/*_stream.h + stream.cpp ../../include/nel/misc/stream.h + stream_*.cpp ../../include/nel/misc/stream_*.h +) + +FILE(GLOB NLMISC_DISPLAYER + displayer.cpp ../../include/nel/misc/displayer.h + *_displayer.cpp ../../include/nel/misc/*_displayer.h +) + +FILE(GLOB NLMISC_MATH + plane.cpp ../../include/nel/misc/plane.h + ../../include/nel/misc/plane_inline.h + polygon.cpp ../../include/nel/misc/polygon.h + quad.cpp ../../include/nel/misc/quad.h + quat.cpp ../../include/nel/misc/quat.h + rect.cpp ../../include/nel/misc/rect.h + rgba.cpp ../../include/nel/misc/rgba.h + triangle.cpp ../../include/nel/misc/triangle.h + uv.cpp ../../include/nel/misc/uv.h + vector*.cpp ../../include/nel/misc/vector*.h + aabbox.cpp ../../include/nel/misc/aabbox.h + algo.cpp ../../include/nel/misc/algo.h + bsphere.cpp ../../include/nel/misc/bsphere.h + fast_floor.cpp ../../include/nel/misc/fast_floor.h + geom_ext.cpp ../../include/nel/misc/geom_ext.h + line.cpp ../../include/nel/misc/line.h + matrix.cpp ../../include/nel/misc/matrix.h +) + +FILE(GLOB NLMISC_PLATFORM + *_nl.cpp ../../include/nel/misc/*_nl.h + common.cpp ../../include/nel/misc/common.h + app_context.cpp ../../include/nel/misc/app_context.h + check_fpu.cpp ../../include/nel/misc/check_fpu.h + cpu_time_stat.cpp ../../include/nel/misc/cpu_time_stat.h + dummy_window.cpp ../../include/nel/misc/dummy_window.h + dynloadlib.cpp ../../include/nel/misc/dynloadlib.h + fast_mem.cpp ../../include/nel/misc/fast_mem.h + inter_window_msg_queue.cpp ../../include/nel/misc/inter_window_msg_queue.h + system_*.cpp ../../include/nel/misc/system_*.h + win32_util.cpp ../../include/nel/misc/win32_util.h + win_tray.cpp ../../include/nel/misc/win_tray.h +) + +FILE(GLOB NLMISC_GENERIC + ../../include/nel/misc/array_2d.h + *_memory.cpp ../../include/nel/misc/*_memory.h + buf_fifo.cpp ../../include/nel/misc/buf_fifo.h + ../../include/nel/misc/callback.h + *_allocator.cpp ../../include/nel/misc/*_allocator.h + ../../include/nel/misc/enum_bitset.h + fast_id_map.cpp ../../include/nel/misc/fast_id_map.h + hierarchical_timer.cpp ../../include/nel/misc/hierarchical_timer.h + ../../include/nel/misc/historic.h + ../../include/nel/misc/mutable_container.h + ../../include/nel/misc/random.h + smart_ptr.cpp ../../include/nel/misc/smart_ptr.h + ../../include/nel/misc/smart_ptr_inline.h + ../../include/nel/misc/resource_ptr.h + ../../include/nel/misc/resource_ptr_inline.h + bit_set.cpp ../../include/nel/misc/bit_set.h + stop_watch.cpp ../../include/nel/misc/stop_watch.h + ../../include/nel/misc/twin_map.h + object_vector.cpp ../../include/nel/misc/object_vector.h + ../../include/nel/misc/singleton.h + speaker_listener.cpp ../../include/nel/misc/speaker_listener.h + ../../include/nel/misc/static_map.h + stl_block_list.cpp ../../include/nel/misc/stl_block_list.h +) + +FILE(GLOB NLMISC_UTILITY + config_file.cpp ../../include/nel/misc/config_file.h + cf_*.cpp ../../include/nel/misc/cf_*.h + config_file/config_file.cpp config_file/config_file.h + config_file/cf_*.cpp config_file/cf_*.h + class_id.cpp ../../include/nel/misc/class_id.h + class_registry.cpp ../../include/nel/misc/class_registry.h + cmd_args.cpp ../../include/nel/misc/cmd_args.h + command.cpp ../../include/nel/misc/command.h + eid_translator.cpp ../../include/nel/misc/eid_translator.h + entity_id.cpp ../../include/nel/misc/entity_id.h + eval_num_expr.cpp ../../include/nel/misc/eval_num_expr.h + factory.cpp ../../include/nel/misc/factory.h + grid_traversal.cpp ../../include/nel/misc/grid_traversal.h + mouse_smoother.cpp ../../include/nel/misc/mouse_smoother.h + noise_value.cpp ../../include/nel/misc/noise_value.h + progress_callback.cpp ../../include/nel/misc/progress_callback.h + sheet_id.cpp ../../include/nel/misc/sheet_id.h + variable.cpp ../../include/nel/misc/variable.h + value_smoother.cpp ../../include/nel/misc/value_smoother.h +) + +FILE(GLOB NLMISC_STRING + string_*.cpp ../../include/nel/misc/string_*.h + ../../include/nel/misc/ucstring.h + unicode.cpp + sstring.cpp ../../include/nel/misc/sstring.h +) + +FILE(GLOB NLMISC_I18N + diff_tool.cpp ../../include/nel/misc/diff_tool.h + i18n.cpp ../../include/nel/misc/i18n.h + words_dictionary.cpp ../../include/nel/misc/words_dictionary.h +) + +FILE(GLOB NLMISC_THREAD + co_task.cpp ../../include/nel/misc/co_task.h + mutex.cpp ../../include/nel/misc/mutex.h + *_thread.cpp ../../include/nel/misc/*_thread.h + task_*.cpp ../../include/nel/misc/task_*.h + reader_writer.cpp ../../include/nel/misc/reader_writer.h + tds.cpp ../../include/nel/misc/tds.h + thread.cpp ../../include/nel/misc/thread.h +) + +FILE(GLOB NLMISC_BITMAP + bitmap.cpp ../../include/nel/misc/bitmap.h + bitmap_*.cpp +) + +FILE(GLOB NLMISC_CRYPT + md5.cpp ../../include/nel/misc/md5.h + sha1.cpp ../../include/nel/misc/sha1.h +) + +SOURCE_GROUP("" FILES ${SRC} ${HEADERS}) +SOURCE_GROUP("cdb" FILES ${NLMISC_CDB}) +SOURCE_GROUP("event" FILES ${NLMISC_EVENT}) +SOURCE_GROUP("debug" FILES ${NLMISC_DEBUG}) +SOURCE_GROUP("platform" FILES ${NLMISC_PLATFORM}) +SOURCE_GROUP("filesystem" FILES ${NLMISC_FILESYSTEM}) +SOURCE_GROUP("stream" FILES ${NLMISC_STREAM}) +SOURCE_GROUP("displayer" FILES ${NLMISC_DISPLAYER}) +SOURCE_GROUP("math" FILES ${NLMISC_MATH}) +SOURCE_GROUP("generic" FILES ${NLMISC_GENERIC}) +SOURCE_GROUP("utility" FILES ${NLMISC_UTILITY}) +SOURCE_GROUP("bitmap" FILES ${NLMISC_BITMAP}) +SOURCE_GROUP("thread" FILES ${NLMISC_THREAD}) +SOURCE_GROUP("i18n" FILES ${NLMISC_I18N}) +SOURCE_GROUP("crypt" FILES ${NLMISC_CRYPT}) +SOURCE_GROUP("string" FILES ${NLMISC_STRING}) + NL_TARGET_LIB(nelmisc ${HEADERS} ${SRC}) IF(WITH_GTK) @@ -27,7 +197,7 @@ ENDIF(WITH_STATIC OR WIN32) # For DirectInput (di_event_emitter) IF(WIN32) INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) - TARGET_LINK_LIBRARIES(nelmisc ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY}) + TARGET_LINK_LIBRARIES(nelmisc ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY} winmm dbghelp) ENDIF(WIN32) IF(UNIX) @@ -39,7 +209,7 @@ ENDIF(UNIX) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${PNG_INCLUDE_DIR} config_file) -TARGET_LINK_LIBRARIES(nelmisc ${CMAKE_THREAD_LIBS_INIT} ${LIBXML2_LIBRARIES}) +TARGET_LINK_LIBRARIES(nelmisc ${CMAKE_THREAD_LIBS_INIT} ${LIBXML2_LIBRARIES} ${ZLIB_LIBRARY}) SET_TARGET_PROPERTIES(nelmisc PROPERTIES LINK_INTERFACE_LIBRARIES "") NL_DEFAULT_PROPS(nelmisc "NeL, Library: NeL Misc") NL_ADD_RUNTIME_FLAGS(nelmisc) diff --git a/code/nel/src/misc/app_context.cpp b/code/nel/src/misc/app_context.cpp index a0b35b35a..2383fcda5 100644 --- a/code/nel/src/misc/app_context.cpp +++ b/code/nel/src/misc/app_context.cpp @@ -75,7 +75,7 @@ INelContext::~INelContext() -void INelContext::contextReady() +void INelContext::contextReady() { // Register the NeL Context // This assert doesn't work for Linux due to ELF symbol relocation @@ -114,6 +114,7 @@ CApplicationContext::CApplicationContext() DebugNeedAssert = false; NoAssert = false; AlreadyCreateSharedAmongThreads = false; + WindowedApplication = false; contextReady(); } @@ -242,6 +243,16 @@ void CApplicationContext::setAlreadyCreateSharedAmongThreads(bool b) AlreadyCreateSharedAmongThreads = b; } +bool CApplicationContext::isWindowedApplication() +{ + return WindowedApplication; +} + +void CApplicationContext::setWindowedApplication(bool b) +{ + WindowedApplication = b; +} + CLibraryContext::CLibraryContext(INelContext &applicationContext) : _ApplicationContext(&applicationContext) { @@ -430,6 +441,16 @@ void CLibraryContext::setAlreadyCreateSharedAmongThreads(bool b) _ApplicationContext->setAlreadyCreateSharedAmongThreads(b); } +bool CLibraryContext::isWindowedApplication() +{ + return _ApplicationContext->isWindowedApplication(); +} + +void CLibraryContext::setWindowedApplication(bool b) +{ + _ApplicationContext->setWindowedApplication(b); +} + void initNelLibrary(NLMISC::CLibrary &lib) { nlassert(lib.isLibraryLoaded()); diff --git a/code/nel/src/misc/bitmap_jpeg.cpp b/code/nel/src/misc/bitmap_jpeg.cpp index 799d659d6..a43c707e7 100644 --- a/code/nel/src/misc/bitmap_jpeg.cpp +++ b/code/nel/src/misc/bitmap_jpeg.cpp @@ -26,6 +26,9 @@ #include extern "C" { + #ifdef NL_COMP_MINGW + # define HAVE_BOOLEAN + #endif #include } #endif diff --git a/code/nel/src/misc/co_task.cpp b/code/nel/src/misc/co_task.cpp index 91b0132a9..97a9e1e23 100644 --- a/code/nel/src/misc/co_task.cpp +++ b/code/nel/src/misc/co_task.cpp @@ -43,18 +43,7 @@ #else //NL_USE_THREAD_COTASK // some platform specifics #if defined (NL_OS_WINDOWS) -//# define _WIN32_WINNT 0x0500 -# define NL_WIN_CALLBACK CALLBACK -// Visual .NET won't allow Fibers for a Windows version older than 2000. However the basic features are sufficient for us, we want to compile them for all Windows >= 95 -# if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0400) -# ifdef _WIN32_WINNT -# undef _WIN32_WINNT -# endif -# define _WIN32_WINNT 0x0400 -# endif - -# define NOMINMAX -# include +# define NL_WIN_CALLBACK CALLBACK #elif defined (NL_OS_UNIX) # define NL_WIN_CALLBACK # include diff --git a/code/nel/src/misc/common.cpp b/code/nel/src/misc/common.cpp index 36e167260..8183430f1 100644 --- a/code/nel/src/misc/common.cpp +++ b/code/nel/src/misc/common.cpp @@ -20,8 +20,7 @@ #include "nel/misc/common.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX -# include +# include # include # include #elif defined NL_OS_UNIX @@ -37,6 +36,7 @@ using namespace std; +#ifndef NL_COMP_MINGW #ifdef NL_OS_WINDOWS # pragma message( " " ) @@ -69,6 +69,36 @@ extern "C" long _ftol2( double dblSource ) { return _ftol( dblSource ); } #endif // NL_OS_WINDOWS +#endif // !NL_COMP_MINGW + + +#ifdef NL_HAS_SSE2 + +void *operator new(size_t size) throw(std::bad_alloc) +{ + void *p = aligned_malloc(size, NL_DEFAULT_MEMORY_ALIGNMENT); + if (p == NULL) throw std::bad_alloc(); + return p; +} + +void *operator new[](size_t size) throw(std::bad_alloc) +{ + void *p = aligned_malloc(size, NL_DEFAULT_MEMORY_ALIGNMENT); + if (p == NULL) throw std::bad_alloc(); + return p; +} + +void operator delete(void *p) throw() +{ + aligned_free(p); +} + +void operator delete[](void *p) throw() +{ + aligned_free(p); +} + +#endif /* NL_HAS_SSE2 */ #ifdef DEBUG_NEW @@ -637,7 +667,7 @@ bool abortProgram(uint32 pid) #endif } -bool launchProgram (const std::string &programName, const std::string &arguments) +bool launchProgram(const std::string &programName, const std::string &arguments, bool log) { #ifdef NL_OS_WINDOWS @@ -689,7 +719,8 @@ bool launchProgram (const std::string &programName, const std::string &arguments { LPVOID lpMsgBuf; FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL); - nlwarning("LAUNCH: Failed launched '%s' with arg '%s' err %d: '%s'", programName.c_str(), arguments.c_str(), GetLastError (), lpMsgBuf); + if (log) + nlwarning("LAUNCH: Failed launched '%s' with arg '%s' err %d: '%s'", programName.c_str(), arguments.c_str(), GetLastError(), lpMsgBuf); LocalFree(lpMsgBuf); CloseHandle( pi.hProcess ); CloseHandle( pi.hThread ); @@ -746,7 +777,8 @@ bool launchProgram (const std::string &programName, const std::string &arguments if (status == -1) { char *err = strerror (errno); - nlwarning("LAUNCH: Failed launched '%s' with arg '%s' err %d: '%s'", programName.c_str(), arguments.c_str(), errno, err); + if (log) + nlwarning("LAUNCH: Failed launched '%s' with arg '%s' err %d: '%s'", programName.c_str(), arguments.c_str(), errno, err); } else if (status == 0) { @@ -766,7 +798,8 @@ bool launchProgram (const std::string &programName, const std::string &arguments return true; } #else - nlwarning ("LAUNCH: launchProgram() not implemented"); + if (log) + nlwarning ("LAUNCH: launchProgram() not implemented"); #endif return false; @@ -1040,7 +1073,7 @@ bool openDoc (const char *document) HINSTANCE result = ShellExecuteA(NULL, "open", document, NULL,NULL, SW_SHOWDEFAULT); // If it failed, get the .htm regkey and lookup the program - if ((UINT)result <= HINSTANCE_ERROR) + if ((uintptr_t)result <= HINSTANCE_ERROR) { if (GetRegKey(HKEY_CLASSES_ROOT, ext.c_str(), key) == ERROR_SUCCESS) { diff --git a/code/nel/src/misc/config_file/cf_bison.simple b/code/nel/src/misc/config_file/cf_bison.simple index 3ab0e5b1a..64e930f27 100644 --- a/code/nel/src/misc/config_file/cf_bison.simple +++ b/code/nel/src/misc/config_file/cf_bison.simple @@ -328,7 +328,7 @@ yynewstate: #endif /* Get the current used size of the three stacks, in elements. */ - int size = yyssp - yyss + 1; + int size = (int)(yyssp - yyss + 1); #ifdef yyoverflow /* Each stack pointer address is followed by the size of diff --git a/code/nel/src/misc/config_file/cf_flex.skl b/code/nel/src/misc/config_file/cf_flex.skl index 5da2aa3f6..b69bed057 100644 --- a/code/nel/src/misc/config_file/cf_flex.skl +++ b/code/nel/src/misc/config_file/cf_flex.skl @@ -1000,7 +1000,7 @@ int yyFlexLexer::yyinput() else { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; + int offset = (int)(yy_c_buf_p - yytext_ptr); ++yy_c_buf_p; switch ( yy_get_next_buffer() ) diff --git a/code/nel/src/misc/config_file/cf_gramatical.cpp b/code/nel/src/misc/config_file/cf_gramatical.cpp index c6a50934f..1d8c568b7 100644 --- a/code/nel/src/misc/config_file/cf_gramatical.cpp +++ b/code/nel/src/misc/config_file/cf_gramatical.cpp @@ -1499,7 +1499,7 @@ void cf_setVar (NLMISC::CConfigFile::CVar &Var, cf_value Val) switch (Val.Type) { case NLMISC::CConfigFile::CVar::T_REAL: Var.IntValues.push_back ((int)Val.Real); break; - case NLMISC::CConfigFile::CVar::T_STRING: Var.IntValues.push_back (atoi(Val.String)); break; + case NLMISC::CConfigFile::CVar::T_STRING: { int val = 0; NLMISC::fromString(Val.String, val); Var.IntValues.push_back(val); break; } default: break; } break; @@ -1507,7 +1507,7 @@ void cf_setVar (NLMISC::CConfigFile::CVar &Var, cf_value Val) switch (Val.Type) { case NLMISC::CConfigFile::CVar::T_INT: Var.RealValues.push_back ((double)Val.Int); break; - case NLMISC::CConfigFile::CVar::T_STRING: Var.RealValues.push_back (atof(Val.String)); break; + case NLMISC::CConfigFile::CVar::T_STRING: { double val = 0.0; NLMISC::fromString(Val.String, val); Var.RealValues.push_back(val); break; } default: break; } break; diff --git a/code/nel/src/misc/config_file/cf_gramatical.ypp b/code/nel/src/misc/config_file/cf_gramatical.ypp index 199f3df9a..578bf53bf 100644 --- a/code/nel/src/misc/config_file/cf_gramatical.ypp +++ b/code/nel/src/misc/config_file/cf_gramatical.ypp @@ -517,7 +517,7 @@ void cf_setVar (NLMISC::CConfigFile::CVar &Var, cf_value Val) switch (Val.Type) { case NLMISC::CConfigFile::CVar::T_REAL: Var.IntValues.push_back ((int)Val.Real); break; - case NLMISC::CConfigFile::CVar::T_STRING: Var.IntValues.push_back (atoi(Val.String)); break; + case NLMISC::CConfigFile::CVar::T_STRING: { int val = 0; NLMISC::fromString(Val.String, val); Var.RealValues.push_back(val); break; } default: break; } break; @@ -525,7 +525,7 @@ void cf_setVar (NLMISC::CConfigFile::CVar &Var, cf_value Val) switch (Val.Type) { case NLMISC::CConfigFile::CVar::T_INT: Var.RealValues.push_back ((double)Val.Int); break; - case NLMISC::CConfigFile::CVar::T_STRING: Var.RealValues.push_back (atof(Val.String)); break; + case NLMISC::CConfigFile::CVar::T_STRING: { double val = 0.0; NLMISC::fromString(Val.String, val); Var.RealValues.push_back(val); break; } default: break; } break; diff --git a/code/nel/src/misc/config_file/cf_lexical.cpp b/code/nel/src/misc/config_file/cf_lexical.cpp index f47696ff9..8c39112a6 100644 --- a/code/nel/src/misc/config_file/cf_lexical.cpp +++ b/code/nel/src/misc/config_file/cf_lexical.cpp @@ -2337,7 +2337,7 @@ YY_RULE_SETUP if (!cf_Ignore) { cflval.Val.Type = T_REAL; - cflval.Val.Real = atof (yytext); + NLMISC::fromString(yytext, cflval.Val.Real); DEBUG_PRINTF("lex: real '%s' '%f\n", yytext, cflval.Val.Real); return REAL; } @@ -2773,7 +2773,7 @@ static int input() else { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; + int offset = (int)(yy_c_buf_p - yytext_ptr); ++yy_c_buf_p; switch ( yy_get_next_buffer() ) diff --git a/code/nel/src/misc/config_file/config_file.cpp b/code/nel/src/misc/config_file/config_file.cpp index 6113a7a2c..c969f614d 100644 --- a/code/nel/src/misc/config_file/config_file.cpp +++ b/code/nel/src/misc/config_file/config_file.cpp @@ -85,8 +85,12 @@ double CConfigFile::CVar::asDouble (int index) const if (index >= (int)IntValues.size () || index < 0) throw EBadSize (Name, (int)IntValues.size (), index); return (double)IntValues[index]; case T_STRING: + { if (index >= (int)StrValues.size () || index < 0) throw EBadSize (Name, (int)StrValues.size (), index); - return atof(StrValues[index].c_str()); + double val; + NLMISC::fromString(StrValues[index], val); + return val; + } default: if (index >= (int)RealValues.size () || index < 0) throw EBadSize (Name, (int)RealValues.size (), index); return RealValues[index]; diff --git a/code/nel/src/misc/debug.cpp b/code/nel/src/misc/debug.cpp index 28f40f641..798161a21 100644 --- a/code/nel/src/misc/debug.cpp +++ b/code/nel/src/misc/debug.cpp @@ -17,26 +17,8 @@ #include "stdmisc.h" #include "nel/misc/types_nl.h" -#include "nel/misc/debug.h" - -#ifdef HAVE_NELCONFIG_H -# include "nelconfig.h" -#endif // HAVE_NELCONFIG_H - -#include "nel/misc/log.h" -#include "nel/misc/displayer.h" -#include "nel/misc/mem_displayer.h" -#include "nel/misc/command.h" -#include "nel/misc/report.h" -#include "nel/misc/path.h" -#include "nel/misc/variable.h" -#include "nel/misc/system_info.h" #ifdef NL_OS_WINDOWS -# define _WIN32_WINDOWS 0x0410 -# define WINVER 0x0400 -# define NOMINMAX -# include # include # include # include @@ -57,6 +39,22 @@ # include #endif +#include "nel/misc/debug.h" + +#ifdef HAVE_NELCONFIG_H +# include "nelconfig.h" +#endif // HAVE_NELCONFIG_H + +#include "nel/misc/log.h" +#include "nel/misc/displayer.h" +#include "nel/misc/mem_displayer.h" +#include "nel/misc/command.h" +#include "nel/misc/report.h" +#include "nel/misc/path.h" +#include "nel/misc/variable.h" +#include "nel/misc/system_info.h" +#include "nel/misc/system_utils.h" + #define NL_NO_DEBUG_FILES 1 using namespace std; @@ -81,7 +79,8 @@ using namespace std; #define LOG_IN_FILE NEL_LOG_IN_FILE // If true, debug system will trap crash even if the application is in debugger -static const bool TrapCrashInDebugger = false; +//static const bool TrapCrashInDebugger = false; +static const bool TrapCrashInDebugger = true; #ifdef DEBUG_NEW #define new DEBUG_NEW @@ -445,7 +444,7 @@ public: EDebug() { _Reason = "Nothing about EDebug"; } - ~EDebug () { } + virtual ~EDebug() throw() {} EDebug(EXCEPTION_POINTERS * pexp) : m_pexp(pexp) { nlassert(pexp != 0); createWhat(); } EDebug(const EDebug& se) : m_pexp(se.m_pexp) { createWhat(); } @@ -550,8 +549,8 @@ public: { // yoyo: allow only to send the crash report once. Because users usually click ignore, // which create noise into list of bugs (once a player crash, it will surely continues to do it). - bool i = false; - report (progname+shortExc, "", subject, _Reason, true, 1, true, 1, !isCrashAlreadyReported(), i, NL_CRASH_DUMP_FILE); + report(progname + shortExc, subject, _Reason, NL_CRASH_DUMP_FILE, true, !isCrashAlreadyReported(), ReportAbort); + // TODO: Does this need to be synchronous? Why does this not handle the report result? // no more sent mail for crash setCrashAlreadyReported(true); @@ -755,7 +754,7 @@ public: HANDLE getProcessHandle() { - return CSystemInfo::isNT()?GetCurrentProcess():(HANDLE)GetCurrentProcessId(); + return CSystemInfo::isNT()?GetCurrentProcess():(HANDLE)(uintptr_t)GetCurrentProcessId(); } // return true if found @@ -797,7 +796,7 @@ public: while (findAndErase(rawType, "classvector,class allocator >", "string")) ; } - string getFuncInfo (DWORD funcAddr, DWORD stackAddr) + string getFuncInfo (uintptr_t funcAddr, uintptr_t stackAddr) { string str ("NoSymbol"); @@ -853,7 +852,7 @@ public: if (stop==0 && (parse[i] == ',' || parse[i] == ')')) { - ULONG *addr = (ULONG*)(stackAddr) + 2 + pos2++; + uintptr_t *addr = (uintptr_t*)(stackAddr) + 2 + pos2++; string displayType = type; cleanType (type, displayType); @@ -882,7 +881,7 @@ public: } else if (type == "char*") { - if (!IsBadReadPtr(addr,sizeof(char*)) && *addr != NULL) + if (!IsBadReadPtr(addr,sizeof(char*)) && *addr != 0) { if (!IsBadStringPtrA((char*)*addr,32)) { @@ -920,7 +919,7 @@ public: { if (!IsBadReadPtr(addr,sizeof(string*))) { - if (*addr != NULL) + if (*addr != 0) { if (!IsBadReadPtr((void*)*addr,sizeof(string))) sprintf (tmp, "\"%s\"", ((string*)*addr)->c_str()); @@ -929,9 +928,9 @@ public: } else { - if (!IsBadReadPtr(addr,sizeof(ULONG*))) + if (!IsBadReadPtr(addr,sizeof(uintptr_t*))) { - if(*addr == NULL) + if(*addr == 0) sprintf (tmp, ""); else sprintf (tmp, "0x%p", *addr); @@ -956,7 +955,7 @@ public: if (disp != 0) { str += " + "; - str += toString ((uint32)disp); + str += toString ((uintptr_t)disp); str += " bytes"; } } @@ -1166,7 +1165,8 @@ void createDebug (const char *logPath, bool logInFile, bool eraseLastLog) initAcquireTimeMap(); #endif -#ifdef NL_OS_WINDOWS +#ifndef NL_COMP_MINGW +# ifdef NL_OS_WINDOWS // if (!IsDebuggerPresent ()) { // Use an environment variable to share the value among the EXE and its child DLLs @@ -1180,7 +1180,8 @@ void createDebug (const char *logPath, bool logInFile, bool eraseLastLog) SetEnvironmentVariable( SE_TRANSLATOR_IN_MAIN_MODULE, _T("1") ); } } -#endif // NL_OS_WINDOWS +# endif // NL_OS_WINDOWS +#endif //!NL_COMP_MINGW INelContext::getInstance().setErrorLog(new CLog (CLog::LOG_ERROR)); INelContext::getInstance().setWarningLog(new CLog (CLog::LOG_WARNING)); @@ -1192,10 +1193,10 @@ void createDebug (const char *logPath, bool logInFile, bool eraseLastLog) #ifdef NL_OS_WINDOWS if (TrapCrashInDebugger || !IsDebuggerPresent ()) +#endif { DefaultMsgBoxDisplayer = new CMsgBoxDisplayer ("DEFAULT_MBD"); } -#endif #if LOG_IN_FILE if (logInFile) @@ -1223,6 +1224,9 @@ void createDebug (const char *logPath, bool logInFile, bool eraseLastLog) #endif // LOG_IN_FILE DefaultMemDisplayer = new CMemDisplayer ("DEFAULT_MD"); + if (NLMISC::CSystemUtils::detectWindowedApplication()) + INelContext::getInstance().setWindowedApplication(true); + initDebug2(logInFile); INelContext::getInstance().setAlreadyCreateSharedAmongThreads(true); diff --git a/code/nel/src/misc/di_event_emitter.cpp b/code/nel/src/misc/di_event_emitter.cpp deleted file mode 100644 index 8f41f6453..000000000 --- a/code/nel/src/misc/di_event_emitter.cpp +++ /dev/null @@ -1,354 +0,0 @@ -// NeL - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// 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 "stdmisc.h" - -#include "nel/misc/di_event_emitter.h" -#include "nel/misc/events.h" -#include "nel/misc/win_event_emitter.h" -// -#include "di_mouse_device.h" -#include "di_keyboard_device.h" -#include "di_game_device.h" - - -#ifdef NL_OS_WINDOWS - -#ifdef DEBUG_NEW - #define new DEBUG_NEW -#endif - -namespace NLMISC -{ - -static const char DirectInputLibName[] = "dinput8.dll"; - -///////////////////////////////// -// CDIEventEmitter statics // -///////////////////////////////// - -HMODULE CDIEventEmitter::_DirectInputLibHandle = 0; -CDIEventEmitter::TPDirectInput8Create CDIEventEmitter::_PDirectInput8Create = NULL; -uint CDIEventEmitter::_NumCreatedInterfaces = 0; - -/////////////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////////////// - -//////////////////////////////////// -// CDIEventEmitter implementation // -//////////////////////////////////// - - -//====================================================== -CDIEventEmitter::CDIEventEmitter(HWND hwnd, CWinEventEmitter *we) -: - _hWnd(hwnd), - _WE(we), - _DInput8(NULL), - _Keyboard(NULL), - _Mouse(NULL), - _ButtonsFlags(noButton) -{ -} -//====================================================== -CDIEventEmitter::~CDIEventEmitter() -{ - releaseMouse(); - releaseKeyboard(); - // release all devices - while (_DeviceServer.getNumDevices() != 0) - { - IInputDevice *dev = _DeviceServer.getDevice(0); - _DeviceServer.removeDevice(dev); - delete dev; - } - if (_DInput8) _DInput8->Release(); - -- _NumCreatedInterfaces; - if (_NumCreatedInterfaces == 0) unloadLib(); -} - -//====================================================== -CDIEventEmitter *CDIEventEmitter::create(HINSTANCE hinst, HWND hwnd, CWinEventEmitter *we) throw(EDirectInput) -{ - if (!loadLib()) throw EDirectInputLibNotFound(); - std::auto_ptr dxee(new CDIEventEmitter(hwnd, we)); - HRESULT result = _PDirectInput8Create(hinst, - DIRECTINPUT_VERSION, - IID_IDirectInput8A, - (void **) &dxee->_DInput8, - NULL); - if (result != DI_OK) throw EDirectInputInitFailed(); - - // ok, everything's fine, commit changes - ++_NumCreatedInterfaces; - return dxee.release(); -} - - -//====================================================== -bool CDIEventEmitter::loadLib() -{ - if (_DirectInputLibHandle != 0) return true; // library already loaded ? - HMODULE handle = ::LoadLibrary(DirectInputLibName); - if (handle == 0) return false; - // try to get the creation function - TPDirectInput8Create cf = (TPDirectInput8Create) ::GetProcAddress(handle, "DirectInput8Create"); - if (!cf) - { - ::FreeLibrary(handle); - return false; - } - // commit changes - _DirectInputLibHandle = handle; - _PDirectInput8Create = cf; - return true; -} - - -//====================================================== -void CDIEventEmitter::unloadLib() -{ - nlassert(_DirectInputLibHandle != 0); - ::FreeLibrary(_DirectInputLibHandle); - _DirectInputLibHandle = 0; - _PDirectInput8Create = NULL; -} - -//====================================================== -void CDIEventEmitter::poll(CEventServer *server) -{ - if (_WE) _ButtonsFlags = _WE->buildFlags(); - if (!server) - server=&_InternalServer; - _DeviceServer.poll(server); -} - - -//====================================================== -TMouseButton CDIEventEmitter::buildButtonsFlags() const -{ - uint mouseFlags; - uint keybFlags; - // - if (_Mouse) // takes the flags from the direct input mouse - { - mouseFlags = (_Mouse->getButton(0) ? leftButton : 0) - | (_Mouse->getButton(1) ? rightButton : 0) - | (_Mouse->getButton(2) ? middleButton : 0); - } - else // takes the flags from the system mouse - { - mouseFlags = _ButtonsFlags & (leftButton | rightButton | middleButton); - } - // - if (_Keyboard) // takes the flags from the direct input keyboard - { - keybFlags = (_Keyboard->ShiftPressed ? shiftButton : 0) - | (_Keyboard->AltPressed ? altButton : 0) - | (_Keyboard->CtrlPressed ? ctrlButton : 0); - } - else // takes the flags from the system keyboard - { - keybFlags = _ButtonsFlags & (shiftButton | altButton | ctrlButton); - } - return (TMouseButton) (keybFlags | mouseFlags); -} - -//====================================================== -IMouseDevice *CDIEventEmitter::getMouseDevice(bool hardware) throw(EInputDevice) -{ - if (_Mouse) return _Mouse; // already created ? - try - { - // Create a mouse - std::auto_ptr mouse(CDIMouse::createMouseDevice(_DInput8, _hWnd, this, hardware, _WE)); - // register to the device server - _DeviceServer.registerDevice(mouse.get()); - _Mouse = mouse.get(); - return mouse.release(); - } - catch (...) - { - if (_WE) _WE->enableMouseEvents(true); - throw; - } -} - -//====================================================== -void CDIEventEmitter::releaseMouse() -{ - if (!_Mouse) return; - // reupdate the system keyboard flags - if (_WE) - { - _WE->resetButtonFlagState(); - _WE->enableMouseEvents(true); - } - // remove the device - _DeviceServer.removeDevice(_Mouse); - delete _Mouse; - _Mouse = NULL; -} - -//=========================================================================== -IKeyboardDevice *CDIEventEmitter::getKeyboardDevice() throw(EInputDevice) -{ - if (_Keyboard) return _Keyboard; - try - { - // create a keyboard - std::auto_ptr keyboard(CDIKeyboard::createKeyboardDevice(_DInput8, _hWnd, this, _WE)); - // register to the device server - _DeviceServer.registerDevice(keyboard.get()); - _Keyboard = keyboard.get(); - return keyboard.release(); - } - catch (...) - { - if (_WE) _WE->enableKeyboardEvents(true); - throw; - } -} - -//========================================================================== -void CDIEventEmitter::releaseKeyboard() -{ - if (!_Keyboard) return; - // reupdate the system keyboard flags - if (_WE) - { - _WE->resetButtonFlagState(); - _WE->enableKeyboardEvents(true); - } - // - _DeviceServer.removeDevice(_Keyboard); - delete _Keyboard; - _Keyboard = NULL; -} - - -//========================================================================== -void CDIEventEmitter::submitEvents(CEventServer &server, bool allWindows) -{ - _InternalServer.setServer(&server); - _InternalServer.pump(allWindows); -} - -//========================================================================== -void CDIEventEmitter::emulateMouseRawMode(bool enable) -{ - nlerror("no raw mode emulation on windows, the CDIMouse has a real raw mode"); -} - -//========================================================================== -/// Tool fct to retrieve the game devices. -static BOOL CALLBACK DIEnumDevicesDescCallback -( - LPCDIDEVICEINSTANCE lpddi, - LPVOID pvRef -) -{ - CGameDeviceDesc desc; - desc.InstanceName = lpddi->tszInstanceName; - desc.ProductName = lpddi->tszProductName; - switch (lpddi->wUsage & 0xff) - { - case DI8DEVTYPE_JOYSTICK: desc.DevType = CGameDeviceDesc::Joystick; break; - case DI8DEVTYPE_GAMEPAD: desc.DevType = CGameDeviceDesc::GamePad; break; - default: desc.DevType = CGameDeviceDesc::DontKnow; break; - } - TDeviceDescVect *dv = (TDeviceDescVect *) pvRef; - dv->push_back(desc); - return DIENUM_CONTINUE; -} - - -//========================================================================== -/// Tool fct to retrieve the game devices GUID -static BOOL CALLBACK DIEnumDevicesGUIDCallback -( - LPCDIDEVICEINSTANCE lpddi, - LPVOID pvRef -) -{ - std::vector *gv = (std::vector *) pvRef; - gv->push_back(lpddi->guidInstance); - return DIENUM_CONTINUE; -} - - -//========================================================================== -void CDIEventEmitter::enumerateGameDevice(TDeviceDescVect &descs) throw(EInputDevice) -{ - uint k; - nlassert(_DInput8); - descs.clear(); - // enum all devices of interest - _DInput8->EnumDevices(DI8DEVCLASS_GAMECTRL, &DIEnumDevicesDescCallback, (LPVOID) &descs, DIEDFL_ALLDEVICES); - for (k = 0; k < descs.size(); ++k) descs[k].Connected = false; - // enum all connected devices - static TDeviceDescVect connecteds; - _DInput8->EnumDevices(DI8DEVCLASS_GAMECTRL, &DIEnumDevicesDescCallback, (LPVOID) &connecteds, DIEDFL_ATTACHEDONLY); - // see which devices are connected - for (k = 0; k < connecteds.size(); ++k) - { - TDeviceDescVect::iterator it = std::find(descs.begin(), descs.end(), connecteds[k]); - it->Connected = true; - } -} - -//========================================================================== -IGameDevice *CDIEventEmitter::createGameDevice(const std::string &instanceName) throw(EInputDevice) -{ - static TDeviceDescVect deviceDescs; - static std::vector deviceGUID; - - nlassert(_DInput8); - enumerateGameDevice(deviceDescs); - // get the ID for each device - deviceGUID.clear(); - HRESULT r = _DInput8->EnumDevices(DI8DEVCLASS_GAMECTRL, &DIEnumDevicesGUIDCallback, (LPVOID) &deviceGUID, DIEDFL_ALLDEVICES); - nlassert(r == DI_OK); - nlassert(deviceDescs.size() == deviceGUID.size()); - - // search the device that match the instance name - for (uint k = 0; k < deviceDescs.size(); ++k) - { - if (deviceDescs[k].InstanceName == instanceName) - { - std::auto_ptr gd(CDIGameDevice::createGameDevice(_DInput8, _hWnd, this, deviceDescs[k], deviceGUID[k])); - // insert in the device server - _DeviceServer.registerDevice(gd.get()); - return gd.release(); - } - } - return NULL; -} - -//========================================================================== -void CDIEventEmitter::releaseGameDevice(IGameDevice *gd) -{ - nlassert(gd); - CDIGameDevice *digd = safe_cast(gd); - _DeviceServer.removeDevice(digd); - delete gd; -} - - -} // NLMISC - -#endif // NL_OS_WINDOWS diff --git a/code/nel/src/misc/di_game_device.cpp b/code/nel/src/misc/di_game_device.cpp deleted file mode 100644 index 6574b5cde..000000000 --- a/code/nel/src/misc/di_game_device.cpp +++ /dev/null @@ -1,523 +0,0 @@ -// NeL - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// 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 "stdmisc.h" -#include "di_game_device.h" -#include "nel/misc/game_device_events.h" - -#ifdef NL_OS_WINDOWS - -#ifdef DEBUG_NEW - #define new DEBUG_NEW -#endif - -namespace NLMISC -{ - -//============================================================================ -CDIGameDevice::CDIGameDevice() : _Device(NULL) -{ - ::memset(&_CurrentState, 0, sizeof(_CurrentState)); -} - -//============================================================================ -CDIGameDevice::~CDIGameDevice() -{ - if (_Device) - { - _Device->Unacquire(); - _Device->Release(); - } -} - -//============================================================================ -CDIGameDevice *CDIGameDevice::createGameDevice(IDirectInput8 *di8, - HWND hwnd, - CDIEventEmitter *diEventEmitter, - const CGameDeviceDesc &desc, - REFGUID rguid) throw(EDirectInput) -{ - nlassert(diEventEmitter); - nlassert(di8); - std::auto_ptr dev(new CDIGameDevice); - // - - HRESULT r = di8->CreateDevice(rguid, &dev->_Device, NULL); - if (r != DI_OK) throw EDirectInputGameDeviceNotCreated(); - - r = dev->_Device->SetDataFormat(pJoyDataFormat); - nlassert(r == DI_OK); - // - r = dev->_Device->SetCooperativeLevel(hwnd, DISCL_FOREGROUND | DISCL_EXCLUSIVE); - if (r != DI_OK) throw EDirectInputCooperativeLevelFailed(); - // - // - dev->_Desc = desc; - dev->_EventEmitter = diEventEmitter; - dev->querryControls(); - return dev.release(); -} - -//============================================================================ -void CDIGameDevice::begin(CEventServer *server) -{ - nlassert(_Device); - HRESULT r; - r = _Device->Poll(); - if (r == DIERR_INPUTLOST || r == DIERR_NOTACQUIRED) - { - r = _Device->Acquire(); - if (r != DI_OK) return; - r = _Device->Poll(); - if (r != DI_OK) return; - } - - CDIJoyState newState; - r = _Device->GetDeviceState(sizeof(CDIJoyState), &newState); - if (r != DI_OK) return; - - uint k; - ////////// - // Axis // - ////////// - for (k = 0; k < MaxNumAxis; ++k) - { - CAxis &axis = _Axis[k]; - if (axis.Present) - { - - if (((LONG *) &newState)[k] != ((LONG *) &_CurrentState)[k]) // state changed ? - { - // update position - axis.Value = 2.f * (((LONG *) &newState)[k] - axis.Min) / (float) (axis.Max - axis.Min) - 1.f; - // create event - CGDAxisMoved *event = new CGDAxisMoved((IGameDevice::TAxis) k, axis.Value, this, _EventEmitter); - // update state - ((LONG *) &_CurrentState)[k] = ((LONG *) &newState)[k]; - // - server->postEvent(event); - // - } - } - } - - - ///////////// - // Buttons // - ///////////// - for (k = 0; k < _Buttons.size(); ++k) - { - CButton &bt = _Buttons[k]; - if ((newState.rgbButtons[k] & 0x80) != (_CurrentState.rgbButtons[k] & 0x80)) - { - bool pushed = (newState.rgbButtons[k] & 0x80) != 0; - // update the state of the button - bt.Pushed = pushed; - CGDButton *event; - if (pushed) event = new CGDButtonDown(k, this, _EventEmitter); - else event = new CGDButtonUp(k, this, _EventEmitter); - // update state - _CurrentState.rgbButtons[k] = newState.rgbButtons[k]; - server->postEvent(event); - } - } - - ///////////// - // Sliders // - ///////////// - for (k = 0; k < _Sliders.size(); ++k) - { - CSlider &sl = _Sliders[k]; - if (newState.rglSlider[k] != _CurrentState.rglSlider[k]) // state changed ? - { - // update position - sl.Pos = ( newState.rglSlider[k] - sl.Min) / (float) (sl.Max - sl.Min); - // create event - CGDSliderMoved *event = new CGDSliderMoved(sl.Pos, k, this, _EventEmitter); - // update state - _CurrentState.rglSlider[k] = newState.rglSlider[k]; - // - server->postEvent(event); - } - } - - ////////// - // POVs // - ////////// - for (k = 0; k < _POVs.size(); ++k) - { - CPOV &pov = _POVs[k]; - if (newState.rgdwPOV[k] != _CurrentState.rgdwPOV[k]) // state changed ? - { - DWORD value = newState.rgdwPOV[k]; - - pov.Centered = (LOWORD(value) == 0xFFFF); - if (!pov.Centered) - { - // update position - pov.Angle = value / 100.f; - } - // create event - CGDPOVChanged *event = new CGDPOVChanged(pov.Centered, pov.Angle, k, this, _EventEmitter); - // update state - _CurrentState.rgdwPOV[k] = newState.rgdwPOV[k]; - // - server->postEvent(event); - } - } - -} - -//============================================================================ -void CDIGameDevice::poll(CInputDeviceServer *dev) -{ - // buffered datas not supported -} - -//============================================================================ -void CDIGameDevice::submit(IInputDeviceEvent *deviceEvent, CEventServer *server) -{ - // should never be called, buffered datas not supported - nlassert(0); -} - - -//============================================================================ -/** Tool fct : tests whether a DIDEVICEOBJECTINSTANCE contains a controls name and return it, - * or build a default one - */ -static void BuildCtrlName(LPCDIDEVICEOBJECTINSTANCE lpddoi, - std::string &destName, - const char *defaultName) -{ - if (lpddoi->dwSize >= offsetof(DIDEVICEOBJECTINSTANCE, tszName) + sizeof(TCHAR[MAX_PATH])) - { - destName = (::strcmp("N/A", lpddoi->tszName) == 0) ? defaultName - : lpddoi->tszName; - } - else - { - destName = defaultName; - } -} - -//============================================================================ -// A callback to enumerate the controls of a device -static BOOL CALLBACK DIEnumDeviceObjectsCallback -( - LPCDIDEVICEOBJECTINSTANCE lpddoi, - LPVOID pvRef -) -{ - - CDIGameDevice *gd = (CDIGameDevice *) pvRef; - return gd->processEnumObject(lpddoi); -} - - - -//======================================================================= -// get range for an axis -static HRESULT GetDIAxisRange(LPDIRECTINPUTDEVICE8 device, uint offset, DWORD type, sint &min, sint &max) -{ - DIPROPRANGE diprg; - diprg.diph.dwSize = sizeof(DIPROPRANGE); - diprg.diph.dwHeaderSize = sizeof(DIPROPHEADER); - diprg.diph.dwHow = DIPH_BYOFFSET; - diprg.diph.dwObj = offset; - - // Set the range for the axis - HRESULT r = device->GetProperty(DIPROP_RANGE, &diprg.diph); - - if (r == DIERR_OBJECTNOTFOUND) - { - // try from its ID - diprg.diph.dwHow = DIPH_BYID; - diprg.diph.dwObj = type; - - // Set the range for the axis - HRESULT r = device->GetProperty(DIPROP_RANGE, &diprg.diph); - if (r != DI_OK) - { - // setup default values ... - min = 0; - max = 65535; - return r; - } - } - else if (r != DI_OK) - { - min = 0; - max = 65535; - return r; - } - - -/* switch (r) - { - default: - nlinfo("ok"); - break; - case DIERR_INVALIDPARAM: - nlinfo("invalid param"); - break; - case DIERR_NOTEXCLUSIVEACQUIRED: - nlinfo("DIERR_NOTEXCLUSIVEACQUIRED"); - break; - case DIERR_NOTINITIALIZED: - nlinfo("DIERR_NOTINITIALIZED"); - break; - case DIERR_OBJECTNOTFOUND: - nlinfo("DIERR_OBJECTNOTFOUND"); - break; - case DIERR_UNSUPPORTED: - nlinfo("DIERR_UNSUPPORTED"); - break; - }*/ - - - min = (sint) diprg.lMin; - max = (sint) diprg.lMax; - - return r; -} - -//============================================================================ -BOOL CDIGameDevice::processEnumObject(LPCDIDEVICEOBJECTINSTANCE lpddoi) -{ - // the dwSize field gives us the size of the objects, and the available fields - // has this object the field guidType and dwOfs ? - if (lpddoi->dwSize < offsetof(DIDEVICEOBJECTINSTANCE, dwOfs) + sizeof(DWORD)) return DIENUM_CONTINUE; - - uint ctrlType = (uint) lpddoi->dwType; - - /////////////////////////////////////////// - // axis, we only support absolute ones // - /////////////////////////////////////////// - - if (lpddoi->guidType == GUID_XAxis && (ctrlType & DIDFT_ABSAXIS) ) - { - GetDIAxisRange(_Device, lpddoi->dwOfs, lpddoi->dwType, _Axis[XAxis].Min, _Axis[XAxis].Max); - BuildCtrlName(lpddoi, _Axis[XAxis].Name, "X Axis"); - _Axis[XAxis].Present = true; - return DIENUM_CONTINUE; - } - if (lpddoi->guidType == GUID_YAxis && (ctrlType & DIDFT_ABSAXIS)) - { - GetDIAxisRange(_Device, lpddoi->dwOfs, lpddoi->dwType, _Axis[YAxis].Min, _Axis[YAxis].Max); - BuildCtrlName(lpddoi, _Axis[YAxis].Name, "Y Axis"); - _Axis[YAxis].Present = true; - return DIENUM_CONTINUE; - } - - if (lpddoi->guidType == GUID_ZAxis && (ctrlType & DIDFT_ABSAXIS)) - { - GetDIAxisRange(_Device, lpddoi->dwOfs, lpddoi->dwType, _Axis[ZAxis].Min, _Axis[ZAxis].Max); - BuildCtrlName(lpddoi, _Axis[ZAxis].Name, "Z Axis"); - _Axis[ZAxis].Present = true; - return DIENUM_CONTINUE; - } - if (lpddoi->guidType == GUID_RxAxis && (ctrlType & DIDFT_ABSAXIS)) - { - GetDIAxisRange(_Device, lpddoi->dwOfs, lpddoi->dwType, _Axis[RXAxis].Min, _Axis[RXAxis].Max); - BuildCtrlName(lpddoi, _Axis[RXAxis].Name, "RX Axis"); - _Axis[RXAxis].Present = true; - return DIENUM_CONTINUE; - } - if (lpddoi->guidType == GUID_RyAxis && (ctrlType & DIDFT_ABSAXIS)) - { - GetDIAxisRange(_Device, lpddoi->dwOfs, lpddoi->dwType, _Axis[RYAxis].Min, _Axis[RYAxis].Max); - BuildCtrlName(lpddoi, _Axis[RYAxis].Name, "RY Axis"); - _Axis[RYAxis].Present = true; - return DIENUM_CONTINUE; - } - if (lpddoi->guidType == GUID_RzAxis && (ctrlType & DIDFT_ABSAXIS)) - { - GetDIAxisRange(_Device, lpddoi->dwOfs, lpddoi->dwType, _Axis[RZAxis].Min, _Axis[RZAxis].Max); - BuildCtrlName(lpddoi, _Axis[RZAxis].Name, "RZ Axis"); - _Axis[RZAxis].Present = true; - return DIENUM_CONTINUE; - } - - - // has this object the field dwType ? - if (lpddoi->dwSize < offsetof(DIDEVICEOBJECTINSTANCE, dwType) + sizeof(DWORD)) return DIENUM_CONTINUE; - - - uint type = lpddoi->dwType; - ///////////// - // Buttons // - ///////////// - if (type & DIDFT_BUTTON) - { - if (_Buttons.size() < MaxNumButtons) - { - _Buttons.push_back(CButton()); - uint buttonIndex = (uint)_Buttons.size() - 1; - char defaultButtonName[32]; - smprintf(defaultButtonName, 32, "BUTTON %d", buttonIndex + 1); - BuildCtrlName(lpddoi, _Buttons[buttonIndex].Name, defaultButtonName); - return DIENUM_CONTINUE; - } - } - - ///////////// - // Sliders // - ///////////// - if (type & DIDFT_ABSAXIS) - { - if (_Sliders.size() < MaxNumSliders) - { - _Sliders.push_back(CSlider()); - uint sliderIndex = (uint)_Sliders.size() - 1; - GetDIAxisRange(_Device, lpddoi->dwOfs, lpddoi->dwType, _Sliders[sliderIndex].Min, _Sliders[sliderIndex].Max); - char defaultSliderName[32]; - smprintf(defaultSliderName, 32, "SLIDER %d", sliderIndex + 1); - BuildCtrlName(lpddoi, _Sliders[sliderIndex].Name, defaultSliderName); - } - return DIENUM_CONTINUE; - } - - - ////////// - // POVs // - ////////// - if (type & DIDFT_POV) - { - if (_POVs.size() < MaxNumPOVs) - { - _POVs.push_back(CPOV()); - uint povIndex = (uint)_POVs.size() - 1; - char defaultPOVName[16]; - smprintf(defaultPOVName, 16, "POV %d", povIndex + 1); - BuildCtrlName(lpddoi, _POVs[povIndex].Name, defaultPOVName); - } - return DIENUM_CONTINUE; - } - - return DIENUM_CONTINUE; -} - -//============================================================================ -void CDIGameDevice::querryControls() -{ - HRESULT r = _Device->EnumObjects(&DIEnumDeviceObjectsCallback, (LPVOID) this, DIDFT_ALL); - nlassert(r == DI_OK); -} - -//============================================================================ -bool CDIGameDevice::setBufferSize(uint size) -{ - // uisually not supported by this kind of devices - return false; -} - -//============================================================================ -uint CDIGameDevice::getBufferSize() const -{ - // uisually not supported by this kind of devices - return 0; -} - -//============================================================================ -uint CDIGameDevice::getNumButtons() const -{ - return (uint)_Buttons.size(); -} - -//============================================================================ -bool CDIGameDevice::hasAxis(TAxis axis) const -{ - nlassert(axis < MaxNumAxis); - return _Axis[axis].Present; -} - -//============================================================================ -uint CDIGameDevice::getNumSliders() const -{ - return (uint)_Sliders.size(); -} - -//============================================================================ -uint CDIGameDevice::getNumPOV() const -{ - return (uint)_POVs.size(); -} -//============================================================================ -const char *CDIGameDevice::getButtonName(uint index) const -{ - nlassert(index < _Buttons.size()); - return _Buttons[index].Name.c_str(); -} - -//============================================================================ -const char *CDIGameDevice::getAxisName(TAxis axis) const -{ - nlassert(axis < MaxNumAxis); - nlassert(hasAxis(axis)); // ! Not an axis of this device - return _Axis[axis].Name.c_str(); -} - -//============================================================================ -const char *CDIGameDevice::getSliderName(uint index) const -{ - nlassert(index < _Sliders.size()); - return _Sliders[index].Name.c_str(); -} - -//============================================================================ -const char *CDIGameDevice::getPOVName(uint index) const -{ - nlassert(index < _POVs.size()); - return _POVs[index].Name.c_str(); -} - -//============================================================================ -bool CDIGameDevice::getButtonState(uint index) const -{ - nlassert(index < _Buttons.size()); - return _Buttons[index].Pushed; -} - -//============================================================================ -float CDIGameDevice::getAxisValue(TAxis axis) const -{ - nlassert(axis < MaxNumAxis); - nlassert(hasAxis(axis)); // ! Not an axis of this device - return _Axis[axis].Value; -} - -//============================================================================ -float CDIGameDevice::getSliderPos(uint index) const -{ - nlassert(index < _Sliders.size()); - return _Sliders[index].Pos; -} - -//============================================================================ -float CDIGameDevice::getPOVAngle(uint index) const -{ - nlassert(index < _POVs.size()); - return _POVs[index].Angle; -} - - - -} // NLMISC - - -#endif // NL_OS_WINDOWS diff --git a/code/nel/src/misc/di_game_device.h b/code/nel/src/misc/di_game_device.h deleted file mode 100644 index cc44aaf4c..000000000 --- a/code/nel/src/misc/di_game_device.h +++ /dev/null @@ -1,170 +0,0 @@ -// NeL - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// 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_DI_GAME_DEVICE_H -#define NL_DI_GAME_DEVICE_H - -#include "nel/misc/types_nl.h" - -#ifdef NL_OS_WINDOWS - -#include "nel/misc/di_event_emitter.h" -#include "nel/misc/game_device.h" - -namespace NLMISC -{ - -// -typedef DIJOYSTATE2 CDIJoyState; -const DIDATAFORMAT * const pJoyDataFormat = &c_dfDIJoystick2; -const uint MaxNumSliders = 2; -const uint MaxNumPOVs = 4; -const uint MaxNumButtons = 128; -// - -struct EDirectInputGameDeviceNotCreated : EDirectInput -{ - EDirectInputGameDeviceNotCreated() : EDirectInput("Unable to create a game device") {} -}; - - -/** - * Direct input implementation of a game device. - */ - -class CDIGameDevice : public IGameDevice -{ -public: - /// Create a direct input game device from the given RGUID. Destroy it with delete - static CDIGameDevice *createGameDevice(IDirectInput8 *di8, - HWND hwnd, - CDIEventEmitter *diEventEmitter, - const CGameDeviceDesc &desc, - REFGUID rguid) throw(EDirectInput); - ~CDIGameDevice(); - - ///\name From IInputDevice - //@{ - virtual bool setBufferSize(uint size); - virtual uint getBufferSize() const; - //@} - - ///\name From IGameDevice - //@{ - virtual const CGameDeviceDesc &getDescription() const { return _Desc; } - // - virtual uint getNumButtons() const; - virtual bool hasAxis(TAxis axis) const; - virtual uint getNumSliders() const; - virtual uint getNumPOV() const; - // - virtual const char *getButtonName(uint index) const; - virtual const char *getAxisName(TAxis axis) const; - virtual const char *getSliderName(uint index) const; - virtual const char *getPOVName(uint index) const; - // - virtual bool getButtonState(uint index) const; - virtual float getAxisValue(TAxis axis) const; - virtual float getSliderPos(uint index) const; - virtual float getPOVAngle(uint index) const; - //@} - - -/////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////// -private: - - // base class for controls - struct CCtrl - { - std::string Name; - }; - - // a button - struct CButton : public CCtrl - { - bool Pushed; - CButton() : Pushed(false) {} - }; - - // an axis. Its value either gives its position (-1 .. 1) or its angle (CCW in radians) - struct CAxis : public CCtrl - { - bool Present; // is this axis used ? - // min and max values from Direct Input - sint Min, Max; - float Value; - CAxis() : Value(0.f), Present(false) {} - }; - - // a slider - struct CSlider : public CCtrl - { - sint Min, Max; - float Pos; - CSlider() : Pos(0.f) {} - }; - - // a POV - struct CPOV : public CCtrl - { - bool Centered; - float Angle; - CPOV() : Angle(0.f), Centered(true) {} - }; - - -private: - // ctor - CDIGameDevice(); - ///\name From IInputDevice - //@{ - virtual void begin(CEventServer *server); - virtual void poll(CInputDeviceServer *dev); - virtual void submit(IInputDeviceEvent *deviceEvent, CEventServer *server); - //@} - /** Get the controls (buttons, slider..) of this device from the Direct Input interface to build this object infos. - */ - void querryControls(); - - /// Called during EnumObject - BOOL processEnumObject(LPCDIDEVICEOBJECTINSTANCE lpddoi); - friend BOOL CALLBACK DIEnumDeviceObjectsCallback(LPCDIDEVICEOBJECTINSTANCE lpddoi, LPVOID pvRef); -private: - LPDIRECTINPUTDEVICE8 _Device; - CGameDeviceDesc _Desc; - CDIEventEmitter *_EventEmitter; - - ///\name Device infos - //@{ - CAxis _Axis[MaxNumAxis]; - std::vector _Buttons; - std::vector _Sliders; - std::vector _POVs; - //@} - CDIJoyState _CurrentState; - -}; - - -} // NLMISC - -#endif // NL_OS_WINDOWS - - -#endif // NL_DI_GAME_DEVICE_H - -/* End of di_play_device.h */ diff --git a/code/nel/src/misc/di_keyboard_device.cpp b/code/nel/src/misc/di_keyboard_device.cpp deleted file mode 100644 index 0802019a4..000000000 --- a/code/nel/src/misc/di_keyboard_device.cpp +++ /dev/null @@ -1,686 +0,0 @@ -// NeL - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// 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 "stdmisc.h" -#include "di_keyboard_device.h" - -#ifdef NL_OS_WINDOWS - -#include "nel/misc/win_event_emitter.h" -#include -#include - -#include "Mmsystem.h" - -#ifdef DEBUG_NEW - #define new DEBUG_NEW -#endif - -namespace NLMISC -{ - -// used to do a conversion from DX key code to Nel keys enums -struct CKeyConv -{ - uint DIKey; - TKey NelKey; - const char *KeyName; - bool Repeatable; -}; - -// this is used to build a conversion table -static const CKeyConv DIToNel[] = -{ - // - {DIK_F1, KeyF1, "F1", true}, - {DIK_F2, KeyF2, "F2", true}, - {DIK_F3, KeyF3, "F3", true}, - {DIK_F4, KeyF4, "F4", true}, - {DIK_F5, KeyF5, "F5", true}, - {DIK_F6, KeyF6, "F6", true}, - {DIK_F7, KeyF7, "F7", true}, - {DIK_F8, KeyF8, "F8", true}, - {DIK_F9, KeyF9, "F9", true}, - {DIK_F10, KeyF10, "F10", true}, - {DIK_F11, KeyF11, "F11", true}, - {DIK_F12, KeyF12, "F12", true}, - {DIK_F13, KeyF13, "F13", true}, - {DIK_F14, KeyF14, "F14", true}, - {DIK_F15, KeyF15, "F15", true}, - // - {DIK_NUMPAD0, KeyNUMPAD0, "NUMPAD0", true}, - {DIK_NUMPAD1, KeyNUMPAD1, "NUMPAD1", true}, - {DIK_NUMPAD2, KeyNUMPAD2, "NUMPAD2", true}, - {DIK_NUMPAD3, KeyNUMPAD3, "NUMPAD3", true}, - {DIK_NUMPAD4, KeyNUMPAD4, "NUMPAD4", true}, - {DIK_NUMPAD5, KeyNUMPAD5, "NUMPAD5", true}, - {DIK_NUMPAD6, KeyNUMPAD6, "NUMPAD6", true}, - {DIK_NUMPAD7, KeyNUMPAD7, "NUMPAD7", true}, - {DIK_NUMPAD8, KeyNUMPAD8, "NUMPAD8", true}, - {DIK_NUMPAD9, KeyNUMPAD9, "NUMPAD9", true}, - // - {DIK_DIVIDE, KeyDIVIDE, "/", true}, - {DIK_DECIMAL, KeyDECIMAL, "NUMPAD .", true}, - // - {DIK_LSHIFT, KeyLSHIFT, "LEFT SHIFT", false}, - {DIK_RSHIFT, KeyRSHIFT, "RIGHT SHIFT", false}, - // - {DIK_LCONTROL, KeyLCONTROL, "LEFT CONTROL", false}, - {DIK_RCONTROL, KeyRCONTROL, "RIGHT CONTROL", false}, - // - {DIK_LMENU, KeyLMENU, "ALT", false}, - {DIK_RMENU, KeyRMENU, "ALT GR", false}, - // - {DIK_UP, KeyUP, "UP", true}, - {DIK_PRIOR, KeyPRIOR, "PRIOR", true}, - {DIK_LEFT, KeyLEFT, "LEFT", true}, - {DIK_RIGHT, KeyRIGHT, "RIGHT", true}, - {DIK_END, KeyEND, "END", true}, - {DIK_DOWN, KeyDOWN, "DOWN", true}, - {DIK_NEXT, KeyNEXT, "NEXT", true}, - {DIK_INSERT, KeyINSERT, "INSERT", true}, - {DIK_DELETE, KeyDELETE, "DELETE", true}, - {DIK_HOME, KeyHOME, "HOME", true}, - {DIK_LWIN, KeyLWIN, "LEFT WIN", false}, - {DIK_RWIN, KeyRWIN, "RIGHT WIN", false}, - {DIK_APPS, KeyAPPS, "APPS", false}, - {DIK_BACK, KeyBACK, "BACK", true}, - // - {DIK_SYSRQ, KeySNAPSHOT, "SNAPSHOT", false}, - {DIK_SCROLL, KeySCROLL, "SCROLL", false}, - {DIK_PAUSE, KeyPAUSE, "PAUSE", false}, - // - {DIK_NUMLOCK, KeyNUMLOCK, "NUMLOCK", false}, - // - {DIK_NUMPADENTER, KeyRETURN, "RETURN", true}, - //{DIK_NUMPADENTER, KeyRETURN, "ENTER", true}, - // - {DIK_CONVERT, KeyCONVERT, "CONVERT", false}, - {DIK_NOCONVERT, KeyNONCONVERT, "NOCONVERT", true}, - // - {DIK_KANA, KeyKANA, false}, - {DIK_KANJI, KeyKANJI, false}, -}; - - -///======================================================================== -const CKeyConv *CDIKeyboard::DIKeyToNelKeyTab[CDIKeyboard::NumKeys]; - -///======================================================================== -CDIKeyboard::CDIKeyboard(CWinEventEmitter *we, HWND hwnd) -: _Keyboard(NULL), - _WE(we), - ShiftPressed(false), - CtrlPressed(false), - AltPressed(false), - _CapsLockToggle(true), - _hWnd(hwnd), - _RepeatDelay(250), - _RepeatPeriod(200), - _FirstPressDate(-1), - _LastDIKeyPressed(0) -{ - if (::GetKeyboardState((PBYTE) _VKKeyState) == FALSE) - { - std::fill(_VKKeyState, _VKKeyState + NumKeys, 0); - } - // test whether the user toggle its keyboard with shift or not.. - HKEY hKey; - if (::RegOpenKeyEx(HKEY_CURRENT_USER, "Keyboard Layout", 0, KEY_READ, &hKey) == ERROR_SUCCESS) - { - DWORD type = REG_DWORD; - DWORD value; - DWORD size = sizeof(DWORD); - if (::RegQueryValueEx(hKey, "Attributes", NULL, &type, (LPBYTE) &value, &size) == ERROR_SUCCESS) - { - _CapsLockToggle = (value & (1 << 16)) == 0; - } - ::RegCloseKey(hKey); - } - // get repeat delay and period - int keybDelay; - if (::SystemParametersInfo(SPI_GETKEYBOARDDELAY, 0, &keybDelay, 0) != 0) - { - _RepeatDelay = 250 + 250 * keybDelay; - } - DWORD keybSpeed; - if (::SystemParametersInfo(SPI_GETKEYBOARDSPEED, 0, &keybSpeed, 0) != 0) - { - _RepeatPeriod = (uint) (1000.f / (keybSpeed * (27.5f / 31.f) + 2.5f)); - } - // get keyboard layout - _KBLayout = ::GetKeyboardLayout(NULL); - - _RepetitionDisabled.resize(NumKeys); - _RepetitionDisabled.clearAll(); -} - -///======================================================================== -void CDIKeyboard::updateVKKeyState(uint diKey, bool pressed, TKey &keyValue, TKey &charValue) -{ - bool extKey; - bool repeatable; - keyValue = DIKeyToNelKey(diKey, extKey, repeatable); - // - if (keyValue == 0) - { - charValue = keyValue; - return; - } - // - if (pressed) - { - // check for toggle key - switch (keyValue) - { - case KeyPAUSE: - case KeyKANA: - case KeyKANJI: - _VKKeyState[keyValue] ^= 0x01; // toggle first bit - break; - case KeyCAPITAL: - if (_CapsLockToggle) - { - _VKKeyState[keyValue] ^= 0x01; - //toggleCapsLock(false); - } - else - { - if ((_VKKeyState[keyValue] & 0x01) == 0) - { - _VKKeyState[keyValue] |= 0x01; - //toggleCapsLock(false); - } - } - break; - case KeyNUMLOCK: - _VKKeyState[keyValue] ^= 0x01; - //setNumLock((_VKKeyState[keyValue] & 0x01) != 0); - break; - case KeySCROLL: - _VKKeyState[keyValue] ^= 0x01; - //toggleScrollLock(); - break; - - } - - _VKKeyState[keyValue] |= 0x80; - } - else - { - _VKKeyState[keyValue] &= ~0x80; - } - // - switch (keyValue) - { - case KeyLSHIFT: charValue = KeySHIFT; break; - case KeyRSHIFT: charValue = KeySHIFT; break; - case KeyLCONTROL: charValue = KeyCONTROL; break; - case KeyRCONTROL: charValue = KeyCONTROL; break; - case KeyLMENU: charValue = KeyMENU; break; - case KeyRMENU: charValue = KeyMENU; break; - default: charValue = keyValue; break; - } - // - if (charValue == KeySHIFT && !_CapsLockToggle) - { - if (_VKKeyState[KeyCAPITAL] & 0x01) - { - _VKKeyState[KeyCAPITAL] &= ~0x01; - //toggleCapsLock(true); - } - } - // - if (charValue != keyValue) - { - _VKKeyState[charValue] = _VKKeyState[keyValue]; - } - // - updateCtrlAltShiftValues(); -} - -///======================================================================== -void CDIKeyboard::updateCtrlAltShiftValues() -{ - ShiftPressed = (_VKKeyState[KeySHIFT] & 0x80) != 0; - CtrlPressed = (_VKKeyState[KeyCONTROL] & 0x80) != 0; - AltPressed = (_VKKeyState[KeyMENU] & 0x80) != 0; -} - -///======================================================================== -CDIKeyboard::~CDIKeyboard() -{ - if (_Keyboard) - { - _Keyboard->Unacquire(); - _Keyboard->Release(); - } -} - -///======================================================================== -CDIKeyboard *CDIKeyboard::createKeyboardDevice(IDirectInput8 *di8, - HWND hwnd, - CDIEventEmitter *diEventEmitter, - CWinEventEmitter *we - ) throw(EDirectInput) -{ - std::auto_ptr kb(new CDIKeyboard(we, hwnd)); - kb->_DIEventEmitter = diEventEmitter; - HRESULT result = di8->CreateDevice(GUID_SysKeyboard, &kb->_Keyboard, NULL); - if (result != DI_OK) throw EDirectInputNoKeyboard(); - result = kb->_Keyboard->SetCooperativeLevel(hwnd, DISCL_FOREGROUND | DISCL_EXCLUSIVE); - if (result != DI_OK) throw EDirectInputCooperativeLevelFailed(); - result = kb->_Keyboard->SetDataFormat(&c_dfDIKeyboard); - kb->setBufferSize(16); - kb->_Keyboard->Acquire(); - - // Enable win32 keyboard messages only if hardware mouse in normal mode - if (kb->_WE) - kb->_WE->enableKeyboardEvents(false); - - return kb.release(); -} - -///======================================================================== -void CDIKeyboard::poll(CInputDeviceServer *dev) -{ - nlassert(_Keyboard); - nlassert(_KeyboardBufferSize > 0); - static std::vector datas; - datas.resize(_KeyboardBufferSize); - DWORD numElements = _KeyboardBufferSize; - HRESULT result = _Keyboard->GetDeviceData(sizeof(DIDEVICEOBJECTDATA), &datas[0], &numElements, 0); - if (result == DIERR_NOTACQUIRED || result == DIERR_INPUTLOST) - { - result = _Keyboard->Acquire(); - if (result != DI_OK) return; - // get device state - ::GetKeyboardState((unsigned char *) _VKKeyState); - _LastDIKeyPressed = 0; - updateCtrlAltShiftValues(); - result = _Keyboard->GetDeviceData(sizeof(DIDEVICEOBJECTDATA), &datas[0], &numElements, 0); - if (result != DI_OK) return; - } - else if (result != DI_OK) - { - return; - } - - _PollTime = (uint32) CTime::getLocalTime(); - - - // process each message in the list - for (uint k = 0; k < numElements; ++k) - { - CDIEvent *die = new CDIEvent; - die->Emitter = this; - die->Datas = datas[k]; - dev->submitEvent(die); - } -} - -///======================================================================== -void CDIKeyboard::transitionOccured(CEventServer *server, const IInputDeviceEvent *nextMessage) -{ - repeatKey(buildDateFromEvent(nextMessage), server); -} - -///======================================================================== -TKeyButton CDIKeyboard::buildKeyButtonsFlags() const -{ - return (TKeyButton) ( (ShiftPressed ? shiftKeyButton : 0) - | (CtrlPressed ? ctrlKeyButton : 0) - | (AltPressed ? altKeyButton : 0) - ); -} - -///======================================================================== -void CDIKeyboard::keyTriggered(bool pressed, uint dikey, CEventServer *server, uint32 date) -{ - #if 0 - const uint numPairs = sizeof(DIToNel) / sizeof(CKeyConv); - for (uint k = 0; k < numPairs; ++k) - { - if (DIToNel[k].DIKey == key) - { - nlinfo(DIToNel[k].KeyName); - } - } - #endif - - - TKey keyValue, charValue; - updateVKKeyState(dikey, pressed, keyValue, charValue); - if (keyValue == 0) return; - - CEventKey *ek; - if (pressed ) - { - ek = new CEventKeyDown(keyValue, buildKeyButtonsFlags(), true, _DIEventEmitter); - } - else - { - ek = new CEventKeyUp(keyValue, buildKeyButtonsFlags(), _DIEventEmitter); - } - server->postEvent(ek); - - if (pressed) - { - if (_RepetitionDisabled[(uint) keyValue] == false) - { - _LastEmitDate = _FirstPressDate = date; - _LastDIKeyPressed = dikey; - } - else // not a repeatable key - { - _LastDIKeyPressed = 0; - return; - } - } - else - { - // key released ? - if (dikey == _LastDIKeyPressed) - { - _LastDIKeyPressed = 0; - } - - if (_RepetitionDisabled[(uint) keyValue] == true) - { - return; - } - } - - // first char event (if repetition not disabled) - if (keyValue >= KeyNUMPAD0 && keyValue <= KeyNUMPAD9 || keyValue == KeyDECIMAL) - { - if ((_VKKeyState[KeyNUMLOCK] & 0x01) != 0) - { - sendUnicode(charValue, dikey, server, pressed); - } - } - else - { - sendUnicode(charValue, dikey, server, pressed); - } - - _FirstPressDate = (uint32) NLMISC::CTime::getLocalTime(); // can't use the time stamp, because we can't not sure it matches the local time. - // time stamp is used for evenrts sorting only -} - -///======================================================================== -void CDIKeyboard::submit(IInputDeviceEvent *deviceEvent, CEventServer *server) -{ - CDIEvent *die = safe_cast(deviceEvent); - bool pressed = (die->Datas.dwData & 0x80) != 0; - keyTriggered(pressed, (uint) die->Datas.dwOfs, server, die->Datas.dwTimeStamp); -} - -///======================================================================== -TMouseButton CDIKeyboard::buildKeyboardButtonFlags() const -{ - nlassert(_Keyboard); - return _DIEventEmitter->buildKeyboardButtonFlags(); -} - -///======================================================================== -bool CDIKeyboard::setBufferSize(uint size) -{ - nlassert(size > 0); - nlassert(_Keyboard); - _Keyboard->Unacquire(); - DIPROPDWORD dipdw; - dipdw.diph.dwSize = sizeof(DIPROPDWORD); - dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER); - dipdw.diph.dwObj = 0; - dipdw.diph.dwHow = DIPH_DEVICE; - dipdw.dwData = size; - HRESULT r = _Keyboard->SetProperty( DIPROP_BUFFERSIZE, &dipdw.diph ); - if (r != DI_OK) return false; - _KeyboardBufferSize = size; - return true; -} - -///======================================================================== -uint CDIKeyboard::getBufferSize() const -{ - return _KeyboardBufferSize; -} - -///======================================================================== -TKey CDIKeyboard::DIKeyToNelKey(uint diKey, bool &extKey, bool &repeatable) -{ - // some key are not handled by MapVirtualKeyEx so we need to convert them ourselves - static bool tableBuilt = false; - - if (!tableBuilt) - { - uint k; - for (k = 0; k < NumKeys; ++k) - { - DIKeyToNelKeyTab[k] = NULL; // set as not a valid key by default - } - const uint numPairs = sizeof(DIToNel) / sizeof(CKeyConv); - for (k = 0; k < numPairs; ++k) - { - DIKeyToNelKeyTab[DIToNel[k].DIKey] = &DIToNel[k]; - } - tableBuilt = true; - } - - - // - if (DIKeyToNelKeyTab[diKey] != NULL) - { - const CKeyConv &keyConv = *DIKeyToNelKeyTab[diKey]; - extKey = true; - repeatable = keyConv.Repeatable; - return keyConv.NelKey; - } - - - - // try doing the conversion using MapVirtualKey - TKey key = (TKey) ::MapVirtualKeyEx(diKey, 1, _KBLayout); - extKey = false; - return key; -} - -///======================================================================== -void CDIKeyboard::sendUnicode(TKey vkey, uint dikey, CEventServer *server, bool pressed) -{ - uint8 oldShift = _VKKeyState[KeySHIFT]; - /// If caps lock is off when pressing shift, we must disable shift, to get no minuscule letters when it is pressed and capslocks is on. - if (!_CapsLockToggle && _VKKeyState[KeyCAPITAL] & 0x01) - { - _VKKeyState[KeySHIFT] = 0; - } - // 'ToUnicode??' is supported since NT4.0 only - // Check if there's support - - - static bool init = false; - static bool toUnicodeSupported = false; - if (!init) - { - init = true; - OSVERSIONINFO osvi; - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - if (::GetVersionEx (&osvi)) - { - if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) - { - if (osvi.dwMajorVersion >= 4) - { - toUnicodeSupported = true; - } - } - } - } - - - if (toUnicodeSupported) - { - const uint maxNumKeys = 8; - WCHAR keyUnicodes[maxNumKeys]; - int res = ::ToUnicodeEx(vkey, dikey | (pressed ? 0 : (1 << 15)), (unsigned char *) _VKKeyState, keyUnicodes, maxNumKeys, 0, _KBLayout); - // - _VKKeyState[KeySHIFT] = oldShift; - // - for (sint k = 0; k < res; ++k) - { - CEventChar *evc = new CEventChar((ucchar) keyUnicodes[k], buildKeyButtonsFlags(), _DIEventEmitter); - server->postEvent(evc); - } - } - else - { - unsigned char buf[2]; - int res = ::ToAsciiEx(vkey, dikey | (pressed ? 0 : (1 << 15)), (unsigned char *) _VKKeyState, (LPWORD) buf, 0, _KBLayout); - for (sint k = 0; k < res; ++k) - { - CEventChar *evc = new CEventChar((ucchar) buf[k], buildKeyButtonsFlags(), _DIEventEmitter); - server->postEvent(evc); - } - } -} - -///======================================================================== -void CDIKeyboard::repeatKey(uint32 currentDate, CEventServer *server) -{ - if (_LastDIKeyPressed == 0 || _LastDIKeyPressed == DIK_INSERT) return; - bool extKey; - bool repeatable; - TKey vkey = DIKeyToNelKey(_LastDIKeyPressed, extKey, repeatable); - if (vkey == 0) return; - if (currentDate - _FirstPressDate < _RepeatDelay) return; - - sint32 firstDate = _LastEmitDate - (_FirstPressDate + _RepeatDelay); - sint32 lastDate = currentDate - (_FirstPressDate + _RepeatDelay); - if (firstDate < 0) firstDate = 0; - - if (lastDate < firstDate) return; - - uint numRep = (uint) ((lastDate + _RepeatPeriod - 1) / _RepeatPeriod - (firstDate + _RepeatPeriod - 1) / _RepeatPeriod); - //numRep = std::min(16u, numRep); // too much repetitions don't make sense... - if ((sint) numRep < 0) return; // 50 days loop.. - numRep = 1; // fix : for now it seems better to limit the number of repetition to 1 per frame (it can be greater than 1 only if framerate is slow, but its not very useable) - - - // numpad case - if (vkey >= KeyNUMPAD0 && vkey <= KeyNUMPAD9 || vkey == KeyDECIMAL) - { - // check whether numlock is activated - if ((_VKKeyState[KeyNUMLOCK] & 0x01) != 0) - { - for (uint k = 0; k < numRep; ++k) - { - sendUnicode(vkey, _LastDIKeyPressed, server, true); - } - } - else - { - // arrow, home, end.. events - for (uint k = 0; k < numRep; ++k) - { - CEventKey *ek = new CEventKeyDown(vkey, buildKeyButtonsFlags(), false, _DIEventEmitter); - server->postEvent(ek); - } - } - } - else - { - for (uint k = 0; k < numRep; ++k) - { - // if it is an extended key, repetition won't be managed by sendUnicode - if (extKey && repeatable) - { - CEventKey *ek = new CEventKeyDown(vkey, buildKeyButtonsFlags(), false, _DIEventEmitter); - server->postEvent(ek); - } - else - { - sendUnicode(vkey, _LastDIKeyPressed, server, true); - } - } - } - - _LastEmitDate = currentDate; -} - -///======================================================================== -uint32 CDIKeyboard::buildDateFromEvent(const IInputDeviceEvent *deviceEvent) -{ - if (deviceEvent) - { - const CDIEvent *die = safe_cast(deviceEvent); - return (uint32) die->Datas.dwData; - } - else - { - return _PollTime; - } -} - -///======================================================================== -void CDIKeyboard::disableRepetition(const TKey *keyTab, uint numKey) -{ - _RepetitionDisabled.clearAll(); - for (uint k = 0; k < numKey; ++k) - { - _RepetitionDisabled.set((sint) keyTab[k]); - } - - if (_LastDIKeyPressed != 0) - { - bool extKey; - bool repeatable; - TKey key = DIKeyToNelKey(_LastDIKeyPressed, extKey, repeatable); - if (_RepetitionDisabled[(uint) key]) - { - // disable this key repetition - _LastDIKeyPressed = 0; - } - } -} - -///======================================================================== -uint CDIKeyboard::getNumDisabledRepetition() const -{ - uint numKey = 0; - for (uint k = 0; k < NumKeys; ++k) - { - if (_RepetitionDisabled[k]) ++numKey; - } - return numKey; -} - -///======================================================================== -void CDIKeyboard::getDisabledRepetitions(TKey *destTab) const -{ - for (uint k = 0; k < NumKeys; ++k) - { - if (_RepetitionDisabled[k]) *destTab++ = (TKey) k; - } -} - - - -} // NLMISC - -#endif // NL_OS_WINDOWS diff --git a/code/nel/src/misc/di_keyboard_device.h b/code/nel/src/misc/di_keyboard_device.h deleted file mode 100644 index d28285894..000000000 --- a/code/nel/src/misc/di_keyboard_device.h +++ /dev/null @@ -1,163 +0,0 @@ -// NeL - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// 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_DI_KEYBOARD_H -#define NL_DI_KEYBOARD_H - -#include "nel/misc/types_nl.h" - -#ifdef NL_OS_WINDOWS - -#include "nel/misc/input_device_server.h" -#include "nel/misc/keyboard_device.h" -#include "nel/misc/di_event_emitter.h" -#include "nel/misc/bit_set.h" - - - - - -namespace NLMISC -{ - -class CWinEventEmitter; - -// -struct EDirectInputNoKeyboard : public EDirectInput -{ - EDirectInputNoKeyboard() : EDirectInput("No keyboard found") {} -}; - - -struct CKeyConv; - -/** - * Direct Input implementation of a keyboard. - * \see CDIEventEmitter - * \author Nicolas Vizerie - * \author Nevrax France - * \date 2002 - */ -class CDIKeyboard : public IKeyboardDevice -{ -public: - bool ShiftPressed, CtrlPressed, AltPressed; -public: - ///\name Object - //@{ - /** Create a keyboard device, that must then be deleted by the caller - * An optional WinEventEmiter can be provided, so that its flags can be in sync - * with a win32 keyboard flags (shift, ctrl, and alt) - */ - static CDIKeyboard *createKeyboardDevice(IDirectInput8 *di8, - HWND hwnd, - CDIEventEmitter *diEventEmitter, - CWinEventEmitter *we = NULL - ) throw(EDirectInput); - // dtor - virtual ~CDIKeyboard(); - //@} - - ///\name From IInputDevice - //@{ - virtual bool setBufferSize(uint size); - virtual uint getBufferSize() const; - //@} - - ///\name From IInputDevice - //@{ - uint getKeyRepeatDelay() const { return _RepeatDelay; } - void setKeyRepeatDelay(uint delay) { nlassert(delay > 0); _RepeatDelay = delay; } - uint getKeyRepeatPeriod() const { return _RepeatPeriod; } - void setKeyRepeatPeriod(uint period) { nlassert(period > 0); _RepeatPeriod = period; } - void disableRepetition(const TKey *keyTab, uint numKey); - uint getNumDisabledRepetition() const; - void getDisabledRepetitions(TKey *destTab) const; - //@} - - TMouseButton buildKeyboardFlags() const; -/////////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////////// -private: - // - bool _CapsLockToggle; // true if caps lock off is triggered by caps lock, false if it toggled by shift - uint _RepeatDelay; // the delay before a key is repeated (in ms) - uint _RepeatPeriod; // The period for key repetitions (in ms) - // - LPDIRECTINPUTDEVICE8 _Keyboard; - uint _KeyboardBufferSize; - // virtual code state - uint8 _VKKeyState[NumKeys]; - // tells for which keys repetition is disabled - CBitSet _RepetitionDisabled; - // The date at which the last key pressed has been pressed (not using 64 bits since note handled by Direct Input) - uint32 _FirstPressDate; - // The last date at which key repetition occured (not using 64 bits since note handled by Direct Input) - uint32 _LastEmitDate; - // The system date at which the last polling occured (not using 64 bits since note handled by Direct Input) - uint32 _PollTime; - uint _LastDIKeyPressed; - CWinEventEmitter *_WE; - HWND _hWnd; - HKL _KBLayout; - // - CDIEventEmitter *_DIEventEmitter; - // - static const CKeyConv *DIKeyToNelKeyTab[NumKeys]; -private: - /// ctor - CDIKeyboard(CWinEventEmitter *we, HWND hwnd); - /** Convert a direct input scancode to a virtual key. Note that DirectInput scancodes do not always match system scan codes. - * Repeatable has a meaning only for extended keys - */ - TKey DIKeyToNelKey(uint diKey, bool &extKey, bool &repeatable); - /** This update virtual key state table. - * \param keyValue contains the value to send to a EventKeyDown or EventKeyUp message. - * \param charValue contains the value that must be used for Unicode conversion (which generate EventChar messages) - */ - void updateVKKeyState(uint diKey, bool pressed, TKey &keyValue, TKey &charValue); - // Use the given virtual key code and the current keyb state to produce Unicode - void sendUnicode(TKey vkey, uint dikey, CEventServer *server, bool pressed); - // Build a TKeyButton value from the state of shift, ctrl and alt - TKeyButton buildKeyButtonsFlags() const; - // Update the state of this object and send the appropriate message when a direct / input key has been pressed / released - void keyTriggered(bool pressed, uint key, CEventServer *server, uint32 date); - // The same as buildKeyButtonsFlags(), but the return is a TMouseButtonValue (with no mouse value setupped) - TMouseButton buildKeyboardButtonFlags() const; - // setup the state of the Ctrl, Alt and Shift key from the state in the _VKKeyState buffer - void updateCtrlAltShiftValues(); - /// Repeat the current key, and create events - void repeatKey(uint32 currentDate, CEventServer *server); - /// Build a date by using an event time stamp, or generate one if NULL - uint32 buildDateFromEvent(const IInputDeviceEvent *deviceEvent); - - ///\name From IInputDevice - //@{ - virtual void poll(CInputDeviceServer *dev); - virtual void submit(IInputDeviceEvent *deviceEvent, CEventServer *server); - virtual void transitionOccured(CEventServer *server, const IInputDeviceEvent *nextMessage); - //@} -}; - - -} // NLMISC - - -#endif // NL_OS_WINDOWS - -#endif // NL_DI_KEYBOARD_H - -/* End of di_keyboard.h */ diff --git a/code/nel/src/misc/di_mouse_device.cpp b/code/nel/src/misc/di_mouse_device.cpp deleted file mode 100644 index 2dfcf95f0..000000000 --- a/code/nel/src/misc/di_mouse_device.cpp +++ /dev/null @@ -1,501 +0,0 @@ -// NeL - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// 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 "stdmisc.h" - -#include "di_mouse_device.h" -#include "nel/misc/game_device_events.h" -#include "nel/misc/win_event_emitter.h" - - -#ifdef NL_OS_WINDOWS - -#ifdef DEBUG_NEW - #define new DEBUG_NEW -#endif - -namespace NLMISC -{ - -//====================================================== -CDIMouse::CDIMouse() : _MessageMode(RawMode), - _MouseSpeed(1.0f), - _MouseAccel(10000), - _Mouse(NULL), - _XAcc(0), - _YAcc(0), - _XMousePos(0), - _YMousePos(0), - _LastMouseButtonClicked(-1), - _DoubleClickDelay(300), - _XFactor(1.f), - _YFactor(1.f), - OldDIXPos(0), - OldDIYPos(0), - OldDIZPos(0), - _FirstX(true), - _FirstY(true), - _SwapButton(false) - -{ - std::fill(_MouseButtons, _MouseButtons + MaxNumMouseButtons, false); - std::fill(_MouseAxisMode, _MouseAxisMode + NumMouseAxis, Raw); - _MouseFrame.setWH(0, 0, 640, 480); -} - -//====================================================== -CDIMouse::~CDIMouse() -{ - if (_Mouse) - { - _Mouse->Unacquire(); - _Mouse->Release(); - } -} - -//====================================================== -void CDIMouse::setMouseMode(TAxis axis, TAxisMode axisMode) -{ - nlassert(axisMode < AxisModeLast); - nlassert(axis < AxisLast); - _MouseAxisMode[axis] = axisMode; - clampMouseAxis(); -} - -//====================================================== -CDIMouse::TAxisMode CDIMouse::getMouseMode(TAxis axis) const -{ - nlassert(axis < NumMouseAxis); - return _MouseAxisMode[axis]; -} - -//====================================================== -void CDIMouse::setMouseSpeed(float speed) -{ - nlassert(_MessageMode == NormalMode); - nlassert(speed > 0); - _MouseSpeed = speed; -} - -//====================================================== -void CDIMouse::setMouseAcceleration(uint accel) -{ - _MouseAccel = accel; -} - -//====================================================== -uint CDIMouse::getMouseAcceleration() const -{ - return _MouseAccel; -} - -//====================================================== -bool CDIMouse::setBufferSize(uint size) -{ - nlassert(size > 0); - nlassert(_Mouse); - _Mouse->Unacquire(); - DIPROPDWORD dipdw; - dipdw.diph.dwSize = sizeof(DIPROPDWORD); - dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER); - dipdw.diph.dwObj = 0; - dipdw.diph.dwHow = DIPH_DEVICE; - dipdw.dwData = size; - HRESULT r = _Mouse->SetProperty( DIPROP_BUFFERSIZE, &dipdw.diph ); - if (r != DI_OK) return false; - _MouseBufferSize = size; - return true; -} - -//====================================================== -uint CDIMouse::getBufferSize() const { return _MouseBufferSize; } - -//====================================================== -void CDIMouse::setMousePos(float x, float y) -{ - nlassert(_MessageMode == NormalMode); - _XMousePos = (sint64) ((double) x * ((sint64) 1 << 32)); - _YMousePos = (sint64) ((double) y * ((sint64) 1 << 32)); -} - -//====================================================== -CDIMouse *CDIMouse::createMouseDevice(IDirectInput8 *di8, HWND hwnd, CDIEventEmitter *diEventEmitter, bool hardware, CWinEventEmitter *we) throw(EDirectInput) -{ - std::auto_ptr mouse(new CDIMouse); - mouse->_DIEventEmitter = diEventEmitter; - mouse->_Hardware = hardware; - HRESULT result = di8->CreateDevice(GUID_SysMouse, &(mouse->_Mouse), NULL); - if (result != DI_OK) throw EDirectInputNoMouse(); - result = mouse->_Mouse->SetCooperativeLevel(hwnd, DISCL_FOREGROUND | (!hardware ? DISCL_EXCLUSIVE:DISCL_NONEXCLUSIVE)); - if (result != DI_OK) throw EDirectInputCooperativeLevelFailed(); - mouse->_Mouse->SetDataFormat(&c_dfDIMouse2); - mouse->setBufferSize(64); - mouse->_WE = we; - mouse->setDoubleClickDelay(::GetDoubleClickTime()); - - /** we want an absolute mouse mode, so that, if the event buffer get full, we can retrieve the right position - */ - DIPROPDWORD prop; - prop.diph.dwSize = sizeof(DIPROPDWORD); - prop.diph.dwHeaderSize = sizeof(DIPROPHEADER); - prop.diph.dwHow = DIPH_DEVICE; - prop.diph.dwObj = 0; - prop.dwData = DIPROPAXISMODE_ABS; - HRESULT r = mouse->_Mouse->SetProperty(DIPROP_AXISMODE, &prop.diph); - nlassert(r == DI_OK); // should always succeed... - // - mouse->_Mouse->Acquire(); - mouse->_hWnd = hwnd; - - // Enable win32 mouse message only if hardware mouse in normal mode - if (mouse->_WE) - mouse->_WE->enableMouseEvents(mouse->_Hardware && (mouse->_MessageMode == IMouseDevice::NormalMode)); - - mouse->_SwapButton = GetSystemMetrics(SM_SWAPBUTTON) != 0; - - return mouse.release(); -} - -//====================================================== -float CDIMouse::getMouseSpeed() const -{ - nlassert(_MessageMode == NormalMode); - return _MouseSpeed; -} - -//====================================================== -const CRect &CDIMouse::getMouseFrame() const -{ - nlassert(_MessageMode == NormalMode); - return _MouseFrame; -} - -//====================================================== -uint CDIMouse::getDoubleClickDelay() const { return _DoubleClickDelay; } - -//====================================================== -inline void CDIMouse::clampMouseAxis() -{ - if (_MouseAxisMode[XAxis] == Clamped) clamp(_XMousePos, (sint64) _MouseFrame.X << 32, (sint64) (_MouseFrame.X + _MouseFrame.Width - 1) << 32); - if (_MouseAxisMode[YAxis] == Clamped) clamp(_YMousePos, (sint64) _MouseFrame.Y << 32, (sint64) (_MouseFrame.X + _MouseFrame.Height - 1) << 32); -} - -//====================================================== -void CDIMouse::poll(CInputDeviceServer *dev) -{ - nlassert(_Mouse); - nlassert(_MouseBufferSize > 0); - static std::vector datas; - datas.resize(_MouseBufferSize); - DWORD numElements = _MouseBufferSize; - HRESULT result = _Mouse->GetDeviceData(sizeof(DIDEVICEOBJECTDATA), &datas[0], &numElements, 0); - if (result == DIERR_NOTACQUIRED || result == DIERR_INPUTLOST) - { - result = _Mouse->Acquire(); - HRESULT result = _Mouse->GetDeviceData(sizeof(DIDEVICEOBJECTDATA), &datas[0], &numElements, 0); - if (result != DI_OK) return; - } - else if (result != DI_OK) return; - - if (::IsWindowEnabled(_hWnd) && ::IsWindowVisible(_hWnd)) - { - for(uint k = 0; k < numElements; ++k) - { - CDIEvent *die = new CDIEvent; - die->Emitter = this; - die->Datas = datas[k]; - dev->submitEvent(die); - } - } -} - - -//====================================================================== -TMouseButton CDIMouse::buildMouseButtonFlags() const -{ - if (_SwapButton) - return (TMouseButton) ( - _DIEventEmitter->buildKeyboardButtonFlags() - | (_MouseButtons[0] ? rightButton : 0) - | (_MouseButtons[1] ? leftButton : 0) - | (_MouseButtons[2] ? middleButton : 0) - ); - else - return (TMouseButton) ( - _DIEventEmitter->buildKeyboardButtonFlags() - | (_MouseButtons[0] ? leftButton : 0) - | (_MouseButtons[1] ? rightButton : 0) - | (_MouseButtons[2] ? middleButton : 0) - ); -} - -//====================================================== -TMouseButton CDIMouse::buildMouseSingleButtonFlags(uint button) -{ - static const TMouseButton mb[] = { leftButton, rightButton, middleButton }; - static const TMouseButton mbswap[] = { rightButton, leftButton, middleButton }; - nlassert(button < MaxNumMouseButtons); - if (_SwapButton) - return (TMouseButton) (_DIEventEmitter->buildKeyboardButtonFlags() | mbswap[button]); - else - return (TMouseButton) (_DIEventEmitter->buildKeyboardButtonFlags() | mb[button]); -} - -//====================================================== -void CDIMouse::onButtonClicked(uint button, CEventServer *server, uint32 date) -{ - // check for double click - if (_LastMouseButtonClicked == (sint) button) - { - if (date - _MouseButtonsLastClickDate < _DoubleClickDelay) - { - CEventMouseDblClk *emdc - = new CEventMouseDblClk((float) (_XMousePos >> 32), - (float) (_YMousePos >> 32), - buildMouseSingleButtonFlags(button), - _DIEventEmitter); - server->postEvent(emdc); - _LastMouseButtonClicked = -1; - } - else - { - _MouseButtonsLastClickDate = date; - } - } - else - { - _LastMouseButtonClicked = button; - _MouseButtonsLastClickDate = date; - } -} - -//====================================================== -void CDIMouse::processButton(uint button, bool pressed, CEventServer *server, uint32 date) -{ - updateMove(server); - float mx = (float) (_XFactor * (double) _XMousePos / ((double) 65536 * (double) 65536)); - float my = (float) (_YFactor * (double) _YMousePos / ((double) 65536 * (double) 65536)); - if (pressed) - { - CEventMouseDown *emd = - new CEventMouseDown(mx, my, buildMouseSingleButtonFlags(button), - _DIEventEmitter); - server->postEvent(emd); - } - else - { - CEventMouseUp *emu = - new CEventMouseUp(mx, my, buildMouseSingleButtonFlags(button), _DIEventEmitter); - server->postEvent(emu); - onButtonClicked(button, server, date); - } - _MouseButtons[button] = pressed; -} - -//====================================================== -void CDIMouse::submit(IInputDeviceEvent *deviceEvent, CEventServer *server) -{ - if (!_Hardware || (_MessageMode == RawMode)) - { - CDIEvent *die = safe_cast(deviceEvent); - bool pressed; - switch(die->Datas.dwOfs) - { - case DIMOFS_X: - { - if (!_FirstX) - { - sint dep = (sint32) die->Datas.dwData - OldDIXPos; - - // Acceleration - if (_MouseAccel) - { - sint accelFactor = abs (dep) / (sint)_MouseAccel; - dep <<= accelFactor; - } - - _XAcc += dep; - } - else - { - _FirstX = false; - } - OldDIXPos = (sint32) die->Datas.dwData; - } - break; - case DIMOFS_Y: - { - if (!_FirstY) - { - sint dep = (sint32) die->Datas.dwData - OldDIYPos; - - // Acceleration - if (_MouseAccel) - { - sint accelFactor = abs (dep) / (sint)_MouseAccel; - dep <<= accelFactor; - } - - _YAcc -= dep; - } - else - { - _FirstY = false; - } - OldDIYPos = (sint32) die->Datas.dwData; - } - break; - case DIMOFS_Z: - { - updateMove(server); - sint dep = die->Datas.dwData - OldDIZPos; - OldDIZPos = (sint32) die->Datas.dwData; - CEventMouseWheel *emw = - new CEventMouseWheel((float) (_XMousePos >> 32), - (float) (_XMousePos >> 32), - buildMouseButtonFlags(), - dep > 0, - _DIEventEmitter); - server->postEvent(emw); - } - break; - case DIMOFS_BUTTON0: /* left button */ - pressed = (die->Datas.dwData & 0x80) != 0; - processButton(0, pressed, server, die->Datas.dwTimeStamp); - break; - case DIMOFS_BUTTON1: /* right button */ - pressed = (die->Datas.dwData & 0x80) != 0; - processButton(1, pressed, server, die->Datas.dwTimeStamp); - break; - case DIMOFS_BUTTON2: /* middle button */ - pressed = (die->Datas.dwData & 0x80) != 0; - processButton(2, pressed, server, die->Datas.dwTimeStamp); - break; - default: - return; - break; - } - } -} - -//====================================================== -void CDIMouse::updateMove(CEventServer *server) -{ - if (_XAcc != 0 || _YAcc != 0) - { - if (_MessageMode == NormalMode) - { - _XMousePos += (sint64) ((double) _MouseSpeed * (sint64) _XAcc * ((sint64) 1 << 32)); - _YMousePos += (sint64) ((double) _MouseSpeed * (sint64) _YAcc * ((sint64) 1 << 32)); - clampMouseAxis(); - CEventMouseMove *emm = new CEventMouseMove((float) (_XFactor * (double) _XMousePos / ((double) 65536 * (double) 65536)), (float) (_YFactor * (double) _YMousePos / ((double) 65536 * (double) 65536)), buildMouseButtonFlags(), _DIEventEmitter); - server->postEvent(emm); - } - else - { - CGDMouseMove *emm = new CGDMouseMove(_DIEventEmitter, this, _XAcc, _YAcc); - server->postEvent(emm); - } - _XAcc = _YAcc = 0; - } -} - - -//====================================================== -void CDIMouse::convertStdMouseMoveInMickeys(float &dx, float &dy) const -{ - // get in same scale as _XAcc and _YAcc - double xacc= ((double)dx/_XFactor) / _MouseSpeed; - double yacc= ((double)dy/_YFactor) / _MouseSpeed; - - dx= float(xacc); - dy =float(yacc); -} - - -//====================================================== -void CDIMouse::transitionOccured(CEventServer *server, const IInputDeviceEvent *) -{ - updateMove(server); -} - -//====================================================== -void CDIMouse::setButton(uint button, bool pushed) -{ - nlassert(button < MaxNumMouseButtons); - _MouseButtons[button] = pushed; -} - -//====================================================== -bool CDIMouse::getButton(uint button) const -{ - nlassert(button < MaxNumMouseButtons); - return _MouseButtons[button]; -} - -//====================================================== -void CDIMouse::setDoubleClickDelay(uint ms) -{ - nlassert(ms > 0); - _DoubleClickDelay = ms; -} - -//====================================================== -void CDIMouse::setMouseFrame(const CRect &rect) -{ - nlassert(_MessageMode == NormalMode); - _MouseFrame = rect; -} - -//====================================================== -void CDIMouse::setMessagesMode(TMessageMode mode) -{ - nlassert(mode < MessageModeLast); - _MessageMode = mode; - _FirstX = _FirstY = true; - - // Enable win32 mouse message only if hardware mouse in normal mode - if (_WE) - _WE->enableMouseEvents(_Hardware && (_MessageMode == NormalMode)); -} - - -} // NLMISC - -#endif // NL_OS_WINDOWS - - - - - - - - - - - - - - - - - - - - - - - diff --git a/code/nel/src/misc/di_mouse_device.h b/code/nel/src/misc/di_mouse_device.h deleted file mode 100644 index aab678ffc..000000000 --- a/code/nel/src/misc/di_mouse_device.h +++ /dev/null @@ -1,167 +0,0 @@ -// NeL - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// 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_DI_MOUSE_DEVICE_H -#define NL_DI_MOUSE_DEVICE_H - -#include "nel/misc/types_nl.h" - -#ifdef NL_OS_WINDOWS - - -#include "nel/misc/rect.h" -#include "nel/misc/di_event_emitter.h" -#include "nel/misc/input_device_server.h" -#include "nel/misc/mouse_device.h" -#include - - -namespace NLMISC -{ - - -// -struct EDirectInputNoMouse : public EDirectInput -{ - EDirectInputNoMouse() : EDirectInput("No mouse found") {} -}; - - -class CDXEventEmitter; - - -/** - * Direct Input implementation of a mouse - * \see CDIEventEmitter - * \author Nicolas Vizerie - * \author Nevrax France - * \date 2002 - */ -class CDIMouse : public IMouseDevice -{ -public: - enum { MaxNumMouseButtons = 3, NumMouseAxis = 3}; -public: - ///\name Object - //@{ - virtual ~CDIMouse(); - /** Create a mouse device from a valid DirectInput8 pointer. This must then be deleted by the caller. - * \return the interface or throw an exception if the creation failed - */ - static CDIMouse *createMouseDevice(IDirectInput8 *di8, HWND hwnd, CDIEventEmitter *diEventEmitter, bool hardware, class CWinEventEmitter *we) throw(EDirectInput); - //@} - - ///\name Mouse params, inherited from IMouseDevice - //@{ - void setMessagesMode(TMessageMode mode); - TMessageMode getMessagesMode() const { return _MessageMode; } - void setMouseMode(TAxis axis, TAxisMode axisMode); - TAxisMode getMouseMode(TAxis axis) const; - void setMouseSpeed(float speed); - float getMouseSpeed() const; - void setMouseAcceleration(uint speed); - uint getMouseAcceleration() const; - void setMouseFrame(const CRect &rect); - const CRect &getMouseFrame() const; - void setDoubleClickDelay(uint ms); - uint getDoubleClickDelay() const; - void setMousePos(float x, float y); - void setFactors(float xFactor, float yFactor) - { - nlassert(_MessageMode == NormalMode); - _XFactor = xFactor; - _YFactor = yFactor; - } - float getXFactor() const { nlassert(_MessageMode == NormalMode); return _XFactor; } - float getYFactor() const { nlassert(_MessageMode == NormalMode); return _YFactor; } - void convertStdMouseMoveInMickeys(float &dx, float &dy) const; - //@} - - ///\name From IInputDevice - //@{ - - virtual bool setBufferSize(uint size); - virtual uint getBufferSize() const; - //@} - - ///\name From IInputDevice - //@{ - void setButton(uint button, bool pushed); - bool getButton(uint button) const; - //@} - -////////////////////////////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////////////////////////////// - -private: - LPDIRECTINPUTDEVICE8 _Mouse; - // - bool _Hardware; - // - TMessageMode _MessageMode; - // - TAxisMode _MouseAxisMode[NumMouseAxis]; - sint64 _XMousePos, _YMousePos; // position encoded in fixed point 32 : 32. This allow wrapping and no loss of precision, when not in clamped mode - // NB: this is sint64 because of max range reached with 16:16 when looping around x with great mouse speed - bool _FirstX, _FirstY; - float _MouseSpeed; - uint _MouseAccel; - CRect _MouseFrame; - // - bool _MouseButtons[MaxNumMouseButtons]; - uint32 _MouseButtonsLastClickDate; - sint _LastMouseButtonClicked; - uint _DoubleClickDelay; - uint _MouseBufferSize; - HWND _hWnd; - // - sint32 OldDIXPos, OldDIYPos, OldDIZPos; // old positions reported by direct input - sint _XAcc, _YAcc; // accumulate move (needed because they are generated on a single axis for each DI event) - float _XFactor, _YFactor; - // - CDIEventEmitter *_DIEventEmitter; - // The windows emitter to enable / disble win32 mouse messages - NLMISC::CRefPtr _WE; - // Does the button left and right are swapped ? - bool _SwapButton; -private: - /// ctor - CDIMouse(); - /// Clamp the mouse axis that need to be. - void clampMouseAxis(); - /// Sum the mouse move and produce an event - void updateMove(CEventServer *server); - void processButton(uint button, bool pressed, CEventServer *server, uint32 date); - TMouseButton buildMouseButtonFlags() const; - TMouseButton buildMouseSingleButtonFlags(uint button); - void onButtonClicked(uint button, CEventServer *server, uint32 date); - ///\name From IInputDevice - //@{ - virtual void poll(CInputDeviceServer *dev); - virtual void submit(IInputDeviceEvent *deviceEvent, CEventServer *server); - virtual void transitionOccured(CEventServer *server, const IInputDeviceEvent *nextMessage); - //@} -}; - - -} // NL3D - - -#endif // NL_OS_WINDOWS - -#endif // NL_DI_MOUSE_H - -/* End of di_mouse.h */ diff --git a/code/nel/src/misc/displayer.cpp b/code/nel/src/misc/displayer.cpp index 1dc45e9db..e7c64ab32 100644 --- a/code/nel/src/misc/displayer.cpp +++ b/code/nel/src/misc/displayer.cpp @@ -18,6 +18,10 @@ #include "nel/misc/types_nl.h" +#ifndef NL_OS_WINDOWS +# define IsDebuggerPresent() false +#endif + #ifdef NL_OS_WINDOWS # include # include @@ -35,17 +39,6 @@ #include "nel/misc/debug.h" -#ifdef NL_OS_WINDOWS -// these defines is for IsDebuggerPresent(). it'll not compile on windows 95 -// just comment this and the IsDebuggerPresent to compile on windows 95 -# define _WIN32_WINDOWS 0x0410 -# define WINVER 0x0400 -# define NOMINMAX -# include -#else -# define IsDebuggerPresent() false -#endif - #include "nel/misc/displayer.h" using namespace std; @@ -528,7 +521,7 @@ void CFileDisplayer::doDisplay ( const CLog::TDisplayInfo& args, const char *mes // in release "" void CMsgBoxDisplayer::doDisplay ( const CLog::TDisplayInfo& args, const char *message) { -#ifdef NL_OS_WINDOWS +//#ifdef NL_OS_WINDOWS bool needSpace = false; // stringstream ss; @@ -687,39 +680,35 @@ void CMsgBoxDisplayer::doDisplay ( const CLog::TDisplayInfo& args, const char *m // yoyo: allow only to send the crash report once. Because users usually click ignore, // which create noise into list of bugs (once a player crash, it will surely continues to do it). std::string filename = getLogDirectory() + NL_CRASH_DUMP_FILE; + + TReportResult reportResult = report(args.ProcessName + " NeL " + toString(logTypeToString(args.LogType, true)), + subject, body, filename, NL_REPORT_SYNCHRONOUS, !isCrashAlreadyReported(), NL_REPORT_DEFAULT); - if (ReportDebug == report (args.ProcessName + " NeL " + toString(logTypeToString(args.LogType, true)), "", subject, body, true, 2, true, 1, !isCrashAlreadyReported(), IgnoreNextTime, filename.c_str())) + switch (reportResult) { + case ReportAlwaysIgnore: + IgnoreNextTime = true; + break; + case ReportBreak: INelContext::getInstance().setDebugNeedAssert(true); + break; + case ReportAbort: +# ifdef NL_OS_WINDOWS +# ifndef NL_COMP_MINGW + // disable the Windows popup telling that the application aborted and disable the dr watson report. + _set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT); +# endif +# endif + abort(); + break; } // no more sent mail for crash setCrashAlreadyReported(true); } + } -/* // Check the envvar NEL_IGNORE_ASSERT - if (getenv ("NEL_IGNORE_ASSERT") == NULL) - { - // Ask the user to continue, debug or ignore - int result = MessageBox (NULL, ss2.str().c_str (), logTypeToString(args.LogType, true), MB_ABORTRETRYIGNORE | MB_ICONSTOP); - if (result == IDABORT) - { - // Exit the program now - exit (EXIT_FAILURE); - } - else if (result == IDRETRY) - { - // Give the debugger a try - DebugNeedAssert = true; - } - else if (result == IDIGNORE) - { - // Continue, do nothing - } - } -*/ } - -#endif +//#endif } diff --git a/code/nel/src/misc/dynloadlib.cpp b/code/nel/src/misc/dynloadlib.cpp index 6dcb7e4cf..25f28286e 100644 --- a/code/nel/src/misc/dynloadlib.cpp +++ b/code/nel/src/misc/dynloadlib.cpp @@ -57,7 +57,7 @@ void *nlGetSymbolAddress(NL_LIB_HANDLE libHandle, const std::string &procName) { void *res = 0; #ifdef NL_OS_WINDOWS - res = GetProcAddress(libHandle, procName.c_str()); + res = (void *)GetProcAddress(libHandle, procName.c_str()); #elif defined(NL_OS_UNIX) res = dlsym(libHandle, procName.c_str()); #else diff --git a/code/nel/src/misc/event_emitter_multi.cpp b/code/nel/src/misc/event_emitter_multi.cpp index 52bc235cd..45559ebc4 100644 --- a/code/nel/src/misc/event_emitter_multi.cpp +++ b/code/nel/src/misc/event_emitter_multi.cpp @@ -84,11 +84,6 @@ void CEventEmitterMulti::submitEvents(CEventServer &server, bool allWindows) } } -///============================================================ -void CEventEmitterMulti::emulateMouseRawMode(bool enable) -{ -} - ///============================================================ IEventEmitter *CEventEmitterMulti::getEmitter(uint index) { diff --git a/code/nel/src/misc/fixed_size_allocator.cpp b/code/nel/src/misc/fixed_size_allocator.cpp index 790275ec6..30693ddfd 100644 --- a/code/nel/src/misc/fixed_size_allocator.cpp +++ b/code/nel/src/misc/fixed_size_allocator.cpp @@ -33,6 +33,9 @@ CFixedSizeAllocator::CFixedSizeAllocator(uint numBytesPerBlock, uint numBlockPer _NumChunks = 0; nlassert(numBytesPerBlock > 1); _NumBytesPerBlock = numBytesPerBlock; + const uint mask = NL_DEFAULT_MEMORY_ALIGNMENT - 1; + _NumBytesPerBlock = (_NumBytesPerBlock + mask) & ~mask; + nlassert(_NumBytesPerBlock >= numBytesPerBlock); _NumBlockPerChunk = std::max(numBlockPerChunk, (uint) 3); _NumAlloc = 0; } @@ -67,12 +70,14 @@ void *CFixedSizeAllocator::alloc() return _FreeSpace->unlink(); } +#define aligned_offsetof(s, m) ((offsetof(s, m) + (NL_DEFAULT_MEMORY_ALIGNMENT - 1)) & ~(NL_DEFAULT_MEMORY_ALIGNMENT - 1)) + // ***************************************************************************************************************** void CFixedSizeAllocator::free(void *block) { if (!block) return; /// get the node from the object - CNode *node = (CNode *) ((uint8 *) block - offsetof(CNode, Next)); + CNode *node = (CNode *) ((uint8 *) block - aligned_offsetof(CNode, Next)); // nlassert(node->Chunk != NULL); nlassert(node->Chunk->Allocator == this); @@ -84,7 +89,9 @@ void CFixedSizeAllocator::free(void *block) // ***************************************************************************************************************** uint CFixedSizeAllocator::CChunk::getBlockSizeWithOverhead() const { - return std::max((uint)(sizeof(CNode) - offsetof(CNode, Next)),(uint)(Allocator->getNumBytesPerBlock())) + offsetof(CNode, Next); + nlctassert((sizeof(CNode) % NL_DEFAULT_MEMORY_ALIGNMENT) == 0); + return std::max((uint)(sizeof(CNode) - aligned_offsetof(CNode, Next)), + (uint)(Allocator->getNumBytesPerBlock())) + aligned_offsetof(CNode, Next); } // ***************************************************************************************************************** @@ -105,7 +112,7 @@ CFixedSizeAllocator::CChunk::~CChunk() nlassert(NumFreeObjs == 0); nlassert(Allocator->_NumChunks > 0); -- (Allocator->_NumChunks); - delete[] Mem; + aligned_free(Mem); //delete[] Mem; } // ***************************************************************************************************************** @@ -115,7 +122,7 @@ void CFixedSizeAllocator::CChunk::init(CFixedSizeAllocator *alloc) nlassert(alloc != NULL); Allocator = alloc; // - Mem = new uint8[getBlockSizeWithOverhead() * alloc->getNumBlockPerChunk()]; + Mem = (uint8 *)aligned_malloc(getBlockSizeWithOverhead() * alloc->getNumBlockPerChunk(), NL_DEFAULT_MEMORY_ALIGNMENT); // new uint8[getBlockSizeWithOverhead() * alloc->getNumBlockPerChunk()]; // getNode(0).Chunk = this; getNode(0).Next = &getNode(1); @@ -179,7 +186,7 @@ void *CFixedSizeAllocator::CNode::unlink() *Prev = Next; nlassert(Chunk->NumFreeObjs > 0); Chunk->grab(); // tells the containing chunk that a node has been allocated - return (void *) &Next; + return (void *)((uintptr_t)(this) + aligned_offsetof(CNode, Next)); //(void *) &Next; } // ***************************************************************************************************************** diff --git a/code/nel/src/misc/gtk_displayer.cpp b/code/nel/src/misc/gtk_displayer.cpp index c2e04e67e..0c581b2e5 100644 --- a/code/nel/src/misc/gtk_displayer.cpp +++ b/code/nel/src/misc/gtk_displayer.cpp @@ -32,6 +32,7 @@ #pragma comment(lib, "gthread-1.3.lib") #endif +#include "nel/misc/app_context.h" #include "nel/misc/path.h" #include "nel/misc/command.h" #include "nel/misc/thread.h" @@ -59,6 +60,14 @@ static GtkWidget *hrootbox = NULL, *scrolled_win2 = NULL; // Functions // +CGtkDisplayer (const char *displayerName) : CWindowDisplayer(displayerName) +{ + needSlashR = false; + createLabel ("@Clear|CLEAR"); + + INelContext::getInstance().setWindowedApplication(true); +} + CGtkDisplayer::~CGtkDisplayer () { if (_Init) diff --git a/code/nel/src/misc/i_xml.cpp b/code/nel/src/misc/i_xml.cpp index d8925ddef..ee3f39a89 100644 --- a/code/nel/src/misc/i_xml.cpp +++ b/code/nel/src/misc/i_xml.cpp @@ -24,6 +24,11 @@ // Include from libxml2 #include +#if defined(NL_OS_WINDOWS) && defined(NL_COMP_VC_VERSION) && NL_COMP_VC_VERSION >= 80 +#define USE_LOCALE_ATOF +#include +#endif + using namespace std; #define NLMISC_READ_BUFFER_SIZE 1024 @@ -46,6 +51,22 @@ const char SEPARATOR = ' '; serialSeparatedBufferIn( number_as_string ); \ dest = (thetype)convfunc( number_as_string.c_str() ); +#ifdef USE_LOCALE_ATOF + +#define readnumberlocale(dest,thetype,digits,convfunc) \ + string number_as_string; \ + serialSeparatedBufferIn( number_as_string ); \ + dest = (thetype)convfunc( number_as_string.c_str(), (_locale_t)_Locale ); + +#define nl_atof _atof_l + +#else + +#define readnumberlocale(dest,thetype,digits,convfunc) readnumber(dest,thetype,digits,convfunc) +#define nl_atof atof + +#endif + // *************************************************************************** inline void CIXml::flushContentString () @@ -70,6 +91,13 @@ CIXml::CIXml () : IStream (true /* Input mode */) _ErrorString = ""; _TryBinaryMode = false; _BinaryStream = NULL; + +#ifdef USE_LOCALE_ATOF + // create C numeric locale + _Locale = _create_locale(LC_NUMERIC, "C"); +#else + _Locale = NULL; +#endif } // *************************************************************************** @@ -85,6 +113,13 @@ CIXml::CIXml (bool tryBinaryMode) : IStream (true /* Input mode */) _ErrorString = ""; _TryBinaryMode = tryBinaryMode; _BinaryStream = NULL; + +#ifdef USE_LOCALE_ATOF + // create C numeric locale + _Locale = _create_locale(LC_NUMERIC, "C"); +#else + _Locale = NULL; +#endif } // *************************************************************************** @@ -93,6 +128,10 @@ CIXml::~CIXml () { // Release release (); + +#ifdef USE_LOCALE_ATOF + if (_Locale) _free_locale((_locale_t)_Locale); +#endif } // *************************************************************************** @@ -546,7 +585,7 @@ void CIXml::serial(float &b) } else { - readnumber( b, float, 128, atof ); + readnumberlocale( b, float, 128, nl_atof ); } } @@ -560,7 +599,7 @@ void CIXml::serial(double &b) } else { - readnumber( b, double, 128, atof ); + readnumberlocale( b, double, 128, nl_atof ); } } diff --git a/code/nel/src/misc/input_device_server.cpp b/code/nel/src/misc/input_device_server.cpp deleted file mode 100644 index 253b68e71..000000000 --- a/code/nel/src/misc/input_device_server.cpp +++ /dev/null @@ -1,109 +0,0 @@ -// NeL - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// 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 "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 -{ -//======================================================================= -void CInputDeviceServer::registerDevice(IInputDevice *device) -{ - nlassert(!isDevice(device)); - _Devices.push_back(device); -} - -//======================================================================= -void CInputDeviceServer::removeDevice(IInputDevice *device) -{ - TDeviceCont::iterator it = std::find(_Devices.begin(), _Devices.end(), device); - nlassert(it != _Devices.end()); - _Devices.erase(it); -} - -//======================================================================= -bool CInputDeviceServer::isDevice(IInputDevice *device) const -{ - TDeviceCont::const_iterator it = std::find(_Devices.begin(), _Devices.end(), device); - return it != _Devices.end(); -} - -//======================================================================= -// Predicate to compare vents dates -struct CInputDeviceEventLess -{ - bool operator()(const IInputDeviceEvent *lhs, const IInputDeviceEvent *rhs) const - { - return *lhs < *rhs; - } -}; - -//======================================================================= -void CInputDeviceServer::poll(CEventServer *server) -{ - nlassert(_Events.empty()); - TDeviceCont::iterator deviceIt; - for (deviceIt = _Devices.begin(); deviceIt != _Devices.end(); ++deviceIt) - { - (*deviceIt)->begin(server); - (*deviceIt)->poll(this); - } - // Sort the messages to get the right dates. - std::sort(_Events.begin(), _Events.end(), CInputDeviceEventLess()); - // submit the result to the server - IInputDevice *lastVisitedDevice = NULL; - TEventCont::iterator eventIt; - for (eventIt = _Events.begin(); eventIt != _Events.end(); ++eventIt) - { - // see if this message is from a previous device then the last we visited. - if (lastVisitedDevice && (*eventIt)->Emitter != lastVisitedDevice) - { - // yes, tells that a transition occured - lastVisitedDevice->transitionOccured(server, *eventIt); - lastVisitedDevice = (*eventIt)->Emitter; - } - nlassert((*eventIt)->Emitter != NULL); - (*eventIt)->Emitter->submit(*eventIt, server); - } - // - for (deviceIt = _Devices.begin(); deviceIt != _Devices.end(); ++deviceIt) - { - (*deviceIt)->transitionOccured(server, NULL); - } - // delete the messages - for (eventIt = _Events.begin(); eventIt != _Events.end(); ++eventIt) - { - delete *eventIt; - } - // - _Events.clear(); -} - -//======================================================================= -void CInputDeviceServer::submitEvent(IInputDeviceEvent *deviceEvent) -{ - _Events.push_back(deviceEvent); -} - - -} // NLMISC diff --git a/code/nel/src/misc/log.cpp b/code/nel/src/misc/log.cpp index 85ec59e04..f0e3e36f8 100644 --- a/code/nel/src/misc/log.cpp +++ b/code/nel/src/misc/log.cpp @@ -19,9 +19,7 @@ #include "nel/misc/log.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX # include -# include #else # include #endif diff --git a/code/nel/src/misc/matrix.cpp b/code/nel/src/misc/matrix.cpp index dd884f4d5..e907fb2e0 100644 --- a/code/nel/src/misc/matrix.cpp +++ b/code/nel/src/misc/matrix.cpp @@ -140,6 +140,7 @@ inline void CMatrix::testExpandRot() const self->Scale33= 1; } } + inline void CMatrix::testExpandProj() const { if(hasProj()) diff --git a/code/nel/src/misc/mem_displayer.cpp b/code/nel/src/misc/mem_displayer.cpp index 52d399350..0aaac26cc 100644 --- a/code/nel/src/misc/mem_displayer.cpp +++ b/code/nel/src/misc/mem_displayer.cpp @@ -24,8 +24,6 @@ #include "nel/misc/debug.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX -# include # include # pragma comment(lib, "imagehlp.lib") # ifdef NL_OS_WIN64 @@ -101,7 +99,7 @@ static string getFuncInfo (DWORD_TYPE funcAddr, DWORD_TYPE stackAddr) if (stop==0 && (parse[i] == ',' || parse[i] == ')')) { char tmp[32]; - sprintf (tmp, "=0x%p", *((ULONG*)(stackAddr) + 2 + pos++)); + sprintf(tmp, "=0x%p", *((DWORD_TYPE*)(stackAddr) + 2 + pos++)); str += tmp; } str += parse[i]; @@ -148,7 +146,11 @@ static string getSourceInfo (DWORD_TYPE addr) return str; } -static DWORD_TYPE __stdcall GetModuleBase(HANDLE hProcess, DWORD_TYPE dwReturnAddress) +#ifdef NL_OS_WIN64 +static DWORD64 __stdcall GetModuleBase(HANDLE hProcess, DWORD64 dwReturnAddress) +#else +static DWORD __stdcall GetModuleBase(HANDLE hProcess, DWORD dwReturnAddress) +#endif { IMAGEHLP_MODULE moduleInfo; @@ -169,9 +171,15 @@ static DWORD_TYPE __stdcall GetModuleBase(HANDLE hProcess, DWORD_TYPE dwReturnAd if (cch && (lstrcmp(szFile, "DBFN")== 0)) { - if (!SymLoadModule(hProcess, - NULL, "MN", - NULL, (DWORD) memoryBasicInfo.AllocationBase, 0)) + char mn[] = { 'M', 'N', 0x00 }; +#ifdef NL_OS_WIN64 + if (!SymLoadModule64( +#else + if (!SymLoadModule( +#endif + hProcess, + NULL, mn, + NULL, (uintptr_t)memoryBasicInfo.AllocationBase, 0)) { // DWORD dwError = GetLastError(); // nlinfo("Error: %d", dwError); @@ -179,17 +187,23 @@ static DWORD_TYPE __stdcall GetModuleBase(HANDLE hProcess, DWORD_TYPE dwReturnAd } else { - if (!SymLoadModule(hProcess, - NULL, ((cch) ? szFile : NULL), - NULL, (DWORD) memoryBasicInfo.AllocationBase, 0)) +#ifdef NL_OS_WIN64 + if (!SymLoadModule64( +#else + if (!SymLoadModule( +#endif + hProcess, + NULL, ((cch) ? szFile : NULL), + NULL, (uintptr_t)memoryBasicInfo.AllocationBase, 0)) { // DWORD dwError = GetLastError(); // nlinfo("Error: %d", dwError); } + } - return (DWORD) memoryBasicInfo.AllocationBase; + return (uintptr_t)memoryBasicInfo.AllocationBase; } // else // nlinfo("Error is %d", GetLastError()); @@ -250,19 +264,13 @@ static void displayCallStack (CLog *log) return; } -#ifdef NL_OS_WIN64 - WOW64_CONTEXT context; -#else + // FIXME: Implement this for MinGW +#ifndef NL_COMP_MINGW CONTEXT context; -#endif ::ZeroMemory (&context, sizeof(context)); context.ContextFlags = CONTEXT_FULL; -#ifdef NL_OS_WIN64 - if (Wow64GetThreadContext (GetCurrentThread(), &context) == FALSE) -#else if (GetThreadContext (GetCurrentThread(), &context) == FALSE) -#endif { nlwarning ("DISP: GetThreadContext(%p) failed", GetCurrentThread()); return; @@ -270,12 +278,20 @@ static void displayCallStack (CLog *log) STACKFRAME callStack; ::ZeroMemory (&callStack, sizeof(callStack)); - callStack.AddrPC.Mode = AddrModeFlat; + +#ifdef NL_OS_WIN64 + callStack.AddrPC.Offset = context.Rip; + callStack.AddrStack.Offset = context.Rsp; + callStack.AddrFrame.Offset = context.Rbp; +#else callStack.AddrPC.Offset = context.Eip; - callStack.AddrStack.Mode = AddrModeFlat; callStack.AddrStack.Offset = context.Esp; - callStack.AddrFrame.Mode = AddrModeFlat; callStack.AddrFrame.Offset = context.Ebp; +#endif + + callStack.AddrPC.Mode = AddrModeFlat; + callStack.AddrStack.Mode = AddrModeFlat; + callStack.AddrFrame.Mode = AddrModeFlat; for (uint32 i = 0; ; i++) { @@ -283,12 +299,13 @@ static void displayCallStack (CLog *log) #ifdef NL_OS_WIN64 MachineType = IMAGE_FILE_MACHINE_AMD64; + BOOL res = StackWalk64(MachineType, GetCurrentProcess(), GetCurrentThread(), &callStack, + NULL, NULL, SymFunctionTableAccess, GetModuleBase, NULL); #else MachineType = IMAGE_FILE_MACHINE_I386; -#endif - - BOOL res = StackWalk (MachineType, GetCurrentProcess(), GetCurrentThread(), &callStack, + BOOL res = StackWalk(MachineType, GetCurrentProcess(), GetCurrentThread(), &callStack, NULL, NULL, SymFunctionTableAccess, GetModuleBase, NULL); +#endif /* if (res == FALSE) { @@ -309,6 +326,7 @@ static void displayCallStack (CLog *log) log->displayNL (" %s : %s", srcInfo.c_str(), symInfo.c_str()); } +#endif } #else // NL_OS_WINDOWS diff --git a/code/nel/src/misc/mutex.cpp b/code/nel/src/misc/mutex.cpp index f8a75d2ea..8135d954f 100644 --- a/code/nel/src/misc/mutex.cpp +++ b/code/nel/src/misc/mutex.cpp @@ -41,13 +41,6 @@ using namespace std; #ifdef NL_OS_WINDOWS -// these defines are for IsDebuggerPresent(). It'll not compile on windows 95 -// just comment this and the IsDebuggerPresent to compile on windows 95 -#define _WIN32_WINDOWS 0x0410 -#define WINVER 0x0400 -#define NOMINMAX -#include - #ifdef DEBUG_NEW #define new DEBUG_NEW #endif @@ -404,13 +397,21 @@ void CUnfairMutex::leave() */ CFairMutex::CFairMutex() { +#ifdef NL_OS_MAC + _Sem = dispatch_semaphore_create(1); +#else sem_init( const_cast(&_Sem), 0, 1 ); +#endif } CFairMutex::CFairMutex( const std::string &name ) { +#ifdef NL_OS_MAC + _Sem = dispatch_semaphore_create(1); +#else sem_init( const_cast(&_Sem), 0, 1 ); +#endif } @@ -419,7 +420,11 @@ CFairMutex::CFairMutex( const std::string &name ) */ CFairMutex::~CFairMutex() { +#ifdef NL_OS_MAC + dispatch_release(_Sem); +#else sem_destroy( const_cast(&_Sem) ); // needs that no thread is waiting on the semaphore +#endif } @@ -428,7 +433,11 @@ CFairMutex::~CFairMutex() */ void CFairMutex::enter() { +#ifdef NL_OS_MAC + dispatch_semaphore_wait(_Sem, DISPATCH_TIME_FOREVER); +#else sem_wait( const_cast(&_Sem) ); +#endif } @@ -437,7 +446,11 @@ void CFairMutex::enter() */ void CFairMutex::leave() { +#ifdef NL_OS_MAC + dispatch_semaphore_signal(_Sem); +#else sem_post( const_cast(&_Sem) ); +#endif } diff --git a/code/nel/src/misc/o_xml.cpp b/code/nel/src/misc/o_xml.cpp index 005ef8000..0fbe3dade 100644 --- a/code/nel/src/misc/o_xml.cpp +++ b/code/nel/src/misc/o_xml.cpp @@ -23,6 +23,11 @@ // Include from libxml2 #include +#if defined(NL_OS_WINDOWS) && defined(NL_COMP_VC_VERSION) && NL_COMP_VC_VERSION >= 80 +#define USE_LOCALE_SPRINTF +#include +#endif + using namespace std; #ifdef DEBUG_NEW @@ -38,11 +43,22 @@ const char SEPARATOR = ' '; // *************************************************************************** +#ifdef USE_LOCALE_SPRINTF + +#define writenumber(src,format,digits) \ + char number_as_cstring [digits+1]; \ + _sprintf_l( number_as_cstring, format, (_locale_t)_Locale, src ); \ + serialSeparatedBufferOut( number_as_cstring ); + +#else + #define writenumber(src,format,digits) \ char number_as_cstring [digits+1]; \ sprintf( number_as_cstring, format, src ); \ serialSeparatedBufferOut( number_as_cstring ); +#endif + // *************************************************************************** // XML callbacks // *************************************************************************** @@ -133,6 +149,13 @@ COXml::COXml () : IStream (false /* Output mode */) // Push begin _PushBegin = false; + +#ifdef USE_LOCALE_SPRINTF + // create C numeric locale + _Locale = _create_locale(LC_NUMERIC, "C"); +#else + _Locale = NULL; +#endif } // *************************************************************************** @@ -192,6 +215,10 @@ COXml::~COXml () { // Flush document to the internal stream flush (); + +#ifdef USE_LOCALE_SPRINTF + if (_Locale) _free_locale((_locale_t)_Locale); +#endif } // *************************************************************************** diff --git a/code/nel/src/misc/object_arena_allocator.cpp b/code/nel/src/misc/object_arena_allocator.cpp index 9c73f5059..5fba66005 100644 --- a/code/nel/src/misc/object_arena_allocator.cpp +++ b/code/nel/src/misc/object_arena_allocator.cpp @@ -68,21 +68,23 @@ void *CObjectArenaAllocator::alloc(uint size) if (size >= _MaxAllocSize) { // use standard allocator - uint8 *block = new uint8[size + sizeof(uint)]; // an additionnal uint is needed to store size of block + nlctassert(NL_DEFAULT_MEMORY_ALIGNMENT >= sizeof(uint)); + uint8 *block = (uint8 *)aligned_malloc(NL_DEFAULT_MEMORY_ALIGNMENT + size, NL_DEFAULT_MEMORY_ALIGNMENT); //new uint8[size + sizeof(uint)]; // an additionnal uint is needed to store size of block if (!block) return NULL; #ifdef NL_DEBUG _MemBlockToAllocID[block] = _AllocID; #endif *(uint *) block = size; - return block + sizeof(uint); + return block + NL_DEFAULT_MEMORY_ALIGNMENT; } uint entry = ((size + (_Granularity - 1)) / _Granularity) ; nlassert(entry < _ObjectSizeToAllocator.size()); if (!_ObjectSizeToAllocator[entry]) { - _ObjectSizeToAllocator[entry] = new CFixedSizeAllocator(entry * _Granularity + sizeof(uint), _MaxAllocSize / size); // an additionnal uint is needed to store size of block + _ObjectSizeToAllocator[entry] = new CFixedSizeAllocator(entry * _Granularity + NL_DEFAULT_MEMORY_ALIGNMENT, _MaxAllocSize / size); // an additionnal uint is needed to store size of block } void *block = _ObjectSizeToAllocator[entry]->alloc(); + nlassert(((uintptr_t)block % NL_DEFAULT_MEMORY_ALIGNMENT) == 0); #ifdef NL_DEBUG if (block) { @@ -91,14 +93,14 @@ void *CObjectArenaAllocator::alloc(uint size) ++_AllocID; #endif *(uint *) block = size; - return (void *) ((uint8 *) block + sizeof(uint)); + return (void *) ((uint8 *) block + NL_DEFAULT_MEMORY_ALIGNMENT); } // ***************************************************************************************************************** void CObjectArenaAllocator::free(void *block) { if (!block) return; - uint8 *realBlock = (uint8 *) block - sizeof(uint); // a uint is used at start of block to give its size + uint8 *realBlock = (uint8 *) block - NL_DEFAULT_MEMORY_ALIGNMENT; // sizeof(uint); // a uint is used at start of block to give its size uint size = *(uint *) realBlock; if (size >= _MaxAllocSize) { @@ -107,7 +109,7 @@ void CObjectArenaAllocator::free(void *block) nlassert(it != _MemBlockToAllocID.end()); _MemBlockToAllocID.erase(it); #endif - delete realBlock; + aligned_free(realBlock); return; } uint entry = ((size + (_Granularity - 1)) / _Granularity); diff --git a/code/nel/src/misc/p_thread.cpp b/code/nel/src/misc/p_thread.cpp index a24029b3c..e71f56611 100644 --- a/code/nel/src/misc/p_thread.cpp +++ b/code/nel/src/misc/p_thread.cpp @@ -17,8 +17,8 @@ #include "stdmisc.h" -#include -#include +#include "nel/misc/types_nl.h" +#include "nel/misc/debug.h" #ifdef NL_OS_UNIX diff --git a/code/nel/src/misc/path.cpp b/code/nel/src/misc/path.cpp index f92b0bda7..248116f20 100644 --- a/code/nel/src/misc/path.cpp +++ b/code/nel/src/misc/path.cpp @@ -25,8 +25,6 @@ #include "nel/misc/xml_pack.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX -# include # include # include # include @@ -219,6 +217,67 @@ void CFileContainer::getFileListByName(const std::string &extension, const std:: } } +void CPath::getFileListByPath(const std::string &extension, const std::string &path, std::vector &filenames) +{ + getInstance()->_FileContainer.getFileListByPath(extension, path, filenames); +} + +void CFileContainer::getFileListByPath(const std::string &extension, const std::string &path, std::vector &filenames) +{ + if (!_MemoryCompressed) + { + TFiles::iterator first(_Files.begin()), last(_Files.end()); + + if( !path.empty() ) + { + for (; first != last; ++ first) + { + string ext = SSMext.get(first->second.idExt); + string p = SSMpath.get(first->second.idPath); + if (p.find(path) != string::npos && (ext == extension || extension.empty())) + { + filenames.push_back(first->first); + } + } + } + // if extension is empty we keep all files + else + { + for (; first != last; ++ first) + { + filenames.push_back(first->first); + } + } + } + else + { + // compressed memory version + std::vector::iterator first(_MCFiles.begin()), last(_MCFiles.end()); + + if( !path.empty() ) + { + for (; first != last; ++ first) + { + string ext = SSMext.get(first->idExt); + string p = SSMpath.get(first->idPath); + + if (strstr(p.c_str(), path.c_str()) != NULL && (ext == extension || extension.empty())) + { + filenames.push_back(first->Name); + } + } + } + // if extension is empty we keep all files + else + { + for (; first != last; ++ first) + { + filenames.push_back(first->Name); + } + } + } +} + void CPath::clearMap () { getInstance()->_FileContainer.clearMap(); @@ -795,6 +854,8 @@ string getname (dirent *de) void CPath::getPathContent (const string &path, bool recurse, bool wantDir, bool wantFile, vector &result, class IProgressCallback *progressCallBack, bool showEverything) { getInstance()->_FileContainer.getPathContent(path, recurse, wantDir, wantFile, result, progressCallBack, showEverything); + + sort(result.begin(), result.end()); } void CFileContainer::getPathContent (const string &path, bool recurse, bool wantDir, bool wantFile, vector &result, class IProgressCallback *progressCallBack, bool showEverything) @@ -837,10 +898,10 @@ void CFileContainer::getPathContent (const string &path, bool recurse, bool want if (isdirectory(de)) { - // skip CVS and .svn directory - if ((!showEverything) && (fn == "CVS" || fn == ".svn")) + // skip CVS, .svn and .hg directory + if ((!showEverything) && (fn == "CVS" || fn == ".svn" || fn == ".hg")) { - NL_DISPLAY_PATH("PATH: CPath::getPathContent(%s, %d, %d, %d): skip CVS and .svn directory", path.c_str(), recurse, wantDir, wantFile); + NL_DISPLAY_PATH("PATH: CPath::getPathContent(%s, %d, %d, %d): skip CVS, .svn and .hg directory", path.c_str(), recurse, wantDir, wantFile); continue; } @@ -876,10 +937,10 @@ void CFileContainer::getPathContent (const string &path, bool recurse, bool want closedir (dir); #ifndef NL_OS_WINDOWS - BasePathgetPathContent = ""; + BasePathgetPathContent.clear(); #endif - // let s recurse + // let's recurse for (uint i = 0; i < recursPath.size (); i++) { // Progress bar @@ -897,8 +958,6 @@ void CFileContainer::getPathContent (const string &path, bool recurse, bool want progressCallBack->popCropedValues (); } } - - sort(result.begin(), result.end()); } void CPath::removeAllAlternativeSearchPath () @@ -974,6 +1033,9 @@ void CFileContainer::addSearchPath (const string &path, bool recurse, bool alter { // find all path and subpath getPathContent (newPath, recurse, true, false, pathsToProcess, progressCallBack); + + // sort files + sort(pathsToProcess.begin(), pathsToProcess.end()); } for (uint p = 0; p < pathsToProcess.size(); p++) @@ -1019,7 +1081,10 @@ void CFileContainer::addSearchPath (const string &path, bool recurse, bool alter // find all files in the path and subpaths getPathContent (newPath, recurse, false, true, filesToProcess, progressCallBack); - // Progree bar + // sort files + sort(filesToProcess.begin(), filesToProcess.end()); + + // Progress bar if (progressCallBack) { progressCallBack->popCropedValues (); @@ -2481,6 +2546,57 @@ bool CPath::makePathRelative (const char *basePath, std::string &relativePath) return false; } +std::string CPath::makePathAbsolute( const std::string &relativePath, const std::string &directory ) +{ + if( relativePath.empty() ) + return ""; + if( directory.empty() ) + return ""; + +#ifdef NL_OS_WINDOWS + // Windows network address. Eg.: \\someshare\path + if( ( relativePath[ 0 ] == '\\' ) && ( relativePath[ 1 ] == '\\' ) ) + return relativePath; + + // Normal Windows absolute path. Eg.: C:\something + // + if( isalpha( relativePath[ 0 ] ) && ( relativePath[ 1 ] == ':' ) && ( ( relativePath[ 2 ] == '\\' ) || ( relativePath[ 2 ] == '/' ) ) ) + return relativePath; +#else + // Unix filesystem absolute path + if( relativePath[ 0 ] == '/' ) + return relativePath; + +#endif + + // Add a slash to the directory if necessary. + // If the relative path starts with dots we need a slash. + // If the relative path starts with a slash we don't. + // If it starts with neither, we need a slash. + bool needSlash = true; + char c = relativePath[ 0 ]; + if( ( c == '\\' ) || ( c == '/' ) ) + needSlash = false; + + bool hasSlash = false; + std::string npath = directory; + c = npath[ npath.size() - 1 ]; + if( ( c == '\\' ) || ( c == '/' ) ) + hasSlash = true; + + if( needSlash && !hasSlash ) + npath += '/'; + else + if( hasSlash && !needSlash ) + npath.resize( npath.size() - 1 ); + + // Now build the new absolute path + npath += relativePath; + npath = standardizePath( npath, false ); + + return npath; +} + bool CFile::setRWAccess(const std::string &filename) { #ifdef NL_OS_WINDOWS diff --git a/code/nel/src/misc/report.cpp b/code/nel/src/misc/report.cpp index 64871e6a3..ef3280ef5 100644 --- a/code/nel/src/misc/report.cpp +++ b/code/nel/src/misc/report.cpp @@ -16,342 +16,209 @@ #include "stdmisc.h" +#include +#include + #include "nel/misc/common.h" #include "nel/misc/ucstring.h" #include "nel/misc/report.h" #include "nel/misc/path.h" - -#ifdef NL_OS_WINDOWS -# define NOMINMAX -# include -# include -# include -#endif // NL_OS_WINDOWS - -#define NL_NO_DEBUG_FILES 1 - -using namespace std; +#include "nel/misc/file.h" +#include "nel/misc/system_utils.h" #ifdef DEBUG_NEW #define new DEBUG_NEW #endif +#define NL_REPORT_POST_URL_ENVVAR "NL_REPORT_POST_URL" +#ifdef NL_OS_WINDOWS +#define NL_CRASH_REPORT_TOOL "crash_report.exe" +#else +#define NL_CRASH_REPORT_TOOL "crash_report" +#endif +#define NL_DEBUG_REPORT 0 +// Set to 1 if you want command line report tool +#define NL_REPORT_CONSOLE 0 +// Set to 1 if you want command line report tool even when the debugger is present +#define NL_REPORT_CONSOLE_DEBUGGER 1 + namespace NLMISC { +void setReportPostUrl(const char *postUrl) +{ +#if NL_DEBUG_REPORT + if (INelContext::isContextInitialised()) + nldebug("Set report post url to '%s'", postUrl); +#endif #ifdef NL_OS_WINDOWS -static HWND sendReport=NULL; + SetEnvironmentVariableA(NL_REPORT_POST_URL_ENVVAR, postUrl); +#else + setenv(NL_REPORT_POST_URL_ENVVAR, postUrl, 1); #endif +} -//old doesn't work on visual c++ 7.1 due to default parameter typedef bool (*TEmailFunction) (const std::string &smtpServer, const std::string &from, const std::string &to, const std::string &subject, const std::string &body, const std::string &attachedFile = "", bool onlyCheck = false); -typedef bool (*TEmailFunction) (const std::string &smtpServer, const std::string &from, const std::string &to, const std::string &subject, const std::string &body, const std::string &attachedFile, bool onlyCheck); - -#define DELETE_OBJECT(a) if((a)!=NULL) { DeleteObject (a); a = NULL; } - -static TEmailFunction EmailFunction = NULL; - -void setReportEmailFunction (void *emailFunction) +inline const char *getReportPostURL() { - EmailFunction = (TEmailFunction)emailFunction; - #ifdef NL_OS_WINDOWS - if (sendReport) - EnableWindow(sendReport, FALSE); + static char buf[512]; + buf[0] = '\0'; + int res = GetEnvironmentVariableA(NL_REPORT_POST_URL_ENVVAR, buf, sizeof(buf)); + if (res <= 0 || res > 511) return NULL; + if (buf[0] == '\0') return NULL; + return buf; +#else + char *res = getenv(NL_REPORT_POST_URL_ENVVAR); + if (res == NULL || res[0] == '\0') return NULL; + return res; #endif } -#ifndef NL_OS_WINDOWS +TReportResult report(const std::string &title, const std::string &subject, const std::string &body, const std::string &attachment, bool synchronous, bool sendReport, TReportResult defaultResult) +{ + std::string reportPath; + if (!body.empty()) + { + std::stringstream reportFile; + reportFile << getLogDirectory(); + reportFile << "nel_report_"; + reportFile << (int)time(NULL); + reportFile << ".log"; + reportPath = CFile::findNewFile(reportFile.str()); + std::ofstream f; + f.open(reportPath.c_str()); + if (!f.good()) + { +#if NL_DEBUG_REPORT + if (INelContext::isContextInitialised()) + nldebug("Failed to write report log to '%s'", reportPath.c_str()); +#endif + reportPath.clear(); + } + else + { + f << body; + f.close(); + } + } -// GNU/Linux, do nothing + if (((INelContext::isContextInitialised() + && INelContext::getInstance().isWindowedApplication()) + || CSystemUtils::detectWindowedApplication()) + && CFile::isExists(NL_CRASH_REPORT_TOOL)) + { + std::stringstream params; + params << NL_CRASH_REPORT_TOOL; -void report () -{ -} + if (!reportPath.empty()) + params << " -log \"" << reportPath << "\""; -#else + if (!subject.empty()) + params << " -attachment \"" << attachment << "\""; -// Windows specific version + if (!title.empty()) + params << " -title \"" << title << "\""; -static string Body; -static string Subject; -static string AttachedFile; + if (!subject.empty()) + params << " -subject \"" << subject << "\""; -static HWND checkIgnore=NULL; -static HWND debug=NULL; -static HWND ignore=NULL; -static HWND quit=NULL; -static HWND dialog=NULL; + const char *reportPostUrl = getReportPostURL(); + if (reportPostUrl) + params << " -host \"" << reportPostUrl << "\""; -static bool NeedExit; -static TReportResult Result; -static bool IgnoreNextTime; -static bool CanSendMailReport= false; + if (synchronous) + params << " -dev"; -static bool DebugDefaultBehavior, QuitDefaultBehavior; + if (sendReport) + params << " -sendreport"; -static void sendEmail() -{ - if (CanSendMailReport && SendMessage(sendReport, BM_GETCHECK, 0, 0) != BST_CHECKED) - { - bool res = EmailFunction ("", "", "", Subject, Body, AttachedFile, false); - if (res) + std::string paramsStr = params.str(); + + if (synchronous) { - // EnableWindow(sendReport, FALSE); - // MessageBox (dialog, "The email was successfully sent", "email", MB_OK); -#ifndef NL_NO_DEBUG_FILES - CFile::createEmptyFile(getLogDirectory() + "report_sent"); + TReportResult result = (TReportResult)::system(paramsStr.c_str()); + if (result != ReportAlwaysIgnore + && result != ReportIgnore + && result != ReportAbort + && result != ReportBreak) + { +#if NL_DEBUG_REPORT + if (INelContext::isContextInitialised()) + nldebug("Return default result, invalid return code %i", (int)result); #endif + return defaultResult; + } + return result; } else { -#ifndef NL_NO_DEBUG_FILES - CFile::createEmptyFile(getLogDirectory() + "report_failed"); -#endif - // MessageBox (dialog, "Failed to send the email", "email", MB_OK | MB_ICONERROR); + NLMISC::launchProgram(NL_CRASH_REPORT_TOOL, paramsStr, + NL_DEBUG_REPORT ? INelContext::isContextInitialised() : false); // Only log if required, avoid infinite loop + return defaultResult; } } else { -#ifndef NL_NO_DEBUG_FILES - CFile::createEmptyFile(getLogDirectory() + "report_refused"); +#if NL_DEBUG_REPORT + if (INelContext::isContextInitialised() && !CFile::isExists(NL_CRASH_REPORT_TOOL)) + nldebug("Crash report tool '%s' does not exist", NL_CRASH_REPORT_TOOL); #endif - } -} - -static LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - //MSGFILTER *pmf; - - if (message == WM_COMMAND && HIWORD(wParam) == BN_CLICKED) - { - if ((HWND) lParam == checkIgnore) - { - IgnoreNextTime = !IgnoreNextTime; - } - else if ((HWND) lParam == debug) - { - sendEmail(); - NeedExit = true; - Result = ReportDebug; - if (DebugDefaultBehavior) - { - NLMISC_BREAKPOINT; - } - } - else if ((HWND) lParam == ignore) +#if defined(NL_OS_WINDOWS) && !FINAL_VERSION && !NL_REPORT_CONSOLE_DEBUGGER + if (IsDebuggerPresent()) { - sendEmail(); - NeedExit = true; - Result = ReportIgnore; + return defaultResult; } - else if ((HWND) lParam == quit) - { - sendEmail(); - NeedExit = true; - Result = ReportQuit; - - if (QuitDefaultBehavior) - { - // ace: we cannot call exit() because it's call the static object dtor and can crash the application - // if the dtor call order is not good. - //exit(EXIT_SUCCESS); -#ifdef NL_OS_WINDOWS - // disable the Windows popup telling that the application aborted and disable the dr watson report. - _set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT); + else #endif - // quit without calling atexit or static object dtors. - abort(); - } - } - /*else if ((HWND) lParam == sendReport) + if (synchronous) { - if (EmailFunction != NULL) +#if NL_REPORT_CONSOLE + // An interactive console based report + printf("\n"); + if (!title.empty()) + printf("%s\n", title.c_str()); + else + printf("NeL report\n"); + printf("\n"); + if (!subject.empty()) + printf("\tsubject: '%s'\n", subject.c_str()); + if (!body.empty()) + printf("\tbody: '%s'\n", reportPath.c_str()); + if (!attachment.empty()) + printf("\tattachment: '%s'\n", attachment.c_str()); + for (;;) { - bool res = EmailFunction ("", "", "", Subject, Body, AttachedFile, false); - if (res) - { - EnableWindow(sendReport, FALSE); - MessageBox (dialog, "The email was successfully sent", "email", MB_OK); - CFile::createEmptyFile(getLogDirectory() + "report_sent"); - } - else + printf("\n"); + printf("Always Ignore (S), Ignore (I), Abort (A), Break (B)?\n"); // S for Surpress + printf("> "); + int c = getchar(); + getchar(); + switch (c) { - MessageBox (dialog, "Failed to send the email", "email", MB_OK | MB_ICONERROR); + case 'S': + case 's': + return ReportAlwaysIgnore; + case 'I': + case 'i': + return ReportIgnore; + case 'A': + case 'a': + return ReportAbort; + case 'B': + case 'b': + return ReportBreak; } } - }*/ - } - else if (message == WM_CHAR) - { - if (wParam == 27) - { - // ESC -> ignore - sendEmail(); - NeedExit = true; - Result = ReportIgnore; - } - } - - return DefWindowProc (hWnd, message, wParam, lParam); -} - -TReportResult report (const std::string &title, const std::string &header, const std::string &subject, const std::string &body, bool enableCheckIgnore, uint debugButton, bool ignoreButton, sint quitButton, bool sendReportButton, bool &ignoreNextTime, const string &attachedFile) -{ - // register the window - static bool AlreadyRegister = false; - if(!AlreadyRegister) - { - WNDCLASSW wc; - memset (&wc,0,sizeof(wc)); - wc.style = CS_HREDRAW | CS_VREDRAW; - wc.lpfnWndProc = (WNDPROC)WndProc; - wc.cbClsExtra = 0; - wc.cbWndExtra = 0; - wc.hInstance = GetModuleHandle(NULL); - wc.hIcon = NULL; - wc.hCursor = LoadCursor(NULL,IDC_ARROW); - wc.hbrBackground = (HBRUSH)COLOR_WINDOW; - wc.lpszClassName = L"NLReportWindow"; - wc.lpszMenuName = NULL; - if (!RegisterClassW(&wc)) return ReportError; - AlreadyRegister = true; - } - - ucstring formatedTitle = title.empty() ? ucstring("NeL report") : ucstring(title); - - - // create the window - dialog = CreateWindowW (L"NLReportWindow", (LPCWSTR)formatedTitle.c_str(), WS_DLGFRAME | WS_CAPTION /*| WS_THICKFRAME*/, CW_USEDEFAULT, CW_USEDEFAULT, 456, 400, NULL, NULL, GetModuleHandle(NULL), NULL); - - // create the font - HFONT font = CreateFont (-12, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial"); - - Subject = subject; - AttachedFile = attachedFile; - - // create the edit control - HWND edit = CreateWindowW (L"EDIT", NULL, WS_BORDER | WS_CHILD | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL | ES_READONLY | ES_LEFT | ES_MULTILINE, 7, 70, 429, 212, dialog, (HMENU) NULL, (HINSTANCE) GetWindowLongPtr(dialog, GWLP_HINSTANCE), NULL); - SendMessage (edit, WM_SETFONT, (LONG) font, TRUE); - - // set the edit text limit to lot of :) - SendMessage (edit, EM_LIMITTEXT, ~0U, 0); - - Body = addSlashR (body); - - // set the message in the edit text - SendMessage (edit, WM_SETTEXT, (WPARAM)0, (LPARAM)Body.c_str()); - - if (enableCheckIgnore) - { - // create the combo box control - checkIgnore = CreateWindowW (L"BUTTON", L"Don't display this report again", WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX | BS_CHECKBOX, 7, 290, 429, 18, dialog, (HMENU) NULL, (HINSTANCE) GetWindowLongPtr(dialog, GWLP_HINSTANCE), NULL); - SendMessage (checkIgnore, WM_SETFONT, (LONG) font, TRUE); - - if(ignoreNextTime) - { - SendMessage (checkIgnore, BM_SETCHECK, BST_CHECKED, 0); +#else + return defaultResult; +#endif } - } - - // create the debug button control - debug = CreateWindowW (L"BUTTON", L"Debug", WS_CHILD | WS_VISIBLE, 7, 315, 75, 25, dialog, (HMENU) NULL, (HINSTANCE) GetWindowLongPtr(dialog, GWLP_HINSTANCE), NULL); - SendMessage (debug, WM_SETFONT, (LONG) font, TRUE); - - if (debugButton == 0) - EnableWindow(debug, FALSE); - - // create the ignore button control - ignore = CreateWindowW (L"BUTTON", L"Ignore", WS_CHILD | WS_VISIBLE, 75+7+7, 315, 75, 25, dialog, (HMENU) NULL, (HINSTANCE) GetWindowLongPtr(dialog, GWLP_HINSTANCE), NULL); - SendMessage (ignore, WM_SETFONT, (LONG) font, TRUE); - - if (ignoreButton == 0) - EnableWindow(ignore, FALSE); - - // create the quit button control - quit = CreateWindowW (L"BUTTON", L"Quit", WS_CHILD | WS_VISIBLE, 75+75+7+7+7, 315, 75, 25, dialog, (HMENU) NULL, (HINSTANCE) GetWindowLongPtr(dialog, GWLP_HINSTANCE), NULL); - SendMessage (quit, WM_SETFONT, (LONG) font, TRUE); - - if (quitButton == 0) - EnableWindow(quit, FALSE); - - // create the debug button control - sendReport = CreateWindowW (L"BUTTON", L"Don't send the report", WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, 7, 315+32, 429, 18, dialog, (HMENU) NULL, (HINSTANCE) GetWindowLongPtr(dialog, GWLP_HINSTANCE), NULL); - SendMessage (sendReport, WM_SETFONT, (LONG) font, TRUE); - - string formatedHeader; - if (header.empty()) - { - formatedHeader = "This application stopped to display this report."; - } - else - { - formatedHeader = header; - } - - // ace don't do that because it s slow to try to send a mail - //CanSendMailReport = sendReportButton && EmailFunction != NULL && EmailFunction("", "", "", "", "", true); - CanSendMailReport = sendReportButton && EmailFunction != NULL; - - if (CanSendMailReport) - formatedHeader += " Send report will only email the contents of the box below. Please, send it to help us (it could take few minutes to send the email, be patient)."; - else - EnableWindow(sendReport, FALSE); - - ucstring uc = ucstring::makeFromUtf8(formatedHeader); - - // create the label control - HWND label = CreateWindowW (L"STATIC", (LPCWSTR)uc.c_str(), WS_CHILD | WS_VISIBLE /*| SS_WHITERECT*/, 7, 7, 429, 51, dialog, (HMENU) NULL, (HINSTANCE) GetWindowLongPtr(dialog, GWLP_HINSTANCE), NULL); - SendMessage (label, WM_SETFONT, (LONG) font, TRUE); - - - DebugDefaultBehavior = debugButton==1; - QuitDefaultBehavior = quitButton==1; - - IgnoreNextTime = ignoreNextTime; - - // show until the cursor really show :) - while (ShowCursor(TRUE) < 0) - ; - - SetWindowPos (dialog, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); - - SetFocus(dialog); - SetForegroundWindow(dialog); - - NeedExit = false; - - while(!NeedExit) - { - MSG msg; - while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE)) + else { - TranslateMessage(&msg); - DispatchMessageW(&msg); + return defaultResult; } - nlSleep (1); } - - // set the user result - ignoreNextTime = IgnoreNextTime; - - ShowWindow(dialog, SW_HIDE); - - - - DELETE_OBJECT(sendReport) - DELETE_OBJECT(quit) - DELETE_OBJECT(ignore) - DELETE_OBJECT(debug) - DELETE_OBJECT(checkIgnore) - DELETE_OBJECT(edit) - DELETE_OBJECT(label) - DELETE_OBJECT(dialog) - - return Result; } -#endif - - } // NLMISC diff --git a/code/nel/src/misc/shared_memory.cpp b/code/nel/src/misc/shared_memory.cpp index 2a7f85a8b..3afe795f1 100644 --- a/code/nel/src/misc/shared_memory.cpp +++ b/code/nel/src/misc/shared_memory.cpp @@ -19,10 +19,7 @@ #include "nel/misc/shared_memory.h" #include "nel/misc/debug.h" -#ifdef NL_OS_WINDOWS -# define NOMINMAX -# include -#else +#ifndef NL_OS_WINDOWS # include # include # include diff --git a/code/nel/src/misc/sheet_id.cpp b/code/nel/src/misc/sheet_id.cpp index 83dd4be89..690d09ab1 100644 --- a/code/nel/src/misc/sheet_id.cpp +++ b/code/nel/src/misc/sheet_id.cpp @@ -217,7 +217,7 @@ bool CSheetId::buildSheetId(const std::string& sheetName) return true; } } - + #ifdef NL_TEMP_YUBO_NO_SOUND_SHEET_ID if (a_NoSoundSheetId && sheetName.find(".sound") != std::string::npos) { @@ -236,7 +236,7 @@ bool CSheetId::buildSheetId(const std::string& sheetName) return true; } #endif - + return false; } @@ -417,10 +417,10 @@ void CSheetId::initWithoutSheet() nlassert(_DontHaveSheetKnowledge); return; } - + _Initialised = true; _DontHaveSheetKnowledge = true; - + // Initialize id 0,0 as unknown.unknown CSheetId unknownunknown = CSheetId("unknown.unknown"); nlassert(unknownunknown == CSheetId::Unknown); @@ -525,7 +525,7 @@ bool CSheetId::operator < (const CSheetId& sheetRef ) const string CSheetId::toString(bool ifNotFoundUseNumericId) const { if (!_Initialised) init(false); - + if (_DontHaveSheetKnowledge) { // FIXME: When someone punches in a fake sheet id this will @@ -564,7 +564,7 @@ string CSheetId::toString(bool ifNotFoundUseNumericId) const void CSheetId::serial(NLMISC::IStream &f) throw(NLMISC::EStream) { nlassert(!_DontHaveSheetKnowledge); - + f.serial( _Id.Id ); #ifdef NL_DEBUG_SHEET_ID diff --git a/code/nel/src/misc/sstring.cpp b/code/nel/src/misc/sstring.cpp index fe9332328..833553f21 100644 --- a/code/nel/src/misc/sstring.cpp +++ b/code/nel/src/misc/sstring.cpp @@ -1731,7 +1731,9 @@ namespace NLMISC double CSString::atof() const { - return ::atof(c_str()); + double val; + NLMISC::fromString(*this, val); + return val; } bool CSString::readFromFile(const CSString& fileName) diff --git a/code/nel/src/misc/stdmisc.h b/code/nel/src/misc/stdmisc.h index 432ec02b0..b24a74616 100644 --- a/code/nel/src/misc/stdmisc.h +++ b/code/nel/src/misc/stdmisc.h @@ -42,10 +42,20 @@ #include #include -#ifdef _WIN32 - #define NOMINMAX - #include - #include +#include + +#ifdef NL_OS_WINDOWS +# define WIN32_LEAN_AND_MEAN +# define _WIN32_WINDOWS 0x0410 +# ifndef _WIN32_WINNT +# define _WIN32_WINNT 0x0400 +# endif +# ifndef NL_COMP_MINGW +# define WINVER 0x0400 +# define NOMINMAX +# endif +# include +# include #endif #endif // NL_STDMISC_H diff --git a/code/nel/src/misc/system_info.cpp b/code/nel/src/misc/system_info.cpp index 1fa91db6c..8524939c8 100644 --- a/code/nel/src/misc/system_info.cpp +++ b/code/nel/src/misc/system_info.cpp @@ -19,8 +19,6 @@ #include "nel/misc/system_info.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX -# include # include # include # include @@ -1484,7 +1482,8 @@ bool CSystemInfo::getVideoInfo (std::string &deviceName, uint64 &driverVersion) { VS_FIXEDFILEINFO *info; UINT len; - if (_VerQueryValue(&buffer[0], "\\", (VOID**)&info, &len)) + char bslash[] = { '\\', 0x00 }; + if (_VerQueryValue(&buffer[0], bslash, (VOID**)&info, &len)) { driverVersion = (((uint64)info->dwFileVersionMS)<<32)|info->dwFileVersionLS; return true; diff --git a/code/nel/src/misc/system_utils.cpp b/code/nel/src/misc/system_utils.cpp index c60364741..bb1111b88 100644 --- a/code/nel/src/misc/system_utils.cpp +++ b/code/nel/src/misc/system_utils.cpp @@ -18,14 +18,12 @@ #include "nel/misc/system_utils.h" #ifdef NL_OS_WINDOWS - #define NOMINMAX - #include - - #ifdef _WIN32_WINNT_WIN7 +# include +# ifdef _WIN32_WINNT_WIN7 // only supported by Windows 7 Platform SDK - #include - #define TASKBAR_PROGRESS 1 - #endif +# include +# define TASKBAR_PROGRESS 1 +# endif #endif #ifdef DEBUG_NEW @@ -222,7 +220,7 @@ bool CSystemUtils::supportUnicode() bool CSystemUtils::isAzertyKeyboard() { #ifdef NL_OS_WINDOWS - uint16 klId = uint16((uint32)GetKeyboardLayout(0) & 0xFFFF); + uint16 klId = uint16((uintptr_t)GetKeyboardLayout(0) & 0xFFFF); // 0x040c is French, 0x080c is Belgian if (klId == 0x040c || klId == 0x080c) return true; @@ -312,7 +310,8 @@ bool CSystemUtils::setRegKey(const string &ValueName, const string &Value) HKEY hkey; DWORD dwDisp; - if (RegCreateKeyExA(HKEY_CURRENT_USER, RootKey.c_str(), 0, "", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, &dwDisp) == ERROR_SUCCESS) + char nstr[] = { 0x00 }; + if (RegCreateKeyExA(HKEY_CURRENT_USER, RootKey.c_str(), 0, nstr, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, &dwDisp) == ERROR_SUCCESS) { if (RegSetValueExA(hkey, ValueName.c_str(), 0L, REG_SZ, (const BYTE *)Value.c_str(), (DWORD)(Value.size())+1) == ERROR_SUCCESS) res = true; @@ -356,4 +355,14 @@ uint CSystemUtils::getCurrentColorDepth() return depth; } +/// Detect whether the current process is a windowed application. Return true if definitely yes, false if unknown +bool CSystemUtils::detectWindowedApplication() +{ +#ifdef NL_OS_WINDOWS + if (GetConsoleWindow() == NULL) + return true; +#endif + return false; +} + } // NLMISC diff --git a/code/nel/src/misc/tds.cpp b/code/nel/src/misc/tds.cpp index 13105f98d..170cda97d 100644 --- a/code/nel/src/misc/tds.cpp +++ b/code/nel/src/misc/tds.cpp @@ -20,7 +20,9 @@ #include "nel/misc/debug.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #endif // NL_OS_WINDOWS diff --git a/code/nel/src/misc/time_nl.cpp b/code/nel/src/misc/time_nl.cpp index 0ba60c8e2..70b7b3807 100644 --- a/code/nel/src/misc/time_nl.cpp +++ b/code/nel/src/misc/time_nl.cpp @@ -21,8 +21,7 @@ #include "nel/misc/thread.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX -# include +# include #elif defined (NL_OS_UNIX) # include # include diff --git a/code/nel/src/misc/win32_util.cpp b/code/nel/src/misc/win32_util.cpp index 63315e1b2..6085e98e5 100644 --- a/code/nel/src/misc/win32_util.cpp +++ b/code/nel/src/misc/win32_util.cpp @@ -20,8 +20,6 @@ #ifdef NL_OS_WINDOWS -#include - #ifdef DEBUG_NEW #define new DEBUG_NEW #endif diff --git a/code/nel/src/misc/win_displayer.cpp b/code/nel/src/misc/win_displayer.cpp index f5c0d9545..5da7db65b 100644 --- a/code/nel/src/misc/win_displayer.cpp +++ b/code/nel/src/misc/win_displayer.cpp @@ -18,9 +18,6 @@ #include "nel/misc/win_displayer.h" #ifdef NL_OS_WINDOWS - -#define NOMINMAX -#include #include #include #include @@ -29,6 +26,7 @@ #include #include +#include "nel/misc/app_context.h" #include "nel/misc/path.h" #include "nel/misc/command.h" #include "nel/misc/thread.h" @@ -44,6 +42,13 @@ namespace NLMISC { static CHARFORMAT2 CharFormat; +CWinDisplayer::CWinDisplayer(const char *displayerName) : CWindowDisplayer(displayerName), Exit(false) +{ + needSlashR = true; + createLabel("@Clear|CLEAR"); + + INelContext::getInstance().setWindowedApplication(true); +} CWinDisplayer::~CWinDisplayer () { @@ -263,7 +268,7 @@ void CWinDisplayer::updateLabels () { access.value()[i].Hwnd = CreateWindowW (L"STATIC", L"", WS_CHILD | WS_VISIBLE | SS_SIMPLE, 0, 0, 0, 0, _HWnd, (HMENU) NULL, (HINSTANCE) GetWindowLongPtr(_HWnd, GWLP_HINSTANCE), NULL); } - SendMessage ((HWND)access.value()[i].Hwnd, WM_SETFONT, (LONG) _HFont, TRUE); + SendMessage ((HWND)access.value()[i].Hwnd, WM_SETFONT, (WPARAM)_HFont, TRUE); needResize = true; } @@ -285,7 +290,7 @@ void CWinDisplayer::updateLabels () } } - SendMessage ((HWND)access.value()[i].Hwnd, WM_SETTEXT, 0, (LONG) n.c_str()); + SendMessage ((HWND)access.value()[i].Hwnd, WM_SETTEXT, 0, (LPARAM) n.c_str()); access.value()[i].NeedUpdate = false; } } @@ -422,7 +427,7 @@ void CWinDisplayer::open (string titleBar, bool iconified, sint x, sint y, sint dwStyle |= WS_HSCROLL; _HEdit = CreateWindowExW(WS_EX_OVERLAPPEDWINDOW, RICHEDIT_CLASSW, L"", dwStyle, 0, _ToolBarHeight, w, h-_ToolBarHeight-_InputEditHeight, _HWnd, (HMENU) NULL, (HINSTANCE) GetWindowLongPtr(_HWnd, GWLP_HINSTANCE), NULL); - SendMessage (_HEdit, WM_SETFONT, (LONG) _HFont, TRUE); + SendMessage (_HEdit, WM_SETFONT, (WPARAM)_HFont, TRUE); // set the edit text limit to lot of :) SendMessage (_HEdit, EM_LIMITTEXT, -1, 0); @@ -436,7 +441,7 @@ void CWinDisplayer::open (string titleBar, bool iconified, sint x, sint y, sint _HInputEdit = CreateWindowExW(WS_EX_OVERLAPPEDWINDOW, RICHEDIT_CLASSW, L"", WS_CHILD | WS_VISIBLE /*| ES_MULTILINE*/ | ES_WANTRETURN | ES_NOHIDESEL | ES_AUTOHSCROLL, 0, h-_InputEditHeight, w, _InputEditHeight, _HWnd, NULL, (HINSTANCE) GetWindowLongPtr(_HWnd, GWLP_HINSTANCE), NULL); - SendMessageW (_HInputEdit, WM_SETFONT, (LONG) _HFont, TRUE); + SendMessageW (_HInputEdit, WM_SETFONT, (WPARAM)_HFont, TRUE); LRESULT dwEvent = SendMessageW(_HInputEdit, EM_GETEVENTMASK, (WPARAM)0, (LPARAM)0); dwEvent |= ENM_MOUSEEVENTS | ENM_KEYEVENTS | ENM_CHANGE; @@ -486,7 +491,7 @@ void CWinDisplayer::clear () SendMessageW (_HEdit, EM_SETSEL, 0, nIndex); // clear all the text - SendMessageW (_HEdit, EM_REPLACESEL, FALSE, (LONG) ""); + SendMessageW (_HEdit, EM_REPLACESEL, FALSE, (LPARAM) ""); SendMessageW(_HEdit,EM_SETMODIFY,(WPARAM)TRUE,(LPARAM)0); @@ -535,7 +540,7 @@ void CWinDisplayer::display_main () // store old selection DWORD startSel, endSel; - SendMessage (_HEdit, EM_GETSEL, (LONG)&startSel, (LONG)&endSel); + SendMessage (_HEdit, EM_GETSEL, (WPARAM)&startSel, (LPARAM)&endSel); // find how many lines we have to remove in the current output to add new lines @@ -549,7 +554,7 @@ void CWinDisplayer::display_main () if (nblineremove == _HistorySize) { - SendMessage (_HEdit, WM_SETTEXT, 0, (LONG) ""); + SendMessage (_HEdit, WM_SETTEXT, 0, (LPARAM) ""); startSel = endSel = -1; } else @@ -559,7 +564,7 @@ void CWinDisplayer::display_main () LRESULT oldIndex2 = SendMessageW (_HEdit, EM_LINEINDEX, nblineremove, 0); //nlassert (oldIndex2 != -1); SendMessageW (_HEdit, EM_SETSEL, oldIndex1, oldIndex2); - SendMessageW (_HEdit, EM_REPLACESEL, FALSE, (LONG) ""); + SendMessageW (_HEdit, EM_REPLACESEL, FALSE, (LPARAM) ""); // update the selection due to the erasing sint dt = (sint)(oldIndex2 - oldIndex1); @@ -599,7 +604,7 @@ void CWinDisplayer::display_main () } // add the string to the edit control - SendMessageW (_HEdit, EM_REPLACESEL, FALSE, (LONG) str.c_str()); + SendMessageW (_HEdit, EM_REPLACESEL, FALSE, (LPARAM) str.c_str()); } // restore old selection diff --git a/code/nel/src/misc/win_event_emitter.cpp b/code/nel/src/misc/win_event_emitter.cpp index bb43e290b..67e426f1e 100644 --- a/code/nel/src/misc/win_event_emitter.cpp +++ b/code/nel/src/misc/win_event_emitter.cpp @@ -22,8 +22,6 @@ #include "nel/misc/event_server.h" #ifdef NL_OS_WINDOWS -#define NOMINMAX -#include #include /** @@ -55,14 +53,6 @@ void CWinEventEmitter::submitEvents(CEventServer & server, bool allWindows) _InternalServer.pump (allWindows); } -/*------------------------------------------------------------------*\ - emulateMouseRawMode() -\*------------------------------------------------------------------*/ -void CWinEventEmitter::emulateMouseRawMode(bool enable) -{ - nlerror("no raw mode emulation on windows, the CDIMouse has a real raw mode"); -} - /*------------------------------------------------------------------*\ processMessage() \*------------------------------------------------------------------*/ @@ -318,7 +308,7 @@ bool CWinEventEmitter::processMessage (HWND hWnd, uint32 msg, WPARAM wParam, LPA case WM_INPUTLANGCHANGE: if ( _IMEEventsEnabled ) { - // wParam = Specifies the character set of the new locale. + // wParam = Specifies the character set of the new locale. // lParam = Input locale identifier. server->postEvent( new CEventIME( msg, (uint32)wParam, (uint32)lParam, this ) ); return true; // trap message diff --git a/code/nel/src/misc/win_thread.cpp b/code/nel/src/misc/win_thread.cpp index d90d081ff..4178b7a58 100644 --- a/code/nel/src/misc/win_thread.cpp +++ b/code/nel/src/misc/win_thread.cpp @@ -20,7 +20,9 @@ #ifdef NL_OS_WINDOWS #include "nel/misc/path.h" +#ifndef NL_COMP_MINGW #define NOMINMAX +#endif #include #include @@ -196,7 +198,7 @@ void CWinThread::start () { if (isRunning()) throw EThread("Starting a thread that is already started, existing thread will continue running, this should not happen"); - + // ThreadHandle = (void *) ::CreateThread (NULL, _StackSize, ProxyFunc, this, 0, (DWORD *)&ThreadId); ThreadHandle = (void *) ::CreateThread (NULL, 0, ProxyFunc, this, 0, (DWORD *)&ThreadId); // nldebug("NLMISC: thread %x started for runnable '%x'", typeid( Runnable ).name()); diff --git a/code/nel/src/misc/words_dictionary.cpp b/code/nel/src/misc/words_dictionary.cpp index e2113e62d..4d5057dd7 100644 --- a/code/nel/src/misc/words_dictionary.cpp +++ b/code/nel/src/misc/words_dictionary.cpp @@ -251,7 +251,7 @@ void CWordsDictionary::exactLookupByKey( const CSString& key, CVectorSString& re */ inline CSString CWordsDictionary::makeResult( const CSString &key, const CSString &word ) { - return key + CSString(": ") + word; + return key + ": " + word.c_str(); } diff --git a/code/nel/src/net/buf_client.cpp b/code/nel/src/net/buf_client.cpp index 939dbc89a..350b2d6db 100644 --- a/code/nel/src/net/buf_client.cpp +++ b/code/nel/src/net/buf_client.cpp @@ -24,7 +24,9 @@ #include "nel/net/net_log.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #elif defined NL_OS_UNIX # include diff --git a/code/nel/src/net/buf_server.cpp b/code/nel/src/net/buf_server.cpp index 44c966e11..09b061fd4 100644 --- a/code/nel/src/net/buf_server.cpp +++ b/code/nel/src/net/buf_server.cpp @@ -22,7 +22,9 @@ #include "nel/net/net_log.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #elif defined NL_OS_UNIX # include diff --git a/code/nel/src/net/buf_sock.cpp b/code/nel/src/net/buf_sock.cpp index e7f07085d..8535435b0 100644 --- a/code/nel/src/net/buf_sock.cpp +++ b/code/nel/src/net/buf_sock.cpp @@ -25,7 +25,9 @@ #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #elif defined NL_OS_UNIX # include diff --git a/code/nel/src/net/callback_client.cpp b/code/nel/src/net/callback_client.cpp index bb9261b65..f05648016 100644 --- a/code/nel/src/net/callback_client.cpp +++ b/code/nel/src/net/callback_client.cpp @@ -53,7 +53,7 @@ CCallbackClient::~CCallbackClient() * Recorded : YES * Replayed : MAYBE */ -void CCallbackClient::send (const CMessage &buffer, TSockId hostid, bool log) +void CCallbackClient::send (const CMessage &buffer, TSockId hostid, bool /* log */) { nlassert (hostid == InvalidSockId); // should always be InvalidSockId on client nlassert (connected ()); diff --git a/code/nel/src/net/listen_sock.cpp b/code/nel/src/net/listen_sock.cpp index 8c9802076..7dedd6b97 100644 --- a/code/nel/src/net/listen_sock.cpp +++ b/code/nel/src/net/listen_sock.cpp @@ -22,7 +22,9 @@ #ifdef NL_OS_WINDOWS -#define NOMINMAX +#ifndef NL_COMP_MINGW +# define NOMINMAX +#endif #include typedef sint socklen_t; diff --git a/code/nel/src/net/service.cpp b/code/nel/src/net/service.cpp index 3a6991485..1f3436d1c 100644 --- a/code/nel/src/net/service.cpp +++ b/code/nel/src/net/service.cpp @@ -23,10 +23,6 @@ #ifdef NL_OS_WINDOWS // these defines is for IsDebuggerPresent(). it'll not compile on windows 95 // just comment this and the IsDebuggerPresent to compile on windows 95 -# define _WIN32_WINDOWS 0x0410 -# define WINVER 0x0400 -# define NOMINMAX -# include # include #elif defined NL_OS_UNIX # include @@ -604,7 +600,7 @@ sint IService::main (const char *serviceShortName, const char *serviceLongName, ListeningPort = servicePort; - setReportEmailFunction ((void*)sendEmail); + // setReportEmailFunction ((void*)sendEmail); // setDefaultEmailParams ("gw.nevrax.com", "", "cado@nevrax.com"); diff --git a/code/nel/src/net/sock.cpp b/code/nel/src/net/sock.cpp index 2a88ca967..0e2329733 100644 --- a/code/nel/src/net/sock.cpp +++ b/code/nel/src/net/sock.cpp @@ -22,7 +22,9 @@ #include "nel/misc/hierarchical_timer.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include # include # define socklen_t int diff --git a/code/nel/src/net/stdnet.h b/code/nel/src/net/stdnet.h index 3a67ea783..df2bc931d 100644 --- a/code/nel/src/net/stdnet.h +++ b/code/nel/src/net/stdnet.h @@ -17,7 +17,11 @@ #include "nel/misc/types_nl.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# define _WIN32_WINDOWS 0x0410 +# ifndef NL_COMP_MINGW +# define WINVER 0x0400 +# define NOMINMAX +# endif # include # include #endif // NL_OS_WINDOWS diff --git a/code/nel/src/net/tcp_sock.cpp b/code/nel/src/net/tcp_sock.cpp index 12948e033..ed04b21b4 100644 --- a/code/nel/src/net/tcp_sock.cpp +++ b/code/nel/src/net/tcp_sock.cpp @@ -21,7 +21,9 @@ #ifdef NL_OS_WINDOWS # include -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include # define socklen_t int # define ERROR_NUM WSAGetLastError() diff --git a/code/nel/src/net/udp_sock.cpp b/code/nel/src/net/udp_sock.cpp index a7dcd4483..16b75d929 100644 --- a/code/nel/src/net/udp_sock.cpp +++ b/code/nel/src/net/udp_sock.cpp @@ -21,7 +21,9 @@ #ifdef NL_OS_WINDOWS # include -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include # define socklen_t int # define ERROR_NUM WSAGetLastError() diff --git a/code/nel/src/net/unified_network.cpp b/code/nel/src/net/unified_network.cpp index e8af9ceac..788dcdf12 100644 --- a/code/nel/src/net/unified_network.cpp +++ b/code/nel/src/net/unified_network.cpp @@ -36,7 +36,7 @@ namespace NLNET { static size_t ThreadCreator = 0; -static const uint64 AppIdDeadConnection = 0xDEAD; +static const uintptr_t AppIdDeadConnection = 0xDEAD; uint32 TotalCallbackCalled = 0; diff --git a/code/nel/src/pacs/local_retriever.cpp b/code/nel/src/pacs/local_retriever.cpp index 7158cee0a..c17709c70 100644 --- a/code/nel/src/pacs/local_retriever.cpp +++ b/code/nel/src/pacs/local_retriever.cpp @@ -2253,7 +2253,7 @@ bool NLPACS::CLocalRetriever::checkSurfaceIntegrity(uint surf, NLMISC::CVector t for (k=0; k+1(ochain[k], ochain[k+1])); + edges.push_back(std::pair(ochain[k], ochain[k+1])); } } } diff --git a/code/nel/src/sound/CMakeLists.txt b/code/nel/src/sound/CMakeLists.txt index 2cf570f69..6b0dc285d 100644 --- a/code/nel/src/sound/CMakeLists.txt +++ b/code/nel/src/sound/CMakeLists.txt @@ -86,6 +86,7 @@ NL_TARGET_LIB(nelsound ${HEADERS} ${SRC}) INCLUDE_DIRECTORIES(${VORBIS_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${OGG_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nelsound ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY}) diff --git a/code/nel/src/sound/driver/dsound/source_dsound.h b/code/nel/src/sound/driver/dsound/source_dsound.h index 81174c1a0..1aa2d5625 100644 --- a/code/nel/src/sound/driver/dsound/source_dsound.h +++ b/code/nel/src/sound/driver/dsound/source_dsound.h @@ -80,7 +80,7 @@ enum TSourceDSoundEndState class CSourceDSound : public ISource { friend class CSoundDriverDSound; - + public: /// Constructor CSourceDSound(uint sourcename = 0); @@ -446,7 +446,7 @@ private: // Set the 'used' state of the source. Managed by the driver. void setUsed(bool v) { _IsUsed = v; } - + // Return the 'used' state of the source bool isUsed() { return _IsUsed; } */ diff --git a/code/nel/src/sound/driver/fmod/source_fmod.cpp b/code/nel/src/sound/driver/fmod/source_fmod.cpp index c5c6e8266..6026ce2f5 100644 --- a/code/nel/src/sound/driver/fmod/source_fmod.cpp +++ b/code/nel/src/sound/driver/fmod/source_fmod.cpp @@ -419,7 +419,7 @@ void CSourceFMod::setMinMaxDistances( float mindist, float maxdist, bool /* defe nlwarning("SOUND_DEV (FMod): Ridiculously high max distance set on source"); maxdist = maxSqrt; } - + _MinDist= mindist; _MaxDist= maxdist; if(_FModChannel!=-1) diff --git a/code/nel/src/sound/driver/openal/buffer_al.cpp b/code/nel/src/sound/driver/openal/buffer_al.cpp index b63e39fa2..352128c3e 100644 --- a/code/nel/src/sound/driver/openal/buffer_al.cpp +++ b/code/nel/src/sound/driver/openal/buffer_al.cpp @@ -121,7 +121,7 @@ bool CBufferAL::unlock(uint size) // Error handling if (alGetError() == AL_NO_ERROR) _IsLoaded = true; // ->lock() set it to false - + return _IsLoaded; } @@ -162,7 +162,7 @@ bool CBufferAL::fill(const uint8 *src, uint size) // Error handling _IsLoaded = (alGetError() == AL_NO_ERROR); - + return _IsLoaded; } diff --git a/code/nel/src/sound/driver/openal/driver_openal.def b/code/nel/src/sound/driver/openal/driver_openal.def index 41e42cf9d..a8b0c2781 100644 --- a/code/nel/src/sound/driver/openal/driver_openal.def +++ b/code/nel/src/sound/driver/openal/driver_openal.def @@ -1,4 +1,6 @@ -EXPORTS NLSOUND_createISoundDriverInstance -EXPORTS NLSOUND_interfaceVersion -EXPORTS NLSOUND_outputProfile -EXPORTS NLSOUND_getDriverType +LIBRARY nel_drv_openal_win_r +EXPORTS + NLSOUND_createISoundDriverInstance + NLSOUND_interfaceVersion + NLSOUND_outputProfile + NLSOUND_getDriverType \ No newline at end of file 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 40ea39d0b..82f52b782 100644 --- a/code/nel/src/sound/driver/openal/sound_driver_al.cpp +++ b/code/nel/src/sound/driver/openal/sound_driver_al.cpp @@ -92,7 +92,12 @@ NLMISC_DECL_PURE_LIB(CSoundDriverALNelLibrary) * Sound driver instance creation */ #ifdef NL_OS_WINDOWS - +#ifdef NL_COMP_MINGW +#ifndef NL_STATIC +extern "C" +{ +#endif +#endif // ****************************************************************** #ifdef NL_STATIC @@ -140,7 +145,11 @@ __declspec(dllexport) ISoundDriver::TDriver NLSOUND_getDriverType() } // ****************************************************************** - +#ifdef NL_COMP_MINGW +#ifndef NL_STATIC +} +#endif +#endif #elif defined (NL_OS_UNIX) #ifndef NL_STATIC diff --git a/code/nel/src/sound/driver/sound_driver.cpp b/code/nel/src/sound/driver/sound_driver.cpp index 145344b8a..4a87df307 100644 --- a/code/nel/src/sound/driver/sound_driver.cpp +++ b/code/nel/src/sound/driver/sound_driver.cpp @@ -34,7 +34,9 @@ #endif // HAVE_CONFIG_H #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #endif // NL_OS_WINDOWS @@ -151,7 +153,9 @@ ISoundDriver *ISoundDriver::createDriver(IStringMapperProvider *stringMapper, TD switch(driverType) { case DriverFMod: -#if defined (NL_OS_WINDOWS) +#if defined (NL_COMP_MINGW) + dllName = "libnel_drv_fmod_win"; +#elif defined (NL_OS_WINDOWS) dllName = "nel_drv_fmod_win"; #elif defined (NL_OS_UNIX) dllName = "nel_drv_fmod"; @@ -160,7 +164,9 @@ ISoundDriver *ISoundDriver::createDriver(IStringMapperProvider *stringMapper, TD #endif // NL_OS_UNIX / NL_OS_WINDOWS break; case DriverOpenAl: -#ifdef NL_OS_WINDOWS +#if defined (NL_COMP_MINGW) + dllName = "libnel_drv_openal_win"; +#elif defined (NL_OS_WINDOWS) dllName = "nel_drv_openal_win"; #elif defined (NL_OS_UNIX) dllName = "nel_drv_openal"; @@ -169,7 +175,9 @@ ISoundDriver *ISoundDriver::createDriver(IStringMapperProvider *stringMapper, TD #endif break; case DriverDSound: -#ifdef NL_OS_WINDOWS +#if defined (NL_COMP_MINGW) + dllName = "libnel_drv_dsound_win"; +#elif defined (NL_OS_WINDOWS) dllName = "nel_drv_dsound_win"; #elif defined (NL_OS_UNIX) nlerror("DriverDSound doesn't exist on Unix because it requires DirectX"); @@ -178,7 +186,9 @@ ISoundDriver *ISoundDriver::createDriver(IStringMapperProvider *stringMapper, TD #endif break; case DriverXAudio2: -#ifdef NL_OS_WINDOWS +#if defined (NL_COMP_MINGW) + dllName = "libnel_drv_xaudio2_win"; +#elif defined (NL_OS_WINDOWS) dllName = "nel_drv_xaudio2_win"; #elif defined (NL_OS_UNIX) nlerror("DriverXAudio2 doesn't exist on Unix because it requires DirectX"); @@ -187,7 +197,9 @@ ISoundDriver *ISoundDriver::createDriver(IStringMapperProvider *stringMapper, TD #endif break; default: -#ifdef NL_OS_WINDOWS +#if defined (NL_COMP_MINGW) + dllName = "libnel_drv_xaudio2_win"; +#elif defined (NL_OS_WINDOWS) dllName = "nel_drv_xaudio2_win"; #elif defined (NL_OS_UNIX) dllName = "nel_drv_openal"; diff --git a/code/nel/src/sound/driver/xaudio2/adpcm_xaudio2.h b/code/nel/src/sound/driver/xaudio2/adpcm_xaudio2.h index 6655c57a8..3b46d1b9a 100644 --- a/code/nel/src/sound/driver/xaudio2/adpcm_xaudio2.h +++ b/code/nel/src/sound/driver/xaudio2/adpcm_xaudio2.h @@ -62,7 +62,7 @@ protected: /// Mutex for cross-thread access from XAudio2 callbacks. NLMISC::CMutex _Mutex; /// Unique id for buffer. - uint _LastBufferContext; + uintptr_t _LastBufferContext; /// Current buffer. void *_ValidBufferContext[_BufferNb]; public: diff --git a/code/nel/src/sound/driver/xaudio2/driver_xaudio2.def b/code/nel/src/sound/driver/xaudio2/driver_xaudio2.def index 247ed160f..2a29a2d91 100644 --- a/code/nel/src/sound/driver/xaudio2/driver_xaudio2.def +++ b/code/nel/src/sound/driver/xaudio2/driver_xaudio2.def @@ -1,4 +1,6 @@ -EXPORTS NLSOUND_createISoundDriverInstance -EXPORTS NLSOUND_interfaceVersion -EXPORTS NLSOUND_outputProfile -EXPORTS NLSOUND_getDriverType \ No newline at end of file +LIBRARY nel_drv_xaudio2_win_r +EXPORTS + NLSOUND_createISoundDriverInstance + NLSOUND_interfaceVersion + NLSOUND_outputProfile + NLSOUND_getDriverType \ No newline at end of file diff --git a/code/nel/src/sound/driver/xaudio2/sound_driver_xaudio2.cpp b/code/nel/src/sound/driver/xaudio2/sound_driver_xaudio2.cpp index c1cdd3729..b95735fc5 100644 --- a/code/nel/src/sound/driver/xaudio2/sound_driver_xaudio2.cpp +++ b/code/nel/src/sound/driver/xaudio2/sound_driver_xaudio2.cpp @@ -53,6 +53,14 @@ BOOL WINAPI DllMain(HANDLE hModule, DWORD /* ul_reason_for_call */, LPVOID /* lp // *************************************************************************** +#ifndef NL_STATIC +#ifdef NL_COMP_MINGW +extern "C" { +#endif +#endif + +// *************************************************************************** + #ifdef NL_STATIC ISoundDriver* createISoundDriverInstanceXAudio2 #else @@ -99,6 +107,14 @@ __declspec(dllexport) ISoundDriver::TDriver NLSOUND_getDriverType() // ****************************************************************** +#ifndef NL_STATIC +#ifdef NL_COMP_MINGW +} +#endif +#endif + +// ****************************************************************** + #ifdef NL_DEBUG static XAUDIO2_DEBUG_CONFIGURATION NLSOUND_XAUDIO2_DEBUG_CONFIGURATION_DISABLED = { diff --git a/code/nel/src/sound/driver/xaudio2/stdxaudio2.h b/code/nel/src/sound/driver/xaudio2/stdxaudio2.h index d716d91bf..76b2a13d8 100644 --- a/code/nel/src/sound/driver/xaudio2/stdxaudio2.h +++ b/code/nel/src/sound/driver/xaudio2/stdxaudio2.h @@ -25,9 +25,57 @@ #include #include #include +#include // 3rd Party Includes +#include #define XAUDIO2_HELPER_FUNCTIONS + +#ifdef NL_COMP_MINGW +#define __in_bcount(x) +#define __in_bcount_opt(x) +#define __in_ecount(x) +#define __in_xcount(x) +#define __inout_bcount_full(x) +#define __inout_bcount_opt(x) +#define __out_bcount(x) +#define __out_bcount_full(x) +#define __out_bcount_opt(x) +#define __out_bcount_part_opt(x,y) +#define __out_ecount(x) +#define __out_xcount(x) +#define __deref_opt_inout_bcount_part_opt(x,y) +#define __deref_out_bcount(x) +#define __deref_out_bcount_opt(x) +#define __out +#define __in +#define __inout +#define __deref_out +#define __in_opt +#define __inout_opt +#define __out_opt +#define __deref +#define __deref_inout_opt +#define __reserved +#define __XMA2DEFS_INCLUDED__ +#endif /* NL_COMP_MINGW */ + +#include + +#ifdef NL_COMP_MINGW +#undef DEFINE_CLSID +#undef DEFINE_IID +#undef DECLSPEC_UUID_WRAPPER +#define DEFINE_CLSID(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ + class className; \ + __CRT_UUID_DECL(className, 0x##l, 0x##w1, 0x##w2, 0x##b1, 0x##b2, 0x##b3, 0x##b4, 0x##b5, 0x##b6, 0x##b7, 0x##b8) \ + EXTERN_C const GUID CLSID_##className +#define DEFINE_IID(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ + interface interfaceName; \ + __CRT_UUID_DECL(interfaceName, 0x##l, 0x##w1, 0x##w2, 0x##b1, 0x##b2, 0x##b3, 0x##b4, 0x##b5, 0x##b6, 0x##b7, 0x##b8) \ + EXTERN_C const GUID IID_##interfaceName +#endif /* NL_COMP_MINGW */ + #include #include #include diff --git a/code/nel/src/sound/simple_source.cpp b/code/nel/src/sound/simple_source.cpp index 2c9dda86c..9b9ee5950 100644 --- a/code/nel/src/sound/simple_source.cpp +++ b/code/nel/src/sound/simple_source.cpp @@ -176,7 +176,7 @@ void CSimpleSource::play() // and play the sound bool play = pSource->play(); - + #ifdef NL_DEBUG nlassert(play); #else diff --git a/code/nel/src/sound/sound_animation.cpp b/code/nel/src/sound/sound_animation.cpp index 5a6f1c256..1d1f9093a 100644 --- a/code/nel/src/sound/sound_animation.cpp +++ b/code/nel/src/sound/sound_animation.cpp @@ -176,7 +176,10 @@ void CSoundAnimation::load() throw NLMISC::Exception("Invalid sound animation marker"); } - marker->setTime((float) atof(time)); + float val; + NLMISC::fromString(time, val); + + marker->setTime(val); xmlFree ((void*)time); diff --git a/code/nel/tools/3d/CMakeLists.txt b/code/nel/tools/3d/CMakeLists.txt index 7d22c39d6..cb709ffaa 100644 --- a/code/nel/tools/3d/CMakeLists.txt +++ b/code/nel/tools/3d/CMakeLists.txt @@ -1,41 +1,42 @@ IF(WITH_NEL_TOOLS) - + IF(WITH_3D) + SUBDIRS( + anim_builder + animation_set_builder + build_clod_bank + build_clodtex + build_coarse_mesh + build_far_bank + build_shadow_skin + build_smallbank + cluster_viewer + file_info + ig_add + ig_elevation + ig_info + ig_lighter + lightmap_optimizer + zone_dependencies + zone_ig_lighter + zone_lighter + zone_welder + shapes_exporter + shape2obj + zone_check_bind + zone_dump + zviewer) + ENDIF() + SUBDIRS( - build_coarse_mesh - build_far_bank - build_smallbank - ig_lighter - ig_elevation - lightmap_optimizer - zone_dependencies - zone_ig_lighter - zone_lighter - zone_welder - animation_set_builder - anim_builder - build_clod_bank - build_clodtex build_interface - unbuild_interface - build_shadow_skin - cluster_viewer - file_info get_neighbors - ig_add - ig_info - shapes_exporter tga_cut - tga_resize - shape2obj - zone_check_bind - zone_dump - zviewer) - -ENDIF(WITH_NEL_TOOLS) + tga_resize) +ENDIF() # For tools selection of only max plugins -IF(WIN32) +IF(WIN32 AND WITH_3D) IF(MFC_FOUND) ADD_SUBDIRECTORY(object_viewer) IF(WITH_NEL_MAXPLUGIN) @@ -45,9 +46,9 @@ IF(WIN32) ENDIF(MAXSDK_FOUND) ENDIF(WITH_NEL_MAXPLUGIN) ENDIF(MFC_FOUND) -ENDIF(WIN32) +ENDIF() -IF(WITH_NEL_TOOLS) +IF(WITH_NEL_TOOLS AND WITH_3D) IF(WIN32) # ADD_SUBDIRECTORY(lightmap_optimizer) IF(MFC_FOUND) @@ -58,7 +59,6 @@ IF(WITH_NEL_TOOLS) IF(WITH_QT) ADD_SUBDIRECTORY(tile_edit_qt) - ADD_SUBDIRECTORY(object_viewer_qt) ADD_SUBDIRECTORY(object_viewer_widget) ENDIF(WITH_QT) @@ -72,5 +72,5 @@ IF(WITH_NEL_TOOLS) #crash_log_analyser #shapes_exporter -ENDIF(WITH_NEL_TOOLS) +ENDIF() diff --git a/code/nel/tools/3d/build_clod_bank/build_clod_bank.cpp b/code/nel/tools/3d/build_clod_bank/build_clod_bank.cpp index 9938eb486..b5cd89f76 100644 --- a/code/nel/tools/3d/build_clod_bank/build_clod_bank.cpp +++ b/code/nel/tools/3d/build_clod_bank/build_clod_bank.cpp @@ -62,7 +62,7 @@ int main(int argc, char *argv[]) float bakeFrameRate= 20; if(argc>=5) { - bakeFrameRate= (float)atof(argv[4]); + NLMISC::fromString(argv[4], bakeFrameRate); if(bakeFrameRate<=1) { nlwarning("bad bakeFrameRate value, use a default of 20"); diff --git a/code/nel/tools/3d/build_interface/main.cpp b/code/nel/tools/3d/build_interface/main.cpp index 25bd35df9..343673b34 100644 --- a/code/nel/tools/3d/build_interface/main.cpp +++ b/code/nel/tools/3d/build_interface/main.cpp @@ -14,6 +14,10 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +// lightmap_optimizer +// ------------------ +// the goal is to regroup lightmap of a level into lightmap with a higher level + #include "nel/misc/common.h" #include "nel/misc/file.h" #include "nel/misc/bitmap.h" @@ -26,8 +30,6 @@ #include #include -#include "nel/misc/tool_logger.h" - // --------------------------------------------------------------------------- using namespace std; @@ -37,9 +39,8 @@ using namespace NLMISC; //char sExeDir[MAX_PATH]; std::string sExeDir; NLMISC::CApplicationContext _ApplicationContext; -PIPELINE::CToolLogger ToolLogger; -void outString(const string &sText) +void outString (const string &sText) { std::string sCurDir = CPath::getCurrentPath(); CPath::setCurrentPath(sExeDir.c_str()); @@ -112,18 +113,17 @@ void putPixel(uint8 *dst, uint8 *src, bool alphaTransfert) // *************************************************************************** bool putIn (NLMISC::CBitmap *pSrc, NLMISC::CBitmap *pDst, sint32 x, sint32 y, bool alphaTransfert=true) { - uint32 a, b; - uint8 *rSrcPix = &pSrc->getPixels()[0]; uint8 *rDstPix = &pDst->getPixels()[0]; uint wSrc= pSrc->getWidth(); uint hSrc= pSrc->getHeight(); - for (b = 0; b < hSrc; ++b) - for (a = 0; a < wSrc; ++a) + for (uint b = 0; b < hSrc; ++b) + for (uint a = 0; a < wSrc; ++a) { if (rDstPix[4*((x+a)+(y+b)*pDst->getWidth())+3] != 0) return false; + // write putPixel(rDstPix + 4*((x+a)+(y+b)*pDst->getWidth()), rSrcPix+ 4*(a+b*pSrc->getWidth()), alphaTransfert); } @@ -134,9 +134,9 @@ bool putIn (NLMISC::CBitmap *pSrc, NLMISC::CBitmap *pDst, sint32 x, sint32 y, bo // expand on W if(wSrcgetWidth()), rDstPix + 4*((x+wSrc-1)+(y+b)*pDst->getWidth()), alphaTransfert); } @@ -145,9 +145,9 @@ bool putIn (NLMISC::CBitmap *pSrc, NLMISC::CBitmap *pDst, sint32 x, sint32 y, bo // expand on H if(hSrcgetWidth()), rDstPix + 4*((x+a)+(y+hSrc-1)*pDst->getWidth()), alphaTransfert); } @@ -195,6 +195,15 @@ int main(int nNbArg, char **ppArgs) { //GetCurrentDirectory (MAX_PATH, sExeDir); sExeDir = CPath::getCurrentPath(); + + if (nNbArg < 3) + { + outString ("ERROR : Wrong number of arguments\n"); + outString ("USAGE : build_interface [-s] [path_maps2] [path_maps3] ....\n"); + outString (" -s : build a subset of an existing interface definition while preserving the existing texture ids,"); + outString (" to support freeing up VRAM by switching to the subset without rebuilding the entire interface\n"); + return -1; + } // build as a subset of existing interface bool buildSubset = false; @@ -209,13 +218,7 @@ int main(int nNbArg, char **ppArgs) case 'S': case 's': buildSubset = true; - existingUVfilename = string(ppArgs[i] + 2); - break; - case 'd': - ToolLogger.initDepend(string(ppArgs[i] + 2)); - break; - case 'e': - ToolLogger.initError(string(ppArgs[i] + 2)); + existingUVfilename = string( ppArgs[i]+2 ); break; default: break; @@ -225,24 +228,14 @@ int main(int nNbArg, char **ppArgs) inputDirs.push_back(ppArgs[i]); } - uint iNumDirs = (uint)inputDirs.size(); - if (iNumDirs < 2) + string fmtName; + uint iNumDirs = (uint)inputDirs.size(); + if( iNumDirs ) { - outString ("ERROR : Wrong number of arguments\n"); - outString ("USAGE : build_interface [-s] [-d] [-e] [path_maps2] [path_maps3] ....\n"); - outString (" -s : build a subset of an existing interface definition while preserving the existing texture ids,"); - outString (" to support freeing up VRAM by switching to the subset without rebuilding the entire interface\n"); - return -1; + fmtName = inputDirs.front(); + inputDirs.pop_front(); + --iNumDirs; } - - std::string tgaName = inputDirs.front(); - inputDirs.pop_front(); - --iNumDirs; - if (tgaName.rfind('.') == string::npos) - tgaName += ".tga"; - std::string uvName = tgaName.substr(0, tgaName.rfind('.')); - uvName += ".txt"; - vector AllMapNames; list::iterator it = inputDirs.begin(); list::iterator itEnd = inputDirs.end(); @@ -251,55 +244,45 @@ int main(int nNbArg, char **ppArgs) string sDir = *it++; if( !CFile::isDirectory(sDir) ) { - outString(string("ERROR : directory ") + sDir + " does not exist\n"); - ToolLogger.writeError(PIPELINE::ERROR, sDir, "Directory does not exist."); - ToolLogger.release(); + outString (string("ERROR : directory ") + sDir + " does not exist\n"); return -1; } - ToolLogger.writeDepend(PIPELINE::DIRECTORY, tgaName, sDir); - ToolLogger.writeDepend(PIPELINE::DIRECTORY, uvName, sDir); CPath::getPathContent(sDir, false, false, true, AllMapNames); } vector AllMaps; - sint32 i, j; + sint32 j; // Load all maps - //sint32 mapSize = (sint32)AllMapNames.size(); - //AllMaps.resize( mapSize ); - AllMaps.reserve(AllMapNames.size()); - for (std::vector::size_type i = 0; i < AllMapNames.size(); ++i) + sint32 mapSize = (sint32)AllMapNames.size(); + AllMaps.resize( mapSize ); + for(sint i = 0; i < mapSize; ++i ) { + NLMISC::CBitmap *pBtmp = NULL; + try { - ToolLogger.writeDepend(PIPELINE::BUILD, tgaName, AllMapNames[i]); // Write depend before error can occur. - ToolLogger.writeDepend(PIPELINE::BUILD, uvName, AllMapNames[i]); - - NLMISC::CBitmap *pBtmp = new NLMISC::CBitmap; + pBtmp = new NLMISC::CBitmap; NLMISC::CIFile inFile; - inFile.open( AllMapNames[i] ); - pBtmp->load(inFile); - AllMaps.push_back(pBtmp); + if (!inFile.open( AllMapNames[i] )) throw NLMISC::Exception("Unable to open " + AllMapNames[i]); + + uint8 colors = pBtmp->load(inFile); - if (pBtmp->getWidth() == 0 || pBtmp->getHeight() == 0) - ToolLogger.writeError(PIPELINE::WARNING, AllMapNames[i], "Bitmap of width or height 0, corrupt data"); + if (colors != 32) throw NLMISC::Exception(AllMapNames[i] + " is using " + toString(colors) + " bits colors, only 32 bit supported!"); + + AllMaps[i] = pBtmp; } catch (const NLMISC::Exception &e) { - // Allow the build process to continue without the bad file. + if (pBtmp) delete pBtmp; outString (string("ERROR :") + e.what()); - ToolLogger.writeError(PIPELINE::WARNING, AllMapNames[i], e.what()); - - AllMapNames.erase(AllMapNames.begin() + i); - --i; + return -1; } - nlassert(AllMaps.size() == i + 1); // It's a coding error otherwise. } - - sint32 mapSize = (sint32)AllMapNames.size(); + // Sort all maps by decreasing size - for (i = 0; i < mapSize-1; ++i) + for (sint i = 0; i < mapSize-1; ++i) for (j = i+1; j < mapSize; ++j) { NLMISC::CBitmap *pBI = AllMaps[i]; @@ -327,7 +310,7 @@ int main(int nNbArg, char **ppArgs) vector UVMin, UVMax; UVMin.resize (mapSize, NLMISC::CUV(0.0f, 0.0f)); UVMax.resize (mapSize, NLMISC::CUV(0.0f, 0.0f)); - for (i = 0; i < mapSize; ++i) + for (sint i = 0; i < mapSize; ++i) { sint32 x, y; while (!tryAllPos(AllMaps[i], &GlobalMask, x, y)) @@ -373,7 +356,7 @@ int main(int nNbArg, char **ppArgs) } // Convert UV from pixel to ratio - for (i = 0; i < mapSize; ++i) + for (sint i = 0; i < mapSize; ++i) { UVMin[i].U = UVMin[i].U / (float)GlobalTexture.getWidth(); UVMin[i].V = UVMin[i].V / (float)GlobalTexture.getHeight(); @@ -386,10 +369,12 @@ int main(int nNbArg, char **ppArgs) CPath::setCurrentPath(sExeDir.c_str()); NLMISC::COFile outTga; - if (outTga.open(tgaName)) + if (fmtName.rfind('.') == string::npos) + fmtName += ".tga"; + if (outTga.open(fmtName)) { std::string ext; - if (toLower(tgaName).find(".png") != string::npos) + if (toLower(fmtName).find(".png") != string::npos) { ext = "png"; GlobalTexture.writePNG (outTga, 32); @@ -401,23 +386,22 @@ int main(int nNbArg, char **ppArgs) } outTga.close(); - outString (toString("Writing %s file : %s\n", ext.c_str(), tgaName.c_str())); + outString (toString("Writing %s file : %s\n", ext.c_str(), fmtName.c_str())); } else { - outString (string("ERROR: Cannot write tga or png file : ") + tgaName + "\n"); - ToolLogger.writeError(PIPELINE::ERROR, tgaName, "Cannot write tga or png file."); - ToolLogger.release(); - return EXIT_FAILURE; + outString (string("ERROR: Cannot write tga file : ") + fmtName + "\n"); } // Write UV text file if( !buildSubset ) { - FILE *f = fopen (uvName.c_str(), "wt"); + fmtName = fmtName.substr(0, fmtName.rfind('.')); + fmtName += ".txt"; + FILE *f = fopen (fmtName.c_str(), "wt"); if (f != NULL) { - for (i = 0; i < mapSize; ++i) + for (sint i = 0; i < mapSize; ++i) { // get the string whitout path string fileName= CFile::getFilename(AllMapNames[i]); @@ -425,14 +409,11 @@ int main(int nNbArg, char **ppArgs) UVMax[i].U, UVMax[i].V); } fclose (f); - outString (string("Writing UV file : ") + uvName + "\n"); + outString (string("Writing UV file : ") + fmtName + "\n"); } else { - outString (string("ERROR: Cannot write UV file : ") + uvName + "\n"); - ToolLogger.writeError(PIPELINE::ERROR, uvName, "Cannot write UV file."); - ToolLogger.release(); - return EXIT_FAILURE; + outString (string("ERROR: Cannot write UV file : ") + fmtName + "\n"); } } else // build as a subset @@ -440,27 +421,21 @@ int main(int nNbArg, char **ppArgs) // Load existing uv file CIFile iFile; string filename = CPath::lookup (existingUVfilename, false); - - ToolLogger.writeDepend(PIPELINE::BUILD, tgaName, existingUVfilename); // Write depend before error can occur. - ToolLogger.writeDepend(PIPELINE::BUILD, uvName, existingUVfilename); - if( (filename == "") || (!iFile.open(filename)) ) { outString (string("ERROR : could not open file ") + existingUVfilename + "\n"); - ToolLogger.writeError(PIPELINE::ERROR, existingUVfilename, "Could not open file."); - ToolLogger.release(); - return EXIT_FAILURE; + return -1; } // Write subset UV text file - FILE *f = fopen (uvName.c_str(), "wt"); + fmtName = fmtName.substr(0, fmtName.rfind('.')); + fmtName += ".txt"; + FILE *f = fopen (fmtName.c_str(), "wt"); if (f == NULL) { - outString (string("ERROR: Cannot write UV file : ") + uvName + "\n"); - ToolLogger.writeError(PIPELINE::ERROR, uvName, "Cannot write UV file."); - ToolLogger.release(); + outString (string("ERROR: Cannot write UV file : ") + fmtName + "\n"); // fclose (iFile); - return EXIT_FAILURE; + return -1; } char bufTmp[256], tgaName[256]; @@ -474,12 +449,14 @@ int main(int nNbArg, char **ppArgs) nlwarning("Can't parse %s", bufTmp); continue; } + + sint i; sTGAname = toLower(string(tgaName)); string findTGAName; for (i = 0; i < mapSize; ++i) { - // get the string without path + // get the string whitout path findTGAName = toLower(CFile::getFilename(AllMapNames[i])); if( findTGAName == sTGAname ) break; @@ -499,9 +476,8 @@ int main(int nNbArg, char **ppArgs) } // fclose (iFile); fclose (f); - outString (string("Writing UV file : ") + uvName + "\n"); + outString (string("Writing UV file : ") + fmtName + "\n"); } - ToolLogger.release(); - return EXIT_SUCCESS; + return 0; } diff --git a/code/nel/tools/3d/cluster_viewer/view_cs.cpp b/code/nel/tools/3d/cluster_viewer/view_cs.cpp index abe54ada5..5e31543ca 100644 --- a/code/nel/tools/3d/cluster_viewer/view_cs.cpp +++ b/code/nel/tools/3d/cluster_viewer/view_cs.cpp @@ -38,7 +38,9 @@ #include "nel/3d/event_mouse_listener.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #endif // NL_OS_WINDOWS 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 4365eab9b..8286a10e6 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 @@ -167,6 +167,12 @@ void CIgLighterLib::lightIg(CInstanceLighter &instanceLighter, string name= igIn.getShapeName(i); bool shapeFound= true; + if (toLower (CFile::getExtension (name)) == "pacs_prim") + { + nlwarning("EXPORT BUG: Can't read %s (not a shape), should not be part of .ig!", name.c_str()); + continue; + } + // Try to find the shape in the UseShapeMap. std::map::const_iterator iteMap= lightDesc.UserShapeMap.find (name); diff --git a/code/nel/tools/3d/ligo/plugin_max/script.cpp b/code/nel/tools/3d/ligo/plugin_max/script.cpp index 41740bcbe..8a88136c5 100644 --- a/code/nel/tools/3d/ligo/plugin_max/script.cpp +++ b/code/nel/tools/3d/ligo/plugin_max/script.cpp @@ -1739,14 +1739,14 @@ bool MakeSnapShot (NLMISC::CBitmap &snapshot, const NL3D::CTileBank &tileBank, c float posY = config.CellSize * (float)ymin; // Use NELU - if (CNELU::init (oversampledWidth, oversampledHeight, CViewport(), 32, true, NULL, true)) + if (CNELU::init (oversampledWidth, oversampledHeight, CViewport(), 32, true, NULL, false, true)) // FIXME: OpenGL not working correctly, offscreen not available in Direct3D { // Setup the camera CNELU::Camera->setTransformMode (ITransformable::DirectMatrix); CMatrix view; view.setPos (CVector (width/2 + posX, height/2 + posY, width)); view.setRot (CVector::I, -CVector::K, CVector::J); - CNELU::Camera->setFrustum (width, height, 0.1f, 1000.f, false); + CNELU::Camera->setFrustum (width, height, 0.1f, 10000.f, false); CNELU::Camera->setMatrix (view); // Create a Landscape. @@ -1766,12 +1766,17 @@ bool MakeSnapShot (NLMISC::CBitmap &snapshot, const NL3D::CTileBank &tileBank, c theLand->enableAdditive (true); theLand->Landscape.setRefineMode (true); + // theLand->Landscape.setupStaticLight(CRGBA(255, 255, 255), CRGBA(0, 0, 0), 1.0f); + // theLand->Landscape.setThreshold(0.0005); + // Enbable automatique lighting #ifndef NL_DEBUG - theLand->Landscape.enableAutomaticLighting (true); - theLand->Landscape.setupAutomaticLightDir (CVector (0, 0, -1)); + // theLand->Landscape.enableAutomaticLighting (true); + // theLand->Landscape.setupAutomaticLightDir (CVector (0, 0, -1)); #endif // NL_DEBUG + // theLand->Landscape.updateLightingAll(); + // Clear the backbuffer and the alpha CNELU::clearBuffers(CRGBA(255,0,255,0)); @@ -1851,7 +1856,7 @@ bool MakeSnapShot (NLMISC::CBitmap &snapshot, const NL3D::CTileBank &tileBank, c Value* make_snapshot_cf (Value** arg_list, int count) { // Make sure we have the correct number of arguments (7) - check_arg_count(check_zone_with_template, 7, count); + check_arg_count(NeLLigoMakeSnapShot, 7, count); // Check to see if the arguments match up to what we expect char *message = "NeLLigoMakeSnapShot [Object] [Snapshot filename] [xMin] [xMax] [yMin] [yMax] [Error in dialog]"; @@ -1903,11 +1908,11 @@ Value* make_snapshot_cf (Value** arg_list, int count) else { // Build a filename - char drive[512]; - char path[512]; - char name[512]; - char ext[512]; - _splitpath (fileName.c_str(), drive, path, name, ext); + char drivetga[512]; + char pathtga[512]; + char nametga[512]; + char exttga[512]; + _splitpath (fileName.c_str(), drivetga, pathtga, nametga, exttga); // Build the zone CZone zone; @@ -1970,7 +1975,7 @@ Value* make_snapshot_cf (Value** arg_list, int count) { // Build the snap shot filename char outputFilenameSnapShot[512]; - _makepath (outputFilenameSnapShot, drive, path, name, ".tga"); + _makepath (outputFilenameSnapShot, drivetga, pathtga, nametga, ".tga"); // Output the snap shot COFile outputSnapShot; @@ -2011,10 +2016,10 @@ Value* make_snapshot_cf (Value** arg_list, int count) // Write the zone COFile outputLigoZone; - _makepath (outputFilenameSnapShot, drive, path, name, ".ligozone"); + _makepath (outputFilenameSnapShot, drivetga, pathtga, nametga, ".ligozone"); // Catch exception - try + /*try { // Open the selected zone file if (outputLigoZone.open (outputFilenameSnapShot)) @@ -2043,7 +2048,7 @@ Value* make_snapshot_cf (Value** arg_list, int count) char tmp[512]; smprintf (tmp, 512, "Error while loading the file %s : %s", fileName, e.what()); CMaxToLigo::errorMessage (tmp, "NeL Ligo export zone", *MAXScript_interface, errorInDialog); - } + }*/ } else { diff --git a/code/nel/tools/3d/object_viewer/edit_ex.cpp b/code/nel/tools/3d/object_viewer/edit_ex.cpp index c600334b0..71d5b8907 100644 --- a/code/nel/tools/3d/object_viewer/edit_ex.cpp +++ b/code/nel/tools/3d/object_viewer/edit_ex.cpp @@ -67,7 +67,9 @@ uint CEditEx::getUInt() const float CEditEx::getFloat() const { nlassert(_Type == FloatType); - return (float) ::atof(getString().c_str()); + float val; + NLMISC::fromString(getString(), val); + return val; } std::string CEditEx::getString() const diff --git a/code/nel/tools/3d/object_viewer/object_viewer.cpp b/code/nel/tools/3d/object_viewer/object_viewer.cpp index ff530e007..d79090662 100644 --- a/code/nel/tools/3d/object_viewer/object_viewer.cpp +++ b/code/nel/tools/3d/object_viewer/object_viewer.cpp @@ -598,7 +598,11 @@ bool CObjectViewer::initUI (HWND parent) // initialize NeL context if needed if (!NLMISC::INelContext::isContextInitialised()) - new NLMISC::CApplicationContext; + { + new NLMISC::CApplicationContext(); + nldebug("NeL Object Viewer: initUI"); + NLMISC::CSheetId::initWithoutSheet(); + } // The fonts manager _FontManager.setMaxMemory(2000000); @@ -676,9 +680,12 @@ bool CObjectViewer::initUI (HWND parent) view->MainFrame = _MainFrame; _MainFrame->ShowWindow (SW_SHOW); + + RECT viewportRect; + GetClientRect(view->m_hWnd, &viewportRect); // Init NELU - if (!CNELU::init (640, 480, viewport, 32, true, view->m_hWnd, false, _Direct3d)) + if (!CNELU::init (viewportRect.right, viewportRect.bottom, viewport, 32, true, view->m_hWnd, false, _Direct3d)) { return false; } diff --git a/code/nel/tools/3d/object_viewer/vegetable_density_page.cpp b/code/nel/tools/3d/object_viewer/vegetable_density_page.cpp index 72e53756b..2db682bcd 100644 --- a/code/nel/tools/3d/object_viewer/vegetable_density_page.cpp +++ b/code/nel/tools/3d/object_viewer/vegetable_density_page.cpp @@ -225,7 +225,8 @@ void CVegetableDensityPage::updateAngleMinFromEditText() // get angles edited. char stmp[256]; AngleMinEdit.GetWindowText(stmp, 256); - float angleMin= (float)atof(stmp); + float angleMin; + NLMISC::fromString(stmp, angleMin); NLMISC::clamp(angleMin, -90, 90); // make a sinus, because 90 => 1, and -90 =>-1 float cosAngleMin= (float)sin(angleMin*NLMISC::Pi/180.f); @@ -248,7 +249,8 @@ void CVegetableDensityPage::updateAngleMaxFromEditText() // get angles edited. char stmp[256]; AngleMaxEdit.GetWindowText(stmp, 256); - float angleMax= (float)atof(stmp); + float angleMax; + NLMISC::fromString(stmp, angleMax); NLMISC::clamp(angleMax, -90, 90); // make a sinus, because 90 => 1, and -90 =>-1 float cosAngleMax= (float)sin(angleMax*NLMISC::Pi/180.f); 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 deleted file mode 100644 index 5b3a49654..000000000 --- a/code/nel/tools/3d/object_viewer_qt/ovqt_config.h.cmake +++ /dev/null @@ -1,7 +0,0 @@ -#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 deleted file mode 100644 index d77b0e6a1..000000000 --- a/code/nel/tools/3d/object_viewer_qt/src/CMakeLists.txt +++ /dev/null @@ -1,53 +0,0 @@ -ADD_SUBDIRECTORY(3rdparty) - -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${LIBXML2_INCLUDE_DIR} ${NEL_INCLUDE_DIR} ${QT_INCLUDES}) -INCLUDE( ${QT_USE_FILE} ) - -CONFIGURE_FILE(translations/translations.qrc ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc COPYONLY) - -FILE(GLOB OBJECT_VIEWER_SRC extension_system/*.h - extension_system/*.cpp - *.h *.cpp) - -SET(OBJECT_VIEWER_HDR extension_system/iplugin_manager.h - extension_system/plugin_manager.h) - -SET(OBJECT_VIEWER_RCS object_viewer_qt.qrc ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc) - -SET(OBJECT_VIEWER_TS translations/object_viewer_qt_en.ts - translations/object_viewer_qt_fr.ts - translations/object_viewer_qt_de.ts - translations/object_viewer_qt_ru.ts) - -SET(QT_USE_QTGUI TRUE) -SET(QT_USE_QTOPENGL TRUE) - -IF(WIN32) - SET(OBJECT_VIEWER_RC object_viewer_qt.rc) -ENDIF(WIN32) - -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} ) - -SOURCE_GROUP(QtResources FILES ${OBJECT_VIEWER_RCS}) -SOURCE_GROUP(QtGeneratedMocQrcSrc FILES ${OBJECT_VIEWER_MOC_SRCS} ${OBJECT_VIEWER_RC_SRCS}) - -ADD_EXECUTABLE(object_viewer_qt WIN32 MACOSX_BUNDLE - ${OBJECT_VIEWER_SRC} - ${OBJECT_VIEWER_MOC_SRCS} - ${OBJECT_VIEWER_RC_SRCS} - ${OBJECT_VIEWER_RC}) - -TARGET_LINK_LIBRARIES(object_viewer_qt - nelmisc - ${QT_LIBRARIES} - ${QT_QTMAIN_LIBRARY}) - -ADD_DEFINITIONS(-DQT_NO_KEYWORDS ${LIBXML2_DEFINITIONS} ${QT_DEFINITIONS}) -NL_DEFAULT_PROPS(object_viewer_qt "NeL, Tools, 3D: Object Viewer Qt") -NL_ADD_RUNTIME_FLAGS(object_viewer_qt) - -ADD_SUBDIRECTORY(plugins) - -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/images/nel_ide_load.png b/code/nel/tools/3d/object_viewer_qt/src/images/nel_ide_load.png deleted file mode 100644 index 1ec9d823f..000000000 Binary files a/code/nel/tools/3d/object_viewer_qt/src/images/nel_ide_load.png and /dev/null differ 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 deleted file mode 100644 index 40a8dcbfe..000000000 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/CMakeLists.txt +++ /dev/null @@ -1,67 +0,0 @@ -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(OVQT_PLUG_GEORGES_EDITOR_HDR georges_editor_plugin.h - georges_editor_form.h - georges_dirtree_dialog.h - georges_filesystem_model.h - georges_treeview_dialog.h - expandable_headerview.h) - -SET(OVQT_PLUG_GEORGES_EDITOR_UIS georges_editor_form.ui - georges_dirtree_form.ui - georges_treeview_form.ui) - -SET(OVQT_PLUGIN_GEORGES_EDITOR_RCS georges_editor.qrc) - -SET(QT_USE_QTGUI TRUE) -SET(QT_USE_QTOPENGL TRUE) - -QT4_ADD_RESOURCES(OVQT_PLUGIN_GEORGES_EDITOR_RC_SRCS ${OVQT_PLUGIN_GEORGES_EDITOR_RCS}) -QT4_WRAP_CPP(OVQT_PLUG_GEORGES_EDITOR_MOC_SRC ${OVQT_PLUG_GEORGES_EDITOR_HDR}) -QT4_WRAP_UI( OVQT_PLUG_GEORGES_EDITOR_UI_HDRS ${OVQT_PLUG_GEORGES_EDITOR_UIS} ) - -SOURCE_GROUP(QtResources FILES ${OVQT_PLUG_GEORGES_EDITOR_UIS} ${OVQT_PLUGIN_GEORGES_EDITOR_RCS}) -SOURCE_GROUP(QtGeneratedUiHdr FILES ${OVQT_PLUG_GEORGES_EDITOR_UI_HDRS}) -SOURCE_GROUP(QtGeneratedMocSrc FILES ${OVQT_PLUG_GEORGES_EDITOR_MOC_SRC}) -SOURCE_GROUP("Georges Editor Plugin" FILES ${SRC}) -SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) - -ADD_LIBRARY(ovqt_plugin_georges_editor MODULE ${SRC} ${OVQT_PLUG_GEORGES_EDITOR_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUG_GEORGES_EDITOR_UI_HDRS} ${OVQT_PLUGIN_GEORGES_EDITOR_RC_SRCS}) - -TARGET_LINK_LIBRARIES(ovqt_plugin_georges_editor ovqt_plugin_core nelmisc nelgeorges ${QT_LIBRARIES}) - -NL_DEFAULT_PROPS(ovqt_plugin_georges_editor "NeL, Tools, 3D: Object Viewer Qt Plugin: Georges Editor") -NL_ADD_RUNTIME_FLAGS(ovqt_plugin_georges_editor) -NL_ADD_LIB_SUFFIX(ovqt_plugin_georges_editor) - -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) - - -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) - -IF(WIN32) - IF(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_georges_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) - ELSE(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_georges_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) - ENDIF(WITH_INSTALL_LIBRARIES) -ELSE(WIN32) - IF(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_georges_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) - ELSE(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_georges_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) - ENDIF(WITH_INSTALL_LIBRARIES) -ENDIF(WIN32) - -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_georges_editor.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) - 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 deleted file mode 100644 index 744bb58da..000000000 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formitem.cpp +++ /dev/null @@ -1,163 +0,0 @@ -// 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" -#include "formitem.h" - -// Qt includes - -// NeL includes -#include -#include -#include - -namespace GeorgesQt -{ - - CFormItem::CFormItem(NLGEORGES::UFormElm* elm, const QList &data, CFormItem *parent, - NLGEORGES::UFormElm::TWhereIsValue wV, NLGEORGES::UFormElm::TWhereIsNode wN) - { - parentItem = parent; - itemData = data; - formElm = elm; - whereV = wV; - whereN = wN; - } - - CFormItem::~CFormItem() - { - qDeleteAll(childItems); - } - - void CFormItem::appendChild(CFormItem *item) - { - childItems.append(item); - } - - CFormItem *CFormItem::child(int row) - { - return childItems.value(row); - } - - int CFormItem::childCount() const - { - return childItems.count(); - } - - int CFormItem::columnCount() const - { - //nlinfo("columnCount %d",itemData.count()); - return itemData.count(); - } - - QVariant CFormItem::data(int column) const - { - return itemData.value(column); - } - - CFormItem *CFormItem::parent() - { - return parentItem; - } - - int CFormItem::row() const - { - if (parentItem) - return parentItem->childItems.indexOf(const_cast(this)); - - return 0; - } - - bool CFormItem::setData(int column, const QVariant &value) - { - if (column < 0 || column >= itemData.size()) - return false; - - // TODO: default values - if (!formElm) - return false; - - itemData[column] = value; - if (formElm->isAtom()) - { - const NLGEORGES::UType *type = formElm->getType(); - if (type) - { - switch (type->getType()) - { - case NLGEORGES::UType::UnsignedInt: - case NLGEORGES::UType::SignedInt: - case NLGEORGES::UType::Double: - case NLGEORGES::UType::String: - if (parentItem->formElm->isArray()) - { - //((NLGEORGES::CFormElm*)parentItem->formElm);//->arrayInsertNodeByName( - //if(parentItem->formElm->getArrayNode(elmName, num)) - //{ - //} - - bool ok; - // TODO: the node can be renamed from eg "#0" to "foobar" - int arrayIndex = itemData[0].toString().remove("#").toInt(&ok); - if(ok) - { - NLGEORGES::UFormElm *elmt = 0; - if(parentItem->formElm->getArrayNode(&elmt, arrayIndex) && elmt) - { - if (elmt->isAtom()) - { - ((NLGEORGES::CFormElmAtom*)elmt)->setValue(value.toString().toUtf8().constData()); - nldebug(QString("array element string %1 %2") - .arg(itemData[0].toString()).arg(value.toString()) - .toUtf8().constData()); - } - } - } - } - else - { - if(parentItem->formElm->setValueByName( - value.toString().toUtf8().constData(), - itemData[0].toString().toUtf8().constData())) - { - nldebug(QString("string %1 %2") - .arg(itemData[0].toString()).arg(value.toString()) - .toUtf8().constData()); - } - else - { - nldebug(QString("FAILED string %1 %2") - .arg(itemData[0].toString()).arg(value.toString()) - .toUtf8().constData()); - } - } - break; - case NLGEORGES::UType::Color: - nldebug("Color is TODO"); - break; - default: - break; - } - } - } - else - { - nldebug("setting sth other than Atom"); - } - //formElm->setValueByName(); - return true; - } -} diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formitem.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formitem.h deleted file mode 100644 index f440d1cf4..000000000 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formitem.h +++ /dev/null @@ -1,69 +0,0 @@ -// 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 FORMITEM_H -#define FORMITEM_H - -// NeL includes -#include - -// Qt includes -#include -#include - -namespace GeorgesQt -{ - - class CFormItem - - { - public: - CFormItem(NLGEORGES::UFormElm *elm, const QList &data, - CFormItem *parent = 0, - NLGEORGES::UFormElm::TWhereIsValue = NLGEORGES::UFormElm::ValueForm, - NLGEORGES::UFormElm::TWhereIsNode = NLGEORGES::UFormElm::NodeForm); - ~CFormItem(); - - void appendChild(CFormItem *child); - - CFormItem *child(int row); - int childCount() const; - int columnCount() const; - QVariant data(int column) const; - int row() const; - CFormItem *parent(); - bool setData(int column, const QVariant &value); - NLGEORGES::UFormElm* getFormElm() {return formElm;} - NLGEORGES::UFormElm::TWhereIsValue valueFrom() - { - return whereV; - } - NLGEORGES::UFormElm::TWhereIsNode nodeFrom() - { - return whereN; - } - - private: - QList childItems; - QList itemData; - CFormItem *parentItem; - NLGEORGES::UFormElm* formElm; - NLGEORGES::UFormElm::TWhereIsValue whereV; - NLGEORGES::UFormElm::TWhereIsNode whereN; - }; // CFormItem - -} -#endif // FORMITEM_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor.qrc b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor.qrc deleted file mode 100644 index 3d514dbc0..000000000 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - images/ic_nel_georges_editor.png - - diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_treeview_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_treeview_dialog.cpp deleted file mode 100644 index c19a01fd7..000000000 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_treeview_dialog.cpp +++ /dev/null @@ -1,600 +0,0 @@ -// 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" -#include "georges_treeview_dialog.h" -#include "georges.h" -#include "georgesform_model.h" -#include "georgesform_proxy_model.h" -#include "formitem.h" -#include "formdelegate.h" -#include "expandable_headerview.h" - -// Qt includes -#include -#include -#include -#include -#include - -// NeL includes -#include -#include -#include -#include -#include -#include -#include - -// OVQT Includes -#include "../core/icore.h" -#include "../core/core_constants.h" - -using namespace NLMISC; -using namespace NLGEORGES; - -namespace GeorgesQt -{ - - CGeorgesTreeViewDialog::CGeorgesTreeViewDialog(QWidget *parent /*= 0*/) - : QDockWidget(parent), - m_header(0), - m_modified(false) - { - m_georges = new CGeorges; - - loadedForm = ""; - // Set the default sheet dir dir to the level design path. - m_lastSheetDir = "."; - QSettings *settings = Core::ICore::instance()->settings(); - settings->beginGroup(Core::Constants::DATA_PATH_SECTION); - m_lastSheetDir = settings->value(Core::Constants::LEVELDESIGN_PATH, "l:/leveldesign").toString(); - settings->endGroup(); - - m_ui.setupUi(this); - m_header = new ExpandableHeaderView(Qt::Horizontal, m_ui.treeView); - m_ui.treeView->setHeader(m_header); - m_ui.treeView->header()->setResizeMode(QHeaderView::ResizeToContents); - m_ui.treeView->header()->setStretchLastSection(true); - m_ui.treeViewTabWidget->setTabEnabled (2,false); - - m_ui.checkBoxParent->setStyleSheet("background-color: rgba(0,255,0,30)"); - m_ui.checkBoxDefaults->setStyleSheet("background-color: rgba(255,0,0,30)"); - m_form = 0; - - FormDelegate *formdelegate = new FormDelegate(this); - m_ui.treeView->setItemDelegateForColumn(1, formdelegate); - - // Set up custom context menu. - setContextMenuPolicy(Qt::CustomContextMenu); - connect(this, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(showContextMenu(const QPoint&))); - - connect(m_ui.treeView, SIGNAL(doubleClicked (QModelIndex)), - this, SLOT(doubleClicked (QModelIndex))); - connect(m_ui.checkBoxParent, SIGNAL(toggled(bool)), - this, SLOT(filterRows())); - connect(m_ui.checkBoxDefaults, SIGNAL(toggled(bool)), - this, SLOT(filterRows())); - connect(m_header, SIGNAL(headerClicked(int)), - this, SLOT(headerClicked(int))); - } - - CGeorgesTreeViewDialog::~CGeorgesTreeViewDialog() - { - delete m_form; - qDebug() << "DTOR"; - } - - void CGeorgesTreeViewDialog::headerClicked(int section) - { - if (section == 0) - { - if (*(m_header->expanded())) - m_ui.treeView->expandAll(); - else - m_ui.treeView->collapseAll(); - } - } - - void CGeorgesTreeViewDialog::setForm(const CForm *form) - { - m_form = (UForm*)form; - } - - NLGEORGES::CForm* CGeorgesTreeViewDialog::getFormByName(const QString formName) - { - if(NLMISC::CPath::exists(formName.toUtf8().constData())) - { - //NLGEORGES::CForm *form = dynamic_cast(m_georges->loadForm(formName.toUtf8())); - return (NLGEORGES::CForm *)m_georges->loadForm(formName.toUtf8().constData()); - } - //else - //{ - // CForm *form = 0; - // // Load the DFN - // std::string extStr = NLMISC::CFile::getExtension( formName.toUtf8() ); - // QString dfnName = QString("%1.dfn").arg(extStr.c_str()); - // UFormDfn *formdfn; - // if (NLMISC::CPath::exists(dfnName.toUtf8())) - // { - // formdfn = _georges->loadFormDfn (dfnName.toUtf8()); - // if (!formdfn) - // { - // nlwarning("Failed to load dfn: %s", dfnName.toUtf8()); - // return 0; - // } - // } - // else - // { - // nlwarning("Cannot find dfn: %s", dfnName.toUtf8()); - // return 0; - // } - - // form = new CForm; - - // // Build the root element - // ((CFormElmStruct*)&form->getRootNode())->build((CFormDfn*)formdfn); - - // uint i; - // for (i=0; iHeldElements[i]))->build ((CFormDfn*)formdfn); - // } - // return form; - //} - nlinfo("File '%s' does not exist!", formName.toUtf8().constData()); - return 0; - } - - NLGEORGES::CForm* CGeorgesTreeViewDialog::getFormByDfnName(const QString dfnName) - { - if(NLMISC::CPath::exists(dfnName.toUtf8().constData())) - { - // Create a new form object. - NLGEORGES::CForm *form = new NLGEORGES::CForm(); - m_form = form; - - // Retrieve a copy of the root definition. - NLGEORGES::CFormDfn *formDfn = dynamic_cast(m_georges->loadFormDfn(dfnName.toUtf8().constData())); - - // Next we'll use the root node to build a new form. - NLGEORGES::CFormElmStruct *fes = dynamic_cast(getRootNode(0)); - fes->build(formDfn); - - // And then initialize the held elements; - for(uint i = 0; i(getRootNode(i+1)); - fes->build(formDfn); - } - - return form; - } - nlinfo("File '%s' does not exist!", dfnName.toUtf8().constData()); - return NULL; - } - - NLGEORGES::CFormElm *CGeorgesTreeViewDialog::getRootNode(uint slot) - { - NLGEORGES::CForm *form = getFormPtr(); - - if(slot == 0) - { - const NLGEORGES::UFormElm &formElm = form->getRootNode(); - return (NLGEORGES::CFormElm *)&formElm; - } - - // Make sure the slot value is valid and then return the corresponding element. - nlassert(slot < NLGEORGES::CForm::HeldElementCount+1); - return getFormPtr()->HeldElements[slot-1]; - } - - NLGEORGES::CForm *CGeorgesTreeViewDialog::getFormPtr() - { - return dynamic_cast(m_form); - } - - void CGeorgesTreeViewDialog::loadFormIntoDialog(CForm *form) - { - - if(form) - m_form = form; - else - return; - - UFormElm *root = 0; - root = &m_form->getRootNode(); - - QStringList parents; - uint cnt = form->getParentCount(); - for (uint i = 0; i < cnt /*form->getParentCount()*/; i++) - { - UForm *u = m_form->getParentForm(i); - parents << u->getFilename().c_str(); - } - - QString comments; - comments = m_form->getComment().c_str(); - - if (!comments.isEmpty()) - { - m_ui.treeViewTabWidget->setTabEnabled (1,true); - m_ui.commentEdit->setPlainText(comments); - } - - QStringList strList; - std::set dependencies; - m_form->getDependencies(dependencies); - - QMap< QString, QStringList> deps; - Q_FOREACH(std::string str, dependencies) - { - QString file = str.c_str(); - if (str == m_form->getFilename()) continue; - deps[file.remove(0,file.indexOf(".")+1)] << str.c_str(); - } - nlinfo("typ's %d",deps["typ"].count()); - nlinfo("dfn's %d",deps["dfn"].count()); - - //nlwarning(strList.join(";").toUtf8()); - if (root) - { - loadedForm = m_form->getFilename().c_str(); - - CGeorgesFormModel *model = new CGeorgesFormModel(root,deps,comments,parents,m_header->expanded()); - CGeorgesFormProxyModel *proxyModel = new CGeorgesFormProxyModel(); - proxyModel->setSourceModel(model); - m_ui.treeView->setModel(proxyModel); - m_ui.treeView->expandAll(); - // this is a debug output row - m_ui.treeView->hideColumn(3); - - filterRows(); - - // //_ui.treeView->setRowHidden(0,QModelIndex(),true); - connect(model, SIGNAL(dataChanged(const QModelIndex, const QModelIndex)), - this, SLOT(modifiedFile())); - - setWindowTitle(loadedForm); - // //Modules::mainWin().getTabBar(); - } - } - - void CGeorgesTreeViewDialog::addParentForm(QString parentFormNm) - { - // Try to load the form - NLGEORGES::UForm *uParentForm = m_georges->loadForm(parentFormNm.toUtf8().constData()); - NLGEORGES::CForm *parentForm = dynamic_cast(uParentForm); - NLGEORGES::CForm *mainForm = static_cast(m_form); - - CGeorgesFormProxyModel * proxyModel = dynamic_cast(m_ui.treeView->model()); - CGeorgesFormModel *model = dynamic_cast(proxyModel->sourceModel()); - - if(parentForm) - { - if (mainForm != parentForm) - { - // Check it is the same dfn - if (parentForm->Elements.FormDfn == mainForm->Elements.FormDfn) - { - // This is the parent form selector - if(!mainForm->insertParent(mainForm->getParentCount(),parentFormNm.toUtf8(), parentForm)) - nlwarning("Failed to add parent form: %s", parentFormNm.toUtf8().constData()); - else - { - nlinfo("Successfullyadded parent form: %s", parentFormNm.toUtf8().constData()); - model->addParentForm(parentFormNm); - } - } - } - } - } - - void CGeorgesTreeViewDialog::modifiedFile( ) - { - if (!m_modified) - { - m_modified = true; - setWindowTitle(windowTitle() + "*"); - } - Q_EMIT modified(); - } - - void CGeorgesTreeViewDialog::write( ) - { - - NLMISC::COFile file; - std::string s = NLMISC::CPath::lookup(loadedForm.toUtf8().constData(), false); - if(file.open (s)) - { - try - { - // if (loadedForm.contains(".typ")) - // { - // //nlassert (Type != NULL); - - // //// Write the file - // //// Modified ? - // //if (IsModified ()) - // //{ - // // Type->Header.MinorVersion++; - // // flushValueChange (); - // //} - // //Type->write (xmlStream.getDocument (), theApp.Georges4CVS); - // //modify (NULL, NULL, false); - // //flushValueChange (); - // //UpdateAllViews (NULL); - // //return TRUE; - // } - // else if (loadedForm.contains(".dfn")) - // { - // //nlassert (Dfn != NULL); - - // //// Write the file - // //if (IsModified ()) - // //{ - // // Dfn->Header.MinorVersion++; - // // flushValueChange (); - // //} - // //Dfn->write (xmlStream.getDocument (), lpszPathName, theApp.Georges4CVS); - // //modify (NULL, NULL, false); - // //UpdateAllViews (NULL); - // //return TRUE; - // } - // else - // { - nlassert (m_form != NULL); - - // Write the file - // /*if (IsModified ()) - // { - // ((CForm*)(UForm*)Form)->Header.MinorVersion++; - // }*/ - // //((CForm*)(UForm*)Form)->write (xmlStream.getDocument (), lpszPathName, theApp.Georges4CVS); - m_form->write(file); - setWindowTitle(windowTitle().remove("*")); - m_modified = false; - // //if (strcmp (xmlStream.getErrorString (), "") != 0) - // //{ - // // char message[512]; - // // smprintf (message, 512, "Error while saving file: %s", xmlStream.getErrorString ()); - // //theApp.outputError (message); - // //} - // //modify (NULL, NULL, false); - // //flushValueChange (); - // //UpdateAllViews (NULL); - - // // Get the left view - // //CView* pView = getLeftView (); - // } - } - catch (Exception &e) - { - nlerror("Error while loading file: %s", e.what()); - } - } - else - { - nlerror("Can't open the file %s for writing.", s.c_str()); - } - } - - void CGeorgesTreeViewDialog::doubleClicked ( const QModelIndex & index ) - { - // TODO: this is messy :( perhaps this can be done better - CGeorgesFormProxyModel * proxyModel = - dynamic_cast(m_ui.treeView->model()); - CGeorgesFormModel *model = - dynamic_cast(proxyModel->sourceModel()); - QModelIndex sourceIndex = proxyModel->mapToSource(index); - - CFormItem *item = model->getItem(sourceIndex); - - if (item->parent() && item->parent()->data(0) == "parents") - { - Q_EMIT changeFile(CPath::lookup(item->data(0).toString().toUtf8().constData(),false).c_str()); - } - - //// col containing additional stuff like icons - //if (index.column() == 2) - //{ - // QModelIndex in2 = m->index(in.row(),in.column()-1,in.parent()); - // CFormItem *item = m->getItem(in2); - // QString value = item->data(1).toString(); - - // QString path = CPath::lookup(value.toUtf8(),false).c_str(); - - // if(value.contains(".tga") || value.contains(".png")) - // { - // QString file = QFileDialog::getOpenFileName( - // this, - // "Select a new image", - // path, - // "Images (*.png *.tga)" - // ); - // if (file.isNull()) - // return; - // QFileInfo info = QFileInfo(file); - - // // TODO? - // // right way would be another delegate but im too lazy :) - // // so for now i just call it directly - // m->setData(in2, info.fileName()); - // return; - // } - // else - // { - // if (path.contains(".shape") || path.contains(".ps")) - // { - // if (Modules::objViewInt()) - // { - // Modules::objViewInt()->resetScene(); - // //Modules::config().configRemapExtensions(); - // Modules::objViewInt()->loadMesh(path.toUtf8(),""); - // } - // return; - // } - // } - - // // open eg parent files - // if (!path.isEmpty()) - // Q_EMIT changeFile(path); - - //} - } - - void CGeorgesTreeViewDialog::closeEvent(QCloseEvent *event) - { - Q_EMIT closing(); - deleteLater(); - } - - void CGeorgesTreeViewDialog::checkVisibility(bool visible) { - // this prevents invisible docks from getting tab focus - qDebug() << "checkVisibility" << visible; - setEnabled(visible); - //if (visible) - Q_EMIT modified(); - } - - void CGeorgesTreeViewDialog::filterRows() - { - CGeorgesFormProxyModel * mp = dynamic_cast(m_ui.treeView->model()); - CGeorgesFormModel *m = dynamic_cast(mp->sourceModel()); - if (m) { - m->setShowParents(m_ui.checkBoxParent->isChecked()); - m->setShowDefaults(m_ui.checkBoxDefaults->isChecked()); - } - } - - void CGeorgesTreeViewDialog::showContextMenu(const QPoint &pos) - { - QMenu contextMenu; - QMenu *structContext = NULL; - QPoint globalPos = this->mapToGlobal(pos); - - // Fisrt we're going to see if we've right clicked on a new item and select it. - const QModelIndex &index = this->m_ui.treeView->currentIndex(); - - if(!index.isValid()) - return; - - CGeorgesFormProxyModel * mp = dynamic_cast(m_ui.treeView->model()); - CGeorgesFormModel *m = dynamic_cast(mp->sourceModel()); - QModelIndex sourceIndex = mp->mapToSource(index); - - if (m) - { - - CFormItem *item = m->getItem(sourceIndex); - - // Right click on the "parents" item - if (item->data(0) == "parents") - contextMenu.addAction("Add parent..."); - // Right click on a parent item - else if(item->parent() && item->parent()->data(0) == "parents") - { - contextMenu.addAction("Add parent..."); - contextMenu.addAction("Remove parent"); - } - else if(item->getFormElm()->isArray()) - contextMenu.addAction("Add array entry..."); - else if(item->getFormElm()->isStruct()) - { - QMenu *structContext = new QMenu("Add struct element...", this); - contextMenu.addMenu(structContext); - - NLGEORGES::UFormDfn *defn = item->getFormElm()->getStructDfn(); - if(defn) - { - for(uint defnNum=0; defnNum < defn->getNumEntry(); defnNum++) - { - std::string entryName; - std::string dummy; - UFormElm::TWhereIsValue *whereV = new UFormElm::TWhereIsValue; - bool result = defn->getEntryName(defnNum, entryName); - bool result2 = item->getFormElm()->getValueByName(dummy, entryName.c_str(), NLGEORGES::UFormElm::Eval, whereV); - - - if(result2 && *whereV != UFormElm::ValueForm) - { - structContext->addAction(entryName.c_str()); - } - delete whereV; - } - } - } - else if(item->getFormElm()->isAtom() && item->valueFrom() == NLGEORGES::UFormElm::ValueForm) - contextMenu.addAction("Revert to parent/default..."); - - QAction *selectedItem = contextMenu.exec(globalPos); - if(selectedItem) - { - if(selectedItem->text() == "Add parent...") - { - // Get the file extension of the form so we can build a dialog pattern. - QString file = m_form->getFilename().c_str(); - file = file.remove(0,file.indexOf(".")+1); - QString filePattern = "Parent Sheets (*."+file+")"; - - nlinfo("parent defn name '%s'", file.toUtf8().constData()); - QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Select parent sheets..."), m_lastSheetDir, filePattern); - if(!fileNames.isEmpty()) - { - Q_FOREACH(QString fileToParent, fileNames) - { - // Get just the filename. Georges doesn't want the path. - QFileInfo pathInfo( fileToParent ); - QString tmpFileName( pathInfo.fileName() ); - - nlinfo("requesting to add parent form '%s'", tmpFileName.toUtf8().constData()); - - // Call to add the form and load it into the Georges form. - addParentForm(tmpFileName); - - // Save the file lookup path for future dialog boxes. - m_lastSheetDir = pathInfo.absolutePath(); - } - } - m_ui.treeView->expandAll(); - } - else if(selectedItem->text() == "Remove parent") - { - NLGEORGES::CForm *form = static_cast(m_form); - QString parentFileName = item->data(0).toString(); - - for(uint num = 0; num < form->getParentCount(); num++) - { - QString curParentName = form->getParent(num)->getFilename().c_str(); - if(parentFileName == curParentName) - { - form->removeParent(num); - m->removeParentForm(parentFileName); - break; - } - } - - m_ui.treeView->expandAll(); - } - - } // if selected context menu item is valid. - } // if 'm' model valid. - - if(structContext) - delete structContext; - } - -} /* namespace GeorgesQt */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_treeview_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_treeview_form.ui deleted file mode 100644 index 8d53bfdd6..000000000 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_treeview_form.ui +++ /dev/null @@ -1,133 +0,0 @@ - - - CGeorgesTreeViewDialog - - - - 0 - 0 - 400 - 300 - - - - - 0 - 0 - - - - - 199 - 165 - - - - Qt::NoFocus - - - - - - - - - - QTabWidget::West - - - 0 - - - - Qt::NoFocus - - - Form - - - - 0 - - - - - - 0 - 0 - - - - - 0 - 0 - - - - true - - - - - - - Parent - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Defaults - - - - - - - - Comment - - - - - - false - - - - - - - - Log - - - - - - - - - - - - - - - - - diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_model.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_model.cpp deleted file mode 100644 index dd0220bbf..000000000 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_model.cpp +++ /dev/null @@ -1,704 +0,0 @@ -// 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" -#include "georgesform_model.h" -#include "formitem.h" - -// NeL includes -#include -#include -#include -#include -#include -#include - -// Qt includes -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace NLGEORGES; - -namespace GeorgesQt -{ - - CGeorgesFormModel::CGeorgesFormModel(UFormElm *rootElm, QMap< QString, QStringList> deps, - QString comment, QStringList parents, bool *expanded, QObject *parent) : QAbstractItemModel(parent) - { - - m_rootData << "Value" << "Data" << "Extra";// << "Type"; - m_rootElm = rootElm; - m_rootItem = new CFormItem(m_rootElm, m_rootData); - m_dependencies = deps; - m_comments = comment; - m_parents = parents; - m_parentRows = new QList; - m_expanded = expanded; - - setupModelData(); - } - - CGeorgesFormModel::~CGeorgesFormModel() - { - delete m_rootItem; - } - - /******************************************************************************/ - - QVariant CGeorgesFormModel::data(const QModelIndex &p_index, int p_role) const - { - if (!p_index.isValid()) - return QVariant(); - - switch (p_role) - { - case Qt::DisplayRole: - { - return getItem(p_index)->data(p_index.column()); - } - case Qt::BackgroundRole: - { - QBrush defaultBrush = QBrush(QColor(255,0,0,30)); - QBrush parentBrush = QBrush(QColor(0,255,0,30)); - - // if elm not existing it must be some kind of default or type value - if(!getItem(p_index)->getFormElm()) - { - return defaultBrush; - } - - // else it might be some parent elm - switch (getItem(p_index)->nodeFrom()) - { - case NLGEORGES::UFormElm::NodeParentForm: - { - return parentBrush; - } - case NLGEORGES::UFormElm::NodeForm: - { - switch (getItem(p_index)->valueFrom()) - { - case NLGEORGES::UFormElm::ValueParentForm: - { - return parentBrush; - } - default: - { - // parent status test kindof ugly, testing only 2 steps deep - // only needed for colorization as treeview default hides childs - // when parent is hidden - CFormItem *parent = getItem(p_index)->parent(); - if (parent) - { - if (parent->nodeFrom() == NLGEORGES::UFormElm::NodeParentForm) - { - return parentBrush; - } - - CFormItem *parentParent = parent->parent(); - if (parentParent) - { - if (parentParent->nodeFrom() == NLGEORGES::UFormElm::NodeParentForm) - { - return parentBrush; - } - } // endif parentParent - } // endif parent - } // end default - } // end switch valueFrom - } // end case nodeForm - } // end switch nodeFrom - return QVariant(); - } - case Qt::DecorationRole: - { - if (p_index.column() == 2) - { - //p_index. - QModelIndex in = index(p_index.row(),p_index.column()-1,p_index.parent()); - CFormItem *item = getItem(in); - - QString value = item->data(1).toString(); - //QString path = NLMISC::CPath::lookup(value.toUtf8().constData(),false).c_str(); - - /*if (value.contains(".shape")) - { - if (Modules::objViewInt()) - { - QIcon *icon = Modules::objViewInt()->saveOneImage(value.toUtf8().constData()); - if (icon) - { - if(icon->isNull()) - return QIcon(":/images/pqrticles.png"); - else - return QIcon(*icon); - } - else - { - return QIcon(); - } - } - }*/ - if(value.contains(".tga") || value.contains(".png")) - { - QString path = NLMISC::CPath::lookup(value.toUtf8().constData(),false).c_str(); - if(path.isEmpty()) - { - path = ":/images/pqrticles.png"; - } - return QIcon(path); - } - } - return QVariant(); - break; - } - case Qt::ToolTipRole: - { - if (p_index.column() == 2) - { - QModelIndex in = index(p_index.row(),p_index.column()-1,p_index.parent()); - CFormItem *item = getItem(in); - QString value = item->data(1).toString(); - - /*if (value.contains(".shape")) - { - if (Modules::objViewInt()) - { - QIcon *icon = Modules::objViewInt()->saveOneImage(value.toUtf8().constData()); - if (icon) - { - if(icon->isNull()) - return QIcon(":/images/pqrticles.png"); - else - return QIcon(*icon); - } - else - { - return QIcon(); - } - } - }*/ - if(value.contains(".tga") || value.contains(".png")) - { - QString path = NLMISC::CPath::lookup(value.toUtf8().constData(),false).c_str(); - if(path.isEmpty()) - { - path = ":/images/pqrticles.png"; - } - - QString imageTooltip = QString("").arg(path); - - return imageTooltip; - } - } - return QVariant(); - break; - } - default: - return QVariant(); - } - } - - /******************************************************************************/ - - CFormItem *CGeorgesFormModel::getItem(const QModelIndex &index) const - { - if (index.isValid()) - { - CFormItem *item = static_cast(index.internalPointer()); - if (item) - return item; - } - return m_rootItem; - } - - /******************************************************************************/ - - bool CGeorgesFormModel::setData(const QModelIndex &index, const QVariant &value, - int role) - { - - if (role != Qt::EditRole) - return false; - - CFormItem *item = getItem(index); - bool result = item->setData(index.column(), value); - - Q_EMIT dataChanged(index, index); - - //setupModelData(); - return result; - } - - /******************************************************************************/ - - Qt::ItemFlags CGeorgesFormModel::flags(const QModelIndex& index) const { - - if (!index.isValid()) - return 0; - - Qt::ItemFlags returnValue = Qt::ItemIsSelectable | Qt::ItemIsEnabled; - - if(index.column() == 1) - returnValue |= Qt::ItemIsEditable; - - return returnValue; - - } - - /******************************************************************************/ - - QVariant CGeorgesFormModel::headerData(int section, - Qt::Orientation orientation, int role) const - { - if (orientation == Qt::Horizontal) - { - if (role == Qt::DisplayRole) - return m_rootItem->data(section); - if (role == Qt::TextAlignmentRole) - return Qt::AlignLeft; - if (section == 0 && role == Qt::DecorationRole) - { - // transparent pixmap as we paint it ourself with tree brach - // if we extend the HeaderView::paintSection for the CE_HeaderLabel - // we could drop this - QPixmap pixmap = QPixmap( - QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize), - QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize)); - // Create new picture for transparent - QPixmap transparent(pixmap.size()); - - // Do transparency - transparent.fill(Qt::transparent); - QPainter p(&transparent); - p.setCompositionMode(QPainter::CompositionMode_Source); - p.drawPixmap(0, 0, pixmap); - p.setCompositionMode(QPainter::CompositionMode_DestinationIn); - // Set transparency level to 150 (possible values are 0-255) - // The alpha channel of a color specifies the transparency effect, - // 0 represents a fully transparent color, while 255 represents - // a fully opaque color. - p.fillRect(transparent.rect(), QColor(0, 0, 0, 0)); - p.end(); - - // Set original picture's reference to new transparent one - pixmap = transparent; - return pixmap; - } - } - return QVariant(); - } - - /******************************************************************************/ - - QModelIndex CGeorgesFormModel::index(int row, int column, const QModelIndex &parent) - const - { - if (!hasIndex(row, column, parent)) - return QModelIndex(); - - CFormItem *parentItem; - - if (!parent.isValid()) - parentItem = m_rootItem; - else - parentItem = static_cast(parent.internalPointer()); - - CFormItem *childItem = parentItem->child(row); - if (childItem) - return createIndex(row, column, childItem); - else - return QModelIndex(); - } - - /******************************************************************************/ - - QModelIndex CGeorgesFormModel::parent(const QModelIndex &index) const - { - if (!index.isValid()) - return QModelIndex(); - - CFormItem *childItem = static_cast(index.internalPointer()); - CFormItem *parentItem = childItem->parent(); - - if (parentItem == m_rootItem) - return QModelIndex(); - - return createIndex(parentItem->row(), 0, parentItem); - } - - /******************************************************************************/ - - int CGeorgesFormModel::rowCount(const QModelIndex &parent) const { - - CFormItem *parentItem; - if (parent.column() > 0) - return 0; - - if (!parent.isValid()) - parentItem = m_rootItem; - else - parentItem = static_cast(parent.internalPointer()); - - return parentItem->childCount(); - - } - - /******************************************************************************/ - - int CGeorgesFormModel::columnCount(const QModelIndex &parent) const { - - if (parent.isValid()) - return static_cast(parent.internalPointer())->columnCount(); - else - return m_rootItem->columnCount(); - - } - - /******************************************************************************/ - - void CGeorgesFormModel::loadFormData(UFormElm *root, CFormItem *parent) { - - if (!root) - return; - - uint num = 0; - - - if (root->isStruct()) - { - //((CFormElm*)root)->getForm()->getComment(); - uint structSize = 0; - root->getStructSize(structSize); - while (num < structSize) - { - UFormElm::TWhereIsNode *whereN = new UFormElm::TWhereIsNode; - UFormElm::TWhereIsValue *whereV = new UFormElm::TWhereIsValue; - // Append a new item to the current parent's list of children. - std::string elmName; - if(root->getStructNodeName(num, elmName)) - { - QList columnData; - //QVariant value; - std::string value; - //NLMISC::CRGBA value_color; - //uint value_uint; - //sint value_sint; - //double value_double; - QString elmtType; - UFormElm *elmt = 0; - if(root->getNodeByName(&elmt, elmName.c_str(), whereN, true)) - { - if (elmt) - { - if (elmt->isArray()) - elmtType = "Array"; - if (elmt->isStruct()) - elmtType = "Struct"; - if (elmt->isAtom()) - { - elmtType = "Atom"; - uint numDefinitions = 0; - const UType *type = elmt->getType(); - if (type) - { - numDefinitions = type->getNumDefinition(); - root->getValueByName(value, elmName.c_str(),UFormElm::Eval,whereV); - switch (type->getType()) - { - case UType::UnsignedInt: - { - uint v; - NLMISC::fromString(value, v); - value = NLMISC::toString(v); - elmtType.append("_uint");break; - } - case UType::SignedInt: - { - sint v; - NLMISC::fromString(value, v); - value = NLMISC::toString(v); - elmtType.append("_sint");break; - } - case UType::Double: - float v; - NLMISC::fromString(value, v); - value = NLMISC::toString(v); - elmtType.append("_double");break; - case UType::String: - elmtType.append("_string");break; - case UType::Color: - elmtType.append("_color");break; - default: - elmtType.append("_unknownType"); - } - } - else - { - elmtType.append("_noType"); - } - - if (numDefinitions) - { - std::string l, v; - QString tmpLabel, tmpValue; - for (uint i = 0; i < numDefinitions; i++) - { - type->getDefinition(i,l,v); - tmpLabel = l.c_str(); - tmpValue = v.c_str(); - if (type->getType() == UType::SignedInt) - { - if (QString("%1").arg(value.c_str()).toDouble() == tmpValue.toDouble()) { - value = l; - break; - } - } - if (type->getType() == UType::String) - { - if (QString(value.c_str()) == tmpValue) - { - value = l; - break; - } - } - } - } - } - if (elmt->isVirtualStruct()) - { - root->getValueByName(value, elmName.c_str(),UFormElm::Eval,whereV); - elmtType = "VirtualStruct"; - } - switch (*whereN) - { - case UFormElm::NodeForm: - elmtType.append("_fromForm"); break; - case UFormElm::NodeParentForm: - elmtType.append("_fromParentForm"); break; - case UFormElm::NodeDfn: - elmtType.append("_isDFN"); break; - case UFormElm::NodeType: - elmtType.append("_isType"); break; - default: - elmtType.append("_noNode"); - } - switch (*whereV) - { - case UFormElm::ValueForm: - elmtType.append("_formValue"); break; - case UFormElm::ValueParentForm: - elmtType.append("_parentValue"); break; - case UFormElm::ValueDefaultDfn: - elmtType.append("_dfnValue"); break; - case UFormElm::ValueDefaultType: - elmtType.append("_typeValue"); break; - default: - elmtType.append("_noValue"); - } - columnData << QString(elmName.c_str()) << QString(value.c_str()) << "";// << elmtType; - parent->appendChild(new CFormItem(elmt, columnData, parent, *whereV, *whereN)); - //if (parents.last()->childCount() > 0) { - // parents << parents.last()->child(parents.last()->childCount()-1); - //} - loadFormData(elmt, parent->child(parent->childCount()-1)); - } - else - { - // add Defaults - // TODO: spams warnings for non ATOM values but i dont get type of non existing nodes - bool success = root->getValueByName(value, elmName.c_str(),UFormElm::Eval,whereV); - switch (*whereN) - { - case UFormElm::NodeForm: - elmtType.append("_fromForm"); break; - case UFormElm::NodeParentForm: - elmtType.append("_fromParentForm"); break; - case UFormElm::NodeDfn: - elmtType.append("_isDFN"); break; - case UFormElm::NodeType: - elmtType.append("_isType"); break; - default: - elmtType.append("_noNode"); - } - switch (*whereV) - { - case UFormElm::ValueForm: - elmtType.append("_formValue"); break; - case UFormElm::ValueParentForm: - elmtType.append("_parentValue"); break; - case UFormElm::ValueDefaultDfn: - elmtType.append("_dfnValue"); break; - case UFormElm::ValueDefaultType: - elmtType.append("_typeValue"); break; - default: - elmtType.append("_noValue"); - } - - columnData << QString(elmName.c_str()) << QString(value.c_str()) << "";// << elmtType; - parent->appendChild(new CFormItem(elmt, columnData, parent, *whereV, *whereN)); - } - } - else - { - nlinfo("getNodeByName returned false"); - } - } - num++; - } - } - if (root->isArray()) - { - uint arraySize = 0; - root->getArraySize(arraySize); - while (num < arraySize) - { - std::string elmName; - if(root->getArrayNodeName(elmName, num)) - { - QList columnData; - std::string value; - QString elmtType; - - UFormElm *elmt = 0; - if(root->getArrayNode(&elmt,0) && elmt) - { - if (elmt->isArray()) - elmtType = "Array"; - if (elmt->isStruct()) { - elmtType = "Struct"; - } - if (elmt->isAtom()) - { - elmt->getValue(value); - elmtType = "Atom"; - } - if (elmt->isVirtualStruct()) - elmtType = "VirtualStruct"; - - elmtType.append("_arrayValue"); - columnData << QString(elmName.c_str()) << QString(value.c_str()) << "";// << elmtType; - parent->appendChild(new CFormItem(elmt, columnData, parent)); - loadFormData(elmt, parent->child(parent->childCount()-1)); - } - } - num++; - } - } - } - - /******************************************************************************/ - - void CGeorgesFormModel::loadFormHeader() - { - - if (m_parents.size()) - { - CFormItem *fi_pars = new CFormItem(m_rootElm, QList() << "parents" << "" << "", m_rootItem); - m_rootItem->appendChild(fi_pars); - - Q_FOREACH(QString str, m_parents) - { - fi_pars->appendChild(new CFormItem(m_rootElm, QList() << str << "" << "", fi_pars)); - } - } - - /*QStringList dfns = _dependencies["dfn"]; - QStringList typs = _dependencies["typ"]; - - _dependencies.remove("dfn"); - _dependencies.remove("typ"); - - CFormItem *fi_dep = new CFormItem(_rootElm, QList() << "dependencies", _rootItem); - _rootItem->appendChild(fi_dep); - - if (!dfns.isEmpty()) { - CFormItem *fi_dfn = new CFormItem(_rootElm, QList() << "dfn", fi_dep); - fi_dep->appendChild(fi_dfn); - foreach(QString str, dfns) { - fi_dfn->appendChild(new CFormItem(_rootElm, QList() << str, fi_dfn)); - } - } - if (!typs.isEmpty()) { - CFormItem *fi_typ = new CFormItem(_rootElm, QList() << "typ", fi_dep); - fi_dep->appendChild(fi_typ); - foreach(QString str, typs) { - fi_typ->appendChild(new CFormItem(_rootElm, QList() << str, fi_typ)); - } - } - if (!_dependencies.isEmpty()) { - CFormItem *fi_other = new CFormItem(_rootElm, QList() << "other", fi_dep); - fi_dep->appendChild(fi_other); - foreach(QStringList list, _dependencies) { - foreach(QString str, list) { - fi_other->appendChild(new CFormItem(_rootElm, QList() << str, fi_other)); - } - } - }*/ - } - - /******************************************************************************/ - - void CGeorgesFormModel::setupModelData() - { - loadFormHeader(); - loadFormData(m_rootElm, m_rootItem); - } - - /******************************************************************************/ - - void CGeorgesFormModel::setShowParents( bool show ) { - m_showParents = show; - Q_EMIT layoutAboutToBeChanged(); - Q_EMIT layoutChanged(); - } - void CGeorgesFormModel::setShowDefaults( bool show ) - { - m_showDefaults = show; - Q_EMIT layoutAboutToBeChanged(); - Q_EMIT layoutChanged(); - } - - void CGeorgesFormModel::addParentForm(QString parentForm) - { - beginResetModel(); - m_parents.push_back(parentForm); - delete m_rootItem; - m_rootItem = new CFormItem(m_rootElm, m_rootData); - setupModelData(); - endResetModel(); - } - - void CGeorgesFormModel::removeParentForm(QString parentForm) - { - beginResetModel(); - m_parents.removeOne(parentForm); - - delete m_rootItem; - m_rootItem = new CFormItem(m_rootElm, m_rootData); - setupModelData(); - endResetModel(); - } -} /* namespace GeorgesQt */ - -/* end of file */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/nel3d_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/nel3d_widget.cpp deleted file mode 100644 index 3fd7abb7b..000000000 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/nel3d_widget.cpp +++ /dev/null @@ -1,174 +0,0 @@ -// Object Viewer Qt GUI Editor plugin -// 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 "nel3d_widget.h" -#include "nel/3d/u_driver.h" -#include "nel/3d/text_context.h" -#include "nel/3d/driver_user.h" -#include "nel/misc/rgba.h" -#include "nel/misc/path.h" -#include "nel/misc/event_listener.h" -#include "nel/gui/event_listener.h" - -#ifdef NL_OS_WINDOWS -#include -#endif - - - -namespace GUIEditor -{ - Nel3DWidget::Nel3DWidget( QWidget *parent ) : - QWidget( parent ) - { - driver = NULL; - textContext = NULL; - - // Need to set this attribute with a NULL paintengine returned to Qt - // so that we can render the widget normally ourselves, without the image - // disappearing when a widget is resized or shown on top of us - setAttribute( Qt::WA_PaintOnScreen, true ); - eventListener = NULL; - } - - Nel3DWidget::~Nel3DWidget() - { - if( driver != NULL ) - { - if( textContext != NULL ) - { - driver->deleteTextContext( textContext ); - textContext = NULL; - } - - driver->release(); - delete driver; - driver = NULL; - } - delete eventListener; - } - - void Nel3DWidget::init() - { - nlassert( driver == NULL ); - - driver = NL3D::UDriver::createDriver( 0, false, 0 ); - driver->setMatrixMode2D11(); - driver->setDisplay( winId(), NL3D::UDriver::CMode( width(), height(), 32, true ) ); - eventListener = new NLGUI::CEventListener(); - eventListener->addToServer( &driver->EventServer ); - } - - void Nel3DWidget::createTextContext( std::string fontFile ) - { - if( driver == NULL ) - return; - - std::string font; - - try - { - font = NLMISC::CPath::lookup( fontFile ); - } - catch( ... ) - { - nlinfo( "Font %s cannot be found, cannot create textcontext!", fontFile.c_str() ); - exit( EXIT_FAILURE ); - } - - if( textContext != NULL ) - { - driver->deleteTextContext( textContext ); - textContext = NULL; - } - - textContext = driver->createTextContext( font ); - } - - void Nel3DWidget::clear() - { - if( driver == NULL ) - return; - driver->clearBuffers( NLMISC::CRGBA::Black ); - driver->swapBuffers(); - } - - -#if defined ( NL_OS_WINDOWS ) - - typedef bool ( *winProc )( NL3D::IDriver *driver, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ); - - bool Nel3DWidget::winEvent( MSG *message, long *result ) - { - if( driver != NULL ) - { - NL3D::IDriver *iDriver = dynamic_cast< NL3D::CDriverUser* >( driver )->getDriver(); - if( iDriver != NULL ) - { - winProc proc = (winProc)iDriver->getWindowProc(); - return proc( iDriver, message->hwnd, message->message, message->wParam, message->lParam ); - } - } - - return false; - } - -#elif defined( NL_OS_MAC ) - - typedef bool ( *cocoaProc )( NL3D::IDriver *, const void *e ); - - bool Nel3DWidget::macEvent( EventHandlerCallRef caller, EventRef event ) - { - if( caller ) - nlerror( "You are using QtCarbon! Only QtCocoa supported, please upgrade Qt" ); - - if( driver != NULL ) - { - NL3D::IDriver *iDriver = dynamic_cast< NL3D::CDriverUser* >( driver )->getDriver(); - if( iDriver != NULL ) - { - cocoaProc proc = ( cocoaProc )iDriver->getWindowProc(); - return proc( iDriver, event ); - } - } - - return false; - } - -#elif defined( NL_OS_UNIX ) - - typedef bool ( *x11Proc )( NL3D::IDriver *drv, XEvent *e ); - - bool Nel3DWidget::x11Event( XEvent *event ) - { - if( driver != NULL ) - { - NL3D::IDriver *iDriver = dynamic_cast< NL3D::CDriverUser* >( driver )->getDriver(); - if( driver != NULL ) - { - x11Proc proc = ( x11Proc )iDriver->getWindowProc(); - return proc( iDriver, event ); - } - } - - return false; - } -#endif - -} - - diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/nel3d_widget.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/nel3d_widget.h deleted file mode 100644 index fb4321d49..000000000 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/nel3d_widget.h +++ /dev/null @@ -1,79 +0,0 @@ -// Object Viewer Qt GUI Editor plugin -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - - -#ifndef NEL3D_WIDGET_H -#define NEL3D_WIDGET_H - -#include -#include "nel/misc/types_nl.h" -#include - -namespace NLGUI -{ - class CEventListener; -} - -namespace NL3D -{ - class UDriver; - class UTextContext; -} - -namespace GUIEditor -{ - /// Nel 3D interface to Qt - class Nel3DWidget : public QWidget - { - Q_OBJECT - public: - Nel3DWidget( QWidget *parent = NULL ); - virtual ~Nel3DWidget(); - - virtual void init(); - void createTextContext( std::string fontFile ); - - NL3D::UDriver* getDriver() const{ return driver; } - NL3D::UTextContext* getTextContext() const{ return textContext; } - - - // Need to return NULL paintengine to Qt so that we can - // render the widget normally ourselves, without the image - // disappearing when a widget is resized or shown on top of us - QPaintEngine* paintEngine() const{ return NULL; } - - public Q_SLOTS: - void clear(); - - protected: - -#if defined(NL_OS_WINDOWS) - virtual bool winEvent( MSG *message, long *result ); -#elif defined(NL_OS_MAC) - virtual bool macEvent( EventHandlerCallRef caller, EventRef event ); -#elif defined(NL_OS_UNIX) - virtual bool x11Event( XEvent *event ); -#endif - - private: - NL3D::UDriver *driver; - NL3D::UTextContext *textContext; - NLGUI::CEventListener *eventListener; - }; -} - -#endif - diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/property_browser_ctrl.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/property_browser_ctrl.cpp deleted file mode 100644 index 82330bfaf..000000000 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/property_browser_ctrl.cpp +++ /dev/null @@ -1,173 +0,0 @@ -// Object Viewer Qt GUI Editor plugin -// 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 "property_browser_ctrl.h" -#include "../../3rdparty/qtpropertybrowser/QtVariantPropertyManager" -#include "../../3rdparty/qtpropertybrowser/QtTreePropertyBrowser" -#include "nel/gui/interface_group.h" -#include "nel/gui/widget_manager.h" -#include -#include "widget_info_tree.h" - -namespace GUIEditor -{ - CPropBrowserCtrl::CPropBrowserCtrl() - { - browser = NULL; - propertyMgr = new QtVariantPropertyManager; - } - - CPropBrowserCtrl::~CPropBrowserCtrl() - { - delete propertyMgr; - propertyMgr = NULL; - browser = NULL; - } - - void CPropBrowserCtrl::setBrowser( QtTreePropertyBrowser *b ) - { - browser = b; - } - - void CPropBrowserCtrl::setupWidgetInfo( CWidgetInfoTree *tree ) - { - widgetInfo.clear(); - - std::vector< std::string > names; - tree->getNames( names ); - - std::vector< std::string >::const_iterator itr; - for( itr = names.begin(); itr != names.end(); ++itr ) - { - CWidgetInfoTreeNode *node = tree->findNodeByName( *itr ); - const SWidgetInfo &w = node->getInfo(); - widgetInfo[ w.GUIName ] = w; - } - } - - void CPropBrowserCtrl::clear() - { - browser->clear(); - disconnect( propertyMgr, SIGNAL( propertyChanged( QtProperty* ) ), - this, SLOT( onPropertyChanged( QtProperty* ) ) ); - } - - void CPropBrowserCtrl::onSelectionChanged( std::string &id ) - { - if( browser == NULL ) - return; - - disconnect( propertyMgr, SIGNAL( propertyChanged( QtProperty* ) ), - this, SLOT( onPropertyChanged( QtProperty* ) ) ); - - browser->clear(); - - CInterfaceElement *e = CWidgetManager::getInstance()->getElementFromId( id ); - if( e == NULL ) - { - connect( propertyMgr, SIGNAL( propertyChanged( QtProperty* ) ), - this, SLOT( onPropertyChanged( QtProperty* ) ) ); - - return; - } - - currentElement = id; - - std::string n = e->getClassName(); - - setupProperties( n, e ); - connect( propertyMgr, SIGNAL( propertyChanged( QtProperty* ) ), - this, SLOT( onPropertyChanged( QtProperty* ) ) ); - } - - void CPropBrowserCtrl::onPropertyChanged( QtProperty *prop ) - { - QString propName = prop->propertyName(); - QString propValue = prop->valueText(); - - // for some reason booleans cannot be extracted from a QtProperty :( - if( propValue.isEmpty() ) - { - QtVariantProperty *p = propertyMgr->variantProperty( prop ); - if( p != NULL ) - propValue = p->value().toString(); - } - - CInterfaceElement *e = CWidgetManager::getInstance()->getElementFromId( currentElement ); - if( e == NULL ) - return; - e->setProperty( propName.toUtf8().constData(), propValue.toUtf8().constData() ); - - - // Make sure the changes are applied - bool active = e->getActive(); - e->setActive( !active ); - e->setActive( active ); - } - - void CPropBrowserCtrl::setupProperties( const std::string &type, const CInterfaceElement *element ) - { - std::map< std::string, SWidgetInfo >::iterator itr = widgetInfo.find( type ); - if( itr == widgetInfo.end() ) - return; - SWidgetInfo &w = itr->second; - - std::vector< SPropEntry >::const_iterator pItr; - for( pItr = w.props.begin(); pItr != w.props.end(); ++pItr ) - { - const SPropEntry &prop = *pItr; - setupProperty( prop, element ); - } - - QtVariantEditorFactory *factory = new QtVariantEditorFactory; - browser->setFactoryForManager( propertyMgr, factory ); - } - - void CPropBrowserCtrl::setupProperty( const SPropEntry &prop, const CInterfaceElement *element ) - { - QtVariantProperty *p = NULL; - QVariant v; - - if( prop.propType == "string" ) - { - p = propertyMgr->addProperty( QVariant::String, prop.propName.c_str() ); - v = element->getProperty( prop.propName ).c_str(); - } - else - if( prop.propType == "bool" ) - { - p = propertyMgr->addProperty( QVariant::Bool, prop.propName.c_str() ); - bool value = false; - NLMISC::fromString( element->getProperty( prop.propName ), value ); - v = value; - } - else - if( prop.propType == "int" ) - { - p = propertyMgr->addProperty( QVariant::Int, prop.propName.c_str() ); - sint32 value = 0; - NLMISC::fromString( element->getProperty( prop.propName ), value ); - v = value; - } - - if( p == NULL ) - return; - - p->setValue( v ); - browser->addProperty( p ); - } -} diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_viewport.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_viewport.cpp deleted file mode 100644 index d8e36e785..000000000 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_viewport.cpp +++ /dev/null @@ -1,195 +0,0 @@ -/* - Object Viewer Qt - Copyright (C) 2010 Dzmitry Kamiahin - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -*/ - -#include "stdpch.h" -#include "graphics_viewport.h" - -// STL includes - -// Qt includes -#include -#include -#include -#include - -// NeL includes -#include - -#include -#include - -#include -#include - -// Project includes -#include "modules.h" - -using namespace std; -using namespace NL3D; - -namespace NLQT -{ - -CGraphicsViewport::CGraphicsViewport(QWidget *parent) - : QNLWidget(parent) -{ - setAttribute(Qt::WA_OpaquePaintEvent); - setAttribute(Qt::WA_NoSystemBackground); - setAttribute(Qt::WA_PaintOnScreen); -} - -CGraphicsViewport::~CGraphicsViewport() -{ - -} - -void CGraphicsViewport::init() -{ - //H_AUTO2 - nldebug("CGraphicsViewport::init"); - -#if defined(NL_OS_UNIX) && !defined(NL_OS_MAC) - makeCurrent(); -#endif // defined(NL_OS_UNIX) && !defined(NL_OS_MAC) - - Modules::objView().init((nlWindow)winId(), width(), height()); - Modules::psEdit().init(); - Modules::veget().init(); - - setMouseTracking(true); - setFocusPolicy(Qt::StrongFocus); -} - -void CGraphicsViewport::release() -{ - //H_AUTO2 - nldebug("CGraphicsViewport::release"); - - Modules::veget().release(); - Modules::psEdit().release(); - Modules::objView().release(); -} - - -QAction *CGraphicsViewport::createSaveScreenshotAction(QObject *parent) -{ - QAction *action = new QAction(parent); - connect(action, SIGNAL(triggered()), this, SLOT(saveScreenshot())); - return action; -} - -QAction *CGraphicsViewport::createSetBackgroundColor(QObject *parent) -{ - QAction *action = new QAction(parent); - connect(action, SIGNAL(triggered()), this, SLOT(setBackgroundColor())); - return action; -} - -void CGraphicsViewport::saveScreenshot() -{ - Modules::objView().saveScreenshot("screenshot", false, true, false); -} - -void CGraphicsViewport::setBackgroundColor() -{ - QColor color = QColorDialog::getColor(QColor(Modules::objView().getBackgroundColor().R, - Modules::objView().getBackgroundColor().G, - Modules::objView().getBackgroundColor().B)); - if (color.isValid()) - Modules::objView().setBackgroundColor(NLMISC::CRGBA(color.red(), color.green(), color.blue())); -} - -void CGraphicsViewport::resizeEvent(QResizeEvent *resizeEvent) -{ - QWidget::resizeEvent(resizeEvent); - if (Modules::objView().getDriver()) - Modules::objView().setSizeViewport(resizeEvent->size().width(), resizeEvent->size().height()); -} - -#if defined(NL_OS_WINDOWS) - -typedef bool (*winProc)(NL3D::IDriver *driver, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); - -bool CGraphicsViewport::winEvent(MSG *message, long *result) -{ - if (Modules::objView().getDriver() && Modules::objView().getDriver()->isActive()) - { - NL3D::IDriver *driver = dynamic_cast(Modules::objView().getDriver())->getDriver(); - if (driver) - { - winProc proc = (winProc)driver->getWindowProc(); - - // TODO: shouldn't it return false like the others? - // see macEvent() and x11Event() below - return proc(driver, message->hwnd, message->message, message->wParam, message->lParam); - } - } - - return false; -} - -#elif defined(NL_OS_MAC) - -typedef bool (*cocoaProc)(NL3D::IDriver *, const void *e); - -bool CGraphicsViewport::macEvent(EventHandlerCallRef caller, EventRef event) -{ - if(caller) - nlerror("You are using QtCarbon! Only QtCocoa supported, please upgrade Qt"); - - if (Modules::objView().getDriver() && Modules::objView().getDriver()->isActive()) - { - NL3D::IDriver *driver = dynamic_cast(Modules::objView().getDriver())->getDriver(); - if (driver) - { - cocoaProc proc = (cocoaProc)driver->getWindowProc(); - proc(driver, event); - } - } - - // return false to let Qt handle the event as well, - // else the widget would never get focus - return false; -} - -#elif defined(NL_OS_UNIX) - -typedef bool (*x11Proc)(NL3D::IDriver *drv, XEvent *e); - -bool CGraphicsViewport::x11Event(XEvent *event) -{ - if (Modules::objView().getDriver() && Modules::objView().getDriver()->isActive()) - { - NL3D::IDriver *driver = dynamic_cast(Modules::objView().getDriver())->getDriver(); - if (driver) - { - x11Proc proc = (x11Proc)driver->getWindowProc(); - proc(driver, event); - } - } - - // return false to let Qt handle the event as well, - // else the widget would never get focus - // TODO: test me please, i have no linux at hand (rti) - return false; -} -#endif - -} /* namespace NLQT */ - 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 deleted file mode 100644 index 34f237757..000000000 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/CMakeLists.txt +++ /dev/null @@ -1,48 +0,0 @@ -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(OVQT_PLUG_SHEET_BUILDER_HDR sheetbuilderconfgdialog.h sheetbuilderdialog.h ovqt_sheet_builder.h) - -SET(QT_USE_QTGUI TRUE) -SET(QT_USE_QTOPENGL TRUE) - -QT4_WRAP_CPP(OVQT_PLUG_SHEET_BUILDER_MOC_SRC ${OVQT_PLUG_SHEET_BUILDER_HDR}) - -SOURCE_GROUP(QtGeneratedMocSrc FILES ${OVQT_PLUG_SHEET_BUILDER_MOC_SRC}) -SOURCE_GROUP("Sheet builder Plugin" FILES ${SRC}) -SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) - -ADD_LIBRARY(ovqt_plugin_sheet_builder MODULE ${SRC} ${OVQT_PLUG_SHEET_BUILDER_MOC_SRC} ${OVQT_EXT_SYS_SRC}) - -TARGET_LINK_LIBRARIES(ovqt_plugin_sheet_builder ovqt_plugin_core nelmisc ${QT_LIBRARIES}) - -NL_DEFAULT_PROPS(ovqt_plugin_sheet_builder "NeL, Tools, 3D: Object Viewer Qt Plugin: Sheet builder") -NL_ADD_RUNTIME_FLAGS(ovqt_plugin_sheet_builder) -NL_ADD_LIB_SUFFIX(ovqt_plugin_sheet_builder) - -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) - - -IF(WIN32) - IF(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_sheet_builder LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) - ELSE(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_sheet_builder LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) - ENDIF(WITH_INSTALL_LIBRARIES) -ELSE(WIN32) - IF(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_sheet_builder LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) - ELSE(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_sheet_builder LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) - ENDIF(WITH_INSTALL_LIBRARIES) -ENDIF(WIN32) - -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_widget/src/object_viewer_widget.cpp b/code/nel/tools/3d/object_viewer_widget/src/object_viewer_widget.cpp index af026b3df..4d0936a1a 100644 --- a/code/nel/tools/3d/object_viewer_widget/src/object_viewer_widget.cpp +++ b/code/nel/tools/3d/object_viewer_widget/src/object_viewer_widget.cpp @@ -185,7 +185,7 @@ namespace NLQT NL3D::CBloomEffect::instance().setDriver(_Driver); NL3D::CBloomEffect::instance().setScene(_Scene); - NL3D::CBloomEffect::instance().init(!_Direct3D); + NL3D::CBloomEffect::instance().init(); //NL3D::CBloomEffect::instance().setDensityBloom(Modules::config().getConfigFile().getVar("BloomDensity").asInt()); //NL3D::CBloomEffect::instance().setSquareBloom(Modules::config().getConfigFile().getVar("BloomSquare").asBool()); } @@ -366,7 +366,7 @@ namespace NLQT // Render the scene. if((NL3D::CBloomEffect::instance().getDriver() != NULL) && (_BloomEffect)) { - NL3D::CBloomEffect::instance().initBloom(); + NL3D::CBloomEffect::instance().init(); } _Driver->clearBuffers(_BackgroundColor); } @@ -378,8 +378,7 @@ namespace NLQT if((NL3D::CBloomEffect::instance().getDriver() != NULL) && (_BloomEffect)) { - NL3D::CBloomEffect::instance().endBloom(); - NL3D::CBloomEffect::instance().endInterfacesDisplayBloom(); + NL3D::CBloomEffect::instance().applyBloom(); } } diff --git a/code/nel/tools/3d/panoply_maker/color_modifier.cpp b/code/nel/tools/3d/panoply_maker/color_modifier.cpp index 3c4b1814d..a55936b7c 100644 --- a/code/nel/tools/3d/panoply_maker/color_modifier.cpp +++ b/code/nel/tools/3d/panoply_maker/color_modifier.cpp @@ -70,7 +70,6 @@ void CColorModifier::convertBitmap(NLMISC::CBitmap &destBitmap, const NLMISC::CB // blend to the destination by using the mask alpha result.blendFromui(*dest, result, mask->R); - /// keep alpha from the source dest->R = result.R; @@ -78,7 +77,6 @@ void CColorModifier::convertBitmap(NLMISC::CBitmap &destBitmap, const NLMISC::CB dest->B = result.B; dest->A = src->A; - ++ mask; ++ src; ++ dest; diff --git a/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/nel_3dsmax_shared.cpp b/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/nel_3dsmax_shared.cpp index da04de211..76592f556 100644 --- a/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/nel_3dsmax_shared.cpp +++ b/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/nel_3dsmax_shared.cpp @@ -68,6 +68,7 @@ NEL_3DSMAX_SHARED_API NLMISC::INelContext &GetSharedNelContext() { new NLMISC::CApplicationContext(); NLMISC::createDebug(); + NLMISC::INelContext::getInstance().setWindowedApplication(true); } return NLMISC::INelContext::getInstance(); } diff --git a/code/nel/tools/3d/plugin_max/nel_export/DllEntry.cpp b/code/nel/tools/3d/plugin_max/nel_export/DllEntry.cpp index 7378fc8ca..fcb2317fd 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/DllEntry.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/DllEntry.cpp @@ -20,6 +20,7 @@ #include "nel/misc/app_context.h" #include "../nel_3dsmax_shared/nel_3dsmax_shared.h" #include +#include "nel/misc/sheet_id.h" extern ClassDesc2* GetCNelExportDesc(); @@ -34,6 +35,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved) { new NLMISC::CLibraryContext(GetSharedNelContext()); nldebug("NeL Export: DllMain"); + NLMISC::CSheetId::initWithoutSheet(); } hInstance = hinstDLL; // Hang on to this DLL's instance handle. diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp index 68d3b8b2b..3a3e40810 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp @@ -173,7 +173,7 @@ INT_PTR CALLBACK OptionsDialogCallback ( if( SendMessage( GetDlgItem(hwndDlg,IDC_RADIORADIOSITYEXPORTLIGHTING), BM_GETCHECK, 0, 0 ) == BST_CHECKED ) theExportSceneStruct.nExportLighting = 1; SendMessage( GetDlgItem(hwndDlg,IDC_EDITLUMELSIZE), WM_GETTEXT, 1024, (long)tmp ); - theExportSceneStruct.rLumelSize = (float)atof( tmp ); + NLMISC::fromString(tmp, theExportSceneStruct.rLumelSize); if( SendMessage( GetDlgItem(hwndDlg,IDC_RADIOSS1), BM_GETCHECK, 0, 0 ) == BST_CHECKED ) theExportSceneStruct.nOverSampling = 1; @@ -192,9 +192,9 @@ INT_PTR CALLBACK OptionsDialogCallback ( // SurfaceLighting theExportSceneStruct.bTestSurfaceLighting= (SendMessage( GetDlgItem(hwndDlg,IDC_TEST_SURFACE_LIGHT), BM_GETCHECK, 0, 0 ) == BST_CHECKED); SendMessage( GetDlgItem(hwndDlg,IDC_EDITCELLSIZE), WM_GETTEXT, 1024, (long)tmp ); - theExportSceneStruct.SurfaceLightingCellSize= (float)atof( tmp ); + NLMISC::fromString(tmp, theExportSceneStruct.SurfaceLightingCellSize); SendMessage( GetDlgItem(hwndDlg,IDC_EDITCELLDELTAZ), WM_GETTEXT, 1024, (long)tmp ); - theExportSceneStruct.SurfaceLightingDeltaZ= (float)atof( tmp ); + NLMISC::fromString(tmp, theExportSceneStruct.SurfaceLightingDeltaZ); // End the dialog EndDialog(hwndDlg, TRUE); diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export.rc b/code/nel/tools/3d/plugin_max/nel_export/nel_export.rc index a2f49f0da..d01762618 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export.rc +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export.rc @@ -575,8 +575,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1, 0, 0, 117 - PRODUCTVERSION 3,0,0,0 + FILEVERSION 0, 11, 0, 0 + PRODUCTVERSION 0, 11, 0, 0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -591,16 +591,16 @@ BEGIN BEGIN BLOCK "040904b0" BEGIN - VALUE "Comments", "TECH: \0" - VALUE "CompanyName", "\0" - VALUE "FileVersion", "1, 0, 0, 117\0" + VALUE "Comments", "Based on Kinetix 3D Studio Max 3.0 plugin sample\0" + VALUE "CompanyName", "Ryzom Core\0" + VALUE "FileVersion", "0.11.0\0" VALUE "InternalName", "CNelExport\0" VALUE "LegalCopyright", "\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "CNelExport.dlu\0" VALUE "PrivateBuild", "\0" - VALUE "ProductName", "3D Studio MAX\0" - VALUE "ProductVersion", "3.0.0.0\0" + VALUE "ProductName", "Ryzom Core\0" + VALUE "ProductVersion", "0.11.0\0" VALUE "SpecialBuild", "\0" END END diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export_script.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export_script.cpp index e3d8a4a12..5b7751ad2 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export_script.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export_script.cpp @@ -968,6 +968,7 @@ protected: Value* force_quit_on_msg_displayer_cf(Value** arg_list, int count) { nlwarning("Enable force quit on NeL report msg displayer"); + NLMISC::INelContext::getInstance().setWindowedApplication(false); // disable the Windows popup telling that the application aborted and disable the dr watson report. _set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT); putenv("NEL_IGNORE_ASSERT=1"); diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/calc_lm.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/calc_lm.cpp index 426deef18..d9b662687 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/calc_lm.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/calc_lm.cpp @@ -293,16 +293,19 @@ void SLightBuild::convertFromMaxLight (INode *node,TimeValue tvTime) for (sint i = 0; i < exclusionList.Count(); ++i) { INode *exclNode = exclusionList[i]; - string tmp = exclNode->GetName(); - this->setExclusion.insert(tmp); + if (exclNode) // Crashfix // FIXME: Why is this NULL? + { + string tmp = exclNode->GetName(); + this->setExclusion.insert(tmp); + } } #endif // (MAX_RELEASE < 4000) // Get Soft Shadow information string sTmp = CExportNel::getScriptAppData (node, NEL3D_APPDATA_SOFTSHADOW_RADIUS, toString(NEL3D_APPDATA_SOFTSHADOW_RADIUS_DEFAULT)); - this->rSoftShadowRadius = (float)atof(sTmp.c_str()); + NLMISC::fromString(sTmp, this->rSoftShadowRadius); sTmp = CExportNel::getScriptAppData (node, NEL3D_APPDATA_SOFTSHADOW_CONELENGTH, toString(NEL3D_APPDATA_SOFTSHADOW_CONELENGTH_DEFAULT)); - this->rSoftShadowConeLength = (float)atof(sTmp.c_str()); + NLMISC::fromString(sTmp, this->rSoftShadowConeLength); if( deleteIt ) maxLight->DeleteThis(); @@ -2142,13 +2145,16 @@ void appendLightmapLog (COFile &outputLog, const char *lightmapName, const vecto bool CExportNel::calculateLM( CMesh::CMeshBuild *pZeMeshBuild, CMeshBase::CMeshBaseBuild *pZeMeshBaseBuild, INode& ZeNode, TimeValue tvTime, uint firstMaterial, bool outputLightmapLog) { + nldebug("Calculate LM: '%s'", ZeNode.GetName()); + DWORD t = timeGetTime(); uint32 i, j; // **** Retrieve Shape Node properties string sLumelSizeMul = CExportNel::getScriptAppData (&ZeNode, NEL3D_APPDATA_LUMELSIZEMUL, "1.0"); - float rLumelSizeMul = (float)atof(sLumelSizeMul.c_str()); + float rLumelSizeMul; + NLMISC::fromString(sLumelSizeMul, rLumelSizeMul); // 8Bits LightMap Compression bool lmcEnabled= CExportNel::getScriptAppData (&ZeNode, NEL3D_APPDATA_EXPORT_LMC_ENABLED, BST_UNCHECKED)==BST_CHECKED; enum {NumLightGroup= 3}; 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 738e6b724..5997006d5 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 @@ -508,14 +508,13 @@ std::string CExportNel::getName (MtlBase& mtl) // -------------------------------------------------- // Get the node name -std::string CExportNel::getName (INode& mtl) +std::string CExportNel::getName(INode& node) { // Return its name - TCHAR* name=mtl.GetName(); - return std::string (name); + MCHAR* name = node.GetName(); + return std::string(name); } - // -------------------------------------------------- // Get the NEL node name diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_skinning.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_skinning.cpp index f8dce3ac6..3708a0906 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_skinning.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_skinning.cpp @@ -18,64 +18,17 @@ #include "export_nel.h" #include "export_appdata.h" #include "nel/3d/skeleton_shape.h" +#include "iskin.h" using namespace NLMISC; using namespace NL3D; // *************************************************************************** -#define SKIN_INTERFACE 0x00010000 - -// *************************************************************************** - -#define SKIN_CLASS_ID Class_ID(9815843,87654) #define PHYSIQUE_CLASS_ID Class_ID(PHYSIQUE_CLASS_ID_A, PHYSIQUE_CLASS_ID_B) // *************************************************************************** -class ISkinContextData -{ -public: - virtual int GetNumPoints()=0; - virtual int GetNumAssignedBones(int vertexIdx)=0; - virtual int GetAssignedBone(int vertexIdx, int boneIdx)=0; - virtual float GetBoneWeight(int vertexIdx, int boneIdx)=0; - - virtual int GetSubCurveIndex(int vertexIdx, int boneIdx)=0; - virtual int GetSubSegmentIndex(int vertexIdx, int boneIdx)=0; - virtual float GetSubSegmentDistance(int vertexIdx, int boneIdx)=0; - virtual Point3 GetTangent(int vertexIdx, int boneIdx)=0; - virtual Point3 GetOPoint(int vertexIdx, int boneIdx)=0; - - virtual void SetWeight(int vertexIdx, int boneIdx, float weight)=0; - virtual void SetWeight(int vertexIdx, INode* bone, float weight)=0; - virtual void SetWeights(int vertexIdx, Tab boneIdx, Tab weights)=0; - virtual void SetWeights(int vertexIdx, INodeTab boneIdx, Tab weights)=0; - -}; - -// *************************************************************************** - -class ISkin -{ -public: - ISkin() {} - ~ISkin() {} - virtual int GetBoneInitTM(INode *pNode, Matrix3 &InitTM, bool bObjOffset = false)=0; - virtual int GetSkinInitTM(INode *pNode, Matrix3 &InitTM, bool bObjOffset = false)=0; - virtual int GetNumBones()=0; - virtual INode *GetBone(int idx)=0; - virtual DWORD GetBoneProperty(int idx)=0; - virtual ISkinContextData *GetContextInterface(INode *pNode)=0; - - virtual BOOL AddBone(INode *bone)=0; - virtual BOOL AddBones(INodeTab *bones)=0; - virtual BOOL RemoveBone(INode *bone)=0; - virtual void Invalidate()=0; -}; - -// *************************************************************************** - void CExportNel::buildSkeletonShape (CSkeletonShape& skeletonShape, INode& node, mapBoneBindPos* mapBindPos, TInodePtrInt& mapId, TimeValue time) { @@ -410,7 +363,8 @@ void CExportNel::buildSkeleton (std::vector& bonesArray, INode& node, bonesArray.push_back (bone); // **** Call on child - for (int children=0; childrenIsEnabled()) { // Get a com_skin2 interface - ISkin *comSkinInterface=(ISkin*)skin->GetInterface (SKIN_INTERFACE); + ISkin *comSkinInterface=(ISkin*)skin->GetInterface (I_SKIN); // Found com_skin2 ? if (comSkinInterface) @@ -446,7 +400,7 @@ bool CExportNel::isSkin (INode& node) ok=true; // Release the interface - skin->ReleaseInterface (SKIN_INTERFACE, comSkinInterface); + skin->ReleaseInterface (I_SKIN, comSkinInterface); } } } @@ -490,7 +444,7 @@ uint CExportNel::buildSkinning (CMesh::CMeshBuild& buildMesh, const TInodePtrInt uint ok=NoError; // Get the skin modifier - Modifier* skin=getModifier (&node, SKIN_CLASS_ID); + Modifier* skin=getModifier (&node, SKIN_CLASSID); // Build a the name array buildMesh.BonesNames.resize (skeletonShape.size()); @@ -513,7 +467,7 @@ uint CExportNel::buildSkinning (CMesh::CMeshBuild& buildMesh, const TInodePtrInt // ********** COMSKIN EXPORT ********** // Get a com_skin2 interface - ISkin *comSkinInterface=(ISkin*)skin->GetInterface (SKIN_INTERFACE); + ISkin *comSkinInterface=(ISkin*)skin->GetInterface (I_SKIN); // Should been controled with isSkin before. nlassert (comSkinInterface); @@ -645,7 +599,7 @@ uint CExportNel::buildSkinning (CMesh::CMeshBuild& buildMesh, const TInodePtrInt } // Release the interface - skin->ReleaseInterface (SKIN_INTERFACE, comSkinInterface); + skin->ReleaseInterface (I_SKIN, comSkinInterface); } else { @@ -881,13 +835,13 @@ INode* CExportNel::getSkeletonRootBone (INode& node) INode* ret=NULL; // Get the skin modifier - Modifier* skin=getModifier (&node, SKIN_CLASS_ID); + Modifier* skin=getModifier (&node, SKIN_CLASSID); // Found it ? if (skin) { // Get a com_skin2 interface - ISkin *comSkinInterface=(ISkin*)skin->GetInterface (SKIN_INTERFACE); + ISkin *comSkinInterface=(ISkin*)skin->GetInterface (I_SKIN); // Found com_skin2 ? if (comSkinInterface) @@ -921,7 +875,7 @@ INode* CExportNel::getSkeletonRootBone (INode& node) } // Release the interface - skin->ReleaseInterface (SKIN_INTERFACE, comSkinInterface); + skin->ReleaseInterface (I_SKIN, comSkinInterface); } } else @@ -961,40 +915,47 @@ INode* CExportNel::getSkeletonRootBone (INode& node) // Get a vertex interface IPhyVertexExport *vertexInterface=localData->GetVertexInterface (vtx); - // Check if it is a rigid vertex or a blended vertex - int type=vertexInterface->GetVertexType (); - if (type==RIGID_TYPE) - { - // this is a rigid vertex - IPhyRigidVertex *rigidInterface=(IPhyRigidVertex*)vertexInterface; - - // Get the bone - INode *newBone=rigidInterface->GetNode(); - - // Get the root of the hierarchy - ret=getRoot (newBone); - found=true; - break; - } - else + if (vertexInterface) { - // It must be a blendable vertex - nlassert (type==RIGID_BLENDED_TYPE); - IPhyBlendedRigidVertex *blendedInterface=(IPhyBlendedRigidVertex*)vertexInterface; - - // For each bones - uint bone; - uint count=(uint)blendedInterface->GetNumberNodes (); - for (bone=0; boneGetVertexType (); + if (type==RIGID_TYPE) { - // Get the bone pointer - INode *newBone=blendedInterface->GetNode(bone); + // this is a rigid vertex + IPhyRigidVertex *rigidInterface=(IPhyRigidVertex*)vertexInterface; + + // Get the bone + INode *newBone=rigidInterface->GetNode(); // Get the root of the hierarchy ret=getRoot (newBone); found=true; break; } + else + { + // It must be a blendable vertex + nlassert (type==RIGID_BLENDED_TYPE); + IPhyBlendedRigidVertex *blendedInterface=(IPhyBlendedRigidVertex*)vertexInterface; + + // For each bones + uint bone; + uint count=(uint)blendedInterface->GetNumberNodes (); + for (bone=0; boneGetNode(bone); + + // Get the root of the hierarchy + ret=getRoot (newBone); + found=true; + break; + } + } + } + else + { + nlwarning("Physique vertex interface NULL"); } // Release vertex interfaces @@ -1030,13 +991,13 @@ void CExportNel::addSkeletonBindPos (INode& skinedNode, mapBoneBindPos& boneBind uint ok=NoError; // Get the skin modifier - Modifier* skin=getModifier (&skinedNode, SKIN_CLASS_ID); + Modifier* skin=getModifier (&skinedNode, SKIN_CLASSID); // Found it ? if (skin) { // Get a com_skin2 interface - ISkin *comSkinInterface=(ISkin*)skin->GetInterface (SKIN_INTERFACE); + ISkin *comSkinInterface=(ISkin*)skin->GetInterface (I_SKIN); // Should been controled with isSkin before. nlassert (comSkinInterface); @@ -1082,7 +1043,7 @@ void CExportNel::addSkeletonBindPos (INode& skinedNode, mapBoneBindPos& boneBind } // Release the interface - skin->ReleaseInterface (SKIN_INTERFACE, comSkinInterface); + skin->ReleaseInterface (I_SKIN, comSkinInterface); } } else @@ -1267,7 +1228,7 @@ void CExportNel::addSkeletonBindPos (INode& skinedNode, mapBoneBindPos& boneBind } // Release the interface - skin->ReleaseInterface (SKIN_INTERFACE, physiqueInterface); + skin->ReleaseInterface (I_SKIN, physiqueInterface); } } } @@ -1279,7 +1240,7 @@ void CExportNel::addSkeletonBindPos (INode& skinedNode, mapBoneBindPos& boneBind void CExportNel::enableSkinModifier (INode& node, bool enable) { // Get the skin modifier - Modifier* skin=getModifier (&node, SKIN_CLASS_ID); + Modifier* skin=getModifier (&node, SKIN_CLASSID); // Found it ? if (skin) diff --git a/code/nel/tools/3d/plugin_max/nel_patch_converter/DllEntry.cpp b/code/nel/tools/3d/plugin_max/nel_patch_converter/DllEntry.cpp index 0fe5bc556..715e35618 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_converter/DllEntry.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_converter/DllEntry.cpp @@ -21,6 +21,7 @@ #include "nel/misc/app_context.h" #include "../nel_3dsmax_shared/nel_3dsmax_shared.h" #include +#include "nel/misc/sheet_id.h" extern ClassDesc2* GetPO2RPODesc(); extern ClassDesc* GetRPODesc(); @@ -44,6 +45,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved) { new NLMISC::CLibraryContext(GetSharedNelContext()); nldebug("NeL Export: DllMain"); + NLMISC::CSheetId::initWithoutSheet(); } if(fdwReason == DLL_PROCESS_ATTACH) diff --git a/code/nel/tools/3d/plugin_max/nel_patch_converter/nel_patch_converter.rc b/code/nel/tools/3d/plugin_max/nel_patch_converter/nel_patch_converter.rc index 619028a99..b6eea41a6 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_converter/nel_patch_converter.rc +++ b/code/nel/tools/3d/plugin_max/nel_patch_converter/nel_patch_converter.rc @@ -85,8 +85,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,6,0,0 - PRODUCTVERSION 0,6,0,0 + FILEVERSION 0, 11, 0, 0 + PRODUCTVERSION 0, 11, 0, 0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -101,14 +101,14 @@ BEGIN BEGIN BLOCK "040904b0" BEGIN - VALUE "Comments", "http://www.opennel.org/" + VALUE "Comments", "http://www.ryzomcore.org/" VALUE "FileDescription", "PatchMesh to RykolPatchMesh" - VALUE "FileVersion", "0.6.0" + VALUE "FileVersion", "0.11.0" VALUE "InternalName", "PatchMesh to RykolPatchMesh" VALUE "LegalCopyright", "Copyright, 2000 Nevrax Ltd." VALUE "OriginalFilename", "nel_convert_patch.dlm" VALUE "ProductName", "NeL Patch Converter" - VALUE "ProductVersion", "0.6.0" + VALUE "ProductVersion", "0.11.0" END END BLOCK "VarFileInfo" 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 8acae94bd..80e715f21 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 @@ -338,6 +338,8 @@ get_selected_tile_cf(Value** arg_list, int count) if (tri->rpatch->tileSel[i]) array->append(Integer::intern(i+1)); } + if (os.obj != tri) + delete tri; } } @@ -383,6 +385,8 @@ get_selected_patch_cf(Value** arg_list, int count) if (tri->patch.patchSel[i]) array->append(Integer::intern(i+1)); } + if (os.obj != tri) + delete tri; } } @@ -428,6 +432,8 @@ get_selected_vertex_cf(Value** arg_list, int count) if (tri->patch.vertSel[i]) array->append(Integer::intern(i+1)); } + if (os.obj != tri) + delete tri; } } @@ -617,6 +623,8 @@ set_vertex_count_cf(Value** arg_list, int count) { nRet=tri->patch.numVerts; } + if (os.obj != tri) + delete tri; } return Integer::intern(nRet); @@ -655,6 +663,8 @@ set_vector_count_cf(Value** arg_list, int count) { nRet=tri->patch.numVecs; } + if (os.obj != tri) + delete tri; } return Integer::intern(nRet); @@ -702,6 +712,8 @@ set_vertex_pos_cf(Value** arg_list, int count) node->NotifyDependents(FOREVER, PART_ALL, REFMSG_CHANGE); ip->RedrawViews(ip->GetTime()); } + if (os.obj != tri) + delete tri; } } @@ -750,6 +762,8 @@ set_vector_pos_cf(Value** arg_list, int count) node->NotifyDependents(FOREVER, PART_ALL, REFMSG_CHANGE); ip->RedrawViews(ip->GetTime()); } + if (os.obj != tri) + delete tri; } } @@ -792,6 +806,8 @@ get_vertex_pos_cf(Value** arg_list, int count) { vRet=new Point3Value (tri->patch.verts[nVertex].p); } + if (os.obj != tri) + delete tri; } } @@ -834,6 +850,8 @@ get_vector_pos_cf(Value** arg_list, int count) { vRet=new Point3Value (tri->patch.vecs[nVertex].p); } + if (os.obj != tri) + delete tri; } } @@ -877,6 +895,8 @@ get_edge_vect1_cf(Value** arg_list, int count) { nVert=tri->patch.edges[nEdge].vec12; } + if (os.obj != tri) + delete tri; } } @@ -919,6 +939,8 @@ get_edge_vect2_cf(Value** arg_list, int count) { nVert=tri->patch.edges[nEdge].vec21; } + if (os.obj != tri) + delete tri; } } @@ -961,6 +983,8 @@ get_edge_vert1_cf(Value** arg_list, int count) { nVert=tri->patch.edges[nEdge].v1; } + if (os.obj != tri) + delete tri; } } @@ -1004,6 +1028,8 @@ get_edge_vert2_cf(Value** arg_list, int count) { nVert=tri->patch.edges[nEdge].v2; } + if (os.obj != tri) + delete tri; } } @@ -1050,6 +1076,8 @@ get_sel_edge_cf(Value** arg_list, int count) array->append(Integer::intern(i+1)); //array->data[j++]=; } + if (os.obj != tri) + delete tri; } } @@ -1158,6 +1186,8 @@ set_tile_steps_cf(Value** arg_list, int count) nTess=5; tri->rpatch->rTess.TileTesselLevel=nTess; tri->rpatch->InvalidateChannels (PART_ALL); + if (os.obj != tri) + delete tri; } if (bRet) { diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/editpat.h b/code/nel/tools/3d/plugin_max/nel_patch_edit/editpat.h index d0bfd1773..ec8947571 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/editpat.h +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/editpat.h @@ -755,6 +755,7 @@ class EditPatchMod : public Modifier, IPatchOps, IPatchSelect, ISubMtlAPI, Attac TCHAR *GetObjectName() { return GetString(IDS_TH_EDITPATCH); } void ActivateSubobjSel(int level, XFormModes& modes ); int NeedUseSubselButton() { return 0; } + void SelectSubPatch(int index); void SelectSubComponent( HitRecord *hitRec, BOOL selected, BOOL all, BOOL invert ); void ClearSelection(int selLevel); void SelectAll(int selLevel); diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/mods.rc b/code/nel/tools/3d/plugin_max/nel_patch_edit/mods.rc index 324c82139..6de328356 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/mods.rc +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/mods.rc @@ -514,8 +514,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,50 - PRODUCTVERSION 3,0,0,0 + FILEVERSION 0, 11, 2, 0 + PRODUCTVERSION 0, 11, 2, 0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -530,15 +530,16 @@ BEGIN BEGIN BLOCK "040904b0" BEGIN - VALUE "CompanyName", "Nevrax Ltd." - VALUE "FileDescription", "Standard modifiers (plugin)" - VALUE "FileVersion", "1, 0, 0, 50" + VALUE "Comments", "Based on Kinetix 3D Studio Max 3.0 plugin sample\0" + VALUE "CompanyName", "Ryzom Core" + VALUE "FileDescription", "NeL Patch Edit" + VALUE "FileVersion", "0.11.2" VALUE "InternalName", "neleditpatch" VALUE "LegalCopyright", "Copyright © 2000 Nevrax Ltd. Copyright © 1998 Autodesk Inc." VALUE "LegalTrademarks", "The following are registered trademarks of Autodesk, Inc.: 3D Studio MAX. The following are trademarks of Autodesk, Inc.: Kinetix, Kinetix(logo), BIPED, Physique, Character Studio, MAX DWG, DWG Unplugged, Heidi, FLI, FLC, DXF." VALUE "OriginalFilename", "neleditpatch.dlm" - VALUE "ProductName", "3D Studio MAX" - VALUE "ProductVersion", "3.0.0.0" + VALUE "ProductName", "Ryzom Core" + VALUE "ProductVersion", "0.11.2" END END BLOCK "VarFileInfo" 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 7b1c9c644..133d0b4d6 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 @@ -84,6 +84,31 @@ *> Copyright(c) 1994, All Rights Reserved. **********************************************************************/ #include "stdafx.h" + +#if MAX_VERSION_MAJOR >= 14 +# include +# include +# include +# include +# include +# include +# include +# include +# include +#else +# include +# include +// Various MAX and MXS includes +# include +# include +# include +# include +# include +# include +// define the new primitives using macros from SDK +# include +#endif + #include "editpat.h" #include "../nel_patch_lib/vertex_neighborhood.h" @@ -855,3 +880,67 @@ void ResetVert (PatchMesh *patch) patch->computeInteriors(); patch->InvalidateGeomCache (); } + +def_visible_primitive(turn_patch, "RykolTurnPatch"); + +Value *turn_patch_cf (Value** arg_list, int count) +{ + // Make sure we have the correct number of arguments (2) + check_arg_count(RykolTurnPatch, 3, count); + + // Check to see if the arguments match up to what we expect + // We want to use 'TurnAllTexturesOn ' + type_check(arg_list[0], MAXNode, "RykolTurnPatch [Node] [Modifier] [Patch]"); + type_check(arg_list[1], MAXModifier, "RykolTurnPatch [Node] [Modifier] [Patch]"); + type_check(arg_list[2], Integer, "RykolTurnPatch [Node] [Modifier] [Patch]"); + + // Get a good interface pointer + Interface *ip = MAXScript_interface; + + // Get a INode pointer from the argument passed to us + INode *node = arg_list[0]->to_node(); + nlassert (node); + + // Get a Object pointer + ObjectState os = node->EvalWorldState(ip->GetTime()); + + // ok ? + bool bRet=false; + + if (os.obj) + { + // Get class id + if (os.obj->CanConvertToType(RYKOLPATCHOBJ_CLASS_ID)) + { + bRet = true; + RPO *tri = (RPO *)os.obj->ConvertToType(ip->GetTime(), RYKOLPATCHOBJ_CLASS_ID); + if (tri) + { + Modifier *mod = arg_list[1]->to_modifier(); + if (mod) + { + EditPatchMod *epmod = (EditPatchMod *)mod; + epmod->ClearSelection(EP_PATCH); + epmod->SelectSubPatch(arg_list[2]->to_int() - 1); + epmod->DoPatchTurn(true); + epmod->ClearSelection(EP_PATCH); + } + else + { + bRet = false; + } + } + // Note that the TriObject should only be deleted + // if the pointer to it is not equal to the object + // pointer that called ConvertToType() + if (os.obj != tri) + delete tri; + + // redraw and update + node->NotifyDependents(FOREVER, PART_ALL, REFMSG_CHANGE); + ip->RedrawViews(ip->GetTime()); + } + } + + return bRet?&true_value:&false_value; +} \ No newline at end of file diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_attach.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_attach.cpp index 64a3296f0..d2843df1c 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_attach.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_attach.cpp @@ -37,7 +37,6 @@ int EditPatchMod::DoAttach(INode *node, PatchMesh *attPatch, RPatchMesh *rattPat nodes.DisposeTemporary(); return 0; } - patchData->BeginEdit(ip->GetTime()); // If the mesh isn't yet cached, this will cause it to get cached. RPatchMesh *rpatch; @@ -49,6 +48,7 @@ int EditPatchMod::DoAttach(INode *node, PatchMesh *attPatch, RPatchMesh *rattPat } patchData->RecordTopologyTags(patch); RecordTopologyTags(); + patchData->BeginEdit(ip->GetTime()); // Transform the shape for attachment: // If reorienting, just translate to align pivots diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_selection.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_selection.cpp index 3814a2df9..0b15b63e7 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_selection.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_selection.cpp @@ -236,6 +236,50 @@ void EditPatchMod::SetSelLevel(DWORD level) // ------------------------------------------------------------------------------------------------------------------------------------------------------ +void EditPatchMod::SelectSubPatch(int index) +{ + if (!ip) + return; + TimeValue t = ip->GetTime(); + + ip->ClearCurNamedSelSet(); + + ModContextList mcList; + INodeTab nodes; + ip->GetModContexts(mcList, nodes); + + for (int i = 0; i < mcList.Count(); i++) + { + EditPatchData *patchData =(EditPatchData*)mcList[i]->localData; + + if (!patchData) + return; + + RPatchMesh *rpatch; + PatchMesh *patch = patchData->TempData(this)->GetPatch(t, rpatch); + if (!patch) + return; + + patchData->BeginEdit(t); + if (theHold.Holding()) + theHold.Put(new PatchRestore(patchData, this, patch, rpatch, "SelectSubComponent")); + + patch->patchSel.Set(index); + + patchData->UpdateChanges(patch, rpatch, FALSE); + if (patchData->tempData) + { + patchData->tempData->Invalidate(PART_SELECT); + } + } + PatchSelChanged(); + + UpdateSelectDisplay(); + NotifyDependents(FOREVER, PART_SELECT, REFMSG_CHANGE); +} + +// ------------------------------------------------------------------------------------------------------------------------------------------------------ + // Select a subcomponent within our object(s). WARNING! Because the HitRecord list can // indicate any of the objects contained within the group of patches being edited, we need // to watch for control breaks in the patchData pointer within the HitRecord! diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_mods.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_mods.cpp index 788c0d649..0d16dd149 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_mods.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_mods.cpp @@ -18,6 +18,7 @@ #include "../nel_3dsmax_shared/nel_3dsmax_shared.h" #include +#include "nel/misc/sheet_id.h" HINSTANCE hInstance; int controlsInit = FALSE; @@ -32,6 +33,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved) { new NLMISC::CLibraryContext(GetSharedNelContext()); nldebug("NeL Patch Edit: DllMain"); + NLMISC::CSheetId::initWithoutSheet(); } if (fdwReason == DLL_PROCESS_ATTACH) diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/DllEntry.cpp b/code/nel/tools/3d/plugin_max/nel_patch_paint/DllEntry.cpp index e0ae7c0fa..7afde8938 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/DllEntry.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/DllEntry.cpp @@ -4,6 +4,7 @@ #include "nel/misc/app_context.h" #include "../nel_3dsmax_shared/nel_3dsmax_shared.h" #include +#include "nel/misc/sheet_id.h" HINSTANCE hInstance; int controlsInit = FALSE; @@ -18,6 +19,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved) { new NLMISC::CLibraryContext(GetSharedNelContext()); nldebug("NeL Patch Paint: DllMain"); + NLMISC::CSheetId::initWithoutSheet(); } hInstance = hinstDLL; diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/keys.cfg b/code/nel/tools/3d/plugin_max/nel_patch_paint/keys.cfg index a94996500..4f1013dae 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/keys.cfg +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/keys.cfg @@ -176,6 +176,7 @@ LockBorders = KeyL; ZoomIn = Key1; ZoomOut = Key2; GetState = Key3; +ResetPatch = KeyF10; /*************** *This is the the light settings diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/nel_patch_paint.rc b/code/nel/tools/3d/plugin_max/nel_patch_paint/nel_patch_paint.rc index c984f2541..507d36ab5 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/nel_patch_paint.rc +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/nel_patch_paint.rc @@ -96,8 +96,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1, 0, 0, 51 - PRODUCTVERSION 3,0,0,0 + FILEVERSION 0, 11, 1, 0 + PRODUCTVERSION 0, 11, 1, 0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -112,17 +112,18 @@ BEGIN BEGIN BLOCK "040904b0" BEGIN + VALUE "Comments", "Based on Kinetix 3D Studio Max 3.0 plugin sample\0" VALUE "Comments", "TECH: cyril.corvazier\0" - VALUE "CompanyName", "Nevrax Ltd\0" - VALUE "FileDescription", "Standard modifiers (plugin)\0" - VALUE "FileVersion", "1, 0, 0, 51\0" + VALUE "CompanyName", "Ryzom Core\0" + VALUE "FileDescription", "NeL Patch Paint\0" + VALUE "FileVersion", "0.11.1\0" VALUE "InternalName", "mods\0" - VALUE "LegalCopyright", "Copyright © 1998 Nevrax Ltd\0" + VALUE "LegalCopyright", "Copyright © 2000 Nevrax Ltd\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "nelpatchpaint.dlm\0" VALUE "PrivateBuild", "\0" - VALUE "ProductName", "3D Studio MAX\0" - VALUE "ProductVersion", "3.0.0.0\0" + VALUE "ProductName", "Ryzom Core\0" + VALUE "ProductVersion", "0.11.1\0" VALUE "SpecialBuild", "\0" END END diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint.cpp b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint.cpp index 3fd00f000..73bb142b1 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint.cpp @@ -145,7 +145,7 @@ std::vector symVector; // Painter modes enum TModePaint { ModeTile, ModeColor, ModeDisplace}; -enum TModeMouse { ModePaint, ModeSelect, ModePick, ModeFill, ModeGetState }; +enum TModeMouse { ModePaint, ModeSelect, ModePick, ModeFill, ModeGetState, ModeResetPatch }; /*-------------------------------------------------------------------*/ @@ -2585,6 +2585,13 @@ void mainproc(CScene& scene, CEventListenerAsync& AsyncListener, CEvent3dMouseLi // Set mode modeSelect=ModeGetState; + // Mode reset zone + if (AsyncListener.isKeyDown ((TKey)PainterKeys[ResetPatch])) + { + // Set mode + modeSelect=ModeResetPatch; + } + // Mode picking if (AsyncListener.isKeyDown ((TKey)PainterKeys[Fill0])) { @@ -2891,6 +2898,8 @@ void mainproc(CScene& scene, CEventListenerAsync& AsyncListener, CEvent3dMouseLi SetCursor (bankCont->HFill); else if (pData->pobj->TileTrick) SetCursor (bankCont->HTrick); + else if (modeSelect==ModeResetPatch) + SetCursor (LoadCursor (NULL, IDC_NO)); else SetCursor (LoadCursor (NULL, IDC_ARROW)); @@ -3034,7 +3043,7 @@ private: // Callback on mouse events virtual void operator ()(const CEvent& event) { - if (event==EventDestroyWindowId) + if (event==EventDestroyWindowId || event==EventCloseWindowId) { WindowActive=false; } @@ -3140,9 +3149,30 @@ private: _FillTile.fillColor (mesh1, patch, _VectMesh, maxToNel (color1), (uint16)(256.f*opa1), PaintColor); else if (nModeTexture==ModeDisplace) - // Fill this patch with the current color + // Fill this patch with the current displace _FillTile.fillDisplace (mesh1, patch, _VectMesh, bank); } + else if (modeSelect==ModeResetPatch) + { + int np = _VectMesh[mesh1].PMesh->numPatches; + for (int pp = 0; pp < np; ++pp) + { + // Fill default tile + _FillTile.fillTile (mesh1, pp, _VectMesh, -1, 0, 0, true, bank); + + // Fill default color + _FillTile.fillColor (mesh1, pp, _VectMesh, CRGBA(255, 255, 255), 256, PaintColor); + + // Backup current displace, fill default, restore + int bkdt = _Pobj->DisplaceTile; + int bkdts = _Pobj->DisplaceTileSet; + _Pobj->DisplaceTile = 0; + _Pobj->DisplaceTileSet = -1; + _FillTile.fillDisplace (mesh1, pp, _VectMesh, bank); + _Pobj->DisplaceTile = bkdt; + _Pobj->DisplaceTileSet = bkdts; + } + } } } // Pick with right mouse @@ -4095,7 +4125,7 @@ DWORD WINAPI myThread (LPVOID vData) // Create a Landscape. CLandscapeModel *TheLand= (CLandscapeModel*)CNELU::Scene->createModel(LandscapeModelId); - TheLand->Landscape.setTileNear (1000.f); + TheLand->Landscape.setTileNear (10000.f); TheLand->Landscape.TileBank=bank; // Enbable automatique lighting @@ -4192,7 +4222,7 @@ DWORD WINAPI myThread (LPVOID vData) mat.setPos(P); CNELU::Camera->setTransformMode (ITransformable::DirectMatrix); CNELU::Camera->setMatrix (mat); - CNELU::Camera->setPerspective( 75.f*(float)Pi/180.f/*vp->GetFOV()*/, 1.33f, 0.1f, 1000.f); + CNELU::Camera->setPerspective( 75.f*(float)Pi/180.f/*vp->GetFOV()*/, 1.33f, 0.1f, 10000.f); // Resize the sym vector symVector.resize (pData->VectMesh.size()); @@ -4257,6 +4287,7 @@ DWORD WINAPI myThread (LPVOID vData) CNELU::EventServer.addListener (EventMouseUpId, &listener); CNELU::EventServer.addListener (EventMouseDblClkId, &listener); CNELU::EventServer.addListener (EventDestroyWindowId, &listener); + CNELU::EventServer.addListener (EventCloseWindowId, &listener); CNELU::EventServer.addListener (EventKeyDownId, &listener); // Camera position @@ -4326,6 +4357,7 @@ DWORD WINAPI myThread (LPVOID vData) CNELU::EventServer.removeListener (EventMouseDblClkId, &listener); CNELU::EventServer.removeListener (EventKeyDownId, &listener); CNELU::EventServer.removeListener (EventDestroyWindowId, &listener); + CNELU::EventServer.removeListener (EventCloseWindowId, &listener); // End. //======== diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_ui.cpp b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_ui.cpp index 1c756e0c8..b8503c137 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_ui.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_ui.cpp @@ -43,6 +43,7 @@ uint PainterKeys[KeyCounter]= Key1, Key2, KeyI, + KeyF10, }; // Keys @@ -77,6 +78,7 @@ const char* PainterKeysName[KeyCounter]= "ZoomIn", "ZoomOut", "GetState", + "ResetPatch", }; // Light settings diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_ui.h b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_ui.h index aa56b06ba..13d1708ef 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_ui.h +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_ui.h @@ -122,6 +122,7 @@ enum PainterKeysType ZoomIn, ZoomOut, GetState, + ResetPatch, KeyCounter }; diff --git a/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/dllmain.cpp b/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/dllmain.cpp index 0fdf6db75..ad5393cf5 100644 --- a/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/dllmain.cpp +++ b/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/dllmain.cpp @@ -1,6 +1,7 @@ #include "vertex_tree_paint.h" #include "../nel_3dsmax_shared/nel_3dsmax_shared.h" #include +#include "nel/misc/sheet_id.h" HINSTANCE hInstance; @@ -12,6 +13,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved) { new NLMISC::CLibraryContext(GetSharedNelContext()); nldebug("NeL Vertex Tree Paint: DllMain"); + NLMISC::CSheetId::initWithoutSheet(); } hInstance = hinstDLL; // Hang on to this DLL's instance handle. diff --git a/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.rc b/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.rc index bb9d2cce7..4e70d1afc 100644 --- a/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.rc +++ b/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.rc @@ -125,8 +125,8 @@ IDC_DROPPER_CURSOR CURSOR DISCARDABLE "dropcurs.cur" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,0,0 - PRODUCTVERSION 3,1,0,0 + FILEVERSION 0, 11, 0, 0 + PRODUCTVERSION 0, 11, 0, 0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -141,16 +141,17 @@ BEGIN BEGIN BLOCK "040904b0" BEGIN - VALUE "Comments", "TECH: Christer Janson\0" - VALUE "CompanyName", "Kinetix, a division of Autodesk, Inc.\0" - VALUE "FileDescription", "Vertex Color Paint (plugin)\0" - VALUE "FileVersion", "3.1.0.0\0" - VALUE "InternalName", "VertexPaint\0" - VALUE "LegalCopyright", "Copyright © 1998 Autodesk Inc.\0" + VALUE "Comments", "Based on Kinetix 3D Studio Max 3.1 plugin sample\0" + VALUE "Comments", "TECH: \0" + VALUE "CompanyName", "Ryzom Core\0" + VALUE "FileDescription", "Vertex Tree Paint\0" + VALUE "FileVersion", "0.11.0\0" + VALUE "InternalName", "VertexTreePaint\0" + VALUE "LegalCopyright", "Copyright © 2000 Nevrax Ltd. Copyright © 1998 Autodesk Inc.\0" VALUE "LegalTrademarks", "The following are registered trademarks of Autodesk, Inc.: 3D Studio MAX. The following are trademarks of Autodesk, Inc.: Kinetix, Kinetix(logo), BIPED, Physique, Character Studio, MAX DWG, DWG Unplugged, Heidi, FLI, FLC, DXF.\0" VALUE "OriginalFilename", "nel_vertex_tree_paint.dlm\0" - VALUE "ProductName", "3D Studio MAX\0" - VALUE "ProductVersion", "3.1.0.0\0" + VALUE "ProductName", "Ryzom Core\0" + VALUE "ProductVersion", "0.11.0\0" END END BLOCK "VarFileInfo" diff --git a/code/nel/tools/3d/plugin_max/scripts/nel_assets_ps_batched.ms b/code/nel/tools/3d/plugin_max/scripts/nel_assets_ps_batched.ms new file mode 100644 index 000000000..f8165e25e --- /dev/null +++ b/code/nel/tools/3d/plugin_max/scripts/nel_assets_ps_batched.ms @@ -0,0 +1,378 @@ + +NEL3D_APPDATA_INTERFACE_FILE = 1423062700 + +-- Allocate 20 Me for the script +heapSize += 15000000 + +nlErrorFilename = "W:/database/conversion.log" +nlErrorStream = openFile nlErrorFilename mode:"w" +if nlErrorStream == undefined then + nlErrorStream = createFile nlErrorFilename + +-- Log a message +fn nllog message = +( + if nlErrorStream != undefined then + ( + format "%\n" message to:nlErrorStream + flush nlErrorStream + ) + + -- To the console + print message +) + +include "nel_utility.ms" + +fn findFile dir fileName = +( + if (doesFileExist (dir + "\\" + fileName)) then + ( + return (dir + "\\" + fileName) + ) + + dirArr = GetDirectories (dir + "\\*") + + for d in dirArr do + ( + local fileFound = findFile d fileName + if (fileFound != "") then + return fileFound + ) + + return "" +) + +fn getFixedPath ps = +( + if not (doesFileExist ps) then + ( + local fileName = filenameFromPath ps + local fileFound = findFile "W:\\database\\sfx" fileName + if (fileFound != "") then + return fileFound + else + return fileName + ) + else + ( + return ps + ) +) + +fn renameParticleSystem ps = +( + local newFileName = getFixedPath ps.ps_file_name + if (newFileName != ps.ps_file_name) then + ( + ps.ps_file_name = newFileName + return 1 + ) + else + ( + return 0 + ) +) + + +rollout assets_ps_rollout "Properties" +( + fn do_it = + ( + local result = 0 + + for m in getClassInstances nel_ps do + ( + if (renameParticleSystem m) == 1 then + result = 1 + ) + + max select none + + actionMan.executeAction 0 "40021" -- Selection: Select All + actionMan.executeAction 0 "311" -- Tools: Zoom Extents All Selected + actionMan.executeAction 0 "40807" -- Views: Activate All Maps + actionMan.executeAction 0 "63508" -- Views: Standard Display with Maps + actionMan.executeAction 0 "40043" -- Selection: Select None + + max views redraw + + return result + ) + + -- This script is a base script to include to add multiple functionality to your script + + -- To use this script + -- Include it in your script into the rollout at the beginning. + -- Implement a do_it function to do the job in your rollout. + -- The function should retun -1 if an arror occured, else the count of modification done + -- It the function returns <1, the project will not be overwritten + + Group "Running properties" + ( + RadioButtons SourceFiles "Source projects" labels:#("Current project", "All Projects in a folder") align:#left + + Label DirectoryLabel "Source directory" align:#left + EditText Directory "" width:500 align:#left enabled:false + Button BrowseDirectory "Browse..." align:#left enabled:false + + CheckBox Recurse "Look in subfolders" checked:true enabled:false + CheckBox Test "Test only, do not save" checked:false enabled:false + CheckBox BackupFiles "Backup files" checked:false enabled:false + CheckBox StopOnError "Stop on error" checked:false enabled:false + CheckBox UseTag "Use tag" checked:false enabled:false + + Label ProgressText width:500 align:#left + ProgressBar Progress width:500 align:#left + + Button GoButton "Go" width:500 align:#left + ) + + local countModifications + local countErrors + local fileModified + local fileParsed + + fn UpdateData = + ( + if SourceFiles.state == 2 then + isSourceDir = true + else + isSourceDir = false + if Test.checked == true then + isTest = true + else + isTest = false + + Directory.enabled = isSourceDir + BrowseDirectory.enabled = isSourceDir + Recurse.enabled = isSourceDir + Test.enabled = isSourceDir + BackupFiles.enabled = isSourceDir and (isTest == false) + StopOnError.enabled = isSourceDir + UseTag.enabled = isSourceDir + ) + + on SourceFiles changed state do + ( + UpdateData () + ) + + on Test changed state do + ( + UpdateData () + ) + + fn call_do_it = + ( + local result + + -- One more project + fileParsed = fileParsed + 1 + + -- Call it + result = do_it () + + -- Error ? + if result < 0 then + countErrors = countErrors + 1 + else + countModifications = countModifications + result + + -- Return result + return result + ) + + fn BackupFile file = + ( + local i + local newFilename + + i = 0 + while true do + ( + -- New file name + newFilename = file + ".backup_" + (i as string) + + -- File exist ? + if (fileExist newFilename) == false then + ( + if (copyFile file newFilename) == false then + return false + else + return true + ) + i = i + 1 + ) + ) + + fn RecurseFolder currentDirectory = + ( + resetMAXFile #noprompt + + local result + local file + local files + local origAnimStart + local origAnimEnd + local origFrameRate + + -- Parse files + files = getFiles (currentDirectory+"/*.max") + + -- For each files + for i = 1 to files.count do + ( + -- File name + file = files[i] + + -- Progress bar + ProgressText.text = "In directory "+currentDirectory+", compute file \"" + (getFilenameFile file) + "\"" + Progress.value = i*100/files.count + + if (UseTag.checked == false) or ((NeLTestFileDate file "W:/database/conversion.tag") == true) then + ( + resetMAXFile #noprompt + + nllog("CONVERT " + file) + + -- Open the max project + if loadMaxFile file quiet:true == true then + ( + objXRefMgr.UpdateAllRecords() + + result = call_do_it () + + -- Error ? + if result < 0 then + ( + if StopOnError.checked == true then + Messagebox ("Error in file " + file) + ) + else + ( + -- Save the max project ? + if (Test.checked == false) and (result != 0) then + ( + -- Backup the max project ? + local ok + ok = true + if BackupFiles.checked == true then + ( + -- Backup the file + if (BackupFile file) == false then + ( + -- Don't save the file because backup has failed + ok = false + + if StopOnError.checked == true then + Messagebox ("Can't backup file " + file) + + -- One more error + countErrors = countErrors + 1 + ) + ) + + -- Save the max project ? + if ok == true then + ( + if (saveMaxFile file) == true then + ( + fileModified = fileModified + 1 + ) + else + ( + if StopOnError.checked == true then + Messagebox ("Can't write file " + file) + + -- One more error + countErrors = countErrors + 1 + ) + ) + ) + ) + ) + else + ( + if StopOnError.checked == true then + Messagebox ("Can't load file " + file) + + -- One more error + countErrors = countErrors + 1 + ) + ) + else + ( + nllog("SKIP " + file + " by tag") + ) + ) + + -- Parse sub directory ? + if (Recurse.checked == true) then + ( + local directories + + -- Get the directories + directories = getDirectories (currentDirectory+"/*") + + -- For each directories + for dir in directories do + ( + RecurseFolder dir + ) + ) + ) + + on BrowseDirectory pressed do + ( + local dir + try + ( + dir = getSavePath () -- caption:"Select the projects directory" + if dir != undefined then + Directory.text = dir + ) + catch + ( + ) + ) + + on GoButton pressed do + ( + -- Reset count + countModifications = 0 + countErrors = 0 + fileModified = 0 + fileParsed = 0 + + -- Get files in the shape_source_directory + if SourceFiles.state == 2 then + ( + -- Should warning user ? + if (SourceFiles.state == 2) and (Test.checked == false) then + ( + -- Warning ! + if ((queryBox "Warning, all the files in the specified folders will be overwrited.\nYou should backup your files before executing this script.\nDo you want to continue executing this script ?" beep:true) == true) then + RecurseFolder (adjustPathStringForScript Directory.text) + ) + else + ( + RecurseFolder (adjustPathStringForScript Directory.text) + ) + ) + else + ( + -- Just compute the current project + call_do_it () + ) + + -- Show errors + ProgressText.text = (fileParsed as string) + " project(s) opened, " + (countModifications as string) + " project modification(s), " + (fileModified as string) + " project(s) saved, " + (countErrors as string) + " error(s)." + Progress.value = 100 + ) +) + +assets_ps_floater = newRolloutFloater "NeL Assets PS Database" 550 400 +addrollout assets_ps_rollout assets_ps_floater rolledUp:false + + diff --git a/code/nel/tools/3d/plugin_max/scripts/nel_assets_resave.ms b/code/nel/tools/3d/plugin_max/scripts/nel_assets_resave.ms new file mode 100644 index 000000000..ab9e45325 --- /dev/null +++ b/code/nel/tools/3d/plugin_max/scripts/nel_assets_resave.ms @@ -0,0 +1,329 @@ + +NEL3D_APPDATA_INTERFACE_FILE = 1423062700 + +-- Allocate 20 Me for the script +heapSize += 15000000 + +nlErrorFilename = "W:/database/conversion.log" +nlErrorStream = openFile nlErrorFilename mode:"w" +if nlErrorStream == undefined then + nlErrorStream = createFile nlErrorFilename + +-- Log a message +fn nllog message = +( + if nlErrorStream != undefined then + ( + format "%\n" message to:nlErrorStream + flush nlErrorStream + ) + + -- To the console + print message +) + +include "nel_utility.ms" + +rollout assets_resave_rollout "Properties" +( + fn do_it = + ( + max select none + + actionMan.executeAction 0 "40021" -- Selection: Select All + actionMan.executeAction 0 "311" -- Tools: Zoom Extents All Selected + actionMan.executeAction 0 "40807" -- Views: Activate All Maps + actionMan.executeAction 0 "63508" -- Views: Standard Display with Maps + actionMan.executeAction 0 "40043" -- Selection: Select None + + max views redraw + + return 1 + ) + + -- This script is a base script to include to add multiple functionality to your script + + -- To use this script + -- Include it in your script into the rollout at the beginning. + -- Implement a do_it function to do the job in your rollout. + -- The function should retun -1 if an arror occured, else the count of modification done + -- It the function returns <1, the project will not be overwritten + + Group "Running properties" + ( + RadioButtons SourceFiles "Source projects" labels:#("Current project", "All Projects in a folder") align:#left + + Label DirectoryLabel "Source directory" align:#left + EditText Directory "" width:500 align:#left enabled:false + Button BrowseDirectory "Browse..." align:#left enabled:false + + CheckBox Recurse "Look in subfolders" checked:true enabled:false + CheckBox Test "Test only, do not save" checked:false enabled:false + CheckBox BackupFiles "Backup files" checked:false enabled:false + CheckBox StopOnError "Stop on error" checked:false enabled:false + CheckBox UseTag "Use tag" checked:false enabled:false + + Label ProgressText width:500 align:#left + ProgressBar Progress width:500 align:#left + + Button GoButton "Go" width:500 align:#left + ) + + local countModifications + local countErrors + local fileModified + local fileParsed + + fn UpdateData = + ( + if SourceFiles.state == 2 then + isSourceDir = true + else + isSourceDir = false + if Test.checked == true then + isTest = true + else + isTest = false + + Directory.enabled = isSourceDir + BrowseDirectory.enabled = isSourceDir + Recurse.enabled = isSourceDir + Test.enabled = isSourceDir + BackupFiles.enabled = isSourceDir and (isTest == false) + StopOnError.enabled = isSourceDir + UseTag.enabled = isSourceDir + ) + + on SourceFiles changed state do + ( + UpdateData () + ) + + on Test changed state do + ( + UpdateData () + ) + + fn call_do_it = + ( + local result + + -- One more project + fileParsed = fileParsed + 1 + + -- Call it + result = do_it () + + -- Error ? + if result < 0 then + countErrors = countErrors + 1 + else + countModifications = countModifications + result + + -- Return result + return result + ) + + fn BackupFile file = + ( + local i + local newFilename + + i = 0 + while true do + ( + -- New file name + newFilename = file + ".backup_" + (i as string) + + -- File exist ? + if (fileExist newFilename) == false then + ( + if (copyFile file newFilename) == false then + return false + else + return true + ) + i = i + 1 + ) + ) + + fn RecurseFolder currentDirectory = + ( + resetMAXFile #noprompt + + local result + local file + local files + local origAnimStart + local origAnimEnd + local origFrameRate + + -- Parse files + files = getFiles (currentDirectory+"/*.max") + + -- For each files + for i = 1 to files.count do + ( + -- File name + file = files[i] + + -- Progress bar + ProgressText.text = "In directory "+currentDirectory+", compute file \"" + (getFilenameFile file) + "\"" + Progress.value = i*100/files.count + + if (UseTag.checked == false) or ((NeLTestFileDate file "W:/database/conversion.tag") == true) then + ( + resetMAXFile #noprompt + + nllog("CONVERT " + file) + + -- Open the max project + if loadMaxFile file quiet:true == true then + ( + origAnimStart = animationRange.start + origAnimEnd = animationRange.end + origFrameRate = frameRate + + resetMAXFile #noprompt + + animationRange = interval origAnimStart origAnimEnd + frameRate = origFrameRate + + -- Merge the max project + if mergeMaxFile file quiet:true == true then + ( + result = call_do_it () + + -- Error ? + if result < 0 then + ( + if StopOnError.checked == true then + Messagebox ("Error in file " + file) + ) + else + ( + -- Save the max project ? + if (Test.checked == false) and (result != 0) then + ( + -- Backup the max project ? + local ok + ok = true + if BackupFiles.checked == true then + ( + -- Backup the file + if (BackupFile file) == false then + ( + -- Don't save the file because backup has failed + ok = false + + if StopOnError.checked == true then + Messagebox ("Can't backup file " + file) + + -- One more error + countErrors = countErrors + 1 + ) + ) + + -- Save the max project ? + if ok == true then + ( + if (saveMaxFile file) == true then + ( + fileModified = fileModified + 1 + ) + else + ( + if StopOnError.checked == true then + Messagebox ("Can't write file " + file) + + -- One more error + countErrors = countErrors + 1 + ) + ) + ) + ) + ) + else + ( + if StopOnError.checked == true then + Messagebox ("Can't load file " + file) + + -- One more error + countErrors = countErrors + 1 + ) + ) + ) + else + ( + nllog("SKIP " + file + " by tag") + ) + ) + + -- Parse sub directory ? + if (Recurse.checked == true) then + ( + local directories + + -- Get the directories + directories = getDirectories (currentDirectory+"/*") + + -- For each directories + for dir in directories do + ( + RecurseFolder dir + ) + ) + ) + + on BrowseDirectory pressed do + ( + local dir + try + ( + dir = getSavePath () -- caption:"Select the projects directory" + if dir != undefined then + Directory.text = dir + ) + catch + ( + ) + ) + + on GoButton pressed do + ( + -- Reset count + countModifications = 0 + countErrors = 0 + fileModified = 0 + fileParsed = 0 + + -- Get files in the shape_source_directory + if SourceFiles.state == 2 then + ( + -- Should warning user ? + if (SourceFiles.state == 2) and (Test.checked == false) then + ( + -- Warning ! + if ((queryBox "Warning, all the files in the specified folders will be overwrited.\nYou should backup your files before executing this script.\nDo you want to continue executing this script ?" beep:true) == true) then + RecurseFolder (adjustPathStringForScript Directory.text) + ) + else + ( + RecurseFolder (adjustPathStringForScript Directory.text) + ) + ) + else + ( + -- Just compute the current project + call_do_it () + ) + + -- Show errors + ProgressText.text = (fileParsed as string) + " project(s) opened, " + (countModifications as string) + " project modification(s), " + (fileModified as string) + " project(s) saved, " + (countErrors as string) + " error(s)." + Progress.value = 100 + ) +) + +assets_resave_floater = newRolloutFloater "NeL Assets Resave Database" 550 874 +addrollout assets_resave_rollout assets_resave_floater rolledUp:false + diff --git a/code/nel/tools/3d/plugin_max/scripts/nel_assets_resave_hard.ms b/code/nel/tools/3d/plugin_max/scripts/nel_assets_resave_hard.ms new file mode 100644 index 000000000..05220c7a5 --- /dev/null +++ b/code/nel/tools/3d/plugin_max/scripts/nel_assets_resave_hard.ms @@ -0,0 +1,316 @@ + +NEL3D_APPDATA_INTERFACE_FILE = 1423062700 + +-- Allocate 20 Me for the script +heapSize += 15000000 + +nlErrorFilename = "W:/database/conversion.log" +nlErrorStream = openFile nlErrorFilename mode:"w" +if nlErrorStream == undefined then + nlErrorStream = createFile nlErrorFilename + +-- Log a message +fn nllog message = +( + if nlErrorStream != undefined then + ( + format "%\n" message to:nlErrorStream + flush nlErrorStream + ) + + -- To the console + print message +) + +include "nel_utility.ms" + +rollout assets_resave_rollout "Properties" +( + fn do_it = + ( + max select none + + actionMan.executeAction 0 "40021" -- Selection: Select All + actionMan.executeAction 0 "311" -- Tools: Zoom Extents All Selected + actionMan.executeAction 0 "40807" -- Views: Activate All Maps + actionMan.executeAction 0 "63508" -- Views: Standard Display with Maps + actionMan.executeAction 0 "40043" -- Selection: Select None + + max views redraw + + return 1 + ) + + -- This script is a base script to include to add multiple functionality to your script + + -- To use this script + -- Include it in your script into the rollout at the beginning. + -- Implement a do_it function to do the job in your rollout. + -- The function should retun -1 if an arror occured, else the count of modification done + -- It the function returns <1, the project will not be overwritten + + Group "Running properties" + ( + RadioButtons SourceFiles "Source projects" labels:#("Current project", "All Projects in a folder") align:#left + + Label DirectoryLabel "Source directory" align:#left + EditText Directory "" width:500 align:#left enabled:false + Button BrowseDirectory "Browse..." align:#left enabled:false + + CheckBox Recurse "Look in subfolders" checked:true enabled:false + CheckBox Test "Test only, do not save" checked:false enabled:false + CheckBox BackupFiles "Backup files" checked:false enabled:false + CheckBox StopOnError "Stop on error" checked:false enabled:false + CheckBox UseTag "Use tag" checked:false enabled:false + + Label ProgressText width:500 align:#left + ProgressBar Progress width:500 align:#left + + Button GoButton "Go" width:500 align:#left + ) + + local countModifications + local countErrors + local fileModified + local fileParsed + + fn UpdateData = + ( + if SourceFiles.state == 2 then + isSourceDir = true + else + isSourceDir = false + if Test.checked == true then + isTest = true + else + isTest = false + + Directory.enabled = isSourceDir + BrowseDirectory.enabled = isSourceDir + Recurse.enabled = isSourceDir + Test.enabled = isSourceDir + BackupFiles.enabled = isSourceDir and (isTest == false) + StopOnError.enabled = isSourceDir + UseTag.enabled = isSourceDir + ) + + on SourceFiles changed state do + ( + UpdateData () + ) + + on Test changed state do + ( + UpdateData () + ) + + fn call_do_it = + ( + local result + + -- One more project + fileParsed = fileParsed + 1 + + -- Call it + result = do_it () + + -- Error ? + if result < 0 then + countErrors = countErrors + 1 + else + countModifications = countModifications + result + + -- Return result + return result + ) + + fn BackupFile file = + ( + local i + local newFilename + + i = 0 + while true do + ( + -- New file name + newFilename = file + ".backup_" + (i as string) + + -- File exist ? + if (fileExist newFilename) == false then + ( + if (copyFile file newFilename) == false then + return false + else + return true + ) + i = i + 1 + ) + ) + + fn RecurseFolder currentDirectory = + ( + resetMAXFile #noprompt + + local result + local file + local files + local origAnimStart + local origAnimEnd + local origFrameRate + + -- Parse files + files = getFiles (currentDirectory+"/*.max") + + -- For each files + for i = 1 to files.count do + ( + -- File name + file = files[i] + + -- Progress bar + ProgressText.text = "In directory "+currentDirectory+", compute file \"" + (getFilenameFile file) + "\"" + Progress.value = i*100/files.count + + if (UseTag.checked == false) or ((NeLTestFileDate file "W:/database/conversion.tag") == true) then + ( + resetMAXFile #noprompt + + nllog("CONVERT " + file) + + -- Merge the max project + if mergeMaxFile file quiet:true == true then + ( + result = call_do_it () + + -- Error ? + if result < 0 then + ( + if StopOnError.checked == true then + Messagebox ("Error in file " + file) + ) + else + ( + -- Save the max project ? + if (Test.checked == false) and (result != 0) then + ( + -- Backup the max project ? + local ok + ok = true + if BackupFiles.checked == true then + ( + -- Backup the file + if (BackupFile file) == false then + ( + -- Don't save the file because backup has failed + ok = false + + if StopOnError.checked == true then + Messagebox ("Can't backup file " + file) + + -- One more error + countErrors = countErrors + 1 + ) + ) + + -- Save the max project ? + if ok == true then + ( + if (saveMaxFile file) == true then + ( + fileModified = fileModified + 1 + ) + else + ( + if StopOnError.checked == true then + Messagebox ("Can't write file " + file) + + -- One more error + countErrors = countErrors + 1 + ) + ) + ) + ) + ) + else + ( + if StopOnError.checked == true then + Messagebox ("Can't load file " + file) + + -- One more error + countErrors = countErrors + 1 + ) + ) + else + ( + nllog("SKIP " + file + " by tag") + ) + ) + + -- Parse sub directory ? + if (Recurse.checked == true) then + ( + local directories + + -- Get the directories + directories = getDirectories (currentDirectory+"/*") + + -- For each directories + for dir in directories do + ( + RecurseFolder dir + ) + ) + ) + + on BrowseDirectory pressed do + ( + local dir + try + ( + dir = getSavePath () -- caption:"Select the projects directory" + if dir != undefined then + Directory.text = dir + ) + catch + ( + ) + ) + + on GoButton pressed do + ( + -- Reset count + countModifications = 0 + countErrors = 0 + fileModified = 0 + fileParsed = 0 + + -- Get files in the shape_source_directory + if SourceFiles.state == 2 then + ( + -- Should warning user ? + if (SourceFiles.state == 2) and (Test.checked == false) then + ( + -- Warning ! + if ((queryBox "Warning, all the files in the specified folders will be overwrited.\nYou should backup your files before executing this script.\nDo you want to continue executing this script ?" beep:true) == true) then + RecurseFolder (adjustPathStringForScript Directory.text) + ) + else + ( + RecurseFolder (adjustPathStringForScript Directory.text) + ) + ) + else + ( + -- Just compute the current project + call_do_it () + ) + + -- Show errors + ProgressText.text = (fileParsed as string) + " project(s) opened, " + (countModifications as string) + " project modification(s), " + (fileModified as string) + " project(s) saved, " + (countErrors as string) + " error(s)." + Progress.value = 100 + ) +) + +assets_resave_floater = newRolloutFloater "NeL Assets Resave Database Hard" 550 874 +addrollout assets_resave_rollout assets_resave_floater rolledUp:false + diff --git a/code/nel/tools/3d/plugin_max/scripts/nel_orient_zones.ms b/code/nel/tools/3d/plugin_max/scripts/nel_orient_zones.ms new file mode 100644 index 000000000..26fd67171 --- /dev/null +++ b/code/nel/tools/3d/plugin_max/scripts/nel_orient_zones.ms @@ -0,0 +1,124 @@ + +gc() +nodes = getCurrentSelection() +max select none +clearselection() + +undo off +( + for cnode in nodes do + ( + if (classof cnode) == Editable_Patch or (classof cnode) == RklPatch then + ( + print cnode.name + selectmore cnode + if (classof cnode) == Editable_Patch and (classof cnode) != RklPatch then + ( + modPanel.addModToSelection (NeL_Convert ()) ui:on + ) + modPanel.addModToSelection (NeL_Edit ()) ui:on + setCommandPanelTaskMode #modify + cmod = modpanel.getCurrentObject() + pcount = (GetRykolPatchCount cnode) + print pcount + for p = 1 to pcount do + ( + --print p + vbegin = (NeLGetPatchVertex cnode p 1) + vend = (NeLGetPatchVertex cnode p 2) + vref = (NeLGetPatchVertex cnode p 3) + begin = (GetRykolVertexPos cnode vbegin) + end = (GetRykolVertexPos cnode vend) + ref = (GetRykolVertexPos cnode vref) + normal = (cross (end - begin) (ref - begin)) + normal = (normalize normal) + + rotnormal = (point3 0 0 0) + if (normal.z > 0.9) then + ( + --print "x normal" + rotnormal = (normal * (rotateXMatrix -90)) + ) + else + ( + normal.z = 0 + normal = (normalize normal) + rotnormal = (normal * (rotateZMatrix -90)) + ) + --print rotnormal + + -- print normal + -- print rotnormal + -- print begin + -- print end + dir = (normalize (end - begin)) + -- print dir + score1 = (dot dir rotnormal) + + RykolTurnPatch cnode cmod (p) + vbegin = (NeLGetPatchVertex cnode p 1) + vend = (NeLGetPatchVertex cnode p 2) + begin = (GetRykolVertexPos cnode vbegin) + end = (GetRykolVertexPos cnode vend) + dir = (normalize (end - begin)) + score2 = (dot dir rotnormal) + + RykolTurnPatch cnode cmod (p) + vbegin = (NeLGetPatchVertex cnode p 1) + vend = (NeLGetPatchVertex cnode p 2) + begin = (GetRykolVertexPos cnode vbegin) + end = (GetRykolVertexPos cnode vend) + dir = (normalize (end - begin)) + score3 = (dot dir rotnormal) + + RykolTurnPatch cnode cmod (p) + vbegin = (NeLGetPatchVertex cnode p 1) + vend = (NeLGetPatchVertex cnode p 2) + begin = (GetRykolVertexPos cnode vbegin) + end = (GetRykolVertexPos cnode vend) + dir = (normalize (end - begin)) + score4 = (dot dir rotnormal) + + -- print score1 + -- print score2 + -- print score3 + -- print score4 + + if (score1 > score2 and score1 > score3 and score1 > score4) then + ( + -- print "score 1" + RykolTurnPatch cnode cmod (p) + ) + else if (score2 > score3 and score2 > score4) then + ( + -- print "score 2" + RykolTurnPatch cnode cmod (p) + RykolTurnPatch cnode cmod (p) + ) + else if (score3 > score4) then + ( + -- print "score 3" + RykolTurnPatch cnode cmod (p) + RykolTurnPatch cnode cmod (p) + RykolTurnPatch cnode cmod (p) + ) + else + ( + -- print "score 4" + ) + ) + maxOps.CollapseNode cnode off + max select none + ) + ) +) + +max select none +clearselection() +undo off +( + for cnode in nodes do + ( + selectmore cnode + ) +) diff --git a/code/nel/tools/3d/plugin_max/scripts/nel_zone_namer.ms b/code/nel/tools/3d/plugin_max/scripts/nel_zone_namer.ms new file mode 100644 index 000000000..e651dd76a --- /dev/null +++ b/code/nel/tools/3d/plugin_max/scripts/nel_zone_namer.ms @@ -0,0 +1,68 @@ +-- This script sets proper centered zone positions and generates their names +-- Use after cutting the zone into 160m by 160m pieces + +cell_size = 160.0 +offset_x = 7680 / 2 +offset_y = -(20480 + (5120 / 2)) + +alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + +-- http://proofofprogress.blogspot.be/2011/03/solution-align-pivot-to-world-without.html +Function alignPivotToWorld &theObject = ( + --VLM = Visible Local Matrix. + --The matrix/pivot you see when selecting object and "Local" axis is selected as viewable. + VLM = theObject.Transform; + IP_LocalRot = theObject.objectOffsetRot; --Rotation to be used later. + IP_LOCAL = theObject.objectOffsetPos; --Invisible Pivot Local coordinates + --In relation to VLM matrix. + IP_WORLD = IP_LOCAL * VLM; --World Coordinates of Invisible Pivot. [Local To World Transform] + VLM_0 = matrix3 1; --Reset Visible Local matrix coordinates. + + NEW_IP_LOCAL = IP_WORLD * inverse(VLM_0); --[World To local Transform] + + theObject.Transform = VLM_0; + theObject.objectOffsetPos = NEW_IP_LOCAL; + + --Now Handle Rotation: + --Since rotation of visible local matrix has been zeroed out, + --You must add that loss to the invisible pivot rotation. + GeomWorldRot = VLM.RotationPart + IP_LocalRot; + theObject.objectOffsetRot = GeomWorldRot; +) + +-- Convert a coordinate in a name +-- name = coordToName #(x, y) +fn coordToName coord = +( + up = floor(coord[1] / 26) + 1 + down = floor(coord[1] - ((up-1) * 26)) + 1 + return (((-coord[2] + 1) as integer) as string) + "_" + alphabet[up] + alphabet[down] +) + +fn realCoordToName coord = +( + return coordToName(#(((coord[1] + offset_x) / cell_size) + 0.5, ((coord[2] + offset_y) / cell_size) + 0.5)) +) + +fn roundedCoord coord = +( + return #(ceil(coord[1] / cell_size) * cell_size - (cell_size / 2), ceil(coord[2] / cell_size) * cell_size - (cell_size / 2)) +) + +max select none +clearselection() + +for node in geometry do +( + if (classof node) == RklPatch or (classof node) == Editable_Patch then + ( + newcoords = roundedCoord(#(node.center.x, node.center.y)) + newname = realCoordToName(newcoords) + node.name = newname + alignPivotToWorld &node + node.pivot.x = newcoords[1] + node.pivot.y = newcoords[2] + resetxform node + maxOps.CollapseNode node off + ) +) diff --git a/code/nel/tools/3d/plugin_max/scripts/nel_zone_snapshot.ms b/code/nel/tools/3d/plugin_max/scripts/nel_zone_snapshot.ms new file mode 100644 index 000000000..edab4f35d --- /dev/null +++ b/code/nel/tools/3d/plugin_max/scripts/nel_zone_snapshot.ms @@ -0,0 +1,162 @@ +-- Use to take the snapshots of a large manually created zone + +from_x = 160 +size_x = 7680-320 +from_y = -25600+160 +size_y = 5120-320 + +targetdir = "W:/database/landscape/ligo/asteroids/max" +snapshotdir = "W:/database/landscape/ligo/asteroids/zonebitmaps" +zonename = "anne" +resumeonly = true + +cell_size = 160.0 + +alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + +fn lowercase instring = -- beginning of function definition +( + local upper, lower, outstring -- declare variables as local + upper="ABCDEFGHIJKLMNOPQRSTUVWXYZ" -- set variables to literals + lower="abcdefghijklmnopqrstuvwxyz" + outstring=copy instring + for i=1 to outstring.count do + ( + j=findString upper outstring[i] + if (j != undefined) do outstring[i]=lower[j] + ) + return outstring -- value of outstring will be returned as function result +) + +fn existFile fname = (getfiles fname).count != 0 + +-- Convert a coordinate in a name +-- name = coordToName #(x, y) +fn coordToName coord = +( + up = floor(coord[1] / 26) + 1 + down = floor(coord[1] - ((up-1) * 26)) + 1 + return (((-coord[2] + 1) as integer) as string) + "_" + alphabet[up] + alphabet[down] +) + +fn roundedCoord coord = +( + return #(ceil(coord[1] / cell_size) * cell_size - (cell_size / 2), ceil(coord[2] / cell_size) * cell_size - (cell_size / 2)) +) + +fn coordId coord = +( + coordr = (roundedCoord coord) + return #(((coordr[1]) / cell_size) + 0.5, ((coordr[2]) / cell_size) + 0.5) +) + +from_coord = (coordId #(from_x, from_y)) +to_coord = (coordId #(from_x + size_x, from_y + size_y)) + +print from_coord +print to_coord + +print (coordToName from_coord) + +undo off +( + for x=from_coord[1] to to_coord[1] do + ( + for y=from_coord[2] to to_coord[2] do + ( + ny=y+1 + sy=y-1 + ex=x+1 + wx=x-1 + zc = coordToName #(x, y) + zn = coordToName #(x, ny) + zne = coordToName #(ex, ny) + ze = coordToName #(ex, y) + zse = coordToName #(ex, sy) + zs = coordToName #(x, sy) + zsw = coordToName #(wx, sy) + zw = coordToName #(wx, y) + znw = coordToName #(wx, ny) + maxc = targetdir + "/zonematerial-" + zonename + "-" + (lowercase zc) + ".max" + csnapfile = snapshotdir + "/" + zonename + "-" + (lowercase zc) + ".tga" + if existFile maxc and (not resumeonly or not (existFile csnapfile)) then + ( + print zc + resetMAXFile #noprompt + gc() + mergeMAXFile maxc #(zc) + ccenter = getnodebyname zc + maxn = targetdir + "/zonematerial-" + zonename + "-" + (lowercase zn) + ".max" + if existFile maxn then + ( + mergeMAXFile maxn #(zn) + cnode = getnodebyname zn + cnode.position.y = cnode.position.y + 160 + NeLAttachPatchMesh cnode ccenter + ) + maxne = targetdir + "/zonematerial-" + zonename + "-" + (lowercase zne) + ".max" + if existFile maxne then + ( + mergeMAXFile maxne #(zne) + cnode = getnodebyname zne + cnode.position.x = cnode.position.x + 160 + cnode.position.y = cnode.position.y + 160 + NeLAttachPatchMesh cnode ccenter + ) + maxe = targetdir + "/zonematerial-" + zonename + "-" + (lowercase ze) + ".max" + if existFile maxe then + ( + mergeMAXFile maxe #(ze) + cnode = getnodebyname ze + cnode.position.x = cnode.position.x + 160 + NeLAttachPatchMesh cnode ccenter + ) + maxse = targetdir + "/zonematerial-" + zonename + "-" + (lowercase zse) + ".max" + if existFile maxse then + ( + mergeMAXFile maxse #(zse) + cnode = getnodebyname zse + cnode.position.x = cnode.position.x + 160 + cnode.position.y = cnode.position.y - 160 + NeLAttachPatchMesh cnode ccenter + ) + maxs = targetdir + "/zonematerial-" + zonename + "-" + (lowercase zs) + ".max" + if existFile maxs then + ( + mergeMAXFile maxs #(zs) + cnode = getnodebyname zs + cnode.position.y = cnode.position.y - 160 + NeLAttachPatchMesh cnode ccenter + ) + maxsw = targetdir + "/zonematerial-" + zonename + "-" + (lowercase zsw) + ".max" + if existFile maxsw then + ( + mergeMAXFile maxsw #(zsw) + cnode = getnodebyname zsw + cnode.position.x = cnode.position.x - 160 + cnode.position.y = cnode.position.y - 160 + --NeLAttachPatchMesh cnode ccenter + ) + maxw = targetdir + "/zonematerial-" + zonename + "-" + (lowercase zw) + ".max" + if existFile maxw then + ( + mergeMAXFile maxw #(zw) + cnode = getnodebyname zw + cnode.position.x = cnode.position.x - 160 + NeLAttachPatchMesh cnode ccenter + ) + maxnw = targetdir + "/zonematerial-" + zonename + "-" + (lowercase znw) + ".max" + if existFile maxnw then + ( + mergeMAXFile maxnw #(znw) + cnode = getnodebyname znw + cnode.position.x = cnode.position.x - 160 + cnode.position.y = cnode.position.y + 160 + NeLAttachPatchMesh cnode ccenter + ) + NeLWeldPatchMesh ccenter 1.0 + NeLLigoMakeSnapShot ccenter csnapfile 0 1 0 1 false + ) + ) + ) +) diff --git a/code/nel/tools/3d/plugin_max/scripts/startup/nel_material.ms b/code/nel/tools/3d/plugin_max/scripts/startup/nel_material.ms index 06021c45f..95c76c894 100644 --- a/code/nel/tools/3d/plugin_max/scripts/startup/nel_material.ms +++ b/code/nel/tools/3d/plugin_max/scripts/startup/nel_material.ms @@ -545,7 +545,7 @@ plugin material NelMaterial rollout nelBasicParameters "NeL Basic Parameters" rolledUp:false ( Label lblNlbpA "NeL Material" align:#center across:3 - Label lblNlbpB "http://dev.ryzom.com/" align:#center + Label lblNlbpB "http://www.ryzomcore.org/" align:#center CheckBox cbTwoSided "2-Sided" checked:false align:#right group "Standard Lighting" @@ -595,7 +595,7 @@ plugin material NelMaterial cpSelfIllumColor.visible = bUseSelfIllumColor ) else - ( + ( bTwoSided = cbTwoSided.checked cAmbient = cpAmbient.color cDiffuse = cpDiffuse.color @@ -607,6 +607,9 @@ plugin material NelMaterial pSelfIllumAmount = spSelfIllumAmount.value bUseSelfIllumColor = cbUseSelfIllumColor.checked + spSelfIllumAmount.visible = not cbUseSelfIllumColor.checked + cpSelfIllumColor.visible = cbUseSelfIllumColor.checked + delegate.twoSided = bTwoSided delegate.ambient = cAmbient delegate.diffuse = cDiffuse @@ -2211,6 +2214,18 @@ plugin material NelMaterial on create do ( + -- Load from Standard + bTwoSided = delegate.twoSided + cAmbient = delegate.ambient + cDiffuse = delegate.diffuse + pOpacity = delegate.opacity + cSpecular = delegate.specular + pSpecularLevel = delegate.specularLevel + pGlossiness = delegate.glossiness + cSelfIllumColor = delegate.selfIllumColor + pSelfIllumAmount = delegate.selfIllumAmount + bUseSelfIllumColor = delegate.useSelfIllumColor + -- Single shader loadShader ShaderSingleTexture ) diff --git a/code/nel/tools/3d/plugin_max/tile_utility/DllEntry.cpp b/code/nel/tools/3d/plugin_max/tile_utility/DllEntry.cpp index fbd53ca37..eb39f7cb0 100644 --- a/code/nel/tools/3d/plugin_max/tile_utility/DllEntry.cpp +++ b/code/nel/tools/3d/plugin_max/tile_utility/DllEntry.cpp @@ -21,6 +21,7 @@ #include "../nel_3dsmax_shared/nel_3dsmax_shared.h" #include #include +#include "nel/misc/sheet_id.h" extern ClassDesc2* GetTile_utilityDesc(); extern ClassDesc* GetRGBAddDesc(); @@ -41,6 +42,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved) { new NLMISC::CLibraryContext(GetSharedNelContext()); nldebug("NeL Tile Utility: DllMain"); + NLMISC::CSheetId::initWithoutSheet(); } hInstance = hinstDLL; // Hang on to this DLL's instance handle. diff --git a/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.rc b/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.rc index f727c9bf2..80d1d390d 100644 --- a/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.rc +++ b/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.rc @@ -124,8 +124,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1, 0, 0, 56 - PRODUCTVERSION 3,0,0,0 + FILEVERSION 0, 11, 0, 0 + PRODUCTVERSION 0, 11, 0, 0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -140,13 +140,14 @@ BEGIN BEGIN BLOCK "040904b0" BEGIN - VALUE "CompanyName", "\0" - VALUE "FileVersion", "1, 0, 0, 56\0" + VALUE "Comments", "Based on Kinetix 3D Studio Max 3.0 plugin sample\0" + VALUE "CompanyName", "Ryzom Core\0" + VALUE "FileVersion", "0.11.0\0" VALUE "InternalName", "Tile_utility\0" VALUE "LegalCopyright", "\0" VALUE "OriginalFilename", "Tile_utility.dlu\0" - VALUE "ProductName", "3D Studio MAX\0" - VALUE "ProductVersion", "3.0.0.0\0" + VALUE "ProductName", "Ryzom Core\0" + VALUE "ProductVersion", "0.11.0\0" VALUE "FileDescription", "Create material for tiles\0" VALUE "Comments", "TECH: \0" VALUE "LegalTrademarks", "\0" diff --git a/code/nel/tools/3d/shapes_exporter/main.cpp b/code/nel/tools/3d/shapes_exporter/main.cpp index 183bd8a49..56249e357 100644 --- a/code/nel/tools/3d/shapes_exporter/main.cpp +++ b/code/nel/tools/3d/shapes_exporter/main.cpp @@ -20,7 +20,9 @@ #include "shapes_exporter.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #endif // NL_OS_WINDOWS diff --git a/code/nel/tools/3d/tga_2_dds/tga2dds.cpp b/code/nel/tools/3d/tga_2_dds/tga2dds.cpp index f3b1faf05..f38b898ef 100644 --- a/code/nel/tools/3d/tga_2_dds/tga2dds.cpp +++ b/code/nel/tools/3d/tga_2_dds/tga2dds.cpp @@ -64,6 +64,10 @@ uint8 getType(const std::string &sFileNameDest) return NOT_DEFINED; } +#ifdef NL_BIG_ENDIAN + NLMISC_BSWAP32(dds); +#endif + if (fread(&h,sizeof(CS3TCCompressor::DDS_HEADER),1,f) != 1) { fclose(f); diff --git a/code/nel/tools/3d/tile_edit/Browse.cpp b/code/nel/tools/3d/tile_edit/Browse.cpp index 0d71ffad7..7c4f6d745 100644 --- a/code/nel/tools/3d/tile_edit/Browse.cpp +++ b/code/nel/tools/3d/tile_edit/Browse.cpp @@ -885,7 +885,7 @@ void Browse::OnChangeVariety() void Browse::OnBatchLoad () { CFileDialog sFile (true, NULL, NULL, OFN_ENABLESIZING, - "Targa bitmap (*.tga)|*.tga|All files (*.*)|*.*||",NULL); + "PNG Bitmap (*.png)|*.png|Targa bitmap (*.tga)|*.tga|All files (*.*)|*.*||",NULL); if (sFile.DoModal()==IDOK) { @@ -1365,7 +1365,7 @@ void Browse::OnExportBorder() { // Select a file CFileDialog sFile (false, NULL, NULL, OFN_ENABLESIZING, - "Targa bitmap (*.tga)|*.tga|All files (*.*)|*.*||",NULL); + "PNG Bitmap (*.png)|*.png|Targa bitmap (*.tga)|*.tga|All files (*.*)|*.*||",NULL); if (sFile.DoModal()==IDOK) { // Get the border of the bank @@ -1431,7 +1431,7 @@ void Browse::OnImportBorder() { // Select a file CFileDialog sFile (true, NULL, NULL, OFN_ENABLESIZING, - "Targa bitmap (*.tga)|*.tga|All files (*.*)|*.*||",NULL); + "PNG Bitmap (*.png)|*.png|Targa bitmap (*.tga)|*.tga|All files (*.*)|*.*||",NULL); if (sFile.DoModal()==IDOK) { // Get the border of the bank diff --git a/code/nel/tools/3d/tile_edit/CMakeLists.txt b/code/nel/tools/3d/tile_edit/CMakeLists.txt index ea7e1ac77..394359cd0 100644 --- a/code/nel/tools/3d/tile_edit/CMakeLists.txt +++ b/code/nel/tools/3d/tile_edit/CMakeLists.txt @@ -1,4 +1,4 @@ -FILE(GLOB SRC *.cpp *.h PIC/*.cpp PIC/*.h) +FILE(GLOB SRC *.cpp *.h) FILE(GLOB SRC2 cpu.cpp DllEntry.cpp Popup.* thread_win32.* TileCtrl.* TileList.* TileView.*) LIST(REMOVE_ITEM SRC ${SRC2}) diff --git a/code/nel/tools/3d/tile_edit/PIC/PIC_System.cpp b/code/nel/tools/3d/tile_edit/PIC/PIC_System.cpp deleted file mode 100644 index 439de9979..000000000 --- a/code/nel/tools/3d/tile_edit/PIC/PIC_System.cpp +++ /dev/null @@ -1,126 +0,0 @@ -#include -#include -#include -#include -#include - -#define PIC_ERRSIZE 256 - -static unsigned long PIC_Sys_MEM_Allocated; -static unsigned long PIC_Sys_MEM_NbAllocs; - -// ---------------------------------------------------------------------------------------------------------------------------------- - -void *Pic_malloc(unsigned long size) -{ - void *mem; - mem=malloc(size); - if (mem) - { - PIC_Sys_MEM_Allocated+=size; - PIC_Sys_MEM_NbAllocs++; - } - return(mem); -} -// ----- -void *Pic_calloc(unsigned long count, unsigned long size) -{ - void *mem; - mem=calloc(count,size); - if (mem) - { - PIC_Sys_MEM_Allocated+=(size*count); - PIC_Sys_MEM_NbAllocs++; - } - return(mem); -} -// ----- -void Pic_free(void *memblock) -{ - unsigned long size; - size=(unsigned long)_msize(memblock); - PIC_Sys_MEM_Allocated-=size; - PIC_Sys_MEM_NbAllocs--; - free(memblock); -} -// ----- -unsigned long Pic__msize(void *memblock) -{ - return(unsigned long)(_msize(memblock)); -} -// ----- -unsigned long PIC_GetMemNbAllocs(void) -{ - return(PIC_Sys_MEM_NbAllocs); -} -// ----- -unsigned long PIC_GetMemAllocated(void) -{ - return(PIC_Sys_MEM_Allocated); -} - -// ---------------------------------------------------------------------------------------------------------------------------------- - -static char PIC_ErrorFlag; -static char PIC_ErrorString[PIC_ERRSIZE]; -static unsigned char PIC_Sys_FnctActive=0; -static void (*PIC_Sys_Fnct)(void); - -void Pic_SetError(const char *msg, ...) -{ - char curerr[PIC_ERRSIZE],olderr[PIC_ERRSIZE]; - va_list args; - - va_start(args,msg); - vsprintf(curerr,msg,args); - va_end(args); - if ( (strlen(curerr)+strlen(PIC_ErrorString))>PIC_ERRSIZE ) return; - - if (PIC_ErrorFlag) - { - strcpy(olderr,PIC_ErrorString); - sprintf(PIC_ErrorString,"--- [PIC#%03d] :\n%s",PIC_ErrorFlag,curerr); - strcat(PIC_ErrorString,"\n"); - strcat(PIC_ErrorString,olderr); - } - else - { - sprintf(PIC_ErrorString,"--- [PIC#%03d] :\n%s",PIC_ErrorFlag,curerr); - } - PIC_ErrorFlag++; - if (PIC_Sys_FnctActive) PIC_Sys_Fnct(); - return; -} -// ----- -char* PIC_GetError(void) -{ - return(PIC_ErrorString); -} -// ----- -unsigned char PIC_Error(void) -{ - return(PIC_ErrorFlag); -} -// ----- -void PIC_ResetError(void) -{ - strcpy(PIC_ErrorString,""); - PIC_ErrorFlag=0; -} -// ----- -unsigned char PIC_OnErrorCall( void pFnct(void) ) -{ - if (pFnct != NULL) - { - PIC_Sys_Fnct=pFnct; - PIC_Sys_FnctActive=1; - } - else - { - PIC_Sys_FnctActive=0; - } - return(1); -} - -// ---------------------------------------------------------------------------------------------------------------------------------- - diff --git a/code/nel/tools/3d/tile_edit/PIC/Pic_BMP.cpp b/code/nel/tools/3d/tile_edit/PIC/Pic_BMP.cpp deleted file mode 100644 index 9ea55e029..000000000 --- a/code/nel/tools/3d/tile_edit/PIC/Pic_BMP.cpp +++ /dev/null @@ -1,215 +0,0 @@ -#include -#include -#include - -#include "pic_private.h" -#include "pic.h" - -// ---------------------------------------------------------------------------------------------------------------------------------- - -#pragma pack(1) -typedef struct BMP_HEADER -{ - unsigned short bfType; - unsigned long bfSize; - unsigned short Res1; - unsigned short Res2; - unsigned long bfOffBits; - unsigned long biSize; - unsigned long biWidth; - unsigned long biHeight; - unsigned short biPlanes; - unsigned short biBitCount; - unsigned long biCompression; - unsigned long biSizeImage; - unsigned long biXPelsPerMeter; - unsigned long biYPelsPerMeter; - unsigned long biClrUsed; - unsigned long biClrImportant; -} BMP_HEADER; -#pragma pack() - -// ---------------------------------------------------------------------------------------------------------------------------------- - -unsigned long Pic_BMP_Write( const char *FileName, - char *pPal, char *pDatas, - unsigned long w, unsigned long h, unsigned long d) - -{ - FILE *file; - BMP_HEADER bmph; - unsigned long slsize; - unsigned char *scanline; - unsigned long i; - long x,y,rest; - unsigned char r,g,b; - - file=fopen(FileName,"wb"); - if (!file) - { - return(0); - } - memset(&bmph,0,sizeof(BMP_HEADER)); - bmph.bfType=19778; - bmph.bfSize=sizeof(BMP_HEADER); - bmph.bfSize+=w*h*d/8; - if (pPal) - { - bmph.bfSize+=(256*4); - } - bmph.bfOffBits=sizeof(BMP_HEADER); - if (pPal) - { - bmph.bfOffBits+=(256*4); - } - bmph.biSize=40;//sizeof(BMP_HEADER); - bmph.biWidth=w; - bmph.biHeight=h; - bmph.biPlanes=1; - bmph.biBitCount=(unsigned short)d; - bmph.biCompression=0; - bmph.biSizeImage=w*h*d/8; - - fwrite(&bmph,1,sizeof(BMP_HEADER),file); - if (pPal) - { - for(i=0 ; i<256 ; i++) - { - fwrite(&pPal[i*3+0],1,1,file); - fwrite(&pPal[i*3+1],1,1,file); - fwrite(&pPal[i*3+2],1,1,file); - fwrite(&pPal[i*3+2],1,1,file); - } - } - slsize=w*d/8; - scanline=(unsigned char*)Pic_calloc(1,slsize); - if (!scanline) - { - Pic_SetError("BMP_Write, not enough memory for scanline"); - return(0); - } - for(rest=0 ; ((w*d/8)+rest)%4!=0 ; rest++); - for(y=0 ; y<(long)h ; y++) - { - memcpy(scanline,&pDatas[(h-y-1)*slsize],slsize); - if (d==24) - { - for(x=0 ; x<(long)w ; x++) - { - b=scanline[x*3+0]; - g=scanline[x*3+1]; - r=scanline[x*3+2]; - scanline[x*3+0]=b; - scanline[x*3+1]=g; - scanline[x*3+2]=r; - } - } - fwrite(scanline,1,slsize,file); - if (rest) - { - fwrite(scanline,1,rest,file); - } - } - Pic_free(scanline); - fclose(file); - return(1); -} - -// ---------------------------------------------------------------------------------------------------------------------------------- - -unsigned long Pic_BMP_Read( const char *FileName, - char **ppPal, char **ppDatas, - unsigned long *pWidth, unsigned long *pHeight, - unsigned long *pDepth) -{ - FILE *file; - BMP_HEADER bmph; - char *pPal; - char *pDatas; - unsigned char *scanline; - long w,h,d; - long i,x,y,rest; - unsigned char r,g,b; - unsigned char pad[4]; - - pPal=NULL; - pDatas=NULL; - file=fopen(FileName,"rb"); - if (!file) - { - Pic_SetError("BMP_Read, unable to open %s",FileName); - return(0); - } - fread(&bmph,1,sizeof(BMP_HEADER),file); - *pWidth=w=bmph.biWidth; - *pHeight=h=bmph.biHeight; - *pDepth=d=bmph.biBitCount; - if (d!=8 && d!=24) - { - Pic_SetError("BMP_Read, number of bits per pixel unsupported"); - return(0); - } - if (*pDepth==8) - { - pPal=(char*)Pic_calloc(1,256*3); - if (!pPal) - { - Pic_SetError("BMP_Read, not enough memory for palette"); - return(0); - } - for(i=0 ; i<256 ; i++) - { - fread(&pPal[i*3+2],1,1,file); - fread(&pPal[i*3+1],1,1,file); - fread(&pPal[i*3+0],1,1,file); - fread(&pad[0],1,1,file); - } - } - pDatas=(char*)Pic_calloc(1,w*h*d/8); - if (!pDatas) - { - if (pPal) - { - Pic_free(pPal); - } - Pic_SetError("BMP_Read, not enough memory for datas"); - return(0); - } - scanline=(unsigned char*)Pic_calloc(1,w*h*d/8); - if (!scanline) - { - if (pPal) - { - Pic_free(pPal); - } - Pic_free(pDatas); - Pic_SetError("BMP_Read, not enough memory for scanline"); - return(0); - } - for(rest=0 ; (w+rest)%4!=0 ; rest++); - for(y=0 ; y -#include -#include -#include - -#include -#include "pic_private.h" -#include "pic.h" - -// ---------------------------------------------------------------------------------------------------------------------------------- - -struct my_error_mgr -{ - struct jpeg_error_mgr pub; - jmp_buf setjmp_buffer; -}; -typedef struct my_error_mgr * my_error_ptr; - -// ---------------------------------------------------------------------------------------------------------------------------------- - -static unsigned char error; - -// ---------------------------------------------------------------------------------------------------------------------------------- - -void my_error_exit(j_common_ptr cinfo) -{ - my_error_ptr myerr = (my_error_ptr) cinfo->err; - error=1; - longjmp(myerr->setjmp_buffer, 1); -} - -// ---------------------------------------------------------------------------------------------------------------------------------- - -unsigned long Pic_JPG_Read(const char *FileName, char **ppPal, char **ppDatas, unsigned long *w, unsigned long *h) -{ - struct jpeg_decompress_struct cinfo; - struct my_error_mgr jerr; - FILE *file; - JSAMPARRAY buffer; - int row_stride,i; - char *pDatas,*pPal; - unsigned long ptr; - - error=0; - ptr=0; - file=fopen(FileName, "rb"); - if (!file) - { - Pic_SetError("JPG_Read, unable to open %s",FileName); - return(0); - } - cinfo.err = jpeg_std_error(&jerr.pub); - jerr.pub.error_exit = my_error_exit; - setjmp(jerr.setjmp_buffer); - if (error) - { - Pic_SetError("JPG_Read, internal decompression error"); - jpeg_destroy_decompress(&cinfo); - return(0); - } - jpeg_create_decompress(&cinfo); - jpeg_stdio_src(&cinfo, file); - (void) jpeg_read_header(&cinfo, TRUE); - *w=cinfo.image_width; - *h=cinfo.image_height; - if (!ppPal) - { - pDatas=(char*)Pic_calloc(1,(*w)*(*h)*3); - } - else - { - pDatas=(char*)Pic_calloc(1,(*w)*(*h)); - pPal=(char*)Pic_calloc(1,256*3); - if (!pPal) - { - Pic_SetError("JPG_Read, not enough memory for palette"); - return(0); - } - cinfo.desired_number_of_colors = 256; - cinfo.quantize_colors = TRUE; - cinfo.dither_mode = JDITHER_ORDERED; - } - if (!pDatas) - { - Pic_SetError("JPG_Read, not enough memory for pic"); - return(0); - } - (void) jpeg_start_decompress(&cinfo); - row_stride = cinfo.output_width * cinfo.output_components; - buffer = (*cinfo.mem->alloc_sarray) - ((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1); - while (cinfo.output_scanline < cinfo.output_height) - { - (void) jpeg_read_scanlines(&cinfo, buffer, 1); - memcpy(&pDatas[ptr],buffer[0],row_stride); - ptr+=row_stride; - } - *ppDatas=pDatas; - if (ppPal) - { - for(i=0 ; i<256 ; i++) - { - pPal[i*3+0]=cinfo.colormap[2][i]; - pPal[i*3+1]=cinfo.colormap[1][i]; - pPal[i*3+2]=cinfo.colormap[0][i]; - } - *ppPal=pPal; - } - (void) jpeg_finish_decompress(&cinfo); - jpeg_destroy_decompress(&cinfo); - fclose(file); - return(1); -} - -// ---------------------------------------------------------------------------------------------------------------------------------- - -unsigned long Pic_JPG_Write(const char *FileName, unsigned long Qual, char *pDatas, unsigned long w, unsigned long h) -{ - struct jpeg_compress_struct cinfo; - struct my_error_mgr jerr; - FILE *file; - JSAMPROW row_pointer[1]; - int row_stride; - - error=0; - file=fopen(FileName,"wb"); - if (!file) - { - Pic_SetError("JPG_Write, unable to open %s",FileName); - return(0); - } - jpeg_create_compress(&cinfo); - cinfo.err = jpeg_std_error(&jerr.pub); - jerr.pub.error_exit = my_error_exit; - setjmp(jerr.setjmp_buffer); - if (error) - { - Pic_SetError("JPG_Write, internal compression error"); - jpeg_destroy_compress(&cinfo); - return(0); - } - jpeg_stdio_dest(&cinfo, file); - cinfo.image_width = w; - cinfo.image_height = h; - cinfo.input_components = 3; - cinfo.in_color_space = JCS_RGB; - jpeg_set_defaults(&cinfo); - jpeg_set_quality(&cinfo, Qual, TRUE); - jpeg_start_compress(&cinfo, TRUE); - row_stride = w * 3; - while(cinfo.next_scanline -#include "pic_private.h" -#include "pic.h" - -static unsigned long NbPics=0; -static PIC_PICTURE *HeadPic=NULL; - -// ---------------------------------------------------------------------------------------------------------------------------------- - -static PIC_PICTURE *GetPic(unsigned long id) -{ - PIC_PICTURE *pic; - - for(pic=HeadPic ; pic ; pic=pic->Next) - { - if (pic->ID==id) - { - return(pic); - } - } - return(NULL); -} - -// ---------------------------------------------------------------------------------------------------------------------------------- - -unsigned long PIC_Load(char* FileName, unsigned char Quantize) -{ - char ext[4]; - unsigned long type; - unsigned long i,taken,id; - PIC_PICTURE *pic; - char *pDatas; - char *pPal; - unsigned long w,h,Depth; - unsigned long ret; - - // --- Init - ret=0; - type=0; - id=0; - taken=0; - w=0; - h=0; - Depth=0; - pic=NULL; - pDatas=NULL; - pPal=NULL; - // --- Get 1st available ID - for(i=1 ; i<=NbPics+1 ; i++) - { - taken=0; - for(pic=HeadPic ; pic ; pic=pic->Next) - { - if (pic->ID==i) - { - taken=1; - break; - } - } - if (!taken) - { - id=i; - break; - } - } - if (!id) - { - Pic_SetError("Load, unable to create ID"); - return(0); - } - // --- Load pic - if (FileName) - { - ext[0]=FileName[strlen(FileName)-3]; - ext[1]=FileName[strlen(FileName)-2]; - ext[2]=FileName[strlen(FileName)-1]; - ext[3]=0; - strupr(ext); - if ( !strcmp(ext,"JPG") ) - { - type=1; - } - else if ( !strcmp(ext,"TGA") ) - { - type=2; - } - else if ( !strcmp(ext,"BMP") ) - { - type=3; - } - - switch(type) - { - // - JPG - case 1: - if (!Quantize) - { - Depth=24; - ret=Pic_JPG_Read(FileName,NULL,&pDatas,&w,&h); - } - else - { - Depth=8; - ret=Pic_JPG_Read(FileName,&pPal,&pDatas,&w,&h); - } - if (!ret) - { - Pic_SetError("Load, unable to load JPG file %s",FileName); - return(0); - } - break; - // - TGA - case 2: - ret=Pic_TGA_Read(FileName,&pPal,&pDatas,&w,&h,&Depth); - if (!ret) - { - Pic_SetError("Load, unable to load TGA file %s",FileName); - return(0); - } - break; - // - BMP - case 3: - ret=Pic_BMP_Read(FileName,&pPal,&pDatas,&w,&h,&Depth); - if (!ret) - { - Pic_SetError("Load, unable to load BMP file %s",FileName); - return(0); - } - break; - // - Unknown - default: - Pic_SetError("Load, unknown extension for %s",FileName); - return(0); - } - } - - // --- Create and place new pic struct - pic=(PIC_PICTURE *)Pic_calloc(1,sizeof(PIC_PICTURE)); - if (!pic) - { - Pic_SetError("Load, not enough memory for internal structure"); - return(0); - } - pic->Next=HeadPic; - HeadPic=pic; - NbPics++; - pic->ID=id; - pic->pDatas=pDatas; - pic->pPal=pPal; - pic->Width=w; - pic->Height=h; - pic->Depth=Depth; - return(id); -} - -// ---------------------------------------------------------------------------------------------------------------------------------- - -unsigned long PIC_Create(char* pPal, char* pDatas, unsigned long w, unsigned long h, unsigned long d) -{ - unsigned long i,taken,id; - PIC_PICTURE *pic; - - // --- Init - id=0; - taken=0; - pic=NULL; - // --- Get 1st available ID - for(i=1 ; i<=NbPics+1 ; i++) - { - taken=0; - for(pic=HeadPic ; pic ; pic=pic->Next) - { - if (pic->ID==i) - { - taken=1; - break; - } - } - if (!taken) - { - id=i; - break; - } - } - if (!id) - { - Pic_SetError("Create, unable to create ID"); - return(0); - } - // --- Create pic - if (!pDatas) - { - pDatas=(char *)Pic_calloc(1,w*h*d/8); - if (!pDatas) - { - Pic_SetError("Create, not enough memory for datas"); - return(0); - } - } - if (d==8) - { - if (!pPal) - { - pPal=(char *)Pic_calloc(1,256*3); - if (!pPal) - { - Pic_SetError("Create, not enough memory for palette"); - return(0); - } - } - } - else - { - pPal=NULL; - } - // --- Create and place new pic struct - pic=(PIC_PICTURE *)Pic_calloc(1,sizeof(PIC_PICTURE)); - if (!pic) - { - Pic_SetError("Create, not enough memory for internal structure"); - return(0); - } - pic->Next=HeadPic; - HeadPic=pic; - NbPics++; - pic->ID=id; - pic->pDatas=pDatas; - pic->pPal=pPal; - pic->Width=w; - pic->Height=h; - pic->Depth=d; - return(id); - -} - -// ---------------------------------------------------------------------------------------------------------------------------------- - -unsigned long PIC_GetInfos( unsigned long id, - char **ppPal, char **ppDatas, - unsigned long *pW, unsigned long *pH, unsigned long *pD) -{ - PIC_PICTURE *pic; - - pic=GetPic(id); - if (!pic) - { - Pic_SetError("GetInfos, picture internal structure not found"); - return(0); - } - if (ppPal) - { - *ppPal=pic->pPal; - } - if (ppDatas) - { - *ppDatas=pic->pDatas; - } - if (pW) - { - *pW=pic->Width; - } - if (pH) - { - *pH=pic->Height; - } - if (pD) - { - *pD=pic->Depth; - } - return(id); -} - -// ---------------------------------------------------------------------------------------------------------------------------------- - -static char* Conv8To24(unsigned long id) -{ - PIC_PICTURE *pic; - char *buf; - unsigned long i; - - pic=GetPic(id); - if (!pic) - { - Pic_SetError("Conv8To24, picture internal structure not found"); - return(NULL); - } - buf=(char *)Pic_malloc(pic->Width*pic->Height*3); - if (!buf) - { - Pic_SetError("Conv8To24, not enough memory for temporary buffer"); - return(NULL); - } - for(i=0 ; iWidth*pic->Height ; i++) - { - buf[i*3+0]=pic->pPal[pic->pDatas[i]*3+0]; - buf[i*3+1]=pic->pPal[pic->pDatas[i]*3+1]; - buf[i*3+2]=pic->pPal[pic->pDatas[i]*3+2]; - } - return(buf); -} - -// ---------------------------------------- -static char* Conv8To16(unsigned long id) -{ - PIC_PICTURE *pic; - unsigned short *buf; - unsigned long i; - unsigned short r,g,b,pix16; - - pic=GetPic(id); - if (!pic) - { - Pic_SetError("Conv8To24, picture internal structure not found"); - return(NULL); - } - buf=(unsigned short*)Pic_malloc(pic->Width*pic->Height*2); - if (!buf) - { - Pic_SetError("Conv8To24, not enough memory for temporary buffer"); - return(NULL); - } - for(i=0 ; iWidth*pic->Height ; i++) - { - b=pic->pPal[pic->pDatas[i]*3+0]; - g=pic->pPal[pic->pDatas[i]*3+1]; - r=pic->pPal[pic->pDatas[i]*3+2]; - r>>=3; - g>>=3; g&=0x3E; - b>>=3; - pix16=(r<<10)+(g<<5)+b; - buf[i]=pix16; - } - return (char*)buf; -} - -// ---------------------------------------- - -static char* Conv16To24(unsigned long id) -{ - PIC_PICTURE *pic; - unsigned short *pDatas; - unsigned char *buf; - unsigned long i; - unsigned short r,g,b; - - pic=GetPic(id); - if (!pic) - { - Pic_SetError("Conv16To24, picture internal structure not found"); - return(NULL); - } - buf=(unsigned char *)Pic_malloc(pic->Width*pic->Height*3); - if (!buf) - { - Pic_SetError("Conv16To24, not enough memory for temporary buffer"); - return(NULL); - } - pDatas=(unsigned short*)pic->pDatas; - for(i=0 ; iWidth*pic->Height ; i++) - { - r=(pDatas[i] & 0x7C00)>>(10-3); - g=(pDatas[i] & 0x03E0)>>(5-3); - b=(pDatas[i] & 0x001F)<<3; - buf[i*3+0]=(unsigned char)r; - buf[i*3+1]=(unsigned char)g; - buf[i*3+2]=(unsigned char)b; - } - return (char*)buf; -} - -// ---------------------------------------- - -static char* Conv24To16(unsigned long id) -{ - PIC_PICTURE *pic; - unsigned short *buf; - unsigned long i; - unsigned short r,g,b; - unsigned short pix16; - - pic=GetPic(id); - if (!pic) - { - Pic_SetError("Conv24To16, picture internal structure not found"); - return(NULL); - } - buf=(unsigned short*)Pic_malloc(pic->Width*pic->Height*2); - if (!buf) - { - Pic_SetError("Conv24To16, not enough memory for temporary buffer"); - return(NULL); - } - for(i=0 ; iWidth*pic->Height ; i++) - { - r=pic->pDatas[i*3+0]; - g=pic->pDatas[i*3+1]; - b=pic->pDatas[i*3+2]; - // r : 5 bits forts (0x7C) - // g : 5 bits (6e zapped) (0x3E) - // b : 5 bits faibles (0x1F) - r>>=3; - g>>=3; g&=0x3E; - b>>=3; - pix16=(r<<10)+(g<<5)+b; - buf[i]=pix16; - } - return (char*)buf; -} - -// ---------------------------------------- - -static char* ConvPic(PIC_PICTURE *pic, unsigned long type, char* pErr) -{ - char *buf; - unsigned long src,dst; - - *pErr=0; - buf=NULL; - src=pic->Depth; - if (type==PIC_TYPE_TGA8 || type==PIC_TYPE_BMP8) - { - dst=8; - } - if (type==PIC_TYPE_TGA16) - { - dst=16; - } - if (type==PIC_TYPE_JPG || type==PIC_TYPE_TGA24 || type==PIC_TYPE_BMP24) - { - dst=24; - } - // --- - if (src==dst) - { - return(NULL); - } - // --- - if (src==8 && dst==24) - { - buf=Conv8To24(pic->ID); - if (!buf) - { - *pErr=1; - } - return(buf); - } - if (src==8 && dst==16) - { - buf=Conv8To16(pic->ID); - if (!buf) - { - *pErr=1; - } - return(buf); - } - // --- - if (src==16 && dst==24) - { - buf=Conv16To24(pic->ID); - if (!buf) - { - *pErr=1; - } - return(buf); - } - // --- - if (src==24 && dst==16) - { - buf=Conv24To16(pic->ID); - if (!buf) - { - *pErr=1; - } - return buf; - } - // --- - if (src==24 && dst==8) - { - Pic_SetError("ConvPic, downsampling 24 to 8 bits unsupported"); - *pErr=1; - return(NULL); - } - Pic_SetError("ConvPic, conversion %d to %d unsupported",src,dst); - *pErr=1; - return(NULL); -} - -// ---------------------------------------- - -unsigned long PIC_Save(unsigned long id, char* FileName, unsigned long type, unsigned long qual) -{ - PIC_PICTURE *pic; - char err; - char *buf; - char *freeit; - unsigned long depth; - - freeit=NULL; - pic=GetPic(id); - if (!pic) - { - Pic_SetError("Save %s, picture internal structure not found",FileName); - return(0); - } - freeit = ConvPic(pic,type,&err); - if (err) - { - Pic_SetError("Save %s, error while converting picture",FileName); - return(0); - } - if (!freeit) - { - buf=pic->pDatas; - } - else - { - buf=freeit; - } - err=0; - switch(type) - { - // --- - case PIC_TYPE_JPG: - if ( !Pic_JPG_Write(FileName,qual,buf,pic->Width,pic->Height) ) - { - if (freeit) - { - Pic_free(buf); - } - Pic_SetError("Save %s, error while saving JPG file",FileName); - err=1; - } - break; - // --- - case PIC_TYPE_TGA8: - case PIC_TYPE_TGA16: - case PIC_TYPE_TGA24: - if (type==PIC_TYPE_TGA8) - { - depth=8; - } - if (type==PIC_TYPE_TGA16) - { - depth=16; - } - if (type==PIC_TYPE_TGA24) - { - depth=24; - } - if ( !Pic_TGA_Write(FileName,pic->pPal,buf,pic->Width,pic->Height,depth) ) - { - if (freeit) - { - Pic_free(freeit); - } - Pic_SetError("Save %s, error while saving TGA file",FileName); - err=1; - } - break; - // --- - case PIC_TYPE_BMP8: - case PIC_TYPE_BMP24: - if (type==PIC_TYPE_BMP8) - { - depth=8; - } - if (type==PIC_TYPE_BMP24) - { - depth=24; - } - if ( !Pic_BMP_Write(FileName,pic->pPal,buf,pic->Width,pic->Height,depth) ) - { - if (freeit) - { - Pic_free(freeit); - } - Pic_SetError("Save %s, error while saving BMP file",FileName); - err=1; - } - break; - // --- - default: - Pic_SetError("Save %s, unknow save format/type",FileName); - err=1; - break; - } - if (freeit) - { - Pic_free(freeit); - } - return(err-1); -} - -// ---------------------------------------------------------------------------------------------------------------------------------- - -unsigned long PIC_Destroy(unsigned long id) -{ - PIC_PICTURE *prevpic,*pic; - unsigned long found; - - prevpic=NULL; - found=0; - for(pic=HeadPic ; pic ; pic=pic->Next) - { - if (pic->ID==id) - { - found=1; - break; - } - prevpic=pic; - } - if (!found) - { - Pic_SetError("Destroy, picture internal structure not found"); - return(0); - } - if (prevpic) - { - prevpic->Next=pic->Next; - } - if (pic->pDatas) - { - Pic_free(pic->pDatas); - } - if (pic->pPal) - { - Pic_free(pic->pPal); - } - if (pic==HeadPic) - { - HeadPic=pic->Next; - } - Pic_free(pic); - return(1); -} - -// ---------------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/code/nel/tools/3d/tile_edit/PIC/Pic_TGA.cpp b/code/nel/tools/3d/tile_edit/PIC/Pic_TGA.cpp deleted file mode 100644 index 6d69b914e..000000000 --- a/code/nel/tools/3d/tile_edit/PIC/Pic_TGA.cpp +++ /dev/null @@ -1,215 +0,0 @@ -#include -#include -#include - -#include "pic_private.h" -#include "pic.h" - -// ---------------------------------------------------------------------------------------------------------------------------------- - -#pragma pack(1) -typedef struct TGA_HEADER -{ - unsigned char LengthID; - unsigned char CMapType; - unsigned char ImageType; - unsigned short Origin; - unsigned short Length; - unsigned char Depth; - unsigned short XOrg; - unsigned short YOrg; - unsigned short Width; - unsigned short Height; - unsigned char ImageDepth; - unsigned char Desc; -} TGA_HEADER; -#pragma pack() - -// ---------------------------------------------------------------------------------------------------------------------------------- - -unsigned long Pic_TGA_Read( const char *FileName, - char **ppPal, char **ppDatas, - unsigned long *pWidth, unsigned long *pHeight, - unsigned long *pDepth) -{ - FILE *file; - TGA_HEADER tgah; - long w,h,d; - unsigned long size; - char *pDatas; - char *pPal; - long x,y; - long slsize; - unsigned char *scanline; - unsigned char r,g,b; - long i; - int upSideDown; - - pDatas=NULL; - pPal=NULL; - file=fopen(FileName,"rb"); - if (!file) - { - Pic_SetError("TGA_Read, unable to open %s",FileName); - return(0); - } - fread(&tgah,1,sizeof(TGA_HEADER),file); - if (tgah.ImageType>3) - { - Pic_SetError("TGA_Read, unsupported TGA format"); - return(0); - } - *pWidth=w=tgah.Width; - *pHeight=h=tgah.Height; - *pDepth=d=tgah.ImageDepth; - upSideDown = ((tgah.Desc & (1 << 5))==0); - - size=tgah.Width*tgah.Height*(tgah.ImageDepth/8); - pDatas=(char*)Pic_malloc(size); - if (!pDatas) - { - Pic_SetError("TGA_Read, not enough memory"); - return(0); - } - if (*pDepth==8) - { - if (!ppPal) - { - Pic_free(pDatas); - Pic_SetError("TGA_Read, need a pointer to palette"); - return(0); - } - pPal=(char*)Pic_calloc(1,256*3); - if (!pPal) - { - Pic_SetError("TGA_Read, not enough memory for palette"); - return(0); - } - if (tgah.ImageType==1) - { - for(i=0 ; i<256*3 ; i+=3) - { - fread(&pPal[i+2],1,1,file); - fread(&pPal[i+1],1,1,file); - fread(&pPal[i+0],1,1,file); - } - } - *ppPal=pPal; - } - - slsize=w*d/8; - scanline=(unsigned char*)Pic_calloc(1,slsize); - if (!scanline) - { - if (pPal) - { - Pic_free(pPal); - } - Pic_free(pDatas); - Pic_SetError("TGA_Read, not enough memory for scanline"); - return(0); - } - for(y=0 ; y8) - { - tgah.CMapType=0; - tgah.ImageType=2; - tgah.Length=0; - tgah.Depth=0; - } - else - { - tgah.CMapType=1; - tgah.ImageType=1; - tgah.Length=256; - tgah.Depth=24; - } - tgah.Origin=0; - tgah.XOrg=0; - tgah.YOrg=0; - tgah.Width=(unsigned short)w; - tgah.Height=(unsigned short)h; - tgah.ImageDepth=(unsigned char)d; - tgah.Desc=0; - fwrite(&tgah,1,sizeof(TGA_HEADER),file); - if (d==8) - { - fwrite(pPal,1,256*3,file); - } - slsize=w*d/8; - scanline=(unsigned char*)Pic_calloc(1,slsize); - if (!scanline) - { - Pic_SetError("TGA_Write, not enough memory for scanline"); - return(0); - } - for(y=0 ; y<(long)h ; y++) - { - memcpy(scanline,&pDatas[(h-y-1)*slsize],slsize); - if (d==24) - { - for(x=0 ; x<(long)w ; x++) - { - r=scanline[x*3+0]; - g=scanline[x*3+1]; - b=scanline[x*3+2]; - scanline[x*3+0]=b; - scanline[x*3+1]=g; - scanline[x*3+2]=r; - } - } - fwrite(scanline,1,slsize,file); - } - Pic_free(scanline); - fclose(file); - return(1); -} diff --git a/code/nel/tools/3d/tile_edit/PIC/pic.h b/code/nel/tools/3d/tile_edit/PIC/pic.h deleted file mode 100644 index ec6582c6b..000000000 --- a/code/nel/tools/3d/tile_edit/PIC/pic.h +++ /dev/null @@ -1,58 +0,0 @@ -// Ryzom - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -#ifndef _PIC_H_ -#define _PIC_H_ - -// ---------------------------------------------------------------------------------------------------------------------------------- - -#define PIC_TYPE_JPG 1 -#define PIC_TYPE_TGA8 2 -#define PIC_TYPE_TGA16 3 -#define PIC_TYPE_TGA24 4 -#define PIC_TYPE_BMP8 5 -#define PIC_TYPE_BMP24 6 - -// ---------------------------------------------------------------------------------------------------------------------------------- - -// -// Basic API -// -extern unsigned long PIC_Load(char* FileName, unsigned char Quantize); - -extern unsigned long PIC_Create(char* pPal, 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_GetInfos( unsigned long id, - char **ppPal, char **ppDatas, - unsigned long *pW, unsigned long *pH, unsigned long *pD); - - -extern unsigned long PIC_Destroy(unsigned long id); -// -// System -// -extern unsigned long PIC_GetMemNbAllocs(void); -extern unsigned long PIC_GetMemAllocated(void); -extern char* PIC_GetError(void); -extern unsigned char PIC_Error(void); -extern void PIC_ResetError(void); -extern unsigned char PIC_OnErrorCall( void pFnct(void) ); - -// ---------------------------------------------------------------------------------------------------------------------------------- - -#endif diff --git a/code/nel/tools/3d/tile_edit/PIC/pic_private.h b/code/nel/tools/3d/tile_edit/PIC/pic_private.h deleted file mode 100644 index 4a67bbc9c..000000000 --- a/code/nel/tools/3d/tile_edit/PIC/pic_private.h +++ /dev/null @@ -1,81 +0,0 @@ -// Ryzom - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -#ifndef _PIC_PRIVATE_H_ -#define _PIC_PRIVATE_H_ - -// ---------------------------------------------------------------------------------------------------------------------------------- - -typedef struct PIC_PICTURE -{ - unsigned long ID; - unsigned long Width; - unsigned long Height; - unsigned long Depth; - char *pDatas; - char *pPal; - struct PIC_PICTURE *Next; -} PIC_PICTURE; - -// ---------------------------------------------------------------------------------------------------------------------------------- - - -// -// JPG -// - - -extern unsigned long Pic_JPG_Read( const char *FileName, - char **ppPal, char **ppDatas, - unsigned long *w, unsigned long *h); - -extern unsigned long Pic_JPG_Write( const char *FileName, - unsigned long Qual, - char *pDatas, - unsigned long w, unsigned long h); -// -// TGA -// -extern unsigned long Pic_TGA_Read( const char *FileName, - char **ppPal, char **ppDatas, - unsigned long *pWidth, unsigned long *pHeight, - unsigned long *pDepth); -extern unsigned long Pic_TGA_Write( const char *FileName, - char *pPal, char *pDatas, - unsigned long w, unsigned long h, unsigned long d); -// -// BMP -// -extern unsigned long Pic_BMP_Read( const char *FileName, - char **ppPal, char **ppDatas, - unsigned long *pWidth, unsigned long *pHeight, - unsigned long *pDepth); - -extern unsigned long Pic_BMP_Write( const char *FileName, - char *pPal, 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(const char *msg, ...); - -// ---------------------------------------------------------------------------------------------------------------------------------- - -#endif \ No newline at end of file diff --git a/code/nel/tools/3d/tile_edit/PIC/readpic.cpp b/code/nel/tools/3d/tile_edit/PIC/readpic.cpp deleted file mode 100644 index 8afac2b45..000000000 --- a/code/nel/tools/3d/tile_edit/PIC/readpic.cpp +++ /dev/null @@ -1,84 +0,0 @@ -// Ryzom - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - - -#include -#include -#include "readpic.h" -#include "pic.h" -#include - -using namespace std; - -//============================================================ -// Image API. -//============================================================ - - -bool PIC_LoadPic(string path, vector &tampon, uint &Width, uint &Height) -{ - uint32 id; - char *pal, *data; - unsigned long w,h,depth; - uint i; - - - // Loadons l'image. - id= PIC_Load((char*)path.c_str(), 0); - if(id==0) - return false; - PIC_GetInfos( id, &pal, &data, &w, &h, &depth); - Width=w; - Height=h; - - // On traduit en RGBA. - tampon.resize(w*h); - switch(depth) - { - case 8: - for(i=0;i //#include "ListGroup.h" //#include "ViewPopup.h" -#include "pic/readpic.h" +//#include "pic/readpic.h" using namespace std; using namespace NL3D; @@ -74,6 +74,37 @@ void rotateBuffer (uint &Width, uint &Height, std::vector& Tampon Height=tmp; } +static bool loadPic(const string &path, std::vector &tampon, uint &width, uint &height) +{ + try + { + NLMISC::CIFile file; + if (file.open(path.c_str())) + { + NLMISC::CBitmap bitmap; + bitmap.load(file); + width = bitmap.getWidth(); + height = bitmap.getHeight(); + tampon.resize(width * height); + bitmap.convertToType(NLMISC::CBitmap::RGBA); + for (uint y = 0; y < height; ++y) + { + for (uint x = 0; x < width; ++x) + { + NLMISC::CRGBA c = bitmap.getPixelColor(x, y, 0); + c.R = (c.R * c.A) / 255; + c.G = (c.G * c.A) / 255; + c.B = (c.B * c.A) / 255; + tampon[(y * width) + x] = c; + } + } + return true; + } + } + catch (NLMISC::Exception& ) { } + return false; +} + ///////////////////////////////////////////////////////////////////////////// // CTView //Attention : windows veut que le buffer image commence du bas vers le haut @@ -82,7 +113,7 @@ int _LoadBitmap(const std::string& path,LPBITMAPINFO BitmapInfo, std::vector Tampon; uint Width; uint Height; - if (PIC_LoadPic(path, Tampon, Width, Height)) + if (loadPic(path, Tampon, Width, Height)) { BitmapInfo->bmiHeader.biSize=sizeof(BITMAPINFOHEADER); BitmapInfo->bmiHeader.biWidth=Width; @@ -207,7 +238,7 @@ int TileList::setTile128 (int tile, const std::string& name, NL3D::CTile::TBitma vector tampon; uint Width; uint Height; - if (!PIC_LoadPic(tileBank2.getAbsPath ()+troncated, tampon, Width, Height)) + if (!loadPic(tileBank2.getAbsPath ()+troncated, tampon, Width, Height)) { return (int)(MessageBox (NULL, ((tileBank2.getAbsPath ()+troncated)+"\nContinue ?").c_str(), "Can't load bitmap.", MB_YESNO|MB_ICONEXCLAMATION)==IDYES); } @@ -272,7 +303,7 @@ int TileList::setTile256 (int tile, const std::string& name, NL3D::CTile::TBitma vector tampon; uint Width; uint Height; - if (!PIC_LoadPic(tileBank2.getAbsPath ()+troncated, tampon, Width, Height)) + if (!loadPic(tileBank2.getAbsPath ()+troncated, tampon, Width, Height)) { return (int)(MessageBox (NULL, ((tileBank2.getAbsPath ()+troncated)+"\nContinue ?").c_str(), "Can't load bitmap.", MB_YESNO|MB_ICONEXCLAMATION)==IDYES); } @@ -338,7 +369,7 @@ int TileList::setTileTransition (int tile, const std::string& name, NL3D::CTile: vector tampon; uint Width; uint Height; - if (!PIC_LoadPic(tileBank2.getAbsPath ()+troncated, tampon, Width, Height)) + if (!loadPic(tileBank2.getAbsPath ()+troncated, tampon, Width, Height)) { return (int)(MessageBox (NULL, ((tileBank2.getAbsPath ()+troncated)+"\nContinue ?").c_str(), "Can't load bitmap.", MB_YESNO|MB_ICONEXCLAMATION)==IDYES); } @@ -451,7 +482,7 @@ int TileList::setTileTransitionAlpha (int tile, const std::string& name, int rot vector tampon; uint Width; uint Height; - if (!PIC_LoadPic(tileBank2.getAbsPath ()+troncated, tampon, Width, Height)) + if (!loadPic(tileBank2.getAbsPath ()+troncated, tampon, Width, Height)) { return MessageBox (NULL, ((tileBank2.getAbsPath ()+troncated)+"\nContinue ?").c_str(), "Can't load bitmap.", MB_YESNO|MB_ICONEXCLAMATION)==IDYES; } @@ -1490,7 +1521,7 @@ LRESULT CTView::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) { _chdir (LastPath.c_str()); CFileDialog load(true, NULL, LastPath.c_str(), OFN_ENABLESIZING | OFN_ALLOWMULTISELECT, - "Targa bitmap (*.tga)|*.tga|All files (*.*)|*.*||",NULL); + "PNG Bitmap (*.png)|*.png|Targa bitmap (*.tga)|*.tga|All files (*.*)|*.*||",NULL); load.m_ofn.lpstrFile = new char[10000]; // buffer contains filenames list load.m_ofn.lpstrFile[0] = 0; // with 10 KB we should be large enough... diff --git a/code/nel/tools/3d/zone_dependencies/zone_dependencies.cpp b/code/nel/tools/3d/zone_dependencies/zone_dependencies.cpp index 7d958d81c..b109c2db2 100644 --- a/code/nel/tools/3d/zone_dependencies/zone_dependencies.cpp +++ b/code/nel/tools/3d/zone_dependencies/zone_dependencies.cpp @@ -607,11 +607,15 @@ static void computeIGBBox(const NL3D::CInstanceGroup &ig, CLightingBBox &result, std::string toLoad = it->Name; if (getExt(toLoad).empty()) toLoad += ".shape"; shapePathName = NLMISC::CPath::lookup(toLoad, false, false); - + if (shapePathName.empty()) { nlwarning("Unable to find shape '%s'", it->Name.c_str()); } + else if (toLower (CFile::getExtension (shapePathName)) == "pacs_prim") + { + nlwarning("EXPORT BUG: Can't read %s (not a shape), should not be part of .ig!", shapePathName.c_str()); + } else { CIFile shapeInputFile; diff --git a/code/nel/tools/3d/zone_ig_lighter/zone_ig_lighter.cpp b/code/nel/tools/3d/zone_ig_lighter/zone_ig_lighter.cpp index 0010d5179..a6636730f 100644 --- a/code/nel/tools/3d/zone_ig_lighter/zone_ig_lighter.cpp +++ b/code/nel/tools/3d/zone_ig_lighter/zone_ig_lighter.cpp @@ -410,6 +410,12 @@ int main(int argc, char* argv[]) if(group->getInstance(instance).DontCastShadow || group->getInstance(instance).DontCastShadowForExterior) continue; + if (toLower (CFile::getExtension (name)) == "pacs_prim") + { + nlwarning("EXPORT BUG: Can't read %s (not a shape), should not be part of .ig!", name.c_str()); + continue; + } + // Add a .shape at the end ? if (!name.empty()) { diff --git a/code/nel/tools/3d/zone_lighter/zone_lighter.cpp b/code/nel/tools/3d/zone_lighter/zone_lighter.cpp index 9b6df0900..b3c6807c1 100644 --- a/code/nel/tools/3d/zone_lighter/zone_lighter.cpp +++ b/code/nel/tools/3d/zone_lighter/zone_lighter.cpp @@ -202,7 +202,7 @@ static void loadIGFromContinent(NLMISC::CConfigFile ¶meter, std::listgetInstance(instance).DontCastShadow || group->getInstance(instance).DontCastShadowForExterior) continue; + if (toLower (CFile::getExtension (name)) == "pacs_prim") + { + nlwarning("EXPORT BUG: Can't read %s (not a shape), should not be part of .ig!", name.c_str()); + continue; + } + // PS ? if (toLower (CFile::getExtension (name)) == "ps") continue; diff --git a/code/nel/tools/3d/zviewer/zviewer.cpp b/code/nel/tools/3d/zviewer/zviewer.cpp index d1711c286..9d64badb1 100644 --- a/code/nel/tools/3d/zviewer/zviewer.cpp +++ b/code/nel/tools/3d/zviewer/zviewer.cpp @@ -41,8 +41,10 @@ #include #ifdef NL_OS_WINDOWS - #define NOMINMAX - #include +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif +# include #endif // NL_OS_WINDOWS using namespace std; @@ -981,7 +983,7 @@ int main(int /* argc */, char ** /* argv */) ViewerCfg.FontManager.setMaxMemory(2000000); displayZones(); - + // release nelu NL3D::CNELU::release(); } diff --git a/code/nel/tools/CMakeLists.txt b/code/nel/tools/CMakeLists.txt index bef7ebcfd..0285bd9c2 100644 --- a/code/nel/tools/CMakeLists.txt +++ b/code/nel/tools/CMakeLists.txt @@ -1,4 +1,3 @@ - # Don't add other subdirectories if only max plugins are selected. IF(WITH_NEL_TOOLS) ADD_SUBDIRECTORY(misc) @@ -6,9 +5,7 @@ IF(WITH_NEL_TOOLS) ENDIF(WITH_NEL_TOOLS) # Max plugins are under the 3d directory as well. -IF(WITH_3D) - ADD_SUBDIRECTORY(3d) -ENDIF(WITH_3D) +ADD_SUBDIRECTORY(3d) # Don't add other subdirectories if only max plugins are selected. IF(WITH_NEL_TOOLS) diff --git a/code/nel/tools/build_gamedata/0_setup.py b/code/nel/tools/build_gamedata/0_setup.py index 1e1824b2c..8eff34131 100755 --- a/code/nel/tools/build_gamedata/0_setup.py +++ b/code/nel/tools/build_gamedata/0_setup.py @@ -8,7 +8,7 @@ # Run all setup processes # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -266,7 +266,7 @@ if not args.noconf: sf.write("# Site configuration.\n") sf.write("# \n") sf.write("# NeL - MMORPG Framework \n") - sf.write("# Copyright (C) 2010 Winch Gate Property Limited\n") + sf.write("# Copyright (C) 2009-2014 by authors\n") sf.write("# \n") sf.write("# This program is free software: you can redistribute it and/or modify\n") sf.write("# it under the terms of the GNU Affero General Public License as\n") @@ -432,6 +432,8 @@ if not args.noverify: findTool(log, ToolDirectories, TgaCutTool, ToolSuffix) findTool(log, ToolDirectories, PatchGenTool, ToolSuffix) findTool(log, ToolDirectories, TranslationToolsTool, ToolSuffix) + findTool(log, ToolDirectories, BuildWorldPackedColTool, ToolSuffix) + findTool(log, ToolDirectories, R2IslandsTexturesTool, ToolSuffix) log.close() if os.path.isfile("0_setup.log"): diff --git a/code/nel/tools/build_gamedata/1_export.py b/code/nel/tools/build_gamedata/1_export.py index 1b77d2c23..d9e4670f7 100755 --- a/code/nel/tools/build_gamedata/1_export.py +++ b/code/nel/tools/build_gamedata/1_export.py @@ -8,7 +8,7 @@ # Run all export processes # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/2_build.py b/code/nel/tools/build_gamedata/2_build.py index 79af533fa..4777ad2d1 100755 --- a/code/nel/tools/build_gamedata/2_build.py +++ b/code/nel/tools/build_gamedata/2_build.py @@ -8,7 +8,7 @@ # Run all build processes # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/3_install.py b/code/nel/tools/build_gamedata/3_install.py index edc542bb3..b2584274c 100755 --- a/code/nel/tools/build_gamedata/3_install.py +++ b/code/nel/tools/build_gamedata/3_install.py @@ -8,7 +8,7 @@ # Run all install processes # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/a1_worldedit_data.py b/code/nel/tools/build_gamedata/a1_worldedit_data.py index e69de29bb..f7aae7a04 100755 --- a/code/nel/tools/build_gamedata/a1_worldedit_data.py +++ b/code/nel/tools/build_gamedata/a1_worldedit_data.py @@ -0,0 +1,74 @@ +#!/usr/bin/python +# +# \file a1_worldedit_data.py +# \brief Install worldedit data +# \date 2014-09-10 14:01GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install worldedit data +# +# NeL - MMORPG Framework +# Copyright (C) 2014 by authors +# +# 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 . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from tools import * + +sys.path.append(WorkspaceDirectory) +from projects import * + +# Log error +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install worldedit data") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +for ecosystem in WorldEditEcosystems: + ecosystemName = ecosystem[0] + srcZoneLigos = ExportBuildDirectory + "/ecosystems/" + ecosystemName + "/ligo_es/zoneligos/" + dstZoneLigos = WorldEditInstallDirectory + "/" + ecosystemName + "/zoneligos/" + mkPath(log, srcZoneLigos) + mkPath(log, dstZoneLigos) + copyFilesNoTreeIfNeeded(log, srcZoneLigos, dstZoneLigos) + srcZoneBitmaps = DatabaseDirectory + "/landscape/ligo/" + ecosystemName + "/zonebitmaps/" + dstZoneBitmaps = WorldEditInstallDirectory + "/" + ecosystemName + "/zonebitmaps/" + mkPath(log, srcZoneBitmaps) + mkPath(log, dstZoneBitmaps) + copyFilesExtNoTreeIfNeeded(log, srcZoneBitmaps, dstZoneBitmaps, ".tga") + copyFilesExtNoTreeIfNeeded(log, srcZoneBitmaps, dstZoneBitmaps, ".png") + dstCollisionMap = WorldEditInstallDirectory + "/" + ecosystemName + "/collisionmap/" + mkPath(log, dstCollisionMap) + for continentName in ecosystem[1]: + srcCollisionMap = ExportBuildDirectory + "/continents/" + continentName + "/ai_wmap/" + mkPath(log, srcCollisionMap) + copyFilesExtNoTreeIfNeeded(log, srcCollisionMap, dstCollisionMap, ".tga") + copyFilesExtNoTreeIfNeeded(log, srcCollisionMap, dstCollisionMap, ".png") +printLog(log, "") + +log.close() +if os.path.isfile("a1_worldedit_data.log"): + os.remove("a1_worldedit_data.log") +shutil.copy("log.log", time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + "_worldedit_data.log") +shutil.move("log.log", "a1_worldedit_data.log") diff --git a/code/nel/tools/build_gamedata/all_install_dev.bat b/code/nel/tools/build_gamedata/all_install_dev.bat new file mode 100644 index 000000000..6791bbea0 --- /dev/null +++ b/code/nel/tools/build_gamedata/all_install_dev.bat @@ -0,0 +1,9 @@ +title Ryzom Core: 3_install.py +3_install.py +title Ryzom Core: a1_worldedit_data.py +a1_worldedit_data.py +title Ryzom Core: b1_client_dev.py +b1_client_dev.py +title Ryzom Core: b2_shard_data.py +b2_shard_data.py +title Ryzom Core: Ready diff --git a/code/nel/tools/build_gamedata/b1_client_dev.py b/code/nel/tools/build_gamedata/b1_client_dev.py index 9553ed6df..a23ee693c 100755 --- a/code/nel/tools/build_gamedata/b1_client_dev.py +++ b/code/nel/tools/build_gamedata/b1_client_dev.py @@ -8,7 +8,7 @@ # Install to client dev # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -52,6 +52,10 @@ if not os.path.isfile(ClientDevDirectory + "/client.cfg"): cfg.write("PreDataPath = {\n") cfg.write("\t\"" + InstallDirectory + "\", \"user\", \"patch\", \"data\", \"examples\" \n") cfg.write("};\n") + cfg.write("PatchWanted = 0;\n") + cfg.write("DisplayLuaDebugInfo = 1;\n") + cfg.write("AllowDebugLua = 1;\n") + cfg.write("FullScreen = 0;\n") printLog(log, "") printLog(log, ">>> Install data <<<") diff --git a/code/nel/tools/build_gamedata/b2_shard_data.py b/code/nel/tools/build_gamedata/b2_shard_data.py index 2843769e9..f0a50cfdf 100755 --- a/code/nel/tools/build_gamedata/b2_shard_data.py +++ b/code/nel/tools/build_gamedata/b2_shard_data.py @@ -8,7 +8,7 @@ # Install shard data # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/characters_dev.bat b/code/nel/tools/build_gamedata/characters_dev.bat new file mode 100644 index 000000000..f2b374c47 --- /dev/null +++ b/code/nel/tools/build_gamedata/characters_dev.bat @@ -0,0 +1,11 @@ +title Ryzom Core: 1_export.py (CHARACTERS) +1_export.py -ipj common/characters common/characters_maps_hr +title Ryzom Core: 2_build.py (CHARACTERS) +2_build.py -ipj common/characters common/characters_maps_hr +title Ryzom Core: 3_install.py (CHARACTERS) +3_install.py -ipj common/characters common/characters_maps_hr +title Ryzom Core: b1_client_dev.py (CHARACTERS) +b1_client_dev.py +title Ryzom Core: b2_shard_data.py (CHARACTERS) +b2_shard_data.py +title Ryzom Core: Ready (CHARACTERS) diff --git a/code/nel/tools/build_gamedata/configuration/scripts.py b/code/nel/tools/build_gamedata/configuration/scripts.py index d7122d3a3..9a815a2b9 100755 --- a/code/nel/tools/build_gamedata/configuration/scripts.py +++ b/code/nel/tools/build_gamedata/configuration/scripts.py @@ -7,7 +7,7 @@ # Useful scripts # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -282,6 +282,26 @@ def findFilesNoSubdir(log, dir_where, file_ext): printLog(log, "findFilesNoSubdir: file not dir or file?!" + fileFull) return result +def findFilesNoSubdirFiltered(log, dir_where, file_ext, filter): + if len(filter) == 0: + return findFilesNoSubdir(log, dir_where, file_ext) + result = [ ] + files = os.listdir(dir_where) + len_file_ext = len(file_ext) + for fileName in files: + if fileName != ".svn" and fileName != ".." and fileName != "." and fileName != "*.*": + fileFull = dir_where + "/" + fileName + if os.path.isfile(fileFull): + if fileName[-len_file_ext:].lower() == file_ext.lower(): + fileNameLower = fileName.lower() + for filterWord in filter: + if filterWord in fileNameLower: + result += [ fileName ] + break + elif not os.path.isdir(fileFull): + printLog(log, "findFilesNoSubdir: file not dir or file?!" + fileFull) + return result + def findFile(log, dir_where, file_name): files = os.listdir(dir_where) for fileName in files: @@ -323,6 +343,31 @@ def needUpdateDirByLowercaseTagLog(log, dir_source, ext_source, dir_dest, ext_de printLog(log, "SKIP " + str(skipCount) + " / " + str(len(sourceFiles)) + "; DEST " + str(len(destFiles))) return 0 +def needUpdateDirByTagLogFiltered(log, dir_source, ext_source, dir_dest, ext_dest, filter): + updateCount = 0 + skipCount = 0 + lenSrcExt = len(ext_source) + sourceFiles = findFilesNoSubdirFiltered(log, dir_source, ext_source, filter) + destFiles = findFilesNoSubdir(log, dir_dest, ext_dest) + for file in sourceFiles: + sourceFile = dir_source + "/" + file + tagFile = dir_dest + "/" + file[0:-lenSrcExt] + ext_dest + if os.path.isfile(tagFile): + sourceTime = os.stat(sourceFile).st_mtime + tagTime = os.stat(tagFile).st_mtime + if (sourceTime > tagTime): + updateCount = updateCount + 1 + else: + skipCount = skipCount + 1 + else: + updateCount = updateCount + 1 + if updateCount > 0: + printLog(log, "UPDATE " + str(updateCount) + " / " + str(len(sourceFiles)) + "; SKIP " + str(skipCount) + " / " + str(len(sourceFiles)) + "; DEST " + str(len(destFiles))) + return 1 + else: + printLog(log, "SKIP " + str(skipCount) + " / " + str(len(sourceFiles)) + "; DEST " + str(len(destFiles))) + return 0 + def needUpdateDirByTagLog(log, dir_source, ext_source, dir_dest, ext_dest): updateCount = 0 skipCount = 0 diff --git a/code/nel/tools/build_gamedata/configuration/tools.py b/code/nel/tools/build_gamedata/configuration/tools.py index f9cc54964..c0c962360 100755 --- a/code/nel/tools/build_gamedata/configuration/tools.py +++ b/code/nel/tools/build_gamedata/configuration/tools.py @@ -8,7 +8,7 @@ # Tools configuration. # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -91,3 +91,5 @@ AiBuildWmapTool = "ai_build_wmap" TgaCutTool = "tga_cut" PatchGenTool = "patch_gen" TranslationToolsTool = "translation_tools" +BuildWorldPackedColTool = "build_world_packed_col" +R2IslandsTexturesTool = "r2_islands_textures" diff --git a/code/nel/tools/build_gamedata/d1_client_patch.py b/code/nel/tools/build_gamedata/d1_client_patch.py index 861ea8bd0..600347d0b 100755 --- a/code/nel/tools/build_gamedata/d1_client_patch.py +++ b/code/nel/tools/build_gamedata/d1_client_patch.py @@ -8,7 +8,7 @@ # Install to client patch # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/d2_client_install.py b/code/nel/tools/build_gamedata/d2_client_install.py index 26fc4f5c5..febaef656 100755 --- a/code/nel/tools/build_gamedata/d2_client_install.py +++ b/code/nel/tools/build_gamedata/d2_client_install.py @@ -8,7 +8,7 @@ # Install to client install # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/executables_dev.bat b/code/nel/tools/build_gamedata/executables_dev.bat index d693b49e0..2007016c4 100644 --- a/code/nel/tools/build_gamedata/executables_dev.bat +++ b/code/nel/tools/build_gamedata/executables_dev.bat @@ -1,5 +1,5 @@ title Ryzom Core: 3_install.py (EXECUTABLES) -3_install.py -ipj common/gamedev common/exedll common/cfg +3_install.py -ipj common/gamedev common/exedll common/cfg common/data_common title Ryzom Core: b1_client_dev.py b1_client_dev.py title Ryzom Core: b2_shard_data.py diff --git a/code/nel/tools/build_gamedata/export_build_install.py b/code/nel/tools/build_gamedata/export_build_install.py index 5be6a2dfc..b5e46ba06 100755 --- a/code/nel/tools/build_gamedata/export_build_install.py +++ b/code/nel/tools/build_gamedata/export_build_install.py @@ -8,7 +8,7 @@ # Run all processes # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/generators/ecosystem_project_template/directories.py b/code/nel/tools/build_gamedata/generators/ecosystem_project_template/directories.py index 90c8b5a91..34886120e 100755 --- a/code/nel/tools/build_gamedata/generators/ecosystem_project_template/directories.py +++ b/code/nel/tools/build_gamedata/generators/ecosystem_project_template/directories.py @@ -14,7 +14,7 @@ # Directories configuration for '%PreGenEcosystemName%' ecosystem. # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/generators/ecosystem_project_template/process.py b/code/nel/tools/build_gamedata/generators/ecosystem_project_template/process.py index 2e3d9643a..367ff8feb 100755 --- a/code/nel/tools/build_gamedata/generators/ecosystem_project_template/process.py +++ b/code/nel/tools/build_gamedata/generators/ecosystem_project_template/process.py @@ -12,7 +12,7 @@ # Process configuration for '%PreGenEcosystemName%' ecosystem. # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/generators/generate_all.py b/code/nel/tools/build_gamedata/generators/generate_all.py index cb191e3d9..29060647d 100755 --- a/code/nel/tools/build_gamedata/generators/generate_all.py +++ b/code/nel/tools/build_gamedata/generators/generate_all.py @@ -8,7 +8,7 @@ # Run all setup processes # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/generators/generate_ecosystem_projects.py b/code/nel/tools/build_gamedata/generators/generate_ecosystem_projects.py index b1852565e..0f71f615b 100755 --- a/code/nel/tools/build_gamedata/generators/generate_ecosystem_projects.py +++ b/code/nel/tools/build_gamedata/generators/generate_ecosystem_projects.py @@ -8,7 +8,7 @@ # Generate ecosystem projects # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/generators/generate_simple_max_exporters.py b/code/nel/tools/build_gamedata/generators/generate_simple_max_exporters.py index cd8a9039f..be4867840 100755 --- a/code/nel/tools/build_gamedata/generators/generate_simple_max_exporters.py +++ b/code/nel/tools/build_gamedata/generators/generate_simple_max_exporters.py @@ -8,7 +8,7 @@ # Run all setup processes # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/generators/generate_tagged_max_exporters.py b/code/nel/tools/build_gamedata/generators/generate_tagged_max_exporters.py index 89a65d3fb..99f8cba83 100755 --- a/code/nel/tools/build_gamedata/generators/generate_tagged_max_exporters.py +++ b/code/nel/tools/build_gamedata/generators/generate_tagged_max_exporters.py @@ -8,7 +8,7 @@ # Run all setup processes # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/clod.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/clod.ms index 29744c7d1..1a947f7d6 100755 --- a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/clod.ms +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/clod.ms @@ -49,6 +49,7 @@ fn runNelMaxExport inputMaxFile = tagThisFile = true -- Unhide category + unhidelayers() unhidecategory() -- Unhide @@ -56,6 +57,7 @@ fn runNelMaxExport inputMaxFile = -- unselect max select none + clearSelection() -- Exported object count exported = 0 diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/cmb.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/cmb.ms index 2a7492c29..40feab761 100755 --- a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/cmb.ms +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/cmb.ms @@ -36,6 +36,7 @@ fn runNelMaxExport inputMaxFile = -- Select all collision mesh max select none + clearSelection() for m in geometry do ( if (isToBeExported m) == true then diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/ig.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/ig.ms index 7c9563088..43a05abcc 100755 --- a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/ig.ms +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/ig.ms @@ -54,6 +54,7 @@ fn runNelMaxExport inputMaxFile = tagThisFile = true -- Unhide category + unhidelayers() unhidecategory() -- Unhide @@ -61,6 +62,7 @@ fn runNelMaxExport inputMaxFile = -- unselect max select none + clearSelection() -- Exported object count exported = 0 @@ -109,6 +111,7 @@ fn runNelMaxExport inputMaxFile = ( -- Select none max select none + clearSelection() -- Select all node in this ig for node in geometry do diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/pacs_prim.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/pacs_prim.ms index 93e94de19..ea730c0b4 100755 --- a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/pacs_prim.ms +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/pacs_prim.ms @@ -10,6 +10,7 @@ fn runNelMaxExport inputMaxFile = -- Select none max select none + clearSelection() -- Select all PACS primitives for i in geometry do diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/shape.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/shape.ms index c1f4761ff..cfb51d0e0 100755 --- a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/shape.ms +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/shape.ms @@ -187,11 +187,14 @@ fn haveCoarseMesh node = return false ) +fn getRoot node = if isvalidnode node.parent then getRoot node.parent else node + fn runNelMaxExportSub inputMaxFile retryCount = ( tagThisFile = false -- Unhide category + unhidelayers() unhidecategory() -- Unhide @@ -199,6 +202,7 @@ fn runNelMaxExportSub inputMaxFile retryCount = -- unselect max select none + clearSelection() -- Exported object count exported = 0 @@ -272,55 +276,51 @@ fn runNelMaxExportSub inputMaxFile retryCount = -- For each node for node in array_node do ( - -- It is root ? - if (node.parent == undefined) then + -- Is not a skeleton ? + if (((substring node.name 1 3) != "Bip") and ((substring (getRoot node).name 1 3) != "Bip")) then ( - -- Is not a skeleton ? - if (node.name != "Bip01") then + -- Can be exported ? + if (isToBeExported node == true) then ( - -- Can be exported ? - if (isToBeExported node == true) then + -- Not a lod ? + if ((isLod node) == false) then ( - -- Not a lod ? - if ((isLod node) == false) then + -- Output directory + if (haveCoarseMesh node) == true then + output = ("%OutputDirectoryWithCoarseMesh%/" + (node.name) + ".shape") + else + output = ("%OutputDirectoryWithoutCoarseMesh%/" + (node.name) + ".shape") + + -- Compare file date + if (NeLTestFileDate output inputMaxFile) == true then ( - -- Output directory - if (haveCoarseMesh node) == true then - output = ("%OutputDirectoryWithCoarseMesh%/" + (node.name) + ".shape") - else - output = ("%OutputDirectoryWithoutCoarseMesh%/" + (node.name) + ".shape") - - -- Compare file date - if (NeLTestFileDate output inputMaxFile) == true then + try ( - try + -- Export the shape + if (NelExportShapeEx node output %ShapeExportOptShadow% %ShapeExportOptExportLighting% "%OutputDirectoryLightmap%" %ShapeExportOptLightingLimit% %ShapeExportOptLumelSize% %ShapeExportOptOversampling% true false %ShapeExportOptLightmapLog%) == true then ( - -- Export the shape - if (NelExportShapeEx node output %ShapeExportOptShadow% %ShapeExportOptExportLighting% "%OutputDirectoryLightmap%" %ShapeExportOptLightingLimit% %ShapeExportOptLumelSize% %ShapeExportOptOversampling% true false %ShapeExportOptLightmapLog%) == true then - ( - nlerror("OK "+output) - exported = exported +1 - ) - else - ( - -- Error - nlerror("ERROR exporting shape " + node.name + " in file " + inputMaxFile) - tagThisFile = false - ) + nlerror("OK "+output) + exported = exported +1 ) - catch + else ( -- Error - nlerror("ERROR fatal error exporting shape " + node.name + " in file " + inputMaxFile) + nlerror("ERROR exporting shape " + node.name + " in file " + inputMaxFile) tagThisFile = false ) ) - else + catch ( - nlerror("SKIPPED " + output) - exported = exported + 1 + -- Error + nlerror("ERROR fatal error exporting shape " + node.name + " in file " + inputMaxFile) + tagThisFile = false ) ) + else + ( + nlerror("SKIPPED " + output) + exported = exported + 1 + ) ) ) ) diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/veget.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/veget.ms index f0d5cd584..614a9a94f 100755 --- a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/veget.ms +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/veget.ms @@ -39,6 +39,7 @@ fn runNelMaxExport inputMaxFile = tagThisFile = true -- Unhide category + unhidelayers() unhidecategory() -- Unhide @@ -46,6 +47,7 @@ fn runNelMaxExport inputMaxFile = -- unselect max select none + clearSelection() -- Exported object count exported = 0 diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/zone.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/zone.ms index d4ecbe275..338d48733 100755 --- a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/zone.ms +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/zone.ms @@ -40,6 +40,7 @@ fn runNelMaxExport inputMaxFile = -- Select none max select none + clearSelection() -- Found it ? find = false diff --git a/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/0_setup.py b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/0_setup.py index 1531f2c89..520eedb03 100755 --- a/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/0_setup.py +++ b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/0_setup.py @@ -8,7 +8,7 @@ # Setup %PreGenProcessName% # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/1_export_header.py b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/1_export_header.py index 1844e0777..6e857af0d 100755 --- a/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/1_export_header.py +++ b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/1_export_header.py @@ -12,7 +12,7 @@ # Export %PreGenProcessName% # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/2_build.py b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/2_build.py index 9b84cdf41..9583c04eb 100755 --- a/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/2_build.py +++ b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/2_build.py @@ -8,7 +8,7 @@ # Build %PreGenProcessName% # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/3_install.py b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/3_install.py index 8406715d7..f2d296d55 100755 --- a/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/3_install.py +++ b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/3_install.py @@ -8,7 +8,7 @@ # Install %PreGenProcessName% # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/export_header.ms b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/export_header.ms index 2d5e5434f..f06bab786 100755 --- a/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/export_header.ms +++ b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/export_header.ms @@ -13,6 +13,16 @@ nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename +-- Unhide layers +fn unhidelayers = +( + for i = 0 to (LayerManager.count - 1) do + ( + layer = (LayerManager.getLayer i) + layer.ishidden = false + ) +) + -- Unhide category fn unhidecategory = ( diff --git a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/0_setup.py b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/0_setup.py index b2340583e..6bd49c40f 100755 --- a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/0_setup.py +++ b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/0_setup.py @@ -8,7 +8,7 @@ # Setup %PreGenProcessName% # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/1_export_header.py b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/1_export_header.py index d16797a40..523001d22 100755 --- a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/1_export_header.py +++ b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/1_export_header.py @@ -12,7 +12,7 @@ # Export %PreGenProcessName% # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/2_build.py b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/2_build.py index 9b84cdf41..9583c04eb 100755 --- a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/2_build.py +++ b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/2_build.py @@ -8,7 +8,7 @@ # Build %PreGenProcessName% # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/3_install.py b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/3_install.py index bc64951a2..65122f3f8 100755 --- a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/3_install.py +++ b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/3_install.py @@ -8,7 +8,7 @@ # Install %PreGenProcessName% # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/export_header.ms b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/export_header.ms index 03bfea443..a7b97a064 100755 --- a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/export_header.ms +++ b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/export_header.ms @@ -16,6 +16,16 @@ nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename +-- Unhide layers +fn unhidelayers = +( + for i = 0 to (LayerManager.count - 1) do + ( + layer = (LayerManager.getLayer i) + layer.ishidden = false + ) +) + -- Unhide category fn unhidecategory = ( diff --git a/code/nel/tools/build_gamedata/panoply_dev.bat b/code/nel/tools/build_gamedata/panoply_dev.bat new file mode 100644 index 000000000..13afac56c --- /dev/null +++ b/code/nel/tools/build_gamedata/panoply_dev.bat @@ -0,0 +1,11 @@ +title Ryzom Core: 1_export.py (PANOPLY) +1_export.py -ipj common/characters_maps_hr +title Ryzom Core: 2_build.py (PANOPLY) +2_build.py -ipj common/characters_maps_hr +title Ryzom Core: 3_install.py (PANOPLY) +3_install.py -ipj common/characters_maps_hr +title Ryzom Core: b1_client_dev.py (PANOPLY) +b1_client_dev.py +title Ryzom Core: b2_shard_data.py (PANOPLY) +b2_shard_data.py +title Ryzom Core: Ready (PANOPLY) diff --git a/code/nel/tools/build_gamedata/processes/0_setup.py b/code/nel/tools/build_gamedata/processes/0_setup.py index 011c65f7b..6fb354781 100755 --- a/code/nel/tools/build_gamedata/processes/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/0_setup.py @@ -8,7 +8,7 @@ # Run all setup processes # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/1_export.py b/code/nel/tools/build_gamedata/processes/1_export.py index 00339aeff..f3ea98ed7 100755 --- a/code/nel/tools/build_gamedata/processes/1_export.py +++ b/code/nel/tools/build_gamedata/processes/1_export.py @@ -8,7 +8,7 @@ # Run all export processes # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/2_build.py b/code/nel/tools/build_gamedata/processes/2_build.py index 80e089b1a..eea528708 100755 --- a/code/nel/tools/build_gamedata/processes/2_build.py +++ b/code/nel/tools/build_gamedata/processes/2_build.py @@ -8,7 +8,7 @@ # Run all build processes # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/3_install.py b/code/nel/tools/build_gamedata/processes/3_install.py index 1d97a4b8c..a34fdbce6 100755 --- a/code/nel/tools/build_gamedata/processes/3_install.py +++ b/code/nel/tools/build_gamedata/processes/3_install.py @@ -8,7 +8,7 @@ # Run all install processes # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/_dummy/0_setup.py b/code/nel/tools/build_gamedata/processes/_dummy/0_setup.py index deefb4f12..e3104979d 100755 --- a/code/nel/tools/build_gamedata/processes/_dummy/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/_dummy/0_setup.py @@ -8,7 +8,7 @@ # Setup dummy # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/_dummy/1_export.py b/code/nel/tools/build_gamedata/processes/_dummy/1_export.py index 851dd8077..373f984ae 100755 --- a/code/nel/tools/build_gamedata/processes/_dummy/1_export.py +++ b/code/nel/tools/build_gamedata/processes/_dummy/1_export.py @@ -8,7 +8,7 @@ # Export dummy # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/_dummy/2_build.py b/code/nel/tools/build_gamedata/processes/_dummy/2_build.py index 853858806..6dd48b9e2 100755 --- a/code/nel/tools/build_gamedata/processes/_dummy/2_build.py +++ b/code/nel/tools/build_gamedata/processes/_dummy/2_build.py @@ -8,7 +8,7 @@ # Build dummy # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/_dummy/3_install.py b/code/nel/tools/build_gamedata/processes/_dummy/3_install.py index 9630480cc..d809646b8 100755 --- a/code/nel/tools/build_gamedata/processes/_dummy/3_install.py +++ b/code/nel/tools/build_gamedata/processes/_dummy/3_install.py @@ -8,7 +8,7 @@ # Install dummy # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/ai_wmap/0_setup.py b/code/nel/tools/build_gamedata/processes/ai_wmap/0_setup.py index 03a3acde9..418bb8de3 100755 --- a/code/nel/tools/build_gamedata/processes/ai_wmap/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/ai_wmap/0_setup.py @@ -8,7 +8,7 @@ # Setup ai_wmap # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/ai_wmap/1_export.py b/code/nel/tools/build_gamedata/processes/ai_wmap/1_export.py index 5259b3515..de3d108c4 100755 --- a/code/nel/tools/build_gamedata/processes/ai_wmap/1_export.py +++ b/code/nel/tools/build_gamedata/processes/ai_wmap/1_export.py @@ -8,7 +8,7 @@ # Export ai_wmap # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/ai_wmap/2_build.py b/code/nel/tools/build_gamedata/processes/ai_wmap/2_build.py index f32cc4d91..8aa63f62f 100755 --- a/code/nel/tools/build_gamedata/processes/ai_wmap/2_build.py +++ b/code/nel/tools/build_gamedata/processes/ai_wmap/2_build.py @@ -8,7 +8,7 @@ # Build ai_wmap # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/ai_wmap/3_install.py b/code/nel/tools/build_gamedata/processes/ai_wmap/3_install.py index e9e68651e..fb81b991d 100755 --- a/code/nel/tools/build_gamedata/processes/ai_wmap/3_install.py +++ b/code/nel/tools/build_gamedata/processes/ai_wmap/3_install.py @@ -8,7 +8,7 @@ # Install ai_wmap # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/anim/0_setup.py b/code/nel/tools/build_gamedata/processes/anim/0_setup.py index 7261feeeb..1f9cf10d7 100755 --- a/code/nel/tools/build_gamedata/processes/anim/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/anim/0_setup.py @@ -8,7 +8,7 @@ # Setup anim # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/anim/1_export.py b/code/nel/tools/build_gamedata/processes/anim/1_export.py index c59056266..1745c45a9 100755 --- a/code/nel/tools/build_gamedata/processes/anim/1_export.py +++ b/code/nel/tools/build_gamedata/processes/anim/1_export.py @@ -6,13 +6,13 @@ # # \file 1_export.py # \brief Export anim -# \date 2011-09-21-20-51-GMT +# \date 2015-01-06-16-31-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export anim # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/anim/2_build.py b/code/nel/tools/build_gamedata/processes/anim/2_build.py index 8a2ab5bab..81d968b06 100755 --- a/code/nel/tools/build_gamedata/processes/anim/2_build.py +++ b/code/nel/tools/build_gamedata/processes/anim/2_build.py @@ -8,7 +8,7 @@ # Build anim # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/anim/3_install.py b/code/nel/tools/build_gamedata/processes/anim/3_install.py index 8887ba8fe..896f43db0 100755 --- a/code/nel/tools/build_gamedata/processes/anim/3_install.py +++ b/code/nel/tools/build_gamedata/processes/anim/3_install.py @@ -8,7 +8,7 @@ # Install anim # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/anim/maxscript/anim_export.ms b/code/nel/tools/build_gamedata/processes/anim/maxscript/anim_export.ms index 7121e16d5..fc1eda5f9 100755 --- a/code/nel/tools/build_gamedata/processes/anim/maxscript/anim_export.ms +++ b/code/nel/tools/build_gamedata/processes/anim/maxscript/anim_export.ms @@ -16,6 +16,16 @@ nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename +-- Unhide layers +fn unhidelayers = +( + for i = 0 to (LayerManager.count - 1) do + ( + layer = (LayerManager.getLayer i) + layer.ishidden = false + ) +) + -- Unhide category fn unhidecategory = ( diff --git a/code/nel/tools/build_gamedata/processes/cartographer/0_setup.py b/code/nel/tools/build_gamedata/processes/cartographer/0_setup.py new file mode 100644 index 000000000..6f8b9a754 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/cartographer/0_setup.py @@ -0,0 +1,114 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup cartographer +# \date 2014-09-13 13:32GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup cartographer +# +# NeL - MMORPG Framework +# Copyright (C) 2014 Jan BOON +# +# 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 . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup cartographer") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + CartographerBuildDirectory) + +# Setup lookup directories +printLog(log, ">>> Setup lookup directories <<<") +mkPath(log, ExportBuildDirectory + "/" + AiWmapBuildDirectory) # IN +mkPath(log, ExportBuildDirectory + "/" + ZoneLightBuildDirectory) # IN (.zonel) +mkPath(log, ExportBuildDirectory + "/" + ZoneLightIgLandBuildDirectory) # IN (.ig) +mkPath(log, ExportBuildDirectory + "/" + SmallbankExportDirectory) # IN +mkPath(log, ExportBuildDirectory + "/" + FarbankBuildDirectory) # IN +mkPath(log, ExportBuildDirectory + "/" + DisplaceExportDirectory) # IN +mkPath(log, ExportBuildDirectory + "/" + TilesExportDirectory) # IN +mkPath(log, LeveldesignDataCommonDirectory) # IN +mkPath(log, LeveldesignDfnDirectory) # IN +mkPath(log, LeveldesignDirectory) # IN +for dir in PropertiesExportBuildSearchPaths: + mkPath(log, ExportBuildDirectory + "/" + dir) + +# Setup client directories +printLog(log, ">>> Setup install directories <<<") +mkPath(log, InstallDirectory + "/" + CartographerInstallDirectory) + +# Setup client directories +printLog(log, ">>> Setup configuration <<<") +mkPath(log, ActiveProjectDirectory + "/generated") +cfg = open(ActiveProjectDirectory + "/generated/island_screenshots.cfg", "w") +cfg.write("\n") +cfg.write("// BUILD CARTOGRAPHER CONFIGURATION\n") +cfg.write("\n") +cfg.write("SearchPaths = {\n") +cfg.write("\t\"" + ExportBuildDirectory + "/" + AiWmapBuildDirectory + "\", \n") +cfg.write("\t\"" + ExportBuildDirectory + "/" + ZoneLightBuildDirectory + "\", \n") +cfg.write("\t\"" + ExportBuildDirectory + "/" + ZoneLightIgLandBuildDirectory + "\", \n") +cfg.write("\t\"" + ExportBuildDirectory + "/" + SmallbankExportDirectory + "\", \n") +cfg.write("\t\"" + ExportBuildDirectory + "/" + FarbankBuildDirectory + "\", \n") +cfg.write("\t\"" + ExportBuildDirectory + "/" + DisplaceExportDirectory + "\", \n") +cfg.write("\t\"" + ExportBuildDirectory + "/" + TilesExportDirectory + "\", \n") +cfg.write("\t\"" + LeveldesignDataCommonDirectory + "\", \n") +cfg.write("\t\"" + LeveldesignDfnDirectory + "\", \n") +cfg.write("\t\"" + LeveldesignDirectory + "\", \n") +for dir in PropertiesExportBuildSearchPaths: + cfg.write("\t\"" + ExportBuildDirectory + "/" + dir + "\", \n") +cfg.write("};\n") +cfg.write("\n") +cfg.write("OutDir = \"" + ExportBuildDirectory + "/" + CartographerBuildDirectory + "\";\n") +cfg.write("\n") +cfg.write("Continents = {\n") +cfg.write("\t\"" + CartographerContinent + "\", \n") +cfg.write("};\n") +cfg.write("\n") +cfg.write("SeasonSuffixes = {\n") +for suffix in MultipleTilesPostfix: + cfg.write("\t\"" + suffix + "\", \n") +cfg.write("};\n") +cfg.write("\n") +cfg.write("InverseZTest = true;\n") +cfg.write("Vegetation = true;\n") +cfg.write("MeterPixelSize = 2;\n") +cfg.write("\n") +cfg.write("CompleteIslandsFile = \"r2_islands.xml\";\n") +cfg.write("EntryPointsFile = \"r2_entry_points.txt\";\n") +cfg.write("\n") +cfg.close() + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/cartographer/1_export.py b/code/nel/tools/build_gamedata/processes/cartographer/1_export.py new file mode 100644 index 000000000..319316728 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/cartographer/1_export.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export cartographer +# \date 2014-09-13 13:32GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export cartographer +# +# NeL - MMORPG Framework +# Copyright (C) 2014 Jan BOON +# +# 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 . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export cartographer") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/cartographer/2_build.py b/code/nel/tools/build_gamedata/processes/cartographer/2_build.py new file mode 100644 index 000000000..c3c14e9aa --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/cartographer/2_build.py @@ -0,0 +1,62 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build cartographer +# \date 2014-09-13 13:32GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build cartographer +# +# NeL - MMORPG Framework +# Copyright (C) 2014 Jan BOON +# +# 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 . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build cartographer") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +R2IslandsTextures = findTool(log, ToolDirectories, R2IslandsTexturesTool, ToolSuffix) + +if R2IslandsTextures == "": + toolLogFail(log, R2IslandsTexturesTool, ToolSuffix) +else: + printLog(log, ">>> Copy island_screenshots.cfg <<<") + cfgPath = ActiveProjectDirectory + "/generated/island_screenshots.cfg" + shutil.copy(cfgPath, "island_screenshots.cfg") + printLog(log, ">>> Build cartographer <<<") + subprocess.call([ R2IslandsTextures ]) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/cartographer/3_install.py b/code/nel/tools/build_gamedata/processes/cartographer/3_install.py new file mode 100644 index 000000000..f241318c4 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/cartographer/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install cartographer +# \date 2014-09-13 13:32GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install cartographer +# +# NeL - MMORPG Framework +# Copyright (C) 2014 Jan BOON +# +# 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 . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install cartographer") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +installPath = InstallDirectory + "/" + CartographerInstallDirectory +mkPath(log, installPath) + +printLog(log, ">>> Install cartographer <<<") +mkPath(log, ExportBuildDirectory + "/" + CartographerBuildDirectory) +copyFilesNoTreeIfNeeded(log, ExportBuildDirectory + "/" + CartographerBuildDirectory, installPath) + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/cegui/0_setup.py b/code/nel/tools/build_gamedata/processes/cegui/0_setup.py index 8ce9a3e78..b3f61468c 100755 --- a/code/nel/tools/build_gamedata/processes/cegui/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/cegui/0_setup.py @@ -7,7 +7,7 @@ # Setup cegui # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/cegui/1_export.py b/code/nel/tools/build_gamedata/processes/cegui/1_export.py index 71104fb4a..018562c46 100755 --- a/code/nel/tools/build_gamedata/processes/cegui/1_export.py +++ b/code/nel/tools/build_gamedata/processes/cegui/1_export.py @@ -7,7 +7,7 @@ # Export cegui # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/cegui/2_build.py b/code/nel/tools/build_gamedata/processes/cegui/2_build.py index 86afc1ec3..134830547 100755 --- a/code/nel/tools/build_gamedata/processes/cegui/2_build.py +++ b/code/nel/tools/build_gamedata/processes/cegui/2_build.py @@ -7,7 +7,7 @@ # Build cegui # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/cegui/3_install.py b/code/nel/tools/build_gamedata/processes/cegui/3_install.py index 89525b1e8..d1d6547ad 100755 --- a/code/nel/tools/build_gamedata/processes/cegui/3_install.py +++ b/code/nel/tools/build_gamedata/processes/cegui/3_install.py @@ -7,7 +7,7 @@ # Install cegui # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/clodbank/0_setup.py b/code/nel/tools/build_gamedata/processes/clodbank/0_setup.py index 223d5a163..a4ab0f4df 100755 --- a/code/nel/tools/build_gamedata/processes/clodbank/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/clodbank/0_setup.py @@ -8,7 +8,7 @@ # Setup clodbank # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -74,6 +74,8 @@ cfgOut.write("{\n") cfgOut.write("\t\"" + ExportBuildDirectory + "/" + ClodExportDirectory + "\", \n") cfgOut.write("\t\"" + ExportBuildDirectory + "/" + SkelExportDirectory + "\", \n") cfgOut.write("\t\"" + ExportBuildDirectory + "/" + AnimBuildDirectory + "\", \n") +cfgOut.write("\t\"" + ExportBuildDirectory + "/" + ShapeOptimizedBuildDirectory + "\", \n") +cfgOut.write("\t\"" + ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory + "\", \n") cfgOut.write("};\n") cfgOut.write("\n") cfgOut.close() diff --git a/code/nel/tools/build_gamedata/processes/clodbank/1_export.py b/code/nel/tools/build_gamedata/processes/clodbank/1_export.py index 0046c2a01..c73a86ac7 100755 --- a/code/nel/tools/build_gamedata/processes/clodbank/1_export.py +++ b/code/nel/tools/build_gamedata/processes/clodbank/1_export.py @@ -6,13 +6,13 @@ # # \file 1_export.py # \brief Export clodbank -# \date 2011-09-21-20-51-GMT +# \date 2015-01-06-16-31-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export clodbank # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/clodbank/2_build.py b/code/nel/tools/build_gamedata/processes/clodbank/2_build.py index 9bd6d2cd6..9146f8c8e 100755 --- a/code/nel/tools/build_gamedata/processes/clodbank/2_build.py +++ b/code/nel/tools/build_gamedata/processes/clodbank/2_build.py @@ -8,7 +8,7 @@ # Build clodbank # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/clodbank/3_install.py b/code/nel/tools/build_gamedata/processes/clodbank/3_install.py index efc3483eb..b8da3d280 100755 --- a/code/nel/tools/build_gamedata/processes/clodbank/3_install.py +++ b/code/nel/tools/build_gamedata/processes/clodbank/3_install.py @@ -8,7 +8,7 @@ # Install clodbank # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/clodbank/maxscript/clod_export.ms b/code/nel/tools/build_gamedata/processes/clodbank/maxscript/clod_export.ms index f01a973e4..02856d2c7 100755 --- a/code/nel/tools/build_gamedata/processes/clodbank/maxscript/clod_export.ms +++ b/code/nel/tools/build_gamedata/processes/clodbank/maxscript/clod_export.ms @@ -16,6 +16,16 @@ nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename +-- Unhide layers +fn unhidelayers = +( + for i = 0 to (LayerManager.count - 1) do + ( + layer = (LayerManager.getLayer i) + layer.ishidden = false + ) +) + -- Unhide category fn unhidecategory = ( @@ -115,6 +125,7 @@ fn runNelMaxExport inputMaxFile = tagThisFile = true -- Unhide category + unhidelayers() unhidecategory() -- Unhide @@ -122,6 +133,7 @@ fn runNelMaxExport inputMaxFile = -- unselect max select none + clearSelection() -- Exported object count exported = 0 diff --git a/code/nel/tools/build_gamedata/processes/copy/0_setup.py b/code/nel/tools/build_gamedata/processes/copy/0_setup.py index d1dd6a59b..f87f94bc9 100755 --- a/code/nel/tools/build_gamedata/processes/copy/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/copy/0_setup.py @@ -8,7 +8,7 @@ # Setup copy # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/copy/1_export.py b/code/nel/tools/build_gamedata/processes/copy/1_export.py index 50922dc75..39fa7fa4e 100755 --- a/code/nel/tools/build_gamedata/processes/copy/1_export.py +++ b/code/nel/tools/build_gamedata/processes/copy/1_export.py @@ -8,7 +8,7 @@ # Export copy # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/copy/2_build.py b/code/nel/tools/build_gamedata/processes/copy/2_build.py index 21b55c1de..796ce3451 100755 --- a/code/nel/tools/build_gamedata/processes/copy/2_build.py +++ b/code/nel/tools/build_gamedata/processes/copy/2_build.py @@ -8,7 +8,7 @@ # Build copy # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/copy/3_install.py b/code/nel/tools/build_gamedata/processes/copy/3_install.py index af988c8a7..7bcacc473 100755 --- a/code/nel/tools/build_gamedata/processes/copy/3_install.py +++ b/code/nel/tools/build_gamedata/processes/copy/3_install.py @@ -8,7 +8,7 @@ # Install copy # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/displace/0_setup.py b/code/nel/tools/build_gamedata/processes/displace/0_setup.py index 9aed98716..6a5e3170e 100755 --- a/code/nel/tools/build_gamedata/processes/displace/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/displace/0_setup.py @@ -8,7 +8,7 @@ # Setup displace # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/displace/1_export.py b/code/nel/tools/build_gamedata/processes/displace/1_export.py index edd93f2ea..52ce5e24d 100755 --- a/code/nel/tools/build_gamedata/processes/displace/1_export.py +++ b/code/nel/tools/build_gamedata/processes/displace/1_export.py @@ -8,7 +8,7 @@ # Export displace # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/displace/2_build.py b/code/nel/tools/build_gamedata/processes/displace/2_build.py index 8a443450c..bc7f91aac 100755 --- a/code/nel/tools/build_gamedata/processes/displace/2_build.py +++ b/code/nel/tools/build_gamedata/processes/displace/2_build.py @@ -8,7 +8,7 @@ # Build displace # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/displace/3_install.py b/code/nel/tools/build_gamedata/processes/displace/3_install.py index bdf8b3a30..76c0c03e4 100755 --- a/code/nel/tools/build_gamedata/processes/displace/3_install.py +++ b/code/nel/tools/build_gamedata/processes/displace/3_install.py @@ -8,7 +8,7 @@ # Install displace # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/farbank/0_setup.py b/code/nel/tools/build_gamedata/processes/farbank/0_setup.py index b02191d2a..9761fa8b1 100755 --- a/code/nel/tools/build_gamedata/processes/farbank/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/farbank/0_setup.py @@ -8,7 +8,7 @@ # Setup farbank # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/farbank/1_export.py b/code/nel/tools/build_gamedata/processes/farbank/1_export.py index 267b5410e..380a3444e 100755 --- a/code/nel/tools/build_gamedata/processes/farbank/1_export.py +++ b/code/nel/tools/build_gamedata/processes/farbank/1_export.py @@ -8,7 +8,7 @@ # Export farbank # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/farbank/2_build.py b/code/nel/tools/build_gamedata/processes/farbank/2_build.py index aed7e4418..85008bdde 100755 --- a/code/nel/tools/build_gamedata/processes/farbank/2_build.py +++ b/code/nel/tools/build_gamedata/processes/farbank/2_build.py @@ -8,7 +8,7 @@ # Build farbank # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/farbank/3_install.py b/code/nel/tools/build_gamedata/processes/farbank/3_install.py index f786a7850..d9164f84a 100755 --- a/code/nel/tools/build_gamedata/processes/farbank/3_install.py +++ b/code/nel/tools/build_gamedata/processes/farbank/3_install.py @@ -8,7 +8,7 @@ # Install farbank # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/font/0_setup.py b/code/nel/tools/build_gamedata/processes/font/0_setup.py index 9b29962b2..4b2a149da 100755 --- a/code/nel/tools/build_gamedata/processes/font/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/font/0_setup.py @@ -8,7 +8,7 @@ # setup font # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/font/1_export.py b/code/nel/tools/build_gamedata/processes/font/1_export.py index 1911aaa0e..f97d3375e 100755 --- a/code/nel/tools/build_gamedata/processes/font/1_export.py +++ b/code/nel/tools/build_gamedata/processes/font/1_export.py @@ -8,7 +8,7 @@ # Export font # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/font/2_build.py b/code/nel/tools/build_gamedata/processes/font/2_build.py index 2f2db281d..bc8794996 100755 --- a/code/nel/tools/build_gamedata/processes/font/2_build.py +++ b/code/nel/tools/build_gamedata/processes/font/2_build.py @@ -8,7 +8,7 @@ # Build font # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/font/3_install.py b/code/nel/tools/build_gamedata/processes/font/3_install.py index 8a7b79e93..c18ae12e3 100755 --- a/code/nel/tools/build_gamedata/processes/font/3_install.py +++ b/code/nel/tools/build_gamedata/processes/font/3_install.py @@ -8,7 +8,7 @@ # Install font # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/ig/0_setup.py b/code/nel/tools/build_gamedata/processes/ig/0_setup.py index 854777f6f..830a32e26 100755 --- a/code/nel/tools/build_gamedata/processes/ig/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/ig/0_setup.py @@ -8,7 +8,7 @@ # Setup ig # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/ig/1_export.py b/code/nel/tools/build_gamedata/processes/ig/1_export.py index 6a2958a12..e22e7ec82 100755 --- a/code/nel/tools/build_gamedata/processes/ig/1_export.py +++ b/code/nel/tools/build_gamedata/processes/ig/1_export.py @@ -8,7 +8,7 @@ # Export ig # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/ig/2_build.py b/code/nel/tools/build_gamedata/processes/ig/2_build.py index 50eb1dbfa..afb84c312 100755 --- a/code/nel/tools/build_gamedata/processes/ig/2_build.py +++ b/code/nel/tools/build_gamedata/processes/ig/2_build.py @@ -8,7 +8,7 @@ # Build ig # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/ig/3_install.py b/code/nel/tools/build_gamedata/processes/ig/3_install.py index de4ac592f..7ab5f182d 100755 --- a/code/nel/tools/build_gamedata/processes/ig/3_install.py +++ b/code/nel/tools/build_gamedata/processes/ig/3_install.py @@ -8,7 +8,7 @@ # Install ig # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/ig/maxscript/ig_export.ms b/code/nel/tools/build_gamedata/processes/ig/maxscript/ig_export.ms index 526d06dc8..e91732391 100755 --- a/code/nel/tools/build_gamedata/processes/ig/maxscript/ig_export.ms +++ b/code/nel/tools/build_gamedata/processes/ig/maxscript/ig_export.ms @@ -16,6 +16,16 @@ nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename +-- Unhide layers +fn unhidelayers = +( + for i = 0 to (LayerManager.count - 1) do + ( + layer = (LayerManager.getLayer i) + layer.ishidden = false + ) +) + -- Unhide category fn unhidecategory = ( @@ -120,6 +130,7 @@ fn runNelMaxExport inputMaxFile = tagThisFile = true -- Unhide category + unhidelayers() unhidecategory() -- Unhide @@ -127,6 +138,7 @@ fn runNelMaxExport inputMaxFile = -- unselect max select none + clearSelection() -- Exported object count exported = 0 @@ -175,6 +187,7 @@ fn runNelMaxExport inputMaxFile = ( -- Select none max select none + clearSelection() -- Select all node in this ig for node in geometry do diff --git a/code/nel/tools/build_gamedata/processes/ig_light/0_setup.py b/code/nel/tools/build_gamedata/processes/ig_light/0_setup.py index c03ddefad..82bda3129 100755 --- a/code/nel/tools/build_gamedata/processes/ig_light/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/ig_light/0_setup.py @@ -8,7 +8,7 @@ # Setup ig_light # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/ig_light/1_export.py b/code/nel/tools/build_gamedata/processes/ig_light/1_export.py index 8423c5738..4880b9d57 100755 --- a/code/nel/tools/build_gamedata/processes/ig_light/1_export.py +++ b/code/nel/tools/build_gamedata/processes/ig_light/1_export.py @@ -8,7 +8,7 @@ # Export ig_light # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/ig_light/2_build.py b/code/nel/tools/build_gamedata/processes/ig_light/2_build.py index cff5766ce..41ae92ff8 100755 --- a/code/nel/tools/build_gamedata/processes/ig_light/2_build.py +++ b/code/nel/tools/build_gamedata/processes/ig_light/2_build.py @@ -8,7 +8,7 @@ # Build ig_light # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/ig_light/3_install.py b/code/nel/tools/build_gamedata/processes/ig_light/3_install.py index 3a94640bf..332d02184 100755 --- a/code/nel/tools/build_gamedata/processes/ig_light/3_install.py +++ b/code/nel/tools/build_gamedata/processes/ig_light/3_install.py @@ -8,7 +8,7 @@ # Install ig_light # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/interface/0_setup.py b/code/nel/tools/build_gamedata/processes/interface/0_setup.py index 9b58eebb1..4a227d364 100755 --- a/code/nel/tools/build_gamedata/processes/interface/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/interface/0_setup.py @@ -8,7 +8,7 @@ # Setup interface # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/interface/1_export.py b/code/nel/tools/build_gamedata/processes/interface/1_export.py index d4146db80..b6c0f394c 100755 --- a/code/nel/tools/build_gamedata/processes/interface/1_export.py +++ b/code/nel/tools/build_gamedata/processes/interface/1_export.py @@ -8,7 +8,7 @@ # Export interface # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/interface/2_build.py b/code/nel/tools/build_gamedata/processes/interface/2_build.py index 0e1a0061f..4dfead25b 100755 --- a/code/nel/tools/build_gamedata/processes/interface/2_build.py +++ b/code/nel/tools/build_gamedata/processes/interface/2_build.py @@ -8,7 +8,7 @@ # Build interface # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/interface/3_install.py b/code/nel/tools/build_gamedata/processes/interface/3_install.py index a0800c522..d7f052561 100755 --- a/code/nel/tools/build_gamedata/processes/interface/3_install.py +++ b/code/nel/tools/build_gamedata/processes/interface/3_install.py @@ -8,7 +8,7 @@ # Install interface # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/ligo/0_setup.py b/code/nel/tools/build_gamedata/processes/ligo/0_setup.py index 3343e07ce..32a74bf63 100755 --- a/code/nel/tools/build_gamedata/processes/ligo/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/ligo/0_setup.py @@ -8,7 +8,7 @@ # Setup ligo # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/ligo/1_export.py b/code/nel/tools/build_gamedata/processes/ligo/1_export.py index 8204926ac..09be53494 100755 --- a/code/nel/tools/build_gamedata/processes/ligo/1_export.py +++ b/code/nel/tools/build_gamedata/processes/ligo/1_export.py @@ -8,7 +8,7 @@ # Export ligo # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -62,7 +62,7 @@ if LigoExportLand == "" or LigoExportOnePass == 1: mkPath(log, ExportBuildDirectory + "/" + LigoEcosystemCmbExportDirectory) mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory[0]) mkPath(log, ExportBuildDirectory + "/" + LigoEcosystemTagExportDirectory) - if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + LigoMaxSourceDirectory, ".max", ExportBuildDirectory + "/" + LigoEcosystemTagExportDirectory, ".max.tag")): + if (needUpdateDirByTagLogFiltered(log, DatabaseDirectory + "/" + LigoMaxSourceDirectory, ".max", ExportBuildDirectory + "/" + LigoEcosystemTagExportDirectory, ".max.tag", [ "zonematerial", "zonetransition", "zonespecial" ])): printLog(log, "WRITE " + ligoIniPath) ligoIni = open(ligoIniPath, "w") ligoIni.write("[LigoConfig]\n") diff --git a/code/nel/tools/build_gamedata/processes/ligo/2_build.py b/code/nel/tools/build_gamedata/processes/ligo/2_build.py index 9d51788bb..54f5d75e8 100755 --- a/code/nel/tools/build_gamedata/processes/ligo/2_build.py +++ b/code/nel/tools/build_gamedata/processes/ligo/2_build.py @@ -8,7 +8,7 @@ # Build ligo # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/ligo/3_install.py b/code/nel/tools/build_gamedata/processes/ligo/3_install.py index 5bf59b884..9d9e59b54 100755 --- a/code/nel/tools/build_gamedata/processes/ligo/3_install.py +++ b/code/nel/tools/build_gamedata/processes/ligo/3_install.py @@ -8,7 +8,7 @@ # Install ligo # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms b/code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms index 303b4917f..07d032809 100755 --- a/code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms +++ b/code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms @@ -17,6 +17,16 @@ NEL3D_APPDATA_IGNAME = 1423062564 -- string : name of the Instance Group tagThisFile = true +-- Unhide layers +fn unhidelayers = +( + for i = 0 to (LayerManager.count - 1) do + ( + layer = (LayerManager.getLayer i) + layer.ishidden = false + ) +) + -- Unhide category fn unhidecategory = ( @@ -228,11 +238,21 @@ fn exportCollisionsFromZone outputNelDir filename = ( -- Select all collision mesh max select none + clearSelection() for m in geometry do ( if (isToBeExportedCollision m) == true then selectmore m ) + for node in objects where classOf node == XRefObject do + ( + sourceObject = node.GetSourceObject false + if (superclassOf sourceObject == GeometryClass) then + ( + if (isToBeExportedCollision node) == true then + selectmore node + ) + ) -- Export the collision if (NelExportCollision ($selection as array) outputNelDir) == false then @@ -297,11 +317,16 @@ fn buildTransitionMatrixObj mt transitionZone cellSize = -- Export instance groups from the current loaded zone fn exportInstanceGroupFromZone inputFile outputPath igName transitionZone cellSize = ( + -- Unhide category + unhidelayers() + unhidecategory() + -- Unhide max unhide all -- unselect max select none + clearSelection() -- Exported object count exported = 0 @@ -311,10 +336,10 @@ fn exportInstanceGroupFromZone inputFile outputPath igName transitionZone cellSi -- Scan all the ig in this project nlerror("Scan all the ig in this project") - for node in geometry do + for node in objects do ( ig = getIg node - nlerror("geometry node") + nlerror("object node") if ( (ig != undefined) and (ig != "") and ( (igName == "") or (ig == igName) ) ) then ( nlerror("Found something with an IG name") @@ -347,71 +372,6 @@ fn exportInstanceGroupFromZone inputFile outputPath igName transitionZone cellSi ) ) - for node in lights do - ( - ig = getIg node - - if ( (ig != undefined) and (ig != "") and ( (igName == "") or ( ig == igName) ) ) then - ( - -- Transition ? - if ( ig == IgName) then - ( - -- Transform the object - node.transform = buildTransitionMatrixObj node.transform transitionZone cellSize - ) - - -- Found ? - found = false - - -- Already found ? - for j = 1 to ig_array.count do - ( - if (ig_array[j]==ig) then - ( - found = true - ) - ) - - -- Found ? - if (found == false) then - ( - append ig_array ig - ) - ) - ) - - for node in helpers do - ( - ig = getIg node - if ( (ig != undefined) and (ig != "") and ( (igName == "") or (ig == igName) ) ) then - ( - -- Transition ? - if (ig == IgName) then - ( - -- Transform the object - node.transform = buildTransitionMatrixObj node.transform transitionZone cellSize - ) - - -- Found ? - found = false - -- Already found ? - for j = 1 to ig_array.count do - ( - if (ig_array[j]==ig) then - ( - found = true - ) - ) - -- Found ? - if (found == false) then - ( - append ig_array ig - ) - ) - ) - - - -- Have some ig ? if (ig_array.count != 0) then ( @@ -428,7 +388,31 @@ fn exportInstanceGroupFromZone inputFile outputPath igName transitionZone cellSi ( -- Select none max select none + clearSelection() + for node in objects where classOf node == XRefObject do + ( + if ((getIg node) == ig_array[ig]) then + ( + sourceObject = node.GetSourceObject false + if (classOf sourceObject == XRefObject) then + ( + nlerror("FAIL XREF STILL XREF " + node.name) + ) + else if (superclassOf sourceObject == GeometryClass) then + ( + selectmore node + ) + else if (superclassOf sourceObject == Helper) then + ( + selectmore node + ) + else if (superclassOf sourceObject == Light) then + ( + selectmore node + ) + ) + ) -- Select all node in this ig for node in geometry do ( @@ -508,8 +492,8 @@ try for curFileName in MaxFilesList do ( -- Free memory and file handles - gc () - resetMAXFile #noprompt + -- gc () + -- resetMAXFile #noprompt tokenArray = filterString (getFilenameFile curFileName) "-" @@ -528,8 +512,10 @@ try nlerror ("Scanning file "+curFileName+" ...") mergeMaxFile curFileName quiet:true + objXRefMgr.UpdateAllRecords() -- Unhide category + unhidelayers() unhidecategory() DeleteDebugMarkersFn () @@ -622,6 +608,8 @@ try ) resetMAXFile #noprompt + gc () + resetMAXFile #noprompt ) else ( @@ -635,10 +623,10 @@ try for curFileName in MaxFilesList do ( -- Free memory and file handles - gc () + -- gc () -- Reset 3dsmax - resetMAXFile #noprompt + -- resetMAXFile #noprompt tokenArray = filterString (getFilenameFile curFileName) "-" if (tokenArray.count == 4) and (tokenArray[1] == "zonetransition") then @@ -672,8 +660,10 @@ try nlerror ("Scanning file "+curFileName+" ...") mergeMaxFile curFileName quiet:true + objXRefMgr.UpdateAllRecords() -- Unhide category + unhidelayers() unhidecategory() DeleteDebugMarkersFn () @@ -852,6 +842,8 @@ try ) resetMAXFile #noprompt + gc () + resetMAXFile #noprompt ) else ( @@ -865,8 +857,8 @@ try for curFileName in MaxFilesList do ( -- Free memory and file handles - gc () - resetMAXFile #noprompt + -- gc () + -- resetMAXFile #noprompt tokenArray = filterString (getFilenameFile curFileName) "-" if (tokenArray.count == 2) and (tokenArray[1] == "zonespecial") then @@ -884,8 +876,10 @@ try nlerror ("Scanning file "+curFileName+" ...") mergeMaxFile curFileName quiet:true + objXRefMgr.UpdateAllRecords() -- Unhide category + unhidelayers() unhidecategory() DeleteDebugMarkersFn () @@ -971,6 +965,8 @@ try ) resetMAXFile #noprompt + gc () + resetMAXFile #noprompt ) else ( diff --git a/code/nel/tools/build_gamedata/processes/map/0_setup.py b/code/nel/tools/build_gamedata/processes/map/0_setup.py index 10769e968..5cfc189d5 100755 --- a/code/nel/tools/build_gamedata/processes/map/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/map/0_setup.py @@ -8,7 +8,7 @@ # Setup map # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/map/1_export.py b/code/nel/tools/build_gamedata/processes/map/1_export.py index 3432eddd6..a77d32082 100755 --- a/code/nel/tools/build_gamedata/processes/map/1_export.py +++ b/code/nel/tools/build_gamedata/processes/map/1_export.py @@ -8,7 +8,7 @@ # Export map # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/map/2_build.py b/code/nel/tools/build_gamedata/processes/map/2_build.py index 91b7ffbb5..82a777410 100755 --- a/code/nel/tools/build_gamedata/processes/map/2_build.py +++ b/code/nel/tools/build_gamedata/processes/map/2_build.py @@ -8,7 +8,7 @@ # Build map # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/map/3_install.py b/code/nel/tools/build_gamedata/processes/map/3_install.py index 29a8cbd2f..a5a56bb94 100755 --- a/code/nel/tools/build_gamedata/processes/map/3_install.py +++ b/code/nel/tools/build_gamedata/processes/map/3_install.py @@ -8,7 +8,7 @@ # Install map # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/pacs_prim/0_setup.py b/code/nel/tools/build_gamedata/processes/pacs_prim/0_setup.py index 5692df9aa..e9bdb5918 100755 --- a/code/nel/tools/build_gamedata/processes/pacs_prim/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/pacs_prim/0_setup.py @@ -8,7 +8,7 @@ # Setup pacs_prim # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/pacs_prim/1_export.py b/code/nel/tools/build_gamedata/processes/pacs_prim/1_export.py index 511467d3c..cfb46635f 100755 --- a/code/nel/tools/build_gamedata/processes/pacs_prim/1_export.py +++ b/code/nel/tools/build_gamedata/processes/pacs_prim/1_export.py @@ -6,13 +6,13 @@ # # \file 1_export.py # \brief Export pacs_prim -# \date 2013-07-24-14-21-GMT +# \date 2015-01-06-16-31-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export pacs_prim # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -130,6 +130,13 @@ if MaxAvailable: +# Remove bad file from previous script version +listPath = ExportBuildDirectory + "/" + PacsPrimExportDirectory + "/landscape_col_prim_pacs_list.txt" +if os.path.isfile(listPath): + os.remove(listPath) + + + log.close() if os.path.isfile("log.log"): os.remove("log.log") diff --git a/code/nel/tools/build_gamedata/processes/pacs_prim/2_build.py b/code/nel/tools/build_gamedata/processes/pacs_prim/2_build.py index 455546657..d50aa6b8c 100755 --- a/code/nel/tools/build_gamedata/processes/pacs_prim/2_build.py +++ b/code/nel/tools/build_gamedata/processes/pacs_prim/2_build.py @@ -8,7 +8,7 @@ # Build pacs_prim # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/pacs_prim/3_install.py b/code/nel/tools/build_gamedata/processes/pacs_prim/3_install.py index a696f73ae..da932c469 100755 --- a/code/nel/tools/build_gamedata/processes/pacs_prim/3_install.py +++ b/code/nel/tools/build_gamedata/processes/pacs_prim/3_install.py @@ -8,7 +8,7 @@ # Install pacs_prim # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/pacs_prim/maxscript/pacs_prim_export.ms b/code/nel/tools/build_gamedata/processes/pacs_prim/maxscript/pacs_prim_export.ms index ddfc0014a..d0d7c7ce4 100755 --- a/code/nel/tools/build_gamedata/processes/pacs_prim/maxscript/pacs_prim_export.ms +++ b/code/nel/tools/build_gamedata/processes/pacs_prim/maxscript/pacs_prim_export.ms @@ -16,6 +16,16 @@ nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename +-- Unhide layers +fn unhidelayers = +( + for i = 0 to (LayerManager.count - 1) do + ( + layer = (LayerManager.getLayer i) + layer.ishidden = false + ) +) + -- Unhide category fn unhidecategory = ( @@ -76,6 +86,7 @@ fn runNelMaxExport inputMaxFile = -- Select none max select none + clearSelection() -- Select all PACS primitives for i in geometry do diff --git a/code/nel/tools/build_gamedata/processes/pacs_prim_list/0_setup.py b/code/nel/tools/build_gamedata/processes/pacs_prim_list/0_setup.py index c761b033c..6be8fbea3 100755 --- a/code/nel/tools/build_gamedata/processes/pacs_prim_list/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/pacs_prim_list/0_setup.py @@ -8,7 +8,7 @@ # Setup pacs_prim_list # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/pacs_prim_list/1_export.py b/code/nel/tools/build_gamedata/processes/pacs_prim_list/1_export.py index 0876366c2..3f250406b 100755 --- a/code/nel/tools/build_gamedata/processes/pacs_prim_list/1_export.py +++ b/code/nel/tools/build_gamedata/processes/pacs_prim_list/1_export.py @@ -8,7 +8,7 @@ # Export pacs_prim_list # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/pacs_prim_list/2_build.py b/code/nel/tools/build_gamedata/processes/pacs_prim_list/2_build.py index 169b8ee76..3c1f3cdbb 100755 --- a/code/nel/tools/build_gamedata/processes/pacs_prim_list/2_build.py +++ b/code/nel/tools/build_gamedata/processes/pacs_prim_list/2_build.py @@ -8,7 +8,7 @@ # Build pacs_prim_list # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/pacs_prim_list/3_install.py b/code/nel/tools/build_gamedata/processes/pacs_prim_list/3_install.py index 50d920fe1..73656122c 100755 --- a/code/nel/tools/build_gamedata/processes/pacs_prim_list/3_install.py +++ b/code/nel/tools/build_gamedata/processes/pacs_prim_list/3_install.py @@ -8,7 +8,7 @@ # Install pacs_prim_list # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/properties/0_setup.py b/code/nel/tools/build_gamedata/processes/properties/0_setup.py index 4118cfeb3..1a0889caf 100755 --- a/code/nel/tools/build_gamedata/processes/properties/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/properties/0_setup.py @@ -8,7 +8,7 @@ # Setup properties # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/properties/1_export.py b/code/nel/tools/build_gamedata/processes/properties/1_export.py index 1c91b20db..809dc440c 100755 --- a/code/nel/tools/build_gamedata/processes/properties/1_export.py +++ b/code/nel/tools/build_gamedata/processes/properties/1_export.py @@ -8,7 +8,7 @@ # Export properties # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/properties/2_build.py b/code/nel/tools/build_gamedata/processes/properties/2_build.py index beb9ef8d5..721d58174 100755 --- a/code/nel/tools/build_gamedata/processes/properties/2_build.py +++ b/code/nel/tools/build_gamedata/processes/properties/2_build.py @@ -8,7 +8,7 @@ # Build properties # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/properties/3_install.py b/code/nel/tools/build_gamedata/processes/properties/3_install.py index 5a0321140..79da071c0 100755 --- a/code/nel/tools/build_gamedata/processes/properties/3_install.py +++ b/code/nel/tools/build_gamedata/processes/properties/3_install.py @@ -8,7 +8,7 @@ # Install properties # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/ps/0_setup.py b/code/nel/tools/build_gamedata/processes/ps/0_setup.py index 673cfc976..c602cb8fe 100755 --- a/code/nel/tools/build_gamedata/processes/ps/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/ps/0_setup.py @@ -8,7 +8,7 @@ # Setup ps # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/ps/1_export.py b/code/nel/tools/build_gamedata/processes/ps/1_export.py index f1059f7d3..e30385335 100755 --- a/code/nel/tools/build_gamedata/processes/ps/1_export.py +++ b/code/nel/tools/build_gamedata/processes/ps/1_export.py @@ -8,7 +8,7 @@ # Export ps # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/ps/2_build.py b/code/nel/tools/build_gamedata/processes/ps/2_build.py index 205f7bc23..71c45e42b 100755 --- a/code/nel/tools/build_gamedata/processes/ps/2_build.py +++ b/code/nel/tools/build_gamedata/processes/ps/2_build.py @@ -8,7 +8,7 @@ # Build ps # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/ps/3_install.py b/code/nel/tools/build_gamedata/processes/ps/3_install.py index 28efa96b2..56713d999 100755 --- a/code/nel/tools/build_gamedata/processes/ps/3_install.py +++ b/code/nel/tools/build_gamedata/processes/ps/3_install.py @@ -8,7 +8,7 @@ # Install ps # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/pz/0_setup.py b/code/nel/tools/build_gamedata/processes/pz/0_setup.py new file mode 100644 index 000000000..e9f22be11 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/pz/0_setup.py @@ -0,0 +1,97 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup pz +# \date 2014-09-13 13:32GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup pz +# +# NeL - MMORPG Framework +# Copyright (C) 2014 Jan BOON +# +# 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 . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup pz") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + PackedZoneCacheBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + PackedZoneCWMapCacheBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + PackedZoneBuildDirectory) + +# Setup lookup directories +printLog(log, ">>> Setup lookup directories <<<") +mkPath(log, ExportBuildDirectory + "/" + AiWmapBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + ZoneLightBuildDirectory) +mkPath(log, LeveldesignDataCommonDirectory) + +# Setup client directories +printLog(log, ">>> Setup install directories <<<") +mkPath(log, InstallDirectory + "/" + PackedZoneInstallDirectory) + +# Setup client directories +printLog(log, ">>> Setup configuration <<<") +mkPath(log, ActiveProjectDirectory + "/generated") +cfg = open(ActiveProjectDirectory + "/generated/build_world_packed_col.cfg", "w") +cfg.write("\n") +cfg.write("// BUILD WORLD PACKED COL CONFIGURATION\n") +cfg.write("\n") +cfg.write("SearchPaths = {\n") +cfg.write("\t\"" + ExportBuildDirectory + "/" + AiWmapBuildDirectory + "\", \n") +cfg.write("\t\"" + ExportBuildDirectory + "/" + ZoneLightBuildDirectory + "\", \n") +cfg.write("\t\"" + LeveldesignDataCommonDirectory + "\", \n") +cfg.write("};\n") +cfg.write("\n") +cfg.write("CachePath = \"" + ExportBuildDirectory + "/" + PackedZoneCacheBuildDirectory + "\";\n") +cfg.write("CWMapCachePath = \"" + ExportBuildDirectory + "/" + PackedZoneCWMapCacheBuildDirectory + "\";\n") +cfg.write("OutputPath = \"" + ExportBuildDirectory + "/" + PackedZoneBuildDirectory + "\";\n") +cfg.write("\n") +cfg.write("EntryPointsFile = \"r2_islands.xml\";\n") +cfg.write("\n") +cfg.write("CWMapList = {\n") +cfg.write("\t\"" + PackedZoneCWMap + "\", \n") +cfg.write("};\n") +cfg.write("\n") +cfg.write("Fly = 0;\n") +cfg.write("\n") +cfg.write("HeightMapsAsTga = 1;\n") +cfg.write("PixelPerMeter = 1;\n") +cfg.write("\n") +cfg.write("RefineThreshold = 32;\n") +cfg.write("\n") +cfg.close() + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/pz/1_export.py b/code/nel/tools/build_gamedata/processes/pz/1_export.py new file mode 100644 index 000000000..ff8daf747 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/pz/1_export.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export pz +# \date 2014-09-13 13:32GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export pz +# +# NeL - MMORPG Framework +# Copyright (C) 2014 Jan BOON +# +# 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 . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export pz") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/pz/2_build.py b/code/nel/tools/build_gamedata/processes/pz/2_build.py new file mode 100644 index 000000000..b632412b0 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/pz/2_build.py @@ -0,0 +1,62 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build pz +# \date 2014-09-13 13:32GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build pz +# +# NeL - MMORPG Framework +# Copyright (C) 2014 Jan BOON +# +# 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 . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build pz") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +BuildWorldPackedCol = findTool(log, ToolDirectories, BuildWorldPackedColTool, ToolSuffix) + +if BuildWorldPackedCol == "": + toolLogFail(log, BuildWorldPackedColTool, ToolSuffix) +else: + printLog(log, ">>> Copy ai_build_wmap.cfg <<<") + cfgPath = ActiveProjectDirectory + "/generated/build_world_packed_col.cfg" + shutil.copy(cfgPath, "build_world_packed_col.cfg") + printLog(log, ">>> Build pz <<<") + subprocess.call([ BuildWorldPackedCol, "build_world_packed_col.cfg" ]) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/pz/3_install.py b/code/nel/tools/build_gamedata/processes/pz/3_install.py new file mode 100644 index 000000000..c4feedef1 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/pz/3_install.py @@ -0,0 +1,58 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install pz +# \date 2014-09-13 13:32GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install pz +# +# NeL - MMORPG Framework +# Copyright (C) 2014 Jan BOON +# +# 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 . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install pz") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +installPath = InstallDirectory + "/" + PackedZoneInstallDirectory +mkPath(log, installPath) + +printLog(log, ">>> Install pz <<<") +mkPath(log, ExportBuildDirectory + "/" + PackedZoneBuildDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + PackedZoneBuildDirectory, installPath, ".island_hm") +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + PackedZoneBuildDirectory, installPath, ".packed_island") + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/rbank/0_setup.py b/code/nel/tools/build_gamedata/processes/rbank/0_setup.py index 4c11c57b1..94bdb1151 100755 --- a/code/nel/tools/build_gamedata/processes/rbank/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/rbank/0_setup.py @@ -8,7 +8,7 @@ # Setup rbank # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/rbank/1_export.py b/code/nel/tools/build_gamedata/processes/rbank/1_export.py index ea078d41d..65c14c907 100755 --- a/code/nel/tools/build_gamedata/processes/rbank/1_export.py +++ b/code/nel/tools/build_gamedata/processes/rbank/1_export.py @@ -6,13 +6,13 @@ # # \file 1_export.py # \brief Export rbank -# \date 2011-09-21-20-51-GMT +# \date 2015-01-06-16-31-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export rbank # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/rbank/2_build.py b/code/nel/tools/build_gamedata/processes/rbank/2_build.py index 0da42fed5..b38aea94b 100755 --- a/code/nel/tools/build_gamedata/processes/rbank/2_build.py +++ b/code/nel/tools/build_gamedata/processes/rbank/2_build.py @@ -8,7 +8,7 @@ # Build rbank # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/rbank/3_install.py b/code/nel/tools/build_gamedata/processes/rbank/3_install.py index 8a548d7c3..c806c79f9 100755 --- a/code/nel/tools/build_gamedata/processes/rbank/3_install.py +++ b/code/nel/tools/build_gamedata/processes/rbank/3_install.py @@ -8,7 +8,7 @@ # Install rbank # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/rbank/maxscript/cmb_export.ms b/code/nel/tools/build_gamedata/processes/rbank/maxscript/cmb_export.ms index 74cf3a8dd..4949f7c60 100755 --- a/code/nel/tools/build_gamedata/processes/rbank/maxscript/cmb_export.ms +++ b/code/nel/tools/build_gamedata/processes/rbank/maxscript/cmb_export.ms @@ -16,6 +16,16 @@ nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename +-- Unhide layers +fn unhidelayers = +( + for i = 0 to (LayerManager.count - 1) do + ( + layer = (LayerManager.getLayer i) + layer.ishidden = false + ) +) + -- Unhide category fn unhidecategory = ( @@ -102,6 +112,7 @@ fn runNelMaxExport inputMaxFile = -- Select all collision mesh max select none + clearSelection() for m in geometry do ( if (isToBeExported m) == true then diff --git a/code/nel/tools/build_gamedata/processes/shape/0_setup.py b/code/nel/tools/build_gamedata/processes/shape/0_setup.py index 71dfd097e..25eabed9e 100755 --- a/code/nel/tools/build_gamedata/processes/shape/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/shape/0_setup.py @@ -8,7 +8,7 @@ # Setup shape # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -69,6 +69,7 @@ if BuildShadowSkinEnabled: printLog(log, ">>> Setup build directories <<<") mkPath(log, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory) mkPath(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + ShapeOptimizedBuildDirectory) mkPath(log, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory) mkPath(log, ExportBuildDirectory + "/" + ShapeLightmap16BitsBuildDirectory) diff --git a/code/nel/tools/build_gamedata/processes/shape/1_export.py b/code/nel/tools/build_gamedata/processes/shape/1_export.py index 92bb9c3e9..f30338264 100755 --- a/code/nel/tools/build_gamedata/processes/shape/1_export.py +++ b/code/nel/tools/build_gamedata/processes/shape/1_export.py @@ -8,7 +8,7 @@ # Export shape # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/shape/2_build.py b/code/nel/tools/build_gamedata/processes/shape/2_build.py index 48a658378..f261473fe 100755 --- a/code/nel/tools/build_gamedata/processes/shape/2_build.py +++ b/code/nel/tools/build_gamedata/processes/shape/2_build.py @@ -8,7 +8,7 @@ # Build shape # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -77,16 +77,19 @@ else: # copy lightmap_not_optimized to lightmap printLog(log, ">>> Optimize lightmaps <<<") loPathLightmapsOriginal = ExportBuildDirectory + "/" + ShapeLightmapNotOptimizedExportDirectory +loPathShapesOriginal = ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory mkPath(log, loPathLightmapsOriginal) loPathLightmaps = ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory -loPathShapes = ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory +loPathShapes = ExportBuildDirectory + "/" + ShapeOptimizedBuildDirectory loPathTags = ExportBuildDirectory + "/" + ShapeTagExportDirectory mkPath(log, loPathLightmaps) mkPath(log, loPathShapes) mkPath(log, loPathTags) -if needUpdateDirByTagLog(log, loPathLightmapsOriginal, ".txt", loPathLightmaps, ".txt") or needUpdateDirNoSubdir(log, loPathLightmapsOriginal, loPathLightmaps) or needUpdateDirNoSubdir(log, loPathShapes, loPathLightmaps) or needUpdateDirNoSubdir(log, loPathTags, loPathLightmaps): +if needUpdateDirByTagLog(log, loPathLightmapsOriginal, ".txt", loPathLightmaps, ".txt") or needUpdateDirNoSubdir(log, loPathLightmapsOriginal, loPathLightmaps) or needUpdateDirNoSubdir(log, loPathShapesOriginal, loPathShapes) or needUpdateDirNoSubdir(log, loPathShapes, loPathLightmaps) or needUpdateDirNoSubdir(log, loPathTags, loPathLightmaps): removeFilesRecursive(log, loPathLightmaps) copyFiles(log, loPathLightmapsOriginal, loPathLightmaps) + removeFilesRecursive(log, loPathShapes) + copyFiles(log, loPathShapesOriginal, loPathShapes) # Optimize lightmaps if any. Additionnaly, output a file indicating which lightmaps are 8 bits # lightmap_optimizer [path_tags] [path_flag8bit] subprocess.call([ LightmapOptimizer, loPathLightmaps, loPathShapes, loPathTags, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory + "/list_lm_8bit.txt" ]) diff --git a/code/nel/tools/build_gamedata/processes/shape/3_install.py b/code/nel/tools/build_gamedata/processes/shape/3_install.py index cb93a443b..d96770c28 100755 --- a/code/nel/tools/build_gamedata/processes/shape/3_install.py +++ b/code/nel/tools/build_gamedata/processes/shape/3_install.py @@ -8,7 +8,7 @@ # Install shape # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -46,8 +46,8 @@ printLog(log, "") printLog(log, ">>> Install shape <<<") installPath = InstallDirectory + "/" + ShapeInstallDirectory mkPath(log, installPath) -mkPath(log, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory) -copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory, installPath, ".shape") +mkPath(log, ExportBuildDirectory + "/" + ShapeOptimizedBuildDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeOptimizedBuildDirectory, installPath, ".shape") mkPath(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory) copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory, installPath, ".shape") copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory, installPath, ".dds") diff --git a/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms b/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms index e979f6b0d..f97419aa7 100755 --- a/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms +++ b/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms @@ -16,6 +16,16 @@ nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename +-- Unhide layers +fn unhidelayers = +( + for i = 0 to (LayerManager.count - 1) do + ( + layer = (LayerManager.getLayer i) + layer.ishidden = false + ) +) + -- Unhide category fn unhidecategory = ( @@ -253,11 +263,14 @@ fn haveCoarseMesh node = return false ) +fn getRoot node = if isvalidnode node.parent then getRoot node.parent else node + fn runNelMaxExportSub inputMaxFile retryCount = ( tagThisFile = false -- Unhide category + unhidelayers() unhidecategory() -- Unhide @@ -265,6 +278,7 @@ fn runNelMaxExportSub inputMaxFile retryCount = -- unselect max select none + clearSelection() -- Exported object count exported = 0 @@ -338,55 +352,51 @@ fn runNelMaxExportSub inputMaxFile retryCount = -- For each node for node in array_node do ( - -- It is root ? - if (node.parent == undefined) then + -- Is not a skeleton ? + if (((substring node.name 1 3) != "Bip") and ((substring (getRoot node).name 1 3) != "Bip")) then ( - -- Is not a skeleton ? - if (node.name != "Bip01") then + -- Can be exported ? + if (isToBeExported node == true) then ( - -- Can be exported ? - if (isToBeExported node == true) then + -- Not a lod ? + if ((isLod node) == false) then ( - -- Not a lod ? - if ((isLod node) == false) then + -- Output directory + if (haveCoarseMesh node) == true then + output = ("%OutputDirectoryWithCoarseMesh%/" + (node.name) + ".shape") + else + output = ("%OutputDirectoryWithoutCoarseMesh%/" + (node.name) + ".shape") + + -- Compare file date + if (NeLTestFileDate output inputMaxFile) == true then ( - -- Output directory - if (haveCoarseMesh node) == true then - output = ("%OutputDirectoryWithCoarseMesh%/" + (node.name) + ".shape") - else - output = ("%OutputDirectoryWithoutCoarseMesh%/" + (node.name) + ".shape") - - -- Compare file date - if (NeLTestFileDate output inputMaxFile) == true then + try ( - try + -- Export the shape + if (NelExportShapeEx node output %ShapeExportOptShadow% %ShapeExportOptExportLighting% "%OutputDirectoryLightmap%" %ShapeExportOptLightingLimit% %ShapeExportOptLumelSize% %ShapeExportOptOversampling% true false %ShapeExportOptLightmapLog%) == true then ( - -- Export the shape - if (NelExportShapeEx node output %ShapeExportOptShadow% %ShapeExportOptExportLighting% "%OutputDirectoryLightmap%" %ShapeExportOptLightingLimit% %ShapeExportOptLumelSize% %ShapeExportOptOversampling% true false %ShapeExportOptLightmapLog%) == true then - ( - nlerror("OK "+output) - exported = exported +1 - ) - else - ( - -- Error - nlerror("ERROR exporting shape " + node.name + " in file " + inputMaxFile) - tagThisFile = false - ) + nlerror("OK "+output) + exported = exported +1 ) - catch + else ( -- Error - nlerror("ERROR fatal error exporting shape " + node.name + " in file " + inputMaxFile) + nlerror("ERROR exporting shape " + node.name + " in file " + inputMaxFile) tagThisFile = false ) ) - else + catch ( - nlerror("SKIPPED " + output) - exported = exported + 1 + -- Error + nlerror("ERROR fatal error exporting shape " + node.name + " in file " + inputMaxFile) + tagThisFile = false ) ) + else + ( + nlerror("SKIPPED " + output) + exported = exported + 1 + ) ) ) ) diff --git a/code/nel/tools/build_gamedata/processes/sheet_id/0_setup.py b/code/nel/tools/build_gamedata/processes/sheet_id/0_setup.py index 521913fbf..94fd8210f 100755 --- a/code/nel/tools/build_gamedata/processes/sheet_id/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/sheet_id/0_setup.py @@ -8,7 +8,7 @@ # Setup sheet_id # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/sheet_id/1_export.py b/code/nel/tools/build_gamedata/processes/sheet_id/1_export.py index 4894babf1..29387c55f 100755 --- a/code/nel/tools/build_gamedata/processes/sheet_id/1_export.py +++ b/code/nel/tools/build_gamedata/processes/sheet_id/1_export.py @@ -8,7 +8,7 @@ # Export sheet_id # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/sheet_id/2_build.py b/code/nel/tools/build_gamedata/processes/sheet_id/2_build.py index b29914913..51fdefc0f 100755 --- a/code/nel/tools/build_gamedata/processes/sheet_id/2_build.py +++ b/code/nel/tools/build_gamedata/processes/sheet_id/2_build.py @@ -8,7 +8,7 @@ # Build sheet_id # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/sheet_id/3_install.py b/code/nel/tools/build_gamedata/processes/sheet_id/3_install.py index 914b9863c..9f27b0dae 100755 --- a/code/nel/tools/build_gamedata/processes/sheet_id/3_install.py +++ b/code/nel/tools/build_gamedata/processes/sheet_id/3_install.py @@ -8,7 +8,7 @@ # Install sheet_id # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/sheets/0_setup.py b/code/nel/tools/build_gamedata/processes/sheets/0_setup.py index 7dc36ab9d..0ad1a3655 100755 --- a/code/nel/tools/build_gamedata/processes/sheets/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/sheets/0_setup.py @@ -8,7 +8,7 @@ # Setup sheets # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/sheets/1_export.py b/code/nel/tools/build_gamedata/processes/sheets/1_export.py index ca94394c9..1a8cc51af 100755 --- a/code/nel/tools/build_gamedata/processes/sheets/1_export.py +++ b/code/nel/tools/build_gamedata/processes/sheets/1_export.py @@ -8,7 +8,7 @@ # Export sheets # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/sheets/2_build.py b/code/nel/tools/build_gamedata/processes/sheets/2_build.py index d9690f52a..ea8f899d2 100755 --- a/code/nel/tools/build_gamedata/processes/sheets/2_build.py +++ b/code/nel/tools/build_gamedata/processes/sheets/2_build.py @@ -8,7 +8,7 @@ # Build sheets # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/sheets/3_install.py b/code/nel/tools/build_gamedata/processes/sheets/3_install.py index 23f17a6dc..ed6efaffd 100755 --- a/code/nel/tools/build_gamedata/processes/sheets/3_install.py +++ b/code/nel/tools/build_gamedata/processes/sheets/3_install.py @@ -8,7 +8,7 @@ # Install sheets # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/skel/0_setup.py b/code/nel/tools/build_gamedata/processes/skel/0_setup.py index ed4471d9b..7394babdd 100755 --- a/code/nel/tools/build_gamedata/processes/skel/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/skel/0_setup.py @@ -8,7 +8,7 @@ # Setup skel # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/skel/1_export.py b/code/nel/tools/build_gamedata/processes/skel/1_export.py index b0c54cb23..dcf336dbd 100755 --- a/code/nel/tools/build_gamedata/processes/skel/1_export.py +++ b/code/nel/tools/build_gamedata/processes/skel/1_export.py @@ -6,13 +6,13 @@ # # \file 1_export.py # \brief Export skel -# \date 2011-09-28-07-42-GMT +# \date 2015-01-06-16-31-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export skel # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/skel/2_build.py b/code/nel/tools/build_gamedata/processes/skel/2_build.py index 090b1a774..86bfce1c8 100755 --- a/code/nel/tools/build_gamedata/processes/skel/2_build.py +++ b/code/nel/tools/build_gamedata/processes/skel/2_build.py @@ -8,7 +8,7 @@ # Build skel # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/skel/3_install.py b/code/nel/tools/build_gamedata/processes/skel/3_install.py index fd5bb9aa0..f70a0258f 100755 --- a/code/nel/tools/build_gamedata/processes/skel/3_install.py +++ b/code/nel/tools/build_gamedata/processes/skel/3_install.py @@ -8,7 +8,7 @@ # Install skel # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/skel/maxscript/skel_export.ms b/code/nel/tools/build_gamedata/processes/skel/maxscript/skel_export.ms index 7fd2af0fb..74440350b 100755 --- a/code/nel/tools/build_gamedata/processes/skel/maxscript/skel_export.ms +++ b/code/nel/tools/build_gamedata/processes/skel/maxscript/skel_export.ms @@ -13,6 +13,16 @@ nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename +-- Unhide layers +fn unhidelayers = +( + for i = 0 to (LayerManager.count - 1) do + ( + layer = (LayerManager.getLayer i) + layer.ishidden = false + ) +) + -- Unhide category fn unhidecategory = ( diff --git a/code/nel/tools/build_gamedata/processes/smallbank/0_setup.py b/code/nel/tools/build_gamedata/processes/smallbank/0_setup.py index 8f7955d42..751077ba3 100755 --- a/code/nel/tools/build_gamedata/processes/smallbank/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/smallbank/0_setup.py @@ -8,7 +8,7 @@ # Setup smallbank # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/smallbank/1_export.py b/code/nel/tools/build_gamedata/processes/smallbank/1_export.py index 82c998eb9..b7d3c6c24 100755 --- a/code/nel/tools/build_gamedata/processes/smallbank/1_export.py +++ b/code/nel/tools/build_gamedata/processes/smallbank/1_export.py @@ -8,7 +8,7 @@ # Export smallbank # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/smallbank/2_build.py b/code/nel/tools/build_gamedata/processes/smallbank/2_build.py index ccebd0f3c..a13d1e843 100755 --- a/code/nel/tools/build_gamedata/processes/smallbank/2_build.py +++ b/code/nel/tools/build_gamedata/processes/smallbank/2_build.py @@ -8,7 +8,7 @@ # Build smallbank # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/smallbank/3_install.py b/code/nel/tools/build_gamedata/processes/smallbank/3_install.py index dd71d226e..310cdaa52 100755 --- a/code/nel/tools/build_gamedata/processes/smallbank/3_install.py +++ b/code/nel/tools/build_gamedata/processes/smallbank/3_install.py @@ -8,7 +8,7 @@ # Install smallbank # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/sound/0_setup.py b/code/nel/tools/build_gamedata/processes/sound/0_setup.py index d668b06b6..178a810ae 100755 --- a/code/nel/tools/build_gamedata/processes/sound/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/sound/0_setup.py @@ -8,7 +8,7 @@ # Setup sound # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/sound/1_export.py b/code/nel/tools/build_gamedata/processes/sound/1_export.py index 3d7e17276..4fd98abb4 100755 --- a/code/nel/tools/build_gamedata/processes/sound/1_export.py +++ b/code/nel/tools/build_gamedata/processes/sound/1_export.py @@ -8,7 +8,7 @@ # Export sound # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/sound/2_build.py b/code/nel/tools/build_gamedata/processes/sound/2_build.py index 02e28e42c..56abeedd7 100755 --- a/code/nel/tools/build_gamedata/processes/sound/2_build.py +++ b/code/nel/tools/build_gamedata/processes/sound/2_build.py @@ -8,7 +8,7 @@ # Build sound # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/sound/3_install.py b/code/nel/tools/build_gamedata/processes/sound/3_install.py index e27f02a62..dc32c30e1 100755 --- a/code/nel/tools/build_gamedata/processes/sound/3_install.py +++ b/code/nel/tools/build_gamedata/processes/sound/3_install.py @@ -8,7 +8,7 @@ # Install sound # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/swt/0_setup.py b/code/nel/tools/build_gamedata/processes/swt/0_setup.py index 90a96010c..4b947f496 100755 --- a/code/nel/tools/build_gamedata/processes/swt/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/swt/0_setup.py @@ -8,7 +8,7 @@ # Setup swt # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/swt/1_export.py b/code/nel/tools/build_gamedata/processes/swt/1_export.py index 9b1913f36..820950fe5 100755 --- a/code/nel/tools/build_gamedata/processes/swt/1_export.py +++ b/code/nel/tools/build_gamedata/processes/swt/1_export.py @@ -6,13 +6,13 @@ # # \file 1_export.py # \brief Export swt -# \date 2011-09-28-07-42-GMT +# \date 2015-01-06-16-31-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export swt # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/swt/2_build.py b/code/nel/tools/build_gamedata/processes/swt/2_build.py index 8359dea29..7ae606a0a 100755 --- a/code/nel/tools/build_gamedata/processes/swt/2_build.py +++ b/code/nel/tools/build_gamedata/processes/swt/2_build.py @@ -8,7 +8,7 @@ # Build swt # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/swt/3_install.py b/code/nel/tools/build_gamedata/processes/swt/3_install.py index b71ed0caa..b70e623f5 100755 --- a/code/nel/tools/build_gamedata/processes/swt/3_install.py +++ b/code/nel/tools/build_gamedata/processes/swt/3_install.py @@ -8,7 +8,7 @@ # Install swt # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/swt/maxscript/swt_export.ms b/code/nel/tools/build_gamedata/processes/swt/maxscript/swt_export.ms index ea6ff95c3..99d684ea3 100755 --- a/code/nel/tools/build_gamedata/processes/swt/maxscript/swt_export.ms +++ b/code/nel/tools/build_gamedata/processes/swt/maxscript/swt_export.ms @@ -13,6 +13,16 @@ nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename +-- Unhide layers +fn unhidelayers = +( + for i = 0 to (LayerManager.count - 1) do + ( + layer = (LayerManager.getLayer i) + layer.ishidden = false + ) +) + -- Unhide category fn unhidecategory = ( diff --git a/code/nel/tools/build_gamedata/processes/tiles/0_setup.py b/code/nel/tools/build_gamedata/processes/tiles/0_setup.py index 30ddf8d28..e7a093723 100755 --- a/code/nel/tools/build_gamedata/processes/tiles/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/tiles/0_setup.py @@ -8,7 +8,7 @@ # Setup tiles # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/tiles/1_export.py b/code/nel/tools/build_gamedata/processes/tiles/1_export.py index 823935c18..9459b81b2 100755 --- a/code/nel/tools/build_gamedata/processes/tiles/1_export.py +++ b/code/nel/tools/build_gamedata/processes/tiles/1_export.py @@ -8,7 +8,7 @@ # Export tiles # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/tiles/2_build.py b/code/nel/tools/build_gamedata/processes/tiles/2_build.py index 9af276464..af1349ccf 100755 --- a/code/nel/tools/build_gamedata/processes/tiles/2_build.py +++ b/code/nel/tools/build_gamedata/processes/tiles/2_build.py @@ -8,7 +8,7 @@ # Build tiles # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/tiles/3_install.py b/code/nel/tools/build_gamedata/processes/tiles/3_install.py index 402fbcdba..a9a31187e 100755 --- a/code/nel/tools/build_gamedata/processes/tiles/3_install.py +++ b/code/nel/tools/build_gamedata/processes/tiles/3_install.py @@ -8,7 +8,7 @@ # Install tiles # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/veget/0_setup.py b/code/nel/tools/build_gamedata/processes/veget/0_setup.py index 7a890560c..222bc39bb 100755 --- a/code/nel/tools/build_gamedata/processes/veget/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/veget/0_setup.py @@ -8,7 +8,7 @@ # Setup veget # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/veget/1_export.py b/code/nel/tools/build_gamedata/processes/veget/1_export.py index 04d3dc06b..ae8b835a3 100755 --- a/code/nel/tools/build_gamedata/processes/veget/1_export.py +++ b/code/nel/tools/build_gamedata/processes/veget/1_export.py @@ -6,13 +6,13 @@ # # \file 1_export.py # \brief Export veget -# \date 2011-09-21-20-51-GMT +# \date 2015-01-06-16-31-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export veget # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/veget/2_build.py b/code/nel/tools/build_gamedata/processes/veget/2_build.py index 7fb69e665..e3358fd39 100755 --- a/code/nel/tools/build_gamedata/processes/veget/2_build.py +++ b/code/nel/tools/build_gamedata/processes/veget/2_build.py @@ -8,7 +8,7 @@ # Build veget # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/veget/3_install.py b/code/nel/tools/build_gamedata/processes/veget/3_install.py index 14b8b33bd..5801e6392 100755 --- a/code/nel/tools/build_gamedata/processes/veget/3_install.py +++ b/code/nel/tools/build_gamedata/processes/veget/3_install.py @@ -8,7 +8,7 @@ # Install veget # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/veget/maxscript/veget_export.ms b/code/nel/tools/build_gamedata/processes/veget/maxscript/veget_export.ms index 828a78d42..1b8154530 100755 --- a/code/nel/tools/build_gamedata/processes/veget/maxscript/veget_export.ms +++ b/code/nel/tools/build_gamedata/processes/veget/maxscript/veget_export.ms @@ -16,6 +16,16 @@ nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename +-- Unhide layers +fn unhidelayers = +( + for i = 0 to (LayerManager.count - 1) do + ( + layer = (LayerManager.getLayer i) + layer.ishidden = false + ) +) + -- Unhide category fn unhidecategory = ( @@ -105,6 +115,7 @@ fn runNelMaxExport inputMaxFile = tagThisFile = true -- Unhide category + unhidelayers() unhidecategory() -- Unhide @@ -112,6 +123,7 @@ fn runNelMaxExport inputMaxFile = -- unselect max select none + clearSelection() -- Exported object count exported = 0 diff --git a/code/nel/tools/build_gamedata/processes/vegetset/0_setup.py b/code/nel/tools/build_gamedata/processes/vegetset/0_setup.py index 2a9364fd8..c46c11b66 100755 --- a/code/nel/tools/build_gamedata/processes/vegetset/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/vegetset/0_setup.py @@ -8,7 +8,7 @@ # Setup vegetset # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/vegetset/1_export.py b/code/nel/tools/build_gamedata/processes/vegetset/1_export.py index 5bd7c62fa..03d70f59d 100755 --- a/code/nel/tools/build_gamedata/processes/vegetset/1_export.py +++ b/code/nel/tools/build_gamedata/processes/vegetset/1_export.py @@ -8,7 +8,7 @@ # Export vegetset # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/vegetset/2_build.py b/code/nel/tools/build_gamedata/processes/vegetset/2_build.py index f46ba5f65..0aab2ecee 100755 --- a/code/nel/tools/build_gamedata/processes/vegetset/2_build.py +++ b/code/nel/tools/build_gamedata/processes/vegetset/2_build.py @@ -8,7 +8,7 @@ # Build vegetset # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/vegetset/3_install.py b/code/nel/tools/build_gamedata/processes/vegetset/3_install.py index 107d0e516..25ebd7677 100755 --- a/code/nel/tools/build_gamedata/processes/vegetset/3_install.py +++ b/code/nel/tools/build_gamedata/processes/vegetset/3_install.py @@ -8,7 +8,7 @@ # Install vegetset # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/zone/0_setup.py b/code/nel/tools/build_gamedata/processes/zone/0_setup.py index 7ecfe614c..ab85cb515 100755 --- a/code/nel/tools/build_gamedata/processes/zone/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/zone/0_setup.py @@ -8,7 +8,7 @@ # Setup zone # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/zone/1_export.py b/code/nel/tools/build_gamedata/processes/zone/1_export.py index 2897ccc0e..acffe9abb 100755 --- a/code/nel/tools/build_gamedata/processes/zone/1_export.py +++ b/code/nel/tools/build_gamedata/processes/zone/1_export.py @@ -6,13 +6,13 @@ # # \file 1_export.py # \brief Export zone -# \date 2011-09-28-07-42-GMT +# \date 2015-01-06-16-31-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export zone # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/zone/2_build.py b/code/nel/tools/build_gamedata/processes/zone/2_build.py index 31ad7d6e0..ad2f052fd 100755 --- a/code/nel/tools/build_gamedata/processes/zone/2_build.py +++ b/code/nel/tools/build_gamedata/processes/zone/2_build.py @@ -8,7 +8,7 @@ # Build zone # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/zone/3_install.py b/code/nel/tools/build_gamedata/processes/zone/3_install.py index 6afba7955..0326abf75 100755 --- a/code/nel/tools/build_gamedata/processes/zone/3_install.py +++ b/code/nel/tools/build_gamedata/processes/zone/3_install.py @@ -8,7 +8,7 @@ # Install zone # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/zone/maxscript/zone_export.ms b/code/nel/tools/build_gamedata/processes/zone/maxscript/zone_export.ms index 71f63e45b..6c4e0c8a0 100755 --- a/code/nel/tools/build_gamedata/processes/zone/maxscript/zone_export.ms +++ b/code/nel/tools/build_gamedata/processes/zone/maxscript/zone_export.ms @@ -13,6 +13,16 @@ nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename +-- Unhide layers +fn unhidelayers = +( + for i = 0 to (LayerManager.count - 1) do + ( + layer = (LayerManager.getLayer i) + layer.ishidden = false + ) +) + -- Unhide category fn unhidecategory = ( @@ -103,6 +113,7 @@ fn runNelMaxExport inputMaxFile = -- Select none max select none + clearSelection() -- Found it ? find = false diff --git a/code/nel/tools/build_gamedata/processes/zone_light/0_setup.py b/code/nel/tools/build_gamedata/processes/zone_light/0_setup.py index 58beff27d..44c67935d 100755 --- a/code/nel/tools/build_gamedata/processes/zone_light/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/zone_light/0_setup.py @@ -8,7 +8,7 @@ # Setup zone_light # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/zone_light/1_export.py b/code/nel/tools/build_gamedata/processes/zone_light/1_export.py index cede7d658..016fe826b 100755 --- a/code/nel/tools/build_gamedata/processes/zone_light/1_export.py +++ b/code/nel/tools/build_gamedata/processes/zone_light/1_export.py @@ -8,7 +8,7 @@ # Export zone_light # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -55,6 +55,7 @@ for dir in WaterMapSourceDirectories: destDir = DatabaseDirectory + "/" + dir mkPath(log, destDir) copyFilesExtNoTreeIfNeeded(log, srcDir, destDir, ".tga") + copyFilesExtNoTreeIfNeeded(log, srcDir, destDir, ".png") printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/zone_light/2_build.py b/code/nel/tools/build_gamedata/processes/zone_light/2_build.py index 8de63f4d8..84d2b26a4 100755 --- a/code/nel/tools/build_gamedata/processes/zone_light/2_build.py +++ b/code/nel/tools/build_gamedata/processes/zone_light/2_build.py @@ -8,7 +8,7 @@ # Build zone_light # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/processes/zone_light/3_install.py b/code/nel/tools/build_gamedata/processes/zone_light/3_install.py index 6b1b14c63..4e4d231a4 100755 --- a/code/nel/tools/build_gamedata/processes/zone_light/3_install.py +++ b/code/nel/tools/build_gamedata/processes/zone_light/3_install.py @@ -8,7 +8,7 @@ # Install zone_light # # NeL - MMORPG Framework -# Copyright (C) 2010 Winch Gate Property Limited +# Copyright (C) 2009-2014 by authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/code/nel/tools/build_gamedata/sky_dev.bat b/code/nel/tools/build_gamedata/sky_dev.bat new file mode 100644 index 000000000..ac80d591e --- /dev/null +++ b/code/nel/tools/build_gamedata/sky_dev.bat @@ -0,0 +1,11 @@ +title Ryzom Core: 1_export.py (LEVELDESIGN) +1_export.py -ipj common/sky common/sfx common/gamedev common/data_common common/data_shard common/leveldesign common/exedll common/cfg shard/data_shard shard/data_language shard/data_leveldesign shard/data_game_share +title Ryzom Core: 2_build.py (LEVELDESIGN) +2_build.py -ipj common/sky common/sfx common/gamedev common/data_common common/data_shard common/leveldesign common/exedll common/cfg shard/data_shard shard/data_language shard/data_leveldesign shard/data_game_share +title Ryzom Core: 3_install.py (LEVELDESIGN) +3_install.py -ipj common/sky common/sfx common/gamedev common/data_common common/data_shard common/leveldesign common/exedll common/cfg shard/data_shard shard/data_language shard/data_leveldesign shard/data_game_share +title Ryzom Core: b1_client_dev.py (LEVELDESIGN) +b1_client_dev.py +title Ryzom Core: b2_shard_data.py (LEVELDESIGN) +b2_shard_data.py +title Ryzom Core: Ready diff --git a/code/nel/tools/memory/memlog/memlog.cpp b/code/nel/tools/memory/memlog/memlog.cpp index 2f9892727..8112f6181 100644 --- a/code/nel/tools/memory/memlog/memlog.cpp +++ b/code/nel/tools/memory/memlog/memlog.cpp @@ -69,11 +69,20 @@ int main(int argc, char* argv[]) if (fread (&size, sizeof(uint32), 1, file) != 1) break; +#ifdef NL_BIG_ENDIAN + NLMISC_BSWAP32(size); +#endif + while (1) { uint32 start; if (fread (&start, sizeof(uint32), 1, file) != 1) break; + +#ifdef NL_BIG_ENDIAN + NLMISC_BSWAP32(start); +#endif + string category; if (!readString (category, file)) break; diff --git a/code/nel/tools/misc/CMakeLists.txt b/code/nel/tools/misc/CMakeLists.txt index 5386cbbc6..c9bbcd058 100644 --- a/code/nel/tools/misc/CMakeLists.txt +++ b/code/nel/tools/misc/CMakeLists.txt @@ -3,6 +3,7 @@ SUBDIRS(bnp_make disp_sheet_id extract_filename lock make_sheet_id xml_packer) IF(WITH_QT) ADD_SUBDIRECTORY(words_dic_qt) ADD_SUBDIRECTORY(message_box_qt) + ADD_SUBDIRECTORY(crash_report) ENDIF(WITH_QT) IF(WIN32) diff --git a/code/nel/tools/misc/bnp_make/main.cpp b/code/nel/tools/misc/bnp_make/main.cpp index 000b5b7cc..4849dbd61 100644 --- a/code/nel/tools/misc/bnp_make/main.cpp +++ b/code/nel/tools/misc/bnp_make/main.cpp @@ -96,7 +96,15 @@ struct BNPHeader if (f == NULL) return false; uint32 nNbFile = (uint32)Files.size(); - if (fwrite (&nNbFile, sizeof(uint32), 1, f) != 1) + + // value to be serialized + uint32 nNbFile2 = nNbFile; + +#ifdef NL_BIG_ENDIAN + NLMISC_BSWAP32(nNbFile2); +#endif + + if (fwrite (&nNbFile2, sizeof(uint32), 1, f) != 1) { fclose(f); return false; @@ -117,20 +125,38 @@ struct BNPHeader return false; } - if (fwrite (&Files[i].Size, sizeof(uint32), 1, f) != 1) + uint32 nFileSize = Files[i].Size; + +#ifdef NL_BIG_ENDIAN + NLMISC_BSWAP32(nFileSize); +#endif + + if (fwrite (&nFileSize, sizeof(uint32), 1, f) != 1) { fclose(f); return false; } - if (fwrite (&Files[i].Pos, sizeof(uint32), 1, f) != 1) + uint32 nFilePos = Files[i].Pos; + +#ifdef NL_BIG_ENDIAN + NLMISC_BSWAP32(nFilePos); +#endif + + if (fwrite (&nFilePos, sizeof(uint32), 1, f) != 1) { fclose(f); return false; } } - if (fwrite (&OffsetFromBeginning, sizeof(uint32), 1, f) != 1) + uint32 nOffsetFromBeginning = OffsetFromBeginning; + +#ifdef NL_BIG_ENDIAN + NLMISC_BSWAP32(nOffsetFromBeginning); +#endif + + if (fwrite (&nOffsetFromBeginning, sizeof(uint32), 1, f) != 1) { fclose(f); return false; diff --git a/code/nel/tools/misc/crash_report/CMakeLists.txt b/code/nel/tools/misc/crash_report/CMakeLists.txt new file mode 100644 index 000000000..0e2d2a9bc --- /dev/null +++ b/code/nel/tools/misc/crash_report/CMakeLists.txt @@ -0,0 +1,39 @@ +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SRC_DIR} ${QT_INCLUDES}) +FILE(GLOB CRASHREPORT_SRC *.cpp) +FILE(GLOB CRASHREPORT_HDR *h) + +SET(CRASHREPORT_MOC_HDR +crash_report_socket.h +crash_report_widget.h +) + +SET(CRASHREPORT_UI +crash_report_widget.ui +) + +SET(QT_USE_QTGUI TRUE) +SET(QT_USE_QTNETWORK TRUE) +SET(QT_USE_QTMAIN TRUE) +SET(QT_USE_QTOPENGL FALSE) +SET(QT_USE_QTXML FALSE) + +INCLUDE(${QT_USE_FILE}) +ADD_DEFINITIONS(${QT_DEFINITIONS}) + +QT4_WRAP_CPP(CRASHREPORT_MOC_SRC ${CRASHREPORT_MOC_HDR}) +QT4_WRAP_UI(CRASHREPORT_UI_HDR ${CRASHREPORT_UI}) + +SOURCE_GROUP(QtResources FILES ${CRASHREPORT_UI}) +SOURCE_GROUP(QtGeneratedUiHdr FILES ${CRASHREPORT_UI_HDR}) +SOURCE_GROUP(QtGeneratedMocQrcSrc FILES ${CRASHREPORT_MOC_SRC}) +SOURCE_GROUP("source files" FILES ${CRASHREPORT_SRC}) +SOURCE_GROUP("header files" FILES ${CRASHREPORT_HDR}) + +ADD_EXECUTABLE(crash_report WIN32 MACOSX_BUNDLE ${CRASHREPORT_SRC} ${CRASHREPORT_MOC_HDR} ${CRASHREPORT_MOC_SRC} ${CRASHREPORT_UI_HDR}) +TARGET_LINK_LIBRARIES(crash_report ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY}) + +NL_DEFAULT_PROPS(crash_report "NeL, Tools, Misc: Crash Report") +NL_ADD_RUNTIME_FLAGS(crash_report) + +INSTALL(TARGETS crash_report RUNTIME DESTINATION ${NL_BIN_PREFIX}) + diff --git a/code/nel/tools/misc/crash_report/crash_report.cpp b/code/nel/tools/misc/crash_report/crash_report.cpp new file mode 100644 index 000000000..c42f1ae6f --- /dev/null +++ b/code/nel/tools/misc/crash_report/crash_report.cpp @@ -0,0 +1,111 @@ +// Nel MMORPG framework - Error Reporter +// +// Copyright (C) 2015 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 "crash_report_widget.h" +#include +#include + +#include +#include +#include + +class CCmdLineParser +{ +public: + static void parse( int argc, char **argv, std::vector< std::pair< std::string, std::string > > &v ) + { + std::stack< std::string > stack; + std::string key; + std::string value; + + for( int i = argc - 1 ; i >= 0; i-- ) + { + stack.push( std::string( argv[ i ] ) ); + } + + while( !stack.empty() ) + { + key = stack.top(); + stack.pop(); + + // If not a real parameter ( they start with '-' ), discard. + if( key[ 0 ] != '-' ) + continue; + + // Remove the '-' + key = key.substr( 1 ); + + // No more parameters + if( stack.empty() ) + { + v.push_back( std::make_pair( key, "" ) ); + break; + } + + value = stack.top(); + + // If next parameter is a key, process it in the next iteration + if( value[ 0 ] == '-' ) + { + v.push_back( std::make_pair( key, "" ) ); + continue; + } + // Otherwise store the pair + else + { + v.push_back( std::make_pair( key, value ) ); + stack.pop(); + } + } + } +}; + +int main( int argc, char **argv ) +{ +#ifndef WIN32 + // Workaround to default -style=gtk+ on recent Cinnamon versions + char *currentDesktop = getenv("XDG_CURRENT_DESKTOP"); + if (currentDesktop) + { + printf("XDG_CURRENT_DESKTOP: %s\n", currentDesktop); + if (!strcmp(currentDesktop, "X-Cinnamon")) + { + setenv("XDG_CURRENT_DESKTOP", "gnome", 1); + } + } +#endif + + QApplication app( argc, argv ); + + std::vector< std::pair< std::string, std::string > > params; + + CCmdLineParser::parse( argc, argv, params ); + + CCrashReportWidget w; + w.setup( params ); + w.show(); + + int ret = app.exec(); + + if( ret != EXIT_SUCCESS ) + return ret; + else + return w.getReturnValue(); + +} \ No newline at end of file diff --git a/code/nel/tools/misc/crash_report/crash_report_data.h b/code/nel/tools/misc/crash_report/crash_report_data.h new file mode 100644 index 000000000..5884e7eb4 --- /dev/null +++ b/code/nel/tools/misc/crash_report/crash_report_data.h @@ -0,0 +1,33 @@ +// Ryzom Core MMORPG framework - Error Reporter +// +// Copyright (C) 2015 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 RCERROR_DATA +#define RCERROR_DATA + +#include + + +struct SCrashReportData +{ + QString description; + QString report; + QString email; +}; + +#endif diff --git a/code/nel/tools/misc/crash_report/crash_report_socket.cpp b/code/nel/tools/misc/crash_report/crash_report_socket.cpp new file mode 100644 index 000000000..f2a14e84b --- /dev/null +++ b/code/nel/tools/misc/crash_report/crash_report_socket.cpp @@ -0,0 +1,78 @@ +// Nel MMORPG framework - Error Reporter +// +// Copyright (C) 2015 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 "crash_report_socket.h" +#include +#include +#include +#include +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) +# include +#endif + +class CCrashReportSocketPvt +{ +public: + QNetworkAccessManager mgr; +}; + +CCrashReportSocket::CCrashReportSocket( QObject *parent ) : +QObject( parent ) +{ + m_pvt = new CCrashReportSocketPvt(); + + connect( &m_pvt->mgr, SIGNAL( finished( QNetworkReply* ) ), this, SLOT( onFinished( QNetworkReply* ) ) ); +} + +CCrashReportSocket::~CCrashReportSocket() +{ + delete m_pvt; +} + +void CCrashReportSocket::sendReport( const SCrashReportData &data ) +{ +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) + QUrlQuery params; +#else + QUrl params; +#endif + params.addQueryItem( "report", data.report ); + params.addQueryItem( "descr", data.description ); + params.addQueryItem("email", data.email); + + QUrl url( m_url ); + QNetworkRequest request( url ); + request.setRawHeader( "Connection", "close" ); + +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) + QByteArray postData = params.query(QUrl::FullyEncoded).toUtf8(); +#else + QByteArray postData = params.encodedQuery(); +#endif + + m_pvt->mgr.post(request, postData); +} + +void CCrashReportSocket::onFinished( QNetworkReply *reply ) +{ + if( reply->error() != QNetworkReply::NoError ) + Q_EMIT reportFailed(); + else + Q_EMIT reportSent(); +} + diff --git a/code/nel/tools/misc/crash_report/crash_report_socket.h b/code/nel/tools/misc/crash_report/crash_report_socket.h new file mode 100644 index 000000000..32ccc5da0 --- /dev/null +++ b/code/nel/tools/misc/crash_report/crash_report_socket.h @@ -0,0 +1,55 @@ +// Nel MMORPG framework - Error Reporter +// +// Copyright (C) 2015 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 RCERROR_SOCKET +#define RCERROR_SOCKET + +#include +#include "crash_report_data.h" + +class CCrashReportSocketPvt; +class QNetworkReply; + +class CCrashReportSocket : public QObject +{ + Q_OBJECT + +public: + CCrashReportSocket( QObject *parent ); + ~CCrashReportSocket(); + + void setURL( const char *URL ){ m_url = URL; } + QString url() const{ return m_url; } + + void sendReport( const SCrashReportData &data ); + +Q_SIGNALS: + void reportSent(); + void reportFailed(); + +private Q_SLOTS: + void onFinished( QNetworkReply *reply ); + +private: + CCrashReportSocketPvt *m_pvt; + QString m_url; +}; + +#endif + diff --git a/code/nel/tools/misc/crash_report/crash_report_widget.cpp b/code/nel/tools/misc/crash_report/crash_report_widget.cpp new file mode 100644 index 000000000..218b3545c --- /dev/null +++ b/code/nel/tools/misc/crash_report/crash_report_widget.cpp @@ -0,0 +1,301 @@ +// Nel MMORPG framework - Error Reporter +// +// Copyright (C) 2015 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 "crash_report_widget.h" +#include "crash_report_socket.h" +#include "crash_report_data.h" +#include +#include +#include +#include +#include +#include +#include +#include + +CCrashReportWidget::CCrashReportWidget( QWidget *parent ) : +QWidget( parent ) +{ + m_developerMode = false; + m_forceSend = false; + m_devSendReport = false; + m_returnValue = ERET_NULL; + + m_ui.setupUi( this ); + + m_socket = new CCrashReportSocket( this ); + + QTimer::singleShot( 1, this, SLOT( onLoad() ) ); + + connect( m_ui.emailCB, SIGNAL( stateChanged( int ) ), this, SLOT( onCBClicked() ) ); + + connect( m_socket, SIGNAL( reportSent() ), this, SLOT( onReportSent() ) ); + connect( m_socket, SIGNAL( reportFailed() ), this, SLOT( onReportFailed() ) ); +} + +CCrashReportWidget::~CCrashReportWidget() +{ + m_socket = NULL; +} + +void CCrashReportWidget::setup( const std::vector< std::pair< std::string, std::string > > ¶ms ) +{ + for( int i = 0; i < params.size(); i++ ) + { + const std::pair< std::string, std::string > &p = params[ i ]; + const std::string &k = p.first; + const std::string &v = p.second; + + if( k == "log" ) + { + m_fileName = v.c_str(); + if( !QFile::exists( m_fileName ) ) + m_fileName.clear(); + } + else + if( k == "host" ) + { + m_socket->setURL( v.c_str() ); + } + else + if( k == "title" ) + { + setWindowTitle( v.c_str() ); + } + else + if( k == "dev" ) + { + m_developerMode = true; + } + else + if( k == "sendreport" ) + { + m_forceSend = true; + } + } + + if( m_fileName.isEmpty() ) + { + m_ui.reportLabel->hide(); + m_ui.reportEdit->hide(); + } + + + if( m_socket->url().isEmpty() || m_fileName.isEmpty() ) + { + m_ui.descriptionEdit->hide(); + m_ui.emailCB->hide(); + m_ui.emailEdit->hide(); + m_ui.descrLabel->hide(); + } + + QHBoxLayout *hbl = new QHBoxLayout( this ); + + if( m_developerMode ) + { + if( !m_socket->url().isEmpty() && !m_fileName.isEmpty() ) + { + m_ui.emailCB->setEnabled( false ); + + QCheckBox *cb = new QCheckBox( tr( "Send report" ), this ); + m_ui.gridLayout->addWidget( cb, 4, 0, 1, 1 ); + + m_ui.gridLayout->addWidget( m_ui.emailCB, 5, 0, 1, 1 ); + m_ui.gridLayout->addWidget( m_ui.emailEdit, 6, 0, 1, 1 ); + + connect(cb, SIGNAL(stateChanged(int)), this, SLOT(onSendCBClicked())); + if (m_forceSend) + cb->setChecked(true); + } + + hbl->addStretch(); + + QPushButton *alwaysIgnoreButton = new QPushButton( tr( "Always Ignore" ), this ); + QPushButton *ignoreButton = new QPushButton( tr( "Ignore" ), this ); + QPushButton *abortButton = new QPushButton( tr( "Abort" ), this ); + QPushButton *breakButton = new QPushButton(tr("Break"), this); + breakButton->setAutoDefault(true); + + hbl->addWidget( alwaysIgnoreButton ); + hbl->addWidget( ignoreButton ); + hbl->addWidget( abortButton ); + hbl->addWidget( breakButton ); + + m_ui.gridLayout->addLayout( hbl, 7, 0, 1, 3 ); + + connect( alwaysIgnoreButton, SIGNAL( clicked( bool ) ), this, SLOT( onAlwaysIgnoreClicked() ) ); + connect( ignoreButton, SIGNAL( clicked( bool ) ), this, SLOT( onIgnoreClicked() ) ); + connect( abortButton, SIGNAL( clicked( bool ) ), this, SLOT( onAbortClicked() ) ); + connect( breakButton, SIGNAL( clicked( bool ) ), this, SLOT( onBreakClicked() ) ); + } + else + { + hbl->addStretch(); + + // If -host is specified, offer the send function + if( !m_socket->url().isEmpty() && !m_fileName.isEmpty() ) + { + if (!m_forceSend) + { + QPushButton *cancelButton = new QPushButton(tr("Don't send report"), this); + connect(cancelButton, SIGNAL(clicked(bool)), this, SLOT(onCancelClicked())); + hbl->addWidget(cancelButton); + } + + QPushButton *sendButton = new QPushButton( tr( "Send report" ), this ); + sendButton->setAutoDefault(true); + connect( sendButton, SIGNAL( clicked( bool ) ), this, SLOT( onSendClicked() ) ); + hbl->addWidget( sendButton ); + } + // Otherwise only offer exit + else + { + QPushButton *exitButton = new QPushButton( tr( "Exit" ), this ); + connect( exitButton, SIGNAL( clicked( bool ) ), this, SLOT( onCancelClicked() ) ); + hbl->addWidget(exitButton); + exitButton->setAutoDefault(true); + } + + m_ui.gridLayout->addLayout( hbl, 6, 0, 1, 3 ); + } +} + +void CCrashReportWidget::onLoad() +{ + if( m_fileName.isEmpty() ) + return; + + QFile f( m_fileName ); + bool b = f.open( QFile::ReadOnly | QFile::Text ); + if( !b ) + { + m_fileName.clear(); + return; + } + + QTextStream ss( &f ); + m_ui.reportEdit->setPlainText( ss.readAll() ); + f.close(); +} + +void CCrashReportWidget::onSendClicked() +{ + if( m_developerMode && !m_devSendReport ) + { + close(); + return; + } + + if( m_socket->url().isEmpty() || m_fileName.isEmpty() ) + { + close(); + return; + } + + QApplication::setOverrideCursor( Qt::WaitCursor ); + + SCrashReportData data; + data.description = m_ui.descriptionEdit->toPlainText(); + data.report = m_ui.reportEdit->toPlainText(); + + if( m_ui.emailCB->isChecked() ) + data.email = m_ui.emailEdit->text(); + + m_socket->sendReport( data ); +} + +void CCrashReportWidget::onCancelClicked() +{ + removeAndQuit(); +} + +void CCrashReportWidget::onCBClicked() +{ + m_ui.emailEdit->setEnabled( m_ui.emailCB->isChecked() ); +} + +void CCrashReportWidget::onSendCBClicked() +{ + bool b = m_ui.emailCB->isEnabled(); + + if( b ) + { + m_ui.emailCB->setChecked( false ); + } + + m_ui.emailCB->setEnabled( !b ); + + m_devSendReport = !m_devSendReport; +} + +void CCrashReportWidget::onAlwaysIgnoreClicked() +{ + m_returnValue = ERET_ALWAYS_IGNORE; + onSendClicked(); +} + +void CCrashReportWidget::onIgnoreClicked() +{ + m_returnValue = ERET_IGNORE; + onSendClicked(); +} + +void CCrashReportWidget::onAbortClicked() +{ + m_returnValue = ERET_ABORT; + onSendClicked(); +} + +void CCrashReportWidget::onBreakClicked() +{ + m_returnValue = ERET_BREAK; + onSendClicked(); +} + + +void CCrashReportWidget::onReportSent() +{ + QApplication::setOverrideCursor( Qt::ArrowCursor ); + + QMessageBox::information( this, + tr( "Report sent" ), + tr( "The report has been sent." ) ); + + removeAndQuit(); +} + +void CCrashReportWidget::onReportFailed() +{ + QApplication::setOverrideCursor( Qt::ArrowCursor ); + + QMessageBox::information( this, + tr( "Report failed" ), + tr( "Failed to send the report..." ) ); + + removeAndQuit(); +} + +void CCrashReportWidget::removeAndQuit() +{ + if( !m_fileName.isEmpty() ) + QFile::remove( m_fileName ); + + close(); +} + diff --git a/code/nel/tools/misc/crash_report/crash_report_widget.h b/code/nel/tools/misc/crash_report/crash_report_widget.h new file mode 100644 index 000000000..f40e40854 --- /dev/null +++ b/code/nel/tools/misc/crash_report/crash_report_widget.h @@ -0,0 +1,82 @@ +// Nel MMORPG framework - Error Reporter +// +// Copyright (C) 2015 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 RCERROR_WIDGET +#define RCERROR_WIDGET + + +#include "ui_crash_report_widget.h" +#include +#include + +class CCrashReportSocket; + +class CCrashReportWidget : public QWidget +{ + Q_OBJECT +public: + + enum EReturnValue + { + ERET_NULL = 0, + ERET_ALWAYS_IGNORE = 21, + ERET_IGNORE = 22, + ERET_ABORT = 23, + ERET_BREAK = 24 + }; + + CCrashReportWidget( QWidget *parent = NULL ); + ~CCrashReportWidget(); + + void setFileName( const char *fn ){ m_fileName = fn; } + + void setup( const std::vector< std::pair< std::string, std::string > > ¶ms ); + + EReturnValue getReturnValue() const{ return m_returnValue; } + +private Q_SLOTS: + void onLoad(); + void onSendClicked(); + void onCancelClicked(); + void onCBClicked(); + void onSendCBClicked(); + + void onAlwaysIgnoreClicked(); + void onIgnoreClicked(); + void onAbortClicked(); + void onBreakClicked(); + + void onReportSent(); + void onReportFailed(); + +private: + void removeAndQuit(); + + Ui::CrashReportWidget m_ui; + QString m_fileName; + CCrashReportSocket *m_socket; + bool m_developerMode; + bool m_forceSend; + bool m_devSendReport; + + EReturnValue m_returnValue; +}; + +#endif + diff --git a/code/nel/tools/misc/crash_report/crash_report_widget.ui b/code/nel/tools/misc/crash_report/crash_report_widget.ui new file mode 100644 index 000000000..da1e38618 --- /dev/null +++ b/code/nel/tools/misc/crash_report/crash_report_widget.ui @@ -0,0 +1,68 @@ + + + CrashReportWidget + + + Qt::ApplicationModal + + + + 0 + 0 + 406 + 430 + + + + NeL report + + + + + + What were you doing when the crash occured? + + + + + + + Contents of the report ( automatically generated ) + + + + + + + + + + Email me if you have further questions, or updates on this issue + + + + + + + false + + + Enter your email address here + + + + + + + true + + + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + diff --git a/code/nel/tools/misc/data_mirror/StdAfx.h b/code/nel/tools/misc/data_mirror/StdAfx.h index 90fe14511..a065be4ed 100644 --- a/code/nel/tools/misc/data_mirror/StdAfx.h +++ b/code/nel/tools/misc/data_mirror/StdAfx.h @@ -10,9 +10,6 @@ #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/make_sheet_id/make_sheet_id.cpp b/code/nel/tools/misc/make_sheet_id/make_sheet_id.cpp index 53d515fdd..851dfe6df 100644 --- a/code/nel/tools/misc/make_sheet_id/make_sheet_id.cpp +++ b/code/nel/tools/misc/make_sheet_id/make_sheet_id.cpp @@ -163,7 +163,7 @@ void readFormId( string& outputFileName ) map::iterator itFT = FileTypeToId.find(fileType); if( itFT == FileTypeToId.end() ) { - FileTypeToId.insert( make_pair(fileType,fid.FormIDInfos.Type) ); + FileTypeToId.insert( std::pair(fileType,fid.FormIDInfos.Type) ); } } else diff --git a/code/nel/tools/misc/xml_packer/xml_packer.cpp b/code/nel/tools/misc/xml_packer/xml_packer.cpp index 6f82b5426..2d7695de4 100644 --- a/code/nel/tools/misc/xml_packer/xml_packer.cpp +++ b/code/nel/tools/misc/xml_packer/xml_packer.cpp @@ -379,7 +379,7 @@ int main(int argc, char *argv[]) CSString subFileName = parser.leftCrop(sizeof(" (i, fi)); + faultyInstances.insert(std::pair(i, fi)); } } @@ -1046,7 +1046,7 @@ void processGlobalRetriever() { if (Verbose) nlinfo("after fix: unlink: %s", unlinkstr.c_str()); - faultyInstances.insert(make_pair(i, fi)); + faultyInstances.insert(std::pair(i, fi)); } } } diff --git a/code/nel/tools/pacs/build_rbank/build_surf.cpp b/code/nel/tools/pacs/build_rbank/build_surf.cpp index 9546e19f1..10d4c6a19 100644 --- a/code/nel/tools/pacs/build_rbank/build_surf.cpp +++ b/code/nel/tools/pacs/build_rbank/build_surf.cpp @@ -201,8 +201,7 @@ template class CHashPtr { public: - static const size_t bucket_size = 4; - static const size_t min_buckets = 8; + enum { bucket_size = 4, min_buckets = 8, }; typedef A *ptrA; size_t operator() (const ptrA &a) const diff --git a/code/nelns/login_service/connection_client.cpp b/code/nelns/login_service/connection_client.cpp index 37976cb24..ebdef1b9a 100644 --- a/code/nelns/login_service/connection_client.cpp +++ b/code/nelns/login_service/connection_client.cpp @@ -126,7 +126,7 @@ retry: // now the user is on the database - uid = atoi(row[0]); + NLMISC::fromString(row[0], uid); if(cpassword != row[2]) { @@ -395,11 +395,11 @@ static void cbWSShardChooseShard (CMessage &msgin, const std::string &serviceNam string addr; msgin.serial (addr); msgout.serial (addr); - ClientsServer->send (msgout, (TSockId)cookie.getUserAddr ()); + ClientsServer->send (msgout, (TSockId)cookie.getUserAddr ()); // FIXME: 64-bit return; } msgout.serial(reason); - ClientsServer->send (msgout, (TSockId)cookie.getUserAddr ()); + ClientsServer->send (msgout, (TSockId)cookie.getUserAddr ()); // FIXME: 64-bit } static const TUnifiedCallbackItem WSCallbackArray[] = diff --git a/code/nelns/login_service/connection_web.cpp b/code/nelns/login_service/connection_web.cpp index 290884f91..e3abb9936 100644 --- a/code/nelns/login_service/connection_web.cpp +++ b/code/nelns/login_service/connection_web.cpp @@ -117,7 +117,7 @@ static void cbWSShardChooseShard/* (CMessage &msgin, TSockId from, CCallbackNetB */ } - WebServer->send (msgout, (TSockId)cookie.getUserAddr ()); + WebServer->send (msgout, (TSockId)cookie.getUserAddr ()); // FIXME: 64-bit } static const TUnifiedCallbackItem WSCallbackArray[] = diff --git a/code/nelns/login_service/login_service.h b/code/nelns/login_service/login_service.h index 7c8c5a427..3d84b1c8e 100644 --- a/code/nelns/login_service/login_service.h +++ b/code/nelns/login_service/login_service.h @@ -19,7 +19,9 @@ // we have to include windows.h because mysql.h uses it but not include it #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include # include typedef unsigned long ulong; diff --git a/code/nelns/login_service/mysql_helper.h b/code/nelns/login_service/mysql_helper.h index fee1d1bf6..ed4ebbd48 100644 --- a/code/nelns/login_service/mysql_helper.h +++ b/code/nelns/login_service/mysql_helper.h @@ -24,7 +24,9 @@ // we have to include windows.h because mysql.h uses it but not include it #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include # include typedef unsigned long ulong; diff --git a/code/nelns/login_system/database/nel.sql b/code/nelns/login_system/database/nel.sql deleted file mode 100644 index 66c887dcb..000000000 --- a/code/nelns/login_system/database/nel.sql +++ /dev/null @@ -1,62 +0,0 @@ -# HeidiSQL Dump -# -# -------------------------------------------------------- -# Host: 127.0.0.1 -# Database: nel -# Server version: 5.0.33 -# Server OS: Win32 -# Target-Compatibility: MySQL 5.0 -# Extended INSERTs: Y -# max_allowed_packet: 1048576 -# HeidiSQL version: 3.0 Revision: 572 -# -------------------------------------------------------- - -/*!40100 SET CHARACTER SET latin1*/; - - -# -# Table structure for table 'permission' -# - -CREATE TABLE `permission` ( - `UId` int(10) unsigned NOT NULL default '0', - `ClientApplication` char(64) collate latin1_general_ci NOT NULL default 'sample', - `ShardId` int(10) NOT NULL default '-1' -) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; - - - -# -# Table structure for table 'shard' -# - -CREATE TABLE `shard` ( - `ShardId` int(10) NOT NULL auto_increment, - `WsAddr` varchar(64) collate latin1_general_ci NOT NULL, - `NbPlayers` int(10) unsigned NOT NULL default '0', - `Name` varchar(64) collate latin1_general_ci NOT NULL default 'unknown shard', - `Online` tinyint(1) unsigned NOT NULL default '0', - `ClientApplication` varchar(64) collate latin1_general_ci NOT NULL, - `Version` varchar(64) collate latin1_general_ci NOT NULL default '', - `DynPatchURL` varchar(255) collate latin1_general_ci NOT NULL default '', - PRIMARY KEY (`ShardId`) -) ENGINE=MyISAM AUTO_INCREMENT=301 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci COMMENT='contains all shards information for login system'; - - - -# -# Table structure for table 'user' -# - -CREATE TABLE `user` ( - `UId` int(10) NOT NULL auto_increment, - `Login` varchar(64) collate latin1_general_ci NOT NULL default '', - `Password` char(32) collate latin1_general_ci NOT NULL, - `ShardId` int(10) NOT NULL default '-1', - `State` enum('Offline','Authorized','Waiting','Online') collate latin1_general_ci NOT NULL default 'Offline', - `Privilege` varchar(255) collate latin1_general_ci NOT NULL default '', - `ExtendedPrivilege` varchar(45) collate latin1_general_ci NOT NULL default '', - `Cookie` varchar(255) collate latin1_general_ci NOT NULL default '', - PRIMARY KEY (`UId`) -) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci COMMENT='contains all users information for login system'; - diff --git a/code/nelns/login_system/database/nel_tool.sql b/code/nelns/login_system/database/nel_tool.sql deleted file mode 100644 index 12caf7393..000000000 --- a/code/nelns/login_system/database/nel_tool.sql +++ /dev/null @@ -1,50 +0,0 @@ -# Database : `nel_tool` - -# -------------------------------------------------------- -# -# Table structure for table `server` -# - -CREATE TABLE server ( - sid int(11) unsigned NOT NULL auto_increment, - name varchar(64) default NULL, - address varchar(64) default NULL, - PRIMARY KEY (sid) -) TYPE=MyISAM; - -# -# Dumping data for table `server` -# -INSERT INTO server VALUES (1, 'Local Host', '127.0.0.1'); - -# -------------------------------------------------------- -# -# Table structure for table `service` -# -CREATE TABLE service ( - shid int(11) unsigned NOT NULL auto_increment, - shard varchar(64) default NULL, - server varchar(64) default NULL, - name varchar(64) default NULL, - PRIMARY KEY (shid) -) TYPE=MyISAM; - -# -# Dumping data for table `service` -# -INSERT INTO service VALUES (1, '300', 'Local Host', 'localhost'); - -# -------------------------------------------------------- -# -# Table structure for table `variable` -# -CREATE TABLE variable ( - path text, - error_bound text, - alarm_order text, - graph_update text -) TYPE=MyISAM; - -# -# Dumping data for table `variable` -# diff --git a/code/nelns/login_system/nel_launcher_windows_ext/Configuration.cpp b/code/nelns/login_system/nel_launcher_windows_ext/Configuration.cpp index f9092e56b..88b0d854a 100644 --- a/code/nelns/login_system/nel_launcher_windows_ext/Configuration.cpp +++ b/code/nelns/login_system/nel_launcher_windows_ext/Configuration.cpp @@ -52,7 +52,7 @@ BOOL CConfiguration::Load() // Reading the configuration file version GetValue(csBuffer, KEY_VERSION, csValue); - m_dVersion = atof(csValue); + NLMISC::fromString(csValue, m_dVersion); nlinfo("Config' version %s", csValue); if(m_dVersion < APP.m_dVersion) diff --git a/code/nelns/login_system/nel_launcher_windows_ext/nel_launcher.cpp b/code/nelns/login_system/nel_launcher_windows_ext/nel_launcher.cpp index 8ace867f7..2e36702d8 100644 --- a/code/nelns/login_system/nel_launcher_windows_ext/nel_launcher.cpp +++ b/code/nelns/login_system/nel_launcher_windows_ext/nel_launcher.cpp @@ -324,7 +324,7 @@ void CNel_launcherApp::LoadVersion() else { nlinfo("Launcher' version %s", csVersion); - m_dVersion = atof(csVersion); + NLMISC::fromString(csVersion, m_dVersion); } } diff --git a/code/ryzom/client/client_default.cfg b/code/ryzom/client/client_default.cfg index a27e69ee0..55e56b012 100644 --- a/code/ryzom/client/client_default.cfg +++ b/code/ryzom/client/client_default.cfg @@ -214,6 +214,12 @@ Shadows_ps1 = 1; Shadows_ps2 = 1; Shadows_ps3 = 1; +FXAA = 1; +FXAA_ps0 = 0; +FXAA_ps1 = 1; +FXAA_ps2 = 1; +FXAA_ps3 = 1; + Bloom = 0; Bloom_ps0 = 0; Bloom_ps1 = 1; @@ -413,7 +419,7 @@ PrintfCommandsFreeTrial = { DisplayMissingAnimFile = 0; -LoadingStringCount = 54; +LoadingStringCount = 0; // Some R2 parameters ... diff --git a/code/ryzom/client/client_default.cfg.in b/code/ryzom/client/client_default.cfg.in index 030a4a2b2..ec699fe14 100644 --- a/code/ryzom/client/client_default.cfg.in +++ b/code/ryzom/client/client_default.cfg.in @@ -210,6 +210,12 @@ Shadows_ps1 = 1; Shadows_ps2 = 1; Shadows_ps3 = 1; +FXAA = 1; +FXAA_ps0 = 0; +FXAA_ps1 = 1; +FXAA_ps2 = 1; +FXAA_ps3 = 1; + Bloom = 0; Bloom_ps0 = 0; Bloom_ps1 = 1; diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/game_config.xml b/code/ryzom/client/data/gamedev/interfaces_v3/game_config.xml index 5e9072b93..c2b62cebd 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/game_config.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/game_config.xml @@ -1230,8 +1230,15 @@ posref="BL TL" x="-20" y="-12" /> + + . -#include +#include "stdpch.h" #include "camera.h" #include diff --git a/code/ryzom/client/src/cdb_synchronised.cpp b/code/ryzom/client/src/cdb_synchronised.cpp index 45c57dd55..2ad3022cf 100644 --- a/code/ryzom/client/src/cdb_synchronised.cpp +++ b/code/ryzom/client/src/cdb_synchronised.cpp @@ -41,7 +41,7 @@ #include -#include "../../common/src/game_share/ryzom_database_banks.h" +#include "game_share/ryzom_database_banks.h" //////////////// diff --git a/code/ryzom/client/src/character_cl.cpp b/code/ryzom/client/src/character_cl.cpp index 23fdb78e2..89c9b805b 100644 --- a/code/ryzom/client/src/character_cl.cpp +++ b/code/ryzom/client/src/character_cl.cpp @@ -4537,7 +4537,7 @@ void CCharacterCL::applyBehaviourFlyingHPs(const CBehaviourContext &bc, const MB { if(behaviour.DeltaHP != 0) { - CRGBA deltaHPColor( 0, 0, 0 ); + 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 19af0545d..1b4285dd5 100644 --- a/code/ryzom/client/src/client.cpp +++ b/code/ryzom/client/src/client.cpp @@ -26,7 +26,6 @@ #include "nel/misc/types_nl.h" #ifdef NL_OS_WINDOWS -#include #include #else #include @@ -366,6 +365,8 @@ int main(int argc, char **argv) createDebug(); + INelContext::getInstance().setWindowedApplication(true); + #ifndef NL_DEBUG INelContext::getInstance().getDebugLog()->removeDisplayer("DEFAULT_SD"); INelContext::getInstance().getInfoLog()->removeDisplayer("DEFAULT_SD"); diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index a42c7988b..6cde86cba 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -328,11 +328,11 @@ CClientConfig::CClientConfig() DisplayAccountButtons = true; CreateAccountURL = "http://shard.ryzomcore.org/ams/index.php?page=register"; - ConditionsTermsURL = "https://secure.ryzom.com/signup/terms_of_use.php"; + ConditionsTermsURL = "http://www.gnu.org/licenses/agpl-3.0.html"; EditAccountURL = "http://shard.ryzomcore.org/ams/index.php?page=settings"; - BetaAccountURL = "http://www.ryzom.com/profile"; + BetaAccountURL = "http://shard.ryzomcore.org/ams/index.php?page=settings"; ForgetPwdURL = "http://shard.ryzomcore.org/ams/index.php?page=forgot_password"; - FreeTrialURL = "http://www.ryzom.com/join/?freetrial=1"; + FreeTrialURL = "http://shard.ryzomcore.org/ams/index.php?page=register"; LoginSupportURL = "http://shard.ryzomcore.org/ams/index.php"; Position = CVector(0.f, 0.f, 0.f); // Default Position. Heading = CVector(0.f, 1.f, 0.f); // Default Heading. @@ -349,13 +349,6 @@ CClientConfig::CClientConfig() ForceDeltaTime = 0; // Default ForceDeltaTime, disabled by default -#ifdef NL_OS_WINDOWS - DisableDirectInput = false; // Default DisableDirectInput -#else - DisableDirectInput = true; // no direct input on linux -#endif - - DisableDirectInputKeyboard = true; // Default DisableDirectInput fort he keyboard only HardwareCursor = true; // Default HardwareCursor HardwareCursorScale = 0.85f; CursorSpeed = 1.f; // Default CursorSpeed @@ -396,6 +389,8 @@ CClientConfig::CClientConfig() Fog = true; // Fog is on by default WaitVBL = false; + FXAA = true; + Bloom = true; SquareBloom = true; DensityBloom = 255.f; @@ -433,11 +428,11 @@ CClientConfig::CClientConfig() PatchVersion.clear(); PatchServer.clear(); - WebIgMainDomain = "atys.ryzom.com"; + WebIgMainDomain = "shard.ryzomcore.org"; WebIgTrustedDomains.push_back(WebIgMainDomain); - RingReleaseNotePath = "http://"+WebIgMainDomain+"/releasenotes_ring/index.php"; - ReleaseNotePath = "http://"+WebIgMainDomain+"/releasenotes/index.php"; + RingReleaseNotePath = "http://" + WebIgMainDomain + "/releasenotes_ring/index.php"; + ReleaseNotePath = "http://" + WebIgMainDomain + "/releasenotes/index.php"; /////////////// @@ -857,8 +852,6 @@ void CClientConfig::setValues() //////////// // INPUTS // - READ_BOOL_FV(DisableDirectInput) - READ_BOOL_FV(DisableDirectInputKeyboard) READ_BOOL_FV(HardwareCursor) READ_FLOAT_FV(HardwareCursorScale) READ_FLOAT_FV(CursorSpeed) @@ -989,6 +982,9 @@ void CClientConfig::setValues() READ_BOOL_FV(SquareBloom) READ_FLOAT_FV(DensityBloom) + // FXAA + READ_BOOL_FV(FXAA) + // ScreenAspectRatio. READ_FLOAT_FV(ScreenAspectRatio) // FoV. @@ -1969,16 +1965,16 @@ void CClientConfig::init(const string &configFileName) size_t endOfLine = contentUtf8.find("\n", pos); contentUtf8.erase(pos, (endOfLine - pos) + 1); } - + // get current location of the root config file (client_default.cfg) std::string defaultConfigLocation; if(!getDefaultConfigLocation(defaultConfigLocation)) nlerror("cannot find client_default.cfg"); - + // and store it in the RootConfigFilename value in the very first line - contentUtf8.insert(0, std::string("RootConfigFilename = \"") + + contentUtf8.insert(0, std::string("RootConfigFilename = \"") + defaultConfigLocation + "\";\n"); - + // save the updated config file NLMISC::COFile configFile(configFileName, false, true, false); configFile.serialBuffer((uint8*)contentUtf8.c_str(), (uint)contentUtf8.size()); @@ -2206,13 +2202,13 @@ ucstring CClientConfig::buildLoadingString( const ucstring& ucstr ) const } // *************************************************************************** -bool CClientConfig::getDefaultConfigLocation(std::string& p_name) const +bool CClientConfig::getDefaultConfigLocation(std::string& p_name) const { std::string defaultConfigFileName = "client_default.cfg"; std::string defaultConfigPath; - + p_name.clear(); - + #ifdef NL_OS_MAC // on mac, client_default.cfg should be searched in .app/Contents/Resources/ defaultConfigPath = CPath::standardizePath(getAppBundlePath() + "/Contents/Resources/"); diff --git a/code/ryzom/client/src/client_cfg.h b/code/ryzom/client/src/client_cfg.h index 44ddf3891..7d7f1c65d 100644 --- a/code/ryzom/client/src/client_cfg.h +++ b/code/ryzom/client/src/client_cfg.h @@ -78,7 +78,7 @@ struct CClientConfig sint SelectCharacter; /// Selected slot in select char interface uint8 SelectedSlot; - + /// Textures for interface login std::vector TexturesLoginInterface; std::vector TexturesLoginInterfaceDXTC; @@ -190,8 +190,6 @@ struct CClientConfig /// \name Inputs /// Use a hardware cursor - bool DisableDirectInput; - bool DisableDirectInputKeyboard; bool HardwareCursor; float HardwareCursorScale; // scale for hardware cursor bitmap (in ]0, 1]) float CursorSpeed; @@ -265,6 +263,9 @@ struct CClientConfig float GlobalWindPower; CVector GlobalWindDirection; + // FXAA + bool FXAA; + // Is bloom effect activated bool Bloom; bool SquareBloom; diff --git a/code/ryzom/client/src/client_chat_manager.cpp b/code/ryzom/client/src/client_chat_manager.cpp index 09f874b96..141edea27 100644 --- a/code/ryzom/client/src/client_chat_manager.cpp +++ b/code/ryzom/client/src/client_chat_manager.cpp @@ -969,8 +969,6 @@ void CClientChatManager::buildTellSentence(const ucstring &sender, const ucstrin name = STRING_MANAGER::CStringManagerClient::getTitleLocalizedName(CEntityCL::getTitleFromName(name), bWoman); } } - - } else { @@ -1052,8 +1050,6 @@ void CClientChatManager::buildChatSentence(TDataSetIndex /* compressedSenderInde senderName = STRING_MANAGER::CStringManagerClient::getTitleLocalizedName(CEntityCL::getTitleFromName(senderName), bWoman); } } - - } switch(type) @@ -1208,7 +1204,7 @@ class CHandlerTell : public IActionHandler ucstring s = CI18N::get("youTellPlayer"); strFindReplace(s, "%name", receiver); strFindReplace(finalMsg, CI18N::get("youTell"), s); - CInterfaceManager::getInstance()->log(finalMsg); + CInterfaceManager::getInstance()->log(finalMsg, CChatGroup::groupTypeToString(CChatGroup::tell)); } }; REGISTER_ACTION_HANDLER( CHandlerTell, "tell"); diff --git a/code/ryzom/client/src/commands.cpp b/code/ryzom/client/src/commands.cpp index 3805122f2..90287955d 100644 --- a/code/ryzom/client/src/commands.cpp +++ b/code/ryzom/client/src/commands.cpp @@ -3890,7 +3890,6 @@ NLMISC_COMMAND(displayInventoryCounter, "display the Inventory counter to compar NLMISC_COMMAND(displayActionCounter, "display the action counters", "") { - CInterfaceManager *pIM= CInterfaceManager::getInstance(); CSPhraseManager *pPM= CSPhraseManager::getInstance(); @@ -3921,11 +3920,11 @@ NLMISC_COMMAND (url, "launch a browser to the specified url", "") return false; HINSTANCE result = ShellExecute(NULL, "open", args[0].c_str(), NULL,NULL, SW_SHOW); - if ((sint32)result > 32) + if ((intptr_t)result > 32) return true; else { - log.displayNL ("ShellExecute failed %d", (uint32)result); + log.displayNL ("ShellExecute failed %d", (uint32)(intptr_t)result); return false; } } diff --git a/code/ryzom/client/src/connection.cpp b/code/ryzom/client/src/connection.cpp index 92b3acbe8..3f3a3d809 100644 --- a/code/ryzom/client/src/connection.cpp +++ b/code/ryzom/client/src/connection.cpp @@ -31,6 +31,7 @@ // 3D Interface. #include "nel/3d/u_driver.h" #include "nel/3d/u_text_context.h" +#include "nel/3d/stereo_display.h" // Game Share //#include "game_share/gd_time.h" // \todo GUIGUI : TO DELETE/CHANGE #include "game_share/gender.h" @@ -102,7 +103,6 @@ extern uint32 Version; // Client Version. extern UDriver *Driver; extern UTextContext *TextContext; extern bool game_exit; -extern CMsgBoxDisplayer MsgBoxError; extern CSoundManager *SoundMngr; @@ -116,6 +116,8 @@ extern void saveMovieShooting(); extern void displaySpecialTextProgress(const char *text); extern bool InitMouseWithCursor(bool hardware); +extern bool SetMousePosFirstTime; + ///////////// // Globals // initialization occurs in the function : connection ///////////// @@ -184,7 +186,7 @@ bool hasPrivilegeEM() { return (UserPrivileges.find(":EM:") != std::string::npos bool hasPrivilegeEG() { return (UserPrivileges.find(":EG:") != std::string::npos); } -// Restore the video mode (fullscreen for exemple) after the connection (done in a window) +// Restore the video mode (fullscreen for example) after the connection (done in a window) void connectionRestaureVideoMode () { // Setup full screen if we have to @@ -203,9 +205,13 @@ void connectionRestaureVideoMode () if (ClientCfg.Width < 800) ClientCfg.Width = 800; if (ClientCfg.Height < 600) ClientCfg.Height = 600; - if ((ClientCfg.Windowed != mode.Windowed) || + if (StereoDisplay) + StereoDisplayAttached = StereoDisplay->attachToDisplay(); + + if (!StereoDisplayAttached && ( + (ClientCfg.Windowed != mode.Windowed) || (ClientCfg.Width != mode.Width) || - (ClientCfg.Height != mode.Height)) + (ClientCfg.Height != mode.Height))) { mode.Windowed = ClientCfg.Windowed; mode.Depth = uint8(ClientCfg.Depth); @@ -216,7 +222,7 @@ void connectionRestaureVideoMode () } // And setup hardware mouse if we have to - InitMouseWithCursor (ClientCfg.HardwareCursor); + InitMouseWithCursor (ClientCfg.HardwareCursor && !StereoDisplayAttached); SetMouseFreeLook (); SetMouseCursor (); SetMouseSpeed (ClientCfg.CursorSpeed); @@ -251,6 +257,10 @@ void setOutGameFullScreen() // NB: don't setup fullscreen if player wants to play in window if (!ClientCfg.Local && ClientCfg.SelectCharacter == -1) { + if (StereoDisplayAttached) + StereoDisplay->detachFromDisplay(); + StereoDisplayAttached = false; + UDriver::CMode currMode; Driver->getCurrentScreenMode(currMode); UDriver::CMode wantedMode; @@ -267,6 +277,8 @@ void setOutGameFullScreen() { setVideoMode(wantedMode); } + + InitMouseWithCursor(ClientCfg.HardwareCursor && !StereoDisplayAttached); /* InitMouseWithCursor (true); Driver->showCursor(false); @@ -385,7 +397,7 @@ bool connection (const string &cookie, const string &fsaddr) // not initialized at login and remain hardware until here ... // Re-initialise the mouse (will be now in hardware mode, if required) - //InitMouseWithCursor (ClientCfg.HardwareCursor); // the return value of enableLowLevelMouse() has already been tested at startup + //InitMouseWithCursor (ClientCfg.HardwareCursor && !StereoDisplayAttached); // the return value of enableLowLevelMouse() has already been tested at startup // no ui init if character selection is automatic //SetMouseFreeLook (); @@ -544,7 +556,8 @@ bool reconnection() if (ClientCfg.SelectCharacter == -1) { // Re-initialise the mouse (will be now in hardware mode, if required) - InitMouseWithCursor (ClientCfg.HardwareCursor); // the return value of enableLowLevelMouse() has already been tested at startup + SetMousePosFirstTime = true; + InitMouseWithCursor (ClientCfg.HardwareCursor && !StereoDisplayAttached); // the return value of enableLowLevelMouse() has already been tested at startup // no ui init if character selection is automatic SetMouseFreeLook (); diff --git a/code/ryzom/client/src/debug_client.cpp b/code/ryzom/client/src/debug_client.cpp index 8800384ba..0af4207ae 100644 --- a/code/ryzom/client/src/debug_client.cpp +++ b/code/ryzom/client/src/debug_client.cpp @@ -345,6 +345,7 @@ void displayStreamingDebug () //----------------// // Create a shadow when displaying a text. TextContext->setShaded(true); + TextContext->setShadeOutline(false); // Set the font size. TextContext->setFontSize(ClientCfg.DebugFontSize); // Set the text color @@ -390,6 +391,7 @@ void displayStreamingDebug () // No more shadow when displaying a text. TextContext->setShaded(false); + TextContext->setShadeOutline(false); } } @@ -567,6 +569,7 @@ void displayNetDebug () //----------------// // Create a shadow when displaying a text. TextContext->setShaded(true); + TextContext->setShadeOutline(false); // Set the font size. TextContext->setFontSize(ClientCfg.DebugFontSize); // Set the text color diff --git a/code/ryzom/client/src/entities.cpp b/code/ryzom/client/src/entities.cpp index 7bc478ce7..516232108 100644 --- a/code/ryzom/client/src/entities.cpp +++ b/code/ryzom/client/src/entities.cpp @@ -426,7 +426,7 @@ void CEntityManager::initialize(uint nbMaxEntity) _Entities.resize(_NbMaxEntity, 0); _EntityGroundFXHandle.resize(_NbMaxEntity); } - + ICDBNode::CTextId textId; // Add an observer on the mission database diff --git a/code/ryzom/client/src/entity_cl.cpp b/code/ryzom/client/src/entity_cl.cpp index 0063c93f4..6a14d6400 100644 --- a/code/ryzom/client/src/entity_cl.cpp +++ b/code/ryzom/client/src/entity_cl.cpp @@ -2296,6 +2296,7 @@ void CEntityCL::onStringAvailable(uint /* stringId */, const ucstring &value) } ucstring replacement(STRING_MANAGER::CStringManagerClient::getTitleLocalizedName(_TitleRaw, womanTitle)); + // Sometimes translation contains another title { ucstring::size_type pos = replacement.find('$'); @@ -2308,7 +2309,7 @@ void CEntityCL::onStringAvailable(uint /* stringId */, const ucstring &value) replacement = STRING_MANAGER::CStringManagerClient::getTitleLocalizedName(_TitleRaw, womanTitle); } } - + _Tags = STRING_MANAGER::CStringManagerClient::getTitleInfos(_TitleRaw, womanTitle); if (!replacement.empty() || !ClientCfg.DebugStringManager) @@ -2949,7 +2950,7 @@ void CEntityCL::dataSetId(CLFECOMMON::TClientDataSetIndex dataSet) { _DataSetId = dataSet; - if (_Primitive && _Primitive->UserData == UserDataEntity) + if (_Primitive && _Primitive->UserData == UserDataEntity) _Primitive->UserData |= (((uint64)_DataSetId)<<16); // additionaly, on a UID change, must check the IsInTeam and IsAniml flags diff --git a/code/ryzom/client/src/events_listener.cpp b/code/ryzom/client/src/events_listener.cpp index 1d05f8a4e..760a5dc08 100644 --- a/code/ryzom/client/src/events_listener.cpp +++ b/code/ryzom/client/src/events_listener.cpp @@ -21,7 +21,6 @@ #include "events_listener.h" #include "nel/misc/events.h" -#include "nel/misc/game_device_events.h" #include "nel/misc/event_server.h" #include "release.h" #include "actions.h" @@ -29,11 +28,13 @@ #include "time_client.h" #include "input.h" #include "interface_v3/interface_manager.h" +#include "global.h" using namespace NLMISC; extern CActionsManager Actions; // Actions Manager. +extern bool MouseFreeLook; //--------------------------------------------------- // CEventsListener : @@ -82,7 +83,6 @@ CEventsListener::~CEventsListener() //--------------------------------------------------- void CEventsListener::addToServer(CEventServer& server) { - server.addListener(EventGDMouseMove, this); server.addListener(EventMouseMoveId, this); server.addListener(EventMouseDownId, this); server.addListener(EventMouseUpId, this); @@ -101,7 +101,6 @@ void CEventsListener::addToServer(CEventServer& server) //--------------------------------------------------- void CEventsListener::removeFromServer (CEventServer& server) { - server.removeListener(EventGDMouseMove, this); server.removeListener(EventMouseMoveId, this); server.removeListener(EventMouseDownId, this); server.removeListener(EventMouseUpId, this); @@ -113,6 +112,12 @@ void CEventsListener::removeFromServer (CEventServer& server) server.removeListener(EventSetFocusId, this); }// removeFromServer // +static bool s_MouseFreeLookReady = false; +static sint s_MouseFreeLookLastX; +static sint s_MouseFreeLookLastY; +static sint s_MouseFreeLookFrameX = 0; +static sint s_MouseFreeLookFrameY = 0; +static bool s_MouseFreeLookWaitCenter; //--------------------------------------------------- // operator() : @@ -148,20 +153,63 @@ void CEventsListener::operator()(const CEvent& event) { CAHManager::getInstance()->runActionHandler("enter_modal", NULL, "group=ui:interface:quit_dialog"); } - // Event from the Mouse (ANGLE) - if(event == EventGDMouseMove) - { - CGDMouseMove* mouseEvent=(CGDMouseMove*)&event; - // Mouse acceleration - sint dX = mouseEvent->X; - sint dY = ClientCfg.FreeLookInverted ? -mouseEvent->Y : mouseEvent->Y; - updateFreeLookPos((float) dX, (float) dY); - } // Event from the Mouse (MOVE) else if(event == EventMouseMoveId) { CEventMouseMove* mouseEvent=(CEventMouseMove*)&event; - updateCursorPos(mouseEvent->X, mouseEvent->Y); + if (!MouseFreeLook) + { + updateCursorPos(mouseEvent->X, mouseEvent->Y); + s_MouseFreeLookReady = false; + } + else + { + // Get in pixel space, centered + uint32 drW, drH; + Driver->getWindowSize(drW, drH); + float fX = mouseEvent->X; // from 0 to 1.0 + float fY = (ClientCfg.FreeLookInverted ? -mouseEvent->Y : mouseEvent->Y); + sint scX = (sint32)(fX * (float)drW) - ((sint32)drW >> 1); // in pixels, centered + sint scY = (sint32)(fY * (float)drH) - ((sint32)drH >> 1); + if (!s_MouseFreeLookReady) + { + float pfX = _MouseX; + float pfY = (ClientCfg.FreeLookInverted ? -_MouseY : _MouseY); + sint pscX = (sint32)(pfX * (float)drW) - ((sint32)drW >> 1); // in pixels, centered + sint pscY = (sint32)(pfY * (float)drH) - ((sint32)drH >> 1); + s_MouseFreeLookReady = true; + s_MouseFreeLookLastX = pscX; + s_MouseFreeLookLastY = pscY; + s_MouseFreeLookWaitCenter = false; + } + + // NOTE: No 0, 0 center mouse message in Windows (lower mouse message rate), but safe to assume any movement messages are requeued relative to our new position + bool outsideBounds = ((abs(scX) > (drW >> 3)) || (abs(scY) > (drH >> 3))); + if (s_MouseFreeLookWaitCenter && !outsideBounds) + { + // Centered, set last to 0 + s_MouseFreeLookLastX = 0; + s_MouseFreeLookLastY = 0; + s_MouseFreeLookWaitCenter = false; + } + + // Get delta since last center + sint scXd = scX - s_MouseFreeLookLastX; + sint scYd = scY - s_MouseFreeLookLastY; + s_MouseFreeLookLastX = scX; + s_MouseFreeLookLastY = scY; + + s_MouseFreeLookFrameX += scXd; + s_MouseFreeLookFrameY += scYd; + // updateFreeLookPos is called in updateMouseSmoothing per frame + + // Center cursor + if (outsideBounds && !s_MouseFreeLookWaitCenter) + { + s_MouseFreeLookWaitCenter = true; + Driver->setMousePos(0.5f, 0.5f); + } + } } // Event from the Mouse (DOWN BUTTONS) else if(event == EventMouseDownId) @@ -233,16 +281,9 @@ void CEventsListener::updateMouseSmoothing() { if (_LastFreeLookUpdateDate != TimeInSec) { - if (ClientCfg.FreeLookSmoothingPeriod != 0.f && _MouseSmoothingOn) - { - // free look hasn't been updated that frame because there was no - // mouse move msg. - // mouse pos must be updated however because of smoothing - updateFreeLookPos(0, 0); - - - - } + updateFreeLookPos((float)s_MouseFreeLookFrameX, (float)s_MouseFreeLookFrameY); + s_MouseFreeLookFrameX = 0; + s_MouseFreeLookFrameY = 0; } } @@ -267,7 +308,6 @@ void CEventsListener::enableMouseSmoothing(bool on) // *************************************************************** void CEventsListener::updateFreeLookPos(float x, float y) { - if (ClientCfg.FreeLookSmoothingPeriod == 0 || !_MouseSmoothingOn) { _MouseDeltaAX = x * ClientCfg.FreeLookSpeed; diff --git a/code/ryzom/client/src/far_tp.cpp b/code/ryzom/client/src/far_tp.cpp index 5ecd90c9c..5b9b0c836 100644 --- a/code/ryzom/client/src/far_tp.cpp +++ b/code/ryzom/client/src/far_tp.cpp @@ -188,7 +188,6 @@ const std::string& CLoginStateMachine::toString(CLoginStateMachine::TEvent event _CurrentState = stateId; \ break; \ } \ - extern std::string LoginLogin, LoginPassword; extern bool noUserChar; @@ -1132,7 +1131,7 @@ void CFarTP::disconnectFromPreviousShard() */ NetMngr.reinit(); - if( !isReselectingChar() ) + if (isIngame() && !isReselectingChar()) { nlinfo("FarTP: calling EntitiesMngr.reinit()"); EntitiesMngr.reinit(); diff --git a/code/ryzom/client/src/global.cpp b/code/ryzom/client/src/global.cpp index c965db43f..7c298ca58 100644 --- a/code/ryzom/client/src/global.cpp +++ b/code/ryzom/client/src/global.cpp @@ -25,21 +25,25 @@ using namespace NLMISC; // *************************************************************************** // Main System -NL3D::UDriver *Driver = 0; // The main 3D Driver +NL3D::UDriver *Driver = NULL; // The main 3D Driver NL3D::IStereoDisplay *StereoDisplay = NULL; // Stereo display NL3D::IStereoHMD *StereoHMD = NULL; // Head mount display -CSoundManager *SoundMngr = 0; // the sound manager +bool StereoDisplayAttached = false; // Is stereo display handling the display mode +CSoundManager *SoundMngr = NULL; // the sound manager NL3D::UMaterial GenericMat; // Generic Material -NL3D::UTextContext *TextContext = 0; // Context for all the text in the client. +NL3D::UTextContext *TextContext = NULL; // Context for all the text in the client. + +// Effects +NL3D::CFXAA *FXAA = NULL; // Main 3D Objects -NL3D::UScene *Scene = 0; -NL3D::UScene *SceneRoot = 0; -NL3D::UInstanceGroup *BackgroundIG = 0; -NL3D::ULandscape *Landscape = 0; -NL3D::UCloudScape *CloudScape = 0; +NL3D::UScene *Scene = NULL; +NL3D::UScene *SceneRoot = NULL; +NL3D::UInstanceGroup *BackgroundIG = NULL; +NL3D::ULandscape *Landscape = NULL; +NL3D::UCloudScape *CloudScape = NULL; NL3D::UCamera MainCam; -NL3D::UVisualCollisionManager *CollisionManager = 0; +NL3D::UVisualCollisionManager *CollisionManager = NULL; #ifdef USE_WATER_ENV_MAP CWaterEnvMapRdr WaterEnvMapRdr; NL3D::UWaterEnvMap *WaterEnvMap = NULL; @@ -58,7 +62,7 @@ NLMISC::CMatrix InvMainSceneViewMatrix; // Matrix to transform from camera s // Misc bool InitCloudScape = true; // tells that the cloud scape must be reinitialized -CEntityAnimationManager *EAM = 0; +CEntityAnimationManager *EAM = NULL; CProgress ProgressBar; TBackground LoadingBackground = StartBackground; string LoadingMusic; diff --git a/code/ryzom/client/src/global.h b/code/ryzom/client/src/global.h index 5879eeaec..de9aa6a73 100644 --- a/code/ryzom/client/src/global.h +++ b/code/ryzom/client/src/global.h @@ -42,6 +42,7 @@ namespace NL3D class UWaterEnvMap; class IStereoDisplay; class IStereoHMD; + class CFXAA; } class CEntityAnimationManager; @@ -81,10 +82,14 @@ const float ExtraZoneLoadingVision = 100.f; extern NL3D::UDriver *Driver; // The main 3D Driver extern NL3D::IStereoDisplay *StereoDisplay; // Stereo display extern NL3D::IStereoHMD *StereoHMD; // Head mount display +extern bool StereoDisplayAttached; // Is stereo display handling the display mode extern CSoundManager *SoundMngr; // the sound manager extern NL3D::UMaterial GenericMat; // Generic Material extern NL3D::UTextContext *TextContext; // Context for all the text in the client. +// Effects +extern NL3D::CFXAA *FXAA; + // Main 3D Objects extern NL3D::UScene *Scene; extern NL3D::UScene *SceneRoot; diff --git a/code/ryzom/client/src/graph.cpp b/code/ryzom/client/src/graph.cpp index 1bf370db0..8270762fb 100644 --- a/code/ryzom/client/src/graph.cpp +++ b/code/ryzom/client/src/graph.cpp @@ -134,6 +134,7 @@ void CGraph::renderGraph () if (TextContext != NULL) { TextContext->setShaded (false); + TextContext->setShadeOutline(false); TextContext->setHotSpot (UTextContext::MiddleLeft); TextContext->setColor (frontCol); TextContext->setFontSize (10); diff --git a/code/ryzom/client/src/ground_fx_manager.cpp b/code/ryzom/client/src/ground_fx_manager.cpp index dc064415f..f13309183 100644 --- a/code/ryzom/client/src/ground_fx_manager.cpp +++ b/code/ryzom/client/src/ground_fx_manager.cpp @@ -807,6 +807,7 @@ void CTestGroundFX::displayFXBoxes() const Driver->setFrustum(fr); TextContext->setColor(CRGBA::Green); TextContext->setShaded(false); + TextContext->setShadeOutline(false); TextContext->setFontSize(12); // float size = 0.4f; diff --git a/code/ryzom/client/src/hair_set.cpp b/code/ryzom/client/src/hair_set.cpp index d82733162..5d44e2857 100644 --- a/code/ryzom/client/src/hair_set.cpp +++ b/code/ryzom/client/src/hair_set.cpp @@ -45,20 +45,20 @@ void CHairSet::init (NLMISC::IProgressCallback &progress) progress.progress ((float)k/(float)numHairItem); const CItemSheet *item = SheetMngr.getItem(SLOTTYPE::HEAD_SLOT, k); - if( (item) && (!item->getShape().empty()) ) + if (item && !item->getShape().empty()) { - std::string itemName = NLMISC::toLower(item->getShape()); - if (item->getShape().find("cheveux", 0) != std::string::npos) { // get race - uint16 race = (uint16) itemName[1] | ((uint16) itemName[0] << 8); - switch(race) + std::string itemName = NLMISC::toLower(item->getShape()); + + // fortunately, first character of each race is distinct + switch(itemName[0]) { - case 'ma': _Hairs[Matis].push_back(k); break; - case 'tr': _Hairs[Tryker].push_back(k); break; - case 'zo': _Hairs[Zorai].push_back(k); break; - case 'fy': _Hairs[Fyros].push_back(k); break; + case 'm': _Hairs[Matis].push_back(k); break; + case 't': _Hairs[Tryker].push_back(k); break; + case 'z': _Hairs[Zorai].push_back(k); break; + case 'f': _Hairs[Fyros].push_back(k); break; } } } diff --git a/code/ryzom/client/src/http_client_curl.cpp b/code/ryzom/client/src/http_client_curl.cpp index db830a9df..008bef19a 100644 --- a/code/ryzom/client/src/http_client_curl.cpp +++ b/code/ryzom/client/src/http_client_curl.cpp @@ -15,7 +15,6 @@ // along with this program. If not, see . #include "stdpch.h" -#define CURL_STATICLIB 1 #include #include "http_client_curl.h" diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index aa18cee6a..5484141a2 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -142,7 +142,6 @@ using namespace std; // Ligo primitive class CLigoConfig LigoConfig; -CMsgBoxDisplayer MsgBoxError; CClientChatManager ChatMngr; bool LastScreenSaverEnabled = false; @@ -554,27 +553,6 @@ void checkDriverDepth () } } -static std::string replaceApplicationDirToken(const std::string &dir) -{ - -#ifdef NL_OS_MAC - // if client_default.cfg is not in current directory, and it's not an absolute path, use application default directory - if (!CFile::isExists("client_default.cfg") && dir.size()>0 && dir[0]!='/') - { - return getAppBundlePath() + "/Contents/Resources/" + dir; - } -#else - static const std::string token = ""; - std::string::size_type pos = dir.find(token); - if (pos != std::string::npos) - return dir.substr(0, pos) + getAppBundlePath() + dir.substr(pos + token.length()); -#endif - -// preDataPath = getAppBundlePath() + "/Contents/Resources/" + preDataPath; - - return dir; -} - void listStereoDisplayDevices(std::vector &devices) { bool cache = VRDeviceCache.empty(); @@ -589,7 +567,7 @@ void listStereoDisplayDevices(std::vector &devices) std::stringstream name; name << IStereoDisplay::getLibraryName(it->Library) << " - " << it->Manufacturer << " - " << it->ProductName; std::stringstream fullname; - fullname << std::string("[") << name << "] [" << it->Serial << "]"; + fullname << std::string("[") << name.str() << "] [" << it->Serial << "]"; nlinfo("VR [C]: Stereo Display: %s", name.str().c_str()); if (cache) { @@ -616,10 +594,16 @@ void initStereoDisplayDevice() std::vector devices; listStereoDisplayDevices(devices); CStereoDeviceInfo *deviceInfo = NULL; - if (ClientCfg.VRDisplayDevice == std::string("Auto") - && devices.begin() != devices.end()) + if (ClientCfg.VRDisplayDevice == std::string("Auto")) { - deviceInfo = &devices[0]; + for (std::vector::iterator it(devices.begin()), end(devices.end()); it != end; ++it) + { + if ((*it).AllowAuto) + { + deviceInfo = &(*it); + break; + } + } } else { @@ -672,39 +656,94 @@ void addSearchPaths(IProgressCallback &progress) progress.progress ((float)i/(float)ClientCfg.DataPath.size()); progress.pushCropedValues ((float)i/(float)ClientCfg.DataPath.size(), (float)(i+1)/(float)ClientCfg.DataPath.size()); - CPath::addSearchPath(replaceApplicationDirToken(ClientCfg.DataPath[i]), true, false, &progress); + CPath::addSearchPath(ClientCfg.DataPath[i], true, false, &progress); progress.popCropedValues (); } CPath::loadRemappedFiles("remap_files.csv"); } + for (uint i = 0; i < ClientCfg.DataPathNoRecurse.size(); i++) { progress.progress ((float)i/(float)ClientCfg.DataPathNoRecurse.size()); progress.pushCropedValues ((float)i/(float)ClientCfg.DataPathNoRecurse.size(), (float)(i+1)/(float)ClientCfg.DataPathNoRecurse.size()); - CPath::addSearchPath(replaceApplicationDirToken(ClientCfg.DataPathNoRecurse[i]), false, false, &progress); + CPath::addSearchPath(ClientCfg.DataPathNoRecurse[i], false, false, &progress); progress.popCropedValues (); } -} + std::string defaultDirectory; + +#ifdef NL_OS_MAC + defaultDirectory = CPath::standardizePath(getAppBundlePath() + "/Contents/Resources"); +#elif defined(NL_OS_UNIX) && defined(RYZOM_SHARE_PREFIX) + defaultDirectory = CPath::standardizePath(std::string(RYZOM_SHARE_PREFIX)); +#endif + + // add in last position, a specific possibly read only directory + if (!defaultDirectory.empty()) + { + for (uint i = 0; i < ClientCfg.DataPath.size(); i++) + { + // don't prepend default directory if path is absolute + if (!ClientCfg.DataPath[i].empty() && ClientCfg.DataPath[i][0] != '/') + { + progress.progress ((float)i/(float)ClientCfg.DataPath.size()); + progress.pushCropedValues ((float)i/(float)ClientCfg.DataPath.size(), (float)(i+1)/(float)ClientCfg.DataPath.size()); + + CPath::addSearchPath(defaultDirectory + ClientCfg.DataPath[i], true, false, &progress); + + progress.popCropedValues (); + } + } + } +} void addPreDataPaths(NLMISC::IProgressCallback &progress) { NLMISC::TTime initPaths = ryzomGetLocalTime (); - H_AUTO(InitRZAddSearchPaths) + + H_AUTO(InitRZAddSearchPaths); + for (uint i = 0; i < ClientCfg.PreDataPath.size(); i++) { progress.progress ((float)i/(float)ClientCfg.PreDataPath.size()); progress.pushCropedValues ((float)i/(float)ClientCfg.PreDataPath.size(), (float)(i+1)/(float)ClientCfg.PreDataPath.size()); - CPath::addSearchPath(replaceApplicationDirToken(ClientCfg.PreDataPath[i]), true, false, &progress); + CPath::addSearchPath(ClientCfg.PreDataPath[i], true, false, &progress); progress.popCropedValues (); } + //nlinfo ("PROFILE: %d seconds for Add search paths Predata", (uint32)(ryzomGetLocalTime ()-initPaths)/1000); + + std::string defaultDirectory; + +#ifdef NL_OS_MAC + defaultDirectory = CPath::standardizePath(getAppBundlePath() + "/Contents/Resources"); +#elif defined(NL_OS_UNIX) && defined(RYZOM_SHARE_PREFIX) + defaultDirectory = CPath::standardizePath(std::string(RYZOM_SHARE_PREFIX)); +#endif + + // add in last position, a specific possibly read only directory + if (!defaultDirectory.empty()) + { + for (uint i = 0; i < ClientCfg.PreDataPath.size(); i++) + { + // don't prepend default directory if path is absolute + if (!ClientCfg.PreDataPath[i].empty() && ClientCfg.PreDataPath[i][0] != '/') + { + progress.progress ((float)i/(float)ClientCfg.PreDataPath.size()); + progress.pushCropedValues ((float)i/(float)ClientCfg.PreDataPath.size(), (float)(i+1)/(float)ClientCfg.PreDataPath.size()); + + CPath::addSearchPath(defaultDirectory + ClientCfg.PreDataPath[i], true, false, &progress); + + progress.popCropedValues (); + } + } + } } static void addPackedSheetUpdatePaths(NLMISC::IProgressCallback &progress) @@ -713,7 +752,7 @@ static void addPackedSheetUpdatePaths(NLMISC::IProgressCallback &progress) { progress.progress((float)i/(float)ClientCfg.UpdatePackedSheetPath.size()); progress.pushCropedValues ((float)i/(float)ClientCfg.UpdatePackedSheetPath.size(), (float)(i+1)/(float)ClientCfg.UpdatePackedSheetPath.size()); - CPath::addSearchPath(replaceApplicationDirToken(ClientCfg.UpdatePackedSheetPath[i]), true, false, &progress); + CPath::addSearchPath(ClientCfg.UpdatePackedSheetPath[i], true, false, &progress); progress.popCropedValues(); } } @@ -748,12 +787,12 @@ 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. setCPUMask(); - + FPU_CHECKER_ONCE NLMISC::TTime initStart = ryzomGetLocalTime (); @@ -882,15 +921,14 @@ void prelogInit() UDriver::TDriver driver = UDriver::OpenGl; #ifdef NL_OS_WINDOWS - uint icon = (uint)LoadIcon(HInstance, MAKEINTRESOURCE(IDI_MAIN_ICON)); + uintptr_t icon = (uintptr_t)LoadIcon(HInstance, MAKEINTRESOURCE(IDI_MAIN_ICON)); #else - uint icon = 0; + uintptr_t icon = 0; #endif // NL_OS_WINDOWS switch(ClientCfg.Driver3D) { #ifdef NL_OS_WINDOWS - case CClientConfig::Direct3D: driver = UDriver::Direct3d; break; @@ -943,7 +981,7 @@ void prelogInit() Driver->setSwapVBLInterval(1); else Driver->setSwapVBLInterval(0); - + if (StereoDisplay) // VR_CONFIG // VR_DRIVER { // override mode TODO @@ -1069,37 +1107,9 @@ void prelogInit() FPU_CHECKER_ONCE - // Test mouse & keyboard low-level mode, if DisableDirectInput not set. - // In case of failure, exit the client. - // In case of success, set it back to normal mode, to provide for the user - // the ability to manually set the firewall's permissions when the client connects. - // The low-level mode will actually be set when "launching" (after loading). - if (!ClientCfg.DisableDirectInput) - { - // Test mouse and set back to normal mode - if (!Driver->enableLowLevelMouse (true, ClientCfg.HardwareCursor)) - { - ExitClientError (CI18N::get ("can_t_initialise_the_mouse").toUtf8 ().c_str ()); - // ExitClientError() call exit() so the code after is never called - return; - } - Driver->enableLowLevelMouse (false, ClientCfg.HardwareCursor); - - // Test keyboard and set back to normal mode - // NB : keyboard will be initialized later now - /*if (!Driver->enableLowLevelKeyboard (true)) - { - ExitClientError (CI18N::get ("can_t_initialise_the_keyboard").toUtf8 ().c_str ()); - // ExitClientError() call exit() so the code after is never called - return; - } - Driver->enableLowLevelKeyboard (false); - */ - } - // Set the monitor color properties CMonitorColorProperties monitorColor; - for ( uint i=0; i<3; i++) + for (uint i=0; i<3; i++) { monitorColor.Contrast[i] = ClientCfg.Contrast; monitorColor.Luminosity[i] = ClientCfg.Luminosity; @@ -1189,7 +1199,7 @@ void prelogInit() CBloomEffect::getInstance().setDriver(Driver); // init bloom effect - CBloomEffect::getInstance().init(driver != UDriver::Direct3d); + CBloomEffect::getInstance().init(); if (StereoDisplay) // VR_CONFIG { diff --git a/code/ryzom/client/src/init_main_loop.cpp b/code/ryzom/client/src/init_main_loop.cpp index b251689ea..390b82e15 100644 --- a/code/ryzom/client/src/init_main_loop.cpp +++ b/code/ryzom/client/src/init_main_loop.cpp @@ -40,6 +40,8 @@ #include "nel/3d/u_cloud_scape.h" #include "nel/3d/u_shape_bank.h" #include "nel/3d/u_water_env_map.h" +#include "nel/3d/material.h" +#include "nel/3d/fxaa.h" // Sound #include "nel/sound/u_audio_mixer.h" // Client @@ -125,6 +127,8 @@ namespace R2 extern bool ReloadUIFlag; } +extern bool SetMousePosFirstTime; + extern EGSPD::CSeason::TSeason ManualSeasonValue; UTextureFile *LoadingBitmap = NULL; UTextureFile *LoadingBitmapFull = NULL; @@ -149,8 +153,12 @@ bool UseEscapeDuringLoading = USE_ESCAPE_DURING_LOADING; #define ENTITY_TEXTURE_NORMAL_LEVEL 1 #define ENTITY_TEXTURE_HIGH_LEVEL 0 // Size in MB of the cache for entity texturing. -#define ENTITY_TEXTURE_NORMAL_MEMORY 10 -#define ENTITY_TEXTURE_HIGH_MEMORY 40 +#define ENTITY_TEXTURE_NORMAL_MEMORY 40 +#define ENTITY_TEXTURE_HIGH_MEMORY 160 +// Size in KB of max upload per frame +#define ENTITY_TEXTURE_LOW_MAXUP 64 +#define ENTITY_TEXTURE_NORMAL_MAXUP 128 +#define ENTITY_TEXTURE_HIGH_MAXUP 256 // Don't Modify, set true for debug purpose only const bool DBG_DisablePreloadShape= false; @@ -176,8 +184,8 @@ struct CStatThread : public NLMISC::IRunnable if(!curl) return; curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1); // curl_easy_setopt(curl, CURLOPT_USERAGENT, "unknown"); - curl_easy_setopt(curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)"); - curl_easy_setopt(curl, CURLOPT_REFERER, string("http://www.ryzom.com/"+referer).c_str()); + curl_easy_setopt(curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)"); // FIXME + curl_easy_setopt(curl, CURLOPT_REFERER, string("http://www.ryzomcore.org/" + referer).c_str()); curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); CURLcode res = curl_easy_perform(curl); curl_easy_cleanup(curl); @@ -232,7 +240,7 @@ struct CStatThread : public NLMISC::IRunnable addParam(params, "page", ""); addParam(params, "pagetitle", referer); addParam(params, "screen", toString("%dx%d", ClientCfg.ConfigFile.getVar("Width").asInt(), ClientCfg.ConfigFile.getVar("Height").asInt())); - addParam(params, "referer", "http%3A%2F%2Fwww.ryzom.com%2F"+referer); + addParam(params, "referer", "http%3A%2F%2Fwww.ryzomcore.org%2F" + referer); time_t rawtime; struct tm * timeinfo; char buffer [80]; @@ -255,7 +263,7 @@ struct CStatThread : public NLMISC::IRunnable default: shard= "unknown"; break; } addParam(params, "cv_Shard", shard); - get("http://ryzom.com.woopra-ns.com/visit/"+params); + /* get("http://ryzom.com.woopra-ns.com/visit/" + params); */// FIXME return true; } @@ -265,7 +273,7 @@ struct CStatThread : public NLMISC::IRunnable std::string params; addParam(params, "cookie", cookie()); addParam(params, "ra", randomString()); - get("http://ryzom.com.woopra-ns.com/ping/"+params); + /* get("http://ryzom.com.woopra-ns.com/ping/" + params); */// FIXME } void run() @@ -563,6 +571,9 @@ void initMainLoop() if(Scene == 0) nlerror("initMainLoop : Cannot create a Scene."); + // create effects + if (ClientCfg.FXAA && !FXAA) FXAA = new NL3D::CFXAA(Driver); + // use this scene for bloom effect CBloomEffect::getInstance().setScene(Scene); @@ -878,8 +889,10 @@ void initMainLoop() { // setup "v2 texture" (or 512*512) Driver->setupAsyncTextureLod(ENTITY_TEXTURE_COARSE_LEVEL, ENTITY_TEXTURE_HIGH_LEVEL); - // Allow a big cache for them (should be on 128 Mo card only) + // Allow a big cache for them (should be on 512 Mo card only) Driver->setupMaxTotalAsyncTextureSize(ENTITY_TEXTURE_HIGH_MEMORY*1024*1024); + // Allow high upload + Driver->setupAsyncTextureMaxUploadPerFrame(ENTITY_TEXTURE_HIGH_MAXUP*1024); } else { @@ -887,6 +900,8 @@ void initMainLoop() Driver->setupAsyncTextureLod(ENTITY_TEXTURE_COARSE_LEVEL, ENTITY_TEXTURE_NORMAL_LEVEL); // Allow a big cache for them Driver->setupMaxTotalAsyncTextureSize(ENTITY_TEXTURE_NORMAL_MEMORY*1024*1024); + // Allow normal upload + Driver->setupAsyncTextureMaxUploadPerFrame(ENTITY_TEXTURE_NORMAL_MAXUP*1024); } } else @@ -897,6 +912,8 @@ void initMainLoop() Driver->setupAsyncTextureLod(ENTITY_TEXTURE_COARSE_LEVEL-1, ENTITY_TEXTURE_NORMAL_LEVEL-1); // Allow a big cache for them Driver->setupMaxTotalAsyncTextureSize(ENTITY_TEXTURE_NORMAL_MEMORY*1024*1024); + // Allow low upload + Driver->setupAsyncTextureMaxUploadPerFrame(ENTITY_TEXTURE_LOW_MAXUP*1024); } } @@ -1253,7 +1270,8 @@ void initMainLoop() // NLMEMORY::CheckHeap (true); // Re-initialise the mouse (will be now in hardware mode, if required) - InitMouseWithCursor (ClientCfg.HardwareCursor); // the return value of enableLowLevelMouse() has already been tested at startup + SetMousePosFirstTime = true; + InitMouseWithCursor (ClientCfg.HardwareCursor && !StereoDisplayAttached); // the return value of enableLowLevelMouse() has already been tested at startup // Re-initialise the keyboard, now in low-level mode, if required // NB nico : done at end of loading @@ -1496,6 +1514,7 @@ void initWelcomeWindow() // *************************************************************************** +// NOTE: This feature is not really used anymore, it is a patch transition void initHardwareCursor(bool secondCall) { CInterfaceManager * pIM = CInterfaceManager::getInstance(); @@ -1571,6 +1590,7 @@ void initBloomConfigUI() if(group) group->setDefaultContextHelp(CI18N::get("uiFxTooltipBloom")); + ClientCfg.writeBool("FXAA", false); ClientCfg.writeBool("Bloom", false); ClientCfg.writeBool("SquareBloom", false); ClientCfg.writeInt("DensityBloom", 0); diff --git a/code/ryzom/client/src/input.cpp b/code/ryzom/client/src/input.cpp index e67df8af2..6d0834f07 100644 --- a/code/ryzom/client/src/input.cpp +++ b/code/ryzom/client/src/input.cpp @@ -21,6 +21,7 @@ ///////////// #include "stdpch.h" // Client +#include "global.h" #include "actions.h" #include "input.h" #include "interface_v3/interface_manager.h" @@ -30,7 +31,6 @@ // 3D #include "nel/3d/u_driver.h" // Misc -#include "nel/misc/mouse_device.h" #include "nel/misc/mouse_smoother.h" #include "nel/misc/system_utils.h" // Game Share @@ -54,7 +54,6 @@ extern CActionsManager Actions; // Actions Manager. //////////// // GLOBAL // //////////// -IMouseDevice *MouseDevice = NULL; bool MouseHardware = false; bool MouseFreeLook = false; float MouseCursorSpeed = 1.f; @@ -81,93 +80,40 @@ bool InitMouseWithCursor (bool hardware) { Driver->showCursor(false); - // First init ? - if (MouseDevice) - { - // No.. change soft to hard or hard to soft ? - if (hardware ^ MouseHardware) - { - // Ok, reinit the mouse - Driver->enableLowLevelMouse (false, false); - MouseDevice = NULL; - MouseHardware = false; - } - } - // Get the new mouse state MouseHardware = hardware; CViewPointer::setHWMouse( hardware ); - // Reinit ? - if (MouseDevice == NULL) - { - if (!ClientCfg.DisableDirectInput) - { - // mouse capture not taken in account for hardware mouse - MouseDevice = Driver->enableLowLevelMouse(true, hardware); - if (!MouseDevice) - return false; - } - - // Update mouse information - UpdateMouse (); + // Update mouse information + UpdateMouse (); - if (InitMouseFirstTime) - { - InitMouseFirstTime = false; - } - else + if (InitMouseFirstTime) + { + InitMouseFirstTime = false; + } + else + { + if (!MouseFreeLook) { - if (!MouseFreeLook) + // Get the current mouse position + CInterfaceManager *pIm = CInterfaceManager::getInstance(); + CViewPointer *vp = static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() ); + Driver->showCursor(hardware); + if (vp) { - // Get the current mouse position - if (hardware) + float x = (float) vp->getX(); + float y = (float) vp->getY(); + // First, hide the hardware mouse + uint width = Driver->getWindowWidth(); + uint height = Driver->getWindowHeight(); + if (SetMousePosFirstTime) { - Driver->showCursor(true); - - CViewPointer *pointer = static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() ); - if (pointer) - { - float x = (float)pointer->getX()/(float)Driver->getWindowWidth(); - float y = (float)pointer->getY()/(float)Driver->getWindowHeight(); - - if (SetMousePosFirstTime) - { - SetMousePosFirstTime = false; - } - else - { - Driver->setMousePos(x, y); - nlwarning("mouse pos %f,%f", x, y); - } - - } + SetMousePosFirstTime = false; } - else + else if (width != 0 && height != 0) { - CInterfaceManager *pIm = CInterfaceManager::getInstance(); - CViewPointer *vp = static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() ); - Driver->showCursor(false); - SetMousePosFirstTime = false; - if (vp) - { - float x = (float) vp->getX(); - float y = (float) vp->getY(); - // First, hide the hardware mouse - if (MouseDevice) - { - MouseDevice->setMousePos(x, y); - } - else - { - uint width = Driver->getWindowWidth(); - uint height = Driver->getWindowHeight(); - if (width != 0 && height != 0) - { - Driver->setMousePos(x / width, y / height); - } - } - } + nlwarning("mouse pos %u, %u", x, y); + Driver->setMousePos(x / width, y / height); } } } @@ -187,45 +133,6 @@ bool IsMouseCursorHardware () // Set the mouse mode. Call this method once per frame to update window size void UpdateMouse () { - // Freelook ? - if (MouseFreeLook) - { - // Raw mode - if (MouseDevice) - { - MouseDevice->setMessagesMode(IMouseDevice::RawMode); - MouseDevice->setMouseAcceleration(ClientCfg.FreeLookAcceleration); - } - else - { - // no mouse device implementation on X11 and Cocoa, emulate raw mode - Driver->emulateMouseRawMode(true); - } - } - else - { - // Set the mouse properties - if (MouseDevice) - { - // Get the driver size - uint32 width, height; - Driver->getWindowSize(width, height); - - MouseDevice->setMessagesMode(IMouseDevice::NormalMode); - MouseDevice->setMouseMode(IMouseDevice::XAxis, IMouseDevice::Clamped); - MouseDevice->setMouseMode(IMouseDevice::YAxis, IMouseDevice::Clamped); - CRect window (0, 0, width, height); - MouseDevice->setMouseFrame(window); - MouseDevice->setFactors(1.f/std::max((float)width, 1.0f), 1.f/std::max((float)height, 1.0f)); - MouseDevice->setMouseSpeed(MouseCursorSpeed); - MouseDevice->setMouseAcceleration(MouseCursorAcceleration); - } - else - { - // no mouse device implementation on X11 and Cocoa, emulate raw mode - Driver->emulateMouseRawMode(false); - } - } if (!Driver->isSystemCursorCaptured()) { DownMouseButtons = 0; @@ -263,7 +170,6 @@ bool IsMouseFreeLook() return MouseFreeLook; } - // ********************************************************************************* // Use this method to toggle the mouse (freelook -> cursor) void SetMouseCursor (bool updatePos) @@ -287,8 +193,11 @@ void SetMouseCursor (bool updatePos) { sint32 ix, iy; cursor->getPointerPos (ix, iy); - x = (float)ix / (float)width; - y = (float)iy / (float)height; + if (ix != CViewPointer::InvalidCoord && iy != CViewPointer::InvalidCoord) + { + x = (float)ix / (float)width; + y = (float)iy / (float)height; + } } } @@ -301,19 +210,7 @@ void SetMouseCursor (bool updatePos) if (updatePos) { - if (MouseDevice) - { - MouseDevice->setMousePos((float)ix, (float)iy); - } - else - { - Driver->setMousePos(x, y); - } - - if (MouseHardware) - { - Driver->setMousePos(x, y); - } + Driver->setMousePos(x, y); } // Update the interface pointer @@ -402,25 +299,18 @@ CNiceInputAuto::CNiceInputAuto() { if (_Count == 0) { - - Driver->enableLowLevelMouse(false, false); // but ignore direct input (win 32 msg only) - - Driver->setCursor("curs_default.tga", CRGBA::White, 0, 0x15, 0x18); Driver->showCursor(true); // keep cursor visible in windowed mode - MouseDevice = NULL; - Driver->enableLowLevelKeyboard (false); } - ++ _Count; + ++_Count; } CNiceInputAuto::~CNiceInputAuto() { - -- _Count; + --_Count; nlassert(_Count >= 0); if (_Count == 0) { - InitMouseWithCursor (ClientCfg.HardwareCursor); - Driver->enableLowLevelKeyboard (!ClientCfg.DisableDirectInputKeyboard); // the return value has already been tested at startup + InitMouseWithCursor(ClientCfg.HardwareCursor && !StereoDisplayAttached); } } diff --git a/code/ryzom/client/src/interface_v3/action_handler_game.cpp b/code/ryzom/client/src/interface_v3/action_handler_game.cpp index 63d2c93b7..b76bbce21 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_game.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_game.cpp @@ -1950,13 +1950,14 @@ public: womanTitle = pChar->getGender() == GSGENDER::female; STRING_MANAGER::CStringManagerClient::getTitleLocalizedName(CEntityCL::getTitleFromName(copyInout), womanTitle); - + // Sometimes translation contains another title ucstring::size_type pos = copyInout.find('$'); if (pos != ucstring::npos) { copyInout = STRING_MANAGER::CStringManagerClient::getTitleLocalizedName(CEntityCL::getTitleFromName(copyInout), womanTitle); } + CStringPostProcessRemoveTitle::cbIDStringReceived(copyInout); inout = copyInout; } 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 e519bb2d0..ed2b34ce3 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_help.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_help.cpp @@ -1117,6 +1117,11 @@ class CHandlerHTMLSubmitForm : public IActionHandler fromString(getParam (sParams, "form"), form); string submit_button = getParam (sParams, "submit_button"); + string type = getParam (sParams, "submit_button_type"); + string value = getParam (sParams, "submit_button_value"); + + sint32 x = pCaller->getEventX(); + sint32 y = pCaller->getEventY(); CInterfaceElement *element = CWidgetManager::getInstance()->getElementFromId(container); { @@ -1125,7 +1130,7 @@ class CHandlerHTMLSubmitForm : public IActionHandler if (groupHtml) { // Submit the form the url - groupHtml->submitForm (form, submit_button.c_str ()); + groupHtml->submitForm (form, type.c_str(), submit_button.c_str(), value.c_str(), x, y); } } } @@ -3613,7 +3618,7 @@ public: uint8 index; fromString(Params, index); --index; // Param is 1-based so subtract 1 - if ( index >= MAX_INVENTORY_ANIMAL) + if (index >= MAX_INVENTORY_ANIMAL) { return; } diff --git a/code/ryzom/client/src/interface_v3/action_handler_item.cpp b/code/ryzom/client/src/interface_v3/action_handler_item.cpp index 24f59cecc..f6dec2d1f 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_item.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_item.cpp @@ -815,7 +815,6 @@ public: CurrentStackDst= NULL; validateStackItem(pCSSrc, pCSDst, val, CurrentStackMode); } - }; REGISTER_ACTION_HANDLER( CHandlerStackOk, "stack_item"); @@ -826,17 +825,17 @@ class CPlayerTradePutBagItemToExchange : public IActionHandler public: virtual void execute (CCtrlBase *pCaller, const string &/* Params */) { - CInterfaceManager *im = CInterfaceManager::getInstance(); - CDBCtrlSheet *src = dynamic_cast(pCaller); - CDBCtrlSheet *dest = dynamic_cast(CWidgetManager::getInstance()->getCtrlLaunchingModal()); - if (src->getSheetId() == 0) - { - putExchangedItemToInventory(dest); - } - else - { - putInventoryItemToExchange(src, dest); - } + CInterfaceManager *im = CInterfaceManager::getInstance(); + CDBCtrlSheet *src = dynamic_cast(pCaller); + CDBCtrlSheet *dest = dynamic_cast(CWidgetManager::getInstance()->getCtrlLaunchingModal()); + if (src->getSheetId() == 0) + { + putExchangedItemToInventory(dest); + } + else + { + putInventoryItemToExchange(src, dest); + } } }; REGISTER_ACTION_HANDLER(CPlayerTradePutBagItemToExchange, "put_bag_item_to_exchange"); diff --git a/code/ryzom/client/src/interface_v3/action_handler_misc.cpp b/code/ryzom/client/src/interface_v3/action_handler_misc.cpp index 688c27635..4e8966e16 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_misc.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_misc.cpp @@ -520,7 +520,7 @@ CCameraBackup setupCameraForScreenshot(UScene &scene, uint left, uint right, uin // Build a viewport CViewport viewport; NL3D::UDriver *Driver = CViewRenderer::getInstance()->getDriver(); - viewport.init (0, 0, (float)(right-left)/Driver->getWindowWidth(),(float)(bottom-top)/Driver->getWindowHeight()); + viewport.init (0, 0, (float)(right-left)/Driver->getWindowWidth(), (float)(bottom-top)/Driver->getWindowHeight()); // Activate all this scene.getCam().setFrustum (frustumPart); 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 efd19fe45..67f798cb8 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.empty()) && (CHandlerPhraseMemoryCopy::haveLastPhraseElement)) + if (src.empty() && (CHandlerPhraseMemoryCopy::haveLastPhraseElement)) { // get the slot ids from save srcIsMacro= CHandlerPhraseMemoryCopy::isMacro; @@ -1600,7 +1600,6 @@ public: } } }; - REGISTER_ACTION_HANDLER(CHandlerPhraseSelectMemory2, "phrase_select_memory_2"); // *************************************************************************** diff --git a/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp b/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp index 81ae893bc..a1506bd8b 100644 --- a/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp +++ b/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp @@ -1688,29 +1688,30 @@ void CActionPhraseFaber::updateItemResult() craftSuccessModifier = nodeCSM->getValue32(); } // With the faber plan skill - sint success= pPM->getCraftPhraseSuccessRate(pPM->getPhrase(phraseSlot), _ExecuteFromItemPlanBrick->getSkill(), minLevel); + sint success= pPM->getCraftPhraseSuccessRate(pPM->getPhrase(phraseSlot), _ExecuteFromItemPlanBrick->getSkill(), minLevel, 0); + sint bonus = pPM->getCraftPhraseSuccessRate(pPM->getPhrase(phraseSlot), _ExecuteFromItemPlanBrick->getSkill(), minLevel, (sint) craftSuccessModifier) - success; string successStr; - if( craftSuccessModifier == 0 ) + if( bonus == 0 ) { successStr = toString("@{FFFF}") + toString(success); } else - if( craftSuccessModifier > 0 ) // bonus + if( bonus > 0 ) // bonus { - successStr = "@{0F0F}" + toString(success+craftSuccessModifier) + successStr = "@{0F0F}" + toString(success + bonus) + "@{FFFF}(" + toString( success ) + "@{0F0F} + " - + toString( craftSuccessModifier ) + + toString( bonus ) + "@{FFFF})"; } else { - successStr = "@{E42F}" + toString(success+craftSuccessModifier) + successStr = "@{E42F}" + toString(success + bonus) + "@{FFFF}(" + toString( success ) + "@{E42F} - " - + toString( craftSuccessModifier ) + + toString( abs(bonus) ) + "@{FFFF})"; } strFindReplace(text, "%success", successStr ); diff --git a/code/ryzom/client/src/interface_v3/bot_chat_page_mission.cpp b/code/ryzom/client/src/interface_v3/bot_chat_page_mission.cpp index bb16353f5..caa90cdda 100644 --- a/code/ryzom/client/src/interface_v3/bot_chat_page_mission.cpp +++ b/code/ryzom/client/src/interface_v3/bot_chat_page_mission.cpp @@ -53,7 +53,6 @@ void CBotChatPageMission::init() NLGUI::CDBManager::getInstance()->addBranchObserver("SERVER:CHOOSE_MISSIONS", &_MissionPagesObs); } - // *************************************************************************************** void CBotChatPageMission::begin() { diff --git a/code/ryzom/client/src/interface_v3/bot_chat_page_trade.cpp b/code/ryzom/client/src/interface_v3/bot_chat_page_trade.cpp index 17aaead48..966a3886a 100644 --- a/code/ryzom/client/src/interface_v3/bot_chat_page_trade.cpp +++ b/code/ryzom/client/src/interface_v3/bot_chat_page_trade.cpp @@ -1808,7 +1808,6 @@ void CBotChatPageTrade::giveFocusToMaxEBChangeBuyFilterDialog() setFocusOnEditBox(ig->getGroup("edit_max:eb")); } - // *************************************************************************** void CBotChatPageTrade::startChangeBuyFilterMPDialog() { @@ -1822,7 +1821,6 @@ void CBotChatPageTrade::startChangeBuyFilterMPDialog() CWidgetManager::getInstance()->enableModalWindow(NULL, ig); } - // *************************************************************************** void CBotChatPageTrade::confirmChangeBuyFilterMPDialog(uint ft) { @@ -1840,7 +1838,6 @@ void CBotChatPageTrade::confirmChangeBuyFilterMPDialog(uint ft) CWidgetManager::getInstance()->disableModalWindow(); } - // *************************************************************************** void CBotChatPageTrade::resetItemPartAndTypeFilters() { diff --git a/code/ryzom/client/src/interface_v3/character_3d.cpp b/code/ryzom/client/src/interface_v3/character_3d.cpp index c76407f11..f711fb764 100644 --- a/code/ryzom/client/src/interface_v3/character_3d.cpp +++ b/code/ryzom/client/src/interface_v3/character_3d.cpp @@ -797,7 +797,7 @@ void CCharacter3D::setup (const SCharacter3DSetup &c3ds) } // Instance skin color - if (c3ds.People != -1) + if (c3ds.People != EGSPD::CPeople::Undefined) if ((c3ds.People != _CurrentSetup.People) || bInstanceRebuilt || bQualityRebuilt) { if (!_Instances[i].empty()) diff --git a/code/ryzom/client/src/interface_v3/chat_displayer.h b/code/ryzom/client/src/interface_v3/chat_displayer.h index e84179f94..e2afc7207 100644 --- a/code/ryzom/client/src/interface_v3/chat_displayer.h +++ b/code/ryzom/client/src/interface_v3/chat_displayer.h @@ -30,7 +30,6 @@ #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_text_manager.cpp b/code/ryzom/client/src/interface_v3/chat_text_manager.cpp index 10fd2d29c..83ef7474e 100644 --- a/code/ryzom/client/src/interface_v3/chat_text_manager.cpp +++ b/code/ryzom/client/src/interface_v3/chat_text_manager.cpp @@ -47,7 +47,6 @@ CChatTextManager::~CChatTextManager() _TextShadowed = NULL; delete _ShowTimestamps; _ShowTimestamps = NULL; - } //================================================================================= uint CChatTextManager::getTextFontSize() const @@ -96,6 +95,7 @@ bool CChatTextManager::showTimestamps() const } return _ShowTimestamps->getValueBool(); } + //================================================================================= static CInterfaceGroup *parseCommandTag(ucstring &line) { @@ -157,6 +157,7 @@ CViewBase *CChatTextManager::createMsgText(const ucstring &cstMsg, NLMISC::CRGBA CViewText *vt = new CViewText(CViewText::TCtorParam()); // get parameters from config.xml vt->setShadow(isTextShadowed()); + vt->setShadowOutline(false); vt->setFontSize(getTextFontSize()); vt->setMultiLine(true); vt->setTextMode(justified ? CViewText::Justified : CViewText::DontClipWord); @@ -185,7 +186,6 @@ CViewBase *CChatTextManager::createMsgText(const ucstring &cstMsg, NLMISC::CRGBA msg = cur_time + msg; } - vt->setTextFormatTaged(msg); vt->setColor(NLMISC::CRGBA::White); } diff --git a/code/ryzom/client/src/interface_v3/chat_window.cpp b/code/ryzom/client/src/interface_v3/chat_window.cpp index e74392432..0bb192fc5 100644 --- a/code/ryzom/client/src/interface_v3/chat_window.cpp +++ b/code/ryzom/client/src/interface_v3/chat_window.cpp @@ -483,7 +483,7 @@ void CChatWindow::displayLocalPlayerTell(const ucstring &receiver, const ucstrin strFindReplace(s, "%name", receiver); strFindReplace(finalMsg, CI18N::get("youTell"), s); displayMessage(finalMsg, prop.getRGBA(), CChatGroup::tell, 0, numBlinks); - CInterfaceManager::getInstance()->log(finalMsg); + CInterfaceManager::getInstance()->log(finalMsg, CChatGroup::groupTypeToString(CChatGroup::tell)); } void CChatWindow::encodeColorTag(const NLMISC::CRGBA &color, ucstring &text, bool append) @@ -601,10 +601,14 @@ void CChatGroupWindow::displayMessage(const ucstring &msg, NLMISC::CRGBA col, CC if (pos == ucstring::npos || (colonpos < pos)) { // No timestamp, so put it right after the color and add a space - pos = newmsg.find(ucstring("}"));; + pos = newmsg.find(ucstring("}")); prefix += " "; } - newmsg = newmsg.substr(0, pos + 1) + prefix + newmsg.substr(pos + 1); + + if (pos == ucstring::npos) + newmsg = prefix + newmsg; + else + newmsg = newmsg.substr(0, pos + 1) + prefix + newmsg.substr(pos + 1); // Add dynchannel number and optionally name before text if user channel CCDBNodeLeaf* node = NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_DYN_CHANNEL_NAME_IN_CHAT_CB", false); @@ -615,7 +619,11 @@ void CChatGroupWindow::displayMessage(const ucstring &msg, NLMISC::CRGBA col, CC STRING_MANAGER::CStringManagerClient::instance()->getDynString(textId, title); prefix = title.empty() ? ucstring("") : ucstring(" ") + title; pos = newmsg.find(ucstring("] ")); - newmsg = newmsg.substr(0, pos) + prefix + newmsg.substr(pos); + + if (pos == ucstring::npos) + newmsg = prefix + newmsg; + else + newmsg = newmsg.substr(0, pos) + prefix + newmsg.substr(pos); } } break; diff --git a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp index 293582f52..68ceb7bf0 100644 --- a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp +++ b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp @@ -333,29 +333,29 @@ bool CCtrlSheetInfo::parseCtrlInfo(xmlNodePtr cur, CInterfaceGroup * /* parentGr prop = (char*) xmlGetProp( cur, (xmlChar*)"nature" ); if (prop) { - if (NLMISC::strlwr(prop) == "item") + if (NLMISC::strlwr(prop.str()) == "item") _Type = CCtrlSheetInfo::SheetType_Item; - else if (NLMISC::strlwr(prop) == "pact") + else if (NLMISC::strlwr(prop.str()) == "pact") _Type = CCtrlSheetInfo::SheetType_Pact; - else if (NLMISC::strlwr(prop) == "skill") + else if (NLMISC::strlwr(prop.str()) == "skill") _Type = CCtrlSheetInfo::SheetType_Skill; - else if (NLMISC::strlwr(prop) == "auto") + else if (NLMISC::strlwr(prop.str()) == "auto") _Type = CCtrlSheetInfo::SheetType_Auto; - else if (NLMISC::strlwr(prop) == "macro") + else if (NLMISC::strlwr(prop.str()) == "macro") _Type = CCtrlSheetInfo::SheetType_Macro; - else if (NLMISC::strlwr(prop) == "guild_flag") + else if (NLMISC::strlwr(prop.str()) == "guild_flag") _Type = CCtrlSheetInfo::SheetType_GuildFlag; - else if (NLMISC::strlwr(prop) == "mission") + else if (NLMISC::strlwr(prop.str()) == "mission") _Type = CCtrlSheetInfo::SheetType_Mission; - else if (NLMISC::strlwr(prop) == "sbrick") + else if (NLMISC::strlwr(prop.str()) == "sbrick") _Type = CCtrlSheetInfo::SheetType_SBrick; - else if (NLMISC::strlwr(prop) == "sphraseid") + else if (NLMISC::strlwr(prop.str()) == "sphraseid") _Type = CCtrlSheetInfo::SheetType_SPhraseId; - else if (NLMISC::strlwr(prop) == "sphrase") + else if (NLMISC::strlwr(prop.str()) == "sphrase") _Type = CCtrlSheetInfo::SheetType_SPhrase; - else if (NLMISC::strlwr(prop) == "elevator_destination") + else if (NLMISC::strlwr(prop.str()) == "elevator_destination") _Type = CCtrlSheetInfo::SheetType_ElevatorDestination; - else if (NLMISC::strlwr(prop) == "outpost_building") + else if (NLMISC::strlwr(prop.str()) == "outpost_building") _Type = CCtrlSheetInfo::SheetType_OutpostBuilding; } @@ -456,7 +456,7 @@ bool CCtrlSheetInfo::parseCtrlInfo(xmlNodePtr cur, CInterfaceGroup * /* parentGr else { // must not have so much brick type, else must change code! - nlassert(brickType<32); + // nlassert(brickType<32); // Ok set the bit associated _BrickTypeBitField|= 1<getDbBranch(prop); + CCDBNodeBranch *branch = NLGUI::CDBManager::getInstance()->getDbBranch(prop.str()); if(!branch) { nlinfo ("Branch not found in the database %s", (const char*)prop); diff --git a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.cpp b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.cpp index a05d1e4aa..2294d3926 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.cpp +++ b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.cpp @@ -98,7 +98,7 @@ bool CDBGroupListSheetText::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup) if (prop) { // get a branch in the database. - CCDBNodeBranch *branch= NLGUI::CDBManager::getInstance()->getDbBranch(prop); + CCDBNodeBranch *branch = NLGUI::CDBManager::getInstance()->getDbBranch(prop.str()); if(!branch) { nlinfo ("Branch not found in the database %s", (const char*)prop); @@ -880,6 +880,7 @@ void CDBGroupListSheetText::setup() text->setFontSize(_TextTemplate.getFontSize()); text->setColor(_TextTemplate.getColor()); text->setShadow(_TextTemplate.getShadow()); + text->setShadowOutline(_TextTemplate.getShadowOutline()); text->setLineMaxW(_TextTemplate.getLineMaxW()); text->setMultiLine(_TextTemplate.getMultiLine()); if(text->getMultiLine()) diff --git a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text_brick_composition.cpp b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text_brick_composition.cpp index 67079ba55..c67e69660 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text_brick_composition.cpp +++ b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text_brick_composition.cpp @@ -95,6 +95,7 @@ void CDBGroupListSheetTextBrickComposition::CSheetChildBrick::init(CDBGroupListS text->setFontSize(compoList->getTextTemplate().getFontSize()); text->setColor(compoList->getTextTemplate().getColor()); text->setShadow(compoList->getTextTemplate().getShadow()); + text->setShadowOutline(compoList->getTextTemplate().getShadowOutline()); text->setMultiLine(false); text->setModulateGlobalColor(compoList->getTextTemplate().getModulateGlobalColor()); diff --git a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text_share.cpp b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text_share.cpp index 35cd90a7e..112ec3e9e 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text_share.cpp +++ b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text_share.cpp @@ -121,6 +121,7 @@ void CDBGroupListSheetTextShare::CSheetChildShare::init(CDBGroupListSheetText *p text->setFontSize(compoList->getTextTemplate().getFontSize()); text->setColor(compoList->getTextTemplate().getColor()); text->setShadow(compoList->getTextTemplate().getShadow()); + text->setShadowOutline(compoList->getTextTemplate().getShadowOutline()); text->setMultiLine(false); text->setModulateGlobalColor(compoList->getTextTemplate().getModulateGlobalColor()); // Add it to the scrolled list. @@ -139,6 +140,7 @@ void CDBGroupListSheetTextShare::CSheetChildShare::init(CDBGroupListSheetText *p text->setFontSize(compoList->getTextTemplate().getFontSize()); text->setColor(compoList->getTextTemplate().getColor()); text->setShadow(compoList->getTextTemplate().getShadow()); + text->setShadowOutline(compoList->getTextTemplate().getShadowOutline()); text->setMultiLine(false); text->setModulateGlobalColor(compoList->getTextTemplate().getModulateGlobalColor()); // Add it to the scrolled list. @@ -173,7 +175,6 @@ void CDBGroupListSheetTextShare::CSheetChildShare::init(CDBGroupListSheetText *p pNL = NLGUI::CDBManager::getInstance()->getDbProp(sTmp, false); nlassert(pNL != NULL); CurrentWanted.link ( sTmp.c_str() ); - } diff --git a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_trade.cpp b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_trade.cpp index 0028ad964..d4fc5da86 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_trade.cpp +++ b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_trade.cpp @@ -728,7 +728,6 @@ void CDBGroupListSheetTrade::sort() } } - bool CDBGroupListSheetTrade::needCheckAllItems() { if (_LastFamePriceFactor != _FamePriceFactorLeaf->getValue16()) diff --git a/code/ryzom/client/src/interface_v3/group_html_webig.cpp b/code/ryzom/client/src/interface_v3/group_html_webig.cpp index 8ffa25878..680a26273 100644 --- a/code/ryzom/client/src/interface_v3/group_html_webig.cpp +++ b/code/ryzom/client/src/interface_v3/group_html_webig.cpp @@ -22,6 +22,7 @@ #include "../user_entity.h" #include "../entities.h" #include "interface_manager.h" +#include "user_agent.h" // used for login cookie to be sent to the web server #include "../net_manager.h" @@ -157,7 +158,7 @@ struct CWebigNotificationThread : public NLMISC::IRunnable if(!Curl) return; curl_easy_setopt(Curl, CURLOPT_COOKIEFILE, ""); curl_easy_setopt(Curl, CURLOPT_NOPROGRESS, 1); - curl_easy_setopt(Curl, CURLOPT_USERAGENT, "Ryzom"); + curl_easy_setopt(Curl, CURLOPT_USERAGENT, getUserAgent().c_str()); curl_easy_setopt(Curl, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt(Curl, CURLOPT_WRITEFUNCTION, writeDataFromCurl); //nlinfo("ctor CWebigNotificationThread"); 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 76d97c519..53cddc93b 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 @@ -198,7 +198,7 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (CEntityCL *entity) ucstring theTribeName; 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()) @@ -652,7 +652,6 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (CEntityCL *entity) if (pPlayer == NULL) needPvPLogo = false; - if (pPlayer != NULL && needPvPLogo) { if (pvpFactionLogo) @@ -756,7 +755,6 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (CEntityCL *entity) view = leftGroup->getView ("win_jauge_bot"); if (view) leftGroup->delView (view); - } // Delete remaining strings @@ -771,8 +769,7 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (CEntityCL *entity) CViewBase *win_mid = leftGroup->getView ("win_mid"); if (win_mid) { - win_mid->setH (win_mid->getH() - spaceBar/2 ); - + win_mid->setH (win_mid->getH() - spaceBar/2); } // Set player name @@ -963,7 +960,7 @@ void CGroupInSceneUserInfo::updateDynamicData () if (pPlayer != NULL) if (pPlayer->isAFK()) - entityName += CI18N::get("uiAFK"); + entityName += CI18N::get("uiAFK"); _Name->setText(entityName); // Title color get the PVP color diff --git a/code/ryzom/client/src/interface_v3/group_map.cpp b/code/ryzom/client/src/interface_v3/group_map.cpp index 31d70d0d7..667e900c4 100644 --- a/code/ryzom/client/src/interface_v3/group_map.cpp +++ b/code/ryzom/client/src/interface_v3/group_map.cpp @@ -556,7 +556,7 @@ bool CGroupMap::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup) ptr = (char*) xmlGetProp( cur, (xmlChar*)"map_mode" ); if (ptr) { - string sTmp = ptr; + string sTmp = ptr.str(); if (sTmp == "normal") _MapMode = MapMode_Normal; else if (sTmp == "death") @@ -2333,6 +2333,7 @@ void CGroupMap::createLMWidgets(const std::vector &lms) pNewText->setColor(CRGBA(255,255,255,255)); pNewText->setShadow(true); + pNewText->setShadowOutline(false); pNewText->setShadowColor(CRGBA(0,0,0,255)); pNewText->setModulateGlobalColor(false); pNewText->Type = rCLM.Type; @@ -3212,7 +3213,7 @@ class CAHValidateUserLandMarkName : public IActionHandler CGroupEditBox *eb = dynamic_cast(ig->getGroup("eb")); if (!eb) return; ig->setActive(false); - + CGroupContainer *gc = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(WIN_LANDMARK_NAME)); if (!gc) return; // Retrieve ComboBox to get the position(ordered landmark type) of the selected item diff --git a/code/ryzom/client/src/interface_v3/group_skills.cpp b/code/ryzom/client/src/interface_v3/group_skills.cpp index e414ab4e4..b5e5c5d34 100644 --- a/code/ryzom/client/src/interface_v3/group_skills.cpp +++ b/code/ryzom/client/src/interface_v3/group_skills.cpp @@ -87,7 +87,7 @@ bool CGroupSkills::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup) string sTmp; ICDBNode::CTextId textId; - + for (uint k = 0; k < SKILLS::NUM_SKILLS; ++k) { sTmp = string(DB_SKILLS)+":"+NLMISC::toString((sint32)k)+":BaseSKILL"; diff --git a/code/ryzom/client/src/interface_v3/guild_manager.cpp b/code/ryzom/client/src/interface_v3/guild_manager.cpp index 9edf86c56..2e0e4e3e7 100644 --- a/code/ryzom/client/src/interface_v3/guild_manager.cpp +++ b/code/ryzom/client/src/interface_v3/guild_manager.cpp @@ -378,13 +378,13 @@ void CGuildManager::update() // 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); @@ -398,7 +398,6 @@ void CGuildManager::update() bool dummy; PeopleInterraction.ChatInput.Guild.displayMessage(msg, col, 2, &dummy); break; - } } diff --git a/code/ryzom/client/src/interface_v3/input_handler_manager.cpp b/code/ryzom/client/src/interface_v3/input_handler_manager.cpp index 62eac876c..48582652a 100644 --- a/code/ryzom/client/src/interface_v3/input_handler_manager.cpp +++ b/code/ryzom/client/src/interface_v3/input_handler_manager.cpp @@ -20,7 +20,6 @@ #include "nel/misc/i_xml.h" #include "nel/misc/file.h" -#include "nel/misc/game_device_events.h" #include "nel/misc/xml_auto_ptr.h" @@ -92,7 +91,6 @@ void CInputHandlerManager::addToServer(NLMISC::CEventServer * server) _EventServer = server; // System - server->addListener(EventGDMouseMove, this); server->addListener(EventDestroyWindowId, this); server->addListener(EventCloseWindowId, this); server->addListener(EventSetFocusId, this); @@ -117,7 +115,6 @@ void CInputHandlerManager::addToServer(NLMISC::CEventServer * server) void CInputHandlerManager::release() { // System - _EventServer->removeListener(EventGDMouseMove, this); _EventServer->removeListener(EventDestroyWindowId, this); _EventServer->removeListener(EventCloseWindowId, this); _EventServer->removeListener(EventSetFocusId, this); @@ -304,7 +301,7 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event) handled |= R2::getEditor().handleEvent(eventDesc); } } - handled |= inputHandler.handleMouseButtonDownEvent( event ); + handled |= inputHandler.handleMouseButtonDownEvent( event ); } // button up ? else if (event==EventMouseUpId) diff --git a/code/ryzom/client/src/interface_v3/input_handler_manager.h b/code/ryzom/client/src/interface_v3/input_handler_manager.h index c29d0155d..bafe0f640 100644 --- a/code/ryzom/client/src/interface_v3/input_handler_manager.h +++ b/code/ryzom/client/src/interface_v3/input_handler_manager.h @@ -44,7 +44,7 @@ class CInputHandlerManager : public NLMISC::IEventListener, public CGroupEditBox::IComboKeyHandler { public: - /// The EventServer Filled with Filtered Messages the InterfaceManager didn't cactch + /// The EventServer Filled with Filtered Messages the InterfaceManager didn't catch NLMISC::CEventServer FilteredEventServer; public: diff --git a/code/ryzom/client/src/interface_v3/interface_3d_scene.cpp b/code/ryzom/client/src/interface_v3/interface_3d_scene.cpp index 0d51a538e..6acc2a17b 100644 --- a/code/ryzom/client/src/interface_v3/interface_3d_scene.cpp +++ b/code/ryzom/client/src/interface_v3/interface_3d_scene.cpp @@ -162,13 +162,13 @@ bool CInterface3DScene::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup) _Ref3DScene = NULL; if (ptr) { - CInterfaceElement *pIE = CWidgetManager::getInstance()->getElementFromId(this->getId(), ptr); + CInterfaceElement *pIE = CWidgetManager::getInstance()->getElementFromId(this->getId(), ptr.str()); _Ref3DScene = dynamic_cast(pIE); } if (_Ref3DScene != NULL) { ptr = (char*) xmlGetProp( cur, (xmlChar*)"curcam" ); - if (ptr) setCurrentCamera (ptr); + if (ptr) setCurrentCamera (ptr.str()); return true; } @@ -294,7 +294,7 @@ bool CInterface3DScene::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup) CXMLAutoPtr ptr((const char*)xmlGetProp (cur, (xmlChar*)"name")); string animName; if (ptr) - animName = strlwr (CFile::getFilenameWithoutExtension(ptr)); + animName = strlwr (CFile::getFilenameWithoutExtension(ptr.str())); if (!animName.empty()) { @@ -340,7 +340,7 @@ bool CInterface3DScene::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup) // Get the current camera ptr = (char*) xmlGetProp( cur, (xmlChar*)"curcam" ); - if (ptr) setCurrentCamera (ptr); + if (ptr) setCurrentCamera(ptr.str()); return true; } diff --git a/code/ryzom/client/src/interface_v3/interface_manager.cpp b/code/ryzom/client/src/interface_v3/interface_manager.cpp index b89566ecd..70be8abe4 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.cpp +++ b/code/ryzom/client/src/interface_v3/interface_manager.cpp @@ -467,8 +467,8 @@ CInterfaceManager::CInterfaceManager() CGroupHTML::options.trustedDomains = ClientCfg.WebIgTrustedDomains; CGroupHTML::options.languageCode = ClientCfg.getHtmlLanguageCode(); - CGroupHTML::options.appName = "Ryzom"; - CGroupHTML::options.appVersion = getUserAgent(); + CGroupHTML::options.appName = getUserAgentName(); + CGroupHTML::options.appVersion = getUserAgentVersion(); NLGUI::CDBManager::getInstance()->resizeBanks( NB_CDB_BANKS ); interfaceLinkUpdater = new CInterfaceLink::CInterfaceLinkUpdater(); @@ -2684,7 +2684,7 @@ bool CInterfaceManager::deletePlayerKeys (const std::string &playerFileIdent) } // *************************************************************************** -void CInterfaceManager::log(const ucstring &str) +void CInterfaceManager::log(const ucstring &str, const std::string &cat) { if (_LogState) { @@ -2693,7 +2693,7 @@ void CInterfaceManager::log(const ucstring &str) FILE *f = fopen(fileName.c_str(), "at"); if (f != NULL) { - const string finalString = string(NLMISC::IDisplayer::dateToHumanString()) + " * " + str.toUtf8(); + const string finalString = string(NLMISC::IDisplayer::dateToHumanString()) + " (" + NLMISC::toUpper(cat) + ") * " + str.toUtf8(); fprintf(f, "%s\n", finalString.c_str()); } fclose(f); @@ -2925,7 +2925,7 @@ void CInterfaceManager::initEmotes() CSkillManager *pSM = CSkillManager::getInstance(); betaTester = pSM->isTitleUnblocked(CHARACTER_TITLE::FBT); - string previousMind = ""; + string previousMind; CGroupSubMenu *pFirstMenu = 0; for (list::const_iterator it = entries.begin(); it != entries.end(); it++) @@ -3982,5 +3982,3 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr) ucstr = str; return true;; } - - diff --git a/code/ryzom/client/src/interface_v3/interface_manager.h b/code/ryzom/client/src/interface_v3/interface_manager.h index 36bd909e3..d947f4912 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.h +++ b/code/ryzom/client/src/interface_v3/interface_manager.h @@ -218,7 +218,7 @@ public: // Log system (all chat/tell void setLogState(bool state) { _LogState = state; } bool getLogState() const { return _LogState; } - void log(const ucstring &str); + void log(const ucstring &str, const std::string &cat = ""); /// Text from here and from server diff --git a/code/ryzom/client/src/interface_v3/interface_observer.h b/code/ryzom/client/src/interface_v3/interface_observer.h index 4261f10a4..6da93637e 100644 --- a/code/ryzom/client/src/interface_v3/interface_observer.h +++ b/code/ryzom/client/src/interface_v3/interface_observer.h @@ -119,7 +119,7 @@ public: char * end = ptr.getDatas() + strlen( ptr.getDatas() ); char * dataTok = strtok( ptr.getDatas()," ,"); NLMISC::ICDBNode::CTextId textId; - + while(dataTok) { std::string data (dataTok); diff --git a/code/ryzom/client/src/interface_v3/inventory_manager.cpp b/code/ryzom/client/src/interface_v3/inventory_manager.cpp index 5e7d66075..7a56e470e 100644 --- a/code/ryzom/client/src/interface_v3/inventory_manager.cpp +++ b/code/ryzom/client/src/interface_v3/inventory_manager.cpp @@ -1981,7 +1981,7 @@ bool SBagOptions::parse(xmlNodePtr cur, CInterfaceGroup * /* parentGroup */) prop = xmlGetProp (cur, (xmlChar*)"inv_type"); if (prop) { - InvType = CInventoryManager::invTypeFromString(prop); + InvType = CInventoryManager::invTypeFromString(prop.str()); } else { @@ -1990,22 +1990,22 @@ bool SBagOptions::parse(xmlNodePtr cur, CInterfaceGroup * /* parentGroup */) } prop = xmlGetProp (cur, (xmlChar*)"filter_armor"); - if (prop) DbFilterArmor = NLGUI::CDBManager::getInstance()->getDbProp(prop); + if (prop) DbFilterArmor = NLGUI::CDBManager::getInstance()->getDbProp(prop.str()); prop = xmlGetProp (cur, (xmlChar*)"filter_weapon"); - if (prop) DbFilterWeapon = NLGUI::CDBManager::getInstance()->getDbProp(prop); + if (prop) DbFilterWeapon = NLGUI::CDBManager::getInstance()->getDbProp(prop.str()); prop = xmlGetProp (cur, (xmlChar*)"filter_tool"); - if (prop) DbFilterTool = NLGUI::CDBManager::getInstance()->getDbProp(prop); + if (prop) DbFilterTool = NLGUI::CDBManager::getInstance()->getDbProp(prop.str()); prop = xmlGetProp (cur, (xmlChar*)"filter_mp"); - if (prop) DbFilterMP = NLGUI::CDBManager::getInstance()->getDbProp(prop); + if (prop) DbFilterMP = NLGUI::CDBManager::getInstance()->getDbProp(prop.str()); prop = xmlGetProp (cur, (xmlChar*)"filter_missmp"); - if (prop) DbFilterMissMP = NLGUI::CDBManager::getInstance()->getDbProp(prop); + if (prop) DbFilterMissMP = NLGUI::CDBManager::getInstance()->getDbProp(prop.str()); prop = xmlGetProp (cur, (xmlChar*)"filter_tp"); - if (prop) DbFilterTP = NLGUI::CDBManager::getInstance()->getDbProp(prop); + if (prop) DbFilterTP = NLGUI::CDBManager::getInstance()->getDbProp(prop.str()); return true; } diff --git a/code/ryzom/client/src/interface_v3/parser_modules.cpp b/code/ryzom/client/src/interface_v3/parser_modules.cpp index ff1c93645..b540900a4 100644 --- a/code/ryzom/client/src/interface_v3/parser_modules.cpp +++ b/code/ryzom/client/src/interface_v3/parser_modules.cpp @@ -353,7 +353,7 @@ bool CCommandParser::parse( xmlNodePtr cur, NLGUI::CInterfaceGroup *parentGroup if (ptrName) { // Does the action exist ? - std::string name = ptrName; + std::string name = ptrName.str(); if (!ICommand::exists (name) || (CUserCommand::CommandMap.find(name) != CUserCommand::CommandMap.end())) { // Get the action @@ -369,7 +369,7 @@ bool CCommandParser::parse( xmlNodePtr cur, NLGUI::CInterfaceGroup *parentGroup // if prop "ctrlchar" is declared with false, then disable ctrlchar for this command CXMLAutoPtr prop((const char*) xmlGetProp( cur, (xmlChar*)"ctrlchar" )); if( (const char*)prop && (CInterfaceElement::convertBool((const char*)prop)==false) ) - ICommand::enableControlCharForCommand(ptrName, false); + ICommand::enableControlCharForCommand(ptrName.str(), false); // Done ret = true; diff --git a/code/ryzom/client/src/interface_v3/people_interraction.cpp b/code/ryzom/client/src/interface_v3/people_interraction.cpp index 332bcac57..c2eb972dd 100644 --- a/code/ryzom/client/src/interface_v3/people_interraction.cpp +++ b/code/ryzom/client/src/interface_v3/people_interraction.cpp @@ -2193,7 +2193,6 @@ class CHandlerTellContact : public IActionHandler CInterfaceGroup *ig = pCaller->getParent(); if (!ig) return; CGroupContainer *gc = static_cast< CGroupContainer* >( ig->getEnclosingContainer() ); - if (!gc) return; CPeopleList *list; uint peopleIndex; diff --git a/code/ryzom/client/src/interface_v3/people_list.cpp b/code/ryzom/client/src/interface_v3/people_list.cpp index a2ee04808..c2167358f 100644 --- a/code/ryzom/client/src/interface_v3/people_list.cpp +++ b/code/ryzom/client/src/interface_v3/people_list.cpp @@ -478,7 +478,7 @@ void CPeopleList::displayLocalPlayerTell(const ucstring &receiver, uint index, c strFindReplace(s, "%name", receiver); strFindReplace(finalMsg, CI18N::get("youTell"), s); gl->addChild(getChatTextMngr().createMsgText(finalMsg, prop.getRGBA())); - CInterfaceManager::getInstance()->log(finalMsg); + CInterfaceManager::getInstance()->log(finalMsg, CChatGroup::groupTypeToString(CChatGroup::tell)); // if the group is closed, make it blink if (!gc->isOpen()) @@ -895,7 +895,7 @@ class CHandlerContactEntry : public IActionHandler // it is simpler to keep it as it and to just use this action handler to manage user input. if (!pCaller || !pCaller->getParent()) return; CGroupContainer *gc = static_cast< CGroupContainer* >( pCaller->getParent()->getEnclosingContainer() ); - + // title gives the name of the player ucstring playerName = gc->getUCTitle(); @@ -946,7 +946,7 @@ class CHandlerContactEntry : public IActionHandler ucstring s = CI18N::get("youTellPlayer"); strFindReplace(s, "%name", pWin->getFreeTellerName(str)); strFindReplace(final, CI18N::get("youTell"), s); - CInterfaceManager::getInstance()->log(final); + CInterfaceManager::getInstance()->log(final, CChatGroup::groupTypeToString(CChatGroup::tell)); } } } diff --git a/code/ryzom/client/src/interface_v3/skill_manager.cpp b/code/ryzom/client/src/interface_v3/skill_manager.cpp index e71225cc2..d8656d925 100644 --- a/code/ryzom/client/src/interface_v3/skill_manager.cpp +++ b/code/ryzom/client/src/interface_v3/skill_manager.cpp @@ -159,10 +159,8 @@ void CSkillManager::initInGame() _TrackSkillChange= NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:TRACK_SKILL_CHANGE", true); // Add a branch observer on skill value change NLGUI::CDBManager::getInstance()->addBranchObserver( "SERVER:CHARACTER_INFO:SKILLS", &_SkillChangeObs ); - } - // *************************************************************************** void CSkillManager::uninitInGame() { diff --git a/code/ryzom/client/src/interface_v3/sphrase_manager.cpp b/code/ryzom/client/src/interface_v3/sphrase_manager.cpp index 7ef59dc1c..d214d1150 100644 --- a/code/ryzom/client/src/interface_v3/sphrase_manager.cpp +++ b/code/ryzom/client/src/interface_v3/sphrase_manager.cpp @@ -474,16 +474,16 @@ void CSPhraseManager::memorizePhrase(uint32 memoryLine, uint32 memorySlot, ui } } -void CSPhraseManager::selectMemoryLineDBalt(sint32 memoryLine) +// *************************************************************************** +void CSPhraseManager::selectMemoryLineDB(sint32 memoryLine) { if(memoryLine<0) memoryLine= -1; - - if(_SelectedMemoryDBalt!=memoryLine) + + if(_SelectedMemoryDB!=memoryLine) { - _SelectedMemoryDBalt= memoryLine; + _SelectedMemoryDB= memoryLine; // since memory selection changes then must update all the DB and the Ctrl states - updateMemoryDBAll(); updateAllMemoryCtrlState(); updateAllMemoryCtrlRegenTickRange(); @@ -492,14 +492,14 @@ void CSPhraseManager::selectMemoryLineDBalt(sint32 memoryLine) } } -// *************************************************************************** -void CSPhraseManager::selectMemoryLineDB(sint32 memoryLine) +void CSPhraseManager::selectMemoryLineDBalt(sint32 memoryLine) { if(memoryLine<0) memoryLine= -1; - if(_SelectedMemoryDB!=memoryLine) + + if(_SelectedMemoryDBalt!=memoryLine) { - _SelectedMemoryDB= memoryLine; + _SelectedMemoryDBalt= memoryLine; // since memory selection changes then must update all the DB and the Ctrl states updateMemoryDBAll(); updateAllMemoryCtrlState(); @@ -573,7 +573,7 @@ void CSPhraseManager::updateMemoryDBSlot(uint32 memorySlot) _MemoryDbLeaves[memorySlot]->setValue32(0); else _MemoryDbLeaves[memorySlot]->setValue32(slot.Id); - + CMemorySlot &slotAlt= _Memories[_SelectedMemoryDBalt].Slot[memorySlot]; if(!slotAlt.isPhrase()) @@ -1126,7 +1126,7 @@ void CSPhraseManager::buildPhraseDesc(ucstring &text, const CSPhraseCom &phrase, uint32 totalActionMalus= 0; CCDBNodeLeaf *actMalus = _TotalMalusEquipLeaf ? &*_TotalMalusEquipLeaf : &*(_TotalMalusEquipLeaf = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:TOTAL_MALUS_EQUIP", false)); - + // root brick must not be Power or aura, because Action malus don't apply to them // (ie leave 0 ActionMalus for Aura or Powers if(actMalus && !rootBrick->isSpecialPower()) @@ -1428,7 +1428,7 @@ sint CSPhraseManager::getPhraseSuccessRate(const CSPhraseCom &phrase) } // *************************************************************************** -sint CSPhraseManager::getCraftPhraseSuccessRate(const CSPhraseCom &phrase, SKILLS::ESkills skill, uint minMpLevel) +sint CSPhraseManager::getCraftPhraseSuccessRate(const CSPhraseCom &phrase, SKILLS::ESkills skill, uint minMpLevel, sint successModifier) { CSkillManager *pSM= CSkillManager::getInstance(); @@ -1438,6 +1438,9 @@ sint CSPhraseManager::getCraftPhraseSuccessRate(const CSPhraseCom &phrase, SK // take skill value of the skill sint skillValue= pSM->getBestSkillValue(skill); + // apply success rate modifier from server + skillValue += successModifier; + // return the sr according to this skill return getPhraseSuccessRate(STCraft, phrase, skillValue, minMpLevel); } @@ -4516,7 +4519,7 @@ uint32 CSPhraseManager::getTotalActionMalus(const CSPhraseCom &phrase) const if (!rootBrick) nlerror("Invalid root sbrick in sphrase_com '%s'", phrase.Name.toUtf8().c_str()); else if (actMalus && !rootBrick->isSpecialPower()) - totalActionMalus = actMalus->getValue32(); + totalActionMalus = actMalus->getValue32(); } return totalActionMalus; } diff --git a/code/ryzom/client/src/interface_v3/sphrase_manager.h b/code/ryzom/client/src/interface_v3/sphrase_manager.h index c14b584ab..d4c1b2092 100644 --- a/code/ryzom/client/src/interface_v3/sphrase_manager.h +++ b/code/ryzom/client/src/interface_v3/sphrase_manager.h @@ -338,7 +338,7 @@ public: // Get the Phrase Success Rate % sint getPhraseSuccessRate(const CSPhraseCom &phrase); // Get the Phrase Success Rate %. Manually gives the Skill to do the comparison (for craft) - sint getCraftPhraseSuccessRate(const CSPhraseCom &phrase, SKILLS::ESkills skill, uint minMpLevel); + sint getCraftPhraseSuccessRate(const CSPhraseCom &phrase, SKILLS::ESkills skill, uint minMpLevel, sint successModifier); // Get the Phrase Success Rate %. Manually gives the Skill to do the comparison (for Forage Extraction) sint getForageExtractionPhraseSuccessRate(const CSPhraseCom &phrase, SKILLS::ESkills skill); // return the fmt according to forage terrain specializing diff --git a/code/ryzom/client/src/interface_v3/view_radar.cpp b/code/ryzom/client/src/interface_v3/view_radar.cpp index 8c8cd1de8..5ebb7fd64 100644 --- a/code/ryzom/client/src/interface_v3/view_radar.cpp +++ b/code/ryzom/client/src/interface_v3/view_radar.cpp @@ -177,7 +177,7 @@ void CViewRadar::draw () // Select the icon to display and draw it uint spotId = CNPCIconCache::getInstance().getNPCIcon(entity).getSpotId(); CRadarSpotDesc spotDesc = _SpotDescriptions[spotId]; - + if (!_MissionIconsObs._displayMissionSpots) spotDesc = _SpotDescriptions[0]; diff --git a/code/ryzom/client/src/interfaces_manager/interf_script.cpp b/code/ryzom/client/src/interfaces_manager/interf_script.cpp index f083eda18..734b99098 100644 --- a/code/ryzom/client/src/interfaces_manager/interf_script.cpp +++ b/code/ryzom/client/src/interfaces_manager/interf_script.cpp @@ -37,7 +37,11 @@ float getFloat() char delimiter[] = "[] \t"; char *ptr = strtok(NULL, delimiter); if(ptr != NULL) - return (float) atof(ptr); + { + float val; + NLMISC::fromString(ptr, val); + return val; + } return 0.f; }// getFloat // @@ -94,7 +98,7 @@ std::vector getVectorOfFloat(uint8 nbCol) ptr = strtok(NULL, delimiter); if(ptr != NULL) { - val = (float)atof(ptr); + NLMISC::fromString(ptr, val); if (val != 0.0f) vect.push_back(val); } diff --git a/code/ryzom/client/src/landscape_poly_drawer.h b/code/ryzom/client/src/landscape_poly_drawer.h index 73d7fcadc..865112223 100644 --- a/code/ryzom/client/src/landscape_poly_drawer.h +++ b/code/ryzom/client/src/landscape_poly_drawer.h @@ -97,7 +97,9 @@ private: // renderScene is called in main loop. It can called beginRenderLandscapePolyPart and renderLandscapePolyPart // methods. - friend void renderScene(); + friend void beginRenderScene(); + friend void drawRenderScene(bool wantTraversals, bool keepTraversals); + friend void endRenderScene(bool keepTraversals); // Enable stencil test and initialize function and operation of stencil at the beginning of renderScene method, // before opaque render of canopy and main scene parts. diff --git a/code/ryzom/client/src/login.cpp b/code/ryzom/client/src/login.cpp index 45e3fea51..091e24a80 100644 --- a/code/ryzom/client/src/login.cpp +++ b/code/ryzom/client/src/login.cpp @@ -73,6 +73,8 @@ using namespace std; // *************************************************************************** +extern bool SetMousePosFirstTime; + vector Shards; string LoginLogin, LoginPassword, ClientApp, Salt; @@ -114,7 +116,7 @@ vector R2PatchURLs; #define CTRL_EDITBOX_CREATEACCOUNT_LOGIN "ui:login:create_account:content:submit_gr:eb_login:eb" #define CTRL_EDITBOX_CREATEACCOUNT_PASSWORD "ui:login:create_account:content:submit_gr:eb_password:eb" #define CTRL_EDITBOX_CREATEACCOUNT_CONFIRMPASSWORD "ui:login:create_account:content:submit_gr:eb_confirm_password:eb" -#define CTRL_EDITBOX_CREATEACCOUNT_EMAIL "ui:login:create_account:content:submit_gr:eb_email:eb" +#define CTRL_EDITBOX_CREATEACCOUNT_EMAIL "ui:login:create_account:content:submit_gr:eb_email:eb" #define UI_VARIABLES_SCREEN_CHECKPASS 0 #define UI_VARIABLES_SCREEN_SHARDDISP 1 @@ -857,16 +859,15 @@ bool login() IngameDbMngr.flushObserverCalls(); NLGUI::CDBManager::getInstance()->flushObserverCalls(); - bool tmpDI = ClientCfg.DisableDirectInput; - ClientCfg.DisableDirectInput = true; + SetMousePosFirstTime = true; InitMouseWithCursor(false); Driver->showCursor (false); SetMouseFreeLook (); SetMouseCursor (false); SetMouseSpeed (ClientCfg.CursorSpeed); SetMouseAcceleration (ClientCfg.CursorAcceleration); - InitMouseWithCursor (ClientCfg.HardwareCursor); - ClientCfg.DisableDirectInput = tmpDI; + SetMousePosFirstTime = true; + InitMouseWithCursor (ClientCfg.HardwareCursor && !StereoDisplayAttached); // if (ClientCfg.TestBrowser) // { @@ -1084,7 +1085,7 @@ void initShardDisplay() for (uint fff = 0; fff < 20; ++fff) { CShard s ( toString("%05d",fff), fff%3, fff+32, toString("%s%d","pipo",fff), - 32*fff%46546, "32.32.32.32", "http://www.ryzom.com" ); + 32*fff%46546, "32.32.32.32", "http://www.ryzomcore.org" ); Shards.push_back(s); }*/ @@ -1211,7 +1212,7 @@ void onlogin(bool vanishScreen = true) // for (uint fff = 0; fff < 20; ++fff) // { // CShard s ( toString("%05d",fff), fff%3, fff+32, toString("%s%d","pipo",fff), -// 32*fff%46546, "32.32.32.32", "http://www.ryzom.com" ); +// 32*fff%46546, "32.32.32.32", "http://www.ryzomcore.org" ); // Shards.push_back(s); // }*/ // @@ -1989,6 +1990,7 @@ class CAHInitResLod : public IActionHandler CfgPresetList.push_back(pair("NbMaxSkeletonNotCLod", false)); CfgPresetList.push_back(pair("CharacterFarClip", true)); + CfgPresetList.push_back(pair("FXAA", false)); CfgPresetList.push_back(pair("Bloom", false)); CfgPresetList.push_back(pair("SquareBloom", false)); CfgPresetList.push_back(pair("DensityBloom", true)); @@ -2410,7 +2412,7 @@ bool initCreateAccount() rulesGr->setActive(false); // must be done after hide rules - CAHManager::getInstance()->runActionHandler("set_keyboard_focus", NULL, "target=" CTRL_EDITBOX_CREATEACCOUNT_LOGIN "|select_all=false"); + CAHManager::getInstance()->runActionHandler("set_keyboard_focus", NULL, "target=" CTRL_EDITBOX_CREATEACCOUNT_LOGIN "|select_all=false"); } diff --git a/code/ryzom/client/src/login_patch.cpp b/code/ryzom/client/src/login_patch.cpp index 5b9a83c83..3cc14e6d2 100644 --- a/code/ryzom/client/src/login_patch.cpp +++ b/code/ryzom/client/src/login_patch.cpp @@ -26,6 +26,10 @@ #include #endif +#ifdef NL_OS_MAC + #include "app_bundle_utils.h" +#endif + #include #include @@ -207,9 +211,18 @@ CPatchManager::CPatchManager() : State("t_state"), DataScanState("t_data_scan_st // **************************************************************************** void CPatchManager::setClientRootPath(const std::string& clientRootPath) { - ClientRootPath = clientRootPath; - ClientPatchPath = ClientRootPath + "unpack/"; - ClientDataPath = ClientRootPath + "data/"; + ClientRootPath = CPath::standardizePath(clientRootPath); + ClientPatchPath = CPath::standardizePath(ClientRootPath + "unpack"); + + WritableClientDataPath = CPath::standardizePath(ClientRootPath + "data"); + +#ifdef NL_OS_MAC + ReadableClientDataPath = CPath::standardizePath(getAppBundlePath() + "/Contents/Resources/data"); +#elif defined(NL_OS_UNIX) && defined(RYZOM_SHARE_PREFIX) + ReadableClientDataPath = CPath::standardizePath(std::string(RYZOM_SHARE_PREFIX) + "/data"); +#else + ReadableClientDataPath = WritableClientDataPath; +#endif } // **************************************************************************** @@ -253,7 +266,7 @@ void CPatchManager::init(const std::vector& patchURIs, const std::s DisplayedServerPath = ServerPath; NLMISC::CFile::createDirectory(ClientPatchPath); - NLMISC::CFile::createDirectory(ClientDataPath); + NLMISC::CFile::createDirectory(WritableClientDataPath); // try to read the version file from the server (that will replace the version number) @@ -787,7 +800,7 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool if (!result) { -//:TODO: handle exception? + // TODO: handle exception? string err = toString("Error unpacking %s", rFilename.c_str()); if (useBatchFile) @@ -913,7 +926,6 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool throw NLMISC::EWriteError(UpdateBatchFilename.c_str()); } } - } // **************************************************************************** @@ -1068,12 +1080,12 @@ float CPatchManager::getCurrentFileProgress() const } // **************************************************************************** -void CPatchManager::setRWAccess (const string &filename) +void CPatchManager::setRWAccess (const string &filename, bool bThrowException) { ucstring s = CI18N::get("uiSetAttrib") + " " + filename; setState(true, s); - if (!NLMISC::CFile::setRWAccess(filename)) + if (!NLMISC::CFile::setRWAccess(filename) && bThrowException) { s = CI18N::get("uiAttribErr") + " " + filename + " (" + toString(errno) + "," + strerror(errno) + ")"; setState(true, s); @@ -1351,7 +1363,7 @@ void CPatchManager::downloadFileWithCurl (const string &source, const string &de // create the local file if (NLMISC::CFile::fileExists(dest)) { - setRWAccess(dest); + setRWAccess(dest, false); NLMISC::CFile::deleteFile(dest.c_str()); } FILE *fp = fopen (dest.c_str(), "wb"); @@ -1492,7 +1504,7 @@ void CPatchManager::decompressFile (const string &filename) } string dest = filename.substr(0, filename.size ()-4); - setRWAccess(dest); + setRWAccess(dest, false); //if(isVerboseLog()) nlinfo("Calling fopen('%s','wb')", dest.c_str()); FILE *fp = fopen (dest.c_str(), "wb"); if (fp == NULL) @@ -1566,7 +1578,7 @@ void CPatchManager::applyDate (const string &sFilename, uint32 nDate) { // _utimbuf utb; // utb.actime = utb.modtime = nDate; - setRWAccess(sFilename); + setRWAccess(sFilename, false); ucstring s = CI18N::get("uiChangeDate") + " " + NLMISC::CFile::getFilename(sFilename) + " " + toString(NLMISC::CFile::getFileModificationDate (sFilename)) + " -> " + toString(nDate); setState(true,s); @@ -1616,9 +1628,25 @@ void CPatchManager::getPatchFromDesc(SFileToPatch &ftpOut, const CBNPFile &fIn, // Only look in data path if the file should not be unpack (otherwise it should only remains in the "unpack" directory) if (!needUnpack) { - if (sFilePath.empty() && NLMISC::CFile::fileExists(ClientDataPath + rFilename)) sFilePath = ClientDataPath + rFilename; + if (sFilePath.empty()) + { + if (NLMISC::CFile::fileExists(WritableClientDataPath + rFilename)) + { + // if file exists in writable directory, use it + sFilePath = WritableClientDataPath + rFilename; + } + else if (NLMISC::CFile::fileExists(ReadableClientDataPath + rFilename)) + { + // if file exists in readable directory, use it + sFilePath = ReadableClientDataPath + rFilename; + } + } + } + + if (sFilePath.empty() && NLMISC::CFile::fileExists(ClientPatchPath + rFilename)) + { + sFilePath = ClientPatchPath + rFilename; } - if (sFilePath.empty() && NLMISC::CFile::fileExists(ClientPatchPath + rFilename)) sFilePath = ClientPatchPath + rFilename; // following lines removed by Sadge to ensure that the correct file is patched // string sFilePath = CPath::lookup(rFilename, false, false); @@ -2039,7 +2067,8 @@ uint CPatchManager::applyScanDataResult() if(ScanDataThread) return 0; - uint numError= 0; + uint numError= 0; + { TSyncDataScanState::CAccessor ac(&DataScanState); CDataScanState &val= ac.value(); @@ -2057,7 +2086,8 @@ uint CPatchManager::applyScanDataResult() // get file path // following lines added by Sadge to ensure that the correct file gets patched string sFilePath; - if (NLMISC::CFile::fileExists(ClientDataPath + ftp.FileName)) sFilePath = ClientDataPath + ftp.FileName; + if (NLMISC::CFile::fileExists(WritableClientDataPath + ftp.FileName)) sFilePath = WritableClientDataPath + ftp.FileName; + if (sFilePath.empty() && NLMISC::CFile::fileExists(ReadableClientDataPath + ftp.FileName)) sFilePath = ReadableClientDataPath + ftp.FileName; if (sFilePath.empty() && NLMISC::CFile::fileExists(ClientPatchPath + ftp.FileName)) sFilePath = ClientPatchPath + ftp.FileName; // following lines removed by Sadge to ensure that the correct file gets patched @@ -2768,15 +2798,31 @@ public: void CPatchThread::processFile (CPatchManager::SFileToPatch &rFTP) { CPatchManager *pPM = CPatchManager::getInstance(); - // Source File Name + + // Source File Name (in writable or readable directory) string SourceName; + + // Destination File Name (in writable directory) + string DestinationName; + if (rFTP.ExtractPath.empty()) { + DestinationName = pPM->WritableClientDataPath + rFTP.FileName; + if (rFTP.LocalFileExists) { // following lines added by Sadge to ensure that the correct file gets patched SourceName.clear(); - if (NLMISC::CFile::fileExists(pPM->ClientDataPath + rFTP.FileName)) SourceName = pPM->ClientDataPath + rFTP.FileName; + + if (NLMISC::CFile::fileExists(pPM->WritableClientDataPath + rFTP.FileName)) + { + SourceName = pPM->WritableClientDataPath + rFTP.FileName; + } + else if (NLMISC::CFile::fileExists(pPM->ReadableClientDataPath + rFTP.FileName)) + { + SourceName = pPM->ReadableClientDataPath + rFTP.FileName; + } + // version from previous download if (SourceName.empty()) throw Exception (std::string("ERROR: Failed to find file: ")+rFTP.FileName); @@ -2788,12 +2834,13 @@ void CPatchThread::processFile (CPatchManager::SFileToPatch &rFTP) // note : if file was background downloaded, we have : // rFTP.LocalFileExists = false // rFTP.SrcFileName = "unpack/filename.bnp.tmp" - SourceName = pPM->ClientDataPath + rFTP.FileName; + SourceName = DestinationName; } } else { SourceName = pPM->ClientPatchPath + rFTP.FileName; + DestinationName = SourceName; } if (rFTP.LocalFileToDelete) @@ -2838,7 +2885,7 @@ void CPatchThread::processFile (CPatchManager::SFileToPatch &rFTP) for (uint i=0; ideleteFile(SourceName, false, false); // File can exists if bad BNP loading if (_CommitPatch) { - pPM->renameFile(OutFilename+".tmp", SourceName); + pPM->renameFile(OutFilename+".tmp", DestinationName); } } } - if (usePatchFile && !rFTP.Patches.empty()) + if (usePatchFile) { uint32 currentPatchedSize = 0; for (uint32 j = 0; j < rFTP.Patches.size(); ++j) @@ -2987,21 +3034,14 @@ void CPatchThread::processFile (CPatchManager::SFileToPatch &rFTP) SourceNameXD = SourceNameXD.substr(0, SourceNameXD.rfind('.')); SourceNameXD += "_.ref"; - std::string refPath; - if (_CommitPatch) - { - refPath = pPM->ClientDataPath; - } - else + if (!_CommitPatch) { // works - refPath = pPM->ClientPatchPath; std::string tmpRefFile = SourceNameXD + ".tmp"; if (!NLMISC::CFile::fileExists(pPM->ClientPatchPath + tmpRefFile)) { // Not found in the patch directory -> version in data directory should be good, or would have been // detected by the check thread else. - refPath = pPM->ClientDataPath; } else { @@ -3018,7 +3058,14 @@ void CPatchThread::processFile (CPatchManager::SFileToPatch &rFTP) // if (SourceNameXDFull.empty()) // SourceNameXDFull = pPM->ClientDataPath + SourceNameXD; // SourceNameXD = SourceNameXDFull; - SourceNameXD = pPM->ClientDataPath + SourceNameXD; + if (CFile::fileExists(pPM->WritableClientDataPath + SourceNameXD)) + { + SourceNameXD = pPM->WritableClientDataPath + SourceNameXD; + } + else if (CFile::fileExists(pPM->ReadableClientDataPath + SourceNameXD)) + { + SourceNameXD = pPM->ReadableClientDataPath + SourceNameXD; + } } PatchName = pPM->ClientPatchPath + PatchName; @@ -3042,7 +3089,8 @@ void CPatchThread::processFile (CPatchManager::SFileToPatch &rFTP) PatchSizeProgress += rFTP.PatcheSizes[j]; currentPatchedSize += rFTP.PatcheSizes[j]; } - if (tmpSourceName != SourceName) + + if (tmpSourceName != DestinationName) { pPM->deleteFile(SourceName, false, false); // File can exists if bad BNP loading if (!_CommitPatch) @@ -3052,7 +3100,7 @@ void CPatchThread::processFile (CPatchManager::SFileToPatch &rFTP) } else { - pPM->renameFile(tmpSourceName, SourceName); + pPM->renameFile(tmpSourceName, DestinationName); } } } @@ -3060,9 +3108,10 @@ void CPatchThread::processFile (CPatchManager::SFileToPatch &rFTP) { PatchSizeProgress += totalPatchSize; } + // If all patches applied with success so file size should be ok // We just have to change file date to match the last patch applied - pPM->applyDate(SourceName, rFTP.LastFileDate); + pPM->applyDate(DestinationName, rFTP.LastFileDate); //progress.progress(1.f); } @@ -3398,6 +3447,7 @@ bool CPatchManager::extract(const std::string& patchPath, ok = true; } } + if (!ok) { // nothing to extract @@ -3407,15 +3457,21 @@ bool CPatchManager::extract(const std::string& patchPath, // extract uint nblab = 0; pPM->deleteFile(updateBatchFilename, false, false); + FILE *fp = fopen (updateBatchFilename.c_str(), "wt"); + if (fp == 0) { string err = toString("Can't open file '%s' for writing: code=%d %s (error code 29)", updateBatchFilename.c_str(), errno, strerror(errno)); throw Exception (err); } + +#ifdef NL_OS_WINDOWS fprintf(fp, "@echo off\n"); fprintf(fp, "ping 127.0.0.1 -n 7 -w 1000 > nul\n"); // wait - +#else + // TODO: for Linux and OS X +#endif // Unpack files with category ExtractPath non empty for (uint32 j = 0; j < sourceFilename.size(); ++j) @@ -3442,21 +3498,32 @@ bool CPatchManager::extract(const std::string& patchPath, string DstPath = CPath::standardizeDosPath(extractPath[j]); string DstName = DstPath + vFilenames[fff]; NLMISC::CFile::createDirectoryTree(extractPath[j]); - // this file must be moved + // this file must be moved +#ifdef NL_OS_WINDOWS fprintf(fp, ":loop%u\n", nblab); fprintf(fp, "attrib -r -a -s -h %s\n", DstName.c_str()); fprintf(fp, "del %s\n", DstName.c_str()); fprintf(fp, "if exist %s goto loop%u\n", DstName.c_str(), nblab); fprintf(fp, "move %s %s\n", SrcName.c_str(), DstPath.c_str()); +#else + // TODO: for Linux and OS X +#endif + nblab++; + } } } } +#ifdef NL_OS_WINDOWS fprintf(fp, "start %s %%1 %%2 %%3\n", execName.c_str()); +#else + // TODO: for Linux and OS X +#endif + fclose(fp); if (stopFun) diff --git a/code/ryzom/client/src/login_patch.h b/code/ryzom/client/src/login_patch.h index de7351775..509a74f9a 100644 --- a/code/ryzom/client/src/login_patch.h +++ b/code/ryzom/client/src/login_patch.h @@ -302,7 +302,7 @@ private: /// Read the description of the highest client version file found void readClientVersionAndDescFile(); - void setRWAccess (const std::string &filename); + void setRWAccess (const std::string &filename, bool bThrowException=true); std::string deleteFile (const std::string &filename, bool bThrowException=true, bool bWarning=true); @@ -447,8 +447,9 @@ private: std::string UpdateBatchFilename; // Where the client get all delta and desc file - std::string ClientPatchPath; - std::string ClientDataPath; + std::string ClientPatchPath; // Temporary path + std::string ReadableClientDataPath; // Where original data can be found + std::string WritableClientDataPath; // Where data can be written /// Output useful information for debugging in the log file bool VerboseLog; diff --git a/code/ryzom/client/src/login_progress_post_thread.cpp b/code/ryzom/client/src/login_progress_post_thread.cpp index bc833fb04..76ce9c2e3 100644 --- a/code/ryzom/client/src/login_progress_post_thread.cpp +++ b/code/ryzom/client/src/login_progress_post_thread.cpp @@ -85,7 +85,7 @@ static std::string sizeToHumanStd(uint64 size) static std::string getVideoInfoDeviceName() { uint64 version; - std::string ret = ""; + std::string ret; bool ok = CSystemInfo::getVideoInfo(ret, version); if (ok) { diff --git a/code/ryzom/client/src/main_loop.cpp b/code/ryzom/client/src/main_loop.cpp index bd5112f99..9b39c53c9 100644 --- a/code/ryzom/client/src/main_loop.cpp +++ b/code/ryzom/client/src/main_loop.cpp @@ -43,6 +43,9 @@ #include "nel/3d/u_instance_material.h" #include "nel/3d/u_cloud_scape.h" #include "nel/3d/stereo_hmd.h" +#include "nel/3d/render_target_manager.h" +#include "nel/3d/driver_user.h" +#include "nel/3d/fxaa.h" // game share #include "game_share/brick_types.h" #include "game_share/light_cycle.h" @@ -165,7 +168,6 @@ using namespace std; // EXTERN // //////////// extern UDriver *Driver; -extern IMouseDevice *MouseDevice; extern UScene *Scene; extern UScene *SceneRoot; extern ULandscape *Landscape; @@ -421,9 +423,9 @@ void beginRenderMainScenePart() { Scene->beginPartRender(); } -void endRenderMainScenePart() +void endRenderMainScenePart(bool keepTraversals) { - Scene->endPartRender(true); + Scene->endPartRender(!keepTraversals, true, keepTraversals); } void beginRenderSkyPart() @@ -460,7 +462,7 @@ static void renderCanopyPart(UScene::TRenderPart renderPart) // *************************************************************************************************************************** // Render a part of the main scene -static void renderMainScenePart(UScene::TRenderPart renderPart) +static void renderMainScenePart(UScene::TRenderPart renderPart, bool wantTraversals, bool keepTraversals) { H_AUTO_USE ( RZ_Client_Main_Loop_Render_Main ) Driver->setDepthRange(0.f, CANOPY_DEPTH_RANGE_START); @@ -472,7 +474,7 @@ static void renderMainScenePart(UScene::TRenderPart renderPart) { MainFogState.setupInDriver (*Driver); } - Scene->renderPart(renderPart); + Scene->renderPart(renderPart, true, wantTraversals, keepTraversals); } @@ -562,13 +564,15 @@ void clearBuffers() void renderScene(bool forceFullDetail, bool bloom) { + CTextureUser *effectRenderTarget = NULL; if (bloom) { // set bloom parameters before applying bloom effect CBloomEffect::getInstance().setSquareBloom(ClientCfg.SquareBloom); CBloomEffect::getInstance().setDensityBloom((uint8)ClientCfg.DensityBloom); - // init bloom - CBloomEffect::getInstance().initBloom(); + + // init effect render target + Driver->beginDefaultRenderTarget(); } if (forceFullDetail) { @@ -576,7 +580,7 @@ void renderScene(bool forceFullDetail, bool bloom) s_ForceFullDetail.set(); } clearBuffers(); - renderScene(); + doRenderScene(true, false); if (forceFullDetail) { s_ForceFullDetail.restore(); @@ -584,8 +588,10 @@ void renderScene(bool forceFullDetail, bool bloom) if (bloom) { // apply bloom effect - CBloomEffect::getInstance().endBloom(); - CBloomEffect::getInstance().endInterfacesDisplayBloom(); + CBloomEffect::getInstance().applyBloom(); + + // draw final result to backbuffer + Driver->endDefaultRenderTarget(Scene); } } @@ -661,7 +667,7 @@ void updateWeather() updateClouds(); } #endif - + ContinentMngr.getFogState(MainFog, LightCycleManager.getLightLevel(), LightCycleManager.getLightDesc().DuskRatio, LightCycleManager.getState(), View.viewPos(), MainFogState); // TODO: ZBuffer clear was originally before this, but should not be necessary normally. @@ -687,30 +693,33 @@ void updateWeather() Driver->setPolygonMode(oldMode); } #endif - - // FIXME: temporary fix for teleportation crash + // Update new sky - if (ContinentMngr.cur() && Driver->getPolygonMode() == UDriver::Filled && Filter3D[FilterSky]) + s_SkyMode = NoSky; + if (ContinentMngr.cur() && !ContinentMngr.cur()->Indoor) { - CSky &sky = ContinentMngr.cur()->CurrentSky; - - if (!ContinentMngr.cur()->Indoor && sky.getScene()) - { - s_SkyMode = NewSky; - sky.getScene()->animate(TimeInSec-FirstTimeInSec); - // Setup the sky camera - preRenderNewSky(); - } - else + if(Driver->getPolygonMode() == UDriver::Filled) { - s_SkyMode = OldSky; + if (Filter3D[FilterSky]) + { + CSky &sky = ContinentMngr.cur()->CurrentSky; + if (sky.getScene()) + { + s_SkyMode = NewSky; + sky.getScene()->animate(TimeInSec-FirstTimeInSec); + // Setup the sky camera + preRenderNewSky(); + } + else + { + s_SkyMode = OldSky; + } + } } } } -// *************************************************************************************************************************** -// Render all scenes -void renderScene() +void beginRenderScene() { // Update Filter Flags Scene->enableElementRender(UScene::FilterAllMeshNoVP, Filter3D[FilterMeshNoVP]); @@ -732,28 +741,45 @@ void renderScene() beginRenderCanopyPart(); beginRenderMainScenePart(); beginRenderSkyPart(); +} + +void drawRenderScene(bool wantTraversals, bool keepTraversals) +{ // Render part // WARNING: always must begin rendering with at least UScene::RenderOpaque, // else dynamic shadows won't work renderCanopyPart(UScene::RenderOpaque); - renderMainScenePart(UScene::RenderOpaque); + renderMainScenePart(UScene::RenderOpaque, wantTraversals, keepTraversals); // render of polygons on landscape CLandscapePolyDrawer::getInstance().renderLandscapePolyPart(); if (s_SkyMode != NoSky) renderSkyPart((UScene::TRenderPart) (UScene::RenderOpaque | UScene::RenderTransparent)); renderCanopyPart((UScene::TRenderPart) (UScene::RenderTransparent | UScene::RenderFlare)); - renderMainScenePart((UScene::TRenderPart) (UScene::RenderTransparent | UScene::RenderFlare)); + renderMainScenePart((UScene::TRenderPart) (UScene::RenderTransparent | UScene::RenderFlare), wantTraversals, keepTraversals); if (s_SkyMode == NewSky) renderSkyPart(UScene::RenderFlare); +} + +void endRenderScene(bool keepTraversals) +{ // End Part Rendering endRenderSkyPart(); - endRenderMainScenePart(); + endRenderMainScenePart(keepTraversals); endRenderCanopyPart(); // reset depth range Driver->setDepthRange(0.f, CANOPY_DEPTH_RANGE_START); } +// *************************************************************************************************************************** +// Render all scenes +void doRenderScene(bool wantTraversals, bool keepTraversals) +{ + beginRenderScene(); + drawRenderScene(wantTraversals, keepTraversals); + endRenderScene(keepTraversals); +} + // *************************************************************************** class CMusicFader @@ -987,6 +1013,7 @@ bool mainLoop() SetMouseCursor (); // Set the cursor. ContextCur.context("STAND BY"); + UserControls.reset(); // set the default box for keyboard setDefaultChatWindow(PeopleInterraction.ChatGroup.Window); @@ -1382,8 +1409,20 @@ bool mainLoop() MainCam.setRotQuat(View.currentViewQuat()); if (StereoHMD) { + CMatrix camMatrix; + camMatrix.translate(MainCam.getMatrix().getPos()); + CVector dir = MainCam.getMatrix().getJ(); + dir.z = 0; + dir.normalize(); + if (dir.y < 0) + camMatrix.rotateZ(float(NLMISC::Pi+asin(dir.x))); + else + camMatrix.rotateZ(float(NLMISC::Pi+NLMISC::Pi-asin(dir.x))); + + StereoHMD->setInterfaceMatrix(camMatrix); + NLMISC::CQuat hmdOrient = StereoHMD->getOrientation(); - NLMISC::CMatrix camMatrix = MainCam.getMatrix(); + // NLMISC::CMatrix camMatrix = MainCam.getMatrix(); NLMISC::CMatrix hmdMatrix; hmdMatrix.setRot(hmdOrient); NLMISC::CMatrix posMatrix; // minimal head modeling, will be changed in the future @@ -1391,8 +1430,15 @@ bool mainLoop() NLMISC::CMatrix mat = ((camMatrix * hmdMatrix) * posMatrix); MainCam.setPos(mat.getPos()); MainCam.setRotQuat(mat.getRot()); + + if (true) // TODO: ClientCfg.Headphone + { + // NOTE: non-(StereoHMD+Headphone) impl in user_entity.cpp + SoundMngr->setListenerPos(mat.getPos()); // TODO: Move ears back ... :) + SoundMngr->setListenerOrientation(mat.getJ(), mat.getK()); + } } - if (StereoDisplay) + if (StereoDisplay) { StereoDisplay->updateCamera(0, &MainCam); if (SceneRoot) @@ -1591,14 +1637,31 @@ bool mainLoop() { // Update water env map (happens when continent changed etc) updateWaterEnvMap(); - + // Update weather updateWeather(); } } - + uint i = 0; - uint bloomStage = 0; + CTextureUser *effectRenderTarget = NULL; + bool haveEffects = Render && Driver->getPolygonMode() == UDriver::Filled + && (ClientCfg.Bloom || FXAA); + bool defaultRenderTarget = false; + if (haveEffects) + { + if (!StereoDisplay) + { + Driver->beginDefaultRenderTarget(); + defaultRenderTarget = true; + } + if (ClientCfg.Bloom) + { + CBloomEffect::getInstance().setSquareBloom(ClientCfg.SquareBloom); + CBloomEffect::getInstance().setDensityBloom((uint8)ClientCfg.DensityBloom); + } + } + bool fullDetail = false; while ((!StereoDisplay && i == 0) || (StereoDisplay && StereoDisplay->nextPass())) { ++i; @@ -1630,60 +1693,68 @@ bool mainLoop() // Commit camera changes commitCamera(); - + ////////////////////////// // RENDER THE FRAME 3D // ////////////////////////// bool stereoRenderTarget = (StereoDisplay != NULL) && StereoDisplay->beginRenderTarget(); - + if (!StereoDisplay || StereoDisplay->wantClear()) { - if (Render) - { - if (ClientCfg.Bloom) - { - nlassert(bloomStage == 0); - // set bloom parameters before applying bloom effect - CBloomEffect::getInstance().setSquareBloom(ClientCfg.SquareBloom); - CBloomEffect::getInstance().setDensityBloom((uint8)ClientCfg.DensityBloom); - // start bloom effect (just before the first scene element render) - CBloomEffect::instance().initBloom(); - bloomStage = 1; - } - } - // Clear buffers clearBuffers(); } if (!StereoDisplay || StereoDisplay->wantScene()) { - if (!ClientCfg.Light) + if (!ClientCfg.Light && Render) { - // Render - if(Render) + if (!StereoDisplay || StereoDisplay->isSceneFirst()) { // nb : force full detail if a screenshot is asked // todo : move outside render code - bool fullDetail = ScreenshotRequest != ScreenshotRequestNone && ClientCfg.ScreenShotFullDetail; - if (fullDetail) + if (!fullDetail) { - s_ForceFullDetail.backup(); - s_ForceFullDetail.set(); + fullDetail = ScreenshotRequest != ScreenshotRequestNone && ClientCfg.ScreenShotFullDetail; + if (fullDetail) + { + s_ForceFullDetail.backup(); + s_ForceFullDetail.set(); + } } - - // Render scene - renderScene(); + } + // Render scene + bool wantTraversals = !StereoDisplay || StereoDisplay->isSceneFirst(); + bool keepTraversals = StereoDisplay && !StereoDisplay->isSceneLast(); + doRenderScene(wantTraversals, keepTraversals); + + if (!StereoDisplay || StereoDisplay->isSceneLast()) + { if (fullDetail) { s_ForceFullDetail.restore(); + fullDetail = false; } } } } + if (!StereoDisplay || StereoDisplay->wantSceneEffects()) + { + if (!ClientCfg.Light && Render && haveEffects) + { + if (StereoDisplay) Driver->setViewport(NL3D::CViewport()); + UCamera pCam = Scene->getCam(); + Driver->setMatrixMode2D11(); + if (FXAA) FXAA->applyEffect(); + if (ClientCfg.Bloom) CBloomEffect::instance().applyBloom(); + Driver->setMatrixMode3D(pCam); + if (StereoDisplay) Driver->setViewport(StereoDisplay->getCurrentViewport()); + } + } + if (!StereoDisplay || StereoDisplay->wantInterface3D()) { if (!ClientCfg.Light) @@ -1691,15 +1762,6 @@ bool mainLoop() // Render if (Render) { - if (ClientCfg.Bloom && bloomStage == 1) - { - // End the actual bloom effect visible in the scene. - if (StereoDisplay) Driver->setViewport(NL3D::CViewport()); - CBloomEffect::instance().endBloom(); - if (StereoDisplay) Driver->setViewport(StereoDisplay->getCurrentViewport()); - bloomStage = 2; - } - // for that frame and // tmp : display height grid //static volatile bool displayHeightGrid = true; @@ -1818,14 +1880,14 @@ bool mainLoop() // special case in OpenGL : all scene has been display in render target, // now, final texture is display with a quad - if (!ClientCfg.Light && ClientCfg.Bloom && Render && bloomStage == 2) + /*if (!ClientCfg.Light && ClientCfg.Bloom && Render && bloomStage == 2) // NO VR BLOOMZ { // End bloom effect system after drawing the 3d interface (z buffer related). if (StereoDisplay) Driver->setViewport(NL3D::CViewport()); CBloomEffect::instance().endInterfacesDisplayBloom(); if (StereoDisplay) Driver->setViewport(StereoDisplay->getCurrentViewport()); bloomStage = 0; - } + }*/ } { @@ -1863,6 +1925,7 @@ bool mainLoop() // Create a shadow when displaying a text. TextContext->setShaded(true); + TextContext->setShadeOutline(false); // Set the font size. TextContext->setFontSize(10); // Set the text color @@ -2139,6 +2202,12 @@ bool mainLoop() } } /* stereo pass */ + if (defaultRenderTarget) + { + // draw final result to backbuffer + Driver->endDefaultRenderTarget(Scene); + } + // Draw to screen. static CQuat MainCamOri; if (FirstFrame) @@ -2395,6 +2464,7 @@ bool mainLoop() SetMouseCursor (); // Set the cursor. ContextCur.context("STAND BY"); + UserControls.reset(); // set the default box for keyboard CChatWindow *defaultChatWindow; @@ -2441,7 +2511,7 @@ bool mainLoop() connectionState = NetMngr.getConnectionState(); CLuaManager::getInstance().executeLuaScript("game:onFarTpEnd()"); - } + } /////////////// // <- FAR_TP // /////////////// @@ -2519,6 +2589,7 @@ void displaySpecialTextProgress(const char *text) { // Create a shadow when displaying a text. TextContext->setShaded(true); + TextContext->setShadeOutline(false); // Set the font size. TextContext->setFontSize(12); // Set the text color @@ -3179,7 +3250,7 @@ NLMISC_COMMAND(debugUI, "Debug the ui : show/hide quads of bboxs and hotspots", else fromString(args[0], on); } - + CGroupCell::setDebugUICell( on ); DebugUIView = on; DebugUICtrl = on; diff --git a/code/ryzom/client/src/main_loop.h b/code/ryzom/client/src/main_loop.h index 21f64d37e..93e4db36d 100644 --- a/code/ryzom/client/src/main_loop.h +++ b/code/ryzom/client/src/main_loop.h @@ -29,7 +29,7 @@ const uint NUM_MISSION_OPTIONS = 8; bool mainLoop(); // render all -void renderScene(); +void doRenderScene(bool wantTraversals, bool keepTraversals); void renderScene(bool forceFullDetail, bool bloom); void setDefaultChatWindow(CChatWindow *defaultChatWindow); diff --git a/code/ryzom/client/src/main_loop_debug.cpp b/code/ryzom/client/src/main_loop_debug.cpp index dbcb47b96..992325c54 100644 --- a/code/ryzom/client/src/main_loop_debug.cpp +++ b/code/ryzom/client/src/main_loop_debug.cpp @@ -14,7 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -#include +#include "stdpch.h" #include "main_loop_debug.h" #include @@ -80,6 +80,7 @@ void displayDebug() //----------------// // Create a shadow when displaying a text. TextContext->setShaded(true); + TextContext->setShadeOutline(false); // Set the font size. TextContext->setFontSize(ClientCfg.DebugFontSize); // Set the text color @@ -370,6 +371,9 @@ void displayDebug() // Current GameCycle TextContext->printfAt(1.f, line, "Ms per Cycle : %d", NetMngr.getMsPerTick()); line += lineStep; + // Smoothed Client Date + TextContext->printfAt(1.f, line, "Smoothed Client Date : %u %f", SmoothedClientDate.Day, SmoothedClientDate.Hour); + line += lineStep; // Packet Loss TextContext->printfAt(1.f, line, "Packet Loss : %.1f %%", NetMngr.getMeanPacketLoss()*100.0f); line += lineStep; @@ -470,6 +474,7 @@ void displayDebug() // No more shadow when displaying a text. TextContext->setShaded(false); + TextContext->setShadeOutline(false); }// displayDebug // // ******************************************************************** @@ -491,6 +496,7 @@ void displayDebugFps() //----------------// // Create a shadow when displaying a text. TextContext->setShaded(true); + TextContext->setShadeOutline(false); // Set the font size. TextContext->setFontSize(ClientCfg.DebugFontSize); // Set the text color @@ -533,6 +539,7 @@ void displayDebugUIUnderMouse() //----------------// // Create a shadow when displaying a text. TextContext->setShaded(true); + TextContext->setShadeOutline(false); // Set the font size. TextContext->setFontSize(ClientCfg.DebugFontSize); @@ -707,6 +714,7 @@ void displayHelp() // Create a shadow when displaying a text. TextContext->setShaded(true); + TextContext->setShadeOutline(false); // Set the font size. TextContext->setFontSize(ClientCfg.HelpFontSize); // Set the text color @@ -763,6 +771,7 @@ void displayHelp() // No more shadow when displaying a text. TextContext->setShaded(false); + TextContext->setShadeOutline(false); }// displayHelp // // ******************************************************************** diff --git a/code/ryzom/client/src/main_loop_temp.cpp b/code/ryzom/client/src/main_loop_temp.cpp index 0b3f24fa3..0bb49b13f 100644 --- a/code/ryzom/client/src/main_loop_temp.cpp +++ b/code/ryzom/client/src/main_loop_temp.cpp @@ -14,7 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -#include +#include "stdpch.h" #include "main_loop_temp.h" #include "global.h" diff --git a/code/ryzom/client/src/main_loop_utilities.cpp b/code/ryzom/client/src/main_loop_utilities.cpp index bca1ccad2..cdd3f8394 100644 --- a/code/ryzom/client/src/main_loop_utilities.cpp +++ b/code/ryzom/client/src/main_loop_utilities.cpp @@ -14,11 +14,13 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -#include +#include "stdpch.h" #include "main_loop_utilities.h" #include #include +#include +#include #include "game_share/scenario_entry_points.h" @@ -57,8 +59,22 @@ void updateFromClientCfg() ))) { nldebug("Apply VR device change"); + // detach display mode + if (StereoDisplay && StereoDisplayAttached) + StereoDisplay->detachFromDisplay(); + StereoDisplayAttached = false; + // re-init releaseStereoDisplayDevice(); initStereoDisplayDevice(); + // try attach display mode + if (StereoDisplay) + StereoDisplayAttached = StereoDisplay->attachToDisplay(); + // set latest config display mode if not attached + if (!StereoDisplayAttached) + setVideoMode(UDriver::CMode(ClientCfg.Width, ClientCfg.Height, (uint8)ClientCfg.Depth, + ClientCfg.Windowed, ClientCfg.Frequency)); + // force software cursor when attached + InitMouseWithCursor(ClientCfg.HardwareCursor && !StereoDisplayAttached); } // GRAPHICS - GENERAL @@ -69,8 +85,11 @@ void updateFromClientCfg() (ClientCfg.Depth != LastClientCfg.Depth) || (ClientCfg.Frequency != LastClientCfg.Frequency)) { - setVideoMode(UDriver::CMode(ClientCfg.Width, ClientCfg.Height, (uint8)ClientCfg.Depth, - ClientCfg.Windowed, ClientCfg.Frequency)); + if (!StereoDisplayAttached) + { + setVideoMode(UDriver::CMode(ClientCfg.Width, ClientCfg.Height, (uint8)ClientCfg.Depth, + ClientCfg.Windowed, ClientCfg.Frequency)); + } } if (ClientCfg.DivideTextureSizeBy2 != LastClientCfg.DivideTextureSizeBy2) @@ -218,6 +237,22 @@ void updateFromClientCfg() } } + //--------------------------------------------------- + if (ClientCfg.FXAA != LastClientCfg.FXAA) + { + if (ClientCfg.FXAA) + { + nlassert(!FXAA); + FXAA = new NL3D::CFXAA(Driver); + } + else + { + nlassert(FXAA); + delete FXAA; + FXAA = NULL; + } + } + // GRAPHICS - CHARACTERS //--------------------------------------------------- if (ClientCfg.SkinNbMaxPoly != LastClientCfg.SkinNbMaxPoly) @@ -259,7 +294,7 @@ void updateFromClientCfg() { if (ClientCfg.HardwareCursor != IsMouseCursorHardware()) { - InitMouseWithCursor (ClientCfg.HardwareCursor); + InitMouseWithCursor (ClientCfg.HardwareCursor && !StereoDisplayAttached); } } diff --git a/code/ryzom/client/src/misc.cpp b/code/ryzom/client/src/misc.cpp index 9adf00a9a..7e018a576 100644 --- a/code/ryzom/client/src/misc.cpp +++ b/code/ryzom/client/src/misc.cpp @@ -920,7 +920,7 @@ std::string getStringCategory(const ucstring &src, ucstring &dest, bool alwaysAd std::string getStringCategoryIfAny(const ucstring &src, ucstring &dest) { - std::string colorCode = ""; + std::string colorCode; if (src.size() >= 3) { uint startPos = 0; diff --git a/code/ryzom/client/src/misc.h b/code/ryzom/client/src/misc.h index d74010c03..463f02b66 100644 --- a/code/ryzom/client/src/misc.h +++ b/code/ryzom/client/src/misc.h @@ -225,6 +225,7 @@ uint getCurrentColorDepth(); // get maximized bool isWindowMaximized(); +// get all supported video modes sint getRyzomModes(std::vector &videoModes, std::vector &stringModeList); #endif // CL_MISC_H diff --git a/code/ryzom/client/src/motion/user_controls.cpp b/code/ryzom/client/src/motion/user_controls.cpp index 527bfb5d4..897cba9c1 100644 --- a/code/ryzom/client/src/motion/user_controls.cpp +++ b/code/ryzom/client/src/motion/user_controls.cpp @@ -174,6 +174,10 @@ void CUserControls::init() }// init // +void CUserControls::reset() +{ + init(); +} //----------------------------------------------- // needReleaseForward : @@ -414,7 +418,6 @@ void CUserControls::keyboardRotationCameraLR (bool left, bool right) _RotateCameraLRVelocity = 0; } - //----------------------------------------------- // getMouseAngleMove //----------------------------------------------- @@ -424,13 +427,9 @@ void CUserControls::getMouseAngleMove(float &dx, float &dy) dy = 0.0f; // The mouse may still "StandardMove" ie through a CEventMouseMove - // This can happens cause DirectInputDisabled, or because of the - // "Rotation Anti-Lag system" which start to rotate before the mouse is hid - // and message mode passed to RawMode - // - // On X11 and Cocoa, there is no MouseDevice, do it without. - - extern IMouseDevice *MouseDevice; + // This can happen because of the "Rotation Anti-Lag system" which + // start to rotate before the mouse is hid and message mode passed + // to updateFreeLookPos // if the mouse position changed if( EventsListener.getMousePosX() != _LastFrameMousePosX || @@ -441,28 +440,23 @@ void CUserControls::getMouseAngleMove(float &dx, float &dy) float dmpy= EventsListener.getMousePosY() - _LastFrameMousePosY; // simulate mickeys mode if there is a mouse device - if (MouseDevice) - MouseDevice->convertStdMouseMoveInMickeys(dmpx, dmpy); - else - { - dmpx *= (float)Driver->getWindowWidth(); - dmpy *= (float)Driver->getWindowHeight(); - } + dmpx *= (float)Driver->getWindowWidth(); + dmpy *= (float)Driver->getWindowHeight(); // handle inverted mouse, if enabled - if(ClientCfg.FreeLookInverted) dmpy = -dmpy; - + if (ClientCfg.FreeLookInverted) dmpy = -dmpy; + // update free look EventsListener.updateFreeLookPos(dmpx, dmpy); } // If the mouse move on the axis X, with a CGDMouseMove - if(EventsListener.isMouseAngleX()) - dx = -EventsListener.getMouseAngleX (); + if (EventsListener.isMouseAngleX()) + dx = -EventsListener.getMouseAngleX(); // If the mouse move on the axis Y, with a CGDMouseMove - if(EventsListener.isMouseAngleY()) - dy = EventsListener.getMouseAngleY (); + if (EventsListener.isMouseAngleY()) + dy = EventsListener.getMouseAngleY(); } @@ -1294,7 +1288,6 @@ void CUserControls::commonSetView() } } - //----------------------------------------------- // startFreeLook() //----------------------------------------------- diff --git a/code/ryzom/client/src/motion/user_controls.h b/code/ryzom/client/src/motion/user_controls.h index eb4de2020..018b2c8e9 100644 --- a/code/ryzom/client/src/motion/user_controls.h +++ b/code/ryzom/client/src/motion/user_controls.h @@ -152,6 +152,8 @@ public: /// Constructor CUserControls(); + void reset(); + /// Return the string associated to the motion Mode. std::string modeStr() const; /// Return the motion Mode. diff --git a/code/ryzom/client/src/net_manager.cpp b/code/ryzom/client/src/net_manager.cpp index 1eedc16c5..ecadce14e 100644 --- a/code/ryzom/client/src/net_manager.cpp +++ b/code/ryzom/client/src/net_manager.cpp @@ -879,7 +879,28 @@ void CInterfaceChatDisplayer::displayChat(TDataSetIndex compressedSenderIndex, c } // Log - pIM->log (finalString); + + string channel; + if (mode == CChatGroup::dyn_chat) + { + sint32 dbIndex = ChatMngr.getDynamicChannelDbIndexFromId(dynChatId); + clamp(dbIndex, (sint32)0 , (sint32)CChatGroup::MaxDynChanPerPlayer); + + channel = "dyn" + toString(dbIndex); + } + else + { + channel = CChatGroup::groupTypeToString(mode); + if (channel.empty()) + { + channel = "#" + toString((uint32)mode); + } + } + if (!stringCategory.empty() && NLMISC::toUpper(stringCategory) != "SYS") + { + channel = channel + "/" + stringCategory; + } + pIM->log (finalString, channel); } @@ -911,7 +932,7 @@ void CInterfaceChatDisplayer::displayTell(/*TDataSetIndex senderIndex, */const u colorizeSender(finalString, senderPart, prop.getRGBA()); PeopleInterraction.ChatInput.Tell.displayTellMessage(/*senderIndex, */finalString, goodSenderName, prop.getRGBA(), 2, &windowVisible); - CInterfaceManager::getInstance()->log(finalString); + CInterfaceManager::getInstance()->log(finalString, CChatGroup::groupTypeToString(CChatGroup::tell)); // Open the free teller window CChatGroupWindow *pCGW = PeopleInterraction.getChatGroupWindow(); @@ -2747,8 +2768,8 @@ void updateInventoryFromStream (NLMISC::CBitMemStream &impulse, const CInventory impulse.serial( slotIndex, CInventoryCategoryTemplate::SlotBitSize ); // Access the database leaf - CCDBNodeBranch *slotNode = static_cast(inventoryNode->getNode( (uint16)slotIndex )); - ICDBNode *leafNode = slotNode->find( INVENTORIES::InfoVersionStr ); + CCDBNodeBranch *slotNode = safe_cast(inventoryNode->getNode( (uint16)slotIndex )); + CCDBNodeLeaf *leafNode = type_cast(slotNode->find( INVENTORIES::InfoVersionStr )); BOMB_IF( !leafNode, "Inventory slot property missing in database", continue ); // Apply or increment Info Version in database @@ -2756,13 +2777,13 @@ void updateInventoryFromStream (NLMISC::CBitMemStream &impulse, const CInventory { uint32 infoVersion; impulse.serial( infoVersion, INVENTORIES::InfoVersionBitSize ); - ((CCDBNodeLeaf*)leafNode)->setPropCheckGC( serverTick, infoVersion ); + leafNode->setPropCheckGC( serverTick, infoVersion ); } else { // NB: don't need to check GC on a info version upgrade, since this is always a delta of +1 // the order of received of this impulse is not important - ((CCDBNodeLeaf*)leafNode)->setValue64( ((CCDBNodeLeaf*)leafNode)->getValue64() + 1 ); + leafNode->setValue64( leafNode->getValue64() + 1 ); } } @@ -2777,10 +2798,10 @@ void updateInventoryFromStream (NLMISC::CBitMemStream &impulse, const CInventory //nldebug( "Inv %s Update %u", CInventoryCategoryTemplate::InventoryStr[invId], itemSlot.getSlotIndex() ); // Apply all properties to database - CCDBNodeBranch *slotNode = static_cast(inventoryNode->getNode( (uint16)itemSlot.getSlotIndex() )); + CCDBNodeBranch *slotNode = safe_cast(inventoryNode->getNode( (uint16)itemSlot.getSlotIndex() )); for ( uint i=0; i!=INVENTORIES::NbItemPropId; ++i ) { - CCDBNodeLeaf *leafNode = static_cast(slotNode->find( string(INVENTORIES::CItemSlot::ItemPropStr[i]) )); + CCDBNodeLeaf *leafNode = type_cast(slotNode->find( string(INVENTORIES::CItemSlot::ItemPropStr[i]) )); SKIP_IF( !leafNode, "Inventory slot property missing in database", continue ); leafNode->setPropCheckGC( serverTick, (sint64)itemSlot.getItemProp( ( INVENTORIES::TItemPropId)i ) ); } @@ -2796,8 +2817,8 @@ void updateInventoryFromStream (NLMISC::CBitMemStream &impulse, const CInventory //nldebug( "Inv %s Prop %u %s", CInventoryCategoryTemplate::InventoryStr[invId], itemSlot.getSlotIndex(), INVENTORIES::CItemSlot::ItemPropStr[itemSlot.getOneProp().ItemPropId] ); // Apply property to database - CCDBNodeBranch *slotNode = static_cast(inventoryNode->getNode( (uint16)itemSlot.getSlotIndex() )); - CCDBNodeLeaf *leafNode = safe_cast(slotNode->find( string(INVENTORIES::CItemSlot::ItemPropStr[itemSlot.getOneProp().ItemPropId]) )); + CCDBNodeBranch *slotNode = safe_cast(inventoryNode->getNode( (uint16)itemSlot.getSlotIndex() )); + CCDBNodeLeaf *leafNode = type_cast(slotNode->find( string(INVENTORIES::CItemSlot::ItemPropStr[itemSlot.getOneProp().ItemPropId]) )); SKIP_IF( !leafNode, "Inventory slot property missing in database", continue ); leafNode->setPropCheckGC( serverTick, (sint64)itemSlot.getOneProp().ItemPropValue ); @@ -2809,13 +2830,14 @@ void updateInventoryFromStream (NLMISC::CBitMemStream &impulse, const CInventory //nldebug( "Inv %s Reset %u", CInventoryCategoryTemplate::InventoryStr[invId], slotIndex ); // Reset all properties in database - CCDBNodeBranch *slotNode = static_cast(inventoryNode->getNode( (uint16)slotIndex )); + CCDBNodeBranch *slotNode = safe_cast(inventoryNode->getNode( (uint16)slotIndex )); for ( uint i=0; i!=INVENTORIES::NbItemPropId; ++i ) { // Instead of clearing all leaves (by index), we must find and clear only the // properties in TItemPropId, because the actual database leaves may have // less properties, and because we must not clear the leaf INFO_VERSION. - CCDBNodeLeaf *leafNode = safe_cast(slotNode->find( string(INVENTORIES::CItemSlot::ItemPropStr[i]) )); + // NOTE: For example, only player BAG inventory has WORNED leaf. + CCDBNodeLeaf *leafNode = type_cast(slotNode->find( string(INVENTORIES::CItemSlot::ItemPropStr[i]) )); SKIP_IF( !leafNode, "Inventory slot property missing in database", continue ); leafNode->setPropCheckGC( serverTick, 0 ); } @@ -4108,7 +4130,7 @@ void CNetManagerMulti::init( const std::string& cookie, const std::string& addr // uint32 ShardId = 0; -std::string WebServer = ""; +std::string WebServer; diff --git a/code/ryzom/client/src/network_connection.cpp b/code/ryzom/client/src/network_connection.cpp index 1fe002648..47d573ca2 100644 --- a/code/ryzom/client/src/network_connection.cpp +++ b/code/ryzom/client/src/network_connection.cpp @@ -2936,7 +2936,7 @@ void CNetworkConnection::initTicks() _CurrentClientTick = 0; _CurrentServerTick = 0; _MsPerTick = 100; - _LCT = 1000; + _LCT = LCT; } void CNetworkConnection::reinit() diff --git a/code/ryzom/client/src/network_connection.h b/code/ryzom/client/src/network_connection.h index 3eb5cd95b..da47f925e 100644 --- a/code/ryzom/client/src/network_connection.h +++ b/code/ryzom/client/src/network_connection.h @@ -776,16 +776,10 @@ protected: /// @name NLMISC::CEntityId handling (for gamedev) //@{ - class CHash + struct CHash { - public: - static const size_t bucket_size = 4; - static const size_t min_buckets = 8; - - CHash() {} - + enum { bucket_size = 4, min_buckets = 8, }; size_t operator () (const CLFECOMMON::TSheetId &id) const { return id; } - inline bool operator() (const CLFECOMMON::TSheetId &id1, const CLFECOMMON::TSheetId &id2) const { return (size_t)id1 < (size_t)id2; } }; diff --git a/code/ryzom/client/src/ping.cpp b/code/ryzom/client/src/ping.cpp index 5a07a2b9d..98d469592 100644 --- a/code/ryzom/client/src/ping.cpp +++ b/code/ryzom/client/src/ping.cpp @@ -14,7 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -#include +#include "stdpch.h" #include "ping.h" #include "interface_v3/interface_manager.h" diff --git a/code/ryzom/client/src/player_cl.cpp b/code/ryzom/client/src/player_cl.cpp index 4166dbec8..a050ac197 100644 --- a/code/ryzom/client/src/player_cl.cpp +++ b/code/ryzom/client/src/player_cl.cpp @@ -673,7 +673,7 @@ void CPlayerCL::updateVisualPropertyVpa(const NLMISC::TGameCycle &/* gameCycle * } // update title when gender changed - const ucstring replacement(STRING_MANAGER::CStringManagerClient::getTitleLocalizedName(_TitleRaw,_Gender == GSGENDER::female)); + const ucstring replacement(STRING_MANAGER::CStringManagerClient::getTitleLocalizedName(_TitleRaw, _Gender == GSGENDER::female)); if (!replacement.empty() || !ClientCfg.DebugStringManager) { // Get extended name diff --git a/code/ryzom/client/src/profiling.cpp b/code/ryzom/client/src/profiling.cpp index a5a0f770f..85805bbf4 100644 --- a/code/ryzom/client/src/profiling.cpp +++ b/code/ryzom/client/src/profiling.cpp @@ -14,7 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -#include +#include "stdpch.h" #include "profiling.h" // NeL includes diff --git a/code/ryzom/client/src/progress.cpp b/code/ryzom/client/src/progress.cpp index 0d5d4e4c9..2631984e7 100644 --- a/code/ryzom/client/src/progress.cpp +++ b/code/ryzom/client/src/progress.cpp @@ -33,6 +33,7 @@ #include "client_cfg.h" #include "bg_downloader_access.h" #include "nel/misc/system_utils.h" +#include "nel/3d/stereo_hmd.h" using namespace std; using namespace NLMISC; @@ -173,186 +174,252 @@ void CProgress::internalProgress (float value) if (Driver->AsyncListener.isKeyPushed (KeyUP)) selectTipsOfTheDay (TipsOfTheDayIndex+1); - // Font factor - float fontFactor = 1; - if (Driver->getWindowHeight() > 0) - fontFactor = (float)Driver->getWindowHeight() / 600.f; - fontFactor *= _FontFactor; - // Set 2d view. - Driver->setMatrixMode2D11(); - Driver->clearBuffers (CRGBA(0,0,0,0)); + // Create camera for stereo mode + bool stereoHMD = StereoHMD && !MainCam.empty() && (MainCam.getTransformMode() == UCamera::RotQuat); + CVector oldPos; + CQuat oldQuat; + if (stereoHMD) + { + MainCam.getPos(oldPos); + MainCam.getRotQuat(oldQuat); + StereoHMD->setInterfaceMatrix(CMatrix()); // identity + NLMISC::CQuat hmdOrient = StereoHMD->getOrientation(); + NLMISC::CMatrix camMatrix; + camMatrix.identity(); + NLMISC::CMatrix hmdMatrix; + hmdMatrix.setRot(hmdOrient); + NLMISC::CMatrix posMatrix; // minimal head modeling, will be changed in the future + posMatrix.translate(StereoHMD->getEyePosition()); + NLMISC::CMatrix mat = ((camMatrix * hmdMatrix) * posMatrix); + MainCam.setPos(mat.getPos()); + MainCam.setRotQuat(mat.getRot()); + StereoDisplay->updateCamera(0, &MainCam); + } + uint i = 0; + while ((!stereoHMD && i == 0) || (stereoHMD && StereoDisplay->nextPass())) + { + ++i; + if (stereoHMD) + { + // modify cameras for stereo display + const CViewport &vp = StereoDisplay->getCurrentViewport(); + Driver->setViewport(vp); + StereoDisplay->getCurrentMatrix(0, &MainCam); + StereoDisplay->getCurrentFrustum(0, &MainCam); - // Display the loading background. - drawLoadingBitmap (value); + // begin current pass + StereoDisplay->beginRenderTarget(); - // temporary values for conversions - float x, y, width, height; + nldebug("Cam pos: %f, %f, %f", MainCam.getPos().x, MainCam.getPos().y, MainCam.getPos().z); + } - for(uint i = 0; i < ClientCfg.Logos.size(); i++) - { - std::vector res; - explode(ClientCfg.Logos[i], std::string(":"), res); - if(res.size()==9 && iwantClear()) { - fromString(res[1], x); - fromString(res[2], y); - fromString(res[3], width); - fromString(res[4], height); - Driver->drawBitmap(x/(float)ClientCfg.Width, y/(float)ClientCfg.Height, width/(float)ClientCfg.Width, height/(float)ClientCfg.Height, *LogoBitmaps[i]); + Driver->clearBuffers(CRGBA(0, 0, 0, 0)); } - } - if (TextContext != NULL) - { - // Init the Pen. - TextContext->setKeep800x600Ratio(false); - TextContext->setColor(CRGBA(255,255,255)); - TextContext->setFontSize((uint)(12.f * fontFactor)); - TextContext->setHotSpot(UTextContext::TopRight); + if (stereoHMD && StereoDisplay->wantScene()) + { + Driver->setMatrixMode3D(MainCam); + } + + if (!stereoHMD || StereoDisplay->wantInterface2D()) + { + // nldebug("Draw progress 2D"); + + // Font factor + float fontFactor = 1; + if (Driver->getWindowHeight() > 0) + fontFactor = (float)Driver->getWindowHeight() / 600.f; + fontFactor *= _FontFactor; + + // Set 2d view. + Driver->setMatrixMode2D11(); + + // Display the loading background. + drawLoadingBitmap(value); + + // temporary values for conversions + float x, y, width, height; + + for(uint i = 0; i < ClientCfg.Logos.size(); i++) + { + std::vector res; + explode(ClientCfg.Logos[i], std::string(":"), res); + if(res.size()==9 && idrawBitmap(x/(float)ClientCfg.Width, y/(float)ClientCfg.Height, width/(float)ClientCfg.Width, height/(float)ClientCfg.Height, *LogoBitmaps[i]); + } + } + + if (TextContext != NULL) + { + // Init the Pen. + TextContext->setKeep800x600Ratio(false); + TextContext->setColor(CRGBA(255,255,255)); + TextContext->setFontSize((uint)(12.f * fontFactor)); + TextContext->setHotSpot(UTextContext::TopRight); #if !FINAL_VERSION - // Display the Text. - TextContext->printAt(1, 0.98f, _ProgressMessage); + // Display the Text. + TextContext->printAt(1, 0.98f, _ProgressMessage); #else - if( ClientCfg.LoadingStringCount > 0 ) - { - TextContext->printAt(1, 0.98f, _ProgressMessage); - } + if( ClientCfg.LoadingStringCount > 0 ) + { + TextContext->printAt(1, 0.98f, _ProgressMessage); + } #endif // FINAL_VERSION - // Display the build version. - TextContext->setFontSize((uint)(12.f * fontFactor)); - TextContext->setHotSpot(UTextContext::TopRight); - string str; + // Display the build version. + TextContext->setFontSize((uint)(12.f * fontFactor)); + TextContext->setHotSpot(UTextContext::TopRight); + string str; #if FINAL_VERSION - str = "FV "; + str = "FV "; #else - str = "DEV "; + str = "DEV "; #endif - str += RYZOM_VERSION; - TextContext->printfAt(1.0f,1.0f, str.c_str()); - - // Display the tips of the day. - TextContext->setFontSize((uint)(16.f * fontFactor)); - TextContext->setHotSpot(UTextContext::MiddleTop); - ucstring::size_type index = 0; - ucstring::size_type end = TipsOfTheDay.find((ucchar)'\n'); - if (end == string::npos) - end = TipsOfTheDay.size(); - float fY = ClientCfg.TipsY; - if (!TipsOfTheDay.empty()) - { - while (index < end) - { - // Get the line - ucstring line = TipsOfTheDay.substr (index, end-index); - - // Draw the line - TextContext->printAt(0.5f, fY, line); - fY = nextLine (TextContext->getFontSize(), Driver->getWindowHeight(), fY); - - index=end+1; - end = TipsOfTheDay.find((ucchar)'\n', index); - if (end == ucstring::npos) + str += RYZOM_VERSION; + TextContext->printfAt(1.0f,1.0f, str.c_str()); + + // Display the tips of the day. + TextContext->setFontSize((uint)(16.f * fontFactor)); + TextContext->setHotSpot(UTextContext::MiddleTop); + ucstring::size_type index = 0; + ucstring::size_type end = TipsOfTheDay.find((ucchar)'\n'); + if (end == string::npos) end = TipsOfTheDay.size(); - } + float fY = ClientCfg.TipsY; + if (!TipsOfTheDay.empty()) + { + while (index < end) + { + // Get the line + ucstring line = TipsOfTheDay.substr (index, end-index); - // More help - TextContext->setFontSize((uint)(12.f * fontFactor)); - /* todo tips of the day uncomment - ucstring ucstr = CI18N::get ("uiTipsEnd"); - TextContext->printAt(0.5f, fY, ucstr); */ - fY = nextLine (TextContext->getFontSize(), Driver->getWindowHeight(), fY); - fY = nextLine (TextContext->getFontSize(), Driver->getWindowHeight(), fY); - } + // Draw the line + TextContext->printAt(0.5f, fY, line); + fY = nextLine (TextContext->getFontSize(), Driver->getWindowHeight(), fY); + index=end+1; + end = TipsOfTheDay.find((ucchar)'\n', index); + if (end == ucstring::npos) + end = TipsOfTheDay.size(); + } + // More help + TextContext->setFontSize((uint)(12.f * fontFactor)); + /* todo tips of the day uncomment + ucstring ucstr = CI18N::get ("uiTipsEnd"); + TextContext->printAt(0.5f, fY, ucstr); */ + fY = nextLine (TextContext->getFontSize(), Driver->getWindowHeight(), fY); + fY = nextLine (TextContext->getFontSize(), Driver->getWindowHeight(), fY); + } - if (!_TPReason.empty()) - { - TextContext->setHotSpot(UTextContext::MiddleMiddle); - TextContext->setFontSize((uint)(14.f * fontFactor)); - TextContext->printAt(0.5f, 0.5f, _TPReason); - TextContext->setHotSpot(UTextContext::BottomLeft); - TextContext->setColor(NLMISC::CRGBA::White); - } + if (!_TPReason.empty()) + { + TextContext->setHotSpot(UTextContext::MiddleMiddle); + TextContext->setFontSize((uint)(14.f * fontFactor)); + TextContext->printAt(0.5f, 0.5f, _TPReason); + TextContext->setHotSpot(UTextContext::BottomLeft); + TextContext->setColor(NLMISC::CRGBA::White); + } - if (!_TPCancelText.empty()) - { - if (ClientCfg.Width != 0 && ClientCfg.Height != 0) - { - TextContext->setFontSize((uint)(15.f * fontFactor)); - TextContext->setHotSpot(UTextContext::BottomLeft); - ucstring uc = CI18N::get("uiR2EDTPEscapeToInteruptLoading") + " (" + _TPCancelText + ") - " + CI18N::get("uiDelayedTPCancel"); - UTextContext::CStringInfo info = TextContext->getStringInfo(uc); - float stringX = 0.5f - info.StringWidth/(ClientCfg.Width*2); - TextContext->printAt(stringX, 7.f / ClientCfg.Height, uc); - } - } + if (!_TPCancelText.empty()) + { + if (ClientCfg.Width != 0 && ClientCfg.Height != 0) + { + TextContext->setFontSize((uint)(15.f * fontFactor)); + TextContext->setHotSpot(UTextContext::BottomLeft); - // Teleport help - //fY = ClientCfg.TeleportInfoY; - if (!ApplyTextCommands && LoadingContinent && !LoadingContinent->Indoor) - { - TextContext->setFontSize((uint)(13.f * fontFactor)); - - // Print some more info - uint32 day = RT.getRyzomDay(); - str = toString (CI18N::get ("uiTipsTeleport").toUtf8().c_str(), - CI18N::get (LoadingContinent->LocalizedName).toUtf8().c_str(), - day, - (uint)RT.getRyzomTime(), - CI18N::get ("uiSeason"+toStringEnum(CRyzomTime::getSeasonByDay(day))).toUtf8().c_str(), - CI18N::get (WeatherManager.getCurrWeatherState().LocalizedName).toUtf8().c_str()); - ucstring ucstr; - ucstr.fromUtf8 (str); - TextContext->setHotSpot(UTextContext::MiddleBottom); - TextContext->setColor(CRGBA(186, 179, 163, 255)); - TextContext->printAt(0.5f, 25/768.f, ucstr); - } + ucstring uc = CI18N::get("uiR2EDTPEscapeToInteruptLoading") + " (" + _TPCancelText + ") - " + CI18N::get("uiDelayedTPCancel"); + UTextContext::CStringInfo info = TextContext->getStringInfo(uc); + float stringX = 0.5f - info.StringWidth/(ClientCfg.Width*2); + TextContext->printAt(stringX, 7.f / ClientCfg.Height, uc); + } + } - // apply text commands - if( ApplyTextCommands ) - { - std::vector printfCommands = ClientCfg.PrintfCommands; - if(FreeTrial) printfCommands = ClientCfg.PrintfCommandsFreeTrial; - if( !printfCommands.empty() ) - { - TextContext->setHotSpot(UTextContext::MiddleBottom); + // Teleport help + //fY = ClientCfg.TeleportInfoY; + if (!ApplyTextCommands && LoadingContinent && !LoadingContinent->Indoor) + { + TextContext->setFontSize((uint)(13.f * fontFactor)); + + // Print some more info + uint32 day = RT.getRyzomDay(); + str = toString (CI18N::get ("uiTipsTeleport").toUtf8().c_str(), + CI18N::get (LoadingContinent->LocalizedName).toUtf8().c_str(), + day, + (uint)RT.getRyzomTime(), + CI18N::get ("uiSeason"+toStringEnum(CRyzomTime::getSeasonByDay(day))).toUtf8().c_str(), + CI18N::get (WeatherManager.getCurrWeatherState().LocalizedName).toUtf8().c_str()); + ucstring ucstr; + ucstr.fromUtf8 (str); + TextContext->setHotSpot(UTextContext::MiddleBottom); + TextContext->setColor(CRGBA(186, 179, 163, 255)); + TextContext->printAt(0.5f, 25/768.f, ucstr); + } - vector::iterator itpc; - for( itpc = printfCommands.begin(); itpc != printfCommands.end(); ++itpc ) + // apply text commands + if( ApplyTextCommands ) { - float x = 0.5f;//((*itpc).X / 1024.f); - float y = ((*itpc).Y / 768.f); - TextContext->setColor( (*itpc).Color ); - TextContext->setFontSize( (uint)(16.f * fontFactor)); - - // build the ucstr(s) - ucstring ucstr = CI18N::get((*itpc).Text); - vector vucstr; - ucstring sep("\n"); - splitUCString(ucstr,sep,vucstr); - - // Letter size - UTextContext::CStringInfo si = TextContext->getStringInfo(ucstring("|")); - uint fontHeight = (uint) si.StringHeight + 2; // we add 2 pixels for the gap - - uint i; - float newy = y; - for( i=0; i printfCommands = ClientCfg.PrintfCommands; + if(FreeTrial) printfCommands = ClientCfg.PrintfCommandsFreeTrial; + + if( !printfCommands.empty() ) { - TextContext->printAt(x,newy, vucstr[i]); - newy = nextLine(fontHeight, Driver->getWindowHeight(), newy); + TextContext->setHotSpot(UTextContext::MiddleBottom); + + vector::iterator itpc; + for( itpc = printfCommands.begin(); itpc != printfCommands.end(); ++itpc ) + { + float x = 0.5f;//((*itpc).X / 1024.f); + float y = ((*itpc).Y / 768.f); + TextContext->setColor( (*itpc).Color ); + TextContext->setFontSize( (uint)(16.f * fontFactor)); + + // build the ucstr(s) + ucstring ucstr = CI18N::get((*itpc).Text); + vector vucstr; + ucstring sep("\n"); + splitUCString(ucstr,sep,vucstr); + + // Letter size + UTextContext::CStringInfo si = TextContext->getStringInfo(ucstring("|")); + uint fontHeight = (uint) si.StringHeight + 2; // we add 2 pixels for the gap + + uint i; + float newy = y; + for( i=0; iprintAt(x,newy, vucstr[i]); + newy = nextLine(fontHeight, Driver->getWindowHeight(), newy); + } + } } } } } + + if (stereoHMD) + { + StereoDisplay->endRenderTarget(); + } + } /* stereo loop */ + + if (stereoHMD) + { + MainCam.setPos(oldPos); + MainCam.setRotQuat(oldQuat); } // Clamp diff --git a/code/ryzom/client/src/r2/displayer_visual_entity.cpp b/code/ryzom/client/src/r2/displayer_visual_entity.cpp index 37632f4d4..5bc8638f0 100644 --- a/code/ryzom/client/src/r2/displayer_visual_entity.cpp +++ b/code/ryzom/client/src/r2/displayer_visual_entity.cpp @@ -564,7 +564,7 @@ void CDisplayerVisualEntity::updateWorldMapPresence() _MapDeco.setDisplayedInstance(getDisplayedInstance(), true); // retrieve icon from the displayed object (lua code) CLuaState &ls = getEditor().getLua(); - std::string texName = ""; + std::string texName; { CLuaStackChecker lsc(&ls); if (getDisplayedInstance()->getLuaProjection().callMethodByNameNoThrow("getSelectBarIcon", 0, 1)) @@ -984,7 +984,7 @@ void CDisplayerVisualEntity::updateName() break; } } - std::string firstPart = ""; + std::string firstPart; if(actNb>0) firstPart = CI18N::get("uiR2EDDefaultActTitle").toString() + " " + NLMISC::toString(actNb); diff --git a/code/ryzom/client/src/r2/dmc/client_edition_module.cpp b/code/ryzom/client/src/r2/dmc/client_edition_module.cpp index 0a5f74cc5..5d00cdc2b 100644 --- a/code/ryzom/client/src/r2/dmc/client_edition_module.cpp +++ b/code/ryzom/client/src/r2/dmc/client_edition_module.cpp @@ -1116,12 +1116,12 @@ void CClientEditionModule::startingScenario(class NLNET::IModuleProxy * /* serve uint32 myUserId = NetMngr.getUserId(); - std::string connectionState = ""; + std::string connectionState; if (myUserId == (charId>>4) || ClientCfg.Local) { - std::string errorMsg = ""; + std::string errorMsg; CObject* hlScenario = _Scenario->getHighLevel(); hlData.setData(hlScenario); // clone before modify by translateFeatures @@ -1352,8 +1352,8 @@ bool CClientEditionModule::loadUserComponent(const std::string& filename, bool m } } - std::string sourceExtension = UserComponentsSourceExtension; - std::string componentExtension = UserComponentsComponentExtension; + std::string sourceExtension = UserComponentsSourceExtension.get(); + std::string componentExtension = UserComponentsComponentExtension.get(); uint32 uncompressedFileLength = 0; @@ -2425,10 +2425,10 @@ bool CClientEditionModule::addToLoadList( const std::string& filename, CScenario void CClientEditionModule::loadScenarioSucceded(const std::string& filename, const std::string& body, const CScenarioValidator::TValues& values) { //H_AUTO(R2_CClientEditionModule_loadScenarioSucceded) - string initialIsland="", initialEntryPoint="", initialSeason = ""; - string creatorMD5 = "", modifiedByMD5=""; - string name = ""; - string locked = ""; + string initialIsland, initialEntryPoint, initialSeason; + string creatorMD5, modifiedByMD5; + string name; + string locked; for(uint i=0; i& pair = values[i]; diff --git a/code/ryzom/client/src/r2/dmc/com_lua_module.cpp b/code/ryzom/client/src/r2/dmc/com_lua_module.cpp index b91aca95c..b73813786 100644 --- a/code/ryzom/client/src/r2/dmc/com_lua_module.cpp +++ b/code/ryzom/client/src/r2/dmc/com_lua_module.cpp @@ -238,7 +238,15 @@ void CComLuaModule::initLuaLib() }; int initialStackSize = lua_gettop(_LuaState); #if LUA_VERSION_NUM >= 502 - luaL_newlib(_LuaState, methods); + // luaL_newlib(_LuaState, methods); + // lua_setglobal(_LuaState, R2_LUA_PATH); + lua_getglobal(_LuaState, R2_LUA_PATH); + if (lua_isnil(_LuaState, -1)) + { + lua_pop(_LuaState, 1); + lua_newtable(_LuaState); + } + luaL_setfuncs(_LuaState, methods, 0); lua_setglobal(_LuaState, R2_LUA_PATH); #else luaL_openlib(_LuaState, R2_LUA_PATH, methods, 0); @@ -826,7 +834,7 @@ sint CComLuaModule::luaRequestEraseNode(lua_State* state) if (args>2) { luaL_checknumber(state, 3); } std::string instanceId(lua_tostring(state, 1)); - std::string attrName = ""; + std::string attrName; sint position = -1; if (args>1){ attrName = lua_tostring(state, 2);} if (args>2){ position = static_cast(lua_tonumber(state, 3));} @@ -1247,7 +1255,7 @@ CObject* CComLuaModule::getObjectFromLua(lua_State* state, sint idx) lua_pushnil(state); while (lua_next(state, -2) != 0) { - std::string key = ""; + std::string key; if ( lua_type(state, -2) == LUA_TSTRING) { key = lua_tostring(state, -2); @@ -1277,7 +1285,7 @@ CObject* CComLuaModule::getObjectFromLua(lua_State* state, sint idx) CObject* CComLuaModule::loadLocal(const std::string& filename, const CScenarioValidator::TValues& values) { CScenarioValidator::TValues::const_iterator first(values.begin()), last(values.end()); - std::string name = ""; + std::string name; for (; first != last; ++first) { if (first->first == "Name" ) { name = first->second; } @@ -1339,7 +1347,7 @@ bool CComLuaModule::loadUserComponent(const std::string& filename) CObject* CComLuaModule::loadFromBuffer(const std::string& data, const std::string& filename, const CScenarioValidator::TValues& values) { CScenarioValidator::TValues::const_iterator first(values.begin()), last(values.end()); - std::string name = ""; + std::string name; for (; first != last; ++first) { if (first->first == "Name" ) { name = first->second; } diff --git a/code/ryzom/client/src/r2/dmc/dmc.cpp b/code/ryzom/client/src/r2/dmc/dmc.cpp index 4642dfa10..0659f0a56 100644 --- a/code/ryzom/client/src/r2/dmc/dmc.cpp +++ b/code/ryzom/client/src/r2/dmc/dmc.cpp @@ -267,7 +267,7 @@ void CDynamicMapClient::save(const std::string& /* filename */) void CDynamicMapClient::saveRtData(const std::string& filename) { //H_AUTO(R2_CDynamicMapClient_saveRtData) - std::string name = ""; + std::string name; name += filename; //std::ostringstream out2; std::string out2; diff --git a/code/ryzom/client/src/r2/editor.cpp b/code/ryzom/client/src/r2/editor.cpp index bb09bec52..aa5995b05 100644 --- a/code/ryzom/client/src/r2/editor.cpp +++ b/code/ryzom/client/src/r2/editor.cpp @@ -1789,6 +1789,7 @@ void CEditor::waitScenarioScreen() if (!waitScreen) { TextContext->setShaded(true); + TextContext->setShadeOutline(false); TextContext->setFontSize(40); TextContext->setColor(CRGBA::White); @@ -5292,10 +5293,8 @@ void CEditor::onTestModeDisconnected(TSessionId sessionId, uint32 lastAct, TSce //H_AUTO(R2_CEditor_onTestModeDisconnected) CHECK_EDITOR _DMC->CDynamicMapClient::onTestModeDisconnected(sessionId, lastAct, sessionType); - } - // ********************************************************************************************************* void CEditor::nodeInserted(const std::string& instanceId, const std::string& attrName, sint32 position, const std::string& key, CObject* value) { @@ -6610,7 +6609,7 @@ NLMISC::CVectorD getVectorD(const CObject *obj) CObject *buildVector(const NLMISC::CVectorD &vector, const std::string &instanceId /*= ""*/) { CObject *table; - if (instanceId.empty() ) + if (instanceId.empty()) { table = getEditor().getDMC().newComponent("Position"); table->set("x", vector.x); diff --git a/code/ryzom/client/src/release.cpp b/code/ryzom/client/src/release.cpp index b40d68b35..f88849197 100644 --- a/code/ryzom/client/src/release.cpp +++ b/code/ryzom/client/src/release.cpp @@ -27,6 +27,7 @@ #include "nel/misc/system_utils.h" // 3D Interface. #include "nel/3d/bloom_effect.h" +#include "nel/3d/fxaa.h" #include "nel/3d/fasthls_modifier.h" #include "nel/3d/particle_system_manager.h" #include "nel/3d/particle_system.h" @@ -120,7 +121,6 @@ extern bool userChar; extern bool serverReceivedReady; extern bool CharNameValidArrived; - extern void releaseContextualCursor(); extern void selectTipsOfTheDay (uint tips); @@ -498,7 +498,8 @@ void releaseOutGame() // Remove the Actions listener from the Events Server. EventsListener.removeFromServer(CInputHandlerManager::getInstance()->FilteredEventServer); - // Release Bloom + // Release effects + delete FXAA; FXAA = NULL; CBloomEffect::releaseInstance(); // Release Scene, textcontexts, materials, ... @@ -516,6 +517,16 @@ void releaseStereoDisplayDevice() { if (StereoDisplay) { + StereoDisplay->getOriginalFrustum(0, &MainCam); + if (SceneRoot) + { + UCamera cam = SceneRoot->getCam(); + StereoDisplay->getOriginalFrustum(1, &cam); + } + nlassert(Driver); + Driver->setViewport(NL3D::CViewport()); + nlassert(Scene); + Scene->setViewport(NL3D::CViewport()); delete StereoDisplay; StereoDisplay = NULL; StereoHMD = NULL; @@ -582,7 +593,8 @@ void release() Driver->deleteTextContext(TextContext); TextContext = NULL; - // Release Bloom + // Release effects + delete FXAA; FXAA = NULL; CBloomEffect::releaseInstance(); // Release Scene, textcontexts, materials, ... @@ -650,12 +662,12 @@ void release() delete &CLuaManager::getInstance(); NLGUI::CDBManager::release(); CWidgetManager::release(); - + #if FINAL_VERSION - // openURL ("http://ryzom.com/exit/"); + // openURL ("http://www.ryzomcore.org/exit/"); #endif }// release // diff --git a/code/ryzom/client/src/scene_parser.cpp b/code/ryzom/client/src/scene_parser.cpp index 1108f3a19..484c00129 100644 --- a/code/ryzom/client/src/scene_parser.cpp +++ b/code/ryzom/client/src/scene_parser.cpp @@ -123,7 +123,7 @@ void CSceneParser::load(const string &filename) char *ptr = strtok(tmpBuff, delimiter); if(ptr != NULL) - _FrameRate = atof(ptr); + NLMISC::fromString(ptr, _FrameRate); } // Close the speed file. @@ -1693,7 +1693,7 @@ void CSceneParser::loadScene(const string &filename) ptr = strtok(NULL, delimiter); if(ptr != NULL) { - seq.second = atof(ptr); + NLMISC::fromString(ptr, seq.second); _Scene.push_back(seq); } } diff --git a/code/ryzom/client/src/session_browser_impl.h b/code/ryzom/client/src/session_browser_impl.h index 6235128b0..302da2864 100644 --- a/code/ryzom/client/src/session_browser_impl.h +++ b/code/ryzom/client/src/session_browser_impl.h @@ -21,7 +21,6 @@ #include "session_browser.h" #include "game_share/ring_session_manager_itf.h" #include "nel/gui/lua_helper.h" -using namespace NLGUI; #include "far_tp.h" class CSessionBrowserImpl : public CSessionBrowser, @@ -37,7 +36,7 @@ public: * - RingAccessPoint:onConnectionClosed() * - RingAccessPoint:onConnectionFailed() */ - void init(CLuaState *ls); + void init(NLGUI::CLuaState *ls); // from CSessionBrowser virtual void on_connectionFailed(); virtual void on_connectionClosed(); @@ -99,17 +98,17 @@ public: static const std::string &getFrontEndAddress(); private: - CLuaState::TRefPtr _Lua; - static int luaGetRingSessionList(CLuaState &ls); - static int luaGetRingCharList(CLuaState &ls); - static int luaJoinRingSession(CLuaState &ls); - static int luaCheckRingAccess(CLuaState &ls); - static int luaGetFileHeader(CLuaState &ls); - static int luaGetRingStats(CLuaState &ls); - static int luaGetScenarioScores(CLuaState &ls); - static int luaUpdateScenarioScores(CLuaState &ls); - static int luaGetSessionAverageScores(CLuaState &ls); - static int luaGetScenarioAverageScores(CLuaState &ls); + NLGUI::CLuaState::TRefPtr _Lua; + static int luaGetRingSessionList(NLGUI::CLuaState &ls); + static int luaGetRingCharList(NLGUI::CLuaState &ls); + static int luaJoinRingSession(NLGUI::CLuaState &ls); + static int luaCheckRingAccess(NLGUI::CLuaState &ls); + static int luaGetFileHeader(NLGUI::CLuaState &ls); + static int luaGetRingStats(NLGUI::CLuaState &ls); + static int luaGetScenarioScores(NLGUI::CLuaState &ls); + static int luaUpdateScenarioScores(NLGUI::CLuaState &ls); + static int luaGetSessionAverageScores(NLGUI::CLuaState &ls); + static int luaGetScenarioAverageScores(NLGUI::CLuaState &ls); // Call a method inside the 'RingAccessPoint' lua table void callRingAccessPointMethod(const char *name, int numArg, int numResult); void callRingCharTrackingMethod(const char *name, int numArg, int numResult); diff --git a/code/ryzom/client/src/sky.cpp b/code/ryzom/client/src/sky.cpp index d5a9216ce..855ab3387 100644 --- a/code/ryzom/client/src/sky.cpp +++ b/code/ryzom/client/src/sky.cpp @@ -235,7 +235,7 @@ uint CSky::setup(const CClientDate &date, const CClientDate &animationDate, floa // animate objects if (_PlayListManager) { - double globalDate = ((double) _NumHourInDay * date.Day + (double) date.Hour) / _NumHourInDay; + double globalDate = (double)date.Hour / (double)_NumHourInDay; //nlinfo("global date = %f", (float) globalDate); _PlayListManager->animate(_AnimLengthInSeconds * globalDate); } diff --git a/code/ryzom/client/src/sound_manager.cpp b/code/ryzom/client/src/sound_manager.cpp index f87c6cdee..4a981366d 100644 --- a/code/ryzom/client/src/sound_manager.cpp +++ b/code/ryzom/client/src/sound_manager.cpp @@ -106,11 +106,11 @@ enum TFilterMapping // constructor //----------------------------------------------- CSoundManager::CSoundManager(IProgressCallback * /* progressCallBack */) -: _AudioMixer(NULL), +: _AudioMixer(NULL), _GroupControllerEffects(NULL), - _GroupControllerEffectsGame(NULL), - _EnvSoundRoot(NULL), - _Sources(NULL), + _GroupControllerEffectsGame(NULL), + _EnvSoundRoot(NULL), + _Sources(NULL), _UserEntitySoundLevel(1.0f) { _EnableBackgroundMusicAtTime= 0; diff --git a/code/ryzom/client/src/stdpch.h b/code/ryzom/client/src/stdpch.h index 48451ceea..96a509e0f 100644 --- a/code/ryzom/client/src/stdpch.h +++ b/code/ryzom/client/src/stdpch.h @@ -55,7 +55,6 @@ #include #include #include -#include #include #include #include @@ -120,7 +119,9 @@ // Foutez pas d'include du client ici svp ! Grrr ! Hulud #ifdef NL_OS_WINDOWS -#define NOMINMAX -#include -#include +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif +# include +# include #endif // NL_OS_WINDOWS diff --git a/code/ryzom/client/src/time_client.h b/code/ryzom/client/src/time_client.h index 9243a908d..b3327ee76 100644 --- a/code/ryzom/client/src/time_client.h +++ b/code/ryzom/client/src/time_client.h @@ -48,7 +48,7 @@ extern sint64 DT64; // Diff time with current and last frame in ms. extern float DT; // Diff time with current and last frame in sec. extern TTime TSend; // Next Time to send motions. extern TTime DTSend; // Delta of time to generate the next time to send motions. - extern double TimeInSec; // Time for the current frame in second. +extern double TimeInSec; // Time for the current frame in second. extern double FirstTimeInSec; // Game local origin time diff --git a/code/ryzom/client/src/timed_fx_manager.cpp b/code/ryzom/client/src/timed_fx_manager.cpp index 9f7f40caf..d37ab782f 100644 --- a/code/ryzom/client/src/timed_fx_manager.cpp +++ b/code/ryzom/client/src/timed_fx_manager.cpp @@ -829,6 +829,7 @@ void CTimedFXManager::displayFXBoxes(TDebugDisplayMode displayMode) const Driver->setFrustum(fr); TextContext->setColor(CRGBA::Blue); TextContext->setShaded(false); + TextContext->setShadeOutline(false); TextContext->setFontSize(10); // float size = 0.4f; diff --git a/code/ryzom/client/src/user_agent.cpp b/code/ryzom/client/src/user_agent.cpp index af07e8b86..1452aa584 100644 --- a/code/ryzom/client/src/user_agent.cpp +++ b/code/ryzom/client/src/user_agent.cpp @@ -21,7 +21,7 @@ #include "game_share/ryzom_version.h" -#ifdef HAVE_REVISION_H +#if defined(RYZOM_COMPATIBILITY_VERSION) && defined(HAVE_REVISION_H) #include "revision.h" #endif @@ -45,6 +45,16 @@ #endif std::string getUserAgent() +{ + return getUserAgentName() + "/" + getUserAgentVersion(); +} + +std::string getUserAgentName() +{ + return "Ryzom"; +} + +std::string getUserAgentVersion() { static std::string s_userAgent; @@ -52,8 +62,9 @@ std::string getUserAgent() { char buffer[256]; -#ifdef REVISION - sprintf(buffer, "%s.%s-%s-%s", RYZOM_VERSION, REVISION, RYZOM_SYSTEM, RYZOM_ARCH); +#if defined(REVISION) && defined(RYZOM_COMPATIBILITY_VERSION) + // we don't need RYZOM_VERSION if we already have a numeric form a.b.c, we just need to append revision to it + sprintf(buffer, "%s.%s-%s-%s", RYZOM_COMPATIBILITY_VERSION, REVISION, RYZOM_SYSTEM, RYZOM_ARCH); #else sprintf(buffer, "%s-%s-%s", RYZOM_VERSION, RYZOM_SYSTEM, RYZOM_ARCH); #endif diff --git a/code/ryzom/client/src/user_agent.h b/code/ryzom/client/src/user_agent.h index e42635871..bc508273d 100644 --- a/code/ryzom/client/src/user_agent.h +++ b/code/ryzom/client/src/user_agent.h @@ -18,6 +18,8 @@ #define CL_USER_AGENT_H std::string getUserAgent(); +std::string getUserAgentName(); +std::string getUserAgentVersion(); #endif // CL_USER_AGENT_H diff --git a/code/ryzom/client/src/user_entity.cpp b/code/ryzom/client/src/user_entity.cpp index c8652fd43..62d45f330 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 // //----------------------------------------------- @@ -2384,10 +2384,13 @@ void CUserEntity::updateSound(const TTime &time) if (SoundMngr == 0) return; - SoundMngr->setListenerPos(pos()); - const CMatrix &camMat = MainCam.getMatrix(); - SoundMngr->setListenerOrientation(camMat.getJ(), camMat.getK()); - + if (!(StereoHMD && true)) // TODO: ClientCfg.Headphone + { + // NOTE: StereoHMD+Headphone impl in main_loop.cpp + SoundMngr->setListenerPos(pos()); + const CMatrix &camMat = MainCam.getMatrix(); + SoundMngr->setListenerOrientation(camMat.getJ(), camMat.getK()); + } if (ClientCfg.Light) return; diff --git a/code/ryzom/common/data_common/database.xml b/code/ryzom/common/data_common/database.xml index 6157693c6..d14b9662e 100644 --- a/code/ryzom/common/data_common/database.xml +++ b/code/ryzom/common/data_common/database.xml @@ -1512,6 +1512,8 @@ type="I5" /> + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/code/ryzom/common/data_common/r2/r2_logic.lua b/code/ryzom/common/data_common/r2/r2_logic.lua index 1ee35d562..d50a15faf 100644 --- a/code/ryzom/common/data_common/r2/r2_logic.lua +++ b/code/ryzom/common/data_common/r2/r2_logic.lua @@ -1679,7 +1679,7 @@ Logic.translateChatSequences = function (context, hlComponent, behavior, rtNpcGr event.Name = "activity_sequence_changed" table.insert(context.RtAct.Events, event) - local rtInitChatStep = r2.Translator.createAction("code", "oldChatStepVar = -1;\n" .. Logic.chatStepVar .." = 0;\n()setTimer(1, " ..Logic.chatTimerId .. ")\;\n") + local rtInitChatStep = r2.Translator.createAction("code", "oldChatStepVar = -1;\n" .. Logic.chatStepVar .." = 0;\n()setTimer(1, " ..Logic.chatTimerId .. ");\n") rtInitChatStep.Name = "init_chat_step" table.insert(context.RtAct.Actions, rtInitChatStep) table.insert(event.ActionsId, rtInitChatStep.Id) diff --git a/code/ryzom/common/data_common/r2/r2_misc.lua b/code/ryzom/common/data_common/r2/r2_misc.lua index ee9e2885e..d85744bd0 100644 --- a/code/ryzom/common/data_common/r2/r2_misc.lua +++ b/code/ryzom/common/data_common/r2/r2_misc.lua @@ -28,6 +28,19 @@ function forEach(table, fn) end end + +------------------------------------------------------------------------------------------------------------ +-- whatever +table.setn = function(table, n) + assert(table) + local mt = getmetatable(table) + if mt ~= nil then + if mt.__next ~= nil then + table.Size = n + end + end +end + ------------------------------------------------------------------------------------------------------------ -- extension to table library : remove all content of a table without deleting the table object function table.clear(tbl) @@ -175,6 +188,17 @@ function strify(str) return [["]] .. tostring(str) .. [["]] end +------------------------------------------------------------------------------------------------- +-- enclose a string by double quotes +function strifyXml(str) + local strxml = string.gsub(tostring(str), ">", ">") + strxml = string.gsub(strxml, "<", "<") + strxml = string.gsub(strxml, "&", "&") + strxml = string.gsub(strxml, "'", "'") + strxml = string.gsub(strxml, '"', """) + return [["]] .. strxml .. [["]] +end + ------------------------------------------------------------------------------------------------------------ -- snap a position to ground, returning the z snapped coordinate function r2:snapZToGround(x, y) @@ -251,26 +275,37 @@ end -assert(table.getn ~= nil) -- default lib should have been opened +-- assert(table.getn ~= nil) -- default lib should have been opened + +--if oldTableGetnFunction == nil then +-- oldTableGetnFunction = table.getn +--end +-- +--table.getn = function(table) +-- assert(table) +-- local mt = getmetatable(table) +-- if mt ~= nil then +-- if mt.__next ~= nil then +-- return table.Size +-- end +-- end +-- return oldTableGetnFunction(table) +--end -if oldTableGetnFunction == nil then - oldTableGetnFunction = table.getn -end table.getn = function(table) assert(table) local mt = getmetatable(table) if mt ~= nil then if mt.__next ~= nil then - return table.Size + return table.Size end end - return oldTableGetnFunction(table) + return #table end - -- redefine the hardcoded 'pairs' function to use the redefined 'next' -- hardcoded version uses the C version of next, not the lua one if it has been redefined diff --git a/code/ryzom/common/data_common/r2/r2_translator.lua b/code/ryzom/common/data_common/r2/r2_translator.lua index 600928d98..e1c4701ba 100644 --- a/code/ryzom/common/data_common/r2/r2_translator.lua +++ b/code/ryzom/common/data_common/r2/r2_translator.lua @@ -541,7 +541,7 @@ Translator.translateEventHandlers = function(context, hlNpc, eventHandlers, rtNp while k do local caller = nil if devMode then - caller = function (...) arg[1](arg[2], arg[3], arg[4], arg[5]) return true end + caller = function (...) local arg = {...} arg[1](arg[2], arg[3], arg[4], arg[5]) return true end else caller = pcall @@ -898,6 +898,7 @@ end -- Returns a RtNpcEventHandlerAction if the action is allowed --first parameter: action type Translator.createAction = function(...) + local arg = {...} local debug=config.R2EDExtendedDebug local function header(toto) @@ -2774,6 +2775,7 @@ end --third param : GroupsByName --then, parameters Translator.createEvent = function(...) + local arg = {...} local event = r2.newComponent("RtNpcEventHandler") local eventType = arg[1] event.Event = eventType diff --git a/code/ryzom/common/data_common/r2/r2_ui_event_handlers.lua b/code/ryzom/common/data_common/r2/r2_ui_event_handlers.lua index 0cd5c8638..431d89eae 100644 --- a/code/ryzom/common/data_common/r2/r2_ui_event_handlers.lua +++ b/code/ryzom/common/data_common/r2/r2_ui_event_handlers.lua @@ -1030,6 +1030,7 @@ end -------------------- -------------------- function r2:updateAnimBarActions(...) + local arg = {...} -- forward to the real anim bar r2.ui.AnimBar:updateActions(arg) end diff --git a/code/ryzom/common/data_common/r2/r2_ui_forms.lua b/code/ryzom/common/data_common/r2/r2_ui_forms.lua index ae1b4d656..587581f26 100644 --- a/code/ryzom/common/data_common/r2/r2_ui_forms.lua +++ b/code/ryzom/common/data_common/r2/r2_ui_forms.lua @@ -328,7 +328,7 @@ end local function saveScenarioOnChange(formInstance) r2.print(formInstance.Name) - local name = string.gsub(formInstance.Name, "[\\\/\:\*\?\"\<\>\|]", "_") + local name = string.gsub(formInstance.Name, "[\\/:*?\"<>|]", "_") if name ~= formInstance.Name then fromInstance.Name = name formInstance.Modified = true diff --git a/code/ryzom/common/data_common/r2/r2_ui_property_sheet.lua b/code/ryzom/common/data_common/r2/r2_ui_property_sheet.lua index 962eaf315..e4fbd4632 100644 --- a/code/ryzom/common/data_common/r2/r2_ui_property_sheet.lua +++ b/code/ryzom/common/data_common/r2/r2_ui_property_sheet.lua @@ -47,13 +47,13 @@ function r2:buildEditBox(prop, textRef, entryType, multiLine, maxNumChars, onCha bg_texture="grey_40.tga" onchange="lua" onchange_params="getUICaller():setupDisplayText(); getUICaller():find('edit_text'):updateCoords(); getUICaller():getEnclosingContainer().Env.updateSize()" onenter="lua" on_focus_lost="lua"]] .. - [[ id= ]] .. strify(prop.Name) .. - [[ text_ref = ]] .. strify(textRef) .. - [[ entry_type = ]] .. strify(entryType) .. - [[ multi_line = ]] .. strify(multiLine) .. - [[ max_num_chars = ]] .. strify(maxNumChars) .. - [[ params = ]] .. strify(onChangeAction) .. - [[ on_focus_lost_params = ]] .. strify(onFocusLostAction) .. + [[ id= ]] .. strifyXml(prop.Name) .. + [[ text_ref = ]] .. strifyXml(textRef) .. + [[ entry_type = ]] .. strifyXml(entryType) .. + [[ multi_line = ]] .. strifyXml(multiLine) .. + [[ max_num_chars = ]] .. strifyXml(maxNumChars) .. + [[ params = ]] .. strifyXml(onChangeAction) .. + [[ on_focus_lost_params = ]] .. strifyXml(onFocusLostAction) .. "/>" return result end @@ -73,13 +73,13 @@ end -- bg_texture="grey_40.tga" -- onchange="lua" onchange_params="getUICaller():setupDisplayText(); getUICaller():find('edit_text'):updateCoords(); getUICaller():getEnclosingContainer().Env.updateSize()" -- onenter="lua" on_focus_lost="lua"]] .. --- [[ id= ]] .. strify(prop.Name) .. --- [[ text_ref = ]] .. strify(textRef) .. --- [[ entry_type = ]] .. strify(entryType) .. --- [[ multi_line = ]] .. strify(multiLine) .. --- [[ max_num_chars = ]] .. strify(maxNumChars) .. --- [[ params = ]] .. strify(onChangeAction) .. --- [[ on_focus_lost_params = ]] .. strify(onChangeAction) .. +-- [[ id= ]] .. strifyXml(prop.Name) .. +-- [[ text_ref = ]] .. strifyXml(textRef) .. +-- [[ entry_type = ]] .. strifyXml(entryType) .. +-- [[ multi_line = ]] .. strifyXml(multiLine) .. +-- [[ max_num_chars = ]] .. strifyXml(maxNumChars) .. +-- [[ params = ]] .. strifyXml(onChangeAction) .. +-- [[ on_focus_lost_params = ]] .. strifyXml(onChangeAction) .. -- [[ /> -- -- @@ -1043,7 +1043,7 @@ r2.WidgetStyles.Number = width1 = tmp end - local part0 = [[ ]] + local part0 = [[ ]] local tooltipTextId, tooltipTextIdFound = buildPropTooltipName(className, prop.Name) @@ -1051,7 +1051,7 @@ r2.WidgetStyles.Number = tooltip_parent="win" tooltip_posref="auto" instant_help="true" - tooltip=]] .. strify(tooltipTextId) .. ">" + tooltip=]] .. strifyXml(tooltipTextId) .. ">" part0 = part0 .. buildCoverAllButton(prop) local color = "255 255 255 255" @@ -1066,10 +1066,10 @@ r2.WidgetStyles.Number = end part0 = part0 .. [[ ]] + [[ id = ]] .. strifyXml(prop.Name .. "_Caption") .. + [[ hardtext = ]] .. strifyXml(hardText) .. + [[ color = ]] .. strifyXml(color) .. + [[ global_color=]] .. strifyXml(globalColor) .. [[ fontsize="12" shadow="true" auto_clamp="true"/> ]] part0 = part0 .. "" part0 = part0 .. "" @@ -1086,7 +1086,7 @@ r2.WidgetStyles.Number = -- local widgetXml = string.format([[ - " .. [[ + " .. [[ " result = result .. [[]] -- append enumerated values for k, v in pairs(prop.Enum) do - result = result .. [[]] + result = result .. [[]] end result = result .. "" return result, setter @@ -1201,10 +1201,10 @@ function r2:createPropertyXmlTable(props, className, posparent, posref, x, y, wi result = result .. value end add([[ ]] + part0 = [[ ]] part0 = part0 .. [[" + tooltip=]] .. strifyXml(tooltipTextId) .. ">" part0 = part0 .. [[ ]] + [[ id = ]] .. strifyXml(prop.Name .. "_Caption") .. + [[ hardtext = ]] .. strifyXml(hardText) .. + [[ color = ]] .. strifyXml(color) .. + [[ global_color=]] .. strifyXml(globalColor) .. [[ fontsize="12" shadow="true" auto_clamp="true"/> ]] part0 = part0 .. "" part0 = part0 .. "" else @@ -1268,13 +1268,13 @@ function r2:createPropertyXmlTable(props, className, posparent, posref, x, y, wi end -- build the widget - local part1 = [[ ]] + local part1 = [[ ]] part1 = part1 .. [[" + tooltip=]] .. strifyXml(tooltipTextId) .. ">" part1 = part1 .. widgetXmlDesc .. [[]] if invertWidget then @@ -1397,15 +1397,15 @@ function r2:buildPropRolloutXml(caption, id, posparent, posref, props, className -- add the rollout bar if not isForm then result = result .. - [[ ]] else result = result .. - [[ ]] end @@ -1475,9 +1475,9 @@ function r2:buildPropertySheetXml(class, className, id, title, isForm) if isForm then -- for forms, closing the form is equivalent to clicking on 'cancel' add(' resizer="true" ') local w = defaulting(class.Width, 500) - add(' pop_min_w=' .. strify(w)) - add(' pop_max_w=' .. strify(w)) - add(' w=' .. strify(w)) + add(' pop_min_w=' .. strifyXml(w)) + add(' pop_max_w=' .. strifyXml(w)) + add(' w=' .. strifyXml(w)) local cancelCode = [[ local form = getUICaller() if form.Env.Choice == nil then @@ -1518,7 +1518,7 @@ function r2:buildPropertySheetXml(class, className, id, title, isForm) - add([[id=]] .. strify(id) .. [[ + add([[id=]] .. strifyXml(id) .. [[ >]]) @@ -1647,7 +1647,7 @@ function r2:buildPropertySheetXml(class, className, id, title, isForm) - + ]]) diff --git a/code/ryzom/common/data_common/r2/ring_map_entry_ponts.txt b/code/ryzom/common/data_common/r2/ring_map_entry_ponts.txt deleted file mode 100644 index 643a416c7..000000000 --- a/code/ryzom/common/data_common/r2/ring_map_entry_ponts.txt +++ /dev/null @@ -1,1068 +0,0 @@ -a1 uiR2_Lakes01 uiR2EntryPoint01 31346 -1310 N -a1 uiR2_Lakes01 uiR2EntryPoint02 31269 -1238 E -a1 uiR2_Lakes01 uiR2EntryPoint03 31456 -1379 N - -a1 uiR2_Lakes07 uiR2EntryPoint01 36264 -1103 S -a1 uiR2_Lakes07 uiR2EntryPoint02 36208 -1353 N -a1 uiR2_Lakes07 uiR2EntryPoint03 36478 -1269 W -a1 uiR2_Lakes07 uiR2EntryPoint04 36478 -1105 SW - -a1 uiR2_Lakes22 uiR2EntryPoint01 32250 -2800 W -a1 uiR2_Lakes22 uiR2EntryPoint02 31920 -3160 N -a1 uiR2_Lakes22 uiR2EntryPoint03 32080 -3090 N -a1 uiR2_Lakes22 uiR2EntryPoint04 32250 -3065 NE - -l1 uiR2_Lakes15 uiR2EntryPoint01 34634 -1872 SW -l1 uiR2_Lakes15 uiR2EntryPoint02 34258 -1991 W -l1 uiR2_Lakes15 uiR2EntryPoint03 34321 -1860 S -l1 uiR2_Lakes15 uiR2EntryPoint04 34510 -2060 W - -l1 uiR2_Lakes17 uiR2EntryPoint01 36150 -2310 NE -l1 uiR2_Lakes17 uiR2EntryPoint02 35936 -2243 S -l1 uiR2_Lakes17 uiR2EntryPoint03 35920 -1844 W -l1 uiR2_Lakes17 uiR2EntryPoint04 36103 -1923 SW -l1 uiR2_Lakes17 uiR2EntryPoint05 35895 -1935 S - -l1 uiR2_Lakes18 uiR2EntryPoint01 36725 -1993 E -l1 uiR2_Lakes18 uiR2EntryPoint02 36688 -2159 N -l1 uiR2_Lakes18 uiR2EntryPoint03 36879 -2217 N -l1 uiR2_Lakes18 uiR2EntryPoint04 36941 -1970 SW - -l1 uiR2_Lakes26 uiR2EntryPoint01 34460 -3120 E -l1 uiR2_Lakes26 uiR2EntryPoint02 34689 -2756 SW -l1 uiR2_Lakes26 uiR2EntryPoint03 34681 -3111 N -l1 uiR2_Lakes26 uiR2EntryPoint04 34671 -2931 N - -l1 uiR2_Lakes27 uiR2EntryPoint01 35605 -3080 NW -l1 uiR2_Lakes27 uiR2EntryPoint02 35520 -2780 S -l1 uiR2_Lakes27 uiR2EntryPoint03 35133 -2663 SE -l1 uiR2_Lakes27 uiR2EntryPoint04 35283 -3051 N - -l1 uiR2_Lakes38 uiR2EntryPoint01 36720 -3740 S -l1 uiR2_Lakes38 uiR2EntryPoint02 36751 -4024 NW -l1 uiR2_Lakes38 uiR2EntryPoint03 36230 -3767 E -l1 uiR2_Lakes38 uiR2EntryPoint04 36481 -3564 S - -l1 uiR2_Lakes39 uiR2EntryPoint01 37510 -3900 N -l1 uiR2_Lakes39 uiR2EntryPoint02 37299 -3575 SE -l1 uiR2_Lakes39 uiR2EntryPoint03 37861 -3719 W - -l2 uiR2_Lakes03 uiR2EntryPoint01 32961 -1388 N -l2 uiR2_Lakes03 uiR2EntryPoint02 32784 -1507 NE -l2 uiR2_Lakes03 uiR2EntryPoint03 33390 -1517 NW -l2 uiR2_Lakes03 uiR2EntryPoint04 33365 -916 SW -l2 uiR2_Lakes03 uiR2EntryPoint05 33033 -991 S - -l2 uiR2_Lakes08 uiR2EntryPoint01 36991 -1311 E -l2 uiR2_Lakes08 uiR2EntryPoint02 37197 -1547 NW -l2 uiR2_Lakes08 uiR2EntryPoint03 37230 -1035 S -l2 uiR2_Lakes08 uiR2EntryPoint04 37111 -1264 SE -l2 uiR2_Lakes08 uiR2EntryPoint05 37393 -1285 W - -l2 uiR2_Lakes16 uiR2EntryPoint01 35330 -2120 W -l2 uiR2_Lakes16 uiR2EntryPoint02 35180 -2010 S -l2 uiR2_Lakes16 uiR2EntryPoint03 35145 -2135 NE - -l2 uiR2_Lakes19 uiR2EntryPoint01 37681 -2167 N -l2 uiR2_Lakes19 uiR2EntryPoint02 37367 -2341 NW -l2 uiR2_Lakes19 uiR2EntryPoint03 37331 -2070 NE -l2 uiR2_Lakes19 uiR2EntryPoint04 37521 -1929 S -l2 uiR2_Lakes19 uiR2EntryPoint05 37773 -2008 W - -l2 uiR2_Lakes23 uiR2EntryPoint01 32727 -3120 W -l2 uiR2_Lakes23 uiR2EntryPoint02 32694 -2802 W -l2 uiR2_Lakes23 uiR2EntryPoint03 32523 -2995 E - -l2 uiR2_Lakes10 uiR2EntryPoint01 38531 -1379 NE -l2 uiR2_Lakes10 uiR2EntryPoint02 38962 -1092 S -l2 uiR2_Lakes10 uiR2EntryPoint03 38677 -1146 SE -l2 uiR2_Lakes10 uiR2EntryPoint04 38953 -1444 NW - -l2 uiR2_Lakes11 uiR2EntryPoint01 31531 -2280 NW -l2 uiR2_Lakes11 uiR2EntryPoint02 31517 -1946 SW -l2 uiR2_Lakes11 uiR2EntryPoint03 31107 -2130 NE -l2 uiR2_Lakes11 uiR2EntryPoint04 31203 -1938 SE -l2 uiR2_Lakes11 uiR2EntryPoint05 31358 -2065 NW - -l3 uiR2_Lakes14 uiR2EntryPoint01 33438 -2169 E -l3 uiR2_Lakes14 uiR2EntryPoint02 33562 -2128 SW -l3 uiR2_Lakes14 uiR2EntryPoint03 33590 -2230 NW - -l3 uiR2_Lakes21 uiR2EntryPoint01 31247 -2790 E -l3 uiR2_Lakes21 uiR2EntryPoint02 31128 -3031 N -l3 uiR2_Lakes21 uiR2EntryPoint03 31536 -2778 W -l3 uiR2_Lakes21 uiR2EntryPoint04 31413 -3101 NE -l3 uiR2_Lakes21 uiR2EntryPoint05 31306 -3168 NW - -l3 uiR2_Lakes31 uiR2EntryPoint01 31295 -4080 N -l3 uiR2_Lakes31 uiR2EntryPoint02 31425 -3724 SW -l3 uiR2_Lakes31 uiR2EntryPoint03 31258 -3747 SE - -l3 uiR2_Lakes04 uiR2EntryPoint01 33740 -1068 E -l3 uiR2_Lakes04 uiR2EntryPoint02 34268 -1202 W -l3 uiR2_Lakes04 uiR2EntryPoint03 34145 -1045 SW -l3 uiR2_Lakes04 uiR2EntryPoint04 33996 -1283 N -l3 uiR2_Lakes04 uiR2EntryPoint05 33691 -1206 E - -l3 uiR2_Lakes06 uiR2EntryPoint01 35468 -1272 N -l3 uiR2_Lakes06 uiR2EntryPoint02 35954 -1080 SW -l3 uiR2_Lakes06 uiR2EntryPoint03 35764 -1026 E -l3 uiR2_Lakes06 uiR2EntryPoint04 35438 -890 SE -l3 uiR2_Lakes06 uiR2EntryPoint05 35634 -1288 N - -l3 uiR2_Lakes09 uiR2EntryPoint01 37916 -1124 S -l3 uiR2_Lakes09 uiR2EntryPoint02 37709 -1451 NE -l3 uiR2_Lakes09 uiR2EntryPoint03 38149 -1051 SW -l3 uiR2_Lakes09 uiR2EntryPoint04 38073 -1412 NW - -l3 uiR2_Lakes20 uiR2EntryPoint01 38155 -2000 E -l3 uiR2_Lakes20 uiR2EntryPoint02 38290 -1813 E -l3 uiR2_Lakes20 uiR2EntryPoint03 38488 -1996 W -l3 uiR2_Lakes20 uiR2EntryPoint04 38289 -2183 S - -l4 uiR2_Lakes33 uiR2EntryPoint01 32370 -3880 N -l4 uiR2_Lakes33 uiR2EntryPoint02 32447 -3577 SE -l4 uiR2_Lakes33 uiR2EntryPoint03 32561 -3774 SW -l4 uiR2_Lakes33 uiR2EntryPoint04 32716 -3591 S -l4 uiR2_Lakes33 uiR2EntryPoint05 32721 -3914 N - -l4 uiR2_Lakes02 uiR2EntryPoint01 32059 -1392 N -l4 uiR2_Lakes02 uiR2EntryPoint02 32267 -1181 W -l4 uiR2_Lakes02 uiR2EntryPoint03 32053 -1159 SE - -l4 uiR2_Lakes05 uiR2EntryPoint01 34650 -1133 NE -l4 uiR2_Lakes05 uiR2EntryPoint02 35018 -1280 SW -l4 uiR2_Lakes05 uiR2EntryPoint03 34984 -889 SW -l4 uiR2_Lakes05 uiR2EntryPoint04 34769 -1166 NE - -l4 uiR2_Lakes12 uiR2EntryPoint01 32040 -2368 N -l4 uiR2_Lakes12 uiR2EntryPoint02 32401 -2210 SW -l4 uiR2_Lakes12 uiR2EntryPoint03 32019 -1939 S -l4 uiR2_Lakes12 uiR2EntryPoint04 31891 -2241 E - -l4 uiR2_Lakes24 uiR2EntryPoint01 33350 -3120 N -l4 uiR2_Lakes24 uiR2EntryPoint02 33200 -2865 N -l4 uiR2_Lakes24 uiR2EntryPoint03 33450 -2950 W - -l4 uiR2_Lakes34 uiR2EntryPoint01 33520 -3910 N -l4 uiR2_Lakes34 uiR2EntryPoint02 33206 -3990 W -l4 uiR2_Lakes34 uiR2EntryPoint03 33276 -3784 N -l4 uiR2_Lakes34 uiR2EntryPoint04 33619 -3638 NW -l4 uiR2_Lakes34 uiR2EntryPoint05 33335 -3829 NE - -o1 uiR2_Lakes25 uiR2EntryPoint01 33980 -3110 N -o1 uiR2_Lakes25 uiR2EntryPoint02 33900 -2990 NE -o1 uiR2_Lakes25 uiR2EntryPoint03 34105 -2760 SW - -o1 uiR2_Lakes28 uiR2EntryPoint01 36480 -3100 N -o1 uiR2_Lakes28 uiR2EntryPoint02 36146 -2679 SE -o1 uiR2_Lakes28 uiR2EntryPoint03 36324 -2871 S - -o1 uiR2_Lakes29 uiR2EntryPoint01 37500 -3110 N -o1 uiR2_Lakes29 uiR2EntryPoint02 37078 -2937 SW -o1 uiR2_Lakes29 uiR2EntryPoint03 37389 -2802 S - -o1 uiR2_Lakes30 uiR2EntryPoint01 38100 -2850 E -o1 uiR2_Lakes30 uiR2EntryPoint02 38414 -2715 S -o1 uiR2_Lakes30 uiR2EntryPoint03 38489 -3116 NW - -o1 uiR2_Lakes32 uiR2EntryPoint01 31900 -3600 E -o1 uiR2_Lakes32 uiR2EntryPoint02 32108 -3832 N -o1 uiR2_Lakes32 uiR2EntryPoint03 32112 -3672 W - -o1 uiR2_Lakes35 uiR2EntryPoint01 34200 -4080 E -o1 uiR2_Lakes35 uiR2EntryPoint02 34145 -3645 SE -o1 uiR2_Lakes35 uiR2EntryPoint03 34387 -3988 S - -o1 uiR2_Lakes36 uiR2EntryPoint01 34960 -3770 N -o1 uiR2_Lakes36 uiR2EntryPoint02 35149 -3703 SW -o1 uiR2_Lakes36 uiR2EntryPoint03 34957 -3586 S - -o1 uiR2_Lakes37 uiR2EntryPoint01 35760 -3750 N -o1 uiR2_Lakes37 uiR2EntryPoint02 35577 -3640 SE -o1 uiR2_Lakes37 uiR2EntryPoint03 35912 -3874 N -o1 uiR2_Lakes37 uiR2EntryPoint04 35902 -3589 SE - -o1 uiR2_Lakes40 uiR2EntryPoint01 38180 -3470 SE -o1 uiR2_Lakes40 uiR2EntryPoint01 38416 -3819 NE -o1 uiR2_Lakes40 uiR2EntryPoint01 38151 -3740 N - - -//z1 uiR2_Lakes13 uiR2EntryPoint01 32479 -2298 E -//z1 uiR2_Lakes13 uiR2EntryPoint02 32880 -2080 S -//z1 uiR2_Lakes13 uiR2EntryPoint03 33050 -2265 NW - -// Desert - - -a1 uiR2_Deserts03 uiR2EntryPoint01 22791 -1289 N -a1 uiR2_Deserts03 uiR2EntryPoint02 23041 -1284 NW -a1 uiR2_Deserts03 uiR2EntryPoint03 22873 -1110 SE - -a1 uiR2_Deserts21 uiR2EntryPoint01 25980 -2015 E -a1 uiR2_Deserts21 uiR2EntryPoint02 26452 -1963 W -a1 uiR2_Deserts21 uiR2EntryPoint03 26353 -1872 SW -a1 uiR2_Deserts21 uiR2EntryPoint04 26214 -1961 S - -a1 uiR2_Deserts32 uiR2EntryPoint01 28070 -2340 E -a1 uiR2_Deserts32 uiR2EntryPoint02 28240 -2719 N -a1 uiR2_Deserts32 uiR2EntryPoint03 28318 -2643 W -a1 uiR2_Deserts32 uiR2EntryPoint04 28293 -2445 W - -d1 uiR2_Deserts02 uiR2EntryPoint01 22383 -1512 N -d1 uiR2_Deserts02 uiR2EntryPoint02 22454 -1186 SW -d1 uiR2_Deserts02 uiR2EntryPoint03 22062 -1050 S -d1 uiR2_Deserts02 uiR2EntryPoint04 22072 -1289 NE - -d1 uiR2_Deserts10 uiR2EntryPoint01 28923 -1434 N -d1 uiR2_Deserts10 uiR2EntryPoint02 29217 -1371 E -d1 uiR2_Deserts10 uiR2EntryPoint03 28901 -1115 SW - -d1 uiR2_Deserts22 uiR2EntryPoint01 26950 -2015 N -d1 uiR2_Deserts22 uiR2EntryPoint02 26937 -1864 S -d1 uiR2_Deserts22 uiR2EntryPoint03 27089 -2042 NW - -d1 uiR2_Deserts23 uiR2EntryPoint01 27600 -1924 S -d1 uiR2_Deserts23 uiR2EntryPoint02 27575 -2351 NW -d1 uiR2_Deserts23 uiR2EntryPoint03 27545 -2211 N -d1 uiR2_Deserts23 uiR2EntryPoint04 27442 -1866 S - -d1 uiR2_Deserts28 uiR2EntryPoint01 25050 -2650 S -d1 uiR2_Deserts28 uiR2EntryPoint02 24910 -2819 E -d1 uiR2_Deserts28 uiR2EntryPoint03 24881 -2720 N -d1 uiR2_Deserts28 uiR2EntryPoint04 24915 -2511 SW - -d1 uiR2_Deserts29 uiR2EntryPoint01 25880 -2630 E -d1 uiR2_Deserts29 uiR2EntryPoint02 26022 -2374 SW -d1 uiR2_Deserts29 uiR2EntryPoint03 26156 -2560 N -d1 uiR2_Deserts29 uiR2EntryPoint04 26163 -2402 S - -d1 uiR2_Deserts31 uiR2EntryPoint01 27760 -2700 N -d1 uiR2_Deserts31 uiR2EntryPoint02 27404 -2588 S -d1 uiR2_Deserts31 uiR2EntryPoint03 27538 -2606 S -d1 uiR2_Deserts31 uiR2EntryPoint04 27413 -2744 NE - -d1 uiR2_Deserts05 uiR2EntryPoint01 24257 -1520 NE -d1 uiR2_Deserts05 uiR2EntryPoint02 24593 -1447 N -d1 uiR2_Deserts05 uiR2EntryPoint03 24341 -1184 NE -d1 uiR2_Deserts05 uiR2EntryPoint04 24535 -1054 S - -d1 uiR2_Deserts13 uiR2EntryPoint01 28942 -1919 S -d1 uiR2_Deserts13 uiR2EntryPoint02 28538 -2241 E -d1 uiR2_Deserts13 uiR2EntryPoint03 28814 -2251 NW -d1 uiR2_Deserts13 uiR2EntryPoint04 28956 -2079 W -d1 uiR2_Deserts13 uiR2EntryPoint05 28794 -1912 S - -d1 uiR2_Deserts17 uiR2EntryPoint01 23250 -1840 W -d1 uiR2_Deserts17 uiR2EntryPoint02 23096 -1943 NE -d1 uiR2_Deserts17 uiR2EntryPoint03 23034 -1839 E -d1 uiR2_Deserts17 uiR2EntryPoint04 23096 -1713 S - -d1 uiR2_Deserts24 uiR2EntryPoint01 27915 -1875 S -d1 uiR2_Deserts24 uiR2EntryPoint02 28136 -1960 S -d1 uiR2_Deserts24 uiR2EntryPoint03 28233 -1746 S -d1 uiR2_Deserts24 uiR2EntryPoint04 28324 -1841 W - -d3 uiR2_Deserts27 uiR2EntryPoint01 23305 -2454 E -d3 uiR2_Deserts27 uiR2EntryPoint02 23313 -2682 N -d3 uiR2_Deserts27 uiR2EntryPoint03 23464 -2611 N -d3 uiR2_Deserts27 uiR2EntryPoint04 23496 -2442 SW - -d3 uiR2_Deserts04 uiR2EntryPoint01 23452 -1050 SE -d3 uiR2_Deserts04 uiR2EntryPoint02 23846 -1435 W -d3 uiR2_Deserts04 uiR2EntryPoint03 23599 -1418 N -d3 uiR2_Deserts04 uiR2EntryPoint04 23927 -1163 W - -d3 uiR2_Deserts11 uiR2EntryPoint01 29554 -1468 N -d3 uiR2_Deserts11 uiR2EntryPoint02 29922 -1222 W -d3 uiR2_Deserts11 uiR2EntryPoint03 29622 -1048 S -d3 uiR2_Deserts11 uiR2EntryPoint04 29615 -1306 SE -d3 uiR2_Deserts11 uiR2EntryPoint05 29755 -1447 NW - -d3 uiR2_Deserts16 uiR2EntryPoint01 22304 -1856 E -d3 uiR2_Deserts16 uiR2EntryPoint02 22513 -1995 E -d3 uiR2_Deserts16 uiR2EntryPoint03 22687 -1891 N -d3 uiR2_Deserts16 uiR2EntryPoint04 22537 -1877 N - -d4 uiR2_Deserts18 uiR2EntryPoint01 23730 -2280 N -d4 uiR2_Deserts18 uiR2EntryPoint02 23666 -2154 NE -d4 uiR2_Deserts18 uiR2EntryPoint03 23871 -1977 SE -d4 uiR2_Deserts18 uiR2EntryPoint04 23570 -2056 NE -d4 uiR2_Deserts18 uiR2EntryPoint05 23834 -1997 W - -d4 uiR2_Deserts19 uiR2EntryPoint01 24560 -2015 N -d4 uiR2_Deserts19 uiR2EntryPoint02 24267 -1998 E -d4 uiR2_Deserts19 uiR2EntryPoint03 24841 -2002 W -d4 uiR2_Deserts19 uiR2EntryPoint04 24562 -1914 S - -d4 uiR2_Deserts09 uiR2EntryPoint01 27814 -1375 N -d4 uiR2_Deserts09 uiR2EntryPoint02 27471 -1503 E -d4 uiR2_Deserts09 uiR2EntryPoint03 27609 -1197 E -d4 uiR2_Deserts09 uiR2EntryPoint04 27730 -1088 S -d4 uiR2_Deserts09 uiR2EntryPoint05 27529 -1014 SE - -d4 uiR2_Deserts14 uiR2EntryPoint01 30629 -2300 N -// d4 uiR2_Deserts14 uiR2EntryPoint04 30747 -2023 SW -d4 uiR2_Deserts14 uiR2EntryPoint02 30577 -1836 S -d4 uiR2_Deserts14 uiR2EntryPoint03 30347 -2140 SE -// d4 uiR2_Deserts14 uiR2EntryPoint05 30407 -1835 SE - -d5 uiR2_Deserts15 uiR2EntryPoint01 21500 -1830 E -d5 uiR2_Deserts15 uiR2EntryPoint02 21933 -1833 W -d5 uiR2_Deserts15 uiR2EntryPoint03 21763 -1839 E -d5 uiR2_Deserts15 uiR2EntryPoint04 21515 -1913 N - -d5 uiR2_Deserts30 uiR2EntryPoint01 26650 -2650 E -d5 uiR2_Deserts30 uiR2EntryPoint02 27036 -2638 W -d5 uiR2_Deserts30 uiR2EntryPoint03 26922 -2433 SE -d5 uiR2_Deserts30 uiR2EntryPoint04 26779 -2504 S - -d5 uiR2_Deserts33 uiR2EntryPoint01 29510 -2040 S -d5 uiR2_Deserts33 uiR2EntryPoint02 29517 -2239 N -d5 uiR2_Deserts33 uiR2EntryPoint03 29712 -2523 NW -d5 uiR2_Deserts33 uiR2EntryPoint04 29920 -2157 W -d5 uiR2_Deserts33 uiR2EntryPoint05 29758 -2318 W - -d5 uiR2_Deserts08 uiR2EntryPoint01 26694 -1485 N -d5 uiR2_Deserts08 uiR2EntryPoint02 26949 -1512 NW -d5 uiR2_Deserts08 uiR2EntryPoint03 26482 -1366 E -d5 uiR2_Deserts08 uiR2EntryPoint04 26875 -1010 S -d5 uiR2_Deserts08 uiR2EntryPoint05 26460 -1205 NE - -d6 uiR2_Deserts06 uiR2EntryPoint01 25523 -1500 NW -d6 uiR2_Deserts06 uiR2EntryPoint02 25419 -1142 SW -d6 uiR2_Deserts06 uiR2EntryPoint03 25220 -1416 W -d6 uiR2_Deserts06 uiR2EntryPoint04 25168 -1168 SW - -d6 uiR2_Deserts20 uiR2EntryPoint01 25206 -2118 N -d6 uiR2_Deserts20 uiR2EntryPoint02 25435 -1997 W -d6 uiR2_Deserts20 uiR2EntryPoint03 25410 -2177 N -d6 uiR2_Deserts20 uiR2EntryPoint04 25532 -1942 N -d6 uiR2_Deserts20 uiR2EntryPoint05 25724 -2192 W - -d6 uiR2_Deserts25 uiR2EntryPoint01 21845 -2475 S -d6 uiR2_Deserts25 uiR2EntryPoint02 21891 -2836 W -d6 uiR2_Deserts25 uiR2EntryPoint03 21442 -2799 NW -d6 uiR2_Deserts25 uiR2EntryPoint04 21460 -2447 S -d6 uiR2_Deserts25 uiR2EntryPoint05 21765 -2480 W - -d6 uiR2_Deserts26 uiR2EntryPoint01 22627 -2480 W -d6 uiR2_Deserts26 uiR2EntryPoint02 22352 -2474 E -d6 uiR2_Deserts26 uiR2EntryPoint03 22925 -2483 W -d6 uiR2_Deserts26 uiR2EntryPoint04 22790 -2627 N - - - -o1 uiR2_Deserts07 uiR2EntryPoint01 26051 -1405 N -o1 uiR2_Deserts07 uiR2EntryPoint02 26153 -1044 S -o1 uiR2_Deserts07 uiR2EntryPoint03 25855 -1233 E -o1 uiR2_Deserts07 uiR2EntryPoint04 25818 -1027 SE - -o1 uiR2_Deserts12 uiR2EntryPoint01 30818 -1487 NW -o1 uiR2_Deserts12 uiR2EntryPoint02 30726 -1023 S -o1 uiR2_Deserts12 uiR2EntryPoint03 30369 -1083 SE -o1 uiR2_Deserts12 uiR2EntryPoint04 30389 -1307 E -o1 uiR2_Deserts12 uiR2EntryPoint05 30539 -1440 NW - - - -//z1 uiR2_Deserts01 uiR2EntryPoint01 21570 -1363 N -//z1 uiR2_Deserts01 uiR2EntryPoint02 21340 -1066 SE -//z1 uiR2_Deserts01 uiR2EntryPoint03 21678 -1129 SW -//z1 uiR2_Deserts01 uiR2EntryPoint04 21503 -1296 N - - - - -// Forest - - -a1 uiR2_Forest04 uiR2EntryPoint01 24213 -11157 W -a1 uiR2_Forest04 uiR2EntryPoint02 23975 -11225 E -a1 uiR2_Forest04 uiR2EntryPoint03 23827 -11373 NE -a1 uiR2_Forest04 uiR2EntryPoint04 24180 -11383 NW -a1 uiR2_Forest04 uiR2EntryPoint05 23871 -11059 SE -a1 uiR2_Forest04 uiR2EntryPoint06 24189 -10982 SW - -a1 uiR2_Forest05 uiR2EntryPoint01 24752 -11360 N -a1 uiR2_Forest05 uiR2EntryPoint02 24602 -11060 SE -a1 uiR2_Forest05 uiR2EntryPoint03 24865 -11100 SW -a1 uiR2_Forest05 uiR2EntryPoint04 25046 -11197 W -a1 uiR2_Forest05 uiR2EntryPoint05 24640 -11453 N -a1 uiR2_Forest05 uiR2EntryPoint06 24537 -11201 E - -a1 uiR2_Forest14 uiR2EntryPoint01 21282 -12196 N -a1 uiR2_Forest14 uiR2EntryPoint02 21276 -11986 S -a1 uiR2_Forest14 uiR2EntryPoint03 21276 -11766 S - -a1 uiR2_Forest27 uiR2EntryPoint01 21173 -12644 W -a1 uiR2_Forest27 uiR2EntryPoint02 21068 -12561 S -a1 uiR2_Forest27 uiR2EntryPoint03 21113 -12714 N -a1 uiR2_Forest27 uiR2EntryPoint04 21119 -12639 S - -a1 uiR2_Forest32 uiR2EntryPoint01 24680 -12600 SE -a1 uiR2_Forest32 uiR2EntryPoint02 24538 -13025 N -a1 uiR2_Forest32 uiR2EntryPoint03 24822 -13039 N -a1 uiR2_Forest32 uiR2EntryPoint04 24718 -12889 N -a1 uiR2_Forest32 uiR2EntryPoint05 24830 -12554 SW -a1 uiR2_Forest32 uiR2EntryPoint06 24659 -12750 E - -f1 uiR2_Forest03 uiR2EntryPoint01 23010 -11209 E -f1 uiR2_Forest03 uiR2EntryPoint02 23080 -11152 E -f1 uiR2_Forest03 uiR2EntryPoint03 23400 -11400 NW -f1 uiR2_Forest03 uiR2EntryPoint04 23400 -11000 SW -f1 uiR2_Forest03 uiR2EntryPoint05 23000 -11000 SE - -f1 uiR2_Forest19 uiR2EntryPoint01 24944 -12220 N -f1 uiR2_Forest19 uiR2EntryPoint02 25357 -12233 N -f1 uiR2_Forest19 uiR2EntryPoint03 25265 -12240 W -f1 uiR2_Forest19 uiR2EntryPoint04 24971 -11947 S -f1 uiR2_Forest19 uiR2EntryPoint05 25155 -12081 SE - -f1 uiR2_Forest23 uiR2EntryPoint01 28465 -12056 W -f1 uiR2_Forest23 uiR2EntryPoint02 28011 -12082 E -f1 uiR2_Forest23 uiR2EntryPoint03 28496 -12248 N -f1 uiR2_Forest23 uiR2EntryPoint04 28375 -11911 SE -f1 uiR2_Forest23 uiR2EntryPoint05 28194 -12118 E -f1 uiR2_Forest23 uiR2EntryPoint06 27926 -11988 SE - -f1 uiR2_Forest39 uiR2EntryPoint01 30520 -12600 S -f1 uiR2_Forest39 uiR2EntryPoint02 30143 -12958 E -f1 uiR2_Forest39 uiR2EntryPoint03 30195 -12559 SE -f1 uiR2_Forest39 uiR2EntryPoint04 30621 -12958 NW -f1 uiR2_Forest39 uiR2EntryPoint05 30298 -12694 SE -f1 uiR2_Forest39 uiR2EntryPoint06 30524 -12799 W -f1 uiR2_Forest39 uiR2EntryPoint07 30291 -12910 NE - -f1 uiR2_Forest41 uiR2EntryPoint01 22140 -13150 SE -f1 uiR2_Forest41 uiR2EntryPoint02 22401 -13440 NW -f1 uiR2_Forest41 uiR2EntryPoint03 22263 -13269 S -f1 uiR2_Forest41 uiR2EntryPoint04 22338 -13133 SW -f1 uiR2_Forest41 uiR2EntryPoint05 22173 -13476 NE - -f1 uiR2_Forest20 uiR2EntryPoint01 26110 -11936 SW -f1 uiR2_Forest20 uiR2EntryPoint02 25734 -11920 SE -f1 uiR2_Forest20 uiR2EntryPoint03 25691 -12200 SW -f1 uiR2_Forest20 uiR2EntryPoint04 26113 -12164 NW -f1 uiR2_Forest20 uiR2EntryPoint05 25950 -12097 N - -f1 uiR2_Forest31 uiR2EntryPoint01 23470 -12600 SE -f1 uiR2_Forest31 uiR2EntryPoint02 23681 -12712 S -f1 uiR2_Forest31 uiR2EntryPoint03 23510 -13001 NE -f1 uiR2_Forest31 uiR2EntryPoint04 23948 -13020 W -f1 uiR2_Forest31 uiR2EntryPoint05 23598 -12850 SW -f1 uiR2_Forest31 uiR2EntryPoint06 23995 -12787 W -f1 uiR2_Forest31 uiR2EntryPoint07 23879 -12573 W - -f2 uiR2_Forest34 uiR2EntryPoint01 26220 -12600 SE -f2 uiR2_Forest34 uiR2EntryPoint02 26613 -12753 NW -f2 uiR2_Forest34 uiR2EntryPoint03 26413 -12556 S -f2 uiR2_Forest34 uiR2EntryPoint04 26238 -12888 N -f2 uiR2_Forest34 uiR2EntryPoint05 26661 -12640 W - -f2 uiR2_Forest35 uiR2EntryPoint01 27100 -12600 S -f2 uiR2_Forest35 uiR2EntryPoint02 27043 -12938 N -f2 uiR2_Forest35 uiR2EntryPoint03 27222 -12726 W - -f2 uiR2_Forest45 uiR2EntryPoint01 26000 -13600 SW -f2 uiR2_Forest45 uiR2EntryPoint02 25983 -13976 NW -f2 uiR2_Forest45 uiR2EntryPoint03 25684 -13611 SE -f2 uiR2_Forest45 uiR2EntryPoint04 25835 -13674 SE -f2 uiR2_Forest45 uiR2EntryPoint05 26004 -13834 NW -f2 uiR2_Forest45 uiR2EntryPoint06 25786 -13883 N - -f2 uiR2_Forest08 uiR2EntryPoint01 26957 -11364 NE -f2 uiR2_Forest08 uiR2EntryPoint02 27200 -11178 S -f2 uiR2_Forest08 uiR2EntryPoint03 27360 -11040 SW -f2 uiR2_Forest08 uiR2EntryPoint04 27002 -10967 SE -f2 uiR2_Forest08 uiR2EntryPoint05 27406 -11414 NW - -f2 uiR2_Forest12 uiR2EntryPoint01 29919 -11062 N -f2 uiR2_Forest12 uiR2EntryPoint02 29855 -11111 NE -f2 uiR2_Forest12 uiR2EntryPoint03 29986 -10996 SW - -f2 uiR2_Forest33 uiR2EntryPoint01 25300 -12600 S -f2 uiR2_Forest33 uiR2EntryPoint02 25598 -13023 N -f2 uiR2_Forest33 uiR2EntryPoint03 25598 -12632 W -f2 uiR2_Forest33 uiR2EntryPoint04 25299 -12957 N - -f3 uiR2_Forest38 uiR2EntryPoint01 29630 -12600 SW -f3 uiR2_Forest38 uiR2EntryPoint02 29735 -12939 NW -f3 uiR2_Forest38 uiR2EntryPoint03 29350 -12779 E -f3 uiR2_Forest38 uiR2EntryPoint04 29525 -12714 SE -f3 uiR2_Forest38 uiR2EntryPoint05 29391 -12585 SE -f3 uiR2_Forest38 uiR2EntryPoint06 29465 -13029 NE - -f3 uiR2_Forest46 uiR2EntryPoint01 27000 -13600 S -f3 uiR2_Forest46 uiR2EntryPoint02 28057 -14465 N -f3 uiR2_Forest46 uiR2EntryPoint03 26890 -14013 NE -f3 uiR2_Forest46 uiR2EntryPoint04 27254 -13872 S - -f3 uiR2_Forest02 uiR2EntryPoint01 22236 -11281 NE -f3 uiR2_Forest02 uiR2EntryPoint02 22468 -11198 W -f3 uiR2_Forest02 uiR2EntryPoint03 22222 -11426 NE -f3 uiR2_Forest02 uiR2EntryPoint04 22353 -11000 S -f3 uiR2_Forest02 uiR2EntryPoint05 22446 -11374 NW -f3 uiR2_Forest02 uiR2EntryPoint06 22137 -11199 E -f3 uiR2_Forest02 uiR2EntryPoint07 22158 -10990 E -f3 uiR2_Forest02 uiR2EntryPoint08 22259 -11108 E - -f3 uiR2_Forest07 uiR2EntryPoint01 26322 -11348 N -f3 uiR2_Forest07 uiR2EntryPoint02 26310 -11200 E -f3 uiR2_Forest07 uiR2EntryPoint03 26545 -11157 W -f3 uiR2_Forest07 uiR2EntryPoint04 26185 -10967 E -f3 uiR2_Forest07 uiR2EntryPoint05 26171 -11200 E -f3 uiR2_Forest07 uiR2EntryPoint06 26446 -11021 SW -f3 uiR2_Forest07 uiR2EntryPoint07 26222 -11401 NE -f3 uiR2_Forest07 uiR2EntryPoint08 26498 -11359 W - -f3 uiR2_Forest16 uiR2EntryPoint01 23114 -11953 W -f3 uiR2_Forest16 uiR2EntryPoint02 22883 -11999 E -f3 uiR2_Forest16 uiR2EntryPoint03 22743 -12136 N -f3 uiR2_Forest16 uiR2EntryPoint04 22735 -11817 SE -f3 uiR2_Forest16 uiR2EntryPoint05 23038 -12182 NW - -f3 uiR2_Forest18 uiR2EntryPoint01 24326 -11878 SE -f3 uiR2_Forest18 uiR2EntryPoint02 24390 -12095 N -f3 uiR2_Forest18 uiR2EntryPoint03 24525 -12090 E -f3 uiR2_Forest18 uiR2EntryPoint04 24225 -11836 E - -f4 uiR2_Forest25 uiR2EntryPoint01 29903 -11886 SO -f4 uiR2_Forest25 uiR2EntryPoint02 29714 -12046 NE -f4 uiR2_Forest25 uiR2EntryPoint03 29730 -11826 SE -f4 uiR2_Forest25 uiR2EntryPoint04 29959 -11791 SW - -f4 uiR2_Forest01 uiR2EntryPoint01 21581 -11056 S -f4 uiR2_Forest01 uiR2EntryPoint02 21733 -11412 NW -f4 uiR2_Forest01 uiR2EntryPoint03 21648 -11248 S -f4 uiR2_Forest01 uiR2EntryPoint04 21510 -11443 NE -f4 uiR2_Forest01 uiR2EntryPoint05 21400 -11247 E -f4 uiR2_Forest01 uiR2EntryPoint06 21762 -10995 S -f4 uiR2_Forest01 uiR2EntryPoint07 21855 -11231 W -f4 uiR2_Forest01 uiR2EntryPoint08 21355 -11040 E -f4 uiR2_Forest01 uiR2EntryPoint09 21596 -10946 S - -f4 uiR2_Forest10 uiR2EntryPoint01 28673 -11191 N -f4 uiR2_Forest10 uiR2EntryPoint02 28645 -11007 S -f4 uiR2_Forest10 uiR2EntryPoint03 28566 -11110 E - -f4 uiR2_Forest24 uiR2EntryPoint01 29365 -11968 W -f4 uiR2_Forest24 uiR2EntryPoint02 28963 -11969 E -f4 uiR2_Forest24 uiR2EntryPoint03 29146 -11817 S -f4 uiR2_Forest24 uiR2EntryPoint04 29117 -12186 N -f4 uiR2_Forest24 uiR2EntryPoint05 29139 -12001 N - -f4 uiR2_Forest30 uiR2EntryPoint01 22865 -12920 N -f4 uiR2_Forest30 uiR2EntryPoint02 23068 -12632 W -f4 uiR2_Forest30 uiR2EntryPoint03 22773 -12782 E -f4 uiR2_Forest30 uiR2EntryPoint04 22901 -12688 S - -f4 uiR2_Forest40 uiR2EntryPoint01 21150 -13350 N -f4 uiR2_Forest40 uiR2EntryPoint02 21536 -13506 N -f4 uiR2_Forest40 uiR2EntryPoint03 21359 -13195 S -f4 uiR2_Forest40 uiR2EntryPoint04 21162 -13553 NE -f4 uiR2_Forest40 uiR2EntryPoint05 21267 -13280 W -f4 uiR2_Forest40 uiR2EntryPoint06 21118 -13278 SE - - - -o1 uiR2_Forest09 uiR2EntryPoint01 28210 -10964 SW -o1 uiR2_Forest09 uiR2EntryPoint02 28058 -11137 S -o1 uiR2_Forest09 uiR2EntryPoint03 27855 -11099 E - -o1 uiR2_Forest13 uiR2EntryPoint01 30783 -11199 W -o1 uiR2_Forest13 uiR2EntryPoint02 30569 -10957 S -o1 uiR2_Forest13 uiR2EntryPoint03 30355 -11071 E - -o1 uiR2_Forest21 uiR2EntryPoint01 26547 -12021 E -o1 uiR2_Forest21 uiR2EntryPoint02 26748 -11980 SW -o1 uiR2_Forest21 uiR2EntryPoint03 26636 -12215 N -o1 uiR2_Forest21 uiR2EntryPoint04 26560 -11775 S - -o1 uiR2_Forest26 uiR2EntryPoint01 30827 -11803 W -o1 uiR2_Forest26 uiR2EntryPoint02 30559 -11816 E -o1 uiR2_Forest26 uiR2EntryPoint03 30347 -11839 E - -o1 uiR2_Forest28 uiR2EntryPoint01 21720 -12717 N -o1 uiR2_Forest28 uiR2EntryPoint02 21559 -12569 S -o1 uiR2_Forest28 uiR2EntryPoint03 21581 -12739 NE -o1 uiR2_Forest28 uiR2EntryPoint04 21831 -12579 SW -o1 uiR2_Forest28 uiR2EntryPoint05 21676 -12643 E - - - -//z1 uiR2_Forest06 uiR2EntryPoint01 25424 -11251 E -//z1 uiR2_Forest06 uiR2EntryPoint02 25768 -11068 SW -//z1 uiR2_Forest06 uiR2EntryPoint03 25616 -11254 NW - -//z1 uiR2_Forest11 uiR2EntryPoint01 29400 -11408 NW -//z1 uiR2_Forest11 uiR2EntryPoint02 29273 -11198 S -//z1 uiR2_Forest11 uiR2EntryPoint03 29112 -11028 SE - -//z1 uiR2_Forest15 uiR2EntryPoint01 22136 -11787 S -//z1 uiR2_Forest15 uiR2EntryPoint02 21908 -12109 NE -//z1 uiR2_Forest15 uiR2EntryPoint03 21903 -11855 SE -//z1 uiR2_Forest15 uiR2EntryPoint04 22206 -12161 NW -//z1 uiR2_Forest15 uiR2EntryPoint05 22066 -11993 N - -//z1 uiR2_Forest17 uiR2EntryPoint01 23533 -11761 SE -//z1 uiR2_Forest17 uiR2EntryPoint02 23689 -12007 N -//z1 uiR2_Forest17 uiR2EntryPoint03 23688 -12223 N -//z1 uiR2_Forest17 uiR2EntryPoint04 23850 -11791 SW -//z1 uiR2_Forest17 uiR2EntryPoint05 23464 -12000 E -//z1 uiR2_Forest17 uiR2EntryPoint06 23862 -12143 NW - -//z1 uiR2_Forest22 uiR2EntryPoint01 27153 -12009 E -//z1 uiR2_Forest22 uiR2EntryPoint02 27581 -11992 SW -//z1 uiR2_Forest22 uiR2EntryPoint03 27374 -12176 N -//z1 uiR2_Forest22 uiR2EntryPoint04 27381 -11938 S -//z1 uiR2_Forest22 uiR2EntryPoint05 27260 -12085 E -//z1 uiR2_Forest22 uiR2EntryPoint06 27444 -12071 W - -//z1 uiR2_Forest29 uiR2EntryPoint01 22306 -12674 W -//z1 uiR2_Forest29 uiR2EntryPoint02 22404 -12746 N -//z1 uiR2_Forest29 uiR2EntryPoint03 22152 -12719 NE - -//z1 uiR2_Forest36 uiR2EntryPoint01 27800 -12770 E -//z1 uiR2_Forest36 uiR2EntryPoint02 28127 -12573 SW -//z1 uiR2_Forest36 uiR2EntryPoint03 28218 -13020 NW -//z1 uiR2_Forest36 uiR2EntryPoint04 27909 -12736 SW -//z1 uiR2_Forest36 uiR2EntryPoint05 27805 -12614 S -//z1 uiR2_Forest36 uiR2EntryPoint06 27896 -12855 E -//z1 uiR2_Forest36 uiR2EntryPoint07 27794 -13005 NW -//z1 uiR2_Forest36 uiR2EntryPoint08 28058 -12493 SE - -//z1 uiR2_Forest37 uiR2EntryPoint01 28980 -12920 W -//z1 uiR2_Forest37 uiR2EntryPoint02 28880 -12886 SE -//z1 uiR2_Forest37 uiR2EntryPoint03 28879 -13020 NE -//z1 uiR2_Forest37 uiR2EntryPoint04 28522 -12562 E -//z1 uiR2_Forest37 uiR2EntryPoint05 28712 -12686 s -//z1 uiR2_Forest37 uiR2EntryPoint06 28747 -12911 N - -//z1 uiR2_Forest42 uiR2EntryPoint01 22830 -13600 NE -//z1 uiR2_Forest42 uiR2EntryPoint02 23342 -13475 W -//z1 uiR2_Forest42 uiR2EntryPoint03 22853 -13394 SE -//z1 uiR2_Forest42 uiR2EntryPoint04 23099 -13430 S - -//z1 uiR2_Forest43 uiR2EntryPoint01 24000 -13600 N -//z1 uiR2_Forest43 uiR2EntryPoint02 24076 -13838 W -//z1 uiR2_Forest43 uiR2EntryPoint03 23825 -13411 SE -//z1 uiR2_Forest43 uiR2EntryPoint04 24208 -13583 W -//z1 uiR2_Forest43 uiR2EntryPoint05 24000 -13364 S -//z1 uiR2_Forest43 uiR2EntryPoint06 24039 -13492 W - -//z1 uiR2_Forest44 uiR2EntryPoint01 24670 -13600 S -//z1 uiR2_Forest44 uiR2EntryPoint02 24877 -14823 N -//z1 uiR2_Forest44 uiR2EntryPoint03 24959 -14224 W -//z1 uiR2_Forest44 uiR2EntryPoint04 24653 -14092 N -//z1 uiR2_Forest44 uiR2EntryPoint05 24565 -13357 S -//z1 uiR2_Forest44 uiR2EntryPoint06 24642 -14325 E - - - - -// Jungle - -a1 uiR2_Jungle14 uiR2EntryPoint01 40700 -11200 E -a1 uiR2_Jungle14 uiR2EntryPoint02 40876 -11370 W -a1 uiR2_Jungle14 uiR2EntryPoint03 40681 -11376 W -a1 uiR2_Jungle14 uiR2EntryPoint04 40841 -10966 W - -a1 uiR2_Jungle23 uiR2EntryPoint01 38200 -12000 N -a1 uiR2_Jungle23 uiR2EntryPoint02 38163 -11917 W -a1 uiR2_Jungle23 uiR2EntryPoint03 37956 -12037 E -a1 uiR2_Jungle23 uiR2EntryPoint04 38356 -11999 NW -a1 uiR2_Jungle23 uiR2EntryPoint05 38489 -11936 NW -a1 uiR2_Jungle23 uiR2EntryPoint06 38196 -11782 S - -a1 uiR2_Jungle27 uiR2EntryPoint01 31200 -12700 N -a1 uiR2_Jungle27 uiR2EntryPoint02 31207 -12533 S -a1 uiR2_Jungle27 uiR2EntryPoint03 31299 -12813 NW - -j1 uiR2_Jungle06 uiR2EntryPoint01 34426 -11339 NE -j1 uiR2_Jungle06 uiR2EntryPoint02 34698 -11060 W -j1 uiR2_Jungle06 uiR2EntryPoint03 34836 -11243 W -j1 uiR2_Jungle06 uiR2EntryPoint04 34651 -11405 S -j1 uiR2_Jungle06 uiR2EntryPoint05 34372 -11029 E - -j1 uiR2_Jungle07 uiR2EntryPoint01 35300 -11200 SE -j1 uiR2_Jungle07 uiR2EntryPoint02 35534 -11057 SW -j1 uiR2_Jungle07 uiR2EntryPoint03 35424 -11378 N -j1 uiR2_Jungle07 uiR2EntryPoint04 35100 -11026 SE - -j1 uiR2_Jungle15 uiR2EntryPoint01 31300 -12000 N -j1 uiR2_Jungle15 uiR2EntryPoint02 31181 -11823 SE -j1 uiR2_Jungle15 uiR2EntryPoint03 31185 -12211 NE -j1 uiR2_Jungle15 uiR2EntryPoint04 31549 -12148 NW -j1 uiR2_Jungle15 uiR2EntryPoint05 31549 -11920 W - -j1 uiR2_Jungle18 uiR2EntryPoint01 34000 -12000 S -j1 uiR2_Jungle18 uiR2EntryPoint02 34234 -12243 N -j1 uiR2_Jungle18 uiR2EntryPoint03 34161 -11953 E -j1 uiR2_Jungle18 uiR2EntryPoint04 34191 -11792 S -j1 uiR2_Jungle18 uiR2EntryPoint05 33799 -11882 SE -j1 uiR2_Jungle18 uiR2EntryPoint06 33832 -12256 N - -j1 uiR2_Jungle36 uiR2EntryPoint01 37074 -12782 N -j1 uiR2_Jungle36 uiR2EntryPoint02 37071 -12878 SW -j1 uiR2_Jungle36 uiR2EntryPoint03 36896 -12875 E -j1 uiR2_Jungle36 uiR2EntryPoint04 36934 -12737 S -j1 uiR2_Jungle36 uiR2EntryPoint05 36978 -13070 N -j1 uiR2_Jungle36 uiR2EntryPoint06 36800 -13062 NE - -j1 uiR2_Jungle41 uiR2EntryPoint01 40648 -12573 N -j1 uiR2_Jungle41 uiR2EntryPoint02 40696 -12807 E -j1 uiR2_Jungle41 uiR2EntryPoint03 40771 -13042 N - -j1 uiR2_Jungle53 uiR2EntryPoint01 39683 -13678 W -j1 uiR2_Jungle53 uiR2EntryPoint02 39413 -13784 NE -j1 uiR2_Jungle53 uiR2EntryPoint03 39514 -13435 SE -j1 uiR2_Jungle53 uiR2EntryPoint04 39718 -13338 S - -j2 uiR2_Jungle01 uiR2EntryPoint01 31300 -11100 S -j2 uiR2_Jungle01 uiR2EntryPoint02 31257 -10932 E -j2 uiR2_Jungle01 uiR2EntryPoint03 31594 -11118 N -j2 uiR2_Jungle01 uiR2EntryPoint04 31080 -11296 NE - -j2 uiR2_Jungle28 uiR2EntryPoint01 31600 -12550 N -j2 uiR2_Jungle28 uiR2EntryPoint02 31788 -12534 S - -j2 uiR2_Jungle32 uiR2EntryPoint01 33720 -12700 SW -j2 uiR2_Jungle32 uiR2EntryPoint02 33855 -12620 W -j2 uiR2_Jungle32 uiR2EntryPoint03 33646 -12853 SE -j2 uiR2_Jungle32 uiR2EntryPoint04 33757 -12969 NW - -j2 uiR2_Jungle34 uiR2EntryPoint01 35220 -12610 N -j2 uiR2_Jungle34 uiR2EntryPoint02 35030 -12535 SW -j2 uiR2_Jungle34 uiR2EntryPoint03 35028 -12728 SE -j2 uiR2_Jungle34 uiR2EntryPoint04 35304 -12781 W -j2 uiR2_Jungle34 uiR2EntryPoint05 35419 -12726 S - -j2 uiR2_Jungle51 uiR2EntryPoint01 38204 -13916 N -j2 uiR2_Jungle51 uiR2EntryPoint02 38135 -13696 NW -j2 uiR2_Jungle51 uiR2EntryPoint03 38032 -13508 E - -j2 uiR2_Jungle02 uiR2EntryPoint01 32203 -11283 NW -j2 uiR2_Jungle02 uiR2EntryPoint02 32062 -10944 E -j2 uiR2_Jungle02 uiR2EntryPoint03 32396 -11409 N -j2 uiR2_Jungle02 uiR2EntryPoint04 32557 -11107 S -j2 uiR2_Jungle02 uiR2EntryPoint05 32533 -10964 W - -j2 uiR2_Jungle05 uiR2EntryPoint01 33768 -11278 N -j2 uiR2_Jungle05 uiR2EntryPoint02 33981 -11292 W - -j3 uiR2_Jungle38 uiR2EntryPoint01 38290 -12740 E -j3 uiR2_Jungle38 uiR2EntryPoint02 38288 -12905 E -j3 uiR2_Jungle38 uiR2EntryPoint03 38446 -13070 E -j3 uiR2_Jungle38 uiR2EntryPoint04 38665 -12895 NW -j3 uiR2_Jungle38 uiR2EntryPoint05 38475 -12755 S - -j3 uiR2_Jungle49 uiR2EntryPoint01 36953 -13596 N -j3 uiR2_Jungle49 uiR2EntryPoint02 36931 -13379 SW -j3 uiR2_Jungle49 uiR2EntryPoint03 36564 -13630 NE -j3 uiR2_Jungle49 uiR2EntryPoint04 36901 -13803 N - -j3 uiR2_Jungle52 uiR2EntryPoint01 39145 -13665 W -j3 uiR2_Jungle52 uiR2EntryPoint02 39053 -13517 E -j3 uiR2_Jungle52 uiR2EntryPoint03 38963 -13387 N -j3 uiR2_Jungle52 uiR2EntryPoint04 38710 -13477 S -j3 uiR2_Jungle52 uiR2EntryPoint05 38931 -13723 W -j3 uiR2_Jungle52 uiR2EntryPoint06 38915 -13580 N - -j3 uiR2_Jungle03 uiR2EntryPoint01 33100 -11200 NE -j3 uiR2_Jungle03 uiR2EntryPoint02 32837 -11458 E -j3 uiR2_Jungle03 uiR2EntryPoint03 33230 -11343 N -j3 uiR2_Jungle03 uiR2EntryPoint04 33304 -11015 SW - -j3 uiR2_Jungle24 uiR2EntryPoint01 39000 -12000 W -j3 uiR2_Jungle24 uiR2EntryPoint02 39297 -11888 S -j3 uiR2_Jungle24 uiR2EntryPoint03 38832 -11886 SE -j3 uiR2_Jungle24 uiR2EntryPoint04 38847 -12265 NE -j3 uiR2_Jungle24 uiR2EntryPoint05 39289 -12258 NE - -j3 uiR2_Jungle25 uiR2EntryPoint01 39621 -12083 NW -j3 uiR2_Jungle25 uiR2EntryPoint02 39938 -12037 S -j3 uiR2_Jungle25 uiR2EntryPoint03 39916 -12213 SE -j3 uiR2_Jungle25 uiR2EntryPoint04 40114 -11884 W -j3 uiR2_Jungle25 uiR2EntryPoint05 39955 -11803 W -j3 uiR2_Jungle25 uiR2EntryPoint06 39786 -11886 W - -j3 uiR2_Jungle29 uiR2EntryPoint01 31753 -12934 N -j3 uiR2_Jungle29 uiR2EntryPoint02 31766 -13034 W -j3 uiR2_Jungle29 uiR2EntryPoint03 31948 -12894 NW -j3 uiR2_Jungle29 uiR2EntryPoint04 31574 -12918 N - -j4 uiR2_Jungle50 uiR2EntryPoint01 37426 -13620 N -j4 uiR2_Jungle50 uiR2EntryPoint02 37482 -13875 E -j4 uiR2_Jungle50 uiR2EntryPoint03 37596 -13682 E -j4 uiR2_Jungle50 uiR2EntryPoint04 37700 -13544 NE -j4 uiR2_Jungle50 uiR2EntryPoint05 37685 -13388 NW - -j4 uiR2_Jungle08 uiR2EntryPoint01 36200 -11200 SE -j4 uiR2_Jungle08 uiR2EntryPoint02 36390 -11360 W -j4 uiR2_Jungle08 uiR2EntryPoint03 36076 -11069 W - -j4 uiR2_Jungle12 uiR2EntryPoint01 39235 -11288 N -j4 uiR2_Jungle12 uiR2EntryPoint02 39448 -10932 W -j4 uiR2_Jungle12 uiR2EntryPoint03 38946 -11120 E -j4 uiR2_Jungle12 uiR2EntryPoint04 39153 -11467 N -j4 uiR2_Jungle12 uiR2EntryPoint05 39130 -11005 NE -j4 uiR2_Jungle12 uiR2EntryPoint06 39426 -11406 S - -j4 uiR2_Jungle16 uiR2EntryPoint01 32200 -12000 E -j4 uiR2_Jungle16 uiR2EntryPoint02 32017 -11813 S -j4 uiR2_Jungle16 uiR2EntryPoint03 32332 -12242 N -j4 uiR2_Jungle16 uiR2EntryPoint04 32459 -11865 W -j4 uiR2_Jungle16 uiR2EntryPoint05 32047 -12201 N - -j4 uiR2_Jungle22 uiR2EntryPoint01 37400 -12000 N -j4 uiR2_Jungle22 uiR2EntryPoint02 37515 -11789 N -j4 uiR2_Jungle22 uiR2EntryPoint03 37631 -12105 N -j4 uiR2_Jungle22 uiR2EntryPoint04 37530 -12275 NE -j4 uiR2_Jungle22 uiR2EntryPoint05 37339 -12275 NW -j4 uiR2_Jungle22 uiR2EntryPoint06 37167 -11731 S - -j4 uiR2_Jungle42 uiR2EntryPoint01 31103 -13282 E -j4 uiR2_Jungle42 uiR2EntryPoint02 31352 -13419 W -j4 uiR2_Jungle42 uiR2EntryPoint03 31285 -13573 S -j4 uiR2_Jungle42 uiR2EntryPoint04 31307 -13712 N -j4 uiR2_Jungle42 uiR2EntryPoint05 31420 -13639 SW -j4 uiR2_Jungle42 uiR2EntryPoint06 31083 -13691 NE - - -o1 uiR2_Jungle11 uiR2EntryPoint01 38400 -11200 N -o1 uiR2_Jungle11 uiR2EntryPoint02 38565 -11080 W -o1 uiR2_Jungle11 uiR2EntryPoint03 38389 -11029 E - -o1 uiR2_Jungle19 uiR2EntryPoint01 35000 -12000 N -o1 uiR2_Jungle19 uiR2EntryPoint02 34752 -12146 NE -o1 uiR2_Jungle19 uiR2EntryPoint03 34749 -11909 SE -o1 uiR2_Jungle19 uiR2EntryPoint04 35292 -12042 S -o1 uiR2_Jungle19 uiR2EntryPoint05 35320 -12203 S - -o1 uiR2_Jungle21 uiR2EntryPoint01 36600 -12000 N -o1 uiR2_Jungle21 uiR2EntryPoint02 36833 -11757 SW -o1 uiR2_Jungle21 uiR2EntryPoint03 36443 -12055 E -o1 uiR2_Jungle21 uiR2EntryPoint04 36504 -12275 NW -o1 uiR2_Jungle21 uiR2EntryPoint05 36657 -12265 NW - -o1 uiR2_Jungle26 uiR2EntryPoint01 40600 -12000 W -o1 uiR2_Jungle26 uiR2EntryPoint02 40903 -11996 W -o1 uiR2_Jungle26 uiR2EntryPoint03 40429 -12233 NE - -o1 uiR2_Jungle30 uiR2EntryPoint01 32318 -12599 N -o1 uiR2_Jungle30 uiR2EntryPoint02 32444 -12765 N -o1 uiR2_Jungle30 uiR2EntryPoint03 32497 -12629 W - -o1 uiR2_Jungle33 uiR2EntryPoint01 34230 -12745 N -o1 uiR2_Jungle33 uiR2EntryPoint02 34311 -12806 SE -o1 uiR2_Jungle33 uiR2EntryPoint03 34399 -12967 W -o1 uiR2_Jungle33 uiR2EntryPoint04 34221 -12959 E - -o1 uiR2_Jungle35 uiR2EntryPoint01 35800 -13010 N -o1 uiR2_Jungle35 uiR2EntryPoint02 36057 -12912 W -o1 uiR2_Jungle35 uiR2EntryPoint03 35755 -12619 E -o1 uiR2_Jungle35 uiR2EntryPoint04 36228 -12618 W -o1 uiR2_Jungle35 uiR2EntryPoint05 35934 -12714 E - -o1 uiR2_Jungle44 uiR2EntryPoint01 32799 -13439 N -o1 uiR2_Jungle44 uiR2EntryPoint02 32628 -13363 SE -o1 uiR2_Jungle44 uiR2EntryPoint03 32928 -13375 SW -o1 uiR2_Jungle44 uiR2EntryPoint04 32828 -13484 SE -o1 uiR2_Jungle44 uiR2EntryPoint05 32954 -13703 N - -o1 uiR2_Jungle45 uiR2EntryPoint01 33599 -13741 N -o1 uiR2_Jungle45 uiR2EntryPoint02 33422 -13656 NE -o1 uiR2_Jungle45 uiR2EntryPoint03 33762 -13543 NW -o1 uiR2_Jungle45 uiR2EntryPoint04 33521 -13372 SE - -o1 uiR2_Jungle46 uiR2EntryPoint01 34218 -13905 N -o1 uiR2_Jungle46 uiR2EntryPoint02 34374 -13798 NE -o1 uiR2_Jungle46 uiR2EntryPoint03 34517 -13771 S -o1 uiR2_Jungle46 uiR2EntryPoint04 34582 -13541 SE -o1 uiR2_Jungle46 uiR2EntryPoint05 34311 -13491 N -o1 uiR2_Jungle46 uiR2EntryPoint06 34194 -13371 NW - -o1 uiR2_Jungle47 uiR2EntryPoint01 35624 -13369 N -o1 uiR2_Jungle47 uiR2EntryPoint02 35613 -13526 W -o1 uiR2_Jungle47 uiR2EntryPoint03 35446 -13684 E -o1 uiR2_Jungle47 uiR2EntryPoint04 35162 -13683 W -o1 uiR2_Jungle47 uiR2EntryPoint05 35118 -13442 E -o1 uiR2_Jungle47 uiR2EntryPoint06 35379 -13426 SE - -o1 uiR2_Jungle48 uiR2EntryPoint01 35989 -13425 N -o1 uiR2_Jungle48 uiR2EntryPoint02 36122 -13469 SW -o1 uiR2_Jungle48 uiR2EntryPoint03 36107 -13750 N - - - -//z1 uiR2_Jungle04 uiR2EntryPoint01 33840 -11000 N - -//z1 uiR2_Jungle09 uiR2EntryPoint01 36694 -11144 E -//z1 uiR2_Jungle09 uiR2EntryPoint02 36947 -11190 N -//z1 uiR2_Jungle09 uiR2EntryPoint03 36698 -10954 S -//z1 uiR2_Jungle09 uiR2EntryPoint04 36679 -11467 N -//z1 uiR2_Jungle09 uiR2EntryPoint05 36880 -11041 S -//z1 uiR2_Jungle09 uiR2EntryPoint06 36870 -11253 E -//z1 uiR2_Jungle09 uiR2EntryPoint07 37203 -11179 N - -//z1 uiR2_Jungle10 uiR2EntryPoint01 37790 -11080 E -//z1 uiR2_Jungle10 uiR2EntryPoint02 37909 -11413 N -//z1 uiR2_Jungle10 uiR2EntryPoint03 37530 -11208 NE -//z1 uiR2_Jungle10 uiR2EntryPoint04 37588 -11375 N - -//z1 uiR2_Jungle13 uiR2EntryPoint01 40000 -11200 W -//z1 uiR2_Jungle13 uiR2EntryPoint02 40187 -11030 S -//z1 uiR2_Jungle13 uiR2EntryPoint03 39771 -10957 E -//z1 uiR2_Jungle13 uiR2EntryPoint04 39793 -11177 E -//z1 uiR2_Jungle13 uiR2EntryPoint05 40057 -11356 E - -//z1 uiR2_Jungle17 uiR2EntryPoint01 33000 -12000 N -//z1 uiR2_Jungle17 uiR2EntryPoint02 33158 -12149 N -//z1 uiR2_Jungle17 uiR2EntryPoint03 33211 -11895 N -//z1 uiR2_Jungle17 uiR2EntryPoint04 33199 -12007 W -//z1 uiR2_Jungle17 uiR2EntryPoint05 32971 -11754 S -//z1 uiR2_Jungle17 uiR2EntryPoint06 33038 -11926 E - -//z1 uiR2_Jungle20 uiR2EntryPoint01 35650 -12140 N - -//z1 uiR2_Jungle31 uiR2EntryPoint01 33149 -12874 N -//z1 uiR2_Jungle31 uiR2EntryPoint02 33066 -13037 S -//z1 uiR2_Jungle31 uiR2EntryPoint03 33043 -12726 NW - -//z1 uiR2_Jungle37 uiR2EntryPoint01 37929 -12925 N - -//z1 uiR2_Jungle39 uiR2EntryPoint01 38971 -12788 N -//z1 uiR2_Jungle39 uiR2EntryPoint02 39024 -13072 NE -//z1 uiR2_Jungle39 uiR2EntryPoint03 39159 -12877 E -//z1 uiR2_Jungle39 uiR2EntryPoint04 39432 -13045 N -//z1 uiR2_Jungle39 uiR2EntryPoint05 39280 -12841 N -//z1 uiR2_Jungle39 uiR2EntryPoint06 39255 -12682 N -//z1 uiR2_Jungle39 uiR2EntryPoint07 39433 -12707 E - -//z1 uiR2_Jungle40 uiR2EntryPoint01 40132 -12610 N - -//z1 uiR2_Jungle43 uiR2EntryPoint01 31767 -13391 N - - -// Prime Roots - -p1 uiR2_Primes04 uiR2EntryPoint01 33300 -21200 S -p1 uiR2_Primes04 uiR2EntryPoint02 33454 -21456 NW -p1 uiR2_Primes04 uiR2EntryPoint03 33029 -21522 E - -p1 uiR2_Primes06 uiR2EntryPoint01 34700 -21070 SE -p1 uiR2_Primes06 uiR2EntryPoint02 34905 -21093 SW -p1 uiR2_Primes06 uiR2EntryPoint03 34733 -21359 N - -p1 uiR2_Primes22 uiR2EntryPoint01 37500 -21960 S -p1 uiR2_Primes22 uiR2EntryPoint02 37524 -22163 N -p1 uiR2_Primes22 uiR2EntryPoint03 37394 -22286 NE - -p1 uiR2_Primes09 uiR2EntryPoint01 36950 -21200 E -p1 uiR2_Primes09 uiR2EntryPoint02 37532 -21366 W -p1 uiR2_Primes09 uiR2EntryPoint03 37208 -21170 S - -p3 uiR2_Primes29 uiR2EntryPoint01 33140 -22910 W -p3 uiR2_Primes29 uiR2EntryPoint02 33016 -22602 S -p3 uiR2_Primes29 uiR2EntryPoint03 32776 -23057 NE - -p3 uiR2_Primes01 uiR2EntryPoint01 31110 -21520 E -p3 uiR2_Primes01 uiR2EntryPoint02 31198 -21061 S -p3 uiR2_Primes01 uiR2EntryPoint03 31132 -21312 E - -p3 uiR2_Primes05 uiR2EntryPoint01 34250 -21300 W -p3 uiR2_Primes05 uiR2EntryPoint02 33891 -21271 E -p3 uiR2_Primes05 uiR2EntryPoint03 34151 -21558 N - -p5 uiR2_Primes16 uiR2EntryPoint01 32970 -22100 NW -p5 uiR2_Primes16 uiR2EntryPoint02 32763 -21871 SE -p5 uiR2_Primes16 uiR2EntryPoint03 32890 -21990 S - -p5 uiR2_Primes18 uiR2EntryPoint01 34600 -22075 W -p5 uiR2_Primes18 uiR2EntryPoint02 34205 -22078 E -p5 uiR2_Primes18 uiR2EntryPoint03 34651 -21825 S - -p5 uiR2_Primes25 uiR2EntryPoint01 39910 -22320 E -p5 uiR2_Primes25 uiR2EntryPoint02 39757 -22077 E -p5 uiR2_Primes25 uiR2EntryPoint03 39979 -22132 NW - -p6 uiR2_Primes03 uiR2EntryPoint01 32300 -21100 SE -p6 uiR2_Primes03 uiR2EntryPoint02 32288 -21484 N -p6 uiR2_Primes03 uiR2EntryPoint03 32691 -21085 SW - -p6 uiR2_Primes07 uiR2EntryPoint01 35350 -21300 NE -p6 uiR2_Primes07 uiR2EntryPoint02 35519 -21067 S -p6 uiR2_Primes07 uiR2EntryPoint03 35601 -21405 N - -p6 uiR2_Primes13 uiR2EntryPoint01 40330 -21600 N -p6 uiR2_Primes13 uiR2EntryPoint02 40127 -21438 E -p6 uiR2_Primes13 uiR2EntryPoint03 40537 -21438 W - -p7 uiR2_Primes19 uiR2EntryPoint01 35000 -22300 N -p7 uiR2_Primes19 uiR2EntryPoint02 35456 -22007 W -p7 uiR2_Primes19 uiR2EntryPoint03 35022 -21891 SE - -p7 uiR2_Primes26 uiR2EntryPoint01 40500 -22100 N -p7 uiR2_Primes26 uiR2EntryPoint02 40694 -22284 NW -p7 uiR2_Primes26 uiR2EntryPoint03 40426 -22298 NE - -p7 uiR2_Primes08 uiR2EntryPoint01 36200 -21100 E -p7 uiR2_Primes08 uiR2EntryPoint02 36393 -21558 N -p7 uiR2_Primes08 uiR2EntryPoint03 36077 -21345 S - -p8 uiR2_Primes10 uiR2EntryPoint01 38002 -21293 N -p8 uiR2_Primes10 uiR2EntryPoint02 38006 -21532 N -p8 uiR2_Primes10 uiR2EntryPoint03 38094 -21040 S - -p8 uiR2_Primes11 uiR2EntryPoint01 38970 -21520 W -p8 uiR2_Primes11 uiR2EntryPoint02 38721 -21047 S -p8 uiR2_Primes11 uiR2EntryPoint03 38577 -21350 NW - -p8 uiR2_Primes15 uiR2EntryPoint01 31980 -21880 SE -p8 uiR2_Primes15 uiR2EntryPoint02 32365 -22121 NW -p8 uiR2_Primes15 uiR2EntryPoint03 32159 -22032 N - -p11 uiR2_Primes30 uiR2EntryPoint01 33730 -22860 N -p11 uiR2_Primes30 uiR2EntryPoint02 33656 -22604 E -p11 uiR2_Primes30 uiR2EntryPoint03 33843 -22997 E - -p11 uiR2_Primes12 uiR2EntryPoint01 39500 -21280 NE -p11 uiR2_Primes12 uiR2EntryPoint02 39240 -21197 E -p11 uiR2_Primes12 uiR2EntryPoint03 39800 -21352 W - -p11 uiR2_Primes14 uiR2EntryPoint01 31350 -21960 S -p11 uiR2_Primes14 uiR2EntryPoint02 31373 -22074 S -p11 uiR2_Primes14 uiR2EntryPoint03 31166 -22272 NE - -p12 uiR2_Primes17 uiR2EntryPoint01 33660 -22000 SW -p12 uiR2_Primes17 uiR2EntryPoint02 33397 -21879 SE -p12 uiR2_Primes17 uiR2EntryPoint03 33347 -22331 N - -p12 uiR2_Primes21 uiR2EntryPoint01 37000 -22150 W -p12 uiR2_Primes21 uiR2EntryPoint02 36645 -21864 SE -p12 uiR2_Primes21 uiR2EntryPoint03 36964 -21813 SE - -p12 uiR2_Primes27 uiR2EntryPoint01 31530 -22700 SW -p12 uiR2_Primes27 uiR2EntryPoint02 31533 -23080 NW -p12 uiR2_Primes27 uiR2EntryPoint03 31078 -22800 N - - - -o1 uiR2_Primes02 uiR2EntryPoint01 31640 -21140 SE -o1 uiR2_Primes02 uiR2EntryPoint02 31593 -21374 N -o1 uiR2_Primes02 uiR2EntryPoint03 31818 -21204 W - -o1 uiR2_Primes28 uiR2EntryPoint01 32270 -23000 N -o1 uiR2_Primes28 uiR2EntryPoint02 32316 -22662 S -o1 uiR2_Primes28 uiR2EntryPoint03 31933 -22734 SE - - - -//z1 uiR2_Primes20 uiR2EntryPoint01 35790 -22100 N - -//z1 uiR2_Primes23 uiR2EntryPoint01 38360 -21970 N - -//z1 uiR2_Primes24 uiR2EntryPoint02 38906 -21891 SE - -//z1 uiR2_Primes24 uiR2EntryPoint03 39086 -22287 NW diff --git a/code/ryzom/common/data_common/r2/unit_test/r2_unit_test.lua b/code/ryzom/common/data_common/r2/unit_test/r2_unit_test.lua index 572f2080a..b48e3da5a 100644 --- a/code/ryzom/common/data_common/r2/unit_test/r2_unit_test.lua +++ b/code/ryzom/common/data_common/r2/unit_test/r2_unit_test.lua @@ -36,7 +36,7 @@ UnitTest.testLoadAnimationScenarioUi = function() end local filename = form.LoadScenario_Name - if string.find(filename, '\.r2', -3) == nil then + if string.find(filename, '.r2', -3) == nil then local ui = r2:getForm("LoadScenario") ui.active = true @@ -134,12 +134,12 @@ UnitTest.testLoadScenarioUi = function() local ucName = ucstring() ucName:fromUtf8(form.LoadScenario_Name) local filename = tostring(ucName) - if string.find(filename, '\.r2', -3) == nil then + if string.find(filename, '.r2', -3) == nil then messageBox(i18n.get("uiR2EDLoadScenario_InvalidFileName")) return end --- if string.find(filename, '\.r2', -3) == nil then +-- if string.find(filename, '.r2', -3) == nil then -- filename = form.Name .. ".r2" -- end @@ -206,7 +206,7 @@ function UnitTest.saveScenario(name, overwrite) messageBox(i18n.get("uiR2EDInvalidName")) return end - if string.find(name, '\.r2', -3) == nil then + if string.find(name, '.r2', -3) == nil then name = name .. ".r2" end -- update scenario name with the new name @@ -1103,8 +1103,8 @@ end function t5() - local toto = "&ezr_çà'_\\)d //:1' 2 éééà'..)à\/:*?\"<>|à)@4 58ftgsfdg\"\/:*?\"<>|" - toto = string.gsub(toto, "[\\\/\:\*\?\"\<\>\|]", "_") + local toto = "&ezr_çà'_\\)d //:1' 2 éééà'..)à/:*?\"<>|à)@4 58ftgsfdg\"/:*?\"<>|" + toto = string.gsub(toto, "[\\/:*?\"<>|]", "_") end diff --git a/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/world_editor_classes.xml b/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/world_editor_classes.xml index de424f76f..d9aae794a 100644 --- a/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/world_editor_classes.xml +++ b/code/ryzom/common/data_leveldesign/leveldesign/world_editor_files/world_editor_classes.xml @@ -1112,7 +1112,7 @@ - + @@ -1126,7 +1126,7 @@ - + @@ -5023,13 +5023,13 @@ - + - + - + diff --git a/code/ryzom/common/src/game_share/_backup_service_interface_non_module.cpp b/code/ryzom/common/src/game_share/_backup_service_interface_non_module.cpp index 2e1d474b2..801d78433 100644 --- a/code/ryzom/common/src/game_share/_backup_service_interface_non_module.cpp +++ b/code/ryzom/common/src/game_share/_backup_service_interface_non_module.cpp @@ -381,7 +381,7 @@ void CBSIINonModule::activate() // setup the callback array CUnifiedNetwork::getInstance()->addCallbackArray( CbArray, sizeof(CbArray)/sizeof(CbArray[0]) ); - string host = BackupServiceIP; + string host = BackupServiceIP.get(); if(host.empty()) { nlwarning("Can't use backup because BSHost variable is empty"); diff --git a/code/ryzom/common/src/game_share/base_types.h b/code/ryzom/common/src/game_share/base_types.h index 250e5f5e4..5330537b7 100644 --- a/code/ryzom/common/src/game_share/base_types.h +++ b/code/ryzom/common/src/game_share/base_types.h @@ -238,8 +238,7 @@ public: CHashCode() {} - static const size_t bucket_size = 4; - static const size_t min_buckets = 8; + enum { bucket_size = 4, min_buckets = 8, }; size_t operator () ( const TDataSetRow &index ) const { return index.getHashCode(); } diff --git a/code/ryzom/server/src/server_share/bmp4image.h b/code/ryzom/common/src/game_share/bmp4image.h similarity index 100% rename from code/ryzom/server/src/server_share/bmp4image.h rename to code/ryzom/common/src/game_share/bmp4image.h diff --git a/code/ryzom/common/src/game_share/brick_types.h b/code/ryzom/common/src/game_share/brick_types.h index fafdb2e4f..871a02cfb 100644 --- a/code/ryzom/common/src/game_share/brick_types.h +++ b/code/ryzom/common/src/game_share/brick_types.h @@ -43,7 +43,7 @@ namespace BRICK_TYPE TIMED_ACTION, BRICK_TYPE_COUNT, BONUS, - UNKNOWN + UNKNOWN // Warning: Shouldn't exceed 32 }; diff --git a/code/ryzom/common/src/game_share/crypt.cpp b/code/ryzom/common/src/game_share/crypt.cpp index 0da908817..1750d5d20 100644 --- a/code/ryzom/common/src/game_share/crypt.cpp +++ b/code/ryzom/common/src/game_share/crypt.cpp @@ -18,16 +18,15 @@ #include "crypt.h" -char * rz_crypt(register const char *key, register const char *setting); - +char * rz_crypt(register const char *key, register const char *setting, char *buf); +char *__crypt_sha512(const char *key, const char *setting, char *output); // Crypts password using salt std::string CCrypt::crypt(const std::string& password, const std::string& salt) { - std::string result = ::rz_crypt(password.c_str(), salt.c_str()); - - return result; + char buf[128]; + return ::rz_crypt(password.c_str(), salt.c_str(), buf); } @@ -506,7 +505,7 @@ static char cryptresult[1+4+4+11+1]; /* encrypted result */ * Return a pointer to static data consisting of the "setting" * followed by an encryption produced by the "key" and "setting". */ -char * rz_crypt(register const char *key, register const char *setting) { +char * rz_crypt(register const char *key, register const char *setting, char *buf) { register char *encp; register long i; register int t; @@ -521,6 +520,10 @@ char * rz_crypt(register const char *key, register const char *setting) { return buff; #endif + if (strlen(setting) >= 2 && setting[0] == '$' && setting[1] == '6') { + return __crypt_sha512(key, setting, buf); + } + for (i = 0; i < 8; i++) { if ((t = 2*(unsigned char)(*key)) != 0) key++; diff --git a/code/ryzom/common/src/game_share/crypt.h b/code/ryzom/common/src/game_share/crypt.h index ea479d74f..b9fa8556b 100644 --- a/code/ryzom/common/src/game_share/crypt.h +++ b/code/ryzom/common/src/game_share/crypt.h @@ -32,7 +32,7 @@ class CCrypt public: /// Crypts password using salt - static std::string crypt(const std::string& password, const std::string& salt); + static std::string crypt(const std::string& password, const std::string& salt); }; diff --git a/code/ryzom/common/src/game_share/crypt_sha512.cpp b/code/ryzom/common/src/game_share/crypt_sha512.cpp new file mode 100644 index 000000000..4d151880d --- /dev/null +++ b/code/ryzom/common/src/game_share/crypt_sha512.cpp @@ -0,0 +1,375 @@ +/* + * public domain sha512 crypt implementation + * + * original sha crypt design: http://people.redhat.com/drepper/SHA-crypt.txt + * in this implementation at least 32bit int is assumed, + * key length is limited, the $6$ prefix is mandatory, '\n' and ':' is rejected + * in the salt and rounds= setting must contain a valid iteration count, + * on error "*" is returned. + */ + +#include + +#include +#include +#include +#include + +/* public domain sha512 implementation based on fips180-3 */ +/* >=2^64 bits messages are not supported (about 2000 peta bytes) */ + +struct sha512 { + uint64 len; /* processed message length */ + uint64 h[8]; /* hash state */ + uint8 buf[128]; /* message block buffer */ +}; + +static uint64 ror(uint64 n, int k) { return (n >> k) | (n << (64-k)); } +#define Ch(x,y,z) (z ^ (x & (y ^ z))) +#define Maj(x,y,z) ((x & y) | (z & (x | y))) +#define S0(x) (ror(x,28) ^ ror(x,34) ^ ror(x,39)) +#define S1(x) (ror(x,14) ^ ror(x,18) ^ ror(x,41)) +#define R0(x) (ror(x,1) ^ ror(x,8) ^ (x>>7)) +#define R1(x) (ror(x,19) ^ ror(x,61) ^ (x>>6)) + +static const uint64 K[80] = { + 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, 0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL, + 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL, 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL, + 0xd807aa98a3030242ULL, 0x12835b0145706fbeULL, 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL, + 0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL, 0x9bdc06a725c71235ULL, 0xc19bf174cf692694ULL, + 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL, 0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL, + 0x2de92c6f592b0275ULL, 0x4a7484aa6ea6e483ULL, 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL, + 0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL, 0xb00327c898fb213fULL, 0xbf597fc7beef0ee4ULL, + 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL, 0x06ca6351e003826fULL, 0x142929670a0e6e70ULL, + 0x27b70a8546d22ffcULL, 0x2e1b21385c26c926ULL, 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL, + 0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL, 0x81c2c92e47edaee6ULL, 0x92722c851482353bULL, + 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL, 0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL, + 0xd192e819d6ef5218ULL, 0xd69906245565a910ULL, 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL, + 0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL, 0x2748774cdf8eeb99ULL, 0x34b0bcb5e19b48a8ULL, + 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL, 0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL, + 0x748f82ee5defb2fcULL, 0x78a5636f43172f60ULL, 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL, + 0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL, 0xbef9a3f7b2c67915ULL, 0xc67178f2e372532bULL, + 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL, 0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL, + 0x06f067aa72176fbaULL, 0x0a637dc5a2c898a6ULL, 0x113f9804bef90daeULL, 0x1b710b35131c471bULL, + 0x28db77f523047d84ULL, 0x32caab7b40c72493ULL, 0x3c9ebe0a15c9bebcULL, 0x431d67c49c100d4cULL, + 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL, 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL +}; + +static void processblock(struct sha512 *s, const uint8 *buf) +{ + uint64 W[80], t1, t2, a, b, c, d, e, f, g, h; + int i; + + for (i = 0; i < 16; i++) { + W[i] = (uint64)buf[8*i]<<56; + W[i] |= (uint64)buf[8*i+1]<<48; + W[i] |= (uint64)buf[8*i+2]<<40; + W[i] |= (uint64)buf[8*i+3]<<32; + W[i] |= (uint64)buf[8*i+4]<<24; + W[i] |= (uint64)buf[8*i+5]<<16; + W[i] |= (uint64)buf[8*i+6]<<8; + W[i] |= buf[8*i+7]; + } + for (; i < 80; i++) + W[i] = R1(W[i-2]) + W[i-7] + R0(W[i-15]) + W[i-16]; + a = s->h[0]; + b = s->h[1]; + c = s->h[2]; + d = s->h[3]; + e = s->h[4]; + f = s->h[5]; + g = s->h[6]; + h = s->h[7]; + for (i = 0; i < 80; i++) { + t1 = h + S1(e) + Ch(e,f,g) + K[i] + W[i]; + t2 = S0(a) + Maj(a,b,c); + h = g; + g = f; + f = e; + e = d + t1; + d = c; + c = b; + b = a; + a = t1 + t2; + } + s->h[0] += a; + s->h[1] += b; + s->h[2] += c; + s->h[3] += d; + s->h[4] += e; + s->h[5] += f; + s->h[6] += g; + s->h[7] += h; +} + +static void pad(struct sha512 *s) +{ + unsigned r = s->len % 128; + + s->buf[r++] = 0x80; + if (r > 112) { + memset(s->buf + r, 0, 128 - r); + r = 0; + processblock(s, s->buf); + } + memset(s->buf + r, 0, 120 - r); + s->len *= 8; + s->buf[120] = s->len >> 56; + s->buf[121] = s->len >> 48; + s->buf[122] = s->len >> 40; + s->buf[123] = s->len >> 32; + s->buf[124] = s->len >> 24; + s->buf[125] = s->len >> 16; + s->buf[126] = s->len >> 8; + s->buf[127] = s->len; + processblock(s, s->buf); +} + +static void sha512_init(struct sha512 *s) +{ + s->len = 0; + s->h[0] = 0x6a09e667f3bcc908ULL; + s->h[1] = 0xbb67ae8584caa73bULL; + s->h[2] = 0x3c6ef372fe94f82bULL; + s->h[3] = 0xa54ff53a5f1d36f1ULL; + s->h[4] = 0x510e527fade682d1ULL; + s->h[5] = 0x9b05688c2b3e6c1fULL; + s->h[6] = 0x1f83d9abfb41bd6bULL; + s->h[7] = 0x5be0cd19137e2179ULL; +} + +static void sha512_sum(struct sha512 *s, uint8 *md) +{ + int i; + + pad(s); + for (i = 0; i < 8; i++) { + md[8*i] = s->h[i] >> 56; + md[8*i+1] = s->h[i] >> 48; + md[8*i+2] = s->h[i] >> 40; + md[8*i+3] = s->h[i] >> 32; + md[8*i+4] = s->h[i] >> 24; + md[8*i+5] = s->h[i] >> 16; + md[8*i+6] = s->h[i] >> 8; + md[8*i+7] = s->h[i]; + } +} + +static void sha512_update(struct sha512 *s, const void *m, unsigned long len) +{ + const uint8 *p = (uint8 *)m; + unsigned r = s->len % 128; + + s->len += len; + if (r) { + if (len < 128 - r) { + memcpy(s->buf + r, p, len); + return; + } + memcpy(s->buf + r, p, 128 - r); + len -= 128 - r; + p += 128 - r; + processblock(s, s->buf); + } + for (; len >= 128; len -= 128, p += 128) + processblock(s, p); + memcpy(s->buf, p, len); +} + +static const unsigned char b64[] = + "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + +static char *to64(char *s, unsigned int u, int n) +{ + while (--n >= 0) { + *s++ = b64[u % 64]; + u /= 64; + } + return s; +} + +/* key limit is not part of the original design, added for DoS protection. + * rounds limit has been lowered (versus the reference/spec), also for DoS + * protection. runtime is O(klen^2 + klen*rounds) */ +#define KEY_MAX 256 +#define SALT_MAX 16 +#define ROUNDS_DEFAULT 5000 +#define ROUNDS_MIN 1000 +#define ROUNDS_MAX 9999999 + +/* hash n bytes of the repeated md message digest */ +static void hashmd(struct sha512 *s, unsigned int n, const void *md) +{ + unsigned int i; + + for (i = n; i > 64; i -= 64) + sha512_update(s, md, 64); + sha512_update(s, md, i); +} + +static char *sha512crypt(const char *key, const char *setting, char *output) +{ + struct sha512 ctx; + unsigned char md[64], kmd[64], smd[64]; + unsigned int i, r, klen, slen; + char rounds[20] = ""; + const char *salt; + char *p; + + /* reject large keys */ + for (i = 0; i <= KEY_MAX && key[i]; i++); + if (i > KEY_MAX) + return 0; + klen = i; + + /* setting: $6$rounds=n$salt$ (rounds=n$ and closing $ are optional) */ + if (strncmp(setting, "$6$", 3) != 0) + return 0; + salt = setting + 3; + + r = ROUNDS_DEFAULT; + if (strncmp(salt, "rounds=", sizeof "rounds=" - 1) == 0) { + unsigned long u; + char *end; + + /* + * this is a deviation from the reference: + * bad rounds setting is rejected if it is + * - empty + * - unterminated (missing '$') + * - begins with anything but a decimal digit + * the reference implementation treats these bad + * rounds as part of the salt or parse them with + * strtoul semantics which may cause problems + * including non-portable hashes that depend on + * the host's value of ULONG_MAX. + */ + salt += sizeof "rounds=" - 1; + if (!isdigit(*salt)) + return 0; + u = strtoul(salt, &end, 10); + if (*end != '$') + return 0; + salt = end+1; + if (u < ROUNDS_MIN) + r = ROUNDS_MIN; + else if (u > ROUNDS_MAX) + r = ROUNDS_MAX; + else + r = u; + /* needed when rounds is zero prefixed or out of bounds */ + sprintf(rounds, "rounds=%u$", r); + } + + for (i = 0; i < SALT_MAX && salt[i] && salt[i] != '$'; i++) + /* reject characters that interfere with /etc/shadow parsing */ + if (salt[i] == '\n' || salt[i] == ':') + return 0; + slen = i; + + /* B = sha(key salt key) */ + sha512_init(&ctx); + sha512_update(&ctx, key, klen); + sha512_update(&ctx, salt, slen); + sha512_update(&ctx, key, klen); + sha512_sum(&ctx, md); + + /* A = sha(key salt repeat-B alternate-B-key) */ + sha512_init(&ctx); + sha512_update(&ctx, key, klen); + sha512_update(&ctx, salt, slen); + hashmd(&ctx, klen, md); + for (i = klen; i > 0; i >>= 1) + if (i & 1) + sha512_update(&ctx, md, sizeof md); + else + sha512_update(&ctx, key, klen); + sha512_sum(&ctx, md); + + /* DP = sha(repeat-key), this step takes O(klen^2) time */ + sha512_init(&ctx); + for (i = 0; i < klen; i++) + sha512_update(&ctx, key, klen); + sha512_sum(&ctx, kmd); + + /* DS = sha(repeat-salt) */ + sha512_init(&ctx); + for (i = 0; i < 16 + md[0]; i++) + sha512_update(&ctx, salt, slen); + sha512_sum(&ctx, smd); + + /* iterate A = f(A,DP,DS), this step takes O(rounds*klen) time */ + for (i = 0; i < r; i++) { + sha512_init(&ctx); + if (i % 2) + hashmd(&ctx, klen, kmd); + else + sha512_update(&ctx, md, sizeof md); + if (i % 3) + sha512_update(&ctx, smd, slen); + if (i % 7) + hashmd(&ctx, klen, kmd); + if (i % 2) + sha512_update(&ctx, md, sizeof md); + else + hashmd(&ctx, klen, kmd); + sha512_sum(&ctx, md); + } + + /* output is $6$rounds=n$salt$hash */ + p = output; + p += sprintf(p, "$6$%s%.*s$", rounds, slen, salt); +#if 1 + static const unsigned char perm[][3] = { + 0,21,42,22,43,1,44,2,23,3,24,45,25,46,4, + 47,5,26,6,27,48,28,49,7,50,8,29,9,30,51, + 31,52,10,53,11,32,12,33,54,34,55,13,56,14,35, + 15,36,57,37,58,16,59,17,38,18,39,60,40,61,19, + 62,20,41 }; + for (i=0; i<21; i++) p = to64(p, + (md[perm[i][0]]<<16)|(md[perm[i][1]]<<8)|md[perm[i][2]], 4); +#else + p = to64(p, (md[0]<<16)|(md[21]<<8)|md[42], 4); + p = to64(p, (md[22]<<16)|(md[43]<<8)|md[1], 4); + p = to64(p, (md[44]<<16)|(md[2]<<8)|md[23], 4); + p = to64(p, (md[3]<<16)|(md[24]<<8)|md[45], 4); + p = to64(p, (md[25]<<16)|(md[46]<<8)|md[4], 4); + p = to64(p, (md[47]<<16)|(md[5]<<8)|md[26], 4); + p = to64(p, (md[6]<<16)|(md[27]<<8)|md[48], 4); + p = to64(p, (md[28]<<16)|(md[49]<<8)|md[7], 4); + p = to64(p, (md[50]<<16)|(md[8]<<8)|md[29], 4); + p = to64(p, (md[9]<<16)|(md[30]<<8)|md[51], 4); + p = to64(p, (md[31]<<16)|(md[52]<<8)|md[10], 4); + p = to64(p, (md[53]<<16)|(md[11]<<8)|md[32], 4); + p = to64(p, (md[12]<<16)|(md[33]<<8)|md[54], 4); + p = to64(p, (md[34]<<16)|(md[55]<<8)|md[13], 4); + p = to64(p, (md[56]<<16)|(md[14]<<8)|md[35], 4); + p = to64(p, (md[15]<<16)|(md[36]<<8)|md[57], 4); + p = to64(p, (md[37]<<16)|(md[58]<<8)|md[16], 4); + p = to64(p, (md[59]<<16)|(md[17]<<8)|md[38], 4); + p = to64(p, (md[18]<<16)|(md[39]<<8)|md[60], 4); + p = to64(p, (md[40]<<16)|(md[61]<<8)|md[19], 4); + p = to64(p, (md[62]<<16)|(md[20]<<8)|md[41], 4); +#endif + p = to64(p, md[63], 2); + *p = 0; + return output; +} + +char *__crypt_sha512(const char *key, const char *setting, char *output) +{ + static const char testkey[] = "Xy01@#\x01\x02\x80\x7f\xff\r\n\x81\t !"; + static const char testsetting[] = "$6$rounds=1234$abc0123456789$"; + static const char testhash[] = "$6$rounds=1234$abc0123456789$BCpt8zLrc/RcyuXmCDOE1ALqMXB2MH6n1g891HhFj8.w7LxGv.FTkqq6Vxc/km3Y0jE0j24jY5PIv/oOu6reg1"; + char testbuf[128]; + char *p, *q; + + p = sha512crypt(key, setting, output); + + /* self test and stack cleanup */ + q = sha512crypt(testkey, testsetting, testbuf); + if (!p || q != testbuf || memcmp(testbuf, testhash, sizeof(testhash))) + return "*"; + + return p; +} diff --git a/code/ryzom/common/src/game_share/deployment_configuration.cpp b/code/ryzom/common/src/game_share/deployment_configuration.cpp index 52fc9087c..8957c89ac 100644 --- a/code/ryzom/common/src/game_share/deployment_configuration.cpp +++ b/code/ryzom/common/src/game_share/deployment_configuration.cpp @@ -313,13 +313,13 @@ namespace DEPCFG void CInfoBlock::addUseEntry(const NLMISC::CSString& entry,const NLMISC::CSString& context,uint32& errors) { - DROP_IF(_UseEntries.find(entry)!=_UseEntries.end(),context+"Ignoring duplicate refference to 'use' clause: "+entry,return); + DROP_IF(_UseEntries.find(entry) != _UseEntries.end(), context + "Ignoring duplicate refference to 'use' clause: " + entry.c_str(), return); _UseEntries.insert(entry); } void CInfoBlock::addDataEntry(const NLMISC::CSString& entry,const NLMISC::CSString& context,uint32& errors) { - DROP_IF(_DataEntries.find(entry)!=_DataEntries.end(),context+"Ignoring duplicate refference to 'data' clause: "+entry,return); + DROP_IF(_DataEntries.find(entry) != _DataEntries.end(), context + "Ignoring duplicate refference to 'data' clause: " + entry.c_str(), return); _DataEntries.insert(entry); } @@ -406,10 +406,10 @@ namespace DEPCFG // try to get a pointer to the refferenced info block... CInfoBlock* infoBlockPtr= container->getInfoBlock(theEntry); - DROP_IF(infoBlockPtr==NULL,"Failed to find block named '"+theEntry+"' while fixing up children of block: "+_Name, ++errors;continue); + DROP_IF(infoBlockPtr == NULL, "Failed to find block named '" + theEntry + "' while fixing up children of block: " + _Name.c_str(), ++errors; continue); // make sure that this block doesn't figure amongst the children of the refferenced info block (to avoid circular refs) - DROP_IF(_haveCircularRef(infoBlockPtr),"Circular dependency found between definitions of '"+_Name+"' and '"+theEntry+"'", ++errors;continue); + DROP_IF(_haveCircularRef(infoBlockPtr), "Circular dependency found between definitions of '" + _Name + "' and '" + theEntry.c_str() + "'", ++errors; continue); // add the info block to our children _Children.push_back(infoBlockPtr); @@ -431,7 +431,7 @@ namespace DEPCFG DROP_IF(!_ShardName.empty() && !theExe.ShardName.empty(), "more than one shard found in: "+theExe.FullName, ++errors ); DROP_IF(!_CmdLine.empty() && !theExe.CmdLine.empty(), "more than one cmdLine found in: "+theExe.FullName, ++errors ); DROP_IF(!_Host.empty() && !theExe.Host.empty(), "more than one host found in: "+theExe.FullName, ++errors ); - WARN_IF(!_UniqueName.empty() && !theExe.UniqueName.empty(), "replacing name '"+theExe.UniqueName+"' with '"+_UniqueName+"' in: "+theExe.FullName); + WARN_IF(!_UniqueName.empty() && !theExe.UniqueName.empty(), "replacing name '" + theExe.UniqueName + "' with '" + _UniqueName.c_str() + "' in: " + theExe.FullName.c_str()); // fill our own data into the exe record if (!_DomainName.empty()) theExe.DomainName = _DomainName; @@ -645,22 +645,22 @@ namespace DEPCFG // try to treat the keyword if (keyword=="include") { - DROP_IF(args.empty(),context+"No file name found following 'include': "+line, ++errors;continue); - DROP_IF(fileNameSet.find(args)!=fileNameSet.end(),context+"Warning: Duplicate 'include' block ignored: "+line, continue); + DROP_IF(args.empty(), context + "No file name found following 'include': " + line.c_str(), ++errors; continue); + DROP_IF(fileNameSet.find(args) != fileNameSet.end(), context + "Warning: Duplicate 'include' block ignored: " + line.c_str(), continue); fileNameSet.insert(args); _readFile(args.unquoteIfQuoted(),errors,fileNameSet); } else if (keyword=="define") { - DROP_IF(args.empty(),context+"No block name found following 'define': "+line, ++errors;continue); - DROP_IF(_InfoBlocks.find(args)!=_InfoBlocks.end(),context+"Duplicate 'define' block found: "+line, ++errors;continue); + DROP_IF(args.empty(), context + "No block name found following 'define': " + line.c_str(), ++errors; continue); + DROP_IF(_InfoBlocks.find(args) != _InfoBlocks.end(), context + "Duplicate 'define' block found: " + line.c_str(), ++errors; continue); // create a new info block and push it into our infoblock set _CurrentInfoBlock= new CInfoBlock(args); _InfoBlocks[args]= _CurrentInfoBlock; } else { - DROP_IF(_CurrentInfoBlock==NULL,context+"Expecting 'define ' but found: "+line, ++errors;continue); + DROP_IF(_CurrentInfoBlock == NULL, context + "Expecting 'define ' but found: " + line.c_str(), ++errors; continue); if (keyword=="domain") { _CurrentInfoBlock->setDomainName(args,context,errors); } else if (keyword=="shard") { _CurrentInfoBlock->setShardName(args,context,errors); } @@ -674,7 +674,7 @@ namespace DEPCFG else if (keyword=="cfgAfter") { _CurrentInfoBlock->addCfgEntryPost(rawArgs,context,errors); } else if (keyword=="cfgFile") { _CurrentInfoBlock->addCfgFile(args,context,errors); } else if (keyword=="cfgFileAfter") { _CurrentInfoBlock->addCfgFilePost(args,context,errors); } - else { DROP(context+"Unrecognised keyword: "+line, ++errors;continue); } + else { DROP(context + "Unrecognised keyword: " + line.c_str(), ++errors; continue); } } } } @@ -725,7 +725,7 @@ namespace DEPCFG // yell if the name already looks like a 'fixed up' name DROP_IF(name.right(3).left(1)=="_" && (name.right(2)=="00" || name.right(2).atoui()!=0),"Appending '_' to name ending in '_00' style format as this can clash with auto renumbering => "+name+'_',name+='_') // compose a second version of the name with the shard name added - NLMISC::CSString name_with_shard= name+'_'+it2->ShardName; + NLMISC::CSString name_with_shard = name + '_' + it2->ShardName.c_str(); // insert both versions of the name into the unique name counter ++nameCounts[name]; ++nameCounts[name_with_shard]; @@ -1123,7 +1123,7 @@ namespace DEPCFG result.CfgFile= "// Auto generated config file\n" "// Use with commandline: "+theApp.CmdLine+"\n" - "AESAliasName= \""+appName+"\";\n" + "AESAliasName= \"" + appName.c_str() + "\";\n" "\n"; // copy the cfg set to the result record (the cfgAfter set should have been merged in already) diff --git a/code/ryzom/common/src/game_share/entity_types.h b/code/ryzom/common/src/game_share/entity_types.h index 6298ff64f..aad2d94e9 100644 --- a/code/ryzom/common/src/game_share/entity_types.h +++ b/code/ryzom/common/src/game_share/entity_types.h @@ -81,7 +81,8 @@ const uint32 NB_FAKE_DISC_PROPERTIES_UPDATED_PER_CYCLE=2; typedef uint16 TProperty; typedef uint8 TPropIndex; -const uint32 NB_PROPERTIES = 256; //number of TProperty elements (if you change this, change the ids of special properties in the Front-end Service!) +// KAE: Commented because not used +//const uint32 NB_PROPERTIES = 256; //number of TProperty elements (if you change this, change the ids of special properties in the Front-end Service!) /// Main type for positions/distances. Unit: millimeter diff --git a/code/ryzom/common/src/game_share/fame.cpp b/code/ryzom/common/src/game_share/fame.cpp index b453bca4e..ca226ecdc 100644 --- a/code/ryzom/common/src/game_share/fame.cpp +++ b/code/ryzom/common/src/game_share/fame.cpp @@ -479,10 +479,9 @@ void CStaticFames::loadStaticFame( const string& filename ) else NLMISC::fromString(s.substr(sep+1, s.size()-sep-1), factor); // Fames in file are in [-600;600] so don't forget 1000 factor - sint32 fame; float fameFloat; NLMISC::fromString(s.substr(0, sep), fameFloat); - fame = (sint32)(fameFloat * 1000.f); + sint32 fame = (sint32)(fameFloat * 1000.f); _FameTable[iFaction*_FameTableSize + jFaction] = fame; _PropagationFactorTable[iFaction*_FameTableSize + jFaction] = factor; diff --git a/code/ryzom/common/src/game_share/generate_module_interface.xslt b/code/ryzom/common/src/game_share/generate_module_interface.xslt index 425e699a4..ee87f6ae4 100644 --- a/code/ryzom/common/src/game_share/generate_module_interface.xslt +++ b/code/ryzom/common/src/game_share/generate_module_interface.xslt @@ -28,9 +28,7 @@ #ifndef #define #include "nel/misc/types_nl.h" -#ifdef NL_COMP_VC8 - #include <memory> -#endif +#include <memory> #include "nel/misc/hierarchical_timer.h" #include "nel/misc/string_conversion.h" #include "nel/net/message.h" @@ -45,7 +43,7 @@ #include "nel/misc/string_common.h" -#include "game_share/mysql_wrapper.h" +#include "server_share/mysql_wrapper.h" #include "game_share/synchronised_message.h" diff --git a/code/ryzom/common/src/game_share/mirror.cpp b/code/ryzom/common/src/game_share/mirror.cpp index ff0ed0b2c..0e634afaf 100644 --- a/code/ryzom/common/src/game_share/mirror.cpp +++ b/code/ryzom/common/src/game_share/mirror.cpp @@ -2871,7 +2871,7 @@ NLMISC_CATEGORISED_DYNVARIABLE(mirror, sint32, MainNbEntities, "Number of online // We can only read the value if ( get ) { - if ( MirrorInstance->mirrorIsReady() ) + if ( MirrorInstance && MirrorInstance->mirrorIsReady() ) { try { @@ -2892,7 +2892,7 @@ NLMISC_CATEGORISED_DYNVARIABLE(mirror, sint32, LocalEntities, "Number of online // We can only read the value if ( get ) { - if ( MirrorInstance->mirrorIsReady() ) + if ( MirrorInstance && MirrorInstance->mirrorIsReady() ) { try { diff --git a/code/ryzom/common/src/game_share/mirror_prop_value.h b/code/ryzom/common/src/game_share/mirror_prop_value.h index 1deb06f03..cbc251be2 100644 --- a/code/ryzom/common/src/game_share/mirror_prop_value.h +++ b/code/ryzom/common/src/game_share/mirror_prop_value.h @@ -1150,7 +1150,7 @@ public: typedef _CMirrorPropValueListIterator iterator; typedef _CCMirrorPropValueListIterator const_iterator; -#ifdef NL_OS_WINDOWS +#ifdef NL_COMP_VC friend iterator; // MSVC friend const_iterator; #else @@ -1192,7 +1192,7 @@ public: // If changing this struct, don't forget to change the places where it is initialized TSharedListRow Next; T Value; -#ifdef NL_OS_WINDOWS +#ifdef NL_COMP_VC }; #else } __attribute__((packed)); @@ -1237,7 +1237,7 @@ public: typedef _CMirrorPropValueListIterator iterator; typedef _CCMirrorPropValueListIterator const_iterator; -#ifdef NL_OS_WINDOWS +#ifdef NL_COMP_VC friend iterator; // MSVC friend const_iterator; #else @@ -1280,7 +1280,7 @@ public: // If changing this struct, don't forget to change the places where it is initialized TSharedListRow Next; uint64 Value; -#ifdef NL_OS_WINDOWS +#ifdef NL_COMP_VC }; #else } __attribute__((packed)); diff --git a/code/ryzom/common/src/game_share/people_pd.h b/code/ryzom/common/src/game_share/people_pd.h index 379a09378..ffcf8732f 100644 --- a/code/ryzom/common/src/game_share/people_pd.h +++ b/code/ryzom/common/src/game_share/people_pd.h @@ -51,6 +51,7 @@ public: enum TPeople { + Undefined = -1, Humanoid = 0, Playable = 0, Fyros = 0, diff --git a/code/ryzom/common/src/game_share/persistent_data_inline.h b/code/ryzom/common/src/game_share/persistent_data_inline.h index 72ef3fc9d..a2d575eef 100644 --- a/code/ryzom/common/src/game_share/persistent_data_inline.h +++ b/code/ryzom/common/src/game_share/persistent_data_inline.h @@ -706,7 +706,12 @@ inline float CPersistentDataRecord::CArg::asFloat() const case UINT64: return (float)(uint64)_Value.i64; case FLOAT32: return (float)_Value.f32; case FLOAT64: return (float)_Value.f64; - case STRING: return (float)atof(_String.c_str()); + case STRING: + { + float val; + NLMISC::fromString(_String, val); + return val; + } case FLAG: return 1.0f; case EXTEND_TYPE: switch(_Value.ExType) @@ -733,7 +738,12 @@ inline double CPersistentDataRecord::CArg::asDouble() const case UINT64: return (double)(uint64)_Value.i64; case FLOAT32: return (double)_Value.f32; case FLOAT64: return (double)_Value.f64; - case STRING: return (double)atof(_String.c_str()); + case STRING: + { + double val; + NLMISC::fromString(_String, val); + return val; + } case FLAG: return 1.0; case EXTEND_TYPE: switch(_Value.ExType) diff --git a/code/ryzom/common/src/game_share/persistent_data_tree.cpp b/code/ryzom/common/src/game_share/persistent_data_tree.cpp index 63252a70c..feefbad1c 100644 --- a/code/ryzom/common/src/game_share/persistent_data_tree.cpp +++ b/code/ryzom/common/src/game_share/persistent_data_tree.cpp @@ -139,10 +139,10 @@ bool CPersistentDataTreeNode::attachToParent(CPersistentDataTreeNode* parent) bool CPersistentDataTreeNode::attachToParent(CPersistentDataTreeNode* parent,uint32 idx) { // check value of 'idx' - BOMB_IF(parent!=NULL && idx>1024*1024,"Implausibly high number of children requested ("+NLMISC::toString("%d",idx)+") for persistent data tree node: "+parent->getNodeName(),return false); + BOMB_IF(parent != NULL && idx>1024 * 1024, "Implausibly high number of children requested (" + NLMISC::toString("%d", idx) + ") for persistent data tree node: " + parent->getNodeName().c_str(), return false); // check for attachment to previous parent - BOMB_IF(_Parent!=NULL,"Attempting to attach a persistent data node to parent '"+(parent==NULL?"NULL":parent->getNodeName())+"' when it's already attached to another parent as: "+getNodeName(),return false); + BOMB_IF(_Parent != NULL, "Attempting to attach a persistent data node to parent '" + (parent == NULL ? "NULL" : parent->getNodeName()) + "' when it's already attached to another parent as: " + getNodeName().c_str(), return false); // split the name into its component parts CSString mapIndex= _Name; @@ -159,7 +159,7 @@ bool CPersistentDataTreeNode::attachToParent(CPersistentDataTreeNode* parent,uin if (parent!=NULL) { // check parent isn't a value - BOMB_IF(parent->_IsValue,"Attempting to attach a persistent data node to parent that has a value '"+parent->getNodeName()+"' = "+parent->_Value,return false); + BOMB_IF(parent->_IsValue, "Attempting to attach a persistent data node to parent that has a value '" + parent->getNodeName() + "' = " + parent->_Value.c_str(), return false); if (hasExplicitIndex) { @@ -179,7 +179,7 @@ bool CPersistentDataTreeNode::attachToParent(CPersistentDataTreeNode* parent,uin } // ensure that there isn't already a node with the same '#' value attached to the same parent - DROP_IF(parent->_ChildIndex.find(nameBase+'#'+mapIndex)!=parent->_ChildIndex.end(),"Failed to add child '"+_Name+"' to parent '"+parent->getNodeName()+"' because another child of same name already exists",return false); + DROP_IF(parent->_ChildIndex.find(nameBase + '#' + mapIndex.c_str()) != parent->_ChildIndex.end(), "Failed to add child '" + _Name + "' to parent '" + parent->getNodeName().c_str() + "' because another child of same name already exists", return false); } } if (!hasExplicitIndex) @@ -190,7 +190,7 @@ bool CPersistentDataTreeNode::attachToParent(CPersistentDataTreeNode* parent,uin } // construct our cleaned up name from its constituent parts - _Name= nameBase+'#'+mapIndex; + _Name = nameBase + '#' + mapIndex.c_str(); // setup own _Parent property and ensure that there are no trailing spaces round the _Name _Parent= parent; @@ -205,7 +205,7 @@ bool CPersistentDataTreeNode::attachToParent(CPersistentDataTreeNode* parent,uin } // ensure that there isn't another child already assigned to this parent slot - BOMB_IF(_Parent->_Children[idx]!=NULL,"Ignoring attempt to add second child to same slot ("+NLMISC::toString("%d",idx)+") in persistent data tree node's children: "+_Parent->getNodeName(),return false); + BOMB_IF(_Parent->_Children[idx] != NULL, "Ignoring attempt to add second child to same slot (" + NLMISC::toString("%d", idx) + ") in persistent data tree node's children: " + _Parent->getNodeName().c_str(), return false); // write own pointer into parent's _Children vector _Parent->_Children[idx]= this; @@ -239,7 +239,7 @@ bool CPersistentDataTreeNode::readFromPdr(CPersistentDataRecord& pdr) return false; // pop the end of block token for the block we just finished processing - DROP_IF(pdr.peekNextToken()!=token,"ERROR: End of "+pdr.lookupString(token)+" block expected but not found at: "+getNodeName(),return false); + DROP_IF(pdr.peekNextToken() != token, "ERROR: End of " + pdr.lookupString(token) + " block expected but not found at: " + getNodeName().c_str(), return false); pdr.popStructEnd(token); } else if (pdr.isEndOfStruct()) @@ -259,7 +259,7 @@ bool CPersistentDataTreeNode::readFromPdr(CPersistentDataRecord& pdr) // extract the map key and ensure that it's followed by a valid __Val__ entry CSString mapKey; pdr.pop(mapKeyToken,mapKey); - DROP_IF(pdr.isEndOfData() || pdr.peekNextToken()!=mapValToken,"ERROR: Ignoring map key (__Key__) because __Val__ token expected but not found at: "+getNodeName()+":"+mapKey,continue); + DROP_IF(pdr.isEndOfData() || pdr.peekNextToken() != mapValToken, "ERROR: Ignoring map key (__Key__) because __Val__ token expected but not found at: " + getNodeName() + ":" + mapKey.c_str(), continue); if (needsQuotes(mapKey)) mapKey=mapKey.quote(); @@ -278,7 +278,7 @@ bool CPersistentDataTreeNode::readFromPdr(CPersistentDataRecord& pdr) return false; // pop the end of struct marker - DROP_IF(pdr.peekNextToken()!=mapValToken,"ERROR: End of __Val__ block expected but not found at: "+getNodeName()+":"+mapKey,return false); + DROP_IF(pdr.peekNextToken() != mapValToken, "ERROR: End of __Val__ block expected but not found at: " + getNodeName() + ":" + mapKey.c_str(), return false); pdr.popStructEnd(mapValToken); } else @@ -419,9 +419,9 @@ bool CPersistentDataTreeNode::writeToBuffer(NLMISC::CSString& buffer) const { // write a value if (needsQuotes(_Value)) - buffer+= getNodeName()+"=="+_Value.quote()+"\n"; + buffer += getNodeName() + "==" + _Value.quote().c_str() + "\n"; else - buffer+= getNodeName()+"="+_Value+"\n"; + buffer += getNodeName() + "=" + _Value.c_str() + "\n"; } else { @@ -468,8 +468,8 @@ CSString CPersistentDataTreeNode::getNodeName() const // return one of name, parentName.name and parentName:name if (parentName.empty()) return name; - if (isMapEntry()) return parentName+":"+name; - else return parentName+"."+name; + if (isMapEntry()) return parentName + ":" + name.c_str(); + else return parentName + "." + name.c_str(); } void CPersistentDataTreeNode::setValue(const TValue& value) @@ -507,7 +507,7 @@ bool CPersistentDataTreeNode::isMapEntry() const bool CPersistentDataTreeNode::flagAsMap() { - DROP_IF(_IsValue,"ERROR: Failed to flag persistent data tree node '"+getNodeName()+"' as a map as it already has a value: "+_Value,return false); + DROP_IF(_IsValue, "ERROR: Failed to flag persistent data tree node '" + getNodeName() + "' as a map as it already has a value: " + _Value.c_str(), return false); if (_IsMap) return true; diff --git a/code/ryzom/common/src/game_share/ryzom_entity_id.h b/code/ryzom/common/src/game_share/ryzom_entity_id.h index 9fc2682ef..0cb2981ab 100644 --- a/code/ryzom/common/src/game_share/ryzom_entity_id.h +++ b/code/ryzom/common/src/game_share/ryzom_entity_id.h @@ -30,12 +30,17 @@ namespace RYZOMID { // warning: respect separation with creature /object, it's used in front-end vision prioritizer // creature part (include player) - player = 0, - npc, //1 - creature, //2 - mount, //3 - pack_animal, //4 - flora, //5 + creature_begin = 0, + player = creature_begin, + bot_ai_begin, + npc = bot_ai_begin, //1 + creature, //2 + mount, //3 + pack_animal, //4 + flora, //5 + bot_ai_end = flora, + creature_end = bot_ai_end, + // objects part object, // 6 building, // 7 diff --git a/code/ryzom/common/src/game_share/ryzom_mirror_properties.h b/code/ryzom/common/src/game_share/ryzom_mirror_properties.h index 55d8b9bbb..134ebe38b 100644 --- a/code/ryzom/common/src/game_share/ryzom_mirror_properties.h +++ b/code/ryzom/common/src/game_share/ryzom_mirror_properties.h @@ -138,7 +138,7 @@ void initRyzomVisualPropertyIndices( CMirroredDataSet& dataset ); #define TYPE_BOT_TRADE_SELECTOR2 uint64 #define TYPE_EVENT_FACTION_ID uint32 -#define TYPE_PVP_MODE uint32 +#define TYPE_PVP_MODE uint16 #define TYPE_PVP_CLAN uint32 #define TYPE_FUEL bool diff --git a/code/ryzom/common/src/game_share/ryzom_version.h b/code/ryzom/common/src/game_share/ryzom_version.h index 2dfdca48e..9476ac849 100644 --- a/code/ryzom/common/src/game_share/ryzom_version.h +++ b/code/ryzom/common/src/game_share/ryzom_version.h @@ -17,7 +17,10 @@ #ifndef RYZOM_VERSION_H #define RYZOM_VERSION_H -#define RYZOM_VERSION "RYZOM CORE" +#define RYZOM_VERSION "ryzomcore" \ + "/" \ + "v0.11.2" \ + "-dev" #endif // RYZOM_VERSION_H 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 f68b1d6f8..7c01af145 100644 --- a/code/ryzom/common/src/game_share/scenario_entry_points.cpp +++ b/code/ryzom/common/src/game_share/scenario_entry_points.cpp @@ -56,23 +56,8 @@ CScenarioEntryPoints::CScenarioEntryPoints() void CScenarioEntryPoints::init() { - CConfigFile cf; - - cf.load("IslandScreenshots.cfg", true); - - // get the scenario entry points file - CConfigFile::CVar * ciFile = cf.getVarPtr("CompleteIslandsFile"); - if(ciFile) - { - _CompleteIslandsFilename = ciFile->asString(); - } - - // get the scenario entry points file - CConfigFile::CVar * epFile = cf.getVarPtr("EntryPointsFile"); - if(epFile) - { - _EntryPointsFilename = epFile->asString(); - } + _CompleteIslandsFilename = "r2_islands.xml"; + _EntryPointsFilename = "r2_entry_points.txt"; } //----------------------------------------------------------------------------- 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 51d7ce19e..3d3548d54 100644 --- a/code/ryzom/common/src/game_share/server_animation_module.cpp +++ b/code/ryzom/common/src/game_share/server_animation_module.cpp @@ -1017,7 +1017,7 @@ IPrimitive* CServerAnimationModule::getAction(CObject* action, const std::string } if(result.size()>=2) - result[1] = "DSS_"+toString(scenarioId)+" "+result[1]; + result[1] = "DSS_"+toString(scenarioId)+" "+result[1].c_str(); if(result.size()>=3) { for(uint32 i=2;i #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include # include #endif 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 f88263c27..b891b6252 100644 --- a/code/ryzom/server/data_shard/mirror_sheets/fe_temp.dataset +++ b/code/ryzom/server/data_shard/mirror_sheets/fe_temp.dataset @@ -292,14 +292,14 @@ - + - + diff --git a/code/ryzom/server/data_shard/mirror_sheets/pet.dataset b/code/ryzom/server/data_shard/mirror_sheets/pet.dataset deleted file mode 100644 index 238a38dbd..000000000 --- a/code/ryzom/server/data_shard/mirror_sheets/pet.dataset +++ /dev/null @@ -1,47 +0,0 @@ - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/code/ryzom/server/patchman_cfg/admin_install/bin/admin b/code/ryzom/server/patchman_cfg/admin_install/bin/admin index c7cfa2fb6..f48de0d15 100644 --- a/code/ryzom/server/patchman_cfg/admin_install/bin/admin +++ b/code/ryzom/server/patchman_cfg/admin_install/bin/admin @@ -99,14 +99,14 @@ then for f in $DOMAIN_LIST do # see if we're setup to run this domain - if [ -e /srv/core/${f}.screen.rc ] && [ -e /srv/core/bin/${f} ] + if [ -e /srv/core/${f}.screen.rc ] && [ -e /srv/core/bin/domain_${f} ] then # see whether the domain is alredy running - if [ $( screen -list | grep \( | cut -f2 | cut -d. -f2| grep \^$f\$ | wc -l) == 0 ] + if [ $( screen -list | grep \\\.${f} | wc -w ) = 0 ] then # the domain isn't running yet so start it echo '****' starting domain: $f '****' - /srv/core/bin/$f batchstart + /srv/core/bin/domain_$f batchstart else echo '****' Domain is already running: $f '****' fi diff --git a/code/ryzom/server/patchman_cfg/admin_install/bin/run_forever b/code/ryzom/server/patchman_cfg/admin_install/bin/run_forever index c6f14b074..91a838a02 100644 --- a/code/ryzom/server/patchman_cfg/admin_install/bin/run_forever +++ b/code/ryzom/server/patchman_cfg/admin_install/bin/run_forever @@ -3,7 +3,7 @@ while true do -if [ "$2" == "" ] +if [ "$2" = "" ] then echo echo USAGE: $0 sleep_time command_line diff --git a/code/ryzom/server/patchman_cfg/admin_install/bin/startup b/code/ryzom/server/patchman_cfg/admin_install/bin/startup index 16bf59fd3..a63c6a3f7 100644 --- a/code/ryzom/server/patchman_cfg/admin_install/bin/startup +++ b/code/ryzom/server/patchman_cfg/admin_install/bin/startup @@ -4,8 +4,8 @@ cd /srv/core rm */*.state */*/*.launch_ctrl */*/*.state /bin/bash /srv/core/bin/admin start -# special case for the "ep1.std01.ryzomcore.org" machine - start the admin tool graph sync script -if [ $(hostname) = "ep1.std01.ryzomcore.org" ] +# special case for the "ep1.std01.ryzomcore.local" machine - start the admin tool graph sync script +if [ $(hostname) = "ep1.std01.ryzomcore.local" ] then nohup /bin/sh /srv/core/bin/sync_rrd_graphs.sh & fi diff --git a/code/ryzom/server/patchman_cfg/admin_install/bin/sync_rrd_graphs.sh b/code/ryzom/server/patchman_cfg/admin_install/bin/sync_rrd_graphs.sh index b23fc285b..cc78fbaf1 100644 --- a/code/ryzom/server/patchman_cfg/admin_install/bin/sync_rrd_graphs.sh +++ b/code/ryzom/server/patchman_cfg/admin_install/bin/sync_rrd_graphs.sh @@ -4,7 +4,7 @@ echo Launched: $(date) while true do # retrieve ATS files from ATS admin tool machine - rsync -t ep1.std01.ryzomcore.org:ats/graph_datas/* /srv/core/mini01/rrd_graphs/ + rsync -t ep1.std01.ryzomcore.local:ats/graph_datas/* /srv/core/mini01/rrd_graphs/ # deal with live files - duplicate files that correspond to unique services to aid with graphing of su & co cd /srv/core/std01/rrd_graphs/ diff --git a/code/ryzom/server/patchman_cfg/admin_install/patchman/admin_executor_service_default.mini01.cfg b/code/ryzom/server/patchman_cfg/admin_install/patchman/admin_executor_service_default.mini01.cfg index bc7be84e9..0e8af6ed9 100644 --- a/code/ryzom/server/patchman_cfg/admin_install/patchman/admin_executor_service_default.mini01.cfg +++ b/code/ryzom/server/patchman_cfg/admin_install/patchman/admin_executor_service_default.mini01.cfg @@ -10,7 +10,7 @@ AESAliasName= "aes"; DontUseStdIn = 0; // Adress ofthe admin service (default port is 49996) -ASHost = "ep1.mini01.ryzomcore.org"; +ASHost = "ep1.mini01.ryzomcore.local"; // Config for AES AESPort = "46712"; diff --git a/code/ryzom/server/patchman_cfg/admin_install/patchman/admin_executor_service_default.std01.cfg b/code/ryzom/server/patchman_cfg/admin_install/patchman/admin_executor_service_default.std01.cfg index 7bfb80b27..7a4176b93 100644 --- a/code/ryzom/server/patchman_cfg/admin_install/patchman/admin_executor_service_default.std01.cfg +++ b/code/ryzom/server/patchman_cfg/admin_install/patchman/admin_executor_service_default.std01.cfg @@ -10,7 +10,7 @@ AESAliasName= "aes"; DontUseStdIn = 0; // Adress ofthe admin service (default port is 49996) -ASHost = "ep1.std01.ryzomcore.org"; +ASHost = "ep1.std01.ryzomcore.local"; // Config for AES AESPort = "46702"; diff --git a/code/ryzom/server/patchman_cfg/admin_install/patchman/loop_patchman.sh b/code/ryzom/server/patchman_cfg/admin_install/patchman/loop_patchman.sh index 73b151c43..af057f2ae 100644 --- a/code/ryzom/server/patchman_cfg/admin_install/patchman/loop_patchman.sh +++ b/code/ryzom/server/patchman_cfg/admin_install/patchman/loop_patchman.sh @@ -10,6 +10,7 @@ do chmod 775 bin/ps_services 2> /dev/null chmod 775 bin/run_forever 2> /dev/null chmod 775 bin/shard 2> /dev/null + chmod 775 bin/domain_* 2> /dev/null chmod 775 bin/startup 2> /dev/null chmod 775 bin/*.sh 2> /dev/null chmod 775 patchman/*_service 2> /dev/null diff --git a/code/ryzom/server/patchman_cfg/admin_install/patchman/loop_patchman_once.sh b/code/ryzom/server/patchman_cfg/admin_install/patchman/loop_patchman_once.sh index 0dd697aa4..f7152cada 100644 --- a/code/ryzom/server/patchman_cfg/admin_install/patchman/loop_patchman_once.sh +++ b/code/ryzom/server/patchman_cfg/admin_install/patchman/loop_patchman_once.sh @@ -3,8 +3,8 @@ CFGFILENAME=patchman_service.${SERVER_TYPE}.cfg echo cfg file: $CFGFILENAME -AESCFGFILENAME=admin_executor_service_default.${SERVER_TYPE}.cfg -echo aes cfg file: $AESCFGFILENAME +#AESCFGFILENAME=admin_executor_service_default.${SERVER_TYPE}.cfg +#echo aes cfg file: $AESCFGFILENAME cd /srv/core/patchman if [ -e $CFGFILENAME ] @@ -15,8 +15,8 @@ if [ -e $CFGFILENAME ] cp $CFGFILENAME patchman_service.cfg # setup the config file for the admin executor service - echo Using aes configuration file: $AESCFGFILENAME - if [ -e $AESCFGFILENAME ] ; then cp $AESCFGFILENAME admin_executor_service_default.cfg ; fi + #echo Using aes configuration file: $AESCFGFILENAME + #if [ -e $AESCFGFILENAME ] ; then cp $AESCFGFILENAME admin_executor_service_default.cfg ; fi # start the patchman service echo Launching patchman... diff --git a/code/ryzom/server/patchman_cfg/admin_install/patchman/loop_special_patchman.sh b/code/ryzom/server/patchman_cfg/admin_install/patchman/loop_special_patchman.sh index af1f5b599..6aa9f2ddf 100644 --- a/code/ryzom/server/patchman_cfg/admin_install/patchman/loop_special_patchman.sh +++ b/code/ryzom/server/patchman_cfg/admin_install/patchman/loop_special_patchman.sh @@ -1,6 +1,6 @@ #!/bin/sh -if [ "$1" == "" ] +if [ "$1" = "" ] then echo echo USAGE: $0 command_line diff --git a/code/ryzom/server/patchman_cfg/admin_install/patchman/make_next_live.sh b/code/ryzom/server/patchman_cfg/admin_install/patchman/make_next_live.sh index fbaca4ac4..394fc971d 100644 --- a/code/ryzom/server/patchman_cfg/admin_install/patchman/make_next_live.sh +++ b/code/ryzom/server/patchman_cfg/admin_install/patchman/make_next_live.sh @@ -84,7 +84,7 @@ rm -v */*.*launch_ctrl *.*launch_ctrl 2> /dev/null # initialise the state files for the new services to "xxxxx" and remove directories that are no longer of interest for D in $(ls */log.log | sed "s%/.*%%" | sort -u) do - if [ $(grep \"$D\" admin_executor_service.cfg | wc -l) == 1 ] + if [ $(grep \"$D\" admin_executor_service.cfg | wc -l) = 1 ] then printf "xxxxx" > $D/$D.state else @@ -97,7 +97,7 @@ done printf "1" > ./global.launch_ctrl # create a script for accessing the screen for this shard -SCRIPT_FILE=/srv/core/bin/${DOMAIN} +SCRIPT_FILE=/srv/core/bin/domain_${DOMAIN} echo "#!/bin/sh" > $SCRIPT_FILE echo "cd "$(pwd) >> $SCRIPT_FILE echo '/bin/sh /srv/core/bin/ryzom_domain_screen_wrapper.sh $*' >> $SCRIPT_FILE diff --git a/code/ryzom/server/patchman_cfg/admin_install/patchman/patchman_list b/code/ryzom/server/patchman_cfg/admin_install/patchman/patchman_list index e90230704..9a9341e9a 100644 --- a/code/ryzom/server/patchman_cfg/admin_install/patchman/patchman_list +++ b/code/ryzom/server/patchman_cfg/admin_install/patchman/patchman_list @@ -1,23 +1,23 @@ // default values for different sites -mini01 ep1.mini01.ryzomcore.org -std01 ep1.std01.ryzomcore.org -std01 su1.std01.ryzomcore.org -std01 pd1.std01.ryzomcore.org -std01 pd2.std01.ryzomcore.org -std01 pd3.std01.ryzomcore.org -std01 pd4.std01.ryzomcore.org -std01 mla1.std01.ryzomcore.org -std01 mla2.std01.ryzomcore.org -std01 mla3.std01.ryzomcore.org -std01 mla4.std01.ryzomcore.org -std01 mla5.std01.ryzomcore.org -std01 mlb1.std01.ryzomcore.org -std01 mlb2.std01.ryzomcore.org -std01 mlb3.std01.ryzomcore.org -std01 mlb4.std01.ryzomcore.org -std01 mlb5.std01.ryzomcore.org -std01 rra1.std01.ryzomcore.org -std01 rra2.std01.ryzomcore.org -std01 rrb1.std01.ryzomcore.org -std01 rrb2.std01.ryzomcore.org +mini01 ep1.mini01.ryzomcore.local +std01 ep1.std01.ryzomcore.local +std01 su1.std01.ryzomcore.local +std01 pd1.std01.ryzomcore.local +std01 pd2.std01.ryzomcore.local +std01 pd3.std01.ryzomcore.local +std01 pd4.std01.ryzomcore.local +std01 mla1.std01.ryzomcore.local +std01 mla2.std01.ryzomcore.local +std01 mla3.std01.ryzomcore.local +std01 mla4.std01.ryzomcore.local +std01 mla5.std01.ryzomcore.local +std01 mlb1.std01.ryzomcore.local +std01 mlb2.std01.ryzomcore.local +std01 mlb3.std01.ryzomcore.local +std01 mlb4.std01.ryzomcore.local +std01 mlb5.std01.ryzomcore.local +std01 rra1.std01.ryzomcore.local +std01 rra2.std01.ryzomcore.local +std01 rrb1.std01.ryzomcore.local +std01 rrb2.std01.ryzomcore.local diff --git a/code/ryzom/server/patchman_cfg/admin_install/patchman/patchman_service.default.cfg b/code/ryzom/server/patchman_cfg/admin_install/patchman/patchman_service.default.cfg index 981654046..7473aa9a0 100644 --- a/code/ryzom/server/patchman_cfg/admin_install/patchman/patchman_service.default.cfg +++ b/code/ryzom/server/patchman_cfg/admin_install/patchman/patchman_service.default.cfg @@ -10,7 +10,7 @@ StartCommands = // Create a gateway module on layer 3 transport and open it "moduleManager.createModule StandardGateway bridge_gw", "bridge_gw.transportAdd L3Client l3client", - "bridge_gw.transportCmd l3client(connect addr=ep1.mini01.ryzomcore.org:44749)", + "bridge_gw.transportCmd l3client(connect addr=ep1.mini01.ryzomcore.local:44749)", //------------------------------------------------------------------------------ @@ -19,7 +19,7 @@ StartCommands = // Create a gateway module on layer 3 transport and open it "moduleManager.createModule StandardGateway spm_gw", "spm_gw.transportAdd L3Client l3client", - "spm_gw.transportCmd l3client(connect addr=ep1.mini01.ryzomcore.org:44752)", + "spm_gw.transportCmd l3client(connect addr=ep1.mini01.ryzomcore.local:44752)", //------------------------------------------------------------------------------ @@ -28,10 +28,3 @@ StartCommands = "pam.plug spm_gw", "pam.plug bridge_gw", }; - -SpaPreCmdLineText="/bin/sh /srv/core/patchman/service_launcher.sh"; -DeploymentRootDirectory="/srv/core/patchman/"; -MakeInstalledVersionLiveCmdLine="/bin/sh /srv/core/patchman/make_next_live.sh"; -SpaLaunchAESCmdLine="/bin/sh /srv/core/patchman/loop_aes.sh"; -InstallArchiveDirectory="/srv/core/"; -InstallArchiveFileName="admin_install.tgz"; diff --git a/code/ryzom/server/patchman_cfg/admin_install/patchman/patchman_service.mini01.cfg b/code/ryzom/server/patchman_cfg/admin_install/patchman/patchman_service.mini01.cfg index 41c283b63..f046815ce 100644 --- a/code/ryzom/server/patchman_cfg/admin_install/patchman/patchman_service.mini01.cfg +++ b/code/ryzom/server/patchman_cfg/admin_install/patchman/patchman_service.mini01.cfg @@ -10,7 +10,7 @@ StartCommands = // Create a gateway module on layer 3 transport and open it "moduleManager.createModule StandardGateway bridge_gw", "bridge_gw.transportAdd L3Client l3client", - "bridge_gw.transportCmd l3client(connect addr=ep1.mini01.ryzomcore.org:44749)", + "bridge_gw.transportCmd l3client(connect addr=ep1.mini01.ryzomcore.local:44749)", //------------------------------------------------------------------------------ @@ -19,7 +19,7 @@ StartCommands = // Create a gateway module on layer 3 transport and open it "moduleManager.createModule StandardGateway spm_gw", "spm_gw.transportAdd L3Client l3client", - "spm_gw.transportCmd l3client(connect addr=ep1.mini01.ryzomcore.org:44751)", + "spm_gw.transportCmd l3client(connect addr=ep1.mini01.ryzomcore.local:44751)", //------------------------------------------------------------------------------ @@ -36,10 +36,3 @@ StartCommands = "pam.plug spm_gw", "pam.plug bridge_gw", }; - -SpaPreCmdLineText="/bin/sh /srv/core/patchman/service_launcher.sh"; -DeploymentRootDirectory="/srv/core/patchman/"; -MakeInstalledVersionLiveCmdLine="/bin/sh /srv/core/patchman/make_next_live.sh"; -SpaLaunchAESCmdLine="/bin/sh /srv/core/patchman/loop_aes.sh"; -InstallArchiveDirectory="/srv/core/"; -InstallArchiveFileName="admin_install.tgz"; diff --git a/code/ryzom/server/patchman_cfg/admin_install/patchman/patchman_service.mini01_bridge.cfg b/code/ryzom/server/patchman_cfg/admin_install/patchman/patchman_service.mini01_bridge.cfg index 32166d6bf..737177202 100644 --- a/code/ryzom/server/patchman_cfg/admin_install/patchman/patchman_service.mini01_bridge.cfg +++ b/code/ryzom/server/patchman_cfg/admin_install/patchman/patchman_service.mini01_bridge.cfg @@ -43,7 +43,7 @@ StartCommands += // Create a gateway module on layer 3 transport and open it "moduleManager.createModule StandardGateway spm_gw", "spm_gw.transportAdd L3Client l3client", - "spm_gw.transportCmd l3client(connect addr=ep1.mini01.ryzomcore.org:44751)", + "spm_gw.transportCmd l3client(connect addr=ep1.mini01.ryzomcore.local:44751)", //------------------------------------------------------------------------------ diff --git a/code/ryzom/server/patchman_cfg/admin_install/patchman/patchman_service.std01.cfg b/code/ryzom/server/patchman_cfg/admin_install/patchman/patchman_service.std01.cfg index e8c2d5787..23175c08b 100644 --- a/code/ryzom/server/patchman_cfg/admin_install/patchman/patchman_service.std01.cfg +++ b/code/ryzom/server/patchman_cfg/admin_install/patchman/patchman_service.std01.cfg @@ -10,7 +10,7 @@ StartCommands = // Create a gateway module on layer 3 transport and open it "moduleManager.createModule StandardGateway bridge_gw", "bridge_gw.transportAdd L3Client l3client", - "bridge_gw.transportCmd l3client(connect addr=ep1.mini01.ryzomcore.org:44749)", + "bridge_gw.transportCmd l3client(connect addr=ep1.mini01.ryzomcore.local:44749)", //------------------------------------------------------------------------------ @@ -19,7 +19,7 @@ StartCommands = // Create a gateway module on layer 3 transport and open it "moduleManager.createModule StandardGateway spm_gw", "spm_gw.transportAdd L3Client l3client", - "spm_gw.transportCmd l3client(connect addr=ep1.std01.ryzomcore.org:44752)", + "spm_gw.transportCmd l3client(connect addr=ep1.std01.ryzomcore.local:44752)", //------------------------------------------------------------------------------ @@ -36,10 +36,3 @@ StartCommands = "pam.plug spm_gw", "pam.plug bridge_gw", }; - -SpaPreCmdLineText="/bin/sh /srv/core/patchman/service_launcher.sh"; -DeploymentRootDirectory="/srv/core/patchman/"; -MakeInstalledVersionLiveCmdLine="/bin/sh /srv/core/patchman/make_next_live.sh"; -SpaLaunchAESCmdLine="/bin/sh /srv/core/patchman/loop_aes.sh"; -InstallArchiveDirectory="/srv/core/"; -InstallArchiveFileName="admin_install.tgz"; diff --git a/code/ryzom/server/patchman_cfg/admin_install/patchman/patchman_service_base_linux.cfg b/code/ryzom/server/patchman_cfg/admin_install/patchman/patchman_service_base_linux.cfg index 8aea88a5f..74290a228 100644 --- a/code/ryzom/server/patchman_cfg/admin_install/patchman/patchman_service_base_linux.cfg +++ b/code/ryzom/server/patchman_cfg/admin_install/patchman/patchman_service_base_linux.cfg @@ -14,4 +14,9 @@ DontUseStdIn = 0; // 4 = nothing UseYieldMethod = 0; - +SpaPreCmdLineText="/bin/sh /srv/core/patchman/service_launcher.sh"; +DeploymentRootDirectory="/srv/core/patchman/"; +MakeInstalledVersionLiveCmdLine="/bin/sh /srv/core/patchman/make_next_live.sh"; +SpaLaunchAESCmdLine="/bin/sh /srv/core/patchman/loop_aes.sh"; +InstallArchiveDirectory="/srv/core/"; +InstallArchiveFileName="admin_install.tgz"; diff --git a/code/ryzom/server/patchman_cfg/admin_install/patchman/service_launcher.sh b/code/ryzom/server/patchman_cfg/admin_install/patchman/service_launcher.sh index 091892af7..435c44bc0 100644 --- a/code/ryzom/server/patchman_cfg/admin_install/patchman/service_launcher.sh +++ b/code/ryzom/server/patchman_cfg/admin_install/patchman/service_launcher.sh @@ -1,25 +1,26 @@ #!/bin/sh -# the object is to make a launcher script that works with a command file to determine when to launch the application that it is responsible for +# the objective is to make a launcher script that works with a command file to determine when to launch the application that it is responsible for DOMAIN=$(pwd |sed "s%/srv/core/%%" | sed "s%/.*%%") NAME_BASE=$(pwd | sed 's/\/srv\/core\///' | sed 's/^.*\///') #if [ _$DOMAIN == _pre_live ] -# then - CTRL_FILE=${NAME_BASE}.launch_ctrl - NEXT_CTRL_FILE=${NAME_BASE}.deferred_launch_ctrl +# then + CTRL_FILE=${NAME_BASE}.launch_ctrl + NEXT_CTRL_FILE=${NAME_BASE}.deferred_launch_ctrl #elif [ _$DOMAIN == _pre_pre_live ] -# then -# CTRL_FILE=${NAME_BASE}.launch_ctrl -# NEXT_CTRL_FILE=${NAME_BASE}.deferred_launch_ctrl +# then +# CTRL_FILE=${NAME_BASE}.launch_ctrl +# NEXT_CTRL_FILE=${NAME_BASE}.deferred_launch_ctrl #else -# CTRL_FILE=${NAME_BASE}_immediate.launch_ctrl -# NEXT_CTRL_FILE=${NAME_BASE}_waiting.launch_ctrl +# CTRL_FILE=${NAME_BASE}_immediate.launch_ctrl +# NEXT_CTRL_FILE=${NAME_BASE}_waiting.launch_ctrl #fi STATE_FILE=${NAME_BASE}.state START_COUNTER_FILE=${NAME_BASE}.start_count CTRL_CMDLINE=$* +CTRL_COMMAND="" echo echo --------------------------------------------------------------------------------- @@ -36,6 +37,13 @@ echo echo 0 > $START_COUNTER_FILE START_COUNTER=0 +# always give ras a first run +if [ "${NAME_BASE}" = "ras" ] +then + echo Force admin service first startup + printf LAUNCH > $CTRL_FILE +fi + echo Press ENTER to launch program while true do @@ -45,37 +53,37 @@ do then # a control file exists so read it's contents - CTRL_COMMAND=_$(cat $CTRL_FILE)_ + CTRL_COMMAND=$(cat $CTRL_FILE) # do we have a 'launch' command? - if [ $CTRL_COMMAND = _LAUNCH_ ] + if [ "$CTRL_COMMAND" = "LAUNCH" ] then - # update the start counter - START_COUNTER=$(( $START_COUNTER + 1 )) - echo $START_COUNTER > $START_COUNTER_FILE + # update the start counter + START_COUNTER=$(( $START_COUNTER + 1 )) + echo $START_COUNTER > $START_COUNTER_FILE - # big nasty hack to deal with the special cases of ryzom_naming_service and ryzom_admin_service who have badly names cfg files - for f in ryzom_*cfg - do - cp $f $(echo $f | sed "s/ryzom_//") - done + # big nasty hack to deal with the special cases of ryzom_naming_service and ryzom_admin_service who have badly names cfg files + for f in ryzom_*cfg + do + cp $f $(echo $f | sed "s/ryzom_//") + done - # we have a launch command so prepare, launch, wait for exit and do the housekeeping - echo ----------------------------------------------------------------------- - echo Launching ... - echo - printf RUNNING > $STATE_FILE + # we have a launch command so prepare, launch, wait for exit and do the housekeeping + echo ----------------------------------------------------------------------- + echo Launching ... + echo + printf RUNNING > $STATE_FILE - $CTRL_CMDLINE + $CTRL_CMDLINE - echo ----------------------------------------------------------------------- - printf STOPPED > $STATE_FILE + echo ----------------------------------------------------------------------- + printf STOPPED > $STATE_FILE - # consume (remove) the control file to allow start once - rm $CTRL_FILE + # consume (remove) the control file to allow start once + rm $CTRL_FILE - echo Press ENTER to relaunch + echo Press ENTER to relaunch fi fi @@ -87,9 +95,9 @@ do else # give the terminal user a chance to press enter to provoke a re-launch HOLD=`sh -ic '{ read a; echo "ENTER" 1>&3; kill 0; } | { sleep 2; kill 0; }' 3>&1 2>/dev/null` - if [ _${HOLD}_ != _HOLD_ ] - then - printf LAUNCH > $CTRL_FILE + if [ "${HOLD}" = "ENTER" ] + then + printf LAUNCH > $CTRL_FILE fi fi diff --git a/code/ryzom/server/patchman_cfg/admin_install/patchman/special_patchman_list b/code/ryzom/server/patchman_cfg/admin_install/patchman/special_patchman_list index b42636e55..bb1114027 100644 --- a/code/ryzom/server/patchman_cfg/admin_install/patchman/special_patchman_list +++ b/code/ryzom/server/patchman_cfg/admin_install/patchman/special_patchman_list @@ -1,10 +1,10 @@ // mini01 - mini manager -mini01_spm ep1.mini01.ryzomcore.org -mini01_bridge ep1.mini01.ryzomcore.org +mini01_spm ep1.mini01.ryzomcore.local +mini01_bridge ep1.mini01.ryzomcore.local // std01 - std manager -std01_spm ep1.std01.ryzomcore.org +std01_spm ep1.std01.ryzomcore.local diff --git a/code/ryzom/server/patchman_cfg/admin_install/patchman_service_local.cfg b/code/ryzom/server/patchman_cfg/admin_install/patchman_service_local.cfg index 45f2afe3f..5b2f35f5f 100644 --- a/code/ryzom/server/patchman_cfg/admin_install/patchman_service_local.cfg +++ b/code/ryzom/server/patchman_cfg/admin_install/patchman_service_local.cfg @@ -1 +1 @@ -SPAHost = "ep1.mini01.ryzomcore.org"; +SPAHost = "ep1.mini01.ryzomcore.local"; diff --git a/code/ryzom/server/patchman_cfg/default/ai_service.cfg b/code/ryzom/server/patchman_cfg/default/ai_service.cfg index 72b278cc0..fdb381b38 100644 --- a/code/ryzom/server/patchman_cfg/default/ai_service.cfg +++ b/code/ryzom/server/patchman_cfg/default/ai_service.cfg @@ -6,7 +6,7 @@ SystemCmd = {}; //NegFiltersDebug += { "LNET", "HNET", "FEVIS"}; //NegFiltersInfo += { "LNET", "HNET", "VISION_DELTA", "FEIMPE", "FEVIS" }; // NegFiltersWarning += { "LNET", "FEHACK", "FERECV"}; -// NegFiltersWarning += { "positional", "faction", "pet" }; +// NegFiltersWarning += { "positional", "faction", "pet" }; ////////////////////////////////////////////////////////////////////////////// //- Basic (specific) heal profile parameters --------------------------------- @@ -49,7 +49,7 @@ DefaultNpcAggroDist = 15; DefaultEscortRange = 10; ////////////////////////////////////////////////////////////////////////////// -// Aggro // +// Aggro // ////////////////////////////////////////////////////////////////////////////// AggroReturnDistCheck = 15.0; AggroReturnDistCheckFauna = 15.0; @@ -318,25 +318,25 @@ StartCommandsWhenMirrorReadyPost = // commands for Ring continents StartCommandsWhenMirrorReadyRing = { - "loadContinent r2_desert", + "loadContinent r2_desert", "createDynamicAIInstance 10000", "loadPrimitiveFile dummy.primitive", - "loadContinent r2_forest", - "createDynamicAIInstance 10001", - "loadPrimitiveFile dummy.primitive", +// "loadContinent r2_forest", +// "createDynamicAIInstance 10001", +// "loadPrimitiveFile dummy.primitive", - "loadContinent r2_lakes", - "createDynamicAIInstance 10003", - "loadPrimitiveFile dummy.primitive", +// "loadContinent r2_lakes", +// "createDynamicAIInstance 10003", +// "loadPrimitiveFile dummy.primitive", - "loadContinent r2_jungle", - "createDynamicAIInstance 10002", - "loadPrimitiveFile dummy.primitive", +// "loadContinent r2_jungle", +// "createDynamicAIInstance 10002", +// "loadPrimitiveFile dummy.primitive", - "loadContinent r2_roots", - "createDynamicAIInstance 10004", - "loadPrimitiveFile dummy.primitive", +// "loadContinent r2_roots", +// "createDynamicAIInstance 10004", +// "loadPrimitiveFile dummy.primitive", // "spawnInstances", "updateAI", diff --git a/code/ryzom/server/patchman_cfg/default/dynamic_scenario_service.cfg b/code/ryzom/server/patchman_cfg/default/dynamic_scenario_service.cfg new file mode 100644 index 000000000..e6d5942ac --- /dev/null +++ b/code/ryzom/server/patchman_cfg/default/dynamic_scenario_service.cfg @@ -0,0 +1,9 @@ + +DelayBeforeStartAct = 1; +MaxNpcs = 300; +MaxStaticObjects = 200; + +StartCommands += +{ + "unifiedNetwork.addService ShardUnifier ( address="+SUAddress+" sendId external autoRetry )", +}; diff --git a/code/ryzom/server/patchman_cfg/default/log_analyser_service.cfg b/code/ryzom/server/patchman_cfg/default/log_analyser_service.cfg new file mode 100644 index 000000000..355984ff5 --- /dev/null +++ b/code/ryzom/server/patchman_cfg/default/log_analyser_service.cfg @@ -0,0 +1,5 @@ + +DontUseNS = 1; + +QueryTimeout = 300; +LinePerPage = 50; diff --git a/code/ryzom/server/patchman_cfg/default/ryzom_as.cfg b/code/ryzom/server/patchman_cfg/default/ryzom_as.cfg index 2755403b7..4227bac69 100644 --- a/code/ryzom/server/patchman_cfg/default/ryzom_as.cfg +++ b/code/ryzom/server/patchman_cfg/default/ryzom_as.cfg @@ -1,7 +1,7 @@ DontUseNS = 1; RRDToolPath = "rrdtool"; -RRDVarPath = "../graph_datas"; +RRDVarPath = "../rrd_graphs"; // Variables required to be defined by other cfgs //AESHost="localhost"; diff --git a/code/ryzom/server/patchman_cfg/shard_ctrl_definitions.txt b/code/ryzom/server/patchman_cfg/shard_ctrl_definitions.txt index 87bd0ce4d..8deb9f533 100644 --- a/code/ryzom/server/patchman_cfg/shard_ctrl_definitions.txt +++ b/code/ryzom/server/patchman_cfg/shard_ctrl_definitions.txt @@ -26,7 +26,7 @@ define exe_set_mini_ring define exe_set_mini_mainland use raes use ms_mini_mainland - use ais_newbyland + use ais_newbieland use egs_mainland use gpms_mainland use ios_mainland @@ -100,7 +100,7 @@ define exe_set_std_mainland_be03 define exe_set_std_mainland_be03_basics // use ais_matis // use ais_tryker - use ais_newbyland + use ais_newbieland // unifier and co ------------------ @@ -170,12 +170,14 @@ define ais_ring cmdLine ai_service -C. -L. --nobreak --writepid -mCommon:Ring use ais data data_r2_desert - data data_r2_forest - data data_r2_jungle - data data_r2_lakes - data data_r2_roots + // data data_r2_forest + // data data_r2_jungle + // data data_r2_lakes + // data data_r2_roots define ais_mainland + name ais + cmdLine ai_service -C. -L. --nobreak --writepid -mCommon:Indoors:Newbieland:Post use ais data data_mainland_common_primitives data data_newbieland_primitives @@ -188,8 +190,8 @@ define ais_mini_mainland cmdLine ai_service -C. -L. --nobreak --writepid -mCommon:Indoors:Newbieland:Post use ais_mainland -define ais_newbyland - name ais_newbyland +define ais_newbieland + name ais_newbieland cmdLine ai_service -C. -L. --nobreak --writepid -mCommon:Indoors:Newbieland:Post use ais data data_mainland_common_primitives @@ -213,36 +215,40 @@ define bms_master use bms cmdLine backup_service -C. -L. --nobreak --writepid -P49990 //cfg #include "../live/cfg/backup_module_service_master.cfg" + cfg #include "../live/service_backup_service/backup_service.cfg" cfgAfter ListeningPort = 49990; cfgAfter L3ListeningPort = 49950; cfgAfter WebPort = 49970; cfgAfter BSReadState = 1; - cfgAfter SaveShardRoot = "../save_shard/"; + cfgAfter SaveShardRoot = "../save_shard_bs/"; define bms_master2 use bms cmdLine backup_service -C. -L. --nobreak --writepid -P49994 //cfg #include "../live/cfg/backup_module_service_master.cfg" + cfg #include "../live/service_backup_service/backup_service.cfg" cfgAfter ListeningPort = 49994; cfgAfter L3ListeningPort = 49954; cfgAfter WebPort = 49974; cfgAfter BSReadState = 1; - cfgAfter SaveShardRoot = "../save_shard/"; + cfgAfter SaveShardRoot = "../save_shard_bs/"; define bms_slave use bms cmdLine backup_service -C. -L. --nobreak --writepid -P49991 - cfg #include "../live/cfg/backup_module_service_slave.cfg" + //cfg #include "../live/cfg/backup_module_service_slave.cfg" + cfg #include "../live/service_backup_service/backup_service.cfg" cfgAfter ListeningPort = 49991; cfgAfter L3ListeningPort = 49951; cfgAfter WebPort = 49971; cfgAfter BSReadState = 0; - cfgAfter SaveShardRoot = "../save_shard/"; + cfgAfter SaveShardRoot = "../save_shard_bs/"; define bms_pd_master use bms cmdLine backup_service -C. -L. --nobreak --writepid -P49992 //cfg #include "../live/cfg/backup_module_service_master.cfg" + cfg #include "../live/service_backup_service/backup_service.cfg" cfgAfter ListeningPort = 49992; cfgAfter L3ListeningPort = 49952; cfgAfter WebPort = 49972; @@ -252,7 +258,8 @@ define bms_pd_master define bms_pd_slave use bms cmdLine backup_service -C. -L. --nobreak --writepid -P49993 - cfg #include "../live/cfg/backup_module_service_slave.cfg" + //cfg #include "../live/cfg/backup_module_service_slave.cfg" + cfg #include "../live/service_backup_service/backup_service.cfg" cfgAfter ListeningPort = 49993; cfgAfter L3ListeningPort = 49953; cfgAfter WebPort = 49973; @@ -263,6 +270,7 @@ define backup_lgs use bms cmdLine backup_service -C. -L. --nobreak --writepid -P49994 //cfg #include "../live/cfg/backup_module_service_master.cfg" + cfg #include "../live/service_backup_service/backup_service.cfg" cfgAfter ListeningPort = 49994; cfgAfter L3ListeningPort = 49995; cfgAfter WebPort = 49972; @@ -320,7 +328,7 @@ define dss define dss_ring use dss - cfg #include "../live/cfg/dynamic_scenario_service_ring.cfg" + // cfg #include "../live/cfg/dynamic_scenario_service_ring.cfg" // egs ----------------------------- @@ -374,17 +382,17 @@ define egs_mainland define egs_ring use egs data data_mainland_common_primitives - data data_newbieland_primitives - data data_newbieland - data data_indoors - cfg #include "../live/cfg/entities_game_service_ring.cfg" + // data data_newbieland_primitives + // data data_newbieland + // data data_indoors + //cfg #include "../live/cfg/entities_game_service_ring.cfg" // care cfg UsedContinents = cfg { cfg "r2_desert", "10000", - cfg "r2_forest", "10001", - cfg "r2_jungle", "10002", - cfg "r2_lakes", "10003", - cfg "r2_roots", "10004", + // cfg "r2_forest", "10001", + // cfg "r2_jungle", "10002", + // cfg "r2_lakes", "10003", + // cfg "r2_roots", "10004", cfg }; cfgAfter MaxXPGainPerPlayer = 30.0; cfgAfter DeathXPFactor = 0.0; @@ -460,16 +468,16 @@ define gpms_mainland use gpms data data_newbieland data data_indoors - cfg #include "../live/cfg/gpm_service_mainland.cfg" + //cfg #include "../live/cfg/gpm_service_mainland.cfg" define gpms_ring use gpms data data_r2_desert - data data_r2_forest - data data_r2_jungle - data data_r2_lakes - data data_r2_roots - cfg #include "../live/cfg/gpm_service_ring.cfg" + // data data_r2_forest + // data data_r2_jungle + // data data_r2_lakes + // data data_r2_roots + //cfg #include "../live/cfg/gpm_service_ring.cfg" // pdss ---------------------------- @@ -534,7 +542,7 @@ define ios_mainland define ios_ring use ios - cfg #include "../live/cfg/input_output_service_ring.cfg" + //cfg #include "../live/cfg/input_output_service_ring.cfg" // las ----------------------------- diff --git a/code/ryzom/server/patchman_cfg/shard_ctrl_mini01.txt b/code/ryzom/server/patchman_cfg/shard_ctrl_mini01.txt index a17f6f922..e09f106ac 100644 --- a/code/ryzom/server/patchman_cfg/shard_ctrl_mini01.txt +++ b/code/ryzom/server/patchman_cfg/shard_ctrl_mini01.txt @@ -30,15 +30,15 @@ define domain_mini01 // domain hosts cfg AESHost = "localhost"; - cfg SUHost = "ep1.mini01.ryzomcore.org"; - cfg MFSHost = "ep1.mini01.ryzomcore.org"; - cfg BSHost = "ep1.mini01.ryzomcore.org:49990"; - cfg SlaveBSHost= "ep1.mini01.ryzomcore.org:49991"; - cfg MasterLGSHost = "ep1.mini01.ryzomcore.org"; - cfg SlaveLGSHost = "ep1.mini01.ryzomcore.org"; - cfg LGSBSHost = "ep1.mini01.ryzomcore.org"; - cfg DBHost = "localhost"; // FIXME "sql.core.ryzomcore.org"; - cfgAfter WebSrvHost = "http://ep1.mini01.ryzomcore.org:50000/"; + cfg SUHost = "ep1.mini01.ryzomcore.local"; + cfg MFSHost = "ep1.mini01.ryzomcore.local"; + cfg BSHost = "ep1.mini01.ryzomcore.local:49990"; + cfg SlaveBSHost= "ep1.mini01.ryzomcore.local:49991"; + cfg MasterLGSHost = "ep1.mini01.ryzomcore.local"; + cfg SlaveLGSHost = "ep1.mini01.ryzomcore.local"; + cfg LGSBSHost = "ep1.mini01.ryzomcore.local"; + cfg DBHost = "ep1.mini01.ryzomcore.local"; + cfgAfter WebSrvHost = "http://ep1.mini01.ryzomcore.local:50000/"; // initial config files cfgFile ../cfg/00_base.cfg @@ -84,7 +84,7 @@ define shard_mini01_unifier use exe_set_std_lgs_slave use backup_lgs cfg DBPass = DBNelPass; - host ep1.mini01.ryzomcore.org + host ep1.mini01.ryzomcore.local // shard mainland01 ---------------- @@ -95,10 +95,10 @@ define shard_mini01_mainland01 cfg ShardId = 301; cfg BasePort = 52000; cfg SaveFilesDirectory="mini01_mainland01/"; - cfg NSHost = "ep1.mini01.ryzomcore.org"; - cfg FSListenHost = "ep1.mini01.ryzomcore.org"; + cfg NSHost = "ep1.mini01.ryzomcore.local"; + cfg FSListenHost = "ep1.mini01.ryzomcore.local"; cfgFile ../cfg/02_shard_type_mini_mainland.cfg - host ep1.mini01.ryzomcore.org + host ep1.mini01.ryzomcore.local // shard ring01 -------------------- @@ -110,7 +110,7 @@ define shard_mini01_ring01 cfg BasePort = 52400; cfg SaveFilesDirectory="mini01_ring01/"; cfg NSPort = 51100; - cfg NSHost = "ep1.mini01.ryzomcore.org" + 51100; + cfg NSHost = "ep1.mini01.ryzomcore.local" + 51100; cfgFile ../cfg/02_shard_type_std_ring.cfg - host ep1.mini01.ryzomcore.org + host ep1.mini01.ryzomcore.local diff --git a/code/ryzom/server/patchman_cfg/shard_ctrl_std01.txt b/code/ryzom/server/patchman_cfg/shard_ctrl_std01.txt index 311261110..5492d6af3 100644 --- a/code/ryzom/server/patchman_cfg/shard_ctrl_std01.txt +++ b/code/ryzom/server/patchman_cfg/shard_ctrl_std01.txt @@ -32,15 +32,15 @@ define domain_std01 // domain hosts cfg AESHost = "localhost"; - cfg SUHost = "su1.std01.ryzomcore.org"; - cfg MFSHost = "su1.std01.ryzomcore.org"; - cfg BSHost = "pd1.std01.ryzomcore.org:49990"; // Backup service host for domain - cfg SlaveBSHost= "pd2.std01.ryzomcore.org:49991"; - cfg MasterLGSHost = "pd3.std01.ryzomcore.org"; - cfg SlaveLGSHost = "pd4.std01.ryzomcore.org"; - cfg LGSBSHost = "csr.core.ryzomcore.org"; // Backup service host for log service - cfg DBHost = "sql.core.ryzomcore.org"; - cfgAfter WebSrvHost = "http://su1.std01.ryzomcore.org:50000/"; + cfg SUHost = "su1.std01.ryzomcore.local"; + cfg MFSHost = "su1.std01.ryzomcore.local"; + cfg BSHost = "pd1.std01.ryzomcore.local:49990"; // Backup service host for domain + cfg SlaveBSHost= "pd2.std01.ryzomcore.local:49991"; + cfg MasterLGSHost = "pd3.std01.ryzomcore.local"; + cfg SlaveLGSHost = "pd4.std01.ryzomcore.local"; + cfg LGSBSHost = "csr.core.ryzomcore.local"; // Backup service host for log service + cfg DBHost = "sql.core.ryzomcore.local"; + cfgAfter WebSrvHost = "http://su1.std01.ryzomcore.local:50000/"; // initial config files cfgFile ../cfg/00_base.cfg @@ -86,11 +86,11 @@ define shard_std01_unifier define shard_exe_set_std01_ras use ras - host ep1.std01.ryzomcore.org + host ep1.std01.ryzomcore.local define shard_exe_set_std01_unifier use exe_set_std_unifier - host su1.std01.ryzomcore.org + host su1.std01.ryzomcore.local cfg DBPass = DBNelPass; @@ -106,30 +106,30 @@ define shard_std01_mainland01 cfg ShardId = 101; cfg BasePort = 51000; cfg SaveFilesDirectory="std01_mainland01/"; - cfg NSHost = "mla1.std01.ryzomcore.org"; + cfg NSHost = "mla1.std01.ryzomcore.local"; cfgFile ../cfg/02_shard_type_std_mainland.cfg define shard_exe_set_std01_mainland01_be01 use exe_set_std_mainland_be01 - host mla1.std01.ryzomcore.org + host mla1.std01.ryzomcore.local define shard_exe_set_std01_mainland01_be02 use exe_set_std_mainland_be02 - host mla2.std01.ryzomcore.org + host mla2.std01.ryzomcore.local define shard_exe_set_std01_mainland01_be03 use exe_set_std_mainland_be03 - host mla3.std01.ryzomcore.org + host mla3.std01.ryzomcore.local define shard_exe_set_std01_mainland01_fe01 use exe_set_std_mainland_fe - host mla4.std01.ryzomcore.org - cfg FSListenHost = "mla4.std01.ryzomcore.org"; + host mla4.std01.ryzomcore.local + cfg FSListenHost = "mla4.std01.ryzomcore.local"; define shard_exe_set_std01_mainland01_fe02 use exe_set_std_mainland_fe - host mla5.std01.ryzomcore.org - cfg FSListenHost = "mla5.std01.ryzomcore.org"; + host mla5.std01.ryzomcore.local + cfg FSListenHost = "mla5.std01.ryzomcore.local"; // shard mainland02 ---------------- @@ -144,30 +144,30 @@ define shard_std01_mainland02 cfg ShardId = 102; cfg BasePort = 51100; cfg SaveFilesDirectory="std01_mainland02/"; - cfg NSHost = "mlb1.std01.ryzomcore.org"; + cfg NSHost = "mlb1.std01.ryzomcore.local"; cfgFile ../cfg/02_shard_type_std_mainland.cfg define shard_exe_set_std01_mainland02_be01 use exe_set_std_mainland_be01 - host mlb1.std01.ryzomcore.org + host mlb1.std01.ryzomcore.local define shard_exe_set_std01_mainland02_be02 use exe_set_std_mainland_be02 - host mlb2.std01.ryzomcore.org + host mlb2.std01.ryzomcore.local define shard_exe_set_std01_mainland02_be03 use exe_set_std_mainland_be03 - host mlb3.std01.ryzomcore.org + host mlb3.std01.ryzomcore.local define shard_exe_set_std01_mainland02_fe01 use exe_set_std_mainland_fe - host mlb4.std01.ryzomcore.org - cfg FSListenHost = "mlb4.std01.ryzomcore.org"; + host mlb4.std01.ryzomcore.local + cfg FSListenHost = "mlb4.std01.ryzomcore.local"; define shard_exe_set_std01_mainland02_fe02 use exe_set_std_mainland_fe - host mlb5.std01.ryzomcore.org - cfg FSListenHost = "mlb5.std01.ryzomcore.org"; + host mlb5.std01.ryzomcore.local + cfg FSListenHost = "mlb5.std01.ryzomcore.local"; // shard ring01 -------------------- @@ -179,17 +179,17 @@ define shard_std01_ring01 cfg ShardId = 201; cfg BasePort = 51400; cfg SaveFilesDirectory="std01_ring01/"; - cfg NSHost = "rra1.std01.ryzomcore.org"; + cfg NSHost = "rra1.std01.ryzomcore.local"; cfgFile ../cfg/02_shard_type_std_ring.cfg define shard_exe_set_std01_ring01_be use exe_set_std_ring_be - host rra1.std01.ryzomcore.org + host rra1.std01.ryzomcore.local define shard_exe_set_std01_ring01_fe use exe_set_std_ring_fe - host rra2.std01.ryzomcore.org - cfg FSListenHost = "rra2.std01.ryzomcore.org"; + host rra2.std01.ryzomcore.local + cfg FSListenHost = "rra2.std01.ryzomcore.local"; // shard ring02 -------------------- @@ -201,17 +201,17 @@ define shard_std01_ring02 cfg ShardId = 202; cfg BasePort = 51500; cfg SaveFilesDirectory="std01_ring02/"; - cfg NSHost = "rrb1.std01.ryzomcore.org"; + cfg NSHost = "rrb1.std01.ryzomcore.local"; cfgFile ../cfg/02_shard_type_std_ring.cfg define shard_exe_set_std01_ring02_be use exe_set_std_ring_be - host rrb1.std01.ryzomcore.org + host rrb1.std01.ryzomcore.local define shard_exe_set_std01_ring02_fe use exe_set_std_ring_fe - host rrb2.std01.ryzomcore.org - cfg FSListenHost = "rrb2.std01.ryzomcore.org"; + host rrb2.std01.ryzomcore.local + cfg FSListenHost = "rrb2.std01.ryzomcore.local"; // the std01 backup domain ---------- @@ -260,7 +260,7 @@ define shard_std01_backup_ras shard std01_backup_ras cfg ShardId = 100; use ras - host ep1.std01.ryzomcore.org + host ep1.std01.ryzomcore.local // the main backup pair ------------ @@ -273,15 +273,15 @@ define shard_std01_backup define shard_exe_set_std01_backup_master name bs_master use exe_set_std_backup_master - host pd1.std01.ryzomcore.org + host pd1.std01.ryzomcore.local define shard_exe_set_std01_backup_slave name bs_slave // hack to workaround bug in backup service // use exe_set_std_backup_slave use exe_set_std01_backup_slave - host pd2.std01.ryzomcore.org - cfgAfter MasterBSHost = "pd1.std01.ryzomcore.org:49990"; + host pd2.std01.ryzomcore.local + cfgAfter MasterBSHost = "pd1.std01.ryzomcore.local:49990"; // hack to workaround bug in backup service define exe_set_std01_backup_slave @@ -312,27 +312,27 @@ define shard_std01_lgs cfg L3SlaveLGSPort = 49993; cfg LGSBSPort = 49994; cfg L3LGSBSPort = 49995; - cfg MasterLGSHost = "pd3.std01.ryzomcore.org"; - cfg SlaveLGSHost = "pd4.std01.ryzomcore.org"; - cfg LGSBSHost = "csr.core.ryzomcore.org"; + cfg MasterLGSHost = "pd3.std01.ryzomcore.local"; + cfg SlaveLGSHost = "pd4.std01.ryzomcore.local"; + cfg LGSBSHost = "csr.core.ryzomcore.local"; define shard_exe_set_std01_lgs_primary name lgs_primary use raes use exe_set_std_lgs_master - host pd3.std01.ryzomcore.org + host pd3.std01.ryzomcore.local define shard_exe_set_std01_lgs_secondary name lgs_secondary use raes use exe_set_std_lgs_slave - host pd4.std01.ryzomcore.org + host pd4.std01.ryzomcore.local define shard_exe_set_std01_lgs_bs name lgs_bs use raes use backup_lgs - host csr.core.ryzomcore.org + host csr.core.ryzomcore.local // the std01 las domain ------------- @@ -365,7 +365,7 @@ define shard_std01_las_ras shard std01_las_ras cfg ShardId = 100; use ras - host ep1.std01.ryzomcore.org + host ep1.std01.ryzomcore.local // master las ---------------------- @@ -378,7 +378,7 @@ define shard_std01_las_master use las_mainland02 use las_ring01 use las_ring02 - host pd3.std01.ryzomcore.org + host pd3.std01.ryzomcore.local define las_mainland01 cfgAfter StartCommands += {"PDRootDirectory /srv/core/backup01/save_shard_pd/std01_mainland01/pds"}; @@ -415,7 +415,7 @@ define shard_std01_las_slave use las_mainland02_slave use las_ring01_slave use las_ring02_slave - host pd4.std01.ryzomcore.org + host pd4.std01.ryzomcore.local define las_mainland01_slave cfgAfter StartCommands += {"PDRootDirectory /srv/core/backup01/save_shard_pd/std01_mainland01/pds"}; diff --git a/code/ryzom/server/patchman_cfg/terminal_mini01/patchman_service.cfg b/code/ryzom/server/patchman_cfg/terminal_mini01/patchman_service.cfg index 351a8614a..c6a336c02 100644 --- a/code/ryzom/server/patchman_cfg/terminal_mini01/patchman_service.cfg +++ b/code/ryzom/server/patchman_cfg/terminal_mini01/patchman_service.cfg @@ -41,12 +41,12 @@ StartCommands += // bridge gateway // "moduleManager.createModule StandardGateway gw1", // "gw1.transportAdd L3Client l3client", -// "gw1.transportCmd l3client(connect addr=ep1.mini01.ryzomcore.org:44748)", +// "gw1.transportCmd l3client(connect addr=ep1.mini01.ryzomcore.local:44748)", // ats spm gateway "moduleManager.createModule StandardGateway gw2", "gw2.transportAdd L3Client l3client", - "gw2.transportCmd l3client(connect addr=ep1.mini01.ryzomcore.org:44751)", + "gw2.transportCmd l3client(connect addr=ep1.mini01.ryzomcore.local:44751)", //------------------------------------------------------------------------------ diff --git a/code/ryzom/server/patchman_cfg/terminal_mini01/terminal_mini01.bat b/code/ryzom/server/patchman_cfg/terminal_mini01/terminal_mini01.bat index 7f61bfa59..90e11d5d6 100644 --- a/code/ryzom/server/patchman_cfg/terminal_mini01/terminal_mini01.bat +++ b/code/ryzom/server/patchman_cfg/terminal_mini01/terminal_mini01.bat @@ -1,2 +1,2 @@ @echo off -start S:\devw_x86\bin\Release\ryzom_patchman_service.exe --nolog -C. -L. \ No newline at end of file +start R:\build\bin\Release\ryzom_patchman_service.exe --nolog -C. -L. \ No newline at end of file diff --git a/code/ryzom/server/src/CMakeLists.txt b/code/ryzom/server/src/CMakeLists.txt index 29c11be09..08731a4ca 100644 --- a/code/ryzom/server/src/CMakeLists.txt +++ b/code/ryzom/server/src/CMakeLists.txt @@ -1,4 +1,3 @@ - # Supporting modules and libraries. # Need servershare for build packed collision tool # Need aishare for build wmap tool diff --git a/code/ryzom/server/src/admin_modules/CMakeLists.txt b/code/ryzom/server/src/admin_modules/CMakeLists.txt index ea8d8a5ff..9809b2f29 100644 --- a/code/ryzom/server/src/admin_modules/CMakeLists.txt +++ b/code/ryzom/server/src/admin_modules/CMakeLists.txt @@ -11,4 +11,8 @@ NL_ADD_LIB_SUFFIX(ryzom_adminmodules) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +IF(WITH_PCH) + ADD_NATIVE_PRECOMPILED_HEADER(ryzom_adminmodules ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) +ENDIF(WITH_PCH) + INSTALL(TARGETS ryzom_adminmodules LIBRARY DESTINATION ${RYZOM_LIB_PREFIX} ARCHIVE DESTINATION ${RYZOM_LIB_PREFIX} COMPONENT libraries) diff --git a/code/ryzom/server/src/admin_modules/admin_modules_itf.cpp b/code/ryzom/server/src/admin_modules/admin_modules_itf.cpp index 258409d16..39dfc6948 100644 --- a/code/ryzom/server/src/admin_modules/admin_modules_itf.cpp +++ b/code/ryzom/server/src/admin_modules/admin_modules_itf.cpp @@ -18,6 +18,7 @@ // WARNING : this is a generated file, don't change it ! ///////////////////////////////////////////////////////////////// +#include "stdpch.h" #include "admin_modules_itf.h" namespace ADMIN diff --git a/code/ryzom/server/src/admin_modules/aes_client_module.cpp b/code/ryzom/server/src/admin_modules/aes_client_module.cpp index e2b9ca390..7cb85f5a4 100644 --- a/code/ryzom/server/src/admin_modules/aes_client_module.cpp +++ b/code/ryzom/server/src/admin_modules/aes_client_module.cpp @@ -15,6 +15,7 @@ // along with this program. If not, see . +#include "stdpch.h" #include "nel/misc/singleton.h" #include "nel/net/module.h" #include "nel/net/module_builder_parts.h" @@ -259,7 +260,7 @@ namespace ADMIN gs.HighRezTimeStamp = timer; IVariable *var = dynamic_cast(ICommand::getCommand(gvi.VarName)); if (var != NULL) - gs.SampleValue = atof(var->toString().c_str()); + NLMISC::fromString(var->toString(), gs.SampleValue); } } } @@ -305,7 +306,11 @@ namespace ADMIN // no sample collected yet, just ask a new one IVariable *var = dynamic_cast(ICommand::getCommand(gvi.VarName)); if (var != NULL) - gd.setValue(atof(var->toString().c_str())); + { + float val; + NLMISC::fromString(var->toString(), val); + gd.setValue(val); + } } else { diff --git a/code/ryzom/server/src/admin_modules/aes_module.cpp b/code/ryzom/server/src/admin_modules/aes_module.cpp index c4faf5c47..734dfff64 100644 --- a/code/ryzom/server/src/admin_modules/aes_module.cpp +++ b/code/ryzom/server/src/admin_modules/aes_module.cpp @@ -15,6 +15,7 @@ // along with this program. If not, see . +#include "stdpch.h" #include "nel/misc/singleton.h" #include #include "nel/misc/path.h" @@ -573,7 +574,7 @@ namespace ADMIN time_t t = now; fprintf(fp, "AESReportDate=%s", ::ctime(&t)); - fprintf(fp, "NBService=%u\n", _ServiceStates.size()); + fprintf(fp, "NBService=%u\n", (uint)_ServiceStates.size()); // output state of each service TServiceStates::iterator first(_ServiceStates.begin()), last(_ServiceStates.end()); for (; first != last; ++first) diff --git a/code/ryzom/server/src/admin_modules/as_module.cpp b/code/ryzom/server/src/admin_modules/as_module.cpp index cbe1b2818..9717da358 100644 --- a/code/ryzom/server/src/admin_modules/as_module.cpp +++ b/code/ryzom/server/src/admin_modules/as_module.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 "nel/misc/types_nl.h" #include #include "nel/misc/file.h" diff --git a/code/nel/src/misc/game_device.cpp b/code/ryzom/server/src/admin_modules/stdpch.cpp similarity index 78% rename from code/nel/src/misc/game_device.cpp rename to code/ryzom/server/src/admin_modules/stdpch.cpp index 2ba49367f..a3d45576c 100644 --- a/code/nel/src/misc/game_device.cpp +++ b/code/ryzom/server/src/admin_modules/stdpch.cpp @@ -1,4 +1,4 @@ -// NeL - MMORPG Framework +// Ryzom - MMORPG Framework // Copyright (C) 2010 Winch Gate Property Limited // // This program is free software: you can redistribute it and/or modify @@ -14,15 +14,4 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -#include "stdmisc.h" -#include "nel/misc/game_device.h" - -#ifdef DEBUG_NEW - #define new DEBUG_NEW -#endif - -namespace NLMISC { - - - -} // NLMISC +#include "stdpch.h" diff --git a/code/ryzom/server/src/admin_modules/stdpch.h b/code/ryzom/server/src/admin_modules/stdpch.h new file mode 100644 index 000000000..be01e5019 --- /dev/null +++ b/code/ryzom/server/src/admin_modules/stdpch.h @@ -0,0 +1,45 @@ +// Ryzom - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef ADMIN_MODULES_STDPCH_H +#define ADMIN_MODULES_STDPCH_H + +#include +#include + +#include "nel/misc/types_nl.h" + +#include "nel/misc/file.h" +#include "nel/misc/hierarchical_timer.h" +#include "nel/misc/mutable_container.h" +#include "nel/misc/path.h" +#include "nel/misc/singleton.h" +#include "nel/misc/sstring.h" +#include "nel/misc/string_conversion.h" +#include "nel/misc/time_nl.h" +#include "nel/net/message.h" +#include "nel/net/module.h" +#include "nel/net/module_builder_parts.h" +#include "nel/net/module_gateway.h" +#include "nel/net/module_manager.h" +#include "nel/net/module_message.h" +#include "nel/net/service.h" +#include "nel/net/unified_network.h" + +#include "game_share/callback_adaptor.h" +#include "game_share/utils.h" + +#endif diff --git a/code/ryzom/server/src/ags_test/commands.cpp b/code/ryzom/server/src/ags_test/commands.cpp index 7b2e6c2a8..4fa955401 100644 --- a/code/ryzom/server/src/ags_test/commands.cpp +++ b/code/ryzom/server/src/ags_test/commands.cpp @@ -586,7 +586,10 @@ NLMISC_COMMAND(actorSetOrientation,"Add one or more static actors"," if (i<(sizeof(angleNames)/sizeof(angleNames[0]))) theta=3.14159265359f*2.0f*(float)i/(float)(sizeof(angleNames)/sizeof(angleNames[0])); else - theta=(float)atof(args[0].c_str())/360.0f*2.0f*3.14159265359f; + { + NLMISC::fromString(args[0], theta); + theta = theta / 360.0f*2.0f*3.14159265359f; + } if (args.size()==1) { @@ -620,11 +623,13 @@ NLMISC_COMMAND(actorSetMagnetRange,"Set the magnet properties for wandering beha if(args.size() <1) return false; COMMAND_MACRO_RECORD_TEST - float range=(float)atof(args[0].c_str()); + float range; + NLMISC::fromString(args[0], range); if (range<=0.0f) return false; unsigned start; - float decay=(float)atof(args[0].c_str()); + float decay; + NLMISC::fromString(args[0], decay); if (decay<0.0f) return false; if (decay==0.0f) { @@ -664,7 +669,8 @@ NLMISC_COMMAND(actorSetAttackDistance,"set actor attack distance"," [< if(args.size() <1) return false; COMMAND_MACRO_RECORD_TEST - float distance=(float)atof(args[0].c_str()); + float distance; + NLMISC::fromString(args[0], distance); // if (distance<=0.0f) return false; if (args.size()<2) @@ -781,11 +787,13 @@ NLMISC_COMMAND(actorSetRespawnDelay,"set actor respawn delay"," [ filters; 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 5fc1ed6b5..e52b97573 100644 --- a/code/ryzom/server/src/ai_data_service/pacs_scan.cpp +++ b/code/ryzom/server/src/ai_data_service/pacs_scan.cpp @@ -48,7 +48,7 @@ // Server share -#include "server_share/bmp4image.h" +#include "game_share/bmp4image.h" #include "server_share/continent_container.h" @@ -1651,7 +1651,7 @@ public: first.flags = (topNode.isInWater() ? 1 : 0) + (topNode.isInNogo() ? 2 : 0); // push first position - stacks[first.flags].insert(make_pair(first.flags, stwp)); + stacks[first.flags].insert(std::pair(first.flags, stwp)); while (true) { @@ -1750,11 +1750,11 @@ public: } if (tmp.getTopologyNode().Id == topNode.Id) { - stacks[0].insert(make_pair(ndist, tmp)); + stacks[0].insert(std::pair(ndist, tmp)); } else { - stacks[tmpflags+1].insert(make_pair(ndist, tmp)); + stacks[tmpflags + 1].insert(std::pair(ndist, tmp)); } } } @@ -2465,9 +2465,17 @@ NLMISC_COMMAND(setDefaultStart,"Set the default start point for all continents", CVectorD startPoint; - startPoint.x = atof(args[0].c_str()); - startPoint.y = atof(args[1].c_str()); - startPoint.z = (args.size() < 3 ? 0.0 : atof(args[2].c_str())); + NLMISC::fromString(args[0], startPoint.x); + NLMISC::fromString(args[1], startPoint.y); + + if (args.size() > 2) + { + NLMISC::fromString(args[2], startPoint.z); + } + else + { + startPoint.z = 0.0; + } DefaultStartPoint = startPoint; @@ -2921,13 +2929,15 @@ NLMISC_COMMAND(testPacsMove, "test a pacs move", " " if (args.size() != 5) return false; - CPacsCruncher pc; + CPacsCruncher pc; + + string name = args[0]; - string name = args[0]; - double x = atof(args[1].c_str()); - double y = atof(args[2].c_str()); - double dx = atof(args[3].c_str()); - double dy = atof(args[4].c_str()); + double x, y, dx, dy; + NLMISC::fromString(args[1], x); + NLMISC::fromString(args[2], y); + NLMISC::fromString(args[3], dx); + NLMISC::fromString(args[4], dy); pc.init(name); diff --git a/code/ryzom/server/src/ai_service/ai.cpp b/code/ryzom/server/src/ai_service/ai.cpp index 587e5ac0c..49144fa9d 100644 --- a/code/ryzom/server/src/ai_service/ai.cpp +++ b/code/ryzom/server/src/ai_service/ai.cpp @@ -224,7 +224,7 @@ uint32 CAIS::getEmotNumber(const std::string &name) { std::map::iterator it(_EmotNames.find(name)); if (it==_EmotNames.end()) - return ~0; + return std::numeric_limits::max(); return it->second; } @@ -280,7 +280,7 @@ uint32 CAIS::createAIInstance(const std::string &continentName, uint32 instanceN continue; nlwarning("CAIS::createAIInstance: instance number %u is already in use, can't create new instance.", instanceNumber); - return ~0; + return std::numeric_limits::max(); } CAIInstance *aii = _AIInstances.addChild(new CAIInstance(this)); diff --git a/code/ryzom/server/src/ai_service/ai.h b/code/ryzom/server/src/ai_service/ai.h index 4f9a7d802..57ff524ec 100644 --- a/code/ryzom/server/src/ai_service/ai.h +++ b/code/ryzom/server/src/ai_service/ai.h @@ -104,7 +104,7 @@ public: // classic init(), update() and release() /** create an AI instance, return the instance index in the AIList - * Return ~0 if the instance number is already in use. + * Return std::numeric_limits::max() if the instance number is already in use. */ uint32 createAIInstance(const std::string &continentName, uint32 instanceNumber); /** destroy an AI Instance (useful for ring creation / destruction of session) @@ -205,7 +205,7 @@ public: /// Time warp managment. This method is called when time as warped more than 600ms bool advanceUserTimer(uint32 nbTicks); - /// Retreive emot number given it's name, return ~0 if not found + /// Retreive emot number given it's name, return std::numeric_limits::max() if not found uint32 getEmotNumber(const std::string &name); CCont &AIList () { return _AIInstances; } @@ -243,7 +243,7 @@ public: class CCounter { public: - CCounter(const uint32 max=~0):_Total(0),_Max(max) + CCounter(const uint32 max=std::numeric_limits::max()):_Total(0),_Max(max) {} virtual ~CCounter() {} diff --git a/code/ryzom/server/src/ai_service/ai_bot_npc.cpp b/code/ryzom/server/src/ai_service/ai_bot_npc.cpp index cb183850e..201cc517c 100644 --- a/code/ryzom/server/src/ai_service/ai_bot_npc.cpp +++ b/code/ryzom/server/src/ai_service/ai_bot_npc.cpp @@ -714,9 +714,12 @@ void CBotNpc::sendVPA() // alternate VPA void CBotNpc::sendVisualProperties() // VisualPropertyA, B, C { - CMirrors::setVisualPropertyA( getSpawn()->dataSetRow(), _VisualPropertyA ); - CMirrors::setVisualPropertyB( getSpawn()->dataSetRow(), _VisualPropertyB ); - CMirrors::setVisualPropertyC( getSpawn()->dataSetRow(), _VisualPropertyC ); + if (getSpawn()) + { + CMirrors::setVisualPropertyA( getSpawn()->dataSetRow(), _VisualPropertyA ); + CMirrors::setVisualPropertyB( getSpawn()->dataSetRow(), _VisualPropertyB ); + CMirrors::setVisualPropertyC( getSpawn()->dataSetRow(), _VisualPropertyC ); + } } bool CBotNpc::reSpawn(bool sendMessage) @@ -875,9 +878,9 @@ Colors are something like that: 2: VERT CITRON VERT CITRON GREEN 3: VERT VERT TURQUOISE 4: BLEU BLEU BLUE -5: ROUGE fonce ROUGE (tout court) CRIMSON +5: ROUGE dark ROUGE (normal) CRIMSON 6: BLANC JAUNE WHITE -7: NOIR BLEU tres fonce BLACK +7: NOIR BLEU very dark BLACK 3D column is (probably) used for equipment */ diff --git a/code/ryzom/server/src/ai_service/ai_entity_physical.h b/code/ryzom/server/src/ai_service/ai_entity_physical.h index c3a8fa966..5eb30b34f 100644 --- a/code/ryzom/server/src/ai_service/ai_entity_physical.h +++ b/code/ryzom/server/src/ai_service/ai_entity_physical.h @@ -55,7 +55,9 @@ template class CTargetable { #ifdef NL_OS_WINDOWS - friend class CTargetable; +# ifndef NL_COMP_MINGW + friend class CTargetable; +# endif #endif public: typedef NLMISC::CDbgPtr TPtr; diff --git a/code/ryzom/server/src/ai_service/ai_generic_fight.cpp b/code/ryzom/server/src/ai_service/ai_generic_fight.cpp index a19f747c3..f4c9a5cb0 100644 --- a/code/ryzom/server/src/ai_service/ai_generic_fight.cpp +++ b/code/ryzom/server/src/ai_service/ai_generic_fight.cpp @@ -571,7 +571,7 @@ bool CFightOrganizer::reorganizeIteration(CBot* bot) ennemy=entity; } } - entity->_ChooseLastTime=~0; + entity->_ChooseLastTime = std::numeric_limits::max(); } if (fleeEnnemy==NULL && !spawnBot->getUnreachableTarget().isNULL()) diff --git a/code/ryzom/server/src/ai_service/ai_grp_fauna.cpp b/code/ryzom/server/src/ai_service/ai_grp_fauna.cpp index 2bab5200d..6cd657ff2 100644 --- a/code/ryzom/server/src/ai_service/ai_grp_fauna.cpp +++ b/code/ryzom/server/src/ai_service/ai_grp_fauna.cpp @@ -220,7 +220,7 @@ void CSpawnGroupFauna::update() getPersistent().updateStateInstance(); - if (_CurrentCycle==~0) + if (_CurrentCycle==std::numeric_limits::max()) return; // Respawn @@ -606,9 +606,9 @@ CGrpFauna::CGrpFauna(CMgrFauna* mgr, CAIAliasDescriptionNode* aliasTree, RYAI_MA // state - _CurPopulation = ~0u; + _CurPopulation = std::numeric_limits::max(); - _CurrentCycle = ~0; + _CurrentCycle = std::numeric_limits::max(); // default values. setTimer(EAT_TIME, refTimer(EAT_TIME)); @@ -699,9 +699,9 @@ CAliasTreeOwner* CGrpFauna::createChild(IAliasCont* cont, CAIAliasDescriptionNod CAIPlaceXYRFauna *faunaPlace = new CAIPlaceXYRFauna(this, aliasTree); child = faunaPlace; uint placeIndex = faunaPlace->setupFromOldName(name); - nlassert(placeIndex!=~0); + nlassert(placeIndex!=std::numeric_limits::max()); - if (placeIndex!=~0) + if (placeIndex!=std::numeric_limits::max()) cont->addAliasChild(child, placeIndex); return child; @@ -769,7 +769,7 @@ bool CGrpFauna::spawn() return false; setStartState(getStartState()); // stateInstance. - return spawnPop(~0); + return spawnPop(std::numeric_limits::max()); } bool CGrpFauna::timeAllowSpawn(uint32 popVersion) const @@ -841,7 +841,7 @@ bool CGrpFauna::spawnPop(uint popVersion) } // check the validity of the input parameter - if (popVersion!=~0 && popVersion>=_Populations.size()) + if (popVersion!=std::numeric_limits::max() && popVersion>=_Populations.size()) { nlwarning("CGrpFauna::spawn(idx) FAILED for group %s because idx (%d) >= _Populations.size() (%d)",this->CGroup::getFullName().c_str(),popVersion,_Populations.size()); return false; diff --git a/code/ryzom/server/src/ai_service/ai_grp_npc.cpp b/code/ryzom/server/src/ai_service/ai_grp_npc.cpp index 937a6f421..056293a25 100644 --- a/code/ryzom/server/src/ai_service/ai_grp_npc.cpp +++ b/code/ryzom/server/src/ai_service/ai_grp_npc.cpp @@ -59,7 +59,7 @@ CSpawnGroupNpc::CSpawnGroupNpc(CPersistent& owner) _LastUpdate = (randomVal>=0)?randomVal:CTimeInterface::gameCycle(); _LastBotUpdate = CTimeInterface::gameCycle(); activityProfile().setAIProfile(new CGrpProfileNormal(this)); - _BotUpdateTimer.set((CAIS::rand32(40)+((long)this>>2))%20); // start with a random value. + _BotUpdateTimer.set((CAIS::rand32(40)+((intptr_t)this>>2))%20); // start with a random value. resetSlowUpdateCycle(); _DespawnBotsWhenNoMoreHandleTimerActive = false; } diff --git a/code/ryzom/server/src/ai_service/ai_vector_mirror.h b/code/ryzom/server/src/ai_service/ai_vector_mirror.h index 0464de4fb..da229b4c3 100644 --- a/code/ryzom/server/src/ai_service/ai_vector_mirror.h +++ b/code/ryzom/server/src/ai_service/ai_vector_mirror.h @@ -95,7 +95,7 @@ public: // Methods. inline double distTo(const CAIVectorMirror &dest) const; inline double distSqTo(const CAIVectorMirror &dest) const; inline double quickDistTo(const CAIVectorMirror &dest) const; - + protected: inline void setX(const CAICoord &x) { _x=x; } inline void setY(const CAICoord &y) { _y=y; } diff --git a/code/ryzom/server/src/ai_service/child_container.h b/code/ryzom/server/src/ai_service/child_container.h index ab98d93af..0b5c79c4e 100644 --- a/code/ryzom/server/src/ai_service/child_container.h +++ b/code/ryzom/server/src/ai_service/child_container.h @@ -495,7 +495,7 @@ uint32 CAliasCont::getChildIndexByAlias(uint32 alias) const if (child!=NULL && child->getAlias()==alias) return (uint32)i; } - return ~0; + return std::numeric_limits::max(); } template diff --git a/code/ryzom/server/src/ai_service/commands.cpp b/code/ryzom/server/src/ai_service/commands.cpp index d257d0492..641503b70 100644 --- a/code/ryzom/server/src/ai_service/commands.cpp +++ b/code/ryzom/server/src/ai_service/commands.cpp @@ -229,8 +229,9 @@ NLMISC_COMMAND(eventCreateNpcGroup, "create an event npc group", " return true; } - double x = atof(args[3].c_str()); - double y = atof(args[4].c_str()); + double x, y; + NLMISC::fromString(args[3], x); + NLMISC::fromString(args[4], y); double dispersionRadius = 10.; if (args.size()>5) @@ -577,10 +578,10 @@ NLMISC_COMMAND(createStaticAIInstance, "Create a new static AIInstance for a giv CUsedContinent &uc = CUsedContinent::instance(); const uint32 in = uc.getInstanceForContinent(args[0]); - if (in == ~0) + if (in == INVALID_AI_INSTANCE) { nlwarning("The continent '%s' is unknow or not active. Can't create instance, FATAL", args[0].c_str()); - nlassert(in != ~0); + nlassert(in != INVALID_AI_INSTANCE); // nlassertex(in != ~0, ("The continent '%s' is unknow or not active. Can't create instance, FATAL", args[0].c_str())); } @@ -1969,9 +1970,13 @@ NLMISC_COMMAND(displayVision3x3,"display 3x3 cell vision centred on a given coor } } + double dx, dy; + NLMISC::fromString(args[1], dx); + NLMISC::fromString(args[2], dy); + CAICoord x, y; - x=atof(args[1].c_str()); - y=atof(args[2].c_str()); + x = dx; + y = dy; log.displayNL("3x3 Vision around (%.3f,%.3f)", x.asDouble(), y.asDouble()); uint32 botCount=0; diff --git a/code/ryzom/server/src/ai_service/continent_inline.h b/code/ryzom/server/src/ai_service/continent_inline.h index 49c21248e..4ddf09c18 100644 --- a/code/ryzom/server/src/ai_service/continent_inline.h +++ b/code/ryzom/server/src/ai_service/continent_inline.h @@ -695,7 +695,7 @@ static CAIVector randomPos(double dispersionRadius) { return CAIVector(0., 0.); } - uint32 const maxLimit=((uint32)~0U)>>1; + uint32 const maxLimit=(std::numeric_limits::max())>>1; double rval = (double)CAIS::rand32(maxLimit)/(double)maxLimit; // [0-1[ double r = dispersionRadius*sqrt(rval); rval = (double)CAIS::rand32(maxLimit)/(double)maxLimit; // [0-1[ diff --git a/code/ryzom/server/src/ai_service/event_manager.h b/code/ryzom/server/src/ai_service/event_manager.h index ab49b8d68..731539051 100644 --- a/code/ryzom/server/src/ai_service/event_manager.h +++ b/code/ryzom/server/src/ai_service/event_manager.h @@ -17,6 +17,8 @@ #ifndef RYAI_EVENT_MANAGER_H #define RYAI_EVENT_MANAGER_H +#include + #include "event_reaction.h" #include "states.h" diff --git a/code/ryzom/server/src/ai_service/family_behavior.h b/code/ryzom/server/src/ai_service/family_behavior.h index 893282ae0..52d534e1c 100644 --- a/code/ryzom/server/src/ai_service/family_behavior.h +++ b/code/ryzom/server/src/ai_service/family_behavior.h @@ -210,7 +210,7 @@ class CFamilyBehavior void spawnBoss(NLMISC::TStringId outpostName); - uint32 energyScale (uint32 levelIndex=~0) const; + uint32 energyScale (uint32 levelIndex=std::numeric_limits::max()) const; void setModifier (const float &value, const uint32 &index) { diff --git a/code/ryzom/server/src/ai_service/generic_logic_action.cpp b/code/ryzom/server/src/ai_service/generic_logic_action.cpp index afd0f9b3c..e2c761619 100644 --- a/code/ryzom/server/src/ai_service/generic_logic_action.cpp +++ b/code/ryzom/server/src/ai_service/generic_logic_action.cpp @@ -1407,13 +1407,12 @@ public: return false; } - // check if its a number or a var. - //TODO: et les variables negatives? + // check if it's a number or a var. + //TODO: and negative values ? if ((str[0]<='9' && str[0]>='0')||(str[0]=='-')) // its a number { var.Type = constant; - double val = atof(str.c_str()); - var.Value = float(val); + NLMISC::fromString(str, var.Value); return true; } diff --git a/code/ryzom/server/src/ai_service/nf_helpers.h b/code/ryzom/server/src/ai_service/nf_helpers.h index 2b8ead4e6..dc9c7c345 100644 --- a/code/ryzom/server/src/ai_service/nf_helpers.h +++ b/code/ryzom/server/src/ai_service/nf_helpers.h @@ -161,7 +161,7 @@ public: if (_value==-1) // not for affectation. return; - if (_index==~0) // all indexs ? + if (_index==std::numeric_limits::max()) // all indexs ? { for (uint32 nrjIndex=0;nrjIndex<4;nrjIndex++) fb->setModifier (_value, nrjIndex); diff --git a/code/ryzom/server/src/ai_service/path_behaviors.h b/code/ryzom/server/src/ai_service/path_behaviors.h index 8c509ae9d..6684b2db3 100644 --- a/code/ryzom/server/src/ai_service/path_behaviors.h +++ b/code/ryzom/server/src/ai_service/path_behaviors.h @@ -168,11 +168,11 @@ public: // - This method adds the new object to the top of the CFollowPath singleton's context stack // parameters: // - contextName : an arbitrary string naming the context - // - maxSearchDepth : the value that the path finder search depth should be limitted to (default to ~0u meaning no limit) + // - maxSearchDepth : the value that the path finder search depth should be limitted to (default to std::numeric_limits::max() meaning no limit) // - forceMaxDepth : set this flag true to override previous limit with larger value // example: - // - ... Before we begin ... CFollowPath::_MaxSearchDepth = ~0u - // - CFollowPathContext context1("tata") : CFollowPath::_MaxSearchDepth => ~0u + // - ... Before we begin ... CFollowPath::_MaxSearchDepth = std::numeric_limits::max() + // - CFollowPathContext context1("tata") : CFollowPath::_MaxSearchDepth => std::numeric_limits::max() // - CFollowPathContext context2("tete",456) : CFollowPath::_MaxSearchDepth => 456 // - CFollowPathContext context3("titi",123) : CFollowPath::_MaxSearchDepth => 123 // - CFollowPathContext context4("toto",456) : CFollowPath::_MaxSearchDepth => 123 @@ -182,9 +182,9 @@ public: // - CFollowPathContext context5.~CFollowPathContext() : CFollowPath::_MaxSearchDepth => 123 // - CFollowPathContext context4.~CFollowPathContext() : CFollowPath::_MaxSearchDepth => 123 // - CFollowPathContext context3.~CFollowPathContext() : CFollowPath::_MaxSearchDepth => 456 - // - CFollowPathContext context2.~CFollowPathContext() : CFollowPath::_MaxSearchDepth => ~0u - // - CFollowPathContext context1.~CFollowPathContext() : CFollowPath::_MaxSearchDepth => ~0u - CFollowPathContext(const char* contextName, uint32 maxSearchDepth=~0u, bool forceMaxDepth=false); + // - CFollowPathContext context2.~CFollowPathContext() : CFollowPath::_MaxSearchDepth => std::numeric_limits::max() + // - CFollowPathContext context1.~CFollowPathContext() : CFollowPath::_MaxSearchDepth => std::numeric_limits::max() + CFollowPathContext(const char* contextName, uint32 maxSearchDepth=std::numeric_limits::max(), bool forceMaxDepth=false); // dtor // - This method removes the destroyed object from the CFollowPath singleton's context stack @@ -270,7 +270,7 @@ private: friend class CFollowPathContext; CFollowPathContext* _TopFollowPathContext; public: - uint32 getMaxSearchDepth() const { return (_TopFollowPathContext==NULL)? ~0u: _TopFollowPathContext->getMaxSearchDepth(); } + uint32 getMaxSearchDepth() const { return (_TopFollowPathContext==NULL)? std::numeric_limits::max(): _TopFollowPathContext->getMaxSearchDepth(); } const char* getContextName() const; }; diff --git a/code/ryzom/server/src/ai_service/service_main.cpp b/code/ryzom/server/src/ai_service/service_main.cpp index 4bdb2c766..130ea1acb 100644 --- a/code/ryzom/server/src/ai_service/service_main.cpp +++ b/code/ryzom/server/src/ai_service/service_main.cpp @@ -38,7 +38,9 @@ #include "ais_user_models.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #endif // NL_OS_WINDOWS diff --git a/code/ryzom/server/src/ai_service/sheets.cpp b/code/ryzom/server/src/ai_service/sheets.cpp index bc7ece4fa..8369023e0 100644 --- a/code/ryzom/server/src/ai_service/sheets.cpp +++ b/code/ryzom/server/src/ai_service/sheets.cpp @@ -581,7 +581,7 @@ void AISHEETS::CCreature::readGeorges(NLMISC::CSmartPtr const& } if (item.getValueByName(s, "Basics.FameForGuardAttack") && !s.empty()) { - double tmp; + float tmp; sscanf(s.c_str(), "%f", &tmp); _FameForGuardAttack = (sint32)tmp; } diff --git a/code/ryzom/server/src/ai_service/state_instance.h b/code/ryzom/server/src/ai_service/state_instance.h index 94755c143..3ad6e6d55 100644 --- a/code/ryzom/server/src/ai_service/state_instance.h +++ b/code/ryzom/server/src/ai_service/state_instance.h @@ -185,7 +185,7 @@ protected: CAITimerExtended _StateTimeout; /// current state (index into manager's state vector) CAIState* _state; - /// variable set to request a state change (~0 otherwise) + /// variable set to request a state change (std::numeric_limits::max() otherwise) CAIState* _NextState; /// timer for timing punctual states diff --git a/code/ryzom/server/src/ai_service/stdpch.h b/code/ryzom/server/src/ai_service/stdpch.h index d0978b2f7..5ad1d5f28 100644 --- a/code/ryzom/server/src/ai_service/stdpch.h +++ b/code/ryzom/server/src/ai_service/stdpch.h @@ -191,7 +191,9 @@ namespace MULTI_LINE_FORMATER { #include "ai_share/world_map.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #endif // NL_OS_WINDOWS diff --git a/code/ryzom/server/src/ai_share/16x16_layer.cpp b/code/ryzom/server/src/ai_share/16x16_layer.cpp index c820e4f7b..4e78cf54e 100644 --- a/code/ryzom/server/src/ai_share/16x16_layer.cpp +++ b/code/ryzom/server/src/ai_share/16x16_layer.cpp @@ -100,7 +100,7 @@ I16x16Layer *I16x16Layer::compress(I16x16Layer *layer, sint32 blank) map::iterator it = count.find(val); if (it == count.end()) - count.insert(make_pair(val, 1)); + count.insert(std::pair(val, 1)); else ++((*it).second); } diff --git a/code/ryzom/server/src/ai_share/aids_messages.h b/code/ryzom/server/src/ai_share/aids_messages.h index 7ef43817b..734acbec3 100644 --- a/code/ryzom/server/src/ai_share/aids_messages.h +++ b/code/ryzom/server/src/ai_share/aids_messages.h @@ -97,16 +97,16 @@ class CMsgAIFeedback : public NLNET::CTransportClass public: std::string Message; - CMsgAIFeedback() + CMsgAIFeedback() { } - CMsgAIFeedback(std::string message) + CMsgAIFeedback(const std::string &message) { Message=message; } - CMsgAIFeedback(char *msgStr) + CMsgAIFeedback(const char *msgStr) { Message=std::string(msgStr); } @@ -120,6 +120,5 @@ public: virtual void callback (const std::string &name, NLNET::TServiceId id); }; - #endif diff --git a/code/ryzom/server/src/ai_share/primitive_parser.cpp b/code/ryzom/server/src/ai_share/primitive_parser.cpp index 892120902..dd52b4d7a 100644 --- a/code/ryzom/server/src/ai_share/primitive_parser.cpp +++ b/code/ryzom/server/src/ai_share/primitive_parser.cpp @@ -4176,7 +4176,7 @@ NLMISC_COMMAND(loadMap,"load a complete set of primitive files","") // check that the continent is active CUsedContinent &uc = CUsedContinent::instance(); uint32 in = uc.getInstanceForContinent(continentName); - if (in == ~0) + if (in == INVALID_AI_INSTANCE) { log.displayNL("loadMap : while loading map '%s', can't load primitive '%s' coz continent '%s' is not active", args[0].c_str(), @@ -4216,7 +4216,7 @@ NLMISC_COMMAND(unloadMap,"unload a complete set of primitive files","" // check that the continent is active CUsedContinent &uc = CUsedContinent::instance(); uint32 in = uc.getInstanceForContinent(continentName); - if (in == ~0) + if (in == INVALID_AI_INSTANCE) { log.displayNL("unloadMap : while loading map '%s', can't load primitive '%s' coz continent '%s' is not active", args[0].c_str(), diff --git a/code/ryzom/server/src/ai_share/world_map.cpp b/code/ryzom/server/src/ai_share/world_map.cpp index eae84acbf..f468c1144 100644 --- a/code/ryzom/server/src/ai_share/world_map.cpp +++ b/code/ryzom/server/src/ai_share/world_map.cpp @@ -1469,7 +1469,7 @@ bool CWorldMap::findAStarPath(CWorldPosition const& start, CWorldPosition const& uint father = (uint)nodes.size()-1; // Add start topology to visited nodes (father holds start topo node index for the moment) - visited.insert(make_pair(startTopo, father)); + visited.insert(std::pair(startTopo, father)); // Push start node in the heap with a zero cost heap.push(0.0f, father); @@ -1562,7 +1562,7 @@ bool CWorldMap::findAStarPath(CWorldPosition const& start, CWorldPosition const& // Add node to heap with a computed f(n)=g(n)+h(n) heap.push(distance + heuristic, child); // Add node to visited - visited.insert(make_pair(next, child)); + visited.insert(std::pair(next, child)); } } @@ -1633,7 +1633,7 @@ bool CWorldMap::findAStarPath(const CTopology::TTopologyId &start, const CTopolo uint father = (uint)nodes.size()-1; // add current to visited nodes - visited.insert(make_pair(startTopo, father)); + visited.insert(std::pair(startTopo, father)); heap.push(0.0f, father); bool found=false; @@ -1699,7 +1699,7 @@ bool CWorldMap::findAStarPath(const CTopology::TTopologyId &start, const CTopolo // add node to visited and to heap heap.push(heuristic, child); - visited.insert(make_pair(next, child)); + visited.insert(std::pair(next, child)); } } @@ -1767,7 +1767,7 @@ bool CWorldMap::findInsideAStarPath(CWorldPosition const& start, CWorldPosition uint father = (uint)nodes.size()-1; // Add start node to visited nodes (father holds start node index for the moment) - visited.insert(make_pair(startNode, father)); + visited.insert(std::pair(startNode, father)); // Push start node in the heap with a zero cost heap.push(0.0f, father); @@ -1854,7 +1854,7 @@ bool CWorldMap::findInsideAStarPath(CWorldPosition const& start, CWorldPosition // Add node to heap with a computed f(n)=g(n)+h(n) heap.push(distance + heuristic, child); // Add node to visited - visited.insert(make_pair(next, child)); + visited.insert(std::pair(next, child)); } } diff --git a/code/ryzom/server/src/backup_service/backup_service.cpp b/code/ryzom/server/src/backup_service/backup_service.cpp index 698cbc02f..95c11d07a 100644 --- a/code/ryzom/server/src/backup_service/backup_service.cpp +++ b/code/ryzom/server/src/backup_service/backup_service.cpp @@ -30,7 +30,9 @@ #include "web_connection.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #endif // NL_OS_WINDOWS @@ -716,7 +718,7 @@ void CBackupService::init() BSIsSlave = true; FileManager.forbidStall(); // I'm a slave, try to contact master - string host = MasterBSHost; + string host = MasterBSHost.get(); if (host.find (":") == string::npos) host += ":49990"; diff --git a/code/ryzom/server/src/backup_service/web_connection.cpp b/code/ryzom/server/src/backup_service/web_connection.cpp index 86a62902d..6afa8f885 100644 --- a/code/ryzom/server/src/backup_service/web_connection.cpp +++ b/code/ryzom/server/src/backup_service/web_connection.cpp @@ -209,10 +209,10 @@ void cbGetSaveList(CMemStream &msgin, TSockId host) explode(str, string("%%"), params, true); - string incrementalDir = IncrementalBackupDirectory; - string saveShardRoot = SaveShardRoot; - string templatePath = SaveTemplatePath; - string extList = SaveExtList; + string incrementalDir = IncrementalBackupDirectory.get(); + string saveShardRoot = SaveShardRoot.get(); + string templatePath = SaveTemplatePath.get(); + string extList = SaveExtList.get(); string shard; string userid; @@ -293,8 +293,8 @@ void cbRestoreSave(CMemStream &msgin, TSockId host) explode(str, string("%%"), params, true); - string saveShardRoot = SaveShardRoot; - string templatePath = SaveTemplatePath; + string saveShardRoot = SaveShardRoot.get(); + string templatePath = SaveTemplatePath.get(); string shard; string userid; @@ -368,9 +368,9 @@ void cbCopyOverSave(CMemStream &msgin, TSockId host) explode(str, string("%%"), params, true); - string saveShardRoot = SaveShardRoot; - string templatePath = SaveTemplatePath; - string extList = SaveExtList; + string saveShardRoot = SaveShardRoot.get(); + string templatePath = SaveTemplatePath.get(); + string extList = SaveExtList.get(); string shard; string userid; diff --git a/code/ryzom/server/src/dynamic_scenario_service/dynamic_scenario_service.h b/code/ryzom/server/src/dynamic_scenario_service/dynamic_scenario_service.h index 8d1685796..8e5efb487 100644 --- a/code/ryzom/server/src/dynamic_scenario_service/dynamic_scenario_service.h +++ b/code/ryzom/server/src/dynamic_scenario_service/dynamic_scenario_service.h @@ -54,14 +54,6 @@ public: // Release the service void release (); - void addTestClient(const std::string & clientId); - - void removeTestClient(const std::string & clientId); - - void listTestClient() const; - - void runTestClientLuaScript(const std::string & clientId, const std::string & cmd); - static R2::CDynamicScenarioService & instance() { return (CDynamicScenarioService&)*IService::getInstance(); } diff --git a/code/ryzom/server/src/dynamic_scenario_service/service.cpp b/code/ryzom/server/src/dynamic_scenario_service/service.cpp index 342a05c23..07c454566 100644 --- a/code/ryzom/server/src/dynamic_scenario_service/service.cpp +++ b/code/ryzom/server/src/dynamic_scenario_service/service.cpp @@ -56,8 +56,6 @@ namespace R2 // The ligo config NLLIGO::CLigoConfig* LigoConfigPtr; CR2LigoConfig R2LigoConfig; - - } diff --git a/code/ryzom/server/src/entities_game_service/CMakeLists.txt b/code/ryzom/server/src/entities_game_service/CMakeLists.txt index d57ff9302..15e7794a4 100644 --- a/code/ryzom/server/src/entities_game_service/CMakeLists.txt +++ b/code/ryzom/server/src/entities_game_service/CMakeLists.txt @@ -111,8 +111,8 @@ NL_ADD_RUNTIME_FLAGS(ryzom_entities_game_service) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -IF(WITH_PCH) +IF(WITH_PCH AND NOT MINGW) # FIXME: PCH too large (> 130MB), crashes cc1plus under MinGW ADD_NATIVE_PRECOMPILED_HEADER(ryzom_entities_game_service ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) -ENDIF(WITH_PCH) +ENDIF(WITH_PCH AND NOT MINGW) INSTALL(TARGETS ryzom_entities_game_service RUNTIME DESTINATION sbin COMPONENT services) diff --git a/code/ryzom/server/src/entities_game_service/admin.cpp b/code/ryzom/server/src/entities_game_service/admin.cpp index 20941e77f..22254c64b 100644 --- a/code/ryzom/server/src/entities_game_service/admin.cpp +++ b/code/ryzom/server/src/entities_game_service/admin.cpp @@ -420,7 +420,7 @@ bool getAIInstanceFromGroupName(string& groupName, uint32& instanceNumber) { string continent = groupName.substr(0, groupName.find('@')); uint32 nr = CUsedContinent::instance().getInstanceForContinent(continent); - if (nr == ~0) + if (nr == INVALID_AI_INSTANCE) { return false; } @@ -4821,9 +4821,9 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", " getSlotCount(); ++ i) { const CGameItemPtr itemPtr = inventory->getItem(i); - if( itemPtr != NULL ) + if ( itemPtr != NULL ) { - if( (itemPtr->getSheetId() == sheetId) && (itemPtr->quality() == quality) ) + if ( (itemPtr->getSheetId() == sheetId) && (itemPtr->quality() == quality) ) { numberItem += itemPtr->getStackSize(); } @@ -4841,9 +4841,9 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", " getSlotCount(); ++ i) { const CGameItemPtr itemPtr = inventory->getItem(i); - if( itemPtr != NULL ) + if ( itemPtr != NULL ) { - if( (itemPtr->getSheetId() == sheetId) && (itemPtr->quality() == quality) ) + if ( (itemPtr->getSheetId() == sheetId) && (itemPtr->quality() == quality) ) { numberItem -= inventory->deleteStackItem(i, quantity); if(numberItem == 0) @@ -5053,7 +5053,8 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", " getType()) + + if (creature == NULL || creatureSheetId == CSheetId::Unknown || creatureSheetId != creature->getType()) { if (send_url) c->sendUrl(web_app_url+"&player_eid="+c->getId().toString()+"&event=failed&desc=bad_sheet", getSalt()); @@ -5686,7 +5687,7 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", " getHomeMainlandSessionId(), value)); - if (entityBase == 0) + if (entityBase == NULL) { // try to find the bot name vector aliases; @@ -5711,7 +5712,7 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", " getState().X + sint32 (cos (entityBase->getState ().Heading) * 2000); y = entityBase->getState().Y + sint32 (sin (entityBase->getState ().Heading) * 2000); diff --git a/code/ryzom/server/src/entities_game_service/character_structure/character_persistant_data.h b/code/ryzom/server/src/entities_game_service/character_structure/character_persistant_data.h index 2cfa59660..a685e26b3 100644 --- a/code/ryzom/server/src/entities_game_service/character_structure/character_persistant_data.h +++ b/code/ryzom/server/src/entities_game_service/character_structure/character_persistant_data.h @@ -26,7 +26,6 @@ #include "character_structure/pact_class.h" #include "character_structure/character_sentence.h" -#include "character_structure/known_brick_info.h" #include "game_item_manager/game_item.h" /** @@ -73,7 +72,7 @@ public: //std::vector< CCharacterSentence * > _MemorizedSentencesSpecial; /// inventory of known bricks (map Id to Latency end date) - std::map< NLMISC::CSheetId, CKnownBrickInfo > _KnownBricks; + //std::map< NLMISC::CSheetId, CKnownBrickInfo > _KnownBricks; /// the known faber plans for that player (directly the reflect of the database) // std::vector _KnownFaberPlans; diff --git a/code/ryzom/server/src/entities_game_service/character_structure/known_brick_info.h b/code/ryzom/server/src/entities_game_service/character_structure/known_brick_info.h deleted file mode 100644 index 6cff4b92c..000000000 --- a/code/ryzom/server/src/entities_game_service/character_structure/known_brick_info.h +++ /dev/null @@ -1,49 +0,0 @@ -// Ryzom - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - - - -#ifndef RY_KNOWN_BRICK_INFO_H -#define RY_KNOWN_BRICK_INFO_H - -// --------------------------------------------------------------------------- -class CStaticGameBrick; - -// --------------------------------------------------------------------------- -struct CKnownBrickInfo -{ - const CStaticGameBrick* Form; - uint32 LatencyEndDate; - bool OldLatentState; - - CKnownBrickInfo( const CStaticGameBrick *form = NULL ) : Form(form) - { - LatencyEndDate = 0; - OldLatentState = false; - } - - /// Serialisation - void serial(class NLMISC::IStream &f) throw(NLMISC::EStream) - { - // f.serial( LatencyEndDate ); - // f.serial( OldLatentState ); - // nothing to serial here, the date are no longer meaningful, all bricks are available when the character connects to the game - // and the Form is set while setting the databse in the setDatabase() method - } -}; - -#endif // RY_KNOWN_BRICK_INFO_H -/* known_brick_info.h */ diff --git a/code/ryzom/server/src/entities_game_service/creature_manager/harvestable.h b/code/ryzom/server/src/entities_game_service/creature_manager/harvestable.h index cd1ecfd06..f966e6cb0 100644 --- a/code/ryzom/server/src/entities_game_service/creature_manager/harvestable.h +++ b/code/ryzom/server/src/entities_game_service/creature_manager/harvestable.h @@ -188,7 +188,7 @@ protected: /// the harvestable Mps (4 per entity) std::vector< CCreatureRawMaterial> _Mps; - /// pointer on the harverting character + /// pointer on the harvesting character TDataSetRow _HarvesterRowId; /// skill used to harvest this creature diff --git a/code/ryzom/server/src/entities_game_service/database_plr.cpp b/code/ryzom/server/src/entities_game_service/database_plr.cpp index 58631a86a..4b5fa84fd 100644 --- a/code/ryzom/server/src/entities_game_service/database_plr.cpp +++ b/code/ryzom/server/src/entities_game_service/database_plr.cpp @@ -3140,7 +3140,7 @@ void CBankAccessor_PLR::TPACK_ANIMAL::TBEAST::init(ICDBStructNode *parent, uint nlassert(node != NULL); _DESPAWN = node; - node = parent->getNode( ICDBStructNode::CTextId("NAME"), true ); + node = parent->getNode( ICDBStructNode::CTextId("NAME"), false ); nlassert(node != NULL); _NAME = node; diff --git a/code/ryzom/server/src/entities_game_service/database_plr.h b/code/ryzom/server/src/entities_game_service/database_plr.h index bd431a108..67e0f7798 100644 --- a/code/ryzom/server/src/entities_game_service/database_plr.h +++ b/code/ryzom/server/src/entities_game_service/database_plr.h @@ -15,8 +15,8 @@ // along with this program. If not, see . -#ifndef INCLUDED_database_PLR_H -#define INCLUDED_database_PLR_H +#ifndef INCLUDED_DATABASE_PLR_H +#define INCLUDED_DATABASE_PLR_H ///////////////////////////////////////////////////////////////// // WARNING : this is a generated file, don't change it ! ///////////////////////////////////////////////////////////////// @@ -140,7 +140,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C class TGameTime - { + { public: @@ -183,7 +183,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TINTERFACES - { + { public: @@ -247,11 +247,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TUSER - { + { public: class TSKILL_POINTS_ - { + { public: @@ -294,7 +294,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TFACTION_POINTS_ - { + { public: @@ -337,7 +337,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TRRPS_LEVELS - { + { public: @@ -380,7 +380,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TNPC_CONTROL - { + { public: @@ -490,7 +490,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C ICDBStructNode *_IS_NEWBIE; ICDBStructNode *_IS_TRIAL; ICDBStructNode *_DEFAULT_WEIGHT_HANDS; - ICDBStructNode *_IS_INVISIBLE; + ICDBStructNode *_IS_INVISIBLE; ICDBStructNode *_COUNTER; TSKILL_POINTS_ _SKILL_POINTS_[4]; TFACTION_POINTS_ _FACTION_POINTS_[6]; @@ -954,6 +954,24 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C return _DEFAULT_WEIGHT_HANDS; } + void setIS_INVISIBLE(CCDBSynchronised &dbGroup, bool value, bool forceSending = false) + { + _setProp(dbGroup, _IS_INVISIBLE, value, forceSending); + } + + bool getIS_INVISIBLE(const CCDBSynchronised &dbGroup) + { + bool value; + _getProp(dbGroup, _IS_INVISIBLE, value); + + return value; + } + + ICDBStructNode *getIS_INVISIBLECDBNode() + { + return _IS_INVISIBLE; + } + void setCOUNTER(CCDBSynchronised &dbGroup, uint8 value, bool forceSending = false) { @@ -976,20 +994,6 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C { return _COUNTER; } - - void setIS_INVISIBLE(CCDBSynchronised &dbGroup, bool value, bool forceSending = false) - { - _setProp(dbGroup, _IS_INVISIBLE, value, forceSending); - } - - bool getIS_INVISIBLE(const CCDBSynchronised &dbGroup) - { - bool value; - _getProp(dbGroup, _IS_INVISIBLE, value); - - return value; - } - TSKILL_POINTS_ &getSKILL_POINTS_(uint32 index) { nlassert(index < 4); @@ -1013,15 +1017,15 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TDEFENSE - { + { public: class TSLOTS - { + { public: class TArray - { + { public: @@ -1156,15 +1160,15 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TFLAGS - { + { public: class TBRICK_TICK_RANGE - { + { public: class TArray - { + { public: @@ -1316,13 +1320,13 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C } }; - + class TTARGET - { + { public: class TBARS - { + { public: @@ -1482,15 +1486,15 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TCONTEXT_MENU - { + { public: class TMISSIONS_OPTIONS - { + { public: class TArray - { + { public: @@ -1602,11 +1606,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TMISSION_RING - { + { public: class TArray - { + { public: @@ -1927,11 +1931,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TGROUP - { + { public: class TArray - { + { public: @@ -2109,19 +2113,19 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TMISSIONS - { + { public: class TArray - { + { public: class TGOALS - { + { public: class TArray - { + { public: @@ -2209,7 +2213,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TTARGET - { + { public: @@ -2294,11 +2298,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class THISTO - { + { public: class TArray - { + { public: @@ -2716,7 +2720,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TDM_GIFT - { + { public: @@ -2759,15 +2763,15 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TEXCHANGE - { + { public: class TGIVE - { + { public: class TArray - { + { public: @@ -3062,11 +3066,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TRECEIVE - { + { public: class TArray - { + { public: @@ -3540,15 +3544,15 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TINVENTORY - { + { public: class THAND - { + { public: class TArray - { + { public: @@ -3618,11 +3622,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TEQUIP - { + { public: class TArray - { + { public: @@ -3692,11 +3696,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TTEMP - { + { public: class TArray - { + { public: @@ -4033,11 +4037,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TSHARE - { + { public: class TArray - { + { public: @@ -4377,7 +4381,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TTM_ - { + { public: @@ -4504,7 +4508,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TROOM - { + { public: @@ -4575,6 +4579,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C { uint64 value; _getProp(dbGroup, _MONEY, value); + return value; } @@ -4669,15 +4674,15 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TMODIFIERS - { + { public: class TBONUS - { + { public: class TArray - { + { public: @@ -4786,11 +4791,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TMALUS - { + { public: class TArray - { + { public: @@ -4948,11 +4953,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TDISABLE_CONSUMABLE - { + { public: class TArray - { + { public: @@ -5040,15 +5045,15 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TBOTCHAT - { + { public: class TDM_CHOICE - { + { public: class TArray - { + { public: @@ -5310,11 +5315,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TASCENSOR - { + { public: class TArray - { + { public: @@ -5468,11 +5473,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TCHOOSE_MISSIONS - { + { public: class TArray - { + { public: @@ -5668,11 +5673,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TTRADING - { + { public: class TArray - { + { public: @@ -6466,11 +6471,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TBRICK_FAMILY - { + { public: class TArray - { + { public: @@ -6537,11 +6542,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TFABER_PLANS - { + { public: class TArray - { + { public: @@ -6608,19 +6613,19 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TMISSIONS - { + { public: class TArray - { + { public: class TGOALS - { + { public: class TArray - { + { public: @@ -6708,7 +6713,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TTARGET - { + { public: @@ -6793,11 +6798,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class THISTO - { + { public: class TArray - { + { public: @@ -7138,15 +7143,15 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TEXECUTE_PHRASE - { + { public: class TLINK - { + { public: class TArray - { + { public: @@ -7512,11 +7517,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TCHARACTER_INFO - { + { public: class TCHARACTERISTICS - { + { public: @@ -7562,7 +7567,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TSCORES - { + { public: @@ -7680,11 +7685,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TMAGIC_RESISTANCE - { + { public: class TArray - { + { public: @@ -7778,11 +7783,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TMAGIC_PROTECTION - { + { public: class TArray - { + { public: @@ -7900,7 +7905,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TDODGE - { + { public: @@ -7970,7 +7975,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TPARRY - { + { public: @@ -8040,11 +8045,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TSKILLS - { + { public: class TArray - { + { public: @@ -8159,7 +8164,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TXP_CATALYSER - { + { public: @@ -8229,7 +8234,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TRING_XP_CATALYSER - { + { public: @@ -8299,7 +8304,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TPVP_FACTION_TAG - { + { public: @@ -8405,7 +8410,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TPVP_OUTPOST - { + { public: @@ -8532,15 +8537,15 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TSUCCESS_MODIFIER - { + { public: class TECO - { + { public: class TArray - { + { public: @@ -8836,11 +8841,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TPACK_ANIMAL - { + { public: class TBEAST - { + { public: @@ -8855,7 +8860,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C ICDBStructNode *_POS; ICDBStructNode *_HUNGER; ICDBStructNode *_DESPAWN; - ICDBStructNode *_NAME; + ICDBStructNode *_NAME; public: void init(ICDBStructNode *parent, uint index); @@ -9089,7 +9094,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TDEBUG_INFO - { + { public: @@ -9132,11 +9137,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TMP_EVAL - { + { public: class TRESULT - { + { public: @@ -9284,7 +9289,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TRESULT_CRITICAL - { + { public: @@ -9481,7 +9486,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TCOMPASS - { + { public: @@ -9566,11 +9571,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TFAME - { + { public: class TPLAYER - { + { public: @@ -9655,7 +9660,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TTRIBE - { + { public: @@ -9860,7 +9865,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TSTATIC_DATA - { + { public: @@ -9903,11 +9908,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TDYN_CHAT - { + { public: class TCHANNEL - { + { public: @@ -10016,11 +10021,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TPVP_EFFECTS - { + { public: class TPVP_FACTION_POINTS - { + { public: @@ -10126,7 +10131,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TArray - { + { public: @@ -10240,7 +10245,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TWEATHER - { + { public: @@ -10483,4 +10488,4 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; -#endif // INCLUDED_database_PLR_H +#endif // INCLUDED_DATABASE_PLR_H diff --git a/code/ryzom/server/src/entities_game_service/deposit.cpp b/code/ryzom/server/src/entities_game_service/deposit.cpp index 7d8000f4d..d4cd560ad 100644 --- a/code/ryzom/server/src/entities_game_service/deposit.cpp +++ b/code/ryzom/server/src/entities_game_service/deposit.cpp @@ -16,6 +16,7 @@ #include "stdpch.h" +#include #include "deposit.h" #include "player_manager/character.h" #include "player_manager/player_manager.h" 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 90d41820f..98ec86a75 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 @@ -507,7 +507,7 @@ void CDynChatEGS::iosSetHideBubble(TChanID chan, bool hideBubble) void CDynChatEGS::iosSetUniversalChannel(TChanID chan, bool universalChannel) { CMessage msg("DYN_CHAT:SET_UNIVERSAL_CHANNEL"); - msg.serial(chan); + msg.serial(chan); msg.serial(universalChannel); sendMessageViaMirror( "IOS", msg); } diff --git a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_item.cpp b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_item.cpp index f36fe91ab..42517c190 100644 --- a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_item.cpp +++ b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_item.cpp @@ -237,24 +237,12 @@ void SItemSpecialEffects::serial(class NLMISC::IStream &f) //-------------------------------------------------------------- // init() //-------------------------------------------------------------- -void CStaticItem::init() +void CStaticItem::init(bool doDelete) { Family = ITEMFAMILY::UNDEFINED; Type = ITEM_TYPE::UNDEFINED; - Armor = NULL; - MeleeWeapon = NULL; - RangeWeapon = NULL; - Ammo = NULL; - Shield = NULL; - TamingTool = NULL; - Mp = NULL; - GuildOption = NULL; - Cosmetics = NULL; - ItemServiceData = NULL; - ConsumableItem = NULL; - XpCatalyser = NULL; - CommandTicket = NULL; + clearPtrs(doDelete); Skill = SKILLS::unknown; MinSkill = 0; @@ -287,16 +275,54 @@ void CStaticItem::init() RequiredCharacQualityFactor = 0.0f; RequiredCharacQualityOffset = 0; - ItemSpecialEffects = NULL; } // init // +// *************************************************************************** +void CStaticItem::clearPtrs(bool doDelete) +{ + if (doDelete) + { + delete Armor; + delete MeleeWeapon; + delete RangeWeapon; + delete Ammo; + delete Shield; + delete TamingTool; + delete Mp; + delete GuildOption; + delete Cosmetics; + delete ItemServiceData; + delete ConsumableItem; + delete XpCatalyser; + delete CommandTicket; + delete ItemSpecialEffects; + } + + Armor = NULL; + MeleeWeapon = NULL; + RangeWeapon = NULL; + Ammo = NULL; + Shield = NULL; + TamingTool = NULL; + Mp = NULL; + GuildOption = NULL; + Cosmetics = NULL; + ItemServiceData = NULL; + ConsumableItem = NULL; + XpCatalyser = NULL; + CommandTicket = NULL; + ItemSpecialEffects = NULL; +} + //-------------------------------------------------------------- // copy constructor //-------------------------------------------------------------- CStaticItem::CStaticItem( const CStaticItem& itm ) { + clearPtrs(false); + *this = itm; if(itm.Armor) { @@ -1443,6 +1469,9 @@ void CStaticItem::readGeorges (const NLMISC::CSmartPtr &form, if (form == NULL) return; + // Clear pointers to previous data + clearPtrs(true); + // Get the root node, always exist UFormElm &root = form->getRootNode (); @@ -1993,37 +2022,6 @@ float CStaticItem::getBaseWeight() const } #endif -// *************************************************************************** -void CStaticItem::clearPtrs(bool doDelete) -{ - if(doDelete) - { - if (Ammo != NULL ) delete Ammo; - if (Armor != NULL ) delete Armor; - if (MeleeWeapon != NULL ) delete MeleeWeapon; - if (RangeWeapon != NULL ) delete RangeWeapon; - if (Cosmetics != NULL ) delete Cosmetics; - if (Mp != NULL ) delete Mp; - if (GuildOption != NULL ) delete GuildOption; - if (Shield != NULL ) delete Shield; - if (TamingTool != NULL) delete TamingTool; - if (ItemServiceData != NULL) delete ItemServiceData; - if (CommandTicket != NULL) delete CommandTicket; - } - - Ammo = NULL; - Armor = NULL; - MeleeWeapon = NULL; - RangeWeapon = NULL; - Cosmetics = NULL; - Mp = NULL; - GuildOption = NULL; - Shield = NULL; - TamingTool = NULL; - ItemServiceData = NULL; - CommandTicket = NULL; -} - uint32 CStaticItem::getMaxStackSize() const { diff --git a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_item.h b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_item.h index ddea7be9c..96aae2e98 100644 --- a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_item.h +++ b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_item.h @@ -812,13 +812,13 @@ public: public: /// Constructor - CStaticItem() { init(); } + CStaticItem() { init(false); } /// copy constructor CStaticItem( const CStaticItem& itm ); /// init method - void init(); + void init(bool doDelete = true); /// destructor virtual ~CStaticItem(); 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 085d67aae..8ca025870 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 @@ -127,7 +127,9 @@ #include "server_share/stl_allocator_checker.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #endif // NL_OS_WINDOWS diff --git a/code/ryzom/server/src/entities_game_service/fame_pd.cpp b/code/ryzom/server/src/entities_game_service/fame_pd.cpp index db2104c5d..2e201412a 100644 --- a/code/ryzom/server/src/entities_game_service/fame_pd.cpp +++ b/code/ryzom/server/src/entities_game_service/fame_pd.cpp @@ -516,7 +516,7 @@ void CFameContainerPD::pds__fetch(RY_PDS::CPData &data) if (rowIndex == RY_PDS::INVALID_ROW_INDEX || tableIndex == RY_PDS::INVALID_TABLE_INDEX) break; NLMISC::CSheetId __k; data.serial(__k); - _Entries.insert(std::make_pair(__k, CFameContainerEntryPD())); + _Entries.insert(std::pair(__k, CFameContainerEntryPD())); CFameContainerEntryPD* __o = &(_Entries[__k]); PDSLib.setRowIndex(rowIndex, __o); __o->pds__fetch(data); diff --git a/code/ryzom/server/src/entities_game_service/game_event_manager.cpp b/code/ryzom/server/src/entities_game_service/game_event_manager.cpp index 5346809a3..b95fb1ad4 100644 --- a/code/ryzom/server/src/entities_game_service/game_event_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/game_event_manager.cpp @@ -59,7 +59,7 @@ CGameEventManager::CGameEventManager() // ---------------------------------------------------------------------------- void CGameEventManager::init() { - string sFilename = GameEventFile; + string sFilename = GameEventFile.get(); sFilename = CPath::standardizePath(IService::getInstance()->WriteFilesDirectory) + sFilename; if (CFile::fileExists(sFilename)) @@ -302,7 +302,7 @@ void CGameEventManager::saveGameEventFile() { if( _InitOk ) { - string sFilename = GameEventFile; + string sFilename = GameEventFile.get(); sFilename = CPath::standardizePath(IService::getInstance()->WriteFilesDirectory) + sFilename; static CPersistentDataRecordRyzomStore pdr; diff --git a/code/ryzom/server/src/entities_game_service/game_item_manager/game_item.cpp b/code/ryzom/server/src/entities_game_service/game_item_manager/game_item.cpp index 75ae81f04..e36a4382e 100644 --- a/code/ryzom/server/src/entities_game_service/game_item_manager/game_item.cpp +++ b/code/ryzom/server/src/entities_game_service/game_item_manager/game_item.cpp @@ -242,11 +242,11 @@ float CItemCraftParameters::getCraftParameterValue( RM_FABER_STAT_TYPE::TRMStatT case RM_FABER_STAT_TYPE::ShockWaveProtection: case RM_FABER_STAT_TYPE::PoisonProtection: case RM_FABER_STAT_TYPE::ElectricityProtection: - if (Protection1 == statType) + if (Protection1 == (PROTECTION_TYPE::TProtectionType)statType) return Protection1Factor; - else if (Protection2 == statType) + else if (Protection2 == (PROTECTION_TYPE::TProtectionType)statType) return Protection2Factor; - else if (Protection3 == statType) + else if (Protection3 == (PROTECTION_TYPE::TProtectionType)statType) return Protection3Factor; else return 0.0f; case RM_FABER_STAT_TYPE::DesertResistance: @@ -2895,13 +2895,13 @@ uint32 CGameItem::maxDurability() const // tools // SHEARS = pick for forage - case ITEM_TYPE::SHEARS: return (uint32)CWeaponCraftParameters::ForageToolDurability; - case ITEM_TYPE::AmmoTool: return (uint32)CWeaponCraftParameters::AmmoCraftingToolDurability; - case ITEM_TYPE::ArmorTool: return (uint32)CWeaponCraftParameters::ArmorCraftingToolDurability; - case ITEM_TYPE::JewelryTool: return (uint32)CWeaponCraftParameters::JewelryCraftingToolDurability; - case ITEM_TYPE::MeleeWeaponTool:return (uint32)CWeaponCraftParameters::MeleeWeaponCraftingToolDurability; - case ITEM_TYPE::RangeWeaponTool:return (uint32)CWeaponCraftParameters::RangeWeaponCraftingToolDurability; - case ITEM_TYPE::ToolMaker: return (uint32)CWeaponCraftParameters::ToolCraftingToolDurability; + case ITEM_TYPE::SHEARS: d = CWeaponCraftParameters::ForageToolDurability; break; + case ITEM_TYPE::AmmoTool: d = CWeaponCraftParameters::AmmoCraftingToolDurability; break; + case ITEM_TYPE::ArmorTool: d = CWeaponCraftParameters::ArmorCraftingToolDurability; break; + case ITEM_TYPE::JewelryTool: d = CWeaponCraftParameters::JewelryCraftingToolDurability; break; + case ITEM_TYPE::MeleeWeaponTool: d = CWeaponCraftParameters::MeleeWeaponCraftingToolDurability; break; + case ITEM_TYPE::RangeWeaponTool: d = CWeaponCraftParameters::RangeWeaponCraftingToolDurability; break; + case ITEM_TYPE::ToolMaker: d = CWeaponCraftParameters::ToolCraftingToolDurability; break; default: return 0; diff --git a/code/ryzom/server/src/entities_game_service/game_item_manager/game_item_manager.cpp b/code/ryzom/server/src/entities_game_service/game_item_manager/game_item_manager.cpp index 830c45d7c..16258192c 100644 --- a/code/ryzom/server/src/entities_game_service/game_item_manager/game_item_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/game_item_manager/game_item_manager.cpp @@ -845,9 +845,9 @@ void CGameItemManager::buildNpcSpecificItems() //----------------------------------------------- // createItem : //----------------------------------------------- -NLMISC_COMMAND(createItem,"create a new item","") +NLMISC_COMMAND(createItem,"create a new item","") { - if( args.size() < 3 ) + if( args.size() < 2 ) { return false; } @@ -859,9 +859,9 @@ NLMISC_COMMAND(createItem,"create a new item","") uint16 quality; NLMISC::fromString(args[1], quality); - uint32 ownerIdTmp; - NLMISC::fromString(args[2], ownerIdTmp); - CEntityId ownerId(RYZOMID::object,ownerIdTmp); + //uint32 ownerIdTmp; + //NLMISC::fromString(args[2], ownerIdTmp); + //CEntityId ownerId(RYZOMID::object,ownerIdTmp); // CGameItemPtr item = GameItemManager.createItem( sheetId, quality, ownerId, -1, true,true ); CGameItemPtr item = GameItemManager.createItem( sheetId, quality, true, true ); diff --git a/code/ryzom/server/src/entities_game_service/guild_container_pd.cpp b/code/ryzom/server/src/entities_game_service/guild_container_pd.cpp index dea4e2a1d..7e025acdf 100644 --- a/code/ryzom/server/src/entities_game_service/guild_container_pd.cpp +++ b/code/ryzom/server/src/entities_game_service/guild_container_pd.cpp @@ -298,7 +298,7 @@ void CGuildContainerPD::pds__fetch(RY_PDS::CPData &data) TGuildId __k; data.serial(__k); CGuildPD* __o = static_cast(PDSLib.create(tableIndex)); - _Guilds.insert(std::make_pair(__k, __o)); + _Guilds.insert(std::pair(__k, __o)); PDSLib.setRowIndex(rowIndex, __o); __o->pds__fetch(data); __o->pds__setParentUnnotified(this); diff --git a/code/ryzom/server/src/entities_game_service/guild_manager/guild_member_module.cpp b/code/ryzom/server/src/entities_game_service/guild_manager/guild_member_module.cpp index 03a105445..c04347c08 100644 --- a/code/ryzom/server/src/entities_game_service/guild_manager/guild_member_module.cpp +++ b/code/ryzom/server/src/entities_game_service/guild_manager/guild_member_module.cpp @@ -559,7 +559,8 @@ void CGuildMemberModule::kickMember( uint16 index,uint8 session )const } // if the user is online reset its guild id CGuildMemberModule * module = NULL; - if ( member->getReferencingModule( module ) ) + + if (member->getReferencingModule(module)) { module->clearOnlineGuildProperties(); } @@ -568,7 +569,7 @@ void CGuildMemberModule::kickMember( uint16 index,uint8 session )const params[0].setEIdAIAlias( proxy.getId(), CAIAliasTranslator::getInstance()->getAIAlias(proxy.getId()) ); params[1].StringId = CEntityIdTranslator::getInstance()->getEntityNameStringId(member->getIngameEId()); sendMessageToGuildMembers("GUILD_KICK_MEMBER",params); - + guild->deleteMember( member ); } diff --git a/code/ryzom/server/src/entities_game_service/guild_pd.cpp b/code/ryzom/server/src/entities_game_service/guild_pd.cpp index 819ae72ad..1da40c221 100644 --- a/code/ryzom/server/src/entities_game_service/guild_pd.cpp +++ b/code/ryzom/server/src/entities_game_service/guild_pd.cpp @@ -470,7 +470,7 @@ void CGuildPD::pds__fetch(RY_PDS::CPData &data) TCharacterId __k; data.serial(__k); CGuildMemberPD* __o = static_cast(PDSLib.create(tableIndex)); - _Members.insert(std::make_pair(__k, __o)); + _Members.insert(std::pair(__k, __o)); PDSLib.setRowIndex(rowIndex, __o); __o->pds__fetch(data); __o->pds__setParentUnnotified(this); diff --git a/code/ryzom/server/src/entities_game_service/mission_client_callbacks.cpp b/code/ryzom/server/src/entities_game_service/mission_client_callbacks.cpp index 7cc0bf32a..98d784e11 100644 --- a/code/ryzom/server/src/entities_game_service/mission_client_callbacks.cpp +++ b/code/ryzom/server/src/entities_game_service/mission_client_callbacks.cpp @@ -236,6 +236,7 @@ void cbClientGroupAbandonMission( NLNET::CMessage& msgin, const std::string &ser MISLOG("user:%s cbClientGroupAbandonMission : Invalid team", userId.toString().c_str()); return; } + if ( team->getLeader() != userId ) { CCharacter::sendDynamicSystemMessage( user->getEntityRowId(), "REQ_LEADER_TO_ABANDON_MISSION" ); diff --git a/code/ryzom/server/src/entities_game_service/mission_manager/mission_action.cpp b/code/ryzom/server/src/entities_game_service/mission_manager/mission_action.cpp index 941b31afa..d967e6971 100644 --- a/code/ryzom/server/src/entities_game_service/mission_manager/mission_action.cpp +++ b/code/ryzom/server/src/entities_game_service/mission_manager/mission_action.cpp @@ -767,7 +767,7 @@ class CMissionActionRecvItem : public IMissionAction freeSlotcount -= invTemp->getUsedSlotCount(); maxBulk -= invTemp->getInventoryBulk(); } - + if( (neededSlotCount <= freeSlotcount) && ( neededBulk + invBag->getInventoryBulk() <= maxBulk) ) { fail = false; @@ -862,7 +862,7 @@ class CMissionActionRecvItem : public IMissionAction } params[2].Int = _Item.getQuality(); } - + params[0].SheetId = _SheetId; params[1].Int = _Quantity; PHRASE_UTILITIES::sendDynamicSystemMessage(user->getEntityRowId(),"MIS_RECV_ITEM", params); @@ -1050,7 +1050,7 @@ class CMissionActionRecvNamedItem : public IMissionAction sint16 neededSlotCount = (sint16) ceil( (float)_Quantity / itemTmp->getMaxStackSize() ); uint32 neededBulk = _Quantity * itemTmp->getStackBulk(); itemTmp.deleteItem(); - + bool fail = true; for ( uint i = 0; i < entities.size(); i++ ) { @@ -1067,15 +1067,15 @@ class CMissionActionRecvNamedItem : public IMissionAction freeSlotcount -= invTemp->getUsedSlotCount(); maxBulk -= invTemp->getInventoryBulk(); } - + if( (neededSlotCount <= freeSlotcount) && ( neededBulk + invBag->getInventoryBulk() <= maxBulk) ) { fail = false; break; } } - } + if( fail ) { CMissionTemplate * templ = CMissionManager::getInstance()->getTemplate( instance->getTemplateId() ); @@ -1274,7 +1274,6 @@ class CMissionActionDestroyItem : // If the "guild" parameter is not set, we destroy the items for the users if (!_Guild) { - for ( uint i = 0; i < entities.size(); i++ ) { CCharacter * user = PlayerManager.getChar( entities[i] ); @@ -1303,7 +1302,6 @@ class CMissionActionDestroyItem : PHRASE_UTILITIES::sendDynamicSystemMessage(user->getEntityRowId(),"MIS_DESTROY_ITEM", params); } } - } // We destroy the item in the guild else @@ -1909,7 +1907,6 @@ class CMissionActionRecvMoney : public IMissionAction // If the guild parameter is not set we just divide the money and give it to each entity if (!_Guild) { - uint amount = _Amount / (uint)entities.size(); if ( amount == 0 || _Amount % entities.size() ) amount++; @@ -1924,7 +1921,6 @@ class CMissionActionRecvMoney : public IMissionAction PHRASE_UTILITIES::sendDynamicSystemMessage(user->getEntityRowId(),"MIS_RECV_MONEY",params); } } - } // Else we give the money to the guild else @@ -2026,7 +2022,6 @@ class CMissionActionRecvFame : public IMissionAction // If there is no "guild" parameter we give the fame to every user if (!_Guild) { - for ( uint i = 0; i < entities.size(); i++ ) { CEntityId eid = TheDataset.getEntityId(entities[i]); @@ -2037,12 +2032,10 @@ class CMissionActionRecvFame : public IMissionAction if (character) character->sendEventForMissionAvailabilityCheck(); } - } // Else we just give it to the guild else { - if (entities.size() == 0) return; @@ -2072,7 +2065,6 @@ class CMissionActionRecvFame : public IMissionAction if (character) character->sendEventForMissionAvailabilityCheck(); } - } }; diff --git a/code/ryzom/server/src/entities_game_service/mission_manager/mission_queue_manager.cpp b/code/ryzom/server/src/entities_game_service/mission_manager/mission_queue_manager.cpp index bab69042a..a821eef45 100644 --- a/code/ryzom/server/src/entities_game_service/mission_manager/mission_queue_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/mission_manager/mission_queue_manager.cpp @@ -48,7 +48,7 @@ CMissionQueueManager::CMissionQueueManager() // ---------------------------------------------------------------------------- void CMissionQueueManager::init() { - string sFilename = MissionQueueFile; + string sFilename = MissionQueueFile.get(); sFilename = Bsi.getLocalPath() + sFilename; if (CFile::fileExists(sFilename)) @@ -141,7 +141,7 @@ void CMissionQueueManager::saveToFile() if( _InitOk ) { - string sFilename = MissionQueueFile; + string sFilename = MissionQueueFile.get(); // save file via Backup Service (BS) try diff --git a/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_template.cpp b/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_template.cpp index 7e99059b9..1caefb340 100644 --- a/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_template.cpp +++ b/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_template.cpp @@ -170,7 +170,6 @@ uint32 IMissionStepTemplate::sendStepText(CCharacter * user,const std::vector(__k, CActiveStepStatePD())); + _States.insert(std::pair(__k, CActiveStepStatePD())); CActiveStepStatePD* __o = &(_States[__k]); PDSLib.setRowIndex(rowIndex, __o); __o->pds__fetch(data); @@ -2353,7 +2353,7 @@ void CMissionPD::pds__fetch(RY_PDS::CPData &data) if (rowIndex == RY_PDS::INVALID_ROW_INDEX || tableIndex == RY_PDS::INVALID_TABLE_INDEX) break; uint32 __k; data.serial(__k); - _Steps.insert(std::make_pair(__k, CActiveStepPD())); + _Steps.insert(std::pair(__k, CActiveStepPD())); CActiveStepPD* __o = &(_Steps[__k]); PDSLib.setRowIndex(rowIndex, __o); __o->pds__fetch(data); @@ -2367,7 +2367,7 @@ void CMissionPD::pds__fetch(RY_PDS::CPData &data) if (rowIndex == RY_PDS::INVALID_ROW_INDEX || tableIndex == RY_PDS::INVALID_TABLE_INDEX) break; uint32 __k; data.serial(__k); - _Compass.insert(std::make_pair(__k, CMissionCompassPD())); + _Compass.insert(std::pair(__k, CMissionCompassPD())); CMissionCompassPD* __o = &(_Compass[__k]); PDSLib.setRowIndex(rowIndex, __o); __o->pds__fetch(data); @@ -2381,7 +2381,7 @@ void CMissionPD::pds__fetch(RY_PDS::CPData &data) if (rowIndex == RY_PDS::INVALID_ROW_INDEX || tableIndex == RY_PDS::INVALID_TABLE_INDEX) break; uint32 __k; data.serial(__k); - _StepsDone.insert(std::make_pair(__k, CDoneStepPD())); + _StepsDone.insert(std::pair(__k, CDoneStepPD())); CDoneStepPD* __o = &(_StepsDone[__k]); PDSLib.setRowIndex(rowIndex, __o); __o->pds__fetch(data); @@ -2395,7 +2395,7 @@ void CMissionPD::pds__fetch(RY_PDS::CPData &data) if (rowIndex == RY_PDS::INVALID_ROW_INDEX || tableIndex == RY_PDS::INVALID_TABLE_INDEX) break; uint32 __k; data.serial(__k); - _Teleports.insert(std::make_pair(__k, CMissionTeleportPD())); + _Teleports.insert(std::pair(__k, CMissionTeleportPD())); CMissionTeleportPD* __o = &(_Teleports[__k]); PDSLib.setRowIndex(rowIndex, __o); __o->pds__fetch(data); @@ -2409,7 +2409,7 @@ void CMissionPD::pds__fetch(RY_PDS::CPData &data) if (rowIndex == RY_PDS::INVALID_ROW_INDEX || tableIndex == RY_PDS::INVALID_TABLE_INDEX) break; uint32 __k; data.serial(__k); - _InsidePlaces.insert(std::make_pair(__k, CMissionInsidePlacePD())); + _InsidePlaces.insert(std::pair(__k, CMissionInsidePlacePD())); CMissionInsidePlacePD* __o = &(_InsidePlaces[__k]); PDSLib.setRowIndex(rowIndex, __o); __o->pds__fetch(data); @@ -2423,7 +2423,7 @@ void CMissionPD::pds__fetch(RY_PDS::CPData &data) if (rowIndex == RY_PDS::INVALID_ROW_INDEX || tableIndex == RY_PDS::INVALID_TABLE_INDEX) break; uint32 __k; data.serial(__k); - _OutsidePlaces.insert(std::make_pair(__k, CMissionOutsidePlacePD())); + _OutsidePlaces.insert(std::pair(__k, CMissionOutsidePlacePD())); CMissionOutsidePlacePD* __o = &(_OutsidePlaces[__k]); PDSLib.setRowIndex(rowIndex, __o); __o->pds__fetch(data); @@ -2437,7 +2437,7 @@ void CMissionPD::pds__fetch(RY_PDS::CPData &data) if (rowIndex == RY_PDS::INVALID_ROW_INDEX || tableIndex == RY_PDS::INVALID_TABLE_INDEX) break; uint32 __k; data.serial(__k); - _HandledAIGroups.insert(std::make_pair(__k, CHandledAIGroupPD())); + _HandledAIGroups.insert(std::pair(__k, CHandledAIGroupPD())); CHandledAIGroupPD* __o = &(_HandledAIGroups[__k]); PDSLib.setRowIndex(rowIndex, __o); __o->pds__fetch(data); @@ -3276,7 +3276,7 @@ void CMissionContainerPD::pds__fetch(RY_PDS::CPData &data) uint32 __k; data.serial(__k); CMissionPD* __o = static_cast(PDSLib.create(tableIndex)); - _Missions.insert(std::make_pair(__k, __o)); + _Missions.insert(std::pair(__k, __o)); PDSLib.setRowIndex(rowIndex, __o); __o->pds__fetch(data); __o->pds__setParentUnnotified(this); 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 50a069b5e..c49a45429 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 @@ -388,7 +388,7 @@ protected: // compute success factor sint deltaLvl; float successFactor = CFaberActionCommon::getSuccessFactor( character, phrase, deltaLvl ); - + // final item quality, depending of recommended skill of action used and lower quality of raw materials used and success factor of action uint16 finalItemQuality = max( (uint16)1, (uint16) (min(phrase->getLowerRmQuality(),(uint16)phrase->getRecommendedSkill()) * successFactor) ); diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/fg_prospection_phrase.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/fg_prospection_phrase.cpp index 010176023..f2fc03eb0 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/fg_prospection_phrase.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/fg_prospection_phrase.cpp @@ -1509,7 +1509,7 @@ NLMISC_DYNVARIABLE( uint32, RyzomSeason, "Get season number (0=Spring)" ) #ifdef DEPOSIT_MAP_GENERATION -#include "server_share/bmp4image.h" +#include "game_share/bmp4image.h" #include typedef std::map< std::string, pair< pair< float, float >, uint > > CSUMap; diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/sabrina_area_debug.h b/code/ryzom/server/src/entities_game_service/phrase_manager/sabrina_area_debug.h index 4964b78e1..a87c0a092 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/sabrina_area_debug.h +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/sabrina_area_debug.h @@ -23,7 +23,7 @@ #include "egs_mirror.h" #include "area_geometry.h" -#include "server_share/bmp4image.h" +#include "game_share/bmp4image.h" diff --git a/code/ryzom/server/src/entities_game_service/player_manager/cdb_branch.cpp b/code/ryzom/server/src/entities_game_service/player_manager/cdb_branch.cpp index d54dbd694..44205d02a 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/cdb_branch.cpp +++ b/code/ryzom/server/src/entities_game_service/player_manager/cdb_branch.cpp @@ -284,7 +284,7 @@ void CCDBStructNodeBranch::init( xmlNodePtr node, NLMISC::IProgressCallback &pro { // dealing with an array of entries uint countAsInt; - NLMISC::fromString(count, countAsInt); + NLMISC::fromString(count.str(), countAsInt); nlassert((const char *) count != NULL); for (uint i=0;itickUpdate(); - return nextUpdate; } // tickUpdate // @@ -2797,7 +2792,6 @@ CCharacter::~CCharacter() _BarUpdateTimer.reset(); delete _EncycloChar; - delete _AchievementsChar; delete _GameEvent; delete _RespawnPoints; delete _PlayerRoom; @@ -2815,11 +2809,6 @@ CCharacter::~CCharacter() } // destructor // -void CCharacter::mobKill(TDataSetRow creatureRowId) -{ - _AchievementsChar->mobKill(creatureRowId); -} - //--------------------------------------------------- // prepareToLoad: method called before applying a pdr save record // @@ -13138,7 +13127,6 @@ void CCharacter::setPlaces(const std::vector & places) for ( uint i = 0; i < size; i++ ) { _Places[i] = places[i]->getId(); - _AchievementsChar->inPlace(places[i]); } } @@ -14179,7 +14167,7 @@ void CCharacter::sendCloseTempInventoryImpulsion() BOMB_IF(isRecursing,"CCharacter::sendCloseTempInventoryImpulsion is recursing!",return); // **** Temp Fix 2/4 **** // isRecursing= true; // **** Temp Fix 3/4 **** // - getAllTempInventoryItems(); + getAllTempInventoryItems(false); CMessage msgout( "IMPULSION_ID" ); msgout.serial( _Id ); @@ -14200,11 +14188,6 @@ void CCharacter::sendCloseTempInventoryImpulsion() //----------------------------------------------- void CCharacter::setFameValuePlayer(uint32 factionIndex, sint32 playerFame, sint32 fameMax, uint16 fameTrend) { - if (playerFame != NO_FAME) - { - _AchievementsChar->fameValue(factionIndex, playerFame); - } - uint32 firstTribeFameIndex = CStaticFames::getInstance().getFirstTribeFameIndex(); uint32 firstTribeDbIndex = CStaticFames::getInstance().getDatabaseIndex( firstTribeFameIndex ); uint32 fameIndexInDatabase = CStaticFames::getInstance().getDatabaseIndex( factionIndex ); @@ -16324,13 +16307,7 @@ void CCharacter::sendEmote( const NLMISC::CEntityId& id, MBEHAV::EBehaviour beha } CEntityId targetId = getTarget(); - if ( targetId.getType() != RYZOMID::npc && - targetId.getType() != RYZOMID::player && - targetId.getType() != RYZOMID::creature && - targetId.getType() != RYZOMID::mount && - targetId.getType() != RYZOMID::pack_animal && - targetId.getType() != RYZOMID::flora - ) + if (targetId.getType() > RYZOMID::creature_end) targetId = CEntityId::Unknown; TDataSetRow targetRow = TheDataset.getDataSetRow( targetId ); 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 9ad894abe..de6d3f110 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 @@ -115,7 +115,6 @@ class CMissionEvent; class CMissionSolo; class CCharacterVersionAdapter; class CCharacterEncyclopedia; -class CCharacterAchievements; class CCharacterGameEvent; class CCharacterRespawnPoints; class CCharacterShoppingList; @@ -443,10 +442,8 @@ private: static const std::string &contactListActionToString(TConctactListAction e); NL_INSTANCE_COUNTER_DECL(CCharacter); -public: - - void mobKill(TDataSetRow creatureRowId); +public: // Start by declaring methods for persistent load/ save operations // The following macro is defined in persistent_data.h // At time of writing it evaluated to: @@ -2626,13 +2623,13 @@ public: CGameItemPtr createItemInInventoryFreeSlot(INVENTORIES::TInventory invId, uint16 obtainedQuality, uint32 quantity, const NLMISC::CSheetId & obtainedItem, const NLMISC::CEntityId & creatorId = NLMISC::CEntityId::Unknown, const std::string * phraseId = NULL); /// action on an item in the temp inventory (move it to bag) - void itemTempInventoryToBag(uint32 scrSlot); + void itemTempInventoryToBag(uint32 scrSlot, bool sendCloseTempImpulsion = true); /// clear temp inventory void clearTempInventory(); /// get all items in temp inventory - void getAllTempInventoryItems(); + void getAllTempInventoryItems(bool sendCloseTempImpulsion = true); /// return true if temp inventory is empty bool tempInventoryEmpty(); @@ -3505,8 +3502,6 @@ private: CCharacterEncyclopedia *_EncycloChar; - CCharacterAchievements *_AchievementsChar; - CCharacterGameEvent *_GameEvent; CCharacterRespawnPoints *_RespawnPoints; diff --git a/code/ryzom/server/src/entities_game_service/player_manager/character_achievements.cpp b/code/ryzom/server/src/entities_game_service/player_manager/character_achievements.cpp deleted file mode 100644 index b80abbdcf..000000000 --- a/code/ryzom/server/src/entities_game_service/player_manager/character_achievements.cpp +++ /dev/null @@ -1,90 +0,0 @@ -// Ryzom - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -//----------------------------------------------------------------------------- -// includes -//----------------------------------------------------------------------------- - -#include "stdpch.h" -//#include "egs_sheets/egs_sheets.h" -//#include "egs_sheets/egs_static_encyclo.h" -//#include "game_share/msg_encyclopedia.h" -//#include "game_share/string_manager_sender.h" -//#include "player_manager/player_manager.h" -//#include "player_manager/player.h" -//#include "mission_manager/mission_manager.h" -#include "player_manager/character_achievements.h" -#include "player_manager/character.h" -#include "phrase_manager/phrase_utilities_functions.h" - -//----------------------------------------------------------------------------- -// namespaces -//----------------------------------------------------------------------------- - -using namespace std; -using namespace NLMISC; - -NL_INSTANCE_COUNTER_IMPL(CCharacterAchievements); - -//----------------------------------------------------------------------------- -// methods CCharacterEncyclopedia -//----------------------------------------------------------------------------- - -CCharacterAchievements::CCharacterAchievements(CCharacter &c) : _Char(c) -{ - init(); -} - -//----------------------------------------------------------------------------- - -void CCharacterAchievements::init() -{ - nlinfo("hello achievements"); - //load atoms -} - -//----------------------------------------------------------------------------- - -void CCharacterAchievements::clear() -{ - //clear atoms -} - -//----------------------------------------------------------------------------- - -void CCharacterAchievements::mobKill(TDataSetRow creatureRowId) -{ - const CCreature *creature = CreatureManager.getCreature(creatureRowId); - if (creature) - { - nlinfo("player has killed a mob: %s!",creature->getType().toString().c_str()); - } -} - -void CCharacterAchievements::inPlace(const CPlace *region) -{ - nlinfo("player in region %u",region->getId()); -} - -void CCharacterAchievements::fameValue(uint32 factionIndex, sint32 playerFame) -{ - nlinfo("fame: f(%u)=>v(%u)",factionIndex,playerFame); -} - -void CCharacterAchievements::tickUpdate() -{ - //evaluate atoms -} \ No newline at end of file diff --git a/code/ryzom/server/src/entities_game_service/player_manager/character_achievements.h b/code/ryzom/server/src/entities_game_service/player_manager/character_achievements.h deleted file mode 100644 index 94fae1260..000000000 --- a/code/ryzom/server/src/entities_game_service/player_manager/character_achievements.h +++ /dev/null @@ -1,78 +0,0 @@ -// Ryzom - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -#ifndef EGS_CHARACTER_ACHIEVEMENTS_H -#define EGS_CHARACTER_ACHIEVEMENTS_H - - -//----------------------------------------------------------------------------- -// includes -//----------------------------------------------------------------------------- - -// game share -//#include "game_share/persistent_data.h" -#include "zone_manager.h" -#include "creature_manager/creature.h" -#include "creature_manager/creature_manager.h" - -//----------------------------------------------------------------------------- - -class CCharacter; - -/** - * Dynamic part of the encyclopedia stored in a character - * This structure is optimized for size because its stored directly in the player persistant data stuff - * We use CEncyMsgXXX for sending info to the player - * \author Matthieu 'Trap' Besson - * \author Nevrax France - * \date November 2004 - */ -class CCharacterAchievements -{ - NL_INSTANCE_COUNTER_DECL(CCharacterAchievements); -public: - - CCharacterAchievements(CCharacter &c); - - // Construct the encyclopedia album structure from the static sheet that defines encyclopedia - // This method ensure that we have at least the same number of album and the same number of thema by album - // as in the sheets defines the encyclopedia - void init(); - - // remove all - void clear(); - - void mobKill(TDataSetRow creatureRowId); - - void inPlace(const CPlace *region); - - void fameValue(uint32 factionIndex, sint32 playerFame); - - void tickUpdate(); - - -private: - - - -private: - - // The parent class - CCharacter &_Char; - -}; - -#endif // EGS_CHARACTER_ACHIEVEMENTS_H diff --git a/code/ryzom/server/src/entities_game_service/player_manager/character_inventory_manipulation.cpp b/code/ryzom/server/src/entities_game_service/player_manager/character_inventory_manipulation.cpp index 2ce09282c..139cf1b4e 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/character_inventory_manipulation.cpp +++ b/code/ryzom/server/src/entities_game_service/player_manager/character_inventory_manipulation.cpp @@ -1841,7 +1841,7 @@ CGameItemPtr CCharacter::createItemInInventoryFreeSlot(INVENTORIES::TInventory i } // **************************************************************************** -void CCharacter::itemTempInventoryToBag(uint32 srcSlot) +void CCharacter::itemTempInventoryToBag(uint32 srcSlot, bool sendCloseTempImpulsion) { H_AUTO(CCharacter_itemTempInventoryToBag); @@ -2015,7 +2015,7 @@ void CCharacter::itemTempInventoryToBag(uint32 srcSlot) CWorldInstances::instance().msgToAIInstance(getInstanceNumber(), msg); } - endHarvest(); + endHarvest(sendCloseTempImpulsion); leaveTempInventoryMode(); } @@ -2108,12 +2108,12 @@ void CCharacter::itemTempInventoryToBag(uint32 srcSlot) } // **************************************************************************** -void CCharacter::getAllTempInventoryItems() +void CCharacter::getAllTempInventoryItems(bool sendCloseTempImpulsion) { H_AUTO(CCharacter_getAllTempInventoryItems); for (uint i = 0 ; i < INVENTORIES::NbTempInvSlots; ++i) - itemTempInventoryToBag(i); + itemTempInventoryToBag(i, sendCloseTempImpulsion); } // **************************************************************************** diff --git a/code/ryzom/server/src/entities_game_service/player_manager/character_version_adapter.cpp b/code/ryzom/server/src/entities_game_service/player_manager/character_version_adapter.cpp index 1cf7940c6..adc281dda 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/character_version_adapter.cpp +++ b/code/ryzom/server/src/entities_game_service/player_manager/character_version_adapter.cpp @@ -652,7 +652,9 @@ void CCharacterVersionAdapter::adaptToVersion11(CCharacter &character) const case EGSPD::CPeople::Zorai : mission = CAIAliasTranslator::getInstance()->getMissionUniqueIdFromName( "ZORAI_NEWB_WELCOME_SHENG_WO_1" ); CAIAliasTranslator::getInstance()->getNPCAliasesFromName("welcomer_sheng_wo_1", bots); - break; + break; + default: + break; } } // other give him a rite intro mission diff --git a/code/ryzom/server/src/entities_game_service/player_manager/db_string_updater.h b/code/ryzom/server/src/entities_game_service/player_manager/db_string_updater.h index 059e7d765..7603c92e9 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/db_string_updater.h +++ b/code/ryzom/server/src/entities_game_service/player_manager/db_string_updater.h @@ -53,6 +53,7 @@ class CDBStringUpdater : public NLMISC::CSingleton // hasher for the identifier struct THashDBStringLeaf { + enum { bucket_size = 4, min_buckets = 8, }; size_t operator()(const TBDStringLeaf &stringLeaf) const { return ((size_t)stringLeaf.ClientDB>>4) ^ ((size_t)stringLeaf.Node>>4); diff --git a/code/ryzom/server/src/entities_game_service/player_manager/player_manager.h b/code/ryzom/server/src/entities_game_service/player_manager/player_manager.h index 9f1643e84..ba0d1c306 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/player_manager.h +++ b/code/ryzom/server/src/entities_game_service/player_manager/player_manager.h @@ -48,9 +48,9 @@ namespace NLNET extern CGenericXmlMsgHeaderManager GenericMsgManager; -class CServiceIdHash +struct CServiceIdHash { -public: + enum { bucket_size = 4, min_buckets = 8, }; size_t operator () ( const NLNET::TServiceId &sid ) const { return sid.get(); } }; diff --git a/code/ryzom/server/src/entities_game_service/player_manager/player_manager_interface.h b/code/ryzom/server/src/entities_game_service/player_manager/player_manager_interface.h index a18e1645a..3e5de3130 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/player_manager_interface.h +++ b/code/ryzom/server/src/entities_game_service/player_manager/player_manager_interface.h @@ -41,9 +41,9 @@ public: }; - class CUint32Hash + struct CUint32Hash { - public: + enum { bucket_size = 4, min_buckets = 8, }; size_t operator () ( const uint32 &i ) const { return i; } }; diff --git a/code/ryzom/server/src/entities_game_service/progression/progression_pve.cpp b/code/ryzom/server/src/entities_game_service/progression/progression_pve.cpp index 6cd1c96a0..ed3c03c8e 100644 --- a/code/ryzom/server/src/entities_game_service/progression/progression_pve.cpp +++ b/code/ryzom/server/src/entities_game_service/progression/progression_pve.cpp @@ -1980,8 +1980,6 @@ bool CCharacterActions::dispatchXpGain( TDataSetRow actor, TDataSetRow creatureR // compute xp gain on creature, cap xp gain per player to MaxXPGainPerPlayer const float xpGainPerOpponent = min( MaxXPGainPerPlayer.get(), float(xpFactor * maxXPGain / equivalentXpMembers) ); - c->mobKill(creatureRowId); - TSkillProgressPerOpponentContainer::iterator it = _SkillProgressPerOpponent.find( creatureRowId ); if( it != _SkillProgressPerOpponent.end() ) { diff --git a/code/ryzom/server/src/entities_game_service/progression/progression_pve.h b/code/ryzom/server/src/entities_game_service/progression/progression_pve.h index 11d538ea4..2c9e9aba2 100644 --- a/code/ryzom/server/src/entities_game_service/progression/progression_pve.h +++ b/code/ryzom/server/src/entities_game_service/progression/progression_pve.h @@ -279,7 +279,6 @@ struct CCreatureTakenDamage { if ( PlayerInflictedDamage[i].TotalDamage > maxDmg ) { - nlinfo("set damage by player"); maxDmg = PlayerInflictedDamage[i].TotalDamage; index = (sint16)i; } diff --git a/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_faction_reward_manager/pvp_faction_reward_manager.cpp b/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_faction_reward_manager/pvp_faction_reward_manager.cpp index 85579dcf8..50b039522 100644 --- a/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_faction_reward_manager/pvp_faction_reward_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_faction_reward_manager/pvp_faction_reward_manager.cpp @@ -1058,8 +1058,9 @@ NLMISC_COMMAND(getEffects, "get effects of a spire"," " ) return false; else { - float x = (float)atof(args[0].c_str()); - float y = (float)atof(args[1].c_str()); + float x, y; + NLMISC::fromString(args[0], x); + NLMISC::fromString(args[1], y); NLMISC::CVector vec( x, y, 0.0f ); @@ -1101,8 +1102,9 @@ NLMISC_COMMAND(buildSpirePos, "build a spire"," ") return true; } - float x = (float)atof(args[1].c_str()); - float y = (float)atof(args[2].c_str()); + float x, y; + NLMISC::fromString(args[1], x); + NLMISC::fromString(args[2], y); NLMISC::CVector vec( x, y, 0.0f ); @@ -1138,8 +1140,9 @@ NLMISC_COMMAND(destroySpirePos, "destroy a spire"," ") return false; else { - float x = (float)atof(args[0].c_str()); - float y = (float)atof(args[1].c_str()); + float x, y; + NLMISC::fromString(args[0], x); + NLMISC::fromString(args[1], y); NLMISC::CVector vec( x, y, 0.0f ); @@ -1178,8 +1181,9 @@ NLMISC_COMMAND(getEffectsPos, "get effects of a spire"," " ) return true; } - float x = (float)atof(args[1].c_str()); - float y = (float)atof(args[2].c_str()); + float x, y; + NLMISC::fromString(args[1], x); + NLMISC::fromString(args[2], y); NLMISC::CVector vec( x, y, 0.0f ); @@ -1265,8 +1269,9 @@ NLMISC_COMMAND(getRegionOwner, "display the faction which currently owns the reg return false; else { - float x = (float)atof(args[0].c_str()); - float y = (float)atof(args[1].c_str()); + float x, y; + NLMISC::fromString(args[0], x); + NLMISC::fromString(args[1], y); NLMISC::CVector vec( x, y, 0.0f ); @@ -1294,8 +1299,9 @@ NLMISC_COMMAND(getSpireStats, "display the status of spire in region correspondi return false; else { - float x = (float)atof(args[0].c_str()); - float y = (float)atof(args[1].c_str()); + float x, y; + NLMISC::fromString(args[0], x); + NLMISC::fromString(args[1], y); NLMISC::CVector vec( x, y, 0.0f ); 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 6beb7b1b2..7f42a671c 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 @@ -211,13 +211,16 @@ std::vector CPVPManager2::getCharacterChannels(CCharacter * user) result.clear(); // Add lang channel, should be first. - if (!user->getLangChannel().empty()) { + if (!user->getLangChannel().empty()) + { TMAPExtraFactionChannel::iterator it = _ExtraFactionChannel.find(user->getLangChannel()); if (it != _ExtraFactionChannel.end()) { result.push_back((*it).second); } - } else { + } + else + { TMAPExtraFactionChannel::iterator it = _ExtraFactionChannel.find("en"); if (it != _ExtraFactionChannel.end()) { diff --git a/code/ryzom/server/src/entities_game_service/shop_type/character_shopping_list.cpp b/code/ryzom/server/src/entities_game_service/shop_type/character_shopping_list.cpp index d23945d25..e024334c2 100644 --- a/code/ryzom/server/src/entities_game_service/shop_type/character_shopping_list.cpp +++ b/code/ryzom/server/src/entities_game_service/shop_type/character_shopping_list.cpp @@ -460,9 +460,9 @@ void CCharacterShoppingList::initPageToUpdate( uint32 nbSlotPerPage ) void CCharacterShoppingList::fillTradePage( uint16 session ) { /* -- Ajout de TRADING:*:PRICE_RETIRE (utile que si SELLER_TYPE == User ou ResaleAndUser). Note: Prix UNITAIRE (si MP, Ammo etc..) -- Si SELLER_TYPE==User seulement: Si PRICE==-1, alors cela veut dire " Item Sold " (pour afficher la liste des items vendus les plus récents) -- Note: TRADING:*:PRICE reste un Prix UNITAIRE (si MP, Ammo etc..) (cela devait déja être le cas) +- Added TRADING:*:PRICE_RETIRE (only useful if SELLER_TYPE == User or ResaleAndUser). Note: UNIT price (if Raw Mats, Ammo, etc..) +- If SELLER_TYPE==User only: if PRICE==-1, then it means " Item Sold " (to display list of more recent sold items) +- Note: TRADING:*:PRICE is wtill a UNIT price (if Raw Mats, Ammo, etc..) (it should already be the case) */ // get page to update if any 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 dd9e817b1..f55222dca 100644 --- a/code/ryzom/server/src/entities_game_service/zone_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/zone_manager.cpp @@ -201,7 +201,7 @@ bool CTpSpawnZone::build(const NLLIGO::CPrimPoint * point) nlwarning(" : no z in CTpSpawnZone '%s'",_Name.c_str() ); return false; } - Point.z = ( float ) atof( value.c_str() ); + NLMISC::fromString(value, Point.z); Point.z = float( sint32 (1000.0f* Point.z) ); } else diff --git a/code/ryzom/server/src/frontend_service/client_entity_id_translator.h b/code/ryzom/server/src/frontend_service/client_entity_id_translator.h index 0f18698c5..f80fbe983 100644 --- a/code/ryzom/server/src/frontend_service/client_entity_id_translator.h +++ b/code/ryzom/server/src/frontend_service/client_entity_id_translator.h @@ -89,10 +89,11 @@ public: private: - class CHash + struct CHash { - public: - size_t operator () ( const TEntityIndex& index ) const { return index.getIndex(); } + enum { bucket_size = 4, min_buckets = 8, }; + size_t operator () (const TEntityIndex& index) const { return index.getIndex(); } + bool operator() (const TEntityIndex& left, const TEntityIndex& right) { return left < right; } }; // table to map CEntityId to TCLEntityId diff --git a/code/ryzom/server/src/frontend_service/client_id_lookup.h b/code/ryzom/server/src/frontend_service/client_id_lookup.h index 3d6db560e..9c63a60a6 100644 --- a/code/ryzom/server/src/frontend_service/client_id_lookup.h +++ b/code/ryzom/server/src/frontend_service/client_id_lookup.h @@ -114,11 +114,11 @@ private: typedef std::vector TEntityIndexToClient; - class CIdHash + struct CIdHash { - public: - - size_t operator () ( NLMISC::CEntityId id ) const { return (uint32)id.getShortId(); } + enum { bucket_size = 4, min_buckets = 8, }; + size_t operator () (NLMISC::CEntityId id) const { return (uint32)id.getShortId(); } + bool operator() (const NLMISC::CEntityId& left, const NLMISC::CEntityId& right) { return left < right; } }; typedef CHashMap TIdToClientMap; diff --git a/code/ryzom/server/src/frontend_service/distance_prioritizer.cpp b/code/ryzom/server/src/frontend_service/distance_prioritizer.cpp index 305adb992..04bf990cd 100644 --- a/code/ryzom/server/src/frontend_service/distance_prioritizer.cpp +++ b/code/ryzom/server/src/frontend_service/distance_prioritizer.cpp @@ -915,7 +915,7 @@ inline void CDistancePrioritizer::serialSlotHeader( CClientHost& client, CEntit timestampDelta = 15; timestampDelta |= 0x10; // 'timestampIsThere bit': first bit is bit 5 (high to low order) } - else if ( seenEntityId.getType() >= RYZOMID::object ) + else if ( seenEntityId.getType() > RYZOMID::creature_end ) { // For non-players/non-bots types (e.g. bags), set the timestamp delta if entity is being spawned to the client //if ( _VisualPropertyTreeRoot->B->B->getSHEETnode()->BranchHasPayload ) // assumes this is done after arbitrateDiscreetProperties() // CHANGED BEN diff --git a/code/ryzom/server/src/frontend_service/distance_prioritizer.h b/code/ryzom/server/src/frontend_service/distance_prioritizer.h index b7a69a1d6..ad59bc12e 100644 --- a/code/ryzom/server/src/frontend_service/distance_prioritizer.h +++ b/code/ryzom/server/src/frontend_service/distance_prioritizer.h @@ -227,7 +227,7 @@ public: { outbox.serialBitAndLog( BranchHasPayload ); if ( a() ) a()->fillDiscreetProperties( outbox ); - if ( a() ) b()->fillDiscreetProperties( outbox ); + if ( b() ) b()->fillDiscreetProperties( outbox ); } } else diff --git a/code/ryzom/server/src/frontend_service/fe_receive_task.cpp b/code/ryzom/server/src/frontend_service/fe_receive_task.cpp index 4eb85134a..3c958f461 100644 --- a/code/ryzom/server/src/frontend_service/fe_receive_task.cpp +++ b/code/ryzom/server/src/frontend_service/fe_receive_task.cpp @@ -22,7 +22,9 @@ #include "fe_types.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #elif defined NL_OS_UNIX diff --git a/code/ryzom/server/src/frontend_service/fe_types.h b/code/ryzom/server/src/frontend_service/fe_types.h index 747fd6f9e..d63ef1e42 100644 --- a/code/ryzom/server/src/frontend_service/fe_types.h +++ b/code/ryzom/server/src/frontend_service/fe_types.h @@ -69,16 +69,15 @@ typedef uint32 TUid; /** * CInetAddress hash function */ -class CInetAddressHashMapTraits +struct CInetAddressHashMapTraits { -public: - static const size_t bucket_size = 4; - static const size_t min_buckets = 8; + enum { bucket_size = 4, min_buckets = 8, }; inline size_t operator() ( const NLNET::CInetAddress& x ) const { //return x.port(); return x.internalIPAddress(); } + bool operator() (const NLNET::CInetAddress& left, const NLNET::CInetAddress& right) { return left < right; } // bool operator() (const NLNET::CInetAddress &x1, const NLNET::CInetAddress &x2) const // { // return classId1 < classId2; diff --git a/code/ryzom/server/src/frontend_service/frontend_service.cpp b/code/ryzom/server/src/frontend_service/frontend_service.cpp index e43b9ccce..c973ebcfd 100644 --- a/code/ryzom/server/src/frontend_service/frontend_service.cpp +++ b/code/ryzom/server/src/frontend_service/frontend_service.cpp @@ -57,7 +57,9 @@ #include "uid_impulsions.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #endif // NL_OS_WINDOWS @@ -1860,7 +1862,7 @@ NLMISC_COMMAND( dumpImpulseStats, "Dump Impulse stat to XML log", " [[- if (reverse) comp = -comp; - result.push_back(std::make_pair(comp, client)); + result.push_back(std::pair(comp, client)); } if (ucriterion != 0 && !result.empty()) diff --git a/code/ryzom/server/src/frontend_service/module_manager.cpp b/code/ryzom/server/src/frontend_service/module_manager.cpp index 24def9d18..f0d3e0514 100644 --- a/code/ryzom/server/src/frontend_service/module_manager.cpp +++ b/code/ryzom/server/src/frontend_service/module_manager.cpp @@ -178,7 +178,7 @@ void CModuleManager::addModule(uint id, TModuleExecCallback cb) { nlassert(id < _MaxModules); nlassert(cb != NULL); - nldebug("FEMMAN: [%s] Added module %d (Cb=%p) to stack", _StackName.c_str(), id, cb); + nldebug("FEMMAN: [%s] Added module %d (Cb=%p) to stack", _StackName.c_str(), id, (void *)cb); _ExecutionStack.push_back(CExecutionItem()); @@ -372,7 +372,7 @@ void CModuleManager::executeStack() nlwarning("FEMMAN: Unexpected ExecutionItem type (%d) at item %d of the execution stack %s", item.Type, i, _StackName.c_str()); uint j; for (j=0; j<_ExecutionStack.size(); ++j) - nlwarning("FEMMAN: > %d [%s] Id=%d Cb=%p", j, (item.Type == Module) ? "MOD" : (item.Type == Wait) ? "WAIT" : "ERR", item.Id, item.Cb); + nlwarning("FEMMAN: > %d [%s] Id=%d Cb=%p", j, (item.Type == Module) ? "MOD" : (item.Type == Wait) ? "WAIT" : "ERR", item.Id, (void *)item.Cb); nlerror("FEMMAN: Error in execution stack %s", _StackName.c_str()); } } diff --git a/code/ryzom/server/src/frontend_service/vision_provider.h b/code/ryzom/server/src/frontend_service/vision_provider.h index 39d84fb2f..aaca90869 100644 --- a/code/ryzom/server/src/frontend_service/vision_provider.h +++ b/code/ryzom/server/src/frontend_service/vision_provider.h @@ -84,6 +84,8 @@ class CClientIdLookup; // Hash function: ClientId * 256 + CeId struct CHash { + static const size_t bucket_size = 4; + static const size_t min_buckets = 8; size_t operator() ( TPairClientSlot pair ) const { return (pair.ClientId << 8) + pair.Slot; } }; diff --git a/code/ryzom/server/src/general_utilities_service/service_main.cpp b/code/ryzom/server/src/general_utilities_service/service_main.cpp index 7a19d90b7..af61c4c71 100644 --- a/code/ryzom/server/src/general_utilities_service/service_main.cpp +++ b/code/ryzom/server/src/general_utilities_service/service_main.cpp @@ -34,7 +34,9 @@ #include "service_main.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #endif // NL_OS_WINDOWS diff --git a/code/ryzom/server/src/gpm_service/commands.cpp b/code/ryzom/server/src/gpm_service/commands.cpp index 127074856..8e5c8d1b8 100644 --- a/code/ryzom/server/src/gpm_service/commands.cpp +++ b/code/ryzom/server/src/gpm_service/commands.cpp @@ -179,8 +179,8 @@ NLMISC_COMMAND(getPatatEntryIndex, "Get the patat entry index at a pos", "x, y") CVector pos; - pos.x = (float)atof(args[0].c_str()); - pos.y = (float)atof(args[1].c_str()); + NLMISC::fromString(args[0], pos.x); + NLMISC::fromString(args[1], pos.y); pos.z = 0; nlinfo("entryIndex(%.1f, %.1f) = %d", pos.x, pos.y, CWorldPositionManager::getEntryIndex(pos)); diff --git a/code/ryzom/server/src/gpm_service/gpm_service.cpp b/code/ryzom/server/src/gpm_service/gpm_service.cpp index 0756f641e..f6011fc82 100644 --- a/code/ryzom/server/src/gpm_service/gpm_service.cpp +++ b/code/ryzom/server/src/gpm_service/gpm_service.cpp @@ -50,7 +50,9 @@ #include "sheets.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #endif // NL_OS_WINDOWS diff --git a/code/ryzom/server/src/gpm_service/world_entity.cpp b/code/ryzom/server/src/gpm_service/world_entity.cpp index d9976a1c4..6debb6284 100644 --- a/code/ryzom/server/src/gpm_service/world_entity.cpp +++ b/code/ryzom/server/src/gpm_service/world_entity.cpp @@ -161,7 +161,7 @@ void CWorldEntity::init( const CEntityId& id, const TDataSetRow &index ) { _Type = Trigger; } - else if ( (id.getType() >= RYZOMID::npc ) || ( id.getType() <= RYZOMID::flora) ) + else if ((id.getType() >= RYZOMID::bot_ai_begin) && (id.getType() <= RYZOMID::bot_ai_end)) { _Type = AI; } diff --git a/code/ryzom/server/src/gpm_service/world_position_manager.cpp b/code/ryzom/server/src/gpm_service/world_position_manager.cpp index 2c10878a6..9674541fc 100644 --- a/code/ryzom/server/src/gpm_service/world_position_manager.cpp +++ b/code/ryzom/server/src/gpm_service/world_position_manager.cpp @@ -504,7 +504,7 @@ void CWorldPositionManager::triggerSubscribe(NLNET::TServiceId serviceId, const STOP_IF(IsRingShard,"Illegal use of CWorldPositionManager on ring shard"); if (_PatatSubscribeManager.exist(name)) { - _PatatSubscribeManager.subscribe(serviceId, make_pair(name, id)); + _PatatSubscribeManager.subscribe(serviceId, std::pair(name, id)); } } @@ -2113,7 +2113,7 @@ void CWorldPositionManager::movePlayer(CWorldEntity *entity, sint32 x, sint32 y, { if (entity->PlayerInfos->DistanceHistory.size() >= 20) entity->PlayerInfos->DistanceHistory.pop_back(); - entity->PlayerInfos->DistanceHistory.push_front(make_pair(CVectorD(x*0.001, y*0.001, z*0.001), tick)); + entity->PlayerInfos->DistanceHistory.push_front(std::pair(CVectorD(x*0.001, y*0.001, z*0.001), tick)); } #endif @@ -3227,7 +3227,7 @@ void CWorldPositionManager::visionRequest(sint32 x, sint32 y, sint32 range, vect if (abs(x - entity->X) < range && abs(y - entity->Y) < range && (rrange = sqrt(sqr((x - entity->X)*0.001) + sqr((y - entity->Y)*0.001))) < frange) { - entities.push_back(make_pair(entity->Id, (sint32)(rrange*1000))); + entities.push_back(std::pair(entity->Id, (sint32)(rrange * 1000))); } } @@ -3240,7 +3240,7 @@ void CWorldPositionManager::visionRequest(sint32 x, sint32 y, sint32 range, vect if (abs(x - entity->X) < range && abs(y - entity->Y) < range && (rrange = sqrt(sqr((x - entity->X)*0.001) + sqr((y - entity->Y)*0.001))) < frange) { - entities.push_back(make_pair(entity->Id, (sint32)(rrange*1000))); + entities.push_back(std::pair(entity->Id, (sint32)(rrange * 1000))); } } } diff --git a/code/ryzom/server/src/gpm_service/world_position_manager.h b/code/ryzom/server/src/gpm_service/world_position_manager.h index 75ea9ead5..81209357c 100644 --- a/code/ryzom/server/src/gpm_service/world_position_manager.h +++ b/code/ryzom/server/src/gpm_service/world_position_manager.h @@ -137,10 +137,11 @@ public: //friend void CWorldEntity::createPrimitive(NLPACS::UMoveContainer *pMoveContainer, uint8 worldImage); friend void CWorldEntity::removePrimitive(); - class CEntityIdHash + struct CEntityIdHash { - public: - size_t operator () ( const NLMISC::CEntityId &id ) const { return (uint32)id.getShortId(); } + enum { bucket_size = 4, min_buckets = 8, }; + size_t operator () (const NLMISC::CEntityId &id) const { return (uint32)id.getShortId(); } + size_t operator () (const NLMISC::CEntityId &left, const NLMISC::CEntityId &right) const { return left < right; } }; /// Container of entities (all entities are referenced by this container 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 50c58fce6..aedfa063f 100644 --- a/code/ryzom/server/src/input_output_service/chat_manager.cpp +++ b/code/ryzom/server/src/input_output_service/chat_manager.cpp @@ -94,21 +94,21 @@ void CChatManager::onServiceDown(const std::string &serviceShortName) switch (cg.Type) { - case CChatGroup::universe: - case CChatGroup::say: - case CChatGroup::shout: - continue; - case CChatGroup::team: - case CChatGroup::guild: - case CChatGroup::civilization: - case CChatGroup::territory: - case CChatGroup::tell: - case CChatGroup::arround: - case CChatGroup::system: - case CChatGroup::region: - case CChatGroup::dyn_chat: - groupToRemove.push_back(gid); - break; + case CChatGroup::universe: + case CChatGroup::say: + case CChatGroup::shout: + continue; + case CChatGroup::team: + case CChatGroup::guild: + case CChatGroup::civilization: + case CChatGroup::territory: + case CChatGroup::tell: + case CChatGroup::arround: + case CChatGroup::system: + case CChatGroup::region: + case CChatGroup::dyn_chat: + groupToRemove.push_back(gid); + break; } } @@ -121,7 +121,7 @@ void CChatManager::onServiceDown(const std::string &serviceShortName) // clear muted players table _MutedUsers.clear(); - + // clear the dyn chats _DynChat.removeAllChannels(); } @@ -151,9 +151,11 @@ bool CChatManager::checkClient( const TDataSetRow& id ) void CChatManager::addClient( const TDataSetRow& id ) { if (VerboseChatManagement) - nldebug("IOSCM: addClient : adding client %s:%x into chat manager and universe group.", + { + nldebug("IOSCM: addClient : adding client %s:%x into chat manager and universe group.", TheDataset.getEntityId(id).toString().c_str(), id.getIndex()); + } if(id.getIndex() == 0xffffff) { @@ -197,10 +199,11 @@ void CChatManager::addClient( const TDataSetRow& id ) void CChatManager::removeClient( const TDataSetRow& id ) { if (VerboseChatManagement) - nldebug("IOSCM: removeClient : removing the client %s:%x from chat manager !", + { + nldebug("IOSCM: removeClient : removing the client %s:%x from chat manager !", TheDataset.getEntityId(id).toString().c_str(), id.getIndex()); - + } TClientInfoCont::iterator itCl = _Clients.find( id ); if( itCl != _Clients.end() ) @@ -214,7 +217,7 @@ void CChatManager::removeClient( const TDataSetRow& id ) } else { - nlwarning("CChatManager::removeClient : The client %s:%x is unknown !", + nlwarning("CChatManager::removeClient : The client %s:%x is unknown !", TheDataset.getEntityId(id).toString().c_str(), id.getIndex()); } @@ -233,7 +236,7 @@ CChatClient& CChatManager::getClient( const TDataSetRow& id ) TClientInfoCont::iterator itCl = _Clients.find( id ); if( itCl != _Clients.end() ) { - return *(itCl->second); + return *(itCl->second); } else { @@ -259,15 +262,15 @@ void CChatManager::addGroup( TGroupId gId, CChatGroup::TGroupType gType, const s { if (!groupName.empty()) nldebug("IOSCM: addGroup : adding %s named chat group %s as '%s'", - CChatGroup::groupTypeToString(gType).c_str(), + CChatGroup::groupTypeToString(gType).c_str(), gId.toString().c_str(), groupName.c_str()); else nldebug("IOSCM: addGroup : adding %s anonymous chat group %s", - CChatGroup::groupTypeToString(gType).c_str(), + CChatGroup::groupTypeToString(gType).c_str(), gId.toString().c_str()); } - + map< TGroupId, CChatGroup >::iterator itGrp = _Groups.find( gId ); if( itGrp == _Groups.end() ) { @@ -290,7 +293,7 @@ void CChatManager::addGroup( TGroupId gId, CChatGroup::TGroupType gType, const s { nlwarning("CChatManager::addGroup : the group %s already exists", gId.toString().c_str()); } - + } // addGroup // @@ -302,8 +305,10 @@ void CChatManager::addGroup( TGroupId gId, CChatGroup::TGroupType gType, const s void CChatManager::removeGroup( TGroupId gId ) { if (VerboseChatManagement) + { nldebug("IOSCM: removeGroup : removing group %s", gId.toString().c_str()); + } map< TGroupId, CChatGroup >::iterator itGrp = _Groups.find( gId ); if( itGrp != _Groups.end() ) @@ -338,10 +343,12 @@ void CChatManager::removeGroup( TGroupId gId ) void CChatManager::addToGroup( TGroupId gId, const TDataSetRow &charId ) { if (VerboseChatManagement) + { nldebug("IOSCM: addtoGroup : adding player %s:%x to group %s", TheDataset.getEntityId(charId).toString().c_str(), charId.getIndex(), gId.toString().c_str()); + } map< TGroupId, CChatGroup >::iterator itGrp = _Groups.find( gId ); if( itGrp != _Groups.end() ) @@ -372,7 +379,7 @@ void CChatManager::addToGroup( TGroupId gId, const TDataSetRow &charId ) } else { - nlwarning("CChatManager::addToGroup : client %s:%x is unknown", + nlwarning("CChatManager::addToGroup : client %s:%x is unknown", TheDataset.getEntityId(charId).toString().c_str(), charId.getIndex()); // remove it from the group (don't leave bad client...) @@ -396,10 +403,12 @@ void CChatManager::addToGroup( TGroupId gId, const TDataSetRow &charId ) void CChatManager::removeFromGroup( TGroupId gId, const TDataSetRow &charId ) { if (VerboseChatManagement) + { nldebug("IOSCM: removeFromGroup : removing player %s:%x from group %s", TheDataset.getEntityId(charId).toString().c_str(), - charId.getIndex(), + charId.getIndex(), gId.toString().c_str()); + } map< TGroupId, CChatGroup >::iterator itGrp = _Groups.find( gId ); if( itGrp != _Groups.end() ) @@ -443,7 +452,7 @@ void CChatManager::removeFromGroup( TGroupId gId, const TDataSetRow &charId ) } // removeFromGroup // - + //----------------------------------------------- @@ -477,16 +486,16 @@ void CChatManager::chat( const TDataSetRow& sender, const ucstring& ucstr ) { // if( itCl->second->isMuted() ) CEntityId eid = TheDataset.getEntityId(sender); - if(_MutedUsers.find( eid ) != _MutedUsers.end()) + if(_MutedUniverseUsers.find( eid ) != _MutedUniverseUsers.end()) { - nldebug("IOSCM: chat The player %s:%x is muted", + nldebug("IOSCM: chat The player %s:%x is universe muted", TheDataset.getEntityId(sender).toString().c_str(), sender.getIndex()); return; } // CEntityId eid = TheDataset.getEntityId(sender); - // Get the char info + // Get the char info //WARNING: can be NULL CCharacterInfos *ci = IOS->getCharInfos(eid); @@ -525,7 +534,7 @@ void CChatManager::chat( const TDataSetRow& sender, const ucstring& ucstr ) // clean up container _DestUsers.clear(); - + switch( itCl->second->getChatMode() ) { // dynamic group @@ -533,7 +542,7 @@ void CChatManager::chat( const TDataSetRow& sender, const ucstring& ucstr ) case CChatGroup::say : { CChatGroup::TMemberCont::iterator itA; - for( itA = itCl->second->getAudience().Members.begin(); + for( itA = itCl->second->getAudience().Members.begin(); itA != itCl->second->getAudience().Members.end(); ++itA ) { @@ -566,7 +575,7 @@ void CChatManager::chat( const TDataSetRow& sender, const ucstring& ucstr ) // so even after teleporting in a remote region the previous around people were still receiving // the messages. - TGroupId grpId = itCl->second->getRegionChatGroup(); + TGroupId grpId = itCl->second->getRegionChatGroup(); _DestUsers.push_back(grpId); _Log.displayNL("'%s' (%s) : \t\"%s\"", senderName.c_str(), groupNames[itCl->second->getChatMode()], ucstr.toString().c_str() ); @@ -599,7 +608,7 @@ void CChatManager::chat( const TDataSetRow& sender, const ucstring& ucstr ) // } // } - TGroupId grpId = CEntityId(RYZOMID::chatGroup,0); + TGroupId grpId = CEntityId(RYZOMID::chatGroup, 0); _Log.displayNL("'%s' (%s) : \t\"%s\"", senderName.c_str(), groupNames[itCl->second->getChatMode()], ucstr.toString().c_str() ); _DestUsers.push_back(grpId); @@ -621,15 +630,15 @@ void CChatManager::chat( const TDataSetRow& sender, const ucstring& ucstr ) TGroupId grpId = itCl->second->getGuildChatGroup(); _DestUsers.push_back(grpId); - _Log.displayNL("'%s' (%s) : \t\"%s\"", - senderName.c_str(), - groupNames[itCl->second->getChatMode()], + _Log.displayNL("'%s' (%s) : \t\"%s\"", + senderName.c_str(), + groupNames[itCl->second->getChatMode()], ucstr.toString().c_str() ); chatInGroup( grpId, ucstr, sender ); } break; case CChatGroup::dyn_chat: - { + { TChanID chanID = itCl->second->getDynChatChan(); CDynChatSession *session = _DynChat.getSession(chanID, sender); if (session) // player must have a session in that channel @@ -650,7 +659,7 @@ void CChatManager::chat( const TDataSetRow& sender, const ucstring& ucstr ) if (!session->getChan()->getDontBroadcastPlayerInputs()) { - // add msg to the historic + // add msg to the historic CDynChatChan::CHistoricEntry entry; entry.String = ucstr; if (ci != NULL) @@ -671,15 +680,15 @@ void CChatManager::chat( const TDataSetRow& sender, const ucstring& ucstr ) ucstring tmp("{no_bubble}"); if (ucstr.find(tmp) == ucstring::npos) { - tmp += ucstr; + tmp += ucstr; content.swap(tmp); } else { content = ucstr; } - } - + } + // broadcast to other client in the channel CDynChatSession *dcc = session->getChan()->getFirstSession(); @@ -687,7 +696,7 @@ void CChatManager::chat( const TDataSetRow& sender, const ucstring& ucstr ) { sendChat(itCl->second->getChatMode(), dcc->getClient()->getID(), content, sender, chanID); dcc = dcc->getNextChannelSession(); // next session in this channel - } + } } else { @@ -702,11 +711,11 @@ void CChatManager::chat( const TDataSetRow& sender, const ucstring& ucstr ) TPlayerInputForward pif; pif.ChanID = chanID; pif.Sender = sender; - pif.Content = ucstr; + pif.Content = ucstr; CMessage msgout( "DYN_CHAT:FORWARD"); msgout.serial(pif); - + CUnifiedNetwork::getInstance()->send(serviceId, msgout); } if (session->getChan()->getUnifiedChannel()) @@ -716,19 +725,19 @@ void CChatManager::chat( const TDataSetRow& sender, const ucstring& ucstr ) IChatUnifierClient::getInstance()->sendUnifiedDynChat(session->getChan()->getID(), senderName, ucstr); } } - } + } } break; // static group default : nlwarning(" client %u chat in %s ! don't know how to handle it.", - sender.getIndex(), + sender.getIndex(), groupNames[itCl->second->getChatMode()]); /* { TGroupId grpId = itCl->second.getChatGroup(); _Log.displayNL("'%s' (%s) : \t\"%s\"", senderName.c_str(), groupNames[itCl->second.getChatMode()], ucstr.toString().c_str() ); - + chatInGroup( grpId, ucstr, sender ); } */ } @@ -736,8 +745,8 @@ void CChatManager::chat( const TDataSetRow& sender, const ucstring& ucstr ) // log chat to PDS system // IOSPD::logChat(ucstr, itCl->second->getId(), _DestUsers); log_Chat_Chat(CChatGroup::groupTypeToString(itCl->second->getChatMode()), - TheDataset.getEntityId(sender), - ucstr.toUtf8(), + TheDataset.getEntityId(sender), + ucstr.toUtf8(), _DestUsers); } @@ -770,7 +779,7 @@ void CChatManager::chatInGroup( TGroupId& grpId, const ucstring& ucstr, const TD CMirrorPropValueRO instanceId( TheDataset, *itM, DSPropertyAI_INSTANCE ); // check the ai instance for region chat - if (chatGrp.Type != CChatGroup::region + if (chatGrp.Type != CChatGroup::region || instanceId == senderInstanceId) { // check homeSessionId for universe @@ -795,7 +804,7 @@ void CChatManager::chatInGroup( TGroupId& grpId, const ucstring& ucstr, const TD _DestUsers.push_back(TheDataset.getEntityId(*itM)); } } - } + } if (chatGrp.Type == CChatGroup::guild) { @@ -855,7 +864,7 @@ void CChatManager::farChatInGroup(TGroupId &grpId, uint32 homeSessionId, const u continue; } sendFarChat( itGrp->second.Type, *itM, text, senderName ); - } + } } else { @@ -885,7 +894,7 @@ void CChatManager::chat2( const TDataSetRow& sender, const std::string &phraseId case CChatGroup::shout : { CChatGroup::TMemberCont::iterator itA; - for( itA = itCl->second->getAudience().Members.begin(); + for( itA = itCl->second->getAudience().Members.begin(); itA != itCl->second->getAudience().Members.end(); ++itA ) { @@ -900,7 +909,7 @@ void CChatManager::chat2( const TDataSetRow& sender, const std::string &phraseId chatInGroup2( grpId, phraseId, sender ); } break; - + case CChatGroup::universe: { @@ -937,7 +946,7 @@ void CChatManager::chat2( const TDataSetRow& sender, const std::string &phraseId { nlwarning(" client %s:%x chat in mode %u ! don't know how to handle it.", TheDataset.getEntityId(sender).toString().c_str(), - sender.getIndex(), + sender.getIndex(), itCl->second->getChatMode()); } } @@ -973,7 +982,7 @@ void CChatManager::chatParam( const TDataSetRow& sender, const std::string &phra case CChatGroup::shout : { CChatGroup::TMemberCont::iterator itA; - for( itA = itCl->second->getAudience().Members.begin(); + for( itA = itCl->second->getAudience().Members.begin(); itA != itCl->second->getAudience().Members.end(); ++itA ) { @@ -988,7 +997,7 @@ void CChatManager::chatParam( const TDataSetRow& sender, const std::string &phra chatParamInGroup( grpId, phraseId, params, sender ); } break; - + case CChatGroup::universe: { @@ -1025,7 +1034,7 @@ void CChatManager::chatParam( const TDataSetRow& sender, const std::string &phra { nlwarning(" client %s:%x chat in mode %u ! don't know how to handle it.", TheDataset.getEntityId(sender).toString().c_str(), - sender.getIndex(), + sender.getIndex(), itCl->second->getChatMode()); } } @@ -1049,7 +1058,7 @@ void CChatManager::chat2Ex( const TDataSetRow& sender, uint32 phraseId) CEntityId eid = TheDataset.getEntityId(sender); if(_MutedUsers.find( eid ) != _MutedUsers.end()) { - nldebug("IOSCM: chat2Ex The player %s:%x is muted", + nldebug("IOSCM: chat2Ex The player %s:%x is muted", TheDataset.getEntityId(sender).toString().c_str(), sender.getIndex()); return; @@ -1061,7 +1070,7 @@ void CChatManager::chat2Ex( const TDataSetRow& sender, uint32 phraseId) case CChatGroup::shout : { CChatGroup::TMemberCont::iterator itA; - for( itA = itCl->second->getAudience().Members.begin(); + for( itA = itCl->second->getAudience().Members.begin(); itA != itCl->second->getAudience().Members.end(); ++itA ) { @@ -1076,7 +1085,7 @@ void CChatManager::chat2Ex( const TDataSetRow& sender, uint32 phraseId) chatInGroup2Ex( grpId, phraseId, sender ); } break; - + case CChatGroup::universe: { CEntityId eid = TheDataset.getEntityId(sender); @@ -1098,21 +1107,21 @@ void CChatManager::chat2Ex( const TDataSetRow& sender, uint32 phraseId) chatInGroup2Ex( grpId, phraseId, sender ); } break; - + case CChatGroup::guild: { TGroupId grpId = itCl->second->getGuildChatGroup(); chatInGroup2Ex( grpId, phraseId, sender ); } break; - - + + // static group default : { nlwarning(" client %s:%x chat in mode %u ! don't know how to handle it.", TheDataset.getEntityId(sender).toString().c_str(), - sender.getIndex(), + sender.getIndex(), itCl->second->getChatMode()); // TGroupId grpId = (*itCl).second.getChatGroup(); // chatInGroup2( grpId, phraseId, sender ); @@ -1141,7 +1150,7 @@ void CChatManager::chatInGroup2Ex( TGroupId& grpId, uint32 phraseId, const TData { CMirrorPropValueRO instanceId( TheDataset, *itM, DSPropertyAI_INSTANCE ); - if (chatGrp.Type != CChatGroup::region + if (chatGrp.Type != CChatGroup::region || instanceId == senderInstanceId) { const CEntityId &eid = TheDataset.getEntityId(*itM); @@ -1184,14 +1193,14 @@ void CChatManager::chatInGroup2( TGroupId& grpId, const std::string & phraseId, CMirrorPropValueRO instanceId( TheDataset, *itM, DSPropertyAI_INSTANCE ); // check the ai instance for region chat - if (chatGrp.Type != CChatGroup::region + if (chatGrp.Type != CChatGroup::region || instanceId == senderInstanceId) { const CEntityId &eid = TheDataset.getEntityId(*itM); if (eid.getType() == RYZOMID::player && std::find( excluded.begin(), excluded.end(), *itM ) == excluded.end() ) sendChat2( (*itGrp ).second.Type, *itM, phraseId, sender ); } - } + } if (chatGrp.Type == CChatGroup::guild) { CCharacterInfos *charInfos = IOS->getCharInfos(TheDataset.getEntityId(sender)); @@ -1232,7 +1241,7 @@ void CChatManager::chatParamInGroup( TGroupId& grpId, const std::string & phrase if (eid.getType() == RYZOMID::player && std::find( excluded.begin(), excluded.end(), *itM ) == excluded.end() ) sendChat2( (*itGrp ).second.Type, *itM, phraseId, sender ); } - } + } if (chatGrp.Type == CChatGroup::guild) { CCharacterInfos *charInfos = IOS->getCharInfos(TheDataset.getEntityId(sender)); @@ -1278,10 +1287,10 @@ void CChatManager::sendEmoteTextToAudience( const TDataSetRow& sender,const std TChanID oldChan = itCl->second->getDynChatChan(); itCl->second->setChatMode(CChatGroup::say); itCl->second->updateAudience(); - + // get audience around the emoting player CChatGroup::TMemberCont::iterator itA; - for( itA = itCl->second->getAudience().Members.begin(); + for( itA = itCl->second->getAudience().Members.begin(); itA != itCl->second->getAudience().Members.end(); ++itA ) { @@ -1329,10 +1338,10 @@ void CChatManager::sendEmoteCustomTextToAll( const TDataSetRow& sender, const uc TChanID oldChan = itCl->second->getDynChatChan(); itCl->second->setChatMode(CChatGroup::say); itCl->second->updateAudience(); - + // get audience around the emoting player CChatGroup::TMemberCont::iterator itA; - for( itA = itCl->second->getAudience().Members.begin(); + for( itA = itCl->second->getAudience().Members.begin(); itA != itCl->second->getAudience().Members.end(); ++itA ) { @@ -1347,7 +1356,7 @@ void CChatManager::sendEmoteCustomTextToAll( const TDataSetRow& sender, const uc TheDataset.getEntityId(sender).toString().c_str(), sender.getIndex()); } - + } @@ -1386,7 +1395,7 @@ void CChatManager::sendEmoteCustomTextToAll( const TDataSetRow& sender, const uc // bms.serial( index ); // bms.serial( infos->Str ); // } -// +// //// nldebug(" sending association [%s,%d] to %s",infos->Str.c_str(),index,receiver.toString().c_str()); // msgout.serialBufferWithSize((uint8*)bms.buffer(), bms.length()); // sendMessageViaMirror(frontendId, msgout); @@ -1406,7 +1415,7 @@ void CChatManager::sendEmoteCustomTextToAll( const TDataSetRow& sender, const uc // //----------------------------------------------- void CChatManager::sendChat( CChatGroup::TGroupType senderChatMode, const TDataSetRow &receiver, const ucstring& ucstr, const TDataSetRow &sender, TChanID chanID, const ucstring &senderName) -{ +{ //if( receiver != sender ) { CCharacterInfos * charInfos = NULL; @@ -1440,14 +1449,14 @@ void CChatManager::sendChat( CChatGroup::TGroupType senderChatMode, const TDataS } uint32 senderNameIndex; - // if the sender exists + // if the sender exists if( charInfos ) { senderNameIndex = charInfos->NameIndex; } else { - // if no sender, we use a special name + // if no sender, we use a special name ucstring senderName(""); senderNameIndex = SM->storeString( senderName ); } @@ -1466,14 +1475,14 @@ void CChatManager::sendChat( CChatGroup::TGroupType senderChatMode, const TDataS msgout.serial( channel ); CBitMemStream bms; GenericXmlMsgHeaderMngr.pushNameToStream( "STRING:CHAT", bms ); - + CChatMsg chatMsg; chatMsg.CompressedIndex = sender.getCompressedIndex(); chatMsg.SenderNameId = senderNameIndex; chatMsg.ChatMode = (uint8) senderChatMode; if (senderChatMode == CChatGroup::dyn_chat) - { - chatMsg.DynChatChanID = chanID; + { + chatMsg.DynChatChanID = chanID; } chatMsg.Content = ucstr; bms.serial( chatMsg ); @@ -1483,7 +1492,7 @@ void CChatManager::sendChat( CChatGroup::TGroupType senderChatMode, const TDataS chatMsg.Sender, receiver.toString().c_str(), chatMsg.ChatMode); - */ + */ msgout.serialBufferWithSize((uint8*)bms.buffer(), bms.length()); sendMessageViaMirror(TServiceId(receiverInfos->EntityId.getDynamicId()), msgout); } @@ -1500,7 +1509,7 @@ void CChatManager::sendChat( CChatGroup::TGroupType senderChatMode, const TDataS nlwarning(" The character %s:%x is unknown, no chat msg sent", TheDataset.getEntityId(receiver).toString().c_str(), receiver.getIndex()); - } + } } } // sendChat // @@ -1526,14 +1535,14 @@ void CChatManager::sendFarChat( CChatGroup::TGroupType senderChatMode, const TDa msgout.serial( channel ); CBitMemStream bms; GenericXmlMsgHeaderMngr.pushNameToStream( "STRING:CHAT", bms ); - + CChatMsg chatMsg; chatMsg.CompressedIndex = 0xFFFFF; chatMsg.SenderNameId = senderNameIndex; chatMsg.ChatMode = (uint8) senderChatMode; if (senderChatMode == CChatGroup::dyn_chat) - { - chatMsg.DynChatChanID = chanID; + { + chatMsg.DynChatChanID = chanID; } chatMsg.Content = ucstr; bms.serial( chatMsg ); @@ -1554,7 +1563,7 @@ void CChatManager::sendFarChat( CChatGroup::TGroupType senderChatMode, const TDa nlwarning(" The character %s:%x is unknown, no chat msg sent", TheDataset.getEntityId(receiver).toString().c_str(), receiver.getIndex()); - } + } } @@ -1584,7 +1593,7 @@ void CChatManager::sendChatParam( CChatGroup::TGroupType senderChatMode, const T { TVectorParamCheck params2; params2.resize( params.size() + 1); - // send the chat phrase to the client + // send the chat phrase to the client params2[0].Type = STRING_MANAGER::bot; params2[0].setEId( TheDataset.getEntityId(sender) ); uint32 first = 0, last = (uint32)params.size(); @@ -1643,7 +1652,7 @@ void CChatManager::sendChat2Ex( CChatGroup::TGroupType senderChatMode, const TDa msgout.serial( channel ); CBitMemStream bms; GenericXmlMsgHeaderMngr.pushNameToStream( "STRING:CHAT2", bms ); - + CChatMsg2 chatMsg; chatMsg.CompressedIndex = sender.getCompressedIndex(); chatMsg.SenderNameId = charInfos ? charInfos->NameIndex : 0; // empty string if there is no sender @@ -1651,7 +1660,7 @@ void CChatManager::sendChat2Ex( CChatGroup::TGroupType senderChatMode, const TDa chatMsg.PhraseId = phraseId; chatMsg.CustomTxt = customTxt; bms.serial( chatMsg ); - + msgout.serialBufferWithSize((uint8*)bms.buffer(), bms.length()); CUnifiedNetwork::getInstance()->send(TServiceId(receiverInfos->EntityId.getDynamicId()), msgout); } @@ -1677,9 +1686,9 @@ void CChatManager::sendChat2Ex( CChatGroup::TGroupType senderChatMode, const TDa // //----------------------------------------------- void CChatManager::sendChatCustomEmote( const TDataSetRow &sender, const TDataSetRow &receiver, const ucstring& ucstr ) -{ +{ TDataSetRow senderFake = TDataSetRow::createFromRawIndex( INVALID_DATASET_ROW ); - + CCharacterInfos * receiverInfos = IOS->getCharInfos( TheDataset.getEntityId(receiver) ); CCharacterInfos * senderInfos = IOS->getCharInfos( TheDataset.getEntityId(sender) ); if( receiverInfos ) @@ -1698,7 +1707,7 @@ void CChatManager::sendChatCustomEmote( const TDataSetRow &sender, const TDataSe { return; } - + // send the string to FE CMessage msgout( "IMPULS_CH_ID" ); uint8 channel = 1; @@ -1707,7 +1716,7 @@ void CChatManager::sendChatCustomEmote( const TDataSetRow &sender, const TDataSe msgout.serial( channel ); CBitMemStream bms; GenericXmlMsgHeaderMngr.pushNameToStream( "STRING:CHAT", bms ); - + CChatMsg chatMsg; chatMsg.CompressedIndex = senderFake.getCompressedIndex(); chatMsg.SenderNameId = 0; @@ -1785,7 +1794,7 @@ void CChatManager::tell2( const TDataSetRow& sender, const TDataSetRow& receiver TheDataset.getEntityId(receiver).toString().c_str() ); return; } - + // check if the sender is CSR or is not in the ignore list of the receiver if(senderInfos->HavePrivilege || !itCl->second->isInIgnoreList(sender) ) { @@ -1802,10 +1811,10 @@ void CChatManager::tell2( const TDataSetRow& sender, const TDataSetRow& receiver msgout.serial( channel ); CBitMemStream bms; GenericXmlMsgHeaderMngr.pushNameToStream( "STRING:TELL2", bms); - + bms.serial( senderInfos->NameIndex ); bms.serial( id); - + msgout.serialBufferWithSize((uint8*)bms.buffer(), bms.length()); CUnifiedNetwork::getInstance()->send(TServiceId(receiverInfos->EntityId.getDynamicId()), msgout); } @@ -1938,8 +1947,8 @@ void CChatManager::tell( const TDataSetRow& sender, const string& receiverIn, co */ _Log.displayNL("'%s' to '%s' (%s) : \t\"%s\"", senderName.c_str(), receiverName.c_str(), "tell", ucstr.toString().c_str() ); - - + + // if the client doesn't know this dynamic string(name of sender), we send it to him // send the string to FE CMessage msgout( "IMPULS_CH_ID" ); @@ -1948,12 +1957,12 @@ void CChatManager::tell( const TDataSetRow& sender, const string& receiverIn, co msgout.serial( channel ); CBitMemStream bms; GenericXmlMsgHeaderMngr.pushNameToStream( "STRING:TELL", bms); - + TDataSetIndex dsi = senderInfos->DataSetIndex.getCompressedIndex(); bms.serial( dsi ); bms.serial( senderInfos->NameIndex ); bms.serial( const_cast(ucstr) ); - + msgout.serialBufferWithSize((uint8*)bms.buffer(), bms.length()); sendMessageViaMirror(TServiceId(receiverInfos->EntityId.getDynamicId()), msgout); @@ -2088,8 +2097,8 @@ void CChatManager::farTell( const NLMISC::CEntityId &senderCharId, const ucstrin string receiverName = receiverInfos->Name.toString(); _Log.displayNL("'%s' to '%s' (%s) : \t\"%s\"", senderName.toUtf8().c_str(), receiverName.c_str(), "tell", ucstr.toString().c_str() ); - - + + // if the client doesn't know this dynamic string(name of sender), we send it to him // send the string to FE CMessage msgout( "IMPULS_CH_ID" ); @@ -2103,7 +2112,7 @@ void CChatManager::farTell( const NLMISC::CEntityId &senderCharId, const ucstrin ftm.SenderName = senderName; ftm.Text = ucstr; ftm.serial(bms); - + msgout.serialBufferWithSize((uint8*)bms.buffer(), bms.length()); sendMessageViaMirror(TServiceId(receiverInfos->EntityId.getDynamicId()), msgout); @@ -2134,19 +2143,19 @@ void CChatManager::displayChatClients(NLMISC::CLog &log) if (ci != NULL) { if (ci->EntityId.getType() == RYZOMID::player) - log.displayNL("'%s' %s:%x %s mode '%s'", - ci->Name.toString().c_str(), - ci->EntityId.toString().c_str(), - im->first.getIndex(), - im->second->isMuted()?"(muted)":"", + log.displayNL("'%s' %s:%x %s mode '%s'", + ci->Name.toString().c_str(), + ci->EntityId.toString().c_str(), + im->first.getIndex(), + im->second->isMuted()?"(muted)":"", CChatGroup::groupTypeToString(im->second->getChatMode()).c_str() ); } else { - log.displayNL("*no name* %s:%x %s mode '%s'", - ci->EntityId.toString().c_str(), - im->first.getIndex(), - im->second->isMuted()?"(muted)":"", + log.displayNL("*no name* %s:%x %s mode '%s'", + ci->EntityId.toString().c_str(), + im->first.getIndex(), + im->second->isMuted()?"(muted)":"", CChatGroup::groupTypeToString(im->second->getChatMode()).c_str() ); } } @@ -2157,17 +2166,17 @@ void CChatManager::displayChatGroup(NLMISC::CLog &log, TGroupId gid, CChatGroup { if (chatGroup.GroupName == CStringMapper::emptyId()) { - log.displayNL("Group : anonym (%s), %s : %u clients :", + log.displayNL("Group : anonym (%s), %s : %u clients :", gid.toString().c_str(), - CChatGroup::groupTypeToString(chatGroup.Type).c_str(), + CChatGroup::groupTypeToString(chatGroup.Type).c_str(), chatGroup.Members.size()); } else { - log.displayNL("Group : '%s' (%s), %s : %u clients :", + log.displayNL("Group : '%s' (%s), %s : %u clients :", CStringMapper::unmap(chatGroup.GroupName).c_str(), - gid.toString().c_str(), - CChatGroup::groupTypeToString(chatGroup.Type).c_str(), + gid.toString().c_str(), + CChatGroup::groupTypeToString(chatGroup.Type).c_str(), chatGroup.Members.size()); } @@ -2179,12 +2188,12 @@ void CChatManager::displayChatGroup(NLMISC::CLog &log, TGroupId gid, CChatGroup { CCharacterInfos *ci = IOS->getCharInfos(TheDataset.getEntityId(*first)); if (ci != NULL) - log.displayNL(" '%s' %s:%x", - ci->Name.toString().c_str(), + log.displayNL(" '%s' %s:%x", + ci->Name.toString().c_str(), ci->EntityId.toString().c_str(), first->getIndex()); else - log.displayNL(" *unknow* %s:%x", + log.displayNL(" *unknow* %s:%x", eid.toString().c_str(), first->getIndex()); } @@ -2262,13 +2271,13 @@ void CChatManager::displayChatAudience(NLMISC::CLog &log, const CEntityId &eid, { CCharacterInfos *ci = IOS->getCharInfos(TheDataset.getEntityId(*first)); if (ci != NULL) - log.displayNL(" '%s' %s:%x", - ci->Name.toString().c_str(), + log.displayNL(" '%s' %s:%x", + ci->Name.toString().c_str(), TheDataset.getEntityId(*first).toString().c_str(), first->getIndex()); - + else - log.displayNL(" *unknow* %s:%x", + log.displayNL(" *unknow* %s:%x", TheDataset.getEntityId(*first).toString().c_str(), first->getIndex()); } @@ -2301,9 +2310,9 @@ ucstring CChatManager::filterClientInputColorCode(ucstring &text) { ucstring result; result.reserve(text.size()); - + ucstring::size_type pos = 0; - + for (; pos < text.size(); ++pos) { if (text[pos] == '@' && pos < text.size()-1 && text[pos+1] == '{') @@ -2316,7 +2325,7 @@ ucstring CChatManager::filterClientInputColorCode(ucstring &text) result += text[pos]; } } - + return result; } @@ -2340,7 +2349,7 @@ ucstring CChatManager::filterClientInput(ucstring &text) bool lastIsWhite = false; for (; pos < text.size(); ++pos) { - bool currentIsWhite = (text[pos] == ' ' || text[pos] == '\t'); + bool currentIsWhite = (text[pos] == ' ' || text[pos] == '\t'); if (!(lastIsWhite && currentIsWhite)) { // any double white skipped @@ -2353,7 +2362,7 @@ ucstring CChatManager::filterClientInput(ucstring &text) hasBrackets = (text[pos-1] == '>') && (text[pos-5] == '<'); } - // Filter out '&' at the first non-whitespace position to remove + // Filter out '&' at the first non-whitespace position to remove // system color code (like '&SYS&' ) bool disallowAmpersand = (result.size() == 0) || hasBrackets; if (disallowAmpersand) diff --git a/code/ryzom/server/src/input_output_service/chat_manager.h b/code/ryzom/server/src/input_output_service/chat_manager.h index 9e2d20e8c..544dbfa2c 100644 --- a/code/ryzom/server/src/input_output_service/chat_manager.h +++ b/code/ryzom/server/src/input_output_service/chat_manager.h @@ -42,14 +42,14 @@ - + /** * CChatManager * \author Stephane Coutelas * \author Nevrax France * \date 2002 */ -class CChatManager +class CChatManager { public : @@ -72,7 +72,7 @@ public : */ void init( /*const std::string& staticDBFileName, const std::string& dynDBFileName*/ ); - /** A service has gone down + /** A service has gone down */ void onServiceDown(const std::string &serviceShortName); @@ -80,7 +80,7 @@ public : * Reset ChatLog management */ void resetChatLog(); - + /** * Check if the client is already registered in the chat manager. */ @@ -102,7 +102,7 @@ public : * \param id is the client character id */ CChatClient& getClient( const TDataSetRow& id ); //throw (EChatClient); - + /** * Return a reference on the static database */ @@ -195,7 +195,7 @@ public : void chat2( const TDataSetRow& sender, const std::string &phraseId ); - + /** * Transmit a chat message * \param sender is the id of the talking char @@ -334,7 +334,7 @@ public : private : - + typedef std::map< TDataSetRow, CChatClient*> TClientInfoCont; /// client infos TClientInfoCont _Clients; @@ -377,7 +377,7 @@ protected: friend void cbNpcTellEx( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId ); friend void cbDynChatServiceChat( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId ); friend void cbDynChatServiceTell( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId ); - + public: /** * Send a chat message @@ -389,7 +389,7 @@ public: * \param senderName Can be used to replace the sender name with a specific string */ void sendChat( CChatGroup::TGroupType senderChatMode, const TDataSetRow &receiver, const ucstring& ucstr, const TDataSetRow &sender = TDataSetRow(), TChanID chanID = NLMISC::CEntityId::Unknown, const ucstring &senderName = ucstring()); - + /** * Send a far chat message diff --git a/code/ryzom/server/src/input_output_service/input_output_service.cpp b/code/ryzom/server/src/input_output_service/input_output_service.cpp index d58de20a4..de3d73458 100644 --- a/code/ryzom/server/src/input_output_service/input_output_service.cpp +++ b/code/ryzom/server/src/input_output_service/input_output_service.cpp @@ -47,7 +47,9 @@ */ #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #endif // NL_OS_WINDOWS diff --git a/code/ryzom/server/src/input_output_service/string_manager_parser.cpp b/code/ryzom/server/src/input_output_service/string_manager_parser.cpp index 67ce62f10..2aa3c896b 100644 --- a/code/ryzom/server/src/input_output_service/string_manager_parser.cpp +++ b/code/ryzom/server/src/input_output_service/string_manager_parser.cpp @@ -650,7 +650,7 @@ bool CStringManager::parseBlock(const ucstring &block, CPhrase &phrase) && (first - clause.String.begin()) == (sint) clause.Replacements[repCount].InsertPlace) { // check parameter type - char *subst; + const char *subst; uint paramIndex = clause.Replacements[repCount].ParamIndex; TParamId ¶mId = phrase.Params[paramIndex]->ParamId; @@ -1356,7 +1356,7 @@ void CStringManager::mergeEntityWords(CEntityWords& dest, const CEntityWords& so std::map::const_iterator iti; for (iti=source._ColumnInfo.begin(); iti!=source._ColumnInfo.end(); ++iti) if (dest._ColumnInfo.find((*iti).first) == dest._ColumnInfo.end()) - extraColumns.push_back(std::make_pair((*iti).first, osz+(uint32)extraColumns.size())); + extraColumns.push_back(std::pair((*iti).first, osz + (uint32)extraColumns.size())); for (iti=source._RowInfo.begin(); iti!=source._RowInfo.end(); ++iti) if (dest._RowInfo.find((*iti).first) == dest._RowInfo.end()) diff --git a/code/ryzom/server/src/log_analyser_service/log_analyser_service.cpp b/code/ryzom/server/src/log_analyser_service/log_analyser_service.cpp index 3725299d6..823a8d1e4 100644 --- a/code/ryzom/server/src/log_analyser_service/log_analyser_service.cpp +++ b/code/ryzom/server/src/log_analyser_service/log_analyser_service.cpp @@ -20,7 +20,9 @@ #include #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #endif // NL_OS_WINDOWS diff --git a/code/ryzom/server/src/logger_service/logger_service.cpp b/code/ryzom/server/src/logger_service/logger_service.cpp index dba4cae57..cb51c6a6d 100644 --- a/code/ryzom/server/src/logger_service/logger_service.cpp +++ b/code/ryzom/server/src/logger_service/logger_service.cpp @@ -36,7 +36,9 @@ #include "log_storage.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #endif // NL_OS_WINDOWS diff --git a/code/ryzom/server/src/mail_forum_service/mail_forum_service.cpp b/code/ryzom/server/src/mail_forum_service/mail_forum_service.cpp index 20c32173e..f902251e9 100644 --- a/code/ryzom/server/src/mail_forum_service/mail_forum_service.cpp +++ b/code/ryzom/server/src/mail_forum_service/mail_forum_service.cpp @@ -25,7 +25,9 @@ #include "hof_generator.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #endif // NL_OS_WINDOWS diff --git a/code/ryzom/server/src/mirror_service/data_set_ms.h b/code/ryzom/server/src/mirror_service/data_set_ms.h index 4e40557ad..4fc9a4bfc 100644 --- a/code/ryzom/server/src/mirror_service/data_set_ms.h +++ b/code/ryzom/server/src/mirror_service/data_set_ms.h @@ -338,7 +338,7 @@ public: // If changing this struct, don't forget to change the places where it is initialized TSharedListRow Next; T Value; -#ifdef NL_OS_WINDOWS +#ifdef NL_COMP_VC }; #else } __attribute__((packed)); @@ -409,7 +409,7 @@ void push_front( const NLMISC::CEntityId& value ); // If changing this struct, don't forget to change the places where it is initialized TSharedListRow Next; uint64 Value; -#ifdef NL_OS_WINDOWS +#ifdef NL_COMP_VC }; #else } __attribute__((packed)); diff --git a/code/ryzom/server/src/mirror_service/mirror_service.cpp b/code/ryzom/server/src/mirror_service/mirror_service.cpp index 9d1952cc7..d29ca4f3d 100644 --- a/code/ryzom/server/src/mirror_service/mirror_service.cpp +++ b/code/ryzom/server/src/mirror_service/mirror_service.cpp @@ -25,7 +25,9 @@ #include #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #endif // NL_OS_WINDOWS diff --git a/code/ryzom/server/src/monitor_service/client.cpp b/code/ryzom/server/src/monitor_service/client.cpp index 6d761ba3e..ce2fdc5dc 100644 --- a/code/ryzom/server/src/monitor_service/client.cpp +++ b/code/ryzom/server/src/monitor_service/client.cpp @@ -273,7 +273,7 @@ void CMonitorClient::update () TYPE_NAME_STRING_ID id = Str[i]; std::map::iterator ite = StringMap.find (id); nlassert (ite != StringMap.end()); - strToSend.push_back( make_pair(id, &((*ite).second)) ); + strToSend.push_back(std::pair(id, &((*ite).second))); strTotalSize += 4+4+(uint)(*ite).second.size(); } diff --git a/code/ryzom/server/src/monitor_service/service_main.cpp b/code/ryzom/server/src/monitor_service/service_main.cpp index 0ad027d86..bf092bbae 100644 --- a/code/ryzom/server/src/monitor_service/service_main.cpp +++ b/code/ryzom/server/src/monitor_service/service_main.cpp @@ -28,7 +28,9 @@ #include "messages.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include # include typedef unsigned long ulong; @@ -390,7 +392,15 @@ void clientAuthentication(CMessage &msgin, TSockId from, CCallbackNetBase &netba { if (strlen(row[0]) > 2) { - std::string salt = std::string(row[0], row[0] + 2); + std::string salt; + if (row[0][0] == '$') + { + salt = std::string(row[0], row[0] + 19); + } + else + { + salt = std::string(row[0], row[0] + 2); + } std::string cryptedVersion = CCrypt::crypt(password, salt); if (cryptedVersion == row[0]) { @@ -408,7 +418,9 @@ void clientAuthentication(CMessage &msgin, TSockId from, CCallbackNetBase &netba // fail the authentication // Do not send result immediatly to avoid a potential hacker // to try a dictionnary or that dort of things - BadLoginClients.insert(std::make_pair(NLMISC::CTime::getLocalTime() + LOGIN_RETRY_DELAY_IN_MILLISECONDS, Clients[i])); + BadLoginClients.insert(std::pair >( + NLMISC::CTime::getLocalTime() + LOGIN_RETRY_DELAY_IN_MILLISECONDS, + (NLMISC::CRefPtr)Clients[i])); Clients[i]->BadLogin =true; return; } diff --git a/code/ryzom/server/src/patchman_service/service_main.cpp b/code/ryzom/server/src/patchman_service/service_main.cpp index c26ac0924..8bf99a275 100644 --- a/code/ryzom/server/src/patchman_service/service_main.cpp +++ b/code/ryzom/server/src/patchman_service/service_main.cpp @@ -36,8 +36,10 @@ #include "patchman_tester.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX -# include +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif +# include #endif // NL_OS_WINDOWS diff --git a/code/ryzom/server/src/patchman_service/spa_server_patch_applier.cpp b/code/ryzom/server/src/patchman_service/spa_server_patch_applier.cpp index 63d5eced8..cd3703766 100644 --- a/code/ryzom/server/src/patchman_service/spa_server_patch_applier.cpp +++ b/code/ryzom/server/src/patchman_service/spa_server_patch_applier.cpp @@ -62,9 +62,9 @@ NLMISC::CVariable SpaLaunchAESCmdLine("spa","SpaLaunchAESCmdLine","Comma // some handy utils //----------------------------------------------------------------------------- -static NLMISC::CSString defaultAdminExecutorServiceCfgFileName() +static NLMISC::CSString defaultAdminExecutorServiceCfgFileName(const NLMISC::CSString& domainName) { - return NLMISC::CPath::standardizePath(DeploymentRootDirectory)+"admin_executor_service_default.cfg"; + return NLMISC::CPath::standardizePath(DeploymentRootDirectory)+"admin_executor_service_default."+domainName+".cfg"; } static NLMISC::CSString defaultScreenCfgFileName() @@ -572,7 +572,7 @@ void CServerPatchApplier::cbDeploymentConfigurationSynchronised(NLNET::IModulePr // setup the base for the admin_executor_service config file CSString adminExecutorConfig; - adminExecutorConfig.readFromFile(defaultAdminExecutorServiceCfgFileName()); + adminExecutorConfig.readFromFile(defaultAdminExecutorServiceCfgFileName(*dit)); adminExecutorConfig+="\n\nShardName=\""+*dit+"\";\n"; CSString aesRegisteredServices; CSString aesAddRegisteredServices; diff --git a/code/ryzom/server/src/pd_lib/db_description_parser.cpp b/code/ryzom/server/src/pd_lib/db_description_parser.cpp index 175000cf2..55eb4a3d6 100644 --- a/code/ryzom/server/src/pd_lib/db_description_parser.cpp +++ b/code/ryzom/server/src/pd_lib/db_description_parser.cpp @@ -260,7 +260,7 @@ bool CDBDescriptionParser::loadType(xmlNodePtr node) return false; } - typeNode.EnumValues.push_back(make_pair(name, value)); + typeNode.EnumValues.push_back(std::pair(name, value)); if (typeNode.Dimension <= value) typeNode.Dimension = value; diff --git a/code/ryzom/server/src/pd_lib/pd_lib.cpp b/code/ryzom/server/src/pd_lib/pd_lib.cpp index f57a4be62..1a2cda9ba 100644 --- a/code/ryzom/server/src/pd_lib/pd_lib.cpp +++ b/code/ryzom/server/src/pd_lib/pd_lib.cpp @@ -571,7 +571,7 @@ void CPDSLib::update() CMessage* msgupd = new CMessage("PD_UPDATE"); msgupd->serial(_DatabaseId); msgupd->serial(_UpdateId); - _QueuedMessages.push_back(make_pair(_UpdateId, msgupd)); + _QueuedMessages.push_back(std::pair(_UpdateId, msgupd)); ++_UpdateId; // serial queue diff --git a/code/ryzom/server/src/pd_lib/pd_messages.cpp b/code/ryzom/server/src/pd_lib/pd_messages.cpp index 253855d46..b5e731d95 100644 --- a/code/ryzom/server/src/pd_lib/pd_messages.cpp +++ b/code/ryzom/server/src/pd_lib/pd_messages.cpp @@ -504,7 +504,7 @@ bool CUpdateLog::selectMessages(const CDBDescriptionParser& description, const N if (message.getType() == CDbMessage::PushContext) { - contextsStart.push_back(std::make_pair(msg, false)); + contextsStart.push_back(std::pair(msg, false)); } else if (message.getType() == CDbMessage::PopContext) { @@ -561,7 +561,7 @@ bool CUpdateLog::selectMessages(const CDBDescriptionParser& description, const s if (message.getType() == CDbMessage::PushContext) { - contextsStart.push_back(std::make_pair(msg, false)); + contextsStart.push_back(std::pair(msg, false)); } else if (message.getType() == CDbMessage::PopContext) { @@ -644,7 +644,7 @@ bool CUpdateLog::selectMessages(const CDBDescriptionParser& description, const N if (message.getType() == CDbMessage::PushContext) { - contextsStart.push_back(std::make_pair(msg, false)); + contextsStart.push_back(std::pair(msg, false)); } else if (message.getType() == CDbMessage::PopContext) { diff --git a/code/ryzom/server/src/pd_lib/pd_string_mapper.cpp b/code/ryzom/server/src/pd_lib/pd_string_mapper.cpp index 184d4bb7f..7a326dc67 100644 --- a/code/ryzom/server/src/pd_lib/pd_string_mapper.cpp +++ b/code/ryzom/server/src/pd_lib/pd_string_mapper.cpp @@ -64,7 +64,7 @@ void CPDStringMapper::setMapping(const std::string& str, uint32 id) return; } - its = _StringMap.insert(std::make_pair(lowMapStr, id)).first; + its = _StringMap.insert(std::pair(lowMapStr, id)).first; _IdMap[id] = its; } diff --git a/code/ryzom/server/src/pd_lib/pd_utils.h b/code/ryzom/server/src/pd_lib/pd_utils.h index 73a0268d8..85a183753 100644 --- a/code/ryzom/server/src/pd_lib/pd_utils.h +++ b/code/ryzom/server/src/pd_lib/pd_utils.h @@ -490,13 +490,16 @@ typedef std::vector TIndexList; struct CColumnIndexHashMapTraits { - static const size_t bucket_size = 4; - static const size_t min_buckets = 8; + enum { bucket_size = 4, min_buckets = 8, }; CColumnIndexHashMapTraits() { } size_t operator() (const CColumnIndex &id) const - { - return id.hash(); - } + { + return id.hash(); + } + bool operator()(const CColumnIndex &left, const CColumnIndex &right) + { + return left < right; + } }; class CSetMap diff --git a/code/ryzom/server/src/pd_reference_builder/reference_builder_service.cpp b/code/ryzom/server/src/pd_reference_builder/reference_builder_service.cpp index 6bb687e8e..20eda6c18 100644 --- a/code/ryzom/server/src/pd_reference_builder/reference_builder_service.cpp +++ b/code/ryzom/server/src/pd_reference_builder/reference_builder_service.cpp @@ -21,7 +21,9 @@ #include "delta_builder_task.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #endif // NL_OS_WINDOWS diff --git a/code/ryzom/server/src/pd_support_service/service_main.cpp b/code/ryzom/server/src/pd_support_service/service_main.cpp index 81bb66f94..447f8f2c4 100644 --- a/code/ryzom/server/src/pd_support_service/service_main.cpp +++ b/code/ryzom/server/src/pd_support_service/service_main.cpp @@ -34,7 +34,9 @@ #include "service_main.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #endif // NL_OS_WINDOWS diff --git a/code/ryzom/server/src/pd_support_service/stat_user_file_list_builders.cpp b/code/ryzom/server/src/pd_support_service/stat_user_file_list_builders.cpp index 8f4f1e07f..45c172384 100644 --- a/code/ryzom/server/src/pd_support_service/stat_user_file_list_builders.cpp +++ b/code/ryzom/server/src/pd_support_service/stat_user_file_list_builders.cpp @@ -20,6 +20,7 @@ //------------------------------------------------------------------------------------------------- #include +#include #include "game_share/utils.h" #include "stat_file_list_builder_factory.h" #include "stat_globals.h" @@ -522,7 +523,7 @@ FILE_LIST_BUILDER(NewestFile,"remove all but the latest file for each account (a uint32 accountId= accountIds[i]; uint32& bestTime= bestTimes[accountId]; uint32 timeStamp= fdc[i].FileTimeStamp; - if (bestTime!=timeStamp || bestTime==~0u) + if (bestTime!=timeStamp || bestTime==std::numeric_limits::max()) { fdc.removeFile(i); continue; diff --git a/code/ryzom/server/src/persistant_data_service/pds_database.cpp b/code/ryzom/server/src/persistant_data_service/pds_database.cpp index 66b272d5c..84148220b 100644 --- a/code/ryzom/server/src/persistant_data_service/pds_database.cpp +++ b/code/ryzom/server/src/persistant_data_service/pds_database.cpp @@ -905,14 +905,16 @@ bool CDatabase::set(RY_PDS::TTableIndex table, RY_PDS::TRowIndex row, RY_PDS::TC case PDS_float: { - float data = (float)atof(value.c_str()); + float data; + NLMISC::fromString(value, data); return set(table, row, column, sizeof(data), &data); } break; case PDS_double: { - double data = (double)atof(value.c_str()); + double data; + NLMISC::fromString(value, data); return set(table, row, column, sizeof(data), &data); } break; diff --git a/code/ryzom/server/src/persistant_data_service/persistant_data_service.cpp b/code/ryzom/server/src/persistant_data_service/persistant_data_service.cpp index 8a7a9cd6a..9fb21d1c9 100644 --- a/code/ryzom/server/src/persistant_data_service/persistant_data_service.cpp +++ b/code/ryzom/server/src/persistant_data_service/persistant_data_service.cpp @@ -19,7 +19,9 @@ #include "db_manager.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #endif // NL_OS_WINDOWS diff --git a/code/ryzom/server/src/ryzom_admin_service/ryzom_admin_service.cpp b/code/ryzom/server/src/ryzom_admin_service/ryzom_admin_service.cpp index a7c1b6f66..54701aff7 100644 --- a/code/ryzom/server/src/ryzom_admin_service/ryzom_admin_service.cpp +++ b/code/ryzom/server/src/ryzom_admin_service/ryzom_admin_service.cpp @@ -22,7 +22,9 @@ #include "nel/net/service.h" #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #endif // NL_OS_WINDOWS diff --git a/code/ryzom/server/src/ryzom_welcome_service/ryzom_welcome_service.cpp b/code/ryzom/server/src/ryzom_welcome_service/ryzom_welcome_service.cpp index 1656f34c1..1de6677cb 100644 --- a/code/ryzom/server/src/ryzom_welcome_service/ryzom_welcome_service.cpp +++ b/code/ryzom/server/src/ryzom_welcome_service/ryzom_welcome_service.cpp @@ -21,6 +21,7 @@ #include #include +#include #include "nel/misc/debug.h" #include "nel/misc/config_file.h" @@ -912,7 +913,7 @@ void cbLSChooseShard (CMessage &msgin, const std::string &serviceName, TServiceI } - string ret = lsChooseShard(userName, cookie, userPriv, userExtended, WS::TUserRole::ur_player, 0xffffffff, ~0); + string ret = lsChooseShard(userName, cookie, userPriv, userExtended, WS::TUserRole::ur_player, 0xffffffff, std::numeric_limits::max()); if (!ret.empty()) { diff --git a/code/ryzom/server/src/server_share/continent_container.h b/code/ryzom/server/src/server_share/continent_container.h index 7edfb0c96..6e65b3dc4 100644 --- a/code/ryzom/server/src/server_share/continent_container.h +++ b/code/ryzom/server/src/server_share/continent_container.h @@ -162,7 +162,7 @@ public: /// Init whole continent container void init(uint gridWidth, uint gridHeight, double primitiveMaxSize, uint nbWorldImages, const std::string &packedSheetsDirectory, double cellSize=0.0, bool loadPacsPrims = true); - + /// Build sheets void buildSheets(const std::string &packedSheetsDirectory); diff --git a/code/ryzom/server/src/server_share/logger_service_client.cpp b/code/ryzom/server/src/server_share/logger_service_client.cpp index e8174e0cd..d94834d12 100644 --- a/code/ryzom/server/src/server_share/logger_service_client.cpp +++ b/code/ryzom/server/src/server_share/logger_service_client.cpp @@ -238,8 +238,8 @@ namespace LGS // create the log context closing _LogInfos.push_back(TLogInfo()); _LogInfos.back().setLogName(contextName); - // tag as 'closing' with ~0 - _LogInfos.back().setTimeStamp(~0); + // tag as 'closing' with std::numeric_limits::max() + _LogInfos.back().setTimeStamp(std::numeric_limits::max()); } --_NbOpenContext; if (VerboseLogger) diff --git a/code/ryzom/server/src/server_share/msg_ai_service.h b/code/ryzom/server/src/server_share/msg_ai_service.h index bd4115f4a..13c6a3423 100644 --- a/code/ryzom/server/src/server_share/msg_ai_service.h +++ b/code/ryzom/server/src/server_share/msg_ai_service.h @@ -88,7 +88,7 @@ public: virtual void description () { className ("CUserEventMsg"); - property ("InstanceNumber", PropUInt32, uint32(~0), InstanceNumber); + property ("InstanceNumber", PropUInt32, std::numeric_limits::max(), InstanceNumber); property ("GrpAlias", PropUInt32, uint32(0xffffffff), GrpAlias); property ("EventId", PropUInt8, uint8(0xff), EventId); propertyCont ("Params", PropString, Params); @@ -133,7 +133,7 @@ public: virtual void description () { className ("CSetEscortTeamId"); - property ("InstanceNumber", PropUInt32, uint32(~0), InstanceNumber); + property ("InstanceNumber", PropUInt32, std::numeric_limits::max(), InstanceNumber); propertyCont ("Groups", PropUInt32, Groups); property ("TeamId", PropUInt16, CTEAM::InvalidTeamId, TeamId); } diff --git a/code/ryzom/server/src/server_share/mysql_wrapper.cpp b/code/ryzom/server/src/server_share/mysql_wrapper.cpp index 5b993b56e..3bb343314 100644 --- a/code/ryzom/server/src/server_share/mysql_wrapper.cpp +++ b/code/ryzom/server/src/server_share/mysql_wrapper.cpp @@ -116,7 +116,7 @@ namespace MSW if (MSWAutoReconnect) { addOption(MYSQL_OPT_RECONNECT, "1"); - } + } return _connect(); } diff --git a/code/ryzom/server/src/server_share/pet_interface_msg.h b/code/ryzom/server/src/server_share/pet_interface_msg.h index d2f9e64a2..f404a76ef 100644 --- a/code/ryzom/server/src/server_share/pet_interface_msg.h +++ b/code/ryzom/server/src/server_share/pet_interface_msg.h @@ -25,6 +25,7 @@ #include "game_share/synchronised_message.h" #include "game_share/mirror.h" +#include // Pet interface message class for AIS / EGS communication @@ -47,7 +48,7 @@ public: virtual void description () { className ("CPetSpawnMsg"); - property ("AIInstanceId", PropUInt32, (uint32)~0, AIInstanceId); + property ("AIInstanceId", PropUInt32, std::numeric_limits::max(), AIInstanceId); property ("SpawnMode", PropUInt16, (uint16)NEAR_PLAYER, SpawnMode); property ("CharacterMirrorRow", PropDataSetRow, TDataSetRow(), CharacterMirrorRow); property ("PetSheetId", PropSheetId, NLMISC::CSheetId::Unknown, PetSheetId); diff --git a/code/ryzom/server/src/server_share/r2_vision.cpp b/code/ryzom/server/src/server_share/r2_vision.cpp index 7433e9026..dd4b2a25d 100644 --- a/code/ryzom/server/src/server_share/r2_vision.cpp +++ b/code/ryzom/server/src/server_share/r2_vision.cpp @@ -147,8 +147,8 @@ namespace R2_VISION void CUniverse::createInstance(uint32 aiInstance, uint32 groupId) { - // just ignore attempts to create the ~0u instance - if (aiInstance==~0u) + // just ignore attempts to create the std::numeric_limits::max() instance + if (aiInstance==std::numeric_limits::max()) { return; } @@ -172,8 +172,8 @@ namespace R2_VISION void CUniverse::removeInstance(uint32 aiInstance) { - // just ignore attempts to remove the ~0u instance - if (aiInstance==~0u) + // just ignore attempts to remove the std::numeric_limits::max() instance + if (aiInstance==std::numeric_limits::max()) { return; } @@ -227,7 +227,7 @@ namespace R2_VISION SUniverseEntity& theEntity= _Entities[row]; // if the entity was already allocated then remove it - if (theEntity.AIInstance == ~0u) { return; } + if (theEntity.AIInstance == std::numeric_limits::max()) { return; } if ( theEntity.ViewerRecord) { @@ -325,8 +325,8 @@ namespace R2_VISION BOMB_IF(row>=_Entities.size(),NLMISC::toString("Ignoring attempt to set entity position with invalid row value: %d",row),return); // ensure that the new AIInstance exists - BOMB_IF(aiInstance!=~0u && (aiInstance>=_Instances.size() || _Instances[aiInstance]==NULL), - NLMISC::toString("ERROR: Failed to add entity %d to un-initialised instance: %d",row,aiInstance),aiInstance=~0u); + BOMB_IF(aiInstance!=std::numeric_limits::max() && (aiInstance>=_Instances.size() || _Instances[aiInstance]==NULL), + NLMISC::toString("ERROR: Failed to add entity %d to un-initialised instance: %d",row,aiInstance),aiInstance=std::numeric_limits::max()); // delegate to workhorse routine (converting y coordinate to +ve axis) _teleportEntity(dataSetRow,aiInstance,x,-y,invisibilityLevel); @@ -429,7 +429,7 @@ namespace R2_VISION SUniverseEntity& theEntity= _Entities[row]; // if the entity was already allocated then remove it - if (theEntity.AIInstance!=~0u) + if (theEntity.AIInstance!=std::numeric_limits::max()) { _removeEntity(dataSetRow); } @@ -455,7 +455,7 @@ namespace R2_VISION { // detach the entity from the instance it's currently in _Instances[theEntity.AIInstance]->removeEntity(theEntity); - theEntity.AIInstance= ~0u; + theEntity.AIInstance= std::numeric_limits::max(); theEntity.ViewerRecord= NULL; } } @@ -466,8 +466,8 @@ namespace R2_VISION SUniverseEntity& theEntity= _Entities[dataSetRow.getIndex()]; #ifdef NL_DEBUG - nlassert(theEntity.AIInstance==~0u || theEntity.AIInstance<_Instances.size()); - nlassert(theEntity.AIInstance==~0u || _Instances[theEntity.AIInstance]!=NULL); + nlassert(theEntity.AIInstance==std::numeric_limits::max() || theEntity.AIInstance<_Instances.size()); + nlassert(theEntity.AIInstance==std::numeric_limits::max() || _Instances[theEntity.AIInstance]!=NULL); #endif // if the entity is a viewer then move the view coordinates @@ -477,7 +477,7 @@ namespace R2_VISION } // if the entity is not currently in an AIInstance then stop here - if (theEntity.AIInstance==~0u) + if (theEntity.AIInstance==std::numeric_limits::max()) return; // set the instance entity record position @@ -498,10 +498,10 @@ namespace R2_VISION // set the new AIInstance value for the entity theEntity.AIInstance= aiInstance; - // if the aiInstance is set to ~0u (a reserved value) then we stop here - if (aiInstance==~0u) + // if the aiInstance is set to std::numeric_limits::max() (a reserved value) then we stop here + if (aiInstance==std::numeric_limits::max()) { - // clear out the vision for an entity in aiInstance ~0u + // clear out the vision for an entity in aiInstance std::numeric_limits::max() if (getEntity(dataSetRow)->ViewerRecord!=NULL) { TVision emptyVision(2); @@ -785,7 +785,7 @@ namespace R2_VISION // locate the old vision group (the one we're allocated to before isolation) uint32 visionId= viewerRecord->VisionId; NLMISC::CSmartPtr& oldVisionGroup= _VisionGroups[visionId]; - BOMB_IF(visionId>=_VisionGroups.size() ||oldVisionGroup==NULL,"Trying to remove entity from vision group with unknown vision id",viewerRecord->VisionId=~0u;return); + BOMB_IF(visionId>=_VisionGroups.size() ||oldVisionGroup==NULL,"Trying to remove entity from vision group with unknown vision id",viewerRecord->VisionId=std::numeric_limits::max();return); // if we're the only viewer then already isolated so just return if (oldVisionGroup->numViewers()==1) @@ -830,7 +830,7 @@ namespace R2_VISION if (viewerRecord!=NULL) { uint32 visionId= viewerRecord->VisionId; - BOMB_IF(visionId>=_VisionGroups.size() ||_VisionGroups[visionId]==NULL,"Trying to remove entity with unknown vision id",viewerRecord->VisionId=~0u;return); + BOMB_IF(visionId>=_VisionGroups.size() ||_VisionGroups[visionId]==NULL,"Trying to remove entity with unknown vision id",viewerRecord->VisionId=std::numeric_limits::max();return); _VisionGroups[visionId]->removeViewer(viewerRecord); } @@ -847,8 +847,8 @@ namespace R2_VISION _Entities.pop_back(); // invalidate the InstanceIndex value for the entity we just removed - entity.InstanceIndex=~0u; - entity.AIInstance=~0u; + entity.InstanceIndex=std::numeric_limits::max(); + entity.AIInstance=std::numeric_limits::max(); } void CInstance::release() @@ -899,11 +899,11 @@ namespace R2_VISION CVisionGroup::CVisionGroup() { - _XMin=~0u; + _XMin=std::numeric_limits::max(); _XMax=0; - _YMin=~0u; + _YMin=std::numeric_limits::max(); _YMax=0; - _VisionId=~0u; + _VisionId=std::numeric_limits::max(); // setup the dummy entry in the vision buffer _Vision.reserve(AllocatedVisionVectorSize); vectAppend(_Vision).DataSetRow= ZeroDataSetRow; @@ -923,8 +923,8 @@ namespace R2_VISION // ensure that the viewer wasn't aleady attached to another vision group #ifdef NL_DEBUG nlassert(viewer!=NULL); - nlassert(viewer->VisionId==~0u); - nlassert(viewer->VisionIndex==~0u); + nlassert(viewer->VisionId==std::numeric_limits::max()); + nlassert(viewer->VisionIndex==std::numeric_limits::max()); #endif TEST(("add viewer %d to grp %d",viewer->getViewerId().getIndex(),_VisionId)); @@ -961,8 +961,8 @@ namespace R2_VISION // pop the back entry off the vector and flag oursleves as unused _Viewers.pop_back(); - viewer->VisionId= ~0u; - viewer->VisionIndex= ~0u; + viewer->VisionId= std::numeric_limits::max(); + viewer->VisionIndex= std::numeric_limits::max(); // NOTE: after this the boundary may be out of date - this will be recalculated at the next // vision update so we don't take time to do it here @@ -1171,8 +1171,8 @@ namespace R2_VISION return; // calculate the bouding box for our viewers - uint32 xmin= ~0u; - uint32 ymin= ~0u; + uint32 xmin= std::numeric_limits::max(); + uint32 ymin= std::numeric_limits::max(); uint32 xmax= 0; uint32 ymax= 0; for (uint32 i=(uint32)_Viewers.size();i--;) @@ -1247,7 +1247,7 @@ namespace R2_VISION // reset the vision vector and add in the dummy entry with DataSetRow=0 _Vision.resize(AllocatedVisionVectorSize); _Vision[0].DataSetRow= ZeroDataSetRow; - _Vision[0].VisionSlot= ~0u; + _Vision[0].VisionSlot= std::numeric_limits::max(); // setup a vision slot iterator for filling in the vision buffer (=1 to skip passed the dummy entry) uint32 nextVisionSlot=1; @@ -1380,8 +1380,8 @@ namespace R2_VISION CViewer::CViewer() { - VisionId=~0u; - VisionIndex=~0u; + VisionId=std::numeric_limits::max(); + VisionIndex=std::numeric_limits::max(); _VisionResetCount= 0; } @@ -1399,7 +1399,7 @@ namespace R2_VISION // setup the dummy entry with DataSetRow=0 _Vision[0].DataSetRow= ZeroDataSetRow; - _Vision[0].VisionSlot= ~0u; + _Vision[0].VisionSlot= std::numeric_limits::max(); // setup the vision slots in reverse order from 254..0 (because they're popped from the back) _FreeVisionSlots.clear(); diff --git a/code/ryzom/server/src/server_share/r2_vision.h b/code/ryzom/server/src/server_share/r2_vision.h index 9bf3f7689..9872e606a 100644 --- a/code/ryzom/server/src/server_share/r2_vision.h +++ b/code/ryzom/server/src/server_share/r2_vision.h @@ -140,7 +140,7 @@ namespace R2_VISION // ctor SViewedEntity() { - VisionSlot=~0u; + VisionSlot=std::numeric_limits::max(); } }; @@ -196,15 +196,15 @@ namespace R2_VISION struct SUniverseEntity { TDataSetRow DataSetRow; // the complete data set row for the entity - uint32 AIInstance; // the id of the instance that we're currently in (~0u by default) + uint32 AIInstance; // the id of the instance that we're currently in (std::numeric_limits::max() by default) mutable uint32 InstanceIndex; // the index within the instance's _Entities vector NLMISC::CSmartPtr ViewerRecord; // pointer to the CViewer record for viewers (or NULL) // ctor SUniverseEntity() { - AIInstance=~0u; - InstanceIndex=~0u; + AIInstance=std::numeric_limits::max(); + InstanceIndex=std::numeric_limits::max(); } }; diff --git a/code/ryzom/server/src/server_share/stl_allocator_checker.cpp b/code/ryzom/server/src/server_share/stl_allocator_checker.cpp index 893ff9cb3..daf9b79b6 100644 --- a/code/ryzom/server/src/server_share/stl_allocator_checker.cpp +++ b/code/ryzom/server/src/server_share/stl_allocator_checker.cpp @@ -27,12 +27,12 @@ bool EnableStlAllocatorChecker= true; NLMISC_VARIABLE(bool,EnableStlAllocatorChecker,"Enable stl allocator tests"); -uint32 StlAllocatorMaxFree= 0; -NLMISC_VARIABLE(uint32,StlAllocatorMaxFree,"When EnableStlAllocatorChecker is true, this value gives the largest number of free blocks encountered"); +uintptr_t StlAllocatorMaxFree= 0; +NLMISC_VARIABLE(uintptr_t,StlAllocatorMaxFree,"When EnableStlAllocatorChecker is true, this value gives the largest number of free blocks encountered"); -// setup a 'max iterations' value of 3GBytes/ sizeof(uint32*) +// setup a 'max iterations' value of 3GBytes/ sizeof(void*) (32bit) // => this is equivalent to the total addressable memory space under linux -static const uint32 MaxIterations= 768*1024*1024; +static const uintptr_t MaxIterations= 768*1024*1024; // the following static vector exists only for the use of the testStlMemoryAllocator() routine // - it is required to allow us to get hold of the stl small block memory allocator @@ -54,20 +54,20 @@ void testStlMemoryAllocator(const char* state) if (IsCrashed) return; // setup a pointer 'p' to the first block in the allocator's linked list of free blocks - std::vector::allocator_type allocator= StaticIntVector.get_allocator(); - uint32 *p; + std::vector::allocator_type allocator= StaticIntVector.get_allocator(); + uintptr_t *p; p= allocator.allocate(1); allocator.deallocate(p,1); - // setup a counter to 3GBytes/ sizeof(uint32*) => equivalent to the total addressable memory space under linux - uint32 counter= MaxIterations; + // setup a counter to 3GBytes/ sizeof(void*) (32bit) => equivalent to the total addressable memory space under linux + uintptr_t counter= MaxIterations; if (setjmp(Context) == 0) { do { // step forwards allong the linked list - p= (uint32*)*p; + p= (uintptr_t*)*p; // if the counter hits zero then we can assume that we're in an infinite loop if (--counter==0) @@ -78,7 +78,7 @@ void testStlMemoryAllocator(const char* state) // if we hit a NULL end of list terminator then return happily if (p==NULL) { - uint32 numIterations= MaxIterations- counter; + uintptr_t numIterations= MaxIterations- counter; StlAllocatorMaxFree= std::max(numIterations,StlAllocatorMaxFree); signal(SIGSEGV, NULL); return; @@ -88,7 +88,7 @@ void testStlMemoryAllocator(const char* state) // note that our memory allocators contain invalid data so any call to 'nlassert' etc may modify // data thta they shouldn't and make our debugging task harder // ... so just provoke an access violation - *(uint32**)(0) = p; + *(uintptr_t**)(0) = p; } // we just hit a crash case so setup flags / globals accordingly diff --git a/code/ryzom/server/src/server_share/used_continent.cpp b/code/ryzom/server/src/server_share/used_continent.cpp index 01ab2beda..9d2b48f0d 100644 --- a/code/ryzom/server/src/server_share/used_continent.cpp +++ b/code/ryzom/server/src/server_share/used_continent.cpp @@ -17,8 +17,9 @@ #include "stdpch.h" -#include #include "used_continent.h" +#include "nel/net/service.h" + using namespace std; using namespace NLMISC; @@ -105,7 +106,7 @@ uint32 CUsedContinent::getInstanceForContinent(const std::string &continentName) if (it != _Continents.end()) return it->ContinentInstance; else - return ~0; + return INVALID_AI_INSTANCE; } uint32 CUsedContinent::getInstanceForContinent(CONTINENT::TContinent continentEnum) const @@ -115,7 +116,7 @@ uint32 CUsedContinent::getInstanceForContinent(CONTINENT::TContinent continentEn if (it != _Continents.end()) return it->ContinentInstance; else - return ~0; + return INVALID_AI_INSTANCE; } const std::string &CUsedContinent::getContinentForInstance(uint32 instanceNumber) const diff --git a/code/ryzom/server/src/server_share/used_continent.h b/code/ryzom/server/src/server_share/used_continent.h index 150b6342c..412c133e3 100644 --- a/code/ryzom/server/src/server_share/used_continent.h +++ b/code/ryzom/server/src/server_share/used_continent.h @@ -21,6 +21,7 @@ #include "nel/misc/types_nl.h" #include "nel/net/service.h" #include "game_share/continent.h" +#include "game_share/misc_const.h" #include @@ -60,12 +61,12 @@ public: bool isContinentUsed(const std::string &continentName) const; /** Return the static instance number associated with a continent name. - * If the continent name is unknow, return ~0 + * If the continent name is unknow, return std::numeric_limits::max() */ uint32 getInstanceForContinent(const std::string &continentName) const; /** Return the static instance number associated with a continent enum value - * If the continent name is unknow, return ~0 + * If the continent name is unknow, return std::numeric_limits::max() */ uint32 getInstanceForContinent(CONTINENT::TContinent continentEnum) const; diff --git a/code/ryzom/server/src/shard_unifier_service/character_sync.cpp b/code/ryzom/server/src/shard_unifier_service/character_sync.cpp index 3b1a8b995..29b404567 100644 --- a/code/ryzom/server/src/shard_unifier_service/character_sync.cpp +++ b/code/ryzom/server/src/shard_unifier_service/character_sync.cpp @@ -365,7 +365,7 @@ namespace CHARSYNC for (; first != last; ++first) { // default to no limit - uint32 limit=~0u; + uint32 limit=std::numeric_limits::max(); // if there's a limit in the limis map then use it instead... if (limitsMap.find(first->first)!=limitsMap.end()) diff --git a/code/ryzom/server/src/shard_unifier_service/name_manager.cpp b/code/ryzom/server/src/shard_unifier_service/name_manager.cpp index 5b50f6359..17b500f92 100644 --- a/code/ryzom/server/src/shard_unifier_service/name_manager.cpp +++ b/code/ryzom/server/src/shard_unifier_service/name_manager.cpp @@ -1138,7 +1138,7 @@ bool CNameManager::loadGuildsNamesFromTxt() // merge the first words until we have only 3 words while (words.size() > 3) { - words[0] += words[1]; + words[0] += " " + words[1]; words.erase(words.begin()+1); } BOMB_IF (words.size()!=3,"Invalid line "<_FileName, ptr->_LineNum); ptr = _PtrList->getNextPtr(); @@ -107,7 +107,7 @@ namespace RSMGR nlstop; } // remove object from cache map - if (_UserId != NOPE::INVALID_OBJECT_ID + if (_UserId != NOPE::INVALID_OBJECT_ID && _ObjectState != NOPE::os_removed && _ObjectState != NOPE::os_transient) { @@ -424,7 +424,7 @@ namespace RSMGR if(_ObjectState == NOPE::os_released && state == NOPE::os_removed) { // a release object gets removed (e.g. by remove by id) - + // delete the object delete this; @@ -578,7 +578,7 @@ namespace RSMGR { nlwarning("ERROR : someone try to delete this object, but there are still ptr on it !"); CNelPermissionPtr *ptr = _PtrList; - do + do { nlwarning(" Pointer created from '%s', line %u", ptr->_FileName, ptr->_LineNum); ptr = _PtrList->getNextPtr(); @@ -586,16 +586,16 @@ namespace RSMGR nlstop; } // remove object from cache map - if (_Prim != NOPE::INVALID_OBJECT_ID + if (_PermissionId != NOPE::INVALID_OBJECT_ID && _ObjectState != NOPE::os_removed && _ObjectState != NOPE::os_transient) { - nldebug("NOPE: clearing CNelPermission @%p from cache with id %u", this, static_cast(_Prim)); - nlverify(_ObjectCache.erase(_Prim) == 1); + nldebug("NOPE: clearing CNelPermission @%p from cache with id %u", this, static_cast(_PermissionId)); + nlverify(_ObjectCache.erase(_PermissionId) == 1); } else if (_ObjectState != NOPE::os_transient) { - nlassert(_ObjectCache.find(_Prim) == _ObjectCache.end()); + nlassert(_ObjectCache.find(_PermissionId) == _ObjectCache.end()); } if (_ObjectState == NOPE::os_released) { @@ -626,18 +626,18 @@ namespace RSMGR { nlassert(getPersistentState() == NOPE::os_transient); - nlassert(_Prim != 0); + nlassert(_PermissionId != 0); std::string qs; qs = "INSERT INTO permission ("; - qs += "prim, UId, ClientApplication, ShardId, AccessPrivilege"; + qs += "PermissionId, UId, DomainId, ShardId, AccessPrivilege"; qs += ") VALUES ("; - qs += "'"+MSW::escapeString(NLMISC::toString(_Prim), connection)+"'"; + qs += "'"+MSW::escapeString(NLMISC::toString(_PermissionId), connection)+"'"; qs += ", "; qs += "'"+MSW::escapeString(NLMISC::toString(_UserId), connection)+"'"; qs += ", "; - qs += "'"+MSW::escapeString(NLMISC::toString(_DomainName), connection)+"'"; + qs += "'"+MSW::escapeString(NLMISC::toString(_DomainId), connection)+"'"; qs += ", "; qs += "'"+MSW::escapeString(NLMISC::toString(_ShardId), connection)+"'"; qs += ", "; @@ -670,17 +670,17 @@ namespace RSMGR std::string qs; qs = "UPDATE permission SET "; - qs += "prim = '"+MSW::escapeString(NLMISC::toString(_Prim), connection)+"'"; + qs += "PermissionId = '"+MSW::escapeString(NLMISC::toString(_PermissionId), connection)+"'"; qs += ", "; qs += "UId = '"+MSW::escapeString(NLMISC::toString(_UserId), connection)+"'"; qs += ", "; - qs += "ClientApplication = '"+MSW::escapeString(NLMISC::toString(_DomainName), connection)+"'"; + qs += "DomainId = '"+MSW::escapeString(NLMISC::toString(_DomainId), connection)+"'"; qs += ", "; qs += "ShardId = '"+MSW::escapeString(NLMISC::toString(_ShardId), connection)+"'"; qs += ", "; qs += "AccessPrivilege = '"+MSW::escapeString(NLMISC::toString(_AccessPriv), connection)+"'"; - qs += " WHERE prim = '"+NLMISC::toString(_Prim)+"'"; + qs += " WHERE PermissionId = '"+NLMISC::toString(_PermissionId)+"'"; if (connection.query(qs)) @@ -702,7 +702,7 @@ namespace RSMGR std::string qs; qs = "DELETE FROM permission "; - qs += " WHERE prim = '"+NLMISC::toString(_Prim)+"'"; + qs += " WHERE PermissionId = '"+NLMISC::toString(_PermissionId)+"'"; if (connection.query(qs)) @@ -736,7 +736,7 @@ namespace RSMGR std::string qs; qs = "DELETE FROM permission "; - qs += " WHERE prim = '"+NLMISC::toString(id)+"'"; + qs += " WHERE PermissionId = '"+NLMISC::toString(id)+"'"; if (connection.query(qs)) @@ -902,7 +902,7 @@ namespace RSMGR if(_ObjectState == NOPE::os_released && state == NOPE::os_removed) { // a release object gets removed (e.g. by remove by id) - + // delete the object delete this; @@ -912,12 +912,12 @@ namespace RSMGR if (_ObjectState == NOPE::os_transient && state != NOPE::os_transient) { - nldebug("NOPE: inserting CNelPermission @%p in cache with id %u", this, static_cast(_Prim)); - nlverify(_ObjectCache.insert(std::make_pair(_Prim, this)).second); + nldebug("NOPE: inserting CNelPermission @%p in cache with id %u", this, static_cast(_PermissionId)); + nlverify(_ObjectCache.insert(std::make_pair(_PermissionId, this)).second); } if (_ObjectState != NOPE::os_transient) - nlassert(_ObjectCache.find(_Prim) != _ObjectCache.end()); + nlassert(_ObjectCache.find(_PermissionId) != _ObjectCache.end()); _ObjectState = state; @@ -928,8 +928,8 @@ namespace RSMGR } else if (state == NOPE::os_removed) { - nldebug("NOPE: erasing CNelPermission @%p in cache with id %u", this, static_cast(_Prim)); - nlverify(_ObjectCache.erase(_Prim) == 1); + nldebug("NOPE: erasing CNelPermission @%p in cache with id %u", this, static_cast(_PermissionId)); + nlverify(_ObjectCache.erase(_PermissionId) == 1); } } @@ -945,11 +945,11 @@ namespace RSMGR std::string qs; qs = "SELECT "; - qs += "prim, UId, ClientApplication, ShardId, AccessPrivilege"; + qs += "PermissionId, UId, DomainId, ShardId, AccessPrivilege"; qs += " FROM permission"; - qs += " WHERE prim = '"+NLMISC::toString(id)+"'"; + qs += " WHERE PermissionId = '"+NLMISC::toString(id)+"'"; CNelPermissionPtr ret; if (!connection.query(qs)) { @@ -965,9 +965,9 @@ namespace RSMGR // ok, we have an object result->fetchRow(); - result->getField(0, ret->_Prim); + result->getField(0, ret->_PermissionId); result->getField(1, ret->_UserId); - result->getField(2, ret->_DomainName); + result->getField(2, ret->_DomainId); result->getField(3, ret->_ShardId); result->getField(4, ret->_AccessPriv); diff --git a/code/ryzom/server/src/shard_unifier_service/nel_database_mapping.h b/code/ryzom/server/src/shard_unifier_service/nel_database_mapping.h index 7ddd3de74..c33e4fe15 100644 --- a/code/ryzom/server/src/shard_unifier_service/nel_database_mapping.h +++ b/code/ryzom/server/src/shard_unifier_service/nel_database_mapping.h @@ -107,7 +107,7 @@ namespace RSMGR _PrevPtr(NULL) { _Ptr = objectPtr; - + linkPtr(); } @@ -247,7 +247,7 @@ namespace RSMGR _PrevPtr(NULL) { _Ptr = objectPtr; - + linkPtr(); } @@ -556,7 +556,7 @@ namespace RSMGR time_t _ReleaseDate; /// The linked list of pointer on this object - CNelUserPtr *_PtrList; + CNelUserPtr *_PtrList; // Try to load the specified object from the memory cache, return NULL if the object is not in the cache static CNelUser *loadFromCache(uint32 objectId, bool unrelease); @@ -583,7 +583,7 @@ namespace RSMGR } public: - + /** Return the object identifier (witch is unique) * You can only call this method on a persistent instance. * (because transient instance can have invalid id) @@ -625,18 +625,18 @@ namespace RSMGR }; - ///////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////// // WARNING : this is a generated file, don't change it ! ///////////////////////////////////////////////////////////////// class CNelPermission { protected: // - uint32 _Prim; + uint32 _PermissionId; // uint32 _UserId; // - std::string _DomainName; + uint32 _DomainId; // uint32 _ShardId; // @@ -662,25 +662,20 @@ namespace RSMGR } // - const std::string &getDomainName() const + uint32 getDomainId() const { - return _DomainName; + return _DomainId; } - - - void setDomainName(const std::string &value) + void setDomainId(uint32 value) { - if (_DomainName != value) + if (_DomainId != value) { if (getPersistentState() != NOPE::os_transient) setPersistentState(NOPE::os_dirty); - - _DomainName = value; - - + _DomainId = value; } } @@ -729,9 +724,9 @@ namespace RSMGR bool operator == (const CNelPermission &other) const { - return _Prim == other._Prim + return _PermissionId == other._PermissionId && _UserId == other._UserId - && _DomainName == other._DomainName + && _DomainId == other._DomainId && _ShardId == other._ShardId && _AccessPriv == other._AccessPriv; } @@ -742,7 +737,7 @@ namespace RSMGR CNelPermission() : _PtrList(NULL), _ObjectState(NOPE::os_transient), - _Prim(NOPE::INVALID_OBJECT_ID) + _PermissionId(NOPE::INVALID_OBJECT_ID) { // register the cache for this class (if not already done) @@ -825,7 +820,7 @@ namespace RSMGR time_t _ReleaseDate; /// The linked list of pointer on this object - CNelPermissionPtr *_PtrList; + CNelPermissionPtr *_PtrList; // Try to load the specified object from the memory cache, return NULL if the object is not in the cache static CNelPermission *loadFromCache(uint32 objectId, bool unrelease); @@ -852,7 +847,7 @@ namespace RSMGR } public: - + /** Return the object identifier (witch is unique) * You can only call this method on a persistent instance. * (because transient instance can have invalid id) @@ -860,7 +855,7 @@ namespace RSMGR uint32 getObjectId() const { - return _Prim; + return _PermissionId; } /** Set the object unique ID. @@ -874,8 +869,8 @@ namespace RSMGR // can only be set when in transient state nlassert(getPersistentState() == NOPE::os_transient); // can only be set once - nlassert(_Prim == NOPE::INVALID_OBJECT_ID); - _Prim = objectId; + nlassert(_PermissionId == NOPE::INVALID_OBJECT_ID); + _PermissionId = objectId; } /** Return the current persistent state of the object.*/ diff --git a/code/ryzom/server/src/shard_unifier_service/nel_database_mapping.xml b/code/ryzom/server/src/shard_unifier_service/nel_database_mapping.xml index 02642eb11..cd85c2fd5 100644 --- a/code/ryzom/server/src/shard_unifier_service/nel_database_mapping.xml +++ b/code/ryzom/server/src/shard_unifier_service/nel_database_mapping.xml @@ -17,16 +17,16 @@ - + - + - + diff --git a/code/ryzom/server/src/shard_unifier_service/nel_tool.sql b/code/ryzom/server/src/shard_unifier_service/nel_tool.sql deleted file mode 100644 index 5c6e6b06d..000000000 --- a/code/ryzom/server/src/shard_unifier_service/nel_tool.sql +++ /dev/null @@ -1,199 +0,0 @@ -# MySQL-Front Dump 2.4 -# -# Host: localhost Database: nel_tool -#-------------------------------------------------------- -# Server version 4.0.24_Debian-10sarge1-log - -USE nel_tool; - - -# -# Table structure for table 'help_topic' -# - -CREATE TABLE `help_topic` ( - `file` varchar(32) default '0', - `topic` varchar(32) default '0', - `help_body` text -) TYPE=MyISAM; - - - -# -# Table structure for table 'server' -# - -CREATE TABLE `server` ( - `name` char(32) NOT NULL default '0', - `address` char(32) NOT NULL default '0' -) TYPE=MyISAM; - - - -# -# Table structure for table 'service' -# - -CREATE TABLE `service` ( - `service_id` int(10) unsigned NOT NULL auto_increment, - `shard` char(32) NOT NULL default '', - `server` char(32) NOT NULL default '', - `name` char(32) NOT NULL default '', - PRIMARY KEY (`service_id`), - UNIQUE KEY `service_id` (`service_id`), - KEY `service_id_2` (`service_id`) -) TYPE=MyISAM; - - - -# -# Table structure for table 'shard_access' -# - -CREATE TABLE `shard_access` ( - `uid` int(10) unsigned default '0', - `shard` char(64) default '0' -) TYPE=MyISAM; - - - -# -# Table structure for table 'shard_annotation' -# - -CREATE TABLE `shard_annotation` ( - `shard` varchar(32) default '0', - `annotation` varchar(255) default '0', - `user` int(10) unsigned default '0', - `post_date` datetime default NULL, - `lock_user` int(10) unsigned default '0', - `lock_ip` varchar(32) default NULL, - `lock_date` datetime default NULL, - `ASAddr` varchar(255) default NULL, - `alias` varchar(255) default NULL -) TYPE=MyISAM; - - - -# -# Table structure for table 'user' -# - -CREATE TABLE `user` ( - `login` varchar(16) NOT NULL default '', - `password` varchar(32) NOT NULL default '', - `uid` int(10) NOT NULL auto_increment, - `gid` int(10) NOT NULL default '1', - `useCookie` enum('yes','no') NOT NULL default 'no', - `default_view` int(11) NOT NULL default '0', - `allowed_ip` varchar(32) default NULL, - PRIMARY KEY (`uid`), - UNIQUE KEY `login` (`login`) -) TYPE=MyISAM; - - - -# -# Table structure for table 'user_right' -# - -CREATE TABLE `user_right` ( - `uid` int(10) unsigned default '0', - `uright` varchar(16) default '0', - KEY `uid` (`uid`) -) TYPE=MyISAM; - - - -# -# Table structure for table 'user_variable' -# - -CREATE TABLE `user_variable` ( - `uid` int(11) NOT NULL default '0', - `vid` int(11) NOT NULL default '0', - `privilege` enum('none','rd','rw') NOT NULL default 'none', - PRIMARY KEY (`uid`,`vid`), - UNIQUE KEY `uid` (`uid`,`vid`) -) TYPE=MyISAM; - - - -# -# Table structure for table 'variable' -# - -CREATE TABLE `variable` ( - `vid` int(11) NOT NULL auto_increment, - `name` varchar(128) NOT NULL default '', - `path` varchar(255) NOT NULL default '', - `state` enum('rd','rw') NOT NULL default 'rd', - `vgid` int(10) unsigned NOT NULL default '1', - `warning_bound` int(11) default '-1', - `error_bound` int(11) default '-1', - `alarm_order` enum('gt','lt') NOT NULL default 'gt', - `graph_update` int(10) unsigned default '0', - `command` enum('variable','command') NOT NULL default 'variable', - PRIMARY KEY (`vid`), - UNIQUE KEY `vid` (`vid`) -) TYPE=MyISAM; - - - -# -# Table structure for table 'variable_group' -# - -CREATE TABLE `variable_group` ( - `vgid` int(10) NOT NULL auto_increment, - `name` varchar(32) default '0', - PRIMARY KEY (`vgid`), - UNIQUE KEY `name` (`name`) -) TYPE=MyISAM; - - - -# -# Table structure for table 'view_command' -# - -CREATE TABLE `view_command` ( - `name` varchar(32) default '0', - `command` varchar(32) default '0', - `tid` int(11) unsigned default '0' -) TYPE=MyISAM; - - - -# -# Table structure for table 'view_row' -# - -CREATE TABLE `view_row` ( - `tid` int(11) NOT NULL default '0', - `vid` int(11) NOT NULL default '0', - `name` varchar(128) NOT NULL default '', - `ordering` tinyint(4) NOT NULL default '0', - `filter` varchar(64) default NULL, - `graph` tinyint(3) unsigned NOT NULL default '0' -) TYPE=MyISAM; - - - -# -# Table structure for table 'view_table' -# - -CREATE TABLE `view_table` ( - `tid` int(11) NOT NULL auto_increment, - `uid` int(11) NOT NULL default '0', - `name` varchar(32) NOT NULL default '', - `ordering` tinyint(4) NOT NULL default '0', - `filter` varchar(64) default NULL, - `display` enum('normal','condensed') NOT NULL default 'normal', - `refresh_rate` int(10) unsigned default '0', - `auto_display` enum('auto','manual') NOT NULL default 'auto', - `show_base_cols` tinyint(3) unsigned NOT NULL default '1', - UNIQUE KEY `tid` (`tid`,`uid`) -) TYPE=MyISAM; - diff --git a/code/ryzom/server/src/shard_unifier_service/readme.txt b/code/ryzom/server/src/shard_unifier_service/readme.txt new file mode 100644 index 000000000..6d45d7556 --- /dev/null +++ b/code/ryzom/server/src/shard_unifier_service/readme.txt @@ -0,0 +1,2 @@ +xsltproc -o nel_database_mapping.cpp --stringparam output cpp --stringparam filename nel_database_mapping ../../../common/src/game_share/generate_module_interface.xslt nel_database_mapping.xml +xsltproc -o nel_database_mapping.h --stringparam output header --stringparam filename nel_database_mapping ../../../common/src/game_share/generate_module_interface.xslt nel_database_mapping.xml diff --git a/code/ryzom/server/src/shard_unifier_service/ring.sql b/code/ryzom/server/src/shard_unifier_service/ring.sql deleted file mode 100644 index 068aa1102..000000000 --- a/code/ryzom/server/src/shard_unifier_service/ring.sql +++ /dev/null @@ -1,311 +0,0 @@ -# MySQL-Front Dump 2.4 -# -# Host: localhost Database: ring_ats -#-------------------------------------------------------- -# Server version 4.0.24_Debian-10sarge1-log - -USE ring_ats; - - -# -# Table structure for table 'characters' -# - -CREATE TABLE `characters` ( - `char_id` int(10) unsigned NOT NULL default '0', - `char_name` varchar(20) NOT NULL default '', - `user_id` int(10) unsigned NOT NULL default '0', - `guild_id` int(10) unsigned NOT NULL default '0', - `best_combat_level` int(10) unsigned NOT NULL default '0', - `home_mainland_session_id` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`char_id`), - UNIQUE KEY `char_name_idx` (`char_name`), - KEY `user_id_idx` (`user_id`), - KEY `guild_id_idx` (`guild_id`) -) TYPE=MyISAM ROW_FORMAT=DYNAMIC; - - - -# -# Table structure for table 'folder' -# - -CREATE TABLE `folder` ( - `Id` int(10) unsigned NOT NULL auto_increment, - `owner` int(10) unsigned NOT NULL default '0', - `title` varchar(40) NOT NULL default '', - `comments` text NOT NULL, - PRIMARY KEY (`Id`), - KEY `owner_idx` (`owner`), - KEY `title_idx` (`title`) -) TYPE=MyISAM ROW_FORMAT=DYNAMIC; - - - -# -# Table structure for table 'folder_access' -# - -CREATE TABLE `folder_access` ( - `Id` int(10) unsigned NOT NULL auto_increment, - `folder_id` int(10) unsigned NOT NULL default '0', - `user_id` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`Id`), - KEY `folder_id_idx` (`folder_id`), - KEY `user_idx` (`user_id`) -) TYPE=MyISAM ROW_FORMAT=FIXED; - - - -# -# Table structure for table 'guild_invites' -# - -CREATE TABLE `guild_invites` ( - `Id` int(10) unsigned NOT NULL auto_increment, - `session_id` int(10) unsigned NOT NULL default '0', - `guild_id` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`Id`), - KEY `guild_id_idx` (`guild_id`), - KEY `session_id_idx` (`session_id`) -) TYPE=MyISAM ROW_FORMAT=FIXED; - - - -# -# Table structure for table 'guilds' -# - -CREATE TABLE `guilds` ( - `guild_id` int(10) unsigned NOT NULL default '0', - `guild_name` varchar(20) NOT NULL default '', - `shard_id` int(11) NOT NULL default '0', - PRIMARY KEY (`guild_id`), - UNIQUE KEY `huild_name_idx` (`guild_name`), - KEY `shard_id_idx` (`shard_id`) -) TYPE=MyISAM ROW_FORMAT=DYNAMIC; - - - -# -# Table structure for table 'journal_entry' -# - -CREATE TABLE `journal_entry` ( - `Id` int(10) unsigned NOT NULL auto_increment, - `session_id` int(10) unsigned NOT NULL default '0', - `author` int(10) unsigned NOT NULL default '0', - `type` enum('jet_credits','jet_notes') NOT NULL default 'jet_notes', - `text` text NOT NULL, - `time_stamp` datetime NOT NULL default '2005-09-07 12:41:33', - PRIMARY KEY (`Id`), - KEY `session_id_idx` (`session_id`) -) TYPE=MyISAM ROW_FORMAT=DYNAMIC; - - - -# -# Table structure for table 'known_users' -# - -CREATE TABLE `known_users` ( - `Id` int(10) unsigned NOT NULL auto_increment, - `owner` int(10) unsigned NOT NULL default '0', - `targer_user` int(10) unsigned NOT NULL default '0', - `targer_character` int(10) unsigned NOT NULL default '0', - `relation_type` enum('rt_friend','rt_banned','rt_friend_dm') NOT NULL default 'rt_friend', - `comments` varchar(255) NOT NULL default '', - PRIMARY KEY (`Id`), - KEY `user_index` (`owner`) -) TYPE=MyISAM ROW_FORMAT=DYNAMIC; - - - -# -# Table structure for table 'mfs_erased_mail_series' -# - -CREATE TABLE `mfs_erased_mail_series` ( - `erased_char_id` int(11) unsigned NOT NULL default '0', - `erased_char_name` varchar(32) NOT NULL default '', - `erased_series` int(11) unsigned NOT NULL auto_increment, - `erase_date` datetime NOT NULL default '0000-00-00 00:00:00', - PRIMARY KEY (`erased_series`) -) TYPE=MyISAM ROW_FORMAT=DYNAMIC; - - - -# -# Table structure for table 'mfs_guild_thread' -# - -CREATE TABLE `mfs_guild_thread` ( - `thread_id` int(11) NOT NULL auto_increment, - `guild_id` int(11) unsigned NOT NULL default '0', - `topic` varchar(255) NOT NULL default '', - `author_name` varchar(32) NOT NULL default '', - `last_post_date` datetime NOT NULL default '0000-00-00 00:00:00', - `post_count` int(11) unsigned NOT NULL default '0', - PRIMARY KEY (`thread_id`), - KEY `guild_index` (`guild_id`) -) TYPE=MyISAM ROW_FORMAT=DYNAMIC; - - - -# -# Table structure for table 'mfs_guild_thread_message' -# - -CREATE TABLE `mfs_guild_thread_message` ( - `id` int(11) NOT NULL auto_increment, - `thread_id` int(11) unsigned NOT NULL default '0', - `author_name` varchar(32) NOT NULL default '', - `date` datetime NOT NULL default '0000-00-00 00:00:00', - `content` text NOT NULL, - PRIMARY KEY (`id`) -) TYPE=MyISAM ROW_FORMAT=DYNAMIC; - - - -# -# Table structure for table 'mfs_mail' -# - -CREATE TABLE `mfs_mail` ( - `id` int(11) NOT NULL auto_increment, - `sender_name` varchar(32) NOT NULL default '', - `subject` varchar(250) NOT NULL default '', - `date` datetime NOT NULL default '0000-00-00 00:00:00', - `status` enum('ms_new','ms_read','ms_erased') NOT NULL default 'ms_new', - `dest_char_id` int(11) unsigned NOT NULL default '0', - `erase_series` int(11) unsigned NOT NULL default '0', - `content` text NOT NULL, - PRIMARY KEY (`id`), - KEY `dest_index` (`dest_char_id`) -) TYPE=MyISAM ROW_FORMAT=DYNAMIC; - - - -# -# Table structure for table 'player_rating' -# - -CREATE TABLE `player_rating` ( - `Id` int(10) unsigned NOT NULL auto_increment, - `session_id` int(10) unsigned NOT NULL default '0', - `author` int(10) unsigned NOT NULL default '0', - `rating` int(10) NOT NULL default '0', - `comments` text NOT NULL, - `time_stamp` datetime NOT NULL default '2005-09-07 12:41:33', - PRIMARY KEY (`Id`), - KEY `session_id_idx` (`session_id`), - KEY `author_idx` (`author`) -) TYPE=MyISAM ROW_FORMAT=DYNAMIC; - - - -# -# Table structure for table 'ring_users' -# - -CREATE TABLE `ring_users` ( - `user_id` int(10) unsigned NOT NULL default '0', - `user_name` varchar(20) NOT NULL default '', - `user_type` enum('ut_character','ut_pioneer') NOT NULL default 'ut_character', - `current_session` int(10) unsigned NOT NULL default '0', - `current_activity` enum('ca_none','ca_play','ca_edit','ca_anim') NOT NULL default 'ca_none', - `current_status` enum('cs_offline','cs_logged','cs_online') NOT NULL default 'cs_offline', - `public_level` enum('pl_none','pl_public') NOT NULL default 'pl_none', - `account_type` enum('at_normal','at_gold') NOT NULL default 'at_normal', - `content_access_level` varchar(20) NOT NULL default '', - `description` text NOT NULL, - `lang` enum('lang_en','lang_fr','lang_de') NOT NULL default 'lang_en', - `cookie` varchar(30) NOT NULL default '', - `current_domain_id` int(10) NOT NULL default '-1', - `pioneer_char_id` int(11) unsigned NOT NULL default '0', - PRIMARY KEY (`user_id`), - UNIQUE KEY `user_name_idx` (`user_name`), - KEY `cookie_idx` (`cookie`) -) TYPE=MyISAM ROW_FORMAT=DYNAMIC; - - - -# -# Table structure for table 'scenario_desc' -# - -CREATE TABLE `scenario_desc` ( - `session_id` int(10) unsigned NOT NULL default '0', - `parent_scenario` int(10) unsigned NOT NULL default '0', - `description` text NOT NULL, - `relation_to_parent` enum('rtp_same','rtp_variant','rtp_different') NOT NULL default 'rtp_same', - `title` varchar(40) NOT NULL default '', - `num_player` int(10) unsigned NOT NULL default '0', - `content_access_level` varchar(20) NOT NULL default '', - PRIMARY KEY (`session_id`), - UNIQUE KEY `title_idx` (`title`), - KEY `parent_idx` (`parent_scenario`) -) TYPE=MyISAM ROW_FORMAT=DYNAMIC; - - - -# -# Table structure for table 'session_participant' -# - -CREATE TABLE `session_participant` ( - `Id` int(10) unsigned NOT NULL auto_increment, - `session_id` int(10) unsigned NOT NULL default '0', - `char_id` int(10) unsigned NOT NULL default '0', - `status` enum('sps_play_subscribed','sps_play_invited','sps_edit_invited','sps_anim_invited','sps_playing','sps_editing','sps_animating') NOT NULL default 'sps_play_subscribed', - `kicked` tinyint(1) unsigned NOT NULL default '0', - `session_rated` tinyint(1) unsigned NOT NULL default '0', - PRIMARY KEY (`Id`), - KEY `session_idx` (`session_id`), - KEY `user_idx` (`char_id`) -) TYPE=MyISAM ROW_FORMAT=FIXED; - - - -# -# Table structure for table 'sessions' -# - -CREATE TABLE `sessions` ( - `session_id` int(10) unsigned NOT NULL auto_increment, - `session_type` enum('st_edit','st_anim','st_outland','st_mainland') NOT NULL default 'st_edit', - `title` varchar(40) NOT NULL default '', - `owner` int(10) unsigned NOT NULL default '0', - `plan_date` datetime NOT NULL default '2005-09-21 12:41:33', - `start_date` datetime NOT NULL default '2005-08-31 00:00:00', - `description` text NOT NULL, - `orientation` enum('so_newbie_training','so_story_telling','so_mistery','so_hack_slash','so_guild_training','so_other') NOT NULL default 'so_other', - `level` enum('sl_a','sl_b','sl_c','sl_d','sl_e') NOT NULL default 'sl_a', - `rule_type` enum('rt_strict','rt_liberal') NOT NULL default 'rt_strict', - `access_type` enum('at_public','at_private') NOT NULL default 'at_public', - `state` enum('ss_planned','ss_open','ss_locked','ss_closed') NOT NULL default 'ss_planned', - `host_shard_id` int(11) NOT NULL default '0', - `subscription_slots` int(11) unsigned NOT NULL default '0', - `reserved_slots` int(10) unsigned NOT NULL default '0', - `free_slots` int(10) unsigned NOT NULL default '0', - `estimated_duration` enum('et_short','et_medium','et_long') NOT NULL default 'et_short', - `final_duration` int(10) unsigned NOT NULL default '0', - `folder_id` int(10) unsigned NOT NULL default '0', - `lang` enum('lang_en','lang_fr','lang_de') NOT NULL default 'lang_en', - `icone` varchar(70) NOT NULL default '', - PRIMARY KEY (`session_id`), - KEY `owner_idx` (`owner`), - KEY `folder_idx` (`folder_id`) -) TYPE=MyISAM ROW_FORMAT=DYNAMIC; - - - -# -# Table structure for table 'shard' -# - -CREATE TABLE `shard` ( - `shard_id` int(11) NOT NULL default '0', - PRIMARY KEY (`shard_id`) -) TYPE=MyISAM ROW_FORMAT=FIXED; - diff --git a/code/ryzom/server/src/shard_unifier_service/ring_session_manager.cpp b/code/ryzom/server/src/shard_unifier_service/ring_session_manager.cpp index 8d6c2a91f..2ed06065b 100644 --- a/code/ryzom/server/src/shard_unifier_service/ring_session_manager.cpp +++ b/code/ryzom/server/src/shard_unifier_service/ring_session_manager.cpp @@ -58,7 +58,7 @@ CVariable PrivilegeForSessionAccess("su", "PrivilegeForSessionAccess", " namespace RSMGR { - class CRingSessionManager : + class CRingSessionManager : public CEmptyModuleServiceBehav > >, public CRingSessionManagerSkel, public CRingSessionManagerWebItf, @@ -74,10 +74,10 @@ namespace RSMGR // mysql nel database connection MSW::CConnection _NelDb; - + struct TSessionServerInfo { - /// Shard id + /// Shard id TShardId ShardId; /// Total number of player in the sessions hosted by this server uint32 NbTotalPlayingChars; @@ -97,7 +97,7 @@ namespace RSMGR TSessionServers _SessionServers; typedef map TSessionServersIdx; - // index of sessionId to session server + // index of sessionId to session server TSessionServersIdx _SessionIndex; struct TWelcomeServiceInfo @@ -147,7 +147,7 @@ namespace RSMGR }; typedef map TTemporaryShardAssocs; - /** A table of session owner and the ring shard on witch they are + /** A table of session owner and the ring shard on witch they are * currently stuck. This allow the RSM to assign edit and anim session * of a character to the same DSS to use the DSS session ID masquerading * that allow reuse of the same session for editing and animating without @@ -184,7 +184,7 @@ namespace RSMGR struct TPendingJoinSession { /// The user ID - uint32 UserId; + uint32 UserId; /// the session id TSessionId SessionId; /// The web connection @@ -206,7 +206,7 @@ namespace RSMGR /// Pointer to character sync speaker ICharacterSync *_CharSync; public: - CRingSessionManager() + CRingSessionManager() : _DontUsePerm(false), _CharSync(NULL) { @@ -284,7 +284,7 @@ namespace RSMGR nlwarning("Missing 'web' param in module init string"); return false; } - + const TParsedCommandLine *portParam = web->getParam("port"); if (portParam == NULL) { @@ -399,7 +399,7 @@ namespace RSMGR { nldebug("RSM : receive module down for session server '%s'", proxy->getModuleName().c_str()); - // lock any sessions that belong to this module (because we don't now if + // lock any sessions that belong to this module (because we don't now if // the session server if just unreachable or really dead) TSessionServerInfo &ssi = it->second; { @@ -433,7 +433,7 @@ namespace RSMGR else ++it; } - + } { @@ -457,7 +457,7 @@ namespace RSMGR } } } - + } // remove session info @@ -625,11 +625,11 @@ namespace RSMGR // query << " WHERE shard.domain_id = domain.domain_id"; // query << " AND domain_name = '" << DomainName << "'"; // query << " AND ShardId = " << shardId; -// +// // BOMB_IF(!_NelDb.query(query), "registerWS : Failed to request into the NeL database", return CNelShardPtr()); // auto_ptr result = auto_ptr(_NelDb.storeResult()); // BOMB_IF(result.get() == NULL, "registerWS : Failed to retrieve request result", return CNelShardPtr()); -// +// // if (result->getNumRows() == 0) // { // return CNelShardPtr(); @@ -639,7 +639,7 @@ namespace RSMGR // // load the data // uint32 prim; // result->getField(0, prim); -// +// // return CNelShard::load(_NelDb, prim, __FILE__, __LINE__); // } @@ -648,8 +648,8 @@ namespace RSMGR userAccessPriv.clear(); CSString query; query << "SELECT AccessPrivilege FROM permission"; - query << " WHERE UId = " << userId << " AND permission.ClientApplication = '"< &runningSessions) { - nldebug("RSM : receive DSS registration from '%s'", + nldebug("RSM : receive DSS registration from '%s'", sender->getModuleName().c_str()); if (_SessionServers.find(sender) != _SessionServers.end()) @@ -696,13 +696,13 @@ namespace RSMGR for (uint i=0; i(rsi.getSessionId()), + nlwarning("registerDSS : can't load the session %u hosted by '%s, closing it", + static_cast(rsi.getSessionId()), sender->getModuleName().c_str()); CRingSessionManagerClientProxy smc(sender); @@ -718,7 +718,7 @@ namespace RSMGR if (session->getState() != TSessionState::ss_open && session->getState() != TSessionState::ss_locked) { nlwarning("registerDSS : The session %u open hosted by '%s' is '%s', asking DSS to close it", - static_cast(rsi.getSessionId()), + static_cast(rsi.getSessionId()), sender->getModuleName().c_str(), session->getState().toString().c_str()); @@ -790,7 +790,7 @@ restartLoop: _TemporaryLockedSession.erase(sessionId); sessionToClose.pop_front(); } - + } _SessionServers[sender] = ssi; @@ -829,7 +829,7 @@ restartLoop: invokeResult(from, (it3->CharId) >> 4, 5, "Session server failure"); return; } - + TSessionServerInfo &ssi = it->second; TSessionServerInfo::THostedSessions::iterator it2(ssi.HostedSessions.find(sessionInfo.getSessionId())); @@ -875,7 +875,7 @@ restartLoop: _PendingSessions.erase(it3); } - + // that all } @@ -898,7 +898,7 @@ restartLoop: sender->getModuleName().c_str()); return; } - + TSessionServerInfo &ssi = it->second; TSessionServerInfo::THostedSessions::iterator it2(ssi.HostedSessions.find(sessionId)); @@ -1049,7 +1049,7 @@ restartLoop: sessionLog->setScenarioPointScored(0); sessionLog->setTimeTaken(0); sessionLog->setGuildName(""); - + sessionLog->create(_RingDb); } @@ -1095,12 +1095,12 @@ restartLoop: // provides a bunch of data about the session life. // The DSS report the end of an animation session and // provides a bunch of data about the session life. - virtual void scenarioEnded(NLNET::IModuleProxy *sender, - TSessionId sessionId, - const R2::TRunningScenarioInfo &scenarioInfo, - uint32 rrpScored, - uint32 scenarioPointScored, - uint32 timeTaken, + virtual void scenarioEnded(NLNET::IModuleProxy *sender, + TSessionId sessionId, + const R2::TRunningScenarioInfo &scenarioInfo, + uint32 rrpScored, + uint32 scenarioPointScored, + uint32 timeTaken, const std::vector < uint32 > &participants) { H_AUTO(SessionManager_scenarioEnded); @@ -1171,7 +1171,7 @@ restartLoop: // build the participants string for (uint i=0; isetObjectId(shardId); - // new WS are always inserted in restricted mode + // new WS are always inserted in restricted mode wsInfo.ShardInfo->setWSOnline(false); wsInfo.ShardInfo->setRequiredState(TAccessLevel::ds_restricted); wsInfo.ShardInfo->setMOTD("Shard up, access restricted"); @@ -1286,7 +1286,7 @@ restartLoop: if (isOnline && wsInfo.ShardInfo->getRequiredState() != TAccessLevel::ds_close) { - // the WS is online, check the previous known state of the + // the WS is online, check the previous known state of the // WS and put it in restricted if it was previously close. if (!wsInfo.ShardInfo->getWSOnline()) { @@ -1322,8 +1322,8 @@ restartLoop: { TWelcomeServiceInfo &wsi = itw->second; - if (isOnline - && wsi.ShardInfo->getRequiredState() != TAccessLevel::ds_close + if (isOnline + && wsi.ShardInfo->getRequiredState() != TAccessLevel::ds_close && !wsi.ShardInfo->getWSOnline()) { // unclose this shard @@ -1388,7 +1388,7 @@ restartLoop: // retrieve the session participant character->loadSessionParticipants(_RingDb, __FILE__, __LINE__); TSessionPartStatus status; - + // vector::iterator first(character->getSessionParticipants().begin()), last(character->getSessionParticipants().end()); // for (; first != last; ++first) uint i; @@ -1479,7 +1479,7 @@ restartLoop: joinSessionResult(pjs.From, pjs.UserId, pjs.SessionId, 8, string("Welcome refused entry in shard with error : '")+errorMsg+"'", TSessionPartStatus::invalid_val); } -endOfWelcomeUserResult: +endOfWelcomeUserResult: if (ok) { // update the 'ring_user' table to signal which session we're entering and with which character @@ -1494,7 +1494,7 @@ endOfWelcomeUserResult: return; } } - + nlwarning("welcomeUserResult : received a result for unexpected userId %u from WS '%s'", userId, sender->getModuleName().c_str()); @@ -1559,37 +1559,37 @@ endOfWelcomeUserResult: } } - virtual void on_setSessionStartParams(NLNET::TSockId from, + virtual void on_setSessionStartParams(NLNET::TSockId from, uint32 charId, TSessionId sessionId, const std::string &initialIslandLocation, const std::string &initialEntryPointLocation, const std::string &initialSeason) { CSessionPtr session = CSession::load(_RingDb, sessionId.asInt(), __FILE__, __LINE__); if (session == NULL) { return; } if (session->getSessionType() == TSessionType::st_mainland) { return;} - + TSessionServersIdx::iterator it(_SessionIndex.find(sessionId)); if (it == _SessionIndex.end()) { return; } CRingSessionManagerClientProxy ss(it->second); ss.setSessionStartParams(this, charId, sessionId, initialIslandLocation, initialEntryPointLocation, initialSeason); - + } - virtual void on_scheduleSession(NLNET::TSockId from, - uint32 charId, - const TSessionType &sessionType, - const std::string &sessionTitle, - const std::string &sessionDesc, - const TSessionLevel &sessionLevel, -// const TAccessType &accessType, - const TRuleType &ruleType, - const TEstimatedDuration &estimatedDuration, - uint32 subscriptionSlot, + virtual void on_scheduleSession(NLNET::TSockId from, + uint32 charId, + const TSessionType &sessionType, + const std::string &sessionTitle, + const std::string &sessionDesc, + const TSessionLevel &sessionLevel, +// const TAccessType &accessType, + const TRuleType &ruleType, + const TEstimatedDuration &estimatedDuration, + uint32 subscriptionSlot, const TAnimMode &animMode, - const TRaceFilter &raceFilter, - const TReligionFilter &religionFilter, - const TGuildFilter &guildFilter, + const TRaceFilter &raceFilter, + const TReligionFilter &religionFilter, + const TGuildFilter &guildFilter, const TShardFilter &shardFilter, const TLevelFilter &levelFilter, const std::string &language, @@ -1636,7 +1636,7 @@ endOfWelcomeUserResult: CCharacterPtr character = CCharacter::load(_RingDb, charId, __FILE__, __LINE__); if (character == NULL) { - // failed !, invalid character + // failed !, invalid character scheduleSessionResult(from, charId, TSessionId(0), 3, "Invalid character"); return; } @@ -1646,13 +1646,13 @@ endOfWelcomeUserResult: { CNelUserPtr nelUser = CNelUser::load(_NelDb, userId, __FILE__, __LINE__); BOMB_IF(nelUser == NULL, "Failed to load nel user "<getExtendedPrivilege().find(":TRIAL:") != string::npos) { // this account is free trial, no anim session allowed - scheduleSessionResult(from, charId, TSessionId(0), 9, "Forbidden for free trial"); + scheduleSessionResult(from, charId, TSessionId(0), 9, "Forbidden for free trial"); return; } */ @@ -1704,7 +1704,7 @@ endOfWelcomeUserResult: // store the session session->create(_RingDb); - + // ok, return the result to web scheduleSessionResult(from, charId, TSessionId(session->getObjectId()), 0, ""); } @@ -1730,7 +1730,7 @@ endOfWelcomeUserResult: } // ok, return the result to web - sessionInfoResult(from, charId, TSessionId(session->getObjectId()), + sessionInfoResult(from, charId, TSessionId(session->getObjectId()), session->getRaceFilter(), session->getReligionFilter(), session->getGuildFilter(), session->getShardFilter(), session->getLevelFilter(), session->getSubscriptionClosed(), (session->getAccessType()==TAccessType::at_public), session->getLang(), session->getOrientation(), session->getDescription()); @@ -1743,21 +1743,21 @@ endOfWelcomeUserResult: // 3 : char don't own the session // 4 : session is closed, no update allowed // 5 : invalid parameter - virtual void on_updateSessionInfo(NLNET::TSockId from, - uint32 charId, - TSessionId sessionId, - const std::string &sessionTitle, - uint32 plannedDate, - const std::string &sessionDesc, - const TSessionLevel &sessionLevel, -// const TAccessType &accessType, - const TEstimatedDuration &estimatedDuration, - uint32 subscriptionSlot, - const TRaceFilter &raceFilter, - const TReligionFilter &religionFilter, - const TGuildFilter &guildFilter, - const TShardFilter &shardFilter, - const TLevelFilter &levelFilter, + virtual void on_updateSessionInfo(NLNET::TSockId from, + uint32 charId, + TSessionId sessionId, + const std::string &sessionTitle, + uint32 plannedDate, + const std::string &sessionDesc, + const TSessionLevel &sessionLevel, +// const TAccessType &accessType, + const TEstimatedDuration &estimatedDuration, + uint32 subscriptionSlot, + const TRaceFilter &raceFilter, + const TReligionFilter &religionFilter, + const TGuildFilter &guildFilter, + const TShardFilter &shardFilter, + const TLevelFilter &levelFilter, bool subscriptionClosed, bool autoInvite, const std::string &language, @@ -1833,7 +1833,7 @@ endOfWelcomeUserResult: invokeResult(from, charId>>4, 0, ""); } - + // Cancel a planned session // Return 'invokeResult' : 0 : ok, session canceled // 1 : unknown char @@ -1867,14 +1867,14 @@ endOfWelcomeUserResult: return; } - if (session->getState() != TSessionState::ss_planned + if (session->getState() != TSessionState::ss_planned && session->getState() != TSessionState::ss_locked) { // not planned invokeResult(from, charId>>4, 4, "Session not in planned state"); return; } - + // remove the session from database session->remove(_RingDb); @@ -1928,7 +1928,7 @@ endOfWelcomeUserResult: // look for the best server TSessionServers::iterator best(_SessionServers.end()); - + // check if the user has a open edit session, if so, lauch the session on the same shard if (session->getSessionType() == TSessionType::st_anim) @@ -1944,7 +1944,7 @@ endOfWelcomeUserResult: TSessionServersIdx::iterator it(_SessionIndex.find(s->getObjectId())); if (it != _SessionIndex.end()) best = _SessionServers.find(it->second); - + break; } } @@ -2134,7 +2134,7 @@ endOfWelcomeUserResult: if (session->getState() != TSessionState::ss_closed && session->getState() != TSessionState::ss_planned) - { + { // ask the session server to close this session TSessionServersIdx::iterator it(_SessionIndex.find(sessionId)); if (it != _SessionIndex.end()) @@ -2142,7 +2142,7 @@ endOfWelcomeUserResult: TModuleProxyPtr proxy = it->second; CRingSessionManagerClientProxy ss(proxy); - + ss.closeSession(this, sessionId); // ok, we have closed the session @@ -2162,7 +2162,7 @@ endOfWelcomeUserResult: // use the first server in the list TModuleProxyPtr proxy = _SessionServers.begin()->first; CRingSessionManagerClientProxy ss(proxy); - + ss.stopHibernation(this, TSessionId(sessionId), charId); } @@ -2171,7 +2171,7 @@ endOfWelcomeUserResult: } // Close a running session - // Return 'invokeResult' : 0 : ok, + // Return 'invokeResult' : 0 : ok, // 1 : not ok //:TODO: change the name to Cloase or hibernate previous sessions virtual void on_hibernateEditSession(NLNET::TSockId from, uint32 charId) @@ -2186,12 +2186,12 @@ endOfWelcomeUserResult: CCharacterPtr character = CCharacter::load(_RingDb, charId, __FILE__, __LINE__); if (character == NULL) { - invokeResult(from, charId>>4, 1, "Character not found"); + invokeResult(from, charId>>4, 1, "Character not found"); return; } // Hiberning edit sessions { - + CSString query; query << "SELECT session_id FROM sessions"; query << " WHERE owner = "<getNumRows() != 0) { - + if (result->getNumRows() > 1) { @@ -2214,13 +2214,13 @@ endOfWelcomeUserResult: uint32 sessionNum; result->getField(0, sessionNum); TSessionId sessionId(sessionNum); - + CSessionPtr session = CSession::load(_RingDb, sessionId.asInt(), __FILE__, __LINE__); if (session != NULL) { if (session->getState() != TSessionState::ss_closed && session->getState() != TSessionState::ss_planned) - { + { // ask the session server to close this session TSessionServersIdx::iterator it(_SessionIndex.find(sessionId)); if (it != _SessionIndex.end()) @@ -2228,7 +2228,7 @@ endOfWelcomeUserResult: TModuleProxyPtr proxy = it->second; CRingSessionManagerClientProxy ss(proxy); - + ss.hibernateSession(this, sessionId); } } @@ -2238,7 +2238,7 @@ endOfWelcomeUserResult: // Close anim sessions { - + CSString query; query << "SELECT session_id FROM sessions"; query << " WHERE owner = "<getNumRows()); } - + unsigned int firstSession = 0; unsigned int lastSession = result->getNumRows(); for (;firstSession != lastSession; ++firstSession) - { + { result->fetchRow(); - // get the session id - + // get the session id + uint32 sessionNum; result->getField(0, sessionNum); TSessionId sessionId(sessionNum); - + CSessionPtr session = CSession::load(_RingDb, sessionId.asInt(), __FILE__, __LINE__); if (session != NULL) { - - if ( session->getState() != TSessionState::ss_closed && session->getState() != TSessionState::ss_planned) - { + + if ( session->getState() != TSessionState::ss_closed && session->getState() != TSessionState::ss_planned) + { // ask the session server to close this session TSessionServersIdx::iterator it(_SessionIndex.find(sessionId)); if (it == _SessionIndex.end()) @@ -2335,8 +2335,8 @@ endOfWelcomeUserResult: uint i; for (i=0; igetKnownUsers().size(); ++i) { - const CKnownUserPtr &ku = ru->getKnownUsers()[i]; - if (ku->getTargetCharacter() == friendCharId + const CKnownUserPtr &ku = ru->getKnownUsers()[i]; + if (ku->getTargetCharacter() == friendCharId && (ku->getRelation() == TKnownUserRelation::rt_friend || ku->getRelation() == TKnownUserRelation::rt_banned)) break; } @@ -2411,7 +2411,7 @@ endOfWelcomeUserResult: uint i; for (i=0; igetKnownUsers().size(); ++i) { - const CKnownUserPtr &ku = ru->getKnownUsers()[i]; + const CKnownUserPtr &ku = ru->getKnownUsers()[i]; if (ku->getTargetCharacter() == friendCharId && ku->getRelation() == TKnownUserRelation::rt_friend) break; } @@ -2468,7 +2468,7 @@ endOfWelcomeUserResult: uint i; for (i=0; igetKnownUsers().size(); ++i) { - const CKnownUserPtr &ku = ru->getKnownUsers()[i]; + const CKnownUserPtr &ku = ru->getKnownUsers()[i]; if (ku->getTargetCharacter() == bannedCharId && ku->getRelation() == TKnownUserRelation::rt_banned) break; } @@ -2487,14 +2487,14 @@ endOfWelcomeUserResult: } else { - // the character is already banned + // the character is already banned } vector removeList; // remove any friend or DM friend record for (i=0; igetKnownUsers().size(); ++i) { - const CKnownUserPtr &ku = ru->getKnownUsers()[i]; + const CKnownUserPtr &ku = ru->getKnownUsers()[i]; if (ku->getTargetCharacter() == bannedCharId && ku->getRelation() != TKnownUserRelation::rt_banned) removeList.push_back(ku); } @@ -2545,7 +2545,7 @@ endOfWelcomeUserResult: uint i; for (i=0; igetKnownUsers().size(); ++i) { - const CKnownUserPtr &ku = ru->getKnownUsers()[i]; + const CKnownUserPtr &ku = ru->getKnownUsers()[i]; if (ku->getTargetCharacter() == bannedCharId && ku->getRelation() == TKnownUserRelation::rt_banned) break; } @@ -2562,7 +2562,7 @@ endOfWelcomeUserResult: // invokeResult(from, userId, 3, "character not flagged as banned"); // return; // } - + // ok, remove the know user record ku->remove(_RingDb); @@ -2606,8 +2606,8 @@ endOfWelcomeUserResult: uint i; for (i=0; igetKnownUsers().size(); ++i) { - const CKnownUserPtr &ku = ru->getKnownUsers()[i]; - if (ku->getTargetCharacter() == friendDMCharId + const CKnownUserPtr &ku = ru->getKnownUsers()[i]; + if (ku->getTargetCharacter() == friendDMCharId && (ku->getRelation() == TKnownUserRelation::rt_friend_dm || ku->getRelation() == TKnownUserRelation::rt_banned)) break; } @@ -2681,7 +2681,7 @@ endOfWelcomeUserResult: uint i; for (i=0; igetKnownUsers().size(); ++i) { - const CKnownUserPtr &ku = ru->getKnownUsers()[i]; + const CKnownUserPtr &ku = ru->getKnownUsers()[i]; if (ku->getTargetCharacter() == friendDMCharId && ku->getRelation() == TKnownUserRelation::rt_friend_dm) break; } @@ -2698,7 +2698,7 @@ endOfWelcomeUserResult: // invokeResult(from, userId, 3, "character not flagged as friend"); // return; // } - + // ok, remove the know user record ku->remove(_RingDb); @@ -2715,9 +2715,9 @@ endOfWelcomeUserResult: // 5 : invalid param virtual void on_setKnownCharacterComments(NLNET::TSockId from, uint32 userId, uint32 charId, const std::string &relation, const std::string &comments) { - nldebug("RSM : setKnownCharacterComments set comment '%s' on char %u knowns as '%s' of user %u", + nldebug("RSM : setKnownCharacterComments set comment '%s' on char %u knowns as '%s' of user %u", comments.c_str(), - charId, + charId, relation.c_str(), userId); @@ -2739,7 +2739,7 @@ endOfWelcomeUserResult: bool foundARelation = false; for (uint i=0; igetKnownUsers().size(); ++i) { - CKnownUserPtr &ku = ru->getKnownUsersByIndex(i); + CKnownUserPtr &ku = ru->getKnownUsersByIndex(i); if (ku->getTargetCharacter() == charId && ku->getRelation() == rel) { // we found the relation, update the comment @@ -2772,7 +2772,7 @@ endOfWelcomeUserResult: // A user invite a character to help or play in his session // charRole is from enum TSessionPartStatus // invokeReturn : 0 : ok, character invited - // 1 : char not found + // 1 : char not found // 2 : session not found // 3 : invited char not found // 4 : char not own the session @@ -2842,17 +2842,17 @@ endOfWelcomeUserResult: invokeResult(from, ownerCharId>>4, 13, "scenario not started, can't validate invitation now"); return; } - + CScenarioPtr scenario = CScenario::load(_RingDb, sessionLog->getScenarioId(), __FILE__, __LINE__); BOMB_IF(invitedNelUser == NULL, "Failed to load scenario for id "<getScenarioId()<<" for session "<>4, 8, "Can not load scenario associated with session log"); return); - - if (invitedNelUser->getExtendedPrivilege().find(":TRIAL:") != string::npos + + if (invitedNelUser->getExtendedPrivilege().find(":TRIAL:") != string::npos && !scenario->getAllowFreeTrial()) { // free trial are not allowed in this scenario invokeResult(from, ownerCharId>>4, 14, "free trial character are not allowed in user scenario"); return; - + } // check that the character is not already participating @@ -2877,18 +2877,18 @@ endOfWelcomeUserResult: invokeResult(from, ownerCharId>>4, 4, "Animator can't invite other animator (only session owner can)"); return; } - else if (session->getOwnerId() != ownerCharId) + else if (session->getOwnerId() != ownerCharId) { // the character that request the invitation is not the session owner, // check that he is animator in the session/ BOMB_IF(!ownerChar->loadSessionParticipants(_RingDb, __FILE__, __LINE__), "Failed to load participation for host character "<>4, 8, "Failed to load participation for host character"); return); - + uint i=0; for (; igetSessionParticipants().size(); ++i) { CSessionParticipantPtr sp = ownerChar->getSessionParticipantsByIndex(i); - + if (sp->getSessionId() == sessionId.asInt()) { // we found it @@ -2899,12 +2899,12 @@ endOfWelcomeUserResult: invokeResult(from, ownerCharId>>4, 11, "Invitation requester char is not animator in the session"); return; } - + // ok, stop the loop break; } } - + if (i == ownerChar->getSessionParticipants().size()) { // no participation found ! @@ -3059,7 +3059,7 @@ endOfWelcomeUserResult: { const CKnownUserPtr &ku = ru->getKnownUsersByIndex(i); - if (ku->getRelation() == TKnownUserRelation::rt_banned + if (ku->getRelation() == TKnownUserRelation::rt_banned && ku->getTargetUser() == character->getUserId()) { // this character is banned ! @@ -3170,7 +3170,7 @@ endOfWelcomeUserResult: { BOMB_IF (!loadUserAccessPrivileges(userId, userAccessPriv), "RSM:on_joinSession : failed to load privileges for user "<getOwnerId() != charId + if (session->getOwnerId() != charId && nelUser->getExtendedPrivilege().find(":TRIAL:") != string::npos) { // check that the scenario launched allow free trials players @@ -3277,7 +3277,7 @@ endOfWelcomeUserResult: sessionPart->setCharId(charId); sessionPart->setSessionId(session->getObjectId()); sessionPart->setStatus(TSessionPartStatus::sps_play_invited); - + // store the participation sessionPart->create(_RingDb); } @@ -3344,7 +3344,7 @@ endOfWelcomeUserResult: // warn the session server that an editor come in enterAs = WS::TUserRole::ur_editor; ss.addCharacterInSession(this, sessionId, charId, enterAs, charac->getRingAccess(), charac->getNewcomer()); - + // update the participant status sessionPart->setStatus(TSessionPartStatus::sps_editing); @@ -3352,8 +3352,8 @@ endOfWelcomeUserResult: else if ( sessionPart->getStatus() == TSessionPartStatus::sps_anim_invited || sessionPart->getStatus() == TSessionPartStatus::sps_animating) { - // warn the session server that an animator come in - enterAs = WS::TUserRole::ur_animator; + // warn the session server that an animator come in + enterAs = WS::TUserRole::ur_animator; ss.addCharacterInSession(this, sessionId, charId, enterAs, charac->getRingAccess(), charac->getNewcomer()); // update the participant status sessionPart->setStatus(TSessionPartStatus::sps_animating); @@ -3406,7 +3406,7 @@ endOfWelcomeUserResult: if (wspSwitch == NULL) { // can't find a welcome service for this shard - + // try to read a shard status in the database CShardPtr shard = CShard::load(_RingDb, sessionId.asInt(), __FILE__, __LINE__); if (shard != NULL) @@ -3455,13 +3455,13 @@ endOfWelcomeUserResult: _PendingJoins.push_back(pjs); // reserve an entry place on the welcome service of the shard and wait for the response - wsp.welcomeUser(this, - charId, - nelUser->getLoginName(), - cookie, - nelUser->getPrivilege(), - nelUser->getExtendedPrivilege(), - enterAs, + wsp.welcomeUser(this, + charId, + nelUser->getLoginName(), + cookie, + nelUser->getPrivilege(), + nelUser->getExtendedPrivilege(), + enterAs, instanceId); // the rest of the code is done in 'welcomeUserResult' returned by the WS. @@ -3566,7 +3566,7 @@ endOfWelcomeUserResult: uint32 sessionNum; result->getField(0, sessionNum); TSessionId sessionId(sessionNum); - + // 2 : check that the character is invited in his session BOMB_IF(!character->loadSessionParticipants(_RingDb, __FILE__, __LINE__), "on_joinEditSession : failed to load session participants for char "<>4, TSessionId(0), 3, "Error loading partipation", TSessionPartStatus::invalid_val); return); uint i; @@ -3612,7 +3612,7 @@ endOfWelcomeUserResult: // ok, now call the normal join session _joinSessionCommon(from, charId, sessionId, clientApplication, true); } - + // Request to have the list of accessible shards with their attributes. virtual void on_getShards(NLNET::TSockId from, uint32 charId) { @@ -3645,7 +3645,7 @@ endOfWelcomeUserResult: } } } - + } getShardsResult(from, charId>>4, result); } @@ -3673,11 +3673,11 @@ endOfWelcomeUserResult: if (!hasSessionAccessPrivilege(userId)) { STOP("RSM : on_kickCharacter : char "<>4, 5, "Owner char don't own the session"); + invokeResult(from, ownerCharId>>4, 5, "Owner char don't own the session"); return; } } - + // load the participants BOMB_IF(!session->loadSessionParticipants(_RingDb, __FILE__, __LINE__), "RSM : on_kickCharacter : failed to load session participants for session "<>4, 4, "Failed to load session participants"); return); @@ -3733,7 +3733,7 @@ endOfWelcomeUserResult: if (!hasSessionAccessPrivilege(userId)) { STOP("RSM : on_unkickCharacter : char "<>4, 5, "Owner char don't own the session"); + invokeResult(from, ownerCharId>>4, 5, "Owner char don't own the session"); return; } } @@ -3775,7 +3775,7 @@ endOfWelcomeUserResult: // 5 : char don't own the session virtual void on_inviteGuild(NLNET::TSockId from, uint32 charId, TSessionId sessionId, uint32 guildId) { - nldebug("RSM : onInviteGuild char %u invite guild %u in session %u", + nldebug("RSM : onInviteGuild char %u invite guild %u in session %u", charId, guildId, sessionId.asInt()); @@ -3830,10 +3830,10 @@ endOfWelcomeUserResult: invite->setGuildId(guildId); invite->setSessionId(sessionId.asInt()); - + // store the new invite invite->create(_RingDb); - + // result ok invokeResult(from, charId>>4, 0, ""); } @@ -3847,7 +3847,7 @@ endOfWelcomeUserResult: // 5 : char don't own the session virtual void on_removeInvitedGuild(NLNET::TSockId from, uint32 charId, TSessionId sessionId, uint32 guildId) { - nldebug("RSM : removeInvitedGuild char %u revoke invitattion for guild %u in session %u", + nldebug("RSM : removeInvitedGuild char %u revoke invitattion for guild %u in session %u", charId, guildId, sessionId.asInt()); @@ -3919,13 +3919,13 @@ endOfWelcomeUserResult: // 2 : user not owner of session // 3 : user not found // 4 : session not found -// virtual void on_setScenarioInfo(NLNET::TSockId from, -// uint32 userId, -// TSessionId sessionId, -// const std::string &title, -// const std::string &journal, -// const std::string &credits, -// uint32 numPlayer, +// virtual void on_setScenarioInfo(NLNET::TSockId from, +// uint32 userId, +// TSessionId sessionId, +// const std::string &title, +// const std::string &journal, +// const std::string &credits, +// uint32 numPlayer, // const std::string &playType) virtual void on_setScenarioInfo(NLNET::TSockId from, uint32 charId, TSessionId sessionId, const std::string &title, uint32 numPlayer, const std::string &playType) { @@ -3955,7 +3955,7 @@ endOfWelcomeUserResult: // invokeResult(from, charId>>4, 2, "Character don't own the session"); // return; // } -// +// // // load the scenario desc // CScenarioDescPtr scenario = CScenarioDesc::load(_RingDb, sessionId.asInt(), __FILE__, __LINE__); // if (scenario == NULL) @@ -3968,7 +3968,7 @@ endOfWelcomeUserResult: // scenario->setTitle(title); // //oups, data do not matchs // nlstop; -// +// invokeResult(from, charId>>4, 100, "Deprecatted"); }; @@ -3982,10 +3982,10 @@ endOfWelcomeUserResult: // 5 : user participation not found // 6 : character not found // 7 : invalid params - virtual void on_addJournalEntry(NLNET::TSockId from, - uint32 charId, - TSessionId sessionId, - const std::string &entryType, + virtual void on_addJournalEntry(NLNET::TSockId from, + uint32 charId, + TSessionId sessionId, + const std::string &entryType, const std::string &text) { nldebug("RSM : addJournalEntry char %u add an entry in journal of session %u", charId, sessionId.asInt()); @@ -4075,11 +4075,11 @@ endOfWelcomeUserResult: // 6 : session not found // 7 : scenario not found // 8 : internal error - virtual void on_setPlayerRating(NLNET::TSockId from, uint32 charId, TSessionId sessionId, - uint32 rateFun, - uint32 rateDifficulty, - uint32 rateAccessibility, - uint32 rateOriginality, + virtual void on_setPlayerRating(NLNET::TSockId from, uint32 charId, TSessionId sessionId, + uint32 rateFun, + uint32 rateDifficulty, + uint32 rateAccessibility, + uint32 rateOriginality, uint32 rateDirection) { nldebug("Web set player rating from char %u to session %u as %u,%u,%u,%u, %u", @@ -4106,14 +4106,14 @@ endOfWelcomeUserResult: if (sp->getKicked() == true) { - invokeResult(from, charId>>4, 5, "Char is banned from the session"); + invokeResult(from, charId>>4, 5, "Char is banned from the session"); return; } break; } } - BOMB_IF(i == character->getSessionParticipants().size(), + BOMB_IF(i == character->getSessionParticipants().size(), "No participation found for char "<>4, 3, "No participation found in session"); return); // retrieve the scenario data @@ -4216,7 +4216,7 @@ endOfWelcomeUserResult: } - + NLMISC_COMMAND_HANDLER_TABLE_EXTEND_BEGIN(CRingSessionManager, CModuleBase) NLMISC_COMMAND_HANDLER_ADD(CRingSessionManager, dump, "dump the session manager internal state", "no param"); NLMISC_COMMAND_HANDLER_ADD(CRingSessionManager, forceSessionCleanup, "force a database synchronisation with current running session", "no param"); @@ -4245,7 +4245,7 @@ endOfWelcomeUserResult: log.displayNL("failed to load session %u", sessionId); return true; } - + // load the participants if (!session->loadSessionParticipants(_RingDb, __FILE__, __LINE__)) { @@ -4355,19 +4355,19 @@ endOfWelcomeUserResult: if (args.size() > 2) { shard->setMOTD(args[2]); - log.displayNL("Shard %u set required state to '%s' with message '%s'", + log.displayNL("Shard %u set required state to '%s' with message '%s'", shardId, al.toString().c_str(), args[2].c_str()); } else { - log.displayNL("Shard %u set required state to '%s'", + log.displayNL("Shard %u set required state to '%s'", shardId, al.toString().c_str()); shard->setMOTD(""); } - + // update WSState if possible @@ -4376,7 +4376,7 @@ endOfWelcomeUserResult: return true; } - + NLMISC_CLASS_COMMAND_DECL(forceSessionCleanup) { if (!_RingDb.query(string("SELECT session_id FROM sessions WHERE state = ")+toString(uint32(TSessionState::ss_open)))) @@ -4437,8 +4437,8 @@ endOfWelcomeUserResult: log.displayNL(" + Welcome service '%s' for shard %u", wsInfo.WSModuleProxy->getModuleName().c_str(), shardId); if (wsInfo.FixedSessionId.asInt() != 0) log.displayNL(" Mainland sessionId: %u", wsInfo.FixedSessionId.asInt()); - log.displayNL(" Access State = '%s', online = %s, message = '%s'", - wsInfo.ShardInfo->getRequiredState().toString().c_str(), + log.displayNL(" Access State = '%s', online = %s, message = '%s'", + wsInfo.ShardInfo->getRequiredState().toString().c_str(), wsInfo.ShardInfo->getWSOnline() ? "true" : "false", wsInfo.ShardInfo->getMOTD().c_str()); log.displayNL(" %u online players", wsInfo.NbOnlinePlayers); @@ -4455,7 +4455,7 @@ endOfWelcomeUserResult: { IModuleProxy *server = first->first; TSessionServerInfo &ssi = first->second; - + log.displayNL(" + Session server '%s' :", server->getModuleName().c_str()); log.displayNL(" Shard ID = %u", ssi.ShardId); log.displayNL(" Total player = %u", ssi.NbTotalPlayingChars); @@ -4479,9 +4479,9 @@ endOfWelcomeUserResult: return true; } - - }; + + }; NLNET_REGISTER_MODULE_FACTORY(CRingSessionManager, RingSessionManagerClassName); diff --git a/code/ryzom/server/src/shard_unifier_service/shard_unifier_service.cpp b/code/ryzom/server/src/shard_unifier_service/shard_unifier_service.cpp index d22cf82a9..50b4eb419 100644 --- a/code/ryzom/server/src/shard_unifier_service/shard_unifier_service.cpp +++ b/code/ryzom/server/src/shard_unifier_service/shard_unifier_service.cpp @@ -24,7 +24,9 @@ //#include #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #endif // NL_OS_WINDOWS diff --git a/code/ryzom/server/src/tick_service/range_mirror_manager.cpp b/code/ryzom/server/src/tick_service/range_mirror_manager.cpp index f988ac054..2c92c738f 100644 --- a/code/ryzom/server/src/tick_service/range_mirror_manager.cpp +++ b/code/ryzom/server/src/tick_service/range_mirror_manager.cpp @@ -472,7 +472,7 @@ void CRangeList::acquireFirstRow() */ bool CRangeList::acquireRange( NLNET::TServiceId ownerServiceId, NLNET::TServiceId mirrorServiceId, sint32 nbRows, TDataSetIndex *first, TDataSetIndex *last ) { - TDataSetIndex prevlast(~0); + TDataSetIndex prevlast(std::numeric_limits::max()); TRangeList::iterator irl = _RangeList.begin(); // Find a compatible range diff --git a/code/ryzom/server/src/tick_service/range_mirror_manager.h b/code/ryzom/server/src/tick_service/range_mirror_manager.h index 6615a1c6a..ed12f706b 100644 --- a/code/ryzom/server/src/tick_service/range_mirror_manager.h +++ b/code/ryzom/server/src/tick_service/range_mirror_manager.h @@ -28,6 +28,7 @@ #include #include #include +#include namespace NLNET { @@ -46,7 +47,7 @@ class CRangeList public: /// Default constructor - CRangeList() : _TotalMaxRows(~0) { acquireFirstRow(); } + CRangeList() : _TotalMaxRows(std::numeric_limits::max()) { acquireFirstRow(); } /// Constructor CRangeList( sint32 totalMaxRows ) : _TotalMaxRows( totalMaxRows ) { acquireFirstRow(); } diff --git a/code/ryzom/server/src/tick_service/tick_service.cpp b/code/ryzom/server/src/tick_service/tick_service.cpp index a25c1c83e..4a64fdd7c 100644 --- a/code/ryzom/server/src/tick_service/tick_service.cpp +++ b/code/ryzom/server/src/tick_service/tick_service.cpp @@ -31,7 +31,9 @@ #include #ifdef NL_OS_WINDOWS -# define NOMINMAX +# ifndef NL_COMP_MINGW +# define NOMINMAX +# endif # include #endif // NL_OS_WINDOWS @@ -823,7 +825,7 @@ bool CTickService::loadGameCycle() /* * */ -CTickServiceGameCycleTimeMeasure::CTickServiceGameCycleTimeMeasure() : HistoryMain( CTickService::getInstance()->getServiceId(), NLNET::TServiceId(~0), false ) {} +CTickServiceGameCycleTimeMeasure::CTickServiceGameCycleTimeMeasure() : HistoryMain( CTickService::getInstance()->getServiceId(), NLNET::TServiceId(std::numeric_limits::max()), false ) {} /* @@ -902,7 +904,7 @@ void CTickServiceGameCycleTimeMeasure::displayStat( NLMISC::CLog *log, TTimeMeas uint divideBy = (HistoryMain.NbMeasures==0) ? 0 : ((stat==MHTSum) ? HistoryMain.NbMeasures : 1); HistoryMain.Stats[stat].displayStat( log, TickServiceTimeMeasureTypeToCString, divideBy ); { - CMirrorTimeMeasure gatheredStats [NbTimeMeasureHistoryStats] = { 0, ~0, 0 }; + CMirrorTimeMeasure gatheredStats [NbTimeMeasureHistoryStats] = { 0, std::numeric_limits::max(), 0 }; for ( std::vector::const_iterator ihm=HistoryByMirror.begin(); ihm!=HistoryByMirror.end(); ++ihm ) { log->displayRawNL( "\tMS-%hu, %u measures:", (*ihm).ServiceId.get(), (*ihm).NbMeasures ); @@ -919,7 +921,7 @@ void CTickServiceGameCycleTimeMeasure::displayStat( NLMISC::CLog *log, TTimeMeas } } { - CServiceTimeMeasure gatheredStats [NbTimeMeasureHistoryStats] = { 0, ~0, 0 }; + CServiceTimeMeasure gatheredStats [NbTimeMeasureHistoryStats] = { 0, std::numeric_limits::max(), 0 }; for ( std::vector::const_iterator ihs=HistoryByService.begin(); ihs!=HistoryByService.end(); ++ihs ) { log->displayRawNL( "\t%s (on MS-%hu), %u measures:", CUnifiedNetwork::getInstance()->getServiceUnifiedName( (*ihs).ServiceId ).c_str(), (*ihs).ParentServiceId.get(), (*ihs).NbMeasures ); diff --git a/code/ryzom/server/src/tick_service/tick_service.h b/code/ryzom/server/src/tick_service/tick_service.h index 5b07793a3..9abe079bc 100644 --- a/code/ryzom/server/src/tick_service/tick_service.h +++ b/code/ryzom/server/src/tick_service/tick_service.h @@ -113,7 +113,7 @@ public: NbMeasures = 0; Stats.resize( NbTimeMeasureHistoryStats ); Stats[MHTSum] = 0; - Stats[MHTMin] = ~0; + Stats[MHTMin] = std::numeric_limits::max(); Stats[MHTMax] = 0; } } diff --git a/code/ryzom/tools/CMakeLists.txt b/code/ryzom/tools/CMakeLists.txt index 0bf9fb632..041ba210e 100644 --- a/code/ryzom/tools/CMakeLists.txt +++ b/code/ryzom/tools/CMakeLists.txt @@ -23,9 +23,7 @@ IF(WITH_LIGO AND WITH_NET) ADD_SUBDIRECTORY(sheets_packer) ENDIF(WITH_LIGO AND WITH_NET) -IF(WITH_RYZOM_CLIENT) - ADD_SUBDIRECTORY(client) -ENDIF(WITH_RYZOM_CLIENT) +ADD_SUBDIRECTORY(client) ADD_SUBDIRECTORY(server) diff --git a/code/ryzom/tools/client/CMakeLists.txt b/code/ryzom/tools/client/CMakeLists.txt index ff7516ccc..0c42233cb 100644 --- a/code/ryzom/tools/client/CMakeLists.txt +++ b/code/ryzom/tools/client/CMakeLists.txt @@ -1,5 +1,9 @@ -ADD_SUBDIRECTORY( client_patcher ) +IF(WITH_RYZOM_CLIENT) + ADD_SUBDIRECTORY(client_patcher) -IF( WITH_QT ) -ADD_SUBDIRECTORY( client_config_qt ) -ENDIF( WITH_QT ) + IF(WITH_QT) + ADD_SUBDIRECTORY(client_config_qt) + ENDIF() +ENDIF() + +ADD_SUBDIRECTORY(r2_islands_textures) diff --git a/code/ryzom/tools/client/client_patcher/CMakeLists.txt b/code/ryzom/tools/client/client_patcher/CMakeLists.txt index e5b845e43..70857105e 100644 --- a/code/ryzom/tools/client/client_patcher/CMakeLists.txt +++ b/code/ryzom/tools/client/client_patcher/CMakeLists.txt @@ -12,6 +12,7 @@ ADD_EXECUTABLE(ryzom_client_patcher ${SRC}) INCLUDE_DIRECTORIES( ${LIBXML2_INCLUDE_DIR} ${CURL_INCLUDE_DIRS} + ${ZLIB_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/ryzom/client/src ) @@ -20,6 +21,7 @@ TARGET_LINK_LIBRARIES(ryzom_client_patcher nelnet ryzom_gameshare ryzom_sevenzip + ${ZLIB_LIBRARIES} ${CURL_LIBRARIES}) IF(APPLE) diff --git a/code/ryzom/tools/client/r2_islands_textures/CMakeLists.txt b/code/ryzom/tools/client/r2_islands_textures/CMakeLists.txt new file mode 100644 index 000000000..0fc6c65a2 --- /dev/null +++ b/code/ryzom/tools/client/r2_islands_textures/CMakeLists.txt @@ -0,0 +1,17 @@ +FILE(GLOB SRC *.cpp *.h) + +ADD_EXECUTABLE(r2_islands_textures ${SRC}) + +INCLUDE_DIRECTORIES(${RZ_SERVER_SRC_DIR} ${LIBXML2_INCLUDE_DIR}) +TARGET_LINK_LIBRARIES(r2_islands_textures + ryzom_gameshare + ryzom_aishare + ${LIBXML2_LIBRARIES} + nelmisc + nel3d) +ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) + +NL_DEFAULT_PROPS(r2_islands_textures "Ryzom, Tools, Server: R2 Islands Textures") +NL_ADD_RUNTIME_FLAGS(r2_islands_textures) + +INSTALL(TARGETS r2_islands_textures RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT tools) diff --git a/code/ryzom/tools/client/r2_islands_textures/main.cpp b/code/ryzom/tools/client/r2_islands_textures/main.cpp new file mode 100644 index 000000000..cbde8b9d4 --- /dev/null +++ b/code/ryzom/tools/client/r2_islands_textures/main.cpp @@ -0,0 +1,29 @@ +// Ryzom - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include +#include "screenshot_islands.h" + +using namespace NLMISC; +using namespace R2; + +int main(int argc, char **argv) +{ + CScreenshotIslands screenshotIslands = CScreenshotIslands::getInstance(); + screenshotIslands.buildScreenshots(); + + return 0; +} diff --git a/code/ryzom/tools/client/r2_islands_textures/screenshot_islands.cpp b/code/ryzom/tools/client/r2_islands_textures/screenshot_islands.cpp new file mode 100644 index 000000000..69f701054 --- /dev/null +++ b/code/ryzom/tools/client/r2_islands_textures/screenshot_islands.cpp @@ -0,0 +1,2350 @@ +// Ryzom - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "screenshot_islands.h" + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +// AI share +#include + +#include + +#include + +using namespace NLMISC; +using namespace NL3D; +using namespace std; +using namespace EGSPD; +using namespace NLGEORGES; +using namespace RYAI_MAP_CRUNCH; + + +// The 3d driver +UDriver *driver = NULL; +CLandscapeIGManager LandscapeIGManager; + +uint ScreenShotWidth; +uint ScreenShotHeight; + +UMaterial sceneMaterial; + +namespace R2 +{ + +const TBufferEntry InteriorValue= (TBufferEntry)(~0u-1); +const TBufferEntry ValueBorder= (TBufferEntry)(~0u-2); +const uint32 BigValue= 15*5; +const float limitValue = 200.0; + +//------------------------------------------------------------------------------------------------- +CScreenshotIslands::CScreenshotIslands() +{ + _BackColor = CRGBA(255, 255, 255, 255); +} + +//------------------------------------------------------------------------------------------------- +void CScreenshotIslands::init() +{ + // Create a driver + driver = UDriver::createDriver(0, true); + nlassert(driver); + + sceneMaterial = driver->createMaterial(); + sceneMaterial.getObjectPtr()->setLighting(true); + sceneMaterial.getObjectPtr()->setSpecular(CRGBA(255, 255, 255, 255)); + sceneMaterial.getObjectPtr()->setShininess(50); + sceneMaterial.getObjectPtr()->setDiffuse(CRGBA(100, 100, 100, 255)); + sceneMaterial.getObjectPtr()->setEmissive(CRGBA(25, 25, 25, 255)); + + // load and parse the configfile + CConfigFile cf; + cf.load("island_screenshots.cfg"); + + // get the value of searchPaths + CConfigFile::CVar * searchPaths = cf.getVarPtr("SearchPaths"); + if(searchPaths) + { + for(int i = 0; i < searchPaths->size(); i++) + { + CPath::addSearchPath(searchPaths->asString(i).c_str(), true, false); + } + } + CPath::remapExtension("dds", "tga", true); + CPath::remapExtension("dds", "png", true); + + // get the scenario entry points file + CConfigFile::CVar * epFile = cf.getVarPtr("CompleteIslandsFile"); + if(epFile) + { + _CompleteIslandsFile = epFile->asString(); + } + + // get the out directory path + CConfigFile::CVar * outDir = cf.getVarPtr("OutDir"); + if(outDir) + { + _OutDirectory = outDir->asString(); + } + + // get the vegetation option + CConfigFile::CVar * veget = cf.getVarPtr("Vegetation"); + if(veget) + { + _Vegetation = veget->asBool(); + } + + // get the vegetation option + CConfigFile::CVar * inverseZTest = cf.getVarPtr("InverseZTest"); + if(inverseZTest) + { + _InverseZTest = inverseZTest->asBool(); + } + + // get list of continents + CConfigFile::CVar * continents = cf.getVarPtr("Continents"); + vector continentsName(continents->size()); + for(int i = 0; i < continents->size(); i++) + { + continentsName[i] = continents->asString(i); + } + + // get continents data (light, coarseMesh,...) + UFormLoader * formLoader; + for(uint i=0; i form = formLoader->loadForm(CPath::lookup(georgeFileName).c_str()); + if(form) + { + CContinentData continentData; + + UFormElm &formRoot = form->getRootNode(); + + const UFormElm *elm; + if(formRoot.getNodeByName(&elm, "LightLandscapeDay") && elm) + { + CDirLightSetup landscapeLightDay; + landscapeLightDay.build(*elm); + continentData.Ambiant = landscapeLightDay.Ambiant; + continentData.Diffuse = landscapeLightDay.Diffuse; + + if(continentsName[i]=="r2_jungle" || continentsName[i]=="r2_forest" || continentsName[i]=="r2_roots") + { + continentData.Ambiant = CRGBA(255, 255, 255, 255); + continentData.Diffuse = CRGBA(255, 255, 255, 255); + } + } + + formRoot.getValueByName(continentData.IGFile, "LandscapeIG"); + string zoneMin, zoneMax; + formRoot.getValueByName(zoneMin, "ZoneMin"); + formRoot.getValueByName(zoneMax, "ZoneMax"); + + getPosFromZoneName(zoneMin, continentData.ZoneMin); + getPosFromZoneName(zoneMax, continentData.ZoneMax); + + string filename; + if(formRoot.getValueByName(filename, "Ecosystem")) + { + UFormLoader *formLoaderEco = UFormLoader::createLoader(); + if(formLoaderEco) + { + // Load the form + CSmartPtr formEco = formLoaderEco->loadForm(filename.c_str()); + + if(formEco) + { + // Root node + UFormElm &formRootEco = formEco->getRootNode(); + + // Small bank. + formRootEco.getValueByName(continentData.SmallBank, "SmallBank"); + + // Far bank. + formRootEco.getValueByName(continentData.FarBank, "FarBank"); + + // Coarse mesh texture. + formRootEco.getValueByName(continentData.CoarseMeshMap, "CoarseMeshMap"); + } + else + { + nlwarning("CScreenshotIslands::init : Can't load form %s.", filename.c_str()); + } + UFormLoader::releaseLoader(formLoaderEco); + } + } + + _ContinentsData[continentsName[i]] = continentData; + } + UFormLoader::releaseLoader(formLoader); + } + + + // load islands + loadIslands(); + + searchIslandsBorders(); + + // get seasons + CConfigFile::CVar * seasonSuffixes = cf.getVarPtr("SeasonSuffixes"); + if(seasonSuffixes) + { + for(uint i = 0; i < (uint)seasonSuffixes->size(); i++) + { + _SeasonSuffixes.push_back(seasonSuffixes->asString(i)); + } + } + + // get the meter size in pixels + CConfigFile::CVar * meterSize = cf.getVarPtr("MeterPixelSize"); + if(meterSize) + { + _MeterPixelSize = meterSize->asInt(); + } +} + +//------------------------------------------------------------------------------------------------- +bool CScreenshotIslands::getPosFromZoneName(const std::string &name, NLMISC::CVector2f &dest) +{ + if(name.empty()) + { + nlwarning ("getPosFromZoneName(): empty name, can't getPosFromZoneName"); + return false; + } + + static std::string zoneName; + static string xStr, yStr; + xStr.clear(); + yStr.clear(); + zoneName = CFile::getFilenameWithoutExtension(name); + uint32 i = 0; + while(zoneName[i] != '_') + { + if(!::isdigit(zoneName[i])) return false; + yStr += zoneName[i]; ++i; + if(i == zoneName.size()) + return false; + } + ++i; + while(i < zoneName.size()) + { + if(!::isalpha(zoneName[i])) return false; + xStr += (char) ::toupper(zoneName[i]); ++i; + } + if(xStr.size() != 2) return false; + dest.x = 160.f * ((xStr[0] - 'A') * 26 + (xStr[1] - 'A')); + dest.y = 160.f * -atoi(yStr.c_str()); + return true; +} + +//------------------------------------------------------------------------------------------------- +void CScreenshotIslands::searchIslandsBorders() +{ + vector filenames; + list zonelFiles; + + map< CVector2f, bool> islandsMap; + + TContinentsData::iterator itCont(_ContinentsData.begin()), lastCont(_ContinentsData.end()); + for( ; itCont != lastCont ; ++itCont) + { + // for each continent we recover a map of zonel files whith position of + // left/bottom point of each zone for keys + filenames.clear(); + zonelFiles.clear(); + + string bnpFileName = itCont->first + ".bnp"; + CBigFile::getInstance().list(bnpFileName.c_str(), filenames); + + for(uint i=0; i::iterator itZonel(zonelFiles.begin()), lastZonel(zonelFiles.end()); + for( ; itZonel != lastZonel ; ++itZonel) + { + CVector2f position; + getPosFromZoneName(*itZonel, position); + + islandsMap[position] = true; + } + + // search for island borders + CContinentData & continent = itCont->second; + list< string >::const_iterator itIsland(continent.Islands.begin()), lastIsland(continent.Islands.end()); + for( ; itIsland != lastIsland ; ++itIsland) + { + if(_IslandsData.find(itIsland->c_str()) != _IslandsData.end()) + { + const CProximityZone & islandData = _IslandsData[itIsland->c_str()]; + + sint32 xmin = islandData.getBoundXMin(); + sint32 xmax = islandData.getBoundXMax(); + sint32 ymin = islandData.getBoundYMin(); + sint32 ymax = islandData.getBoundYMax(); + + sint32 width = xmax-xmin; + sint32 height = ymax-ymin; + + sint32 zonelXMin = ((uint)(xmin/160)) * 160; + sint32 zonelYMin = ((uint)(ymin/160) - 1) * 160; + sint32 zonelXMax = ((uint)(xmax/160)) * 160; + sint32 zonelYMax = ((uint)(ymax/160) - 1) * 160; + + list< CVector2f > leftBorders, rightBorders, bottomBorders, topBorders; + + // search for left and right borders on lines + for(sint32 y = zonelYMin; y<=zonelYMax; y+=160 ) + { + sint32 x=zonelXMin; + CVector2f vec((float)x, (float)y); + bool lastZoneFull = (islandsMap.find(vec) != islandsMap.end()); + bool currentZoneFull; + + while(x<=zonelXMax) + { + vec = CVector2f((float)x, (float)y); + currentZoneFull = (islandsMap.find(vec) != islandsMap.end()); + + if(lastZoneFull && !currentZoneFull && vec.x-1 >= xmin) + { + rightBorders.push_back(CVector2f(vec.x-1, vec.y)); + } + else if(!lastZoneFull && currentZoneFull) + { + leftBorders.push_back(vec); + } + x += 160; + lastZoneFull = currentZoneFull; + } + } + + // search for bottom and top borders on columns + for(sint32 x = zonelXMin; x<=zonelXMax; x+=160 ) + { + sint32 y=zonelYMin; + CVector2f vec((float)x, (float)y); + bool lastZoneFull = (islandsMap.find(vec) != islandsMap.end()); + bool currentZoneFull; + + while(y<=zonelYMax) + { + vec = CVector2f((float)x, (float)y); + currentZoneFull = (islandsMap.find(vec) != islandsMap.end()); + + if(lastZoneFull && !currentZoneFull && vec.y-1 >= ymin) + { + topBorders.push_back(CVector2f(vec.x, vec.y-1)); + } + else if(!lastZoneFull && currentZoneFull) + { + bottomBorders.push_back(vec); + } + y += 160; + lastZoneFull = currentZoneFull; + } + } + + _BorderIslands[*itIsland + "/right"] = rightBorders; + _BorderIslands[*itIsland + "/left"] = leftBorders; + _BorderIslands[*itIsland + "/bottom"] = bottomBorders; + _BorderIslands[*itIsland + "/top"] = topBorders; + } + } + } +} + +//------------------------------------------------------------------------------------------------- +void CScreenshotIslands::attenuateIslandBorders(const std::string & islandName, CBitmap & islandBitmap, + const CProximityZone & islandData) +{ + list< CVector2f > leftBorders, rightBorders, bottomBorders, topBorders; + rightBorders = _BorderIslands[islandName + "/right"]; + leftBorders = _BorderIslands[islandName + "/left"]; + bottomBorders = _BorderIslands[islandName + "/bottom"]; + topBorders = _BorderIslands[islandName + "/top"]; + + sint32 xmin = islandData.getBoundXMin(); + sint32 xmax = islandData.getBoundXMax(); + sint32 ymin = islandData.getBoundYMin(); + sint32 ymax = islandData.getBoundYMax(); + + sint32 width = xmax-xmin; + sint32 height = ymax-ymin; + uint8 *dest = &(islandBitmap.getPixels(0)[0]); + + list< CVector2f >::iterator itBorder; + + for(itBorder=leftBorders.begin(); itBorder!=leftBorders.end(); itBorder++) + { + const CVector2f initPoint = *itBorder; + sint32 x = (sint32)initPoint.x - xmin; + sint32 y = (sint32)initPoint.y - ymin; + sint32 maxBorder = 160; + if(y<0) + { + maxBorder += y; + y = 0; + } + sint32 inity = y; + + while(y<(inity+maxBorder) && y<(sint32)height) + { + double noiseValue = (1+cos(((y-inity)*2*Pi)/maxBorder))*5; + double evalNoise = 10 + noiseValue; + double diffAlpha = 255/evalNoise; + + CRGBA color = islandBitmap.getPixelColor(x, height-y-1); + sint32 currentX = x-1; + + while((currentX>=x-evalNoise) && currentX>=0) + { + uint8 *pixel = &(islandBitmap.getPixels(0)[((height-y-1)*width + currentX)*4]); + uint alpha = (uint)(255-diffAlpha*(x-currentX)); + uint invAlpha = 255-alpha; + + *pixel = (uint8) (((invAlpha * *pixel) + (alpha * color.R)) >> 8); + *(pixel + 1) = (uint8) (((invAlpha * *(pixel + 1)) + (alpha * color.G)) >> 8); + *(pixel + 2) = (uint8) (((invAlpha * *(pixel + 2)) + (alpha * color.B)) >> 8); + *(pixel + 3) = (uint8) 255; + + currentX--; + } + y++; + } + } + + for(itBorder=rightBorders.begin(); itBorder!=rightBorders.end(); itBorder++) + { + const CVector2f initPoint = *itBorder; + sint32 x = (sint32)initPoint.x - xmin; + sint32 y = (sint32)initPoint.y - ymin; + sint32 maxBorder = 160; + if(y<0) + { + maxBorder += y; + y = 0; + } + sint32 inity = y; + + while(y<(inity+maxBorder) && y<(sint32)height) + { + double noiseValue = (1+cos(((y-inity)*2*Pi)/maxBorder))*5; + double evalNoise = 10 + noiseValue; + double diffAlpha = 255/evalNoise; + + CRGBA color = islandBitmap.getPixelColor(x, height-y-1); + sint32 currentX = x+1; + + while((currentX<=x+evalNoise) && currentX> 8); + *(pixel + 1) = (uint8) (((invAlpha * *(pixel + 1)) + (alpha * color.G)) >> 8); + *(pixel + 2) = (uint8) (((invAlpha * *(pixel + 2)) + (alpha * color.B)) >> 8); + *(pixel + 3) = (uint8) 255; + + currentX++; + } + + y++; + } + } + + for(itBorder=bottomBorders.begin(); itBorder!=bottomBorders.end(); itBorder++) + { + const CVector2f initPoint = *itBorder; + sint32 x = (sint32)initPoint.x - xmin; + sint32 y = (sint32)initPoint.y - ymin; + sint32 maxBorder = 160; + if(x<0) + { + maxBorder += x; + x = 0; + } + sint32 initx = x; + + while(x<(initx+maxBorder) && x<(sint32)width) + { + double noiseValue = (1+cos(((x-initx)*2*Pi)/maxBorder))*5; + double evalNoise = 10 + noiseValue; + double diffAlpha = 255/evalNoise; + + CRGBA color = islandBitmap.getPixelColor(x, height-y-1); + sint32 currentY = y-1; + + while((currentY>=y-evalNoise) && currentY>=0) + { + uint8 *pixel = &(islandBitmap.getPixels(0)[((height-currentY-1)*width + x)*4]); + uint alpha = (uint)(255-diffAlpha*(y-currentY)); + uint invAlpha = 255-alpha; + + *pixel = (uint8) (((invAlpha * *pixel) + (alpha * color.R)) >> 8); + *(pixel + 1) = (uint8) (((invAlpha * *(pixel + 1)) + (alpha * color.G)) >> 8); + *(pixel + 2) = (uint8) (((invAlpha * *(pixel + 2)) + (alpha * color.B)) >> 8); + *(pixel + 3) = (uint8) 255; + + currentY--; + } + + x++; + } + } + + for(itBorder=topBorders.begin(); itBorder!=topBorders.end(); itBorder++) + { + const CVector2f initPoint = *itBorder; + sint32 x = (sint32)initPoint.x - xmin; + sint32 y = (sint32)initPoint.y - ymin; + sint32 maxBorder = 160; + if(x<0) + { + maxBorder += x; + x = 0; + } + sint32 initx = x; + + while(x<(initx+maxBorder) && x<(sint32)width) + { + double noiseValue = (1+cos(((x-initx)*2*Pi)/maxBorder))*5; + double evalNoise = 10 + noiseValue; + double diffAlpha = 255/evalNoise; + + CRGBA color = islandBitmap.getPixelColor(x, height-y-1); + sint32 currentY = y+1; + + while((currentY<=y+evalNoise) && currentY> 8); + *(pixel + 1) = (uint8) (((invAlpha * *(pixel + 1)) + (alpha * color.G)) >> 8); + *(pixel + 2) = (uint8) (((invAlpha * *(pixel + 2)) + (alpha * color.B)) >> 8); + *(pixel + 3) = (uint8) 255; + + currentY++; + } + + x++; + } + } +} + +//------------------------------------------------------------------------------------------------- +void CScreenshotIslands::buildScreenshots() +{ + init(); + buildIslandsTextures(); +} + +//------------------------------------------------------------------------------------------------- +void CScreenshotIslands::writeProximityBufferToTgaFile(const std::string& fileName,const TBuffer& buffer,uint32 scanWidth,uint32 scanHeight) +{ + uint imageWidth = (scanWidth); // (scanWidth+15)&~15; + uint imageHeight = (scanHeight); + + CTGAImageGrey tgaImage; + tgaImage.setup((uint16)imageWidth, (uint16)imageHeight, fileName, 0, 0); + for (uint32 y=0;y255*5)?255:value/5); + } + tgaImage.writeLine(); + } +} + +//------------------------------------------------------------------------------------------------- +void CScreenshotIslands::processProximityBuffer(TBuffer & inputBuffer, uint32 lineLength, TBuffer& resultBuffer) +{ + // a couple of constants to control the range over which our degressive filter is to be applied + const uint32 smallValue= 2*5; + + float a = 5*((255.0 - limitValue)/(float(100-BigValue))); + float b = (float)(limitValue*5 - a*BigValue); + + // determine numer of lines in the buffer... + uint32 numLines= inputBuffer.size()/ lineLength; + + // clear out the result buffer and reset all values to 5*255, remembering that this is the correct value for the image edges + resultBuffer.clear(); + resultBuffer.resize(inputBuffer.size(),(TBufferEntry)5*255); + + for (uint32 y=1;yBigValue) value=5*255; + else value= (uint32)(((1.0-cos(Pi*(float(value-smallValue)/(float)(BigValue-smallValue))))/2.0)*float(5*255)); + */ + + if (value==ValueBorder); + else if ((value>=0) && (valueBigValue) + { + if(value==InteriorValue) + { + value = (uint)(5*limitValue); + } + else + { + value = (uint)(a*value+b); + if(value > 5*255) value = 5*255; + } + } + else if((value>=smallValue) && (value<=BigValue)) + { + value= (uint32)(((1.0-cos(Pi*(float(value-smallValue)/(float)(BigValue-smallValue))))/2.0)*float(5*limitValue)); + } + + // store the value into the result buffer + resultBuffer[offset]= (TBufferEntry)value; + } + } + + // modify inputBuffer to store "bigValue" limit + for (uint32 y=1;y0) + { + uint16 nextValue = resultBuffer[offset-1]; + uint16 prevValue = (TBufferEntry)(5*limitValue); + if(nextValue!=(TBufferEntry)(5*limitValue)) + { + uint32 count = x-1; + while((count>x-7) && (count>0) && ((nextValue=resultBuffer[lineOffset+count])!=0) + && nextValue!=(TBufferEntry)(5*limitValue) && (nextValue!=ValueBorder)) + { + uint16 newValue = (TBufferEntry)(prevValue+5*7); + if(newValue < nextValue) + { + resultBuffer[lineOffset+count] = newValue; + } + + prevValue = newValue; + count--; + } + } + } + } + } + } + + //columns + for (uint32 x=0;x=startOffset) + { + uint16 nextValue = resultBuffer[offset-lineLength]; + uint16 prevValue = (TBufferEntry)(5*limitValue); + if(nextValue!=(TBufferEntry)(5*limitValue)) + { + uint32 count = offset-lineLength; + while((count>offset-7*lineLength) && (count>=startOffset) && + ((nextValue=resultBuffer[count])!=0) && nextValue!=(TBufferEntry)(5*limitValue) && (nextValue!=ValueBorder)) + { + uint16 newValue = (TBufferEntry)(prevValue+5*7); + if(newValue < nextValue) + { + resultBuffer[count] = newValue; + } + + prevValue = newValue; + count -= lineLength; + } + } + } + } + } + } + */ + + //----------------------------------------------------------------------------- + // search for pixels of borders + map< CVector2f, bool > bordersPixels; + for (uint32 y=0;y leftBorders, rightBorders, bottomBorders, topBorders; + for (uint32 y=0;y0) + { + for(uint32 xc=(uint32)firstPixelBorder.x; xc<(uint32)(firstPixelBorder.x+nbPixelsBorder); xc++) + { + if(resultBuffer[(y-1)*lineLength+xc]==(TBufferEntry)(5*255)) + { + bottom = true; + break; + } + } + } + + if(y+10) + { + for(uint32 yc=(uint32)firstPixelBorder.y; yc<(uint32)(firstPixelBorder.y+nbPixelsBorder); yc++) + { + if(resultBuffer[yc*lineLength+x-1]==(TBufferEntry)(5*255)) + { + left = true; + break; + } + } + } + + if(x+1=(uint32)(y-evalNoise)) && yc>=0) + { + uint16 newValue = (TBufferEntry)(5*(limitValue + diffAlpha*(y-yc))); + uint16 currentValue = (TBufferEntry)resultBuffer[yc*lineLength+xc]; + if(newValue=(uint32)(x-evalNoise)) && xc>=0) + { + uint16 newValue = (TBufferEntry)(5*(limitValue + diffAlpha*(x-xc))); + uint16 currentValue = (TBufferEntry)resultBuffer[yc*lineLength+xc]; + if(newValue islands; + CScenarioEntryPoints scenarioEntryPoints = CScenarioEntryPoints::getInstance(); + + scenarioEntryPoints.loadFromFile(); + const CScenarioEntryPoints::TEntryPoints& entryPoints = scenarioEntryPoints.getEntryPoints(); + + CScenarioEntryPoints::TEntryPoints::const_iterator entry(entryPoints.begin()), entryPoint(entryPoints.end()); + for( ; entry != entryPoint ; ++entry) + { + islands[entry->Island] = CVector2f((float)entry->X, (float)entry->Y); + } + + // search islands of each continent + map< string, CVector2f >::iterator itIsland(islands.begin()), lastIsland(islands.end()); + for( ; itIsland != lastIsland ; ++itIsland) + { + const CVector2f & entryPoint = itIsland->second; + + // search continent of this island + TContinentsData::iterator itCont(_ContinentsData.begin()), lastCont(_ContinentsData.end()); + for( ; itCont != lastCont ; ++itCont) + { + CContinentData & continent = itCont->second; + CVector2f zoneMax = continent.ZoneMax; + CVector2f zoneMin = continent.ZoneMin; + + if((zoneMin.x <= entryPoint.x) && (entryPoint.x <= zoneMax.x) + && (zoneMax.y <= entryPoint.y) && (entryPoint.y <= zoneMin.y)) + { + continent.Islands.push_back(itIsland->first); + break; + } + } + } + + // search data of each island + TContinentsData::iterator itCont(_ContinentsData.begin()), lastCont(_ContinentsData.end()); + for( ; itCont != lastCont ; ++itCont) + { + string aiFileName = itCont->first+"_0.cwmap2"; + + const CContinentData & continent = itCont->second; + + CProximityMapBuffer continentBuffer; + continentBuffer.load(CPath::lookup(aiFileName)); + + CProximityMapBuffer::TZones zones; + continentBuffer.calculateZones(zones); + + for (uint32 i=0;i::const_iterator itIsland(continent.Islands.begin()), lastIsland(continent.Islands.end()); + for( ; itIsland != lastIsland ; ++itIsland) + { + const CVector2f & entryPoint = islands[*itIsland]; + sint32 xmin = zones[i].getBoundXMin(); + sint32 xmax = zones[i].getBoundXMax(); + sint32 ymin = zones[i].getBoundYMin(); + sint32 ymax = zones[i].getBoundYMax(); + + if((xmin <= entryPoint.x) && (entryPoint.x <= xmax) + && (ymin <= entryPoint.y) && (entryPoint.y <= ymax)) + { + fileName = _OutDirectory + "/" + *itIsland + "_prox.tga"; + _IslandsData[*itIsland] = zones[i]; + break; + } + } + + // write the processed proximity map to an output file + if(fileName != "") + { + writeProximityBufferToTgaFile(fileName, cleanBuffer, zones[i].getZoneWidth(), zones[i].getZoneHeight()); + _TempFileNames.push_back(fileName); + + fileName = _OutDirectory + "/" + *itIsland + "_limit.tga"; + writeProximityBufferToTgaFile(fileName, zoneBuffer, zones[i].getZoneWidth(), zones[i].getZoneHeight()); + _TempFileNames.push_back(fileName); + } + else + { + nlinfo("Zone of island not found, tga not build"); + } + } + } + + + CScenarioEntryPoints::TCompleteIslands completeIslands(entryPoints.size()); + + uint completeIslandsNb = 0; + for(uint e=0; e::const_iterator itIsland(itCont->second.Islands.begin()), lastIsland(itCont->second.Islands.end()); + for( ; itIsland != lastIsland ; ++itIsland) + { + if(*itIsland == entry.Island) + { + completeIsland.Continent = CSString(itCont->first); + if(_IslandsData.find(entry.Island)!=_IslandsData.end()) + { + completeIsland.XMin = _IslandsData[entry.Island].getBoundXMin(); + completeIsland.YMin = _IslandsData[entry.Island].getBoundYMin(); + completeIsland.XMax = _IslandsData[entry.Island].getBoundXMax(); + completeIsland.YMax = _IslandsData[entry.Island].getBoundYMax(); + completeIslands[completeIslandsNb] = completeIsland; + completeIslandsNb++; + } + break; + } + } + } + } + completeIslands.resize(completeIslandsNb); + + CScenarioEntryPoints::getInstance().saveXMLFile(completeIslands, _CompleteIslandsFile); +} + +//-------------------------------------------------------------------------------- + +void CScreenshotIslands::getBuffer(UScene * scene, ULandscape * landscape, CBitmap &btm) +{ + // + if (ScreenShotWidth && ScreenShotHeight) + { + UCamera camera = scene->getCam(); + + // Destination image + CBitmap dest; + btm.resize(ScreenShotWidth, ScreenShotHeight, CBitmap::RGBA); + + uint windowWidth = driver->getWindowWidth(); + uint windowHeight = driver->getWindowHeight(); + + uint top; + uint bottom = min(windowHeight, ScreenShotHeight); + for (top=0; topclearBuffers(_BackColor); + + // store initial frustum and viewport + CFrustum Frustum = scene->getCam().getFrustum(); + CViewport Viewport = scene->getViewport(); + + // Build a new frustum + CFrustum frustumPart; + frustumPart.Left = Frustum.Left+(Frustum.Right-Frustum.Left)*((float)left/(float)ScreenShotWidth); + frustumPart.Right = Frustum.Left+(Frustum.Right-Frustum.Left)*((float)right/(float)ScreenShotWidth); + frustumPart.Top = ceil(Frustum.Top+(Frustum.Bottom-Frustum.Top)*((float)top/(float)ScreenShotHeight)); + frustumPart.Bottom = ceil(Frustum.Top+(Frustum.Bottom-Frustum.Top)*((float)bottom/(float)ScreenShotHeight)); + frustumPart.Near = Frustum.Near; + frustumPart.Far = Frustum.Far; + frustumPart.Perspective = Frustum.Perspective; + + // Build a new viewport + CViewport viewport; + viewport.init(0, 0, (float)(right-left)/windowWidth, + (float)(bottom-top)/windowHeight); + + // Activate all this + scene->getCam().setFrustum(frustumPart); + scene->setViewport(viewport); + + scene->setMaxSkeletonsInNotCLodForm(1000000); + scene->setPolygonBalancingMode(UScene::PolygonBalancingOff); + + if(_InverseZTest) + { + // render scene with inversed ZBuffer test (keep greater distances) + driver->setColorMask(false, false, false, false); + sceneMaterial.setZFunc(UMaterial::less); + + // initialize ZBuffer with leak value + driver->setMatrixMode2D11(); + CQuad quad; + quad.V0 = CVector(0.0, 0.0, 0.0); + quad.V1 = CVector(1.0, 0.0, 0.0); + quad.V2 = CVector(1.0, 1.0, 0.0); + quad.V3 = CVector(0.0, 1.0, 0.0); + + driver->drawQuad(quad, sceneMaterial); + driver->setMatrixMode3D(camera); + driver->setColorMask(true, true, true, true); + + scene->enableElementRender(UScene::FilterWater, false); + } + + scene->render(); + + // display vegetables with normal ZBuffer test + if(_InverseZTest && _Vegetation) + { + scene->enableElementRender(UScene::FilterWater, false); + scene->enableElementRender(UScene::FilterLandscape, false); + scene->enableElementRender(UScene::FilterWater, true); + scene->render(); + scene->enableElementRender(UScene::FilterLandscape, true); + } + + // Get the bitmap + driver->getBuffer(dest); + btm.blit(dest, 0, windowHeight-(bottom-top), right-left, bottom-top, left, top); + + // restore camera + scene->getCam().setFrustum(Frustum); + scene->setViewport(Viewport); + + driver->flush(); + driver->swapBuffers(); + + // Next + right = std::min(right+windowWidth, ScreenShotWidth); + } + + // Next + bottom = std::min(bottom+windowHeight, ScreenShotHeight); + } + } + else + { + driver->getBuffer(btm); + } +} + + + +void CScreenshotIslands::buildIslandsTextures() +{ + int loop = 0; + int maxLoop = 6; + + // Create the window with config file values + driver->setDisplay(UDriver::CMode(512, 512, 32, true)); + + // Create a scene + UScene * scene = driver->createScene(true); + scene->animate(CTime::ticksToSecond(CTime::getPerformanceTime())); + scene->setMaxSkeletonsInNotCLodForm(1000000); + scene->setPolygonBalancingMode(UScene::PolygonBalancingOff); + + // Create a camera + UCamera camera = scene->getCam(); + camera.setTransformMode(UTransformable::DirectMatrix); + + // Create and load landscape + ULandscape * landscape = scene->createLandscape(); + landscape->setThreshold(0.0005); + if(_InverseZTest) + { + landscape->setZFunc(UMaterial::greaterequal); + } + else + { + landscape->setZFunc(UMaterial::less); + } + + //Iteration on seasons + list< string >::iterator itSeason(_SeasonSuffixes.begin()), lastSeason(_SeasonSuffixes.end()); + for( ; itSeason != lastSeason ; ++itSeason) + { + string seasonSuffix = *itSeason; + + int season; + if(seasonSuffix=="_sp") season = CSeason::Spring; + else if(seasonSuffix=="_su") season = CSeason::Summer; + else if(seasonSuffix=="_au") season = CSeason::Autumn; + else if(seasonSuffix=="_wi") season = CSeason::Winter; + + // Iterations on Continents + TContinentsData::iterator itCont(_ContinentsData.begin()), lastCont(_ContinentsData.end()); + for( ; itCont != lastCont ; ++itCont) + { + const CContinentData & continent = itCont->second; + + // Light init + landscape->setupStaticLight(continent.Diffuse, continent.Ambiant, 1.0f); + + string coarseMeshFile = continent.CoarseMeshMap; + string coarseMeshWithoutExt = CFile::getFilenameWithoutExtension(coarseMeshFile); + string coarseMeshExt = CFile::getExtension(coarseMeshFile); + coarseMeshFile = coarseMeshWithoutExt + seasonSuffix + "." + coarseMeshExt; + nldebug("Coarse mesh texture: '%s'", coarseMeshFile.c_str()); + scene->setCoarseMeshManagerTexture(coarseMeshFile.c_str()); + + // Load the landscape + string farBank = continent.FarBank; + string farBankWithoutExt = CFile::getFilenameWithoutExtension(farBank); + string farBankExt = CFile::getExtension(farBank); + farBank = farBankWithoutExt + seasonSuffix + "." + farBankExt; + landscape->loadBankFiles(continent.SmallBank, farBank); + + // Load vegatables + LandscapeIGManager.initIG(scene, continent.IGFile, driver, season, NULL); + + // Iterations on Islands + list< string >::const_iterator itIsland(continent.Islands.begin()), lastIsland(continent.Islands.end()); + for( ; itIsland != lastIsland ; ++itIsland) + { + loop = 0; + + if(_IslandsData.find(itIsland->c_str()) != _IslandsData.end()) + { + const CProximityZone & islandData = _IslandsData[itIsland->c_str()]; + + sint32 xmin = islandData.getBoundXMin(); + sint32 xmax = islandData.getBoundXMax(); + sint32 ymin = islandData.getBoundYMin(); + sint32 ymax = islandData.getBoundYMax(); + + float width = (float)(xmax-xmin); + float height = (float)(ymax-ymin); + ScreenShotWidth = (uint)(width*_MeterPixelSize); + ScreenShotHeight = (uint)(height*_MeterPixelSize); + + // position in island center + float posx = ((float)(xmax+xmin))/2; + float posy = ((float)(ymax+ymin))/2; + CVector entryPos(posx, posy, 400); + + // Setup camera + CMatrix startCamMatrix; + startCamMatrix.setPos(entryPos); + startCamMatrix.rotateX(-(float)Pi/2); + camera.setMatrix(startCamMatrix); + camera.setFrustum(width, height, -10000.0f, 10000.0f, false); + + // init lanscape + landscape->postfixTileFilename(seasonSuffix.c_str()); + + while(loop zonesAdded; + vector zonesRemoved; + IProgressCallback progress; + landscape->refreshAllZonesAround(camera.getMatrix().getPos(), 1000, zonesAdded, zonesRemoved, progress); + if(_Vegetation) + { + LandscapeIGManager.unloadArrayZoneIG(zonesRemoved); + LandscapeIGManager.loadArrayZoneIG(zonesAdded); + + vector::iterator itName(zonesAdded.begin()), lastName(zonesAdded.end()); + for( ; itName != lastName ; ++itName) + { + UInstanceGroup * instanceGr = LandscapeIGManager.getIG(*itName); + if(instanceGr) + { + uint nbInst = instanceGr->getNumInstance(); + for(uint i=0; igetNumInstance(); i++) + { + instanceGr->setCoarseMeshDist(i, 100000); + instanceGr->setDistMax(i, 100000); + } + } + } + } + scene->animate(CTime::ticksToSecond(CTime::getPerformanceTime())); + + // Clear all buffers + driver->clearBuffers(_BackColor); + + if(_InverseZTest) + { + // render scene with inversed ZBuffer test (keep greater distances) + driver->setColorMask(false, false, false, false); + sceneMaterial.setZFunc(UMaterial::less); + + // initialize ZBuffer with leak value + driver->setMatrixMode2D11(); + CQuad quad; + quad.V0 = CVector(0.0, 0.0, 0.0); + quad.V1 = CVector(1.0, 0.0, 0.0); + quad.V2 = CVector(1.0, 1.0, 0.0); + quad.V3 = CVector(0.0, 1.0, 0.0); + + driver->drawQuad(quad, sceneMaterial); + driver->setMatrixMode3D(camera); + driver->setColorMask(true, true, true, true); + + scene->enableElementRender(UScene::FilterWater, false); + } + + scene->render(); + + // display vegetables with normal ZBuffer test + if(_InverseZTest && _Vegetation) + { + scene->enableElementRender(UScene::FilterLandscape, false); + scene->enableElementRender(UScene::FilterWater, true); + scene->render(); + scene->enableElementRender(UScene::FilterLandscape, true); + } + + // Swap 3d buffers + driver->flush(); + driver->swapBuffers(); + + // Pump user input messages + driver->EventServer.pump(); + + loop += 1; + + // Screenshot + if(loop==maxLoop-1) + { + CBitmap islandBitmap; + getBuffer(scene, landscape, islandBitmap); + + buildBackTextureHLS(*itIsland, islandBitmap); + } + if(loop==maxLoop) + { + // create srcennshot bitmap of full island + CBitmap islandBitmap; + getBuffer(scene, landscape, islandBitmap); + + attenuateIslandBorders(*itIsland, islandBitmap, islandData); + + // load proximity bitmap + CBitmap proxBitmap; + std::string proxFileName = _OutDirectory + "/" + *itIsland + "_prox.tga"; + CIFile proxFS(proxFileName.c_str()); + proxBitmap.load(proxFS); + + // resize proximity bitmap + CBitmap tempBitmap; + int newWidth = islandBitmap.getWidth(); + int newHeight = islandBitmap.getHeight(); + tempBitmap.resize(newWidth, newHeight, islandBitmap.PixelFormat); + // blit src bitmap + //tempBitmap.blit(proxBitmap, 0, 0, newWidth, newHeight, 0, 0); + { + const uint8 *prox = &(proxBitmap.getPixels(0)[0]); + uint8 *temp = &(tempBitmap.getPixels(0)[0]); + for (uint y = 0; y < newHeight; ++y) + for (uint x = 0; x < newWidth; ++x) + { + uint ys = (y * proxBitmap.getHeight()) / newHeight; + uint xs = (x * proxBitmap.getWidth()) / newWidth; + uint addr = ((y * newWidth) + x) * 4; + uint addrs = ((ys * proxBitmap.getWidth()) + xs) * 4; + temp[addr] = prox[addrs]; + temp[addr+1] = prox[addrs+1]; + temp[addr+2] = prox[addrs+2]; + temp[addr+3] = prox[addrs+3]; + } + } + + // swap them + proxBitmap.resize(newWidth, newHeight, proxBitmap.PixelFormat); + proxBitmap.swap(tempBitmap); + + //proxBitmap.resample(newWidth, newHeight); + + + // create final bitmap + CBitmap bitmapDest; + bitmapDest.resize(islandBitmap.getWidth(), islandBitmap.getHeight(), islandBitmap.PixelFormat); + + + // mix black and full island bitmaps with blend factor of proximity bitmap pixels + uint numPix = islandBitmap.getWidth() * islandBitmap.getHeight(); + + const uint8 *alphaProx = &(proxBitmap.getPixels(0)[0]); + const uint8 *srcIsland = &(islandBitmap.getPixels(0)[0]); + uint8 *dest = &(bitmapDest.getPixels(0)[0]); + + + const uint8 *srcBack = &(_BackBitmap.getPixels(0)[0]); + + uint8 *endDest = dest + (numPix << 2); + + do + { + uint invblendFact = (uint) alphaProx[0]; + uint blendFact = 256 - invblendFact; + + // blend 4 component at each pass + *dest = (uint8) (((blendFact * *srcIsland) + (invblendFact * *srcBack)) >> 8); + *(dest + 1) = (uint8) (((blendFact * *(srcIsland + 1)) + (invblendFact * *(srcBack + 1))) >> 8); + *(dest + 2) = (uint8) (((blendFact * *(srcIsland + 2)) + (invblendFact * *(srcBack + 2))) >> 8); + *(dest + 3) = (uint8) 255; + + alphaProx = alphaProx + 4; + srcIsland = srcIsland + 4; + dest = dest + 4; + + srcBack = srcBack + 4; + } + while(dest != endDest); + + + // create tga file of avoidable place in island + string textureName = _OutDirectory + "/" + *itIsland + seasonSuffix + ".tga"; + + CBitmap bitmapLittle; + bitmapLittle.resize(bitmapDest.getWidth(), bitmapDest.getHeight(), bitmapDest.PixelFormat); + bitmapLittle = bitmapDest; + if(!isPowerOf2(bitmapDest.getWidth()) || !isPowerOf2(bitmapDest.getHeight()) ) + { + uint pow2w = NLMISC::raiseToNextPowerOf2(bitmapDest.getWidth()); + uint pow2h = NLMISC::raiseToNextPowerOf2(bitmapDest.getHeight()); + CBitmap enlargedBitmap; + enlargedBitmap.resize(pow2w, pow2h, bitmapDest.PixelFormat); + // blit src bitmap + enlargedBitmap.blit(&bitmapDest, 0, 0); + // swap them + bitmapDest.swap(enlargedBitmap); + } + + COFile fsDest(textureName.c_str()); + bitmapDest.writeTGA(fsDest,32); + + + // little tga + bitmapLittle.resample(bitmapLittle.getWidth()/10, bitmapLittle.getHeight()/10); + if(!isPowerOf2(bitmapLittle.getWidth()) || !isPowerOf2(bitmapLittle.getHeight()) ) + { + uint pow2w = NLMISC::raiseToNextPowerOf2(bitmapLittle.getWidth()); + uint pow2h = NLMISC::raiseToNextPowerOf2(bitmapLittle.getHeight()); + CBitmap enlargedBitmap; + enlargedBitmap.resize(pow2w, pow2h, bitmapLittle.PixelFormat); + // blit src bitmap + enlargedBitmap.blit(&bitmapLittle, 0, 0); + // swap them + bitmapLittle.swap(enlargedBitmap); + } + + textureName = _OutDirectory + "/" + *itIsland + seasonSuffix + "_little.tga"; + COFile fsLittle(textureName.c_str()); + bitmapLittle.writeTGA(fsLittle,32); + + _BackColor = CRGBA(255, 255, 255, 255); + } + } + } + } + + LandscapeIGManager.reset(); + landscape->removeAllZones(); + } + } + + // remove proximity tga + list::iterator itProx(_TempFileNames.begin()), lastProx(_TempFileNames.end()); + for( ; itProx != lastProx ; ++itProx) + { + CFile::deleteFile(*itProx); + }; +} + +//-------------------------------------------------------------------------------- +inline bool RGB2HSV(const CRGBA & rgba, uint & Hue, uint & Sat, uint & Val) +{ + double Min_, Max_, Delta, H, S, V; + + H = 0.0; + Min_ = min(min(rgba.R, rgba.G), rgba.B); + Max_ = max(max(rgba.R, rgba.G), rgba.B); + Delta = ( Max_ - Min_); + V = Max_; + + if(Max_ != 0.0) + { + S = 255.0*Delta/Max_; + } + else + { + S = 0.0; + H = -1; + return false; + } + + if(rgba.R == Max_) + { + H = (rgba.G - rgba.B) / Delta; + } + else if(rgba.G == Max_) + { + H = 2.0 + (rgba.B - rgba.R) / Delta; + } + else + { + H = 4.0 + (rgba.R - rgba.G) / Delta; + } + + H = H * 60; + if(H < 0.0) + { + H = H + 360.0; + } + + Hue = (uint)H ; // Hue -> 0..360 + Sat = (uint)S * 100 / 255; // Saturation -> 0..100 % + Val = (uint)V * 100 / 255; // Value - > 0..100 % + + return true; +} + +//------------------------------------------------------------------------------------------------- +inline bool infHLS(const CRGBA & rgba1, const CRGBA & rgba2) +{ + uint h1, s1, v1, h2, s2, v2; + RGB2HSV(rgba1, h1, s1, v1); + RGB2HSV(rgba2, h2, s2, v2); + + if(h1 != h2) + { + return (h1 < h2); + } + else if(s1 != s2) + { + return (s1 < s2); + } + else + { + return (v1 < v2); + } +} + +//------------------------------------------------------------------------------------------------- +void CScreenshotIslands::buildBackTextureHLS(const std::string & islandName, const CBitmap & islandBitmap) +{ + // load limit bitmap + CBitmap limBitmap; + std::string limFileName = _OutDirectory + "/" + islandName + "_limit.tga"; + + CIFile limFS(limFileName.c_str()); + limBitmap.load(limFS); + + list< CRGBA > limitPixels; + + // search for colors of limit pixels + for(uint x=0; x sortedHLS; + list< CRGBA >::iterator itCol, itHLS; + bool inserted = false; + for(itCol=limitPixels.begin(); itCol!=limitPixels.end(); itCol++) + { + inserted = false; + for(itHLS=sortedHLS.begin(); itHLS!=sortedHLS.end(); ++itHLS) + { + if(infHLS(*itCol, *itHLS)) + { + sortedHLS.insert(itHLS, *itCol); + inserted = true; + break; + } + } + if(inserted==false) sortedHLS.push_back(*itCol); + } + + + // keep more filled eighth of circle + nlassert(!sortedHLS.empty()); // If it crashes here, you may be missing .zonel's. + itHLS = sortedHLS.begin(); + uint h, s, v; + RGB2HSV(*itHLS, h, s, v); + list< CRGBA > currentList, maxList; + + for(uint i=0; i<8; i++) + { + while(itHLS!=sortedHLS.end() && h maxList.size()) + { + maxList.clear(); + maxList = currentList; + currentList.clear(); + } + } + + vector< CRGBA > sortedColors(maxList.size()); + uint colorsNb = 0; + CRGBA lastColor(0, 0, 0, 0); + CRGBA maxColor; + uint maxColorNb = 0; + uint currentColorNb = 0; + for(itHLS=maxList.begin(); itHLS!=maxList.end(); ++itHLS) + { + if(lastColor==*itHLS) + { + currentColorNb++; + } + else + { + currentColorNb = 1; + } + + if(currentColorNb>maxColorNb) + { + maxColorNb = currentColorNb; + maxColor = *itHLS; + } + + lastColor = *itHLS; + + RGB2HSV(*itHLS, h, s, v); + if(v>25 && v<75 && s>25 && s<75) + { + sortedColors[colorsNb] = *itHLS; + colorsNb++; + } + } + + if(colorsNb < 5) + { + colorsNb = 0; + for(itHLS=maxList.begin(); itHLS!=maxList.end(); ++itHLS) + { + sortedColors[colorsNb] = *itHLS; + colorsNb++; + } + } + + sortedColors.resize(colorsNb); + + _BackBitmap.resize(islandBitmap.getWidth(), islandBitmap.getHeight(), islandBitmap.PixelFormat); + + if(sortedColors.size()!=0) + { + _BackColor = maxColor; + + CRandom randomGenerator; + + uint8 * backPixels = &(_BackBitmap.getPixels(0)[0]); + + for(uint x=0; x<_BackBitmap.getWidth(); x++) + { + for(uint y=0; y<_BackBitmap.getHeight(); y++) + { + sint32 randomVal = randomGenerator.rand(colorsNb-1); + const CRGBA & color = sortedColors[randomVal]; + + *backPixels = (uint8) color.R; + *(backPixels + 1) = (uint8) color.G; + *(backPixels + 2) = (uint8) color.B; + *(backPixels + 3) = (uint8) 255; + + backPixels = backPixels+4; + } + } + } + + /* + //TEST + CBitmap HLSBitmap; + HLSBitmap.resize(640, sortedColors.size()*4, islandBitmap.PixelFormat); + + uint8 * hlsPixels = &(HLSBitmap.getPixels(0)[0]); + + for(uint i=0; i < sortedColors.size(); i++) + { + uint count = 0; + while(count<640*4) + { + *hlsPixels = (uint8) sortedColors[i].R; + *(hlsPixels + 1) = (uint8) sortedColors[i].G; + *(hlsPixels + 2) = (uint8) sortedColors[i].B; + *(hlsPixels + 3) = (uint8) sortedColors[i].A; + + hlsPixels = hlsPixels+4; + count++; + } + } + + + string textureName = _OutDirectory + "/" + islandName + "_HLS2.tga"; + COFile fsHLS(textureName.c_str()); + HLSBitmap.writeTGA(fsHLS,32); + */ +} + + +//-------------------------------------------------------------------------------------------------------------- +//-------------------------------------------------------------------------------------------------------------- + +//------------------------------------------------------------------------------------------------- +// methods CProximityMapBuffer +//------------------------------------------------------------------------------------------------- + +void CProximityMapBuffer::load(const std::string& name) +{ + // load the AI collision map file + CWorldMap worldMap; + CIFile f(name); + f.serial(worldMap); + + // lookup the map bounds + CMapPosition min, max; + worldMap.getBounds(min, max); + + // calculate a handful of constants relating to the bounds of the image... + _ScanWidth = max.x()-min.x(); + _ScanHeight = max.y()-min.y(); + _XOffset= min.x(); + _YOffset= (sint16)min.y(); + + // redimension buffer to correct size + _Buffer.resize(_ScanWidth*_ScanHeight); + + // setup a position variable to mark the start point of each line + CMapPosition scanpos(min.x(),min.y()); + + // iterate over the scan area looking for points that are accessible + for (uint32 y=0; y<_ScanHeight; ++y, scanpos = scanpos.getStepN()) + { + CMapPosition pos(scanpos); + + // scan a line of the map + for (uint32 x=0; x<_ScanWidth; ++x, pos = pos.getStepE()) + { + bool isAccessible= false; + // if the cell pointer is NULL it means that the 16x16 cell in question is inaccessible + if (worldMap.getRootCellCst(pos) != NULL) + { + // run through the surfaces in the cell looking for a match for this position (may be as many as 3 surfaces per cell max) + for (uint32 ns=0; ns<3; ++ns) + { + isAccessible |= worldMap.getSafeWorldPosition(pos, CSlot(ns)).isValid(); + } + } + // setup the next pixel in the output buffers... + _Buffer[y*_ScanWidth+x]= (isAccessible? 0: (TBufferEntry)~0u); + } + } +} + +//------------------------------------------------------------------------------------------------- +void CProximityMapBuffer::calculateZones(TZones& zones) +{ + // clear out the result buffer before starting work + zones.clear(); + + // setup a container to hold the accessible points within this buffer + typedef std::set TAccessiblePoints; + TAccessiblePoints accessiblePoints; + + // start by building the set of all accessible points + for (uint32 i=0;i<_Buffer.size();++i) + { + if (_Buffer[i]==0) + accessiblePoints.insert(i); + } + + // while there are still points remaining in the set we must have another zone to process + while (!accessiblePoints.empty()) + { + // append a new zone to the zones vector and get a refference to it + zones.push_back( CProximityZone(_ScanWidth,_ScanHeight,_XOffset,_YOffset) ); + CProximityZone& theZone= zones.back(); + + // setup a todo list representing points that are part of the surface that we are dealing with + // that haven't yet been treated to check for neighbours, etc + std::vector todo; + + // get hold of the first point in the accessilbe points set and push it onto the todo list + todo.push_back(*accessiblePoints.begin()); + accessiblePoints.erase(todo.back()); + + // while we have more points to deal with ... + while (!todo.empty()) + { + // pop the next point off the todo list + uint32 thePoint= todo.back(); + todo.pop_back(); + + // add the point to the zone + theZone.add(thePoint); + + // a little macro for the code to perform for each movement test... + #define TEST_MOVE(xoffs,yoffs)\ + {\ + TAccessiblePoints::iterator it= accessiblePoints.find(thePoint+xoffs+_ScanWidth*yoffs);\ + if (it!=accessiblePoints.end())\ + {\ + todo.push_back(*it);\ + accessiblePoints.erase(it);\ + }\ + } + + // N, S, W, E moves + TEST_MOVE( 0, 1); + TEST_MOVE( 0,-1); + TEST_MOVE( 1, 0); + TEST_MOVE(-1, 0); + + // NW, NE, WS, SE moves + TEST_MOVE( 1, 1); + TEST_MOVE(-1, 1); + TEST_MOVE( 1,-1); + TEST_MOVE(-1,-1); + + #undef TEST_MOVE + } + } + + nlinfo("Found %u zones",zones.size()); +} + +//------------------------------------------------------------------------------------------------- +void CProximityMapBuffer::_prepareBufferForZoneProximityMap(const CProximityZone& zone,TBuffer& zoneBuffer,TOffsetsVector& accessiblePoints) +{ + // the length of runs that we consider too short to deal with... + const uint32 shortRunLength=5; + + // redimention and initialise the zone buffer + uint32 zoneWidth= zone.getZoneWidth(); + uint32 zoneHeight= zone.getZoneHeight(); + zoneBuffer.clear(); + zoneBuffer.resize(zoneWidth*zoneHeight,(TBufferEntry)~0u); + + // setup the buffer's accessible points and prime vects[0] with the set of accessible points in the zone buffer + for (uint32 i=0;istartOffset && zoneBuffer[endOffset]!=0; endOffset-= zoneWidth) {} + + for (uint32 offset=startOffset, marker=startOffset;offset<=endOffset;offset+=zoneWidth) + { + // see if this is an accessible position + if (zoneBuffer[offset]!=0) + { + zoneBuffer[offset]= InteriorValue; + + if(offset-1>=startOffset && zoneBuffer[offset-1]==(TBufferEntry)~0u) + { + zoneBuffer[offset-1] = ValueBorder; + } + if(offset+1<=endOffset && zoneBuffer[offset+1]==(TBufferEntry)~0u) + { + zoneBuffer[offset+1] = ValueBorder; + } + } + } + } + + // continue by dealing with all points that belong to a short run in the x direction + for (uint32 i=0;istartOffset && zoneBuffer[endOffset]!=0; --endOffset) {} + + for (uint32 offset=startOffset, marker=startOffset;offset<=endOffset;++offset) + { + // see if this is an accessible position + if (zoneBuffer[offset]!=0) + { + zoneBuffer[offset]= InteriorValue; + + if(offset>zoneWidth && zoneBuffer[offset-zoneWidth]==(TBufferEntry)~0u) + { + zoneBuffer[offset-zoneWidth] = ValueBorder; + } + if(offset+zoneWidth BigValue) + || (zoneBuffer[val]==ValueBorder && dist > BigValue)) + continue; + + // write the new distance into this buffer entry + zoneBuffer[val]=dist; + + // decompose into x and y in order to manage identification of neighbour cells correctly + uint32 x= val% zoneWidth; + uint32 y= val/ zoneWidth; + + #define TEST_MOVE(xoffs,yoffs,newDist)\ + {\ + if (((uint32)(x+(xoffs)) BigValue) || (zoneBuffer[newVal]==ValueBorder && newDist > BigValue));\ + if (zoneBuffer[newVal]>(newDist) && !isInterior)\ + {\ + zoneBuffer[newVal]=(newDist);\ + vects[(newDist)&15].push_back(newVal);\ + ++entriesToTreat;\ + }\ + }\ + } + + // N, S, W, E moves + TEST_MOVE( 0, 1,dist+5); + TEST_MOVE( 0,-1,dist+5); + TEST_MOVE( 1, 0,dist+5); + TEST_MOVE(-1, 0,dist+5); + + // NW, NE, WS, SE moves + TEST_MOVE( 1, 1,dist+7); + TEST_MOVE(-1, 1,dist+7); + TEST_MOVE( 1,-1,dist+7); + TEST_MOVE(-1,-1,dist+7); + + // NNW, NNE, SSW, SSE moves + TEST_MOVE( 1, 2,dist+11); + TEST_MOVE(-1, 2,dist+11); + TEST_MOVE( 1,-2,dist+11); + TEST_MOVE(-1,-2,dist+11); + + // WNW, WSW, ENE, ESE moves + TEST_MOVE( 2, 1,dist+11); + TEST_MOVE(-2, 1,dist+11); + TEST_MOVE( 2,-1,dist+11); + TEST_MOVE(-2,-1,dist+11); + + #undef TEST_MOVE + } + + // clear out the vector + entriesToTreat-= vect.size(); + vect.clear(); + } +} + +//------------------------------------------------------------------------------------------------- +const TBuffer& CProximityMapBuffer::getBuffer() const +{ + return _Buffer; +} + +//------------------------------------------------------------------------------------------------- +uint32 CProximityMapBuffer::getScanHeight() const +{ + return _ScanHeight; +} + +//------------------------------------------------------------------------------------------------- +uint32 CProximityMapBuffer::getScanWidth() const +{ + return _ScanWidth; +} + +//----------------------------------------------------------------------------------------- +//----------------------------------------------------------------------------------------- + +//------------------------------------------------------------------------------------------------- +// methods CProximityZone +//------------------------------------------------------------------------------------------------- + +CProximityZone::CProximityZone(uint32 scanWidth,uint32 scanHeight,sint32 xOffset, sint32 yOffset) +{ + _ScanWidth = scanWidth; + _ScanHeight = scanHeight; + _XOffset = xOffset; + _YOffset = yOffset; + + _MaxOffset = scanWidth * scanHeight -1; + + _XMin = ~0u; + _YMin = ~0u; + _XMax = 0; + _YMax = 0; + + _BorderPixels = 30; +} + +//------------------------------------------------------------------------------------------------- +bool CProximityZone::add(uint32 offset) +{ + // make sure the requested point is in the zone + if (offset>_MaxOffset) + return false; + + // calculate the x and y coordinates of the point + uint32 y= offset/ _ScanWidth; + uint32 x= offset% _ScanWidth; + + // update the bounding coordinates for this zone + if (x<_XMin) _XMin= x; + if (x>_XMax) _XMax= x; + if (y<_YMin) _YMin= y; + if (y>_YMax) _YMax= y; + + // add the point to the vector of points + _Offsets.push_back(offset); + return true; +} + +//------------------------------------------------------------------------------------------------- +const CProximityZone::TOffsets& CProximityZone::getOffsets() const +{ + return _Offsets; +} + +//------------------------------------------------------------------------------------------------- +uint32 CProximityZone::getZoneWidth() const +{ + return getZoneXMax()- getZoneXMin() +1; +} + +//------------------------------------------------------------------------------------------------- +uint32 CProximityZone::getZoneHeight() const +{ + return getZoneYMax()- getZoneYMin() +1; +} + +//------------------------------------------------------------------------------------------------- +sint32 CProximityZone::getZoneXMin() const +{ + return _XMin-_BorderPixels; +} + +//------------------------------------------------------------------------------------------------- +sint32 CProximityZone::getZoneYMin() const +{ + return _YMin-_BorderPixels; +} + +//------------------------------------------------------------------------------------------------- +uint32 CProximityZone::getZoneXMax() const +{ + return _XMax+_BorderPixels; +} + +//------------------------------------------------------------------------------------------------- +uint32 CProximityZone::getZoneYMax() const +{ + return _YMax+_BorderPixels; +} + +//------------------------------------------------------------------------------------------------- +uint32 CProximityZone::getBoundXMin() const +{ + return _XMin+_XOffset-_BorderPixels; +} + +//------------------------------------------------------------------------------------------------- +uint32 CProximityZone::getBoundYMin() const +{ + return _YMin+_YOffset-_BorderPixels; +} + +//------------------------------------------------------------------------------------------------- +uint32 CProximityZone::getBoundXMax() const +{ + return _XMax+_XOffset+_BorderPixels; +} + +//------------------------------------------------------------------------------------------------- +uint32 CProximityZone::getBoundYMax() const +{ + return _YMax+_YOffset+_BorderPixels; +} + +//------------------------------------------------------------------------------------------------- +uint32 CProximityZone::remapOffset(uint32 bufferOffset) const +{ + // decompose input coordinates into x and y parts + uint32 bufferX= bufferOffset% _ScanWidth; + uint32 bufferY= bufferOffset/ _ScanWidth; + + // remap the offset from a _Buffer-relative offset to a zone-relative offset + return bufferX-getZoneXMin()+ (bufferY-getZoneYMin())*getZoneWidth(); +} + +} + diff --git a/code/ryzom/tools/client/r2_islands_textures/screenshot_islands.h b/code/ryzom/tools/client/r2_islands_textures/screenshot_islands.h new file mode 100644 index 000000000..7d47fa3e7 --- /dev/null +++ b/code/ryzom/tools/client/r2_islands_textures/screenshot_islands.h @@ -0,0 +1,241 @@ +// Ryzom - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef CL_SCRRENSHOT_ISLANDS_H +#define CL_SCRRENSHOT_ISLANDS_H + +// Misc +#include "nel/misc/singleton.h" +#include "nel/misc/vector_2f.h" +#include "nel/misc/rgba.h" +#include "nel/misc/bitmap.h" + +#include + +namespace NL3D +{ + class UScene; + class ULandscape; +} + +namespace R2 +{ + class CProximityZone; + +typedef uint16 TBufferEntry; +typedef std::vector TBuffer; +typedef std::vector TOffsetsVector; + +//----------------------------------------------------------------------------- +// class CScreenshotIslands +//----------------------------------------------------------------------------- +struct CIslandData +{ + NLMISC::CVector2f EntryPoint; + NLMISC::CVector2f Max; + NLMISC::CVector2f Min; + + CIslandData() + { + EntryPoint = NLMISC::CVector2f(0, 0); + Max = NLMISC::CVector2f(0, 0); + Min = NLMISC::CVector2f(0, 0); + } + + CIslandData(float x, float y) + { + EntryPoint = NLMISC::CVector2f(x, y); + Max = NLMISC::CVector2f(0, 0); + Min = NLMISC::CVector2f(0, 0); + } +}; + +struct CContinentData +{ + std::string SmallBank; + std::string FarBank; + std::string IGFile; + std::string CoarseMeshMap; + NLMISC::CVector2f ZoneMin; + NLMISC::CVector2f ZoneMax; + std::list< std::string > Islands; + NLMISC::CRGBA Ambiant; + NLMISC::CRGBA Diffuse; + + CContinentData() {} +}; + +typedef std::map< const std::string, CProximityZone> TIslandsData; +typedef std::map< NLMISC::CVector2f, bool > TIslandsMap; +typedef std::map< const std::string, CContinentData > TContinentsData; +typedef std::map< std::string, std::list< NLMISC::CVector2f > > TIslandsBordersMap; + +class CScreenshotIslands : public NLMISC::CSingleton +{ + +public: + + CScreenshotIslands(); + + void buildScreenshots(); + +private: + + void init(); + + void loadIslands(); + + void buildIslandsTextures(); + + void getBuffer(NL3D::UScene * scene, NL3D::ULandscape * landscape, NLMISC::CBitmap &btm); + + bool getPosFromZoneName(const std::string &name, NLMISC::CVector2f &dest); + + void writeProximityBufferToTgaFile(const std::string& fileName,const TBuffer& buffer, + uint32 scanWidth,uint32 scanHeight); + + void processProximityBuffer(TBuffer& inputBuffer, uint32 lineLength, TBuffer& resultBuffer); + + void buildBackTextureHLS(const std::string & islandName, const NLMISC::CBitmap & islandBitmap); + + void searchIslandsBorders(); + + void attenuateIslandBorders(const std::string & islandName, NLMISC::CBitmap & islandBitmap, const CProximityZone & islandData); + + TIslandsData _IslandsData; + TIslandsMap _IslandsMap; + TContinentsData _ContinentsData; + std::list< std::string > _SeasonSuffixes; + int _MeterPixelSize; + std::string _OutDirectory; + std::list< std::string > _TempFileNames; + TIslandsBordersMap _BorderIslands; + bool _Vegetation; + bool _InverseZTest; + + NLMISC::CRGBA _BackColor; + NLMISC::CBitmap _BackBitmap; + std::string _CompleteIslandsFile; +}; + + + + + + +class CProximityZone +{ +public: + typedef std::vector TOffsets; + + // ctor + // scanWidth and scanHeight define the dimentions of the buffer that this zone is being extracted from + // xOffset and yOffset are for re-mapping coordinates from buffer-relative to absolute ryzom world coordinates + CProximityZone(uint32 scanWidth=0,uint32 scanHeight=0,sint32 xOffset=0, sint32 yOffset=0); + + // add an 'accessible position' to a zone (offset is y*scanWidth+x) + bool add(uint32 offset); + + // zone dimention accessors (note that zone dimentions line up with 160x160 world zones) + // note that this means that the zone bounds may extend outside the scan area + uint32 getZoneWidth() const; + uint32 getZoneHeight() const; + sint32 getZoneXMin() const; + sint32 getZoneYMin() const; + uint32 getZoneXMax() const; + uint32 getZoneYMax() const; + + // read accessors for the bounding limits that define the area occupied by the accessible points + uint32 getBoundXMin() const; + uint32 getBoundYMin() const; + uint32 getBoundXMax() const; + uint32 getBoundYMax() const; + + // read accessor for the _Offsets vector + // this is a vector of offsets into the scan area. It needs to be remapped to zone offsets + // via the remapOffset() routine in order to be used to index into a zone buffer + const TOffsets& getOffsets() const; + + // remap a scan buffer offset to a zone offset by decomposing into x and y parts and + // subtracting getZoneXMin() and getZoneYMin() + uint32 remapOffset(uint32 bufferOffset) const; + +private: + // parameters setup at construction time, giving info on the context that we're in + uint32 _ScanWidth; + uint32 _ScanHeight; + sint32 _XOffset; + sint32 _YOffset; + uint32 _MaxOffset; + + // the vector of points that are part of this zone + TOffsets _Offsets; + + // the min and max coords of the points that are part of this zone + uint32 _XMax; + uint32 _XMin; + uint32 _YMax; + uint32 _YMin; + + // border add to bouding zone (pixels number) + int _BorderPixels; +}; + +//------------------------------------------------------------------------------------------------- +// class CProximityMapBuffer +//------------------------------------------------------------------------------------------------- + +class CProximityMapBuffer +{ +public: + typedef std::vector TZones; + + // load a cwmap2 file and setup this object from its contents + // the 'name' parameter is the full file name of the file to load with path and extension + void load(const std::string& name); + + // scan the buffer to generate the set of non-connecting zones that it contains + void calculateZones(TZones& zones); + + // generate the proximity map for a given zone + void generateZoneProximityMap(const CProximityZone& zone,TBuffer& zoneBuffer); + + // read accessors... + const TBuffer& getBuffer() const; + uint32 getScanHeight() const; + uint32 getScanWidth() const; + + // buffer coordinate to world coordinate offsets... + sint32 _XOffset; + sint32 _YOffset; + +private: + // private routine used by generateZoneProximityMap() to setup the zoneBuffer with the accessible points set + void _prepareBufferForZoneProximityMap(const CProximityZone& zone,TBuffer& zoneBuffer,TOffsetsVector& accessiblePoints); + +private: + // the width and heilght of the scan zone (ie the dimentions of the buffer) + uint32 _ScanWidth; + uint32 _ScanHeight; + + // vector representing 2d array of points [_ScanHeight][_ScanWidth] + TBuffer _Buffer; +}; + + +} + +#endif \ No newline at end of file diff --git a/code/ryzom/tools/leveldesign/CMakeLists.txt b/code/ryzom/tools/leveldesign/CMakeLists.txt index 9a56a2fac..399a71deb 100644 --- a/code/ryzom/tools/leveldesign/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/CMakeLists.txt @@ -1,4 +1,3 @@ - ADD_SUBDIRECTORY(uni_conv) ADD_SUBDIRECTORY(csv_transform) ADD_SUBDIRECTORY(icon_search) diff --git a/code/ryzom/tools/leveldesign/georges_convert/type_unit_double.cpp b/code/ryzom/tools/leveldesign/georges_convert/type_unit_double.cpp index 6244c0f4a..674f77cd6 100644 --- a/code/ryzom/tools/leveldesign/georges_convert/type_unit_double.cpp +++ b/code/ryzom/tools/leveldesign/georges_convert/type_unit_double.cpp @@ -203,7 +203,7 @@ void CTypeUnitDouble::SetLowLimit( const CStringEx _sxll ) void CTypeUnitDouble::SetHighLimit( const CStringEx _sxhl ) { sxhighlimit = _sxhl; - dhighlimit = atof( sxhighlimit.c_str() ); + NLMISC::fromString(sxhighlimit, dhighlimit); } } 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 6af950eae..cd937688a 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/configuration.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/configuration.cpp @@ -53,7 +53,8 @@ namespace NLQT { { // load config QFile file(NLQT_CONFIG_FILE); - if (!file.exists()) { + if (!file.exists()) + { file.open( QIODevice::WriteOnly | QIODevice::Text ); file.write("GraphicsDrivers = { \"OpenGL\", \"Direct3D\" };"); file.write("\nSearchPaths = {\"\"};"); @@ -64,9 +65,12 @@ namespace NLQT { file.close(); } - try { + try + { ConfigFile.load(NLQT_CONFIG_FILE); - } catch(...) { + } + catch(...) + { } addLeveldesignPath(); @@ -213,16 +217,17 @@ namespace NLQT { uint listsize = tmpList->size(); for (uint i = 0; i < listsize; ++i) { - if(_progressCB) { - _progressCB->DisplayString = tmpList->at(i); - CPath::addSearchPath(tmpList->at(i), true, false, _progressCB); + if(_progressCB) + { + _progressCB->DisplayString = tmpList->at(i); + CPath::addSearchPath(tmpList->at(i), true, false, _progressCB); } else { - CProgressDialog pcb; - pcb.DisplayString = tmpList->at(i); - pcb.show(); - CPath::addSearchPath(tmpList->at(i), true, false, &pcb); + CProgressDialog pcb; + pcb.DisplayString = tmpList->at(i); + pcb.show(); + CPath::addSearchPath(tmpList->at(i), true, false, &pcb); } } if (!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 bb91f8b62..25b8a1490 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/formdelegate.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/formdelegate.cpp @@ -60,7 +60,8 @@ namespace NLQT CFormItem* curItem = m->getItem(mp->mapToSource(index)); NLGEORGES::UFormElm *curElm = curItem->getFormElm(); - if (!curElm) { + if (!curElm) + { // TODO: create new Element return 0; } 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 b5ab13ba3..f06bb537e 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 @@ -377,7 +377,8 @@ namespace NLQT nlinfo("CGeorgesTreeViewDialog::filterRows"); CGeorgesFormProxyModel * mp = dynamic_cast(_ui.treeView->model()); CGeorgesFormModel *m = dynamic_cast(mp->sourceModel()); - if (m) { + if (m) + { m->setShowParents(_ui.checkBoxParent->isChecked()); m->setShowDefaults(_ui.checkBoxDefaults->isChecked()); } 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 89cba843c..98c7b59e2 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 @@ -352,7 +352,8 @@ namespace NLQT /******************************************************************************/ - void CGeorgesFormModel::loadFormData(UFormElm *root, CFormItem *parent) { + void CGeorgesFormModel::loadFormData(UFormElm *root, CFormItem *parent) + { if (!root) return; @@ -390,7 +391,8 @@ namespace NLQT elmtType = "Array"; if (elmt->isStruct()) elmtType = "Struct"; - if (elmt->isAtom()) { + if (elmt->isAtom()) + { elmtType = "Atom"; uint numDefinitions = 0; const UType *type = elmt->getType(); @@ -433,7 +435,8 @@ namespace NLQT tmpValue = v.c_str(); if (type->getType() == UType::SignedInt) { - if (QString("%1").arg(value.c_str()).toDouble() == tmpValue.toDouble()) { + if (QString("%1").arg(value.c_str()).toDouble() == tmpValue.toDouble()) + { value = l; break; } @@ -482,7 +485,8 @@ namespace NLQT } columnData << QString(elmName.c_str()) << QString(value.c_str()) << "" << elmtType; parent->appendChild(new CFormItem(elmt, columnData, parent, *whereV, *whereN)); - //if (parents.last()->childCount() > 0) { + //if (parents.last()->childCount() > 0) + //{ // parents << parents.last()->child(parents.last()->childCount()-1); //} loadFormData(elmt, parent->child(parent->childCount()-1)); @@ -549,7 +553,8 @@ namespace NLQT { if (elmt->isArray()) elmtType = "Array"; - if (elmt->isStruct()) { + if (elmt->isStruct()) + { elmtType = "Struct"; } if (elmt->isAtom()) @@ -593,28 +598,35 @@ namespace NLQT CFormItem *fi_dep = new CFormItem(_rootElm, QList() << "dependencies", _rootItem); _rootItem->appendChild(fi_dep); - if (!dfns.isEmpty()) { - CFormItem *fi_dfn = new CFormItem(_rootElm, QList() << "dfn", fi_dep); - fi_dep->appendChild(fi_dfn); - foreach(QString str, dfns) { - fi_dfn->appendChild(new CFormItem(_rootElm, QList() << str, fi_dfn)); - } - } - if (!typs.isEmpty()) { - CFormItem *fi_typ = new CFormItem(_rootElm, QList() << "typ", fi_dep); - fi_dep->appendChild(fi_typ); - foreach(QString str, typs) { - fi_typ->appendChild(new CFormItem(_rootElm, QList() << str, fi_typ)); - } - } - if (!_dependencies.isEmpty()) { - CFormItem *fi_other = new CFormItem(_rootElm, QList() << "other", fi_dep); - fi_dep->appendChild(fi_other); - foreach(QStringList list, _dependencies) { - foreach(QString str, list) { - fi_other->appendChild(new CFormItem(_rootElm, QList() << str, fi_other)); + if (!dfns.isEmpty()) + { + CFormItem *fi_dfn = new CFormItem(_rootElm, QList() << "dfn", fi_dep); + fi_dep->appendChild(fi_dfn); + foreach(QString str, dfns) + { + fi_dfn->appendChild(new CFormItem(_rootElm, QList() << str, fi_dfn)); + } } + if (!typs.isEmpty()) + { + CFormItem *fi_typ = new CFormItem(_rootElm, QList() << "typ", fi_dep); + fi_dep->appendChild(fi_typ); + foreach(QString str, typs) + { + fi_typ->appendChild(new CFormItem(_rootElm, QList() << str, fi_typ)); + } } + if (!_dependencies.isEmpty()) + { + CFormItem *fi_other = new CFormItem(_rootElm, QList() << "other", fi_dep); + fi_dep->appendChild(fi_other); + foreach(QStringList list, _dependencies) + { + foreach(QString str, list) + { + fi_other->appendChild(new CFormItem(_rootElm, QList() << str, fi_other)); + } + } }*/ } 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 ef40f4dbc..8dbc2c18b 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 @@ -338,7 +338,8 @@ namespace NLQT _aboutQtAction->setStatusTip(tr("Show the Qt library's About box")); connect(_aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt())); - for (int i = 0; i < MaxRecentFiles; ++i) { + for (int i = 0; i < MaxRecentFiles; ++i) + { recentFileActs[i] = new QAction(this); recentFileActs[i]->setVisible(false); connect(recentFileActs[i], SIGNAL(triggered()), 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 499b06d94..f0a1fe351 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 @@ -333,7 +333,8 @@ namespace NLQT return -1; } - void CGeorgesNewDialog::validateParentCombo() { + void CGeorgesNewDialog::validateParentCombo() + { // TODO: clear if no valid text //if (!_filelist.contains(_ui.parentLineEdit->text())) // _ui.parentLineEdit->clear(); diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/objectviewer_dialog.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/objectviewer_dialog.cpp index a47395cf6..e3c3d24e2 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/objectviewer_dialog.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/objectviewer_dialog.cpp @@ -77,7 +77,8 @@ namespace NLQT } } - void CObjectViewerDialog::topLevelChanged ( bool topLevel ) { + void CObjectViewerDialog::topLevelChanged ( bool topLevel ) + { //nldebug("topLevel:%d",topLevel); //_georges->init(); } @@ -100,7 +101,8 @@ namespace NLQT { //nldebug("%d %d",_nlw->width(), _nlw->height()); QDockWidget::resizeEvent(resizeEvent); - if (Modules::objViewInt()) { + if (Modules::objViewInt()) + { if (Modules::objViewInt()->getDriver()) Modules::objViewInt()->setSizeViewport(resizeEvent->size().width(), resizeEvent->size().height()); } diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/qt_displayer.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/qt_displayer.cpp index 07b338009..7c94e4fb0 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/qt_displayer.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/qt_displayer.cpp @@ -39,8 +39,8 @@ namespace NLQT ; } - CQtDisplayer::~CQtDisplayer() { - ; + CQtDisplayer::~CQtDisplayer() + { } void CQtDisplayer::setParam (QPlainTextEdit *dlgDebug, bool eraseLastLog) @@ -59,7 +59,8 @@ namespace NLQT QTextCharFormat format; - if (args.Date != 0 && !_Raw) { + if (args.Date != 0 && !_Raw) + { str += dateToHumanString(args.Date); needSpace = true; } @@ -76,27 +77,31 @@ namespace NLQT } // Write thread identifier - /*if ( args.ThreadId != 0 && !_Raw) { - if (needSpace) { str += " "; needSpace = false; } - str += NLMISC::toString(args.ThreadId); - needSpace = true; + /*if ( args.ThreadId != 0 && !_Raw) + { + if (needSpace) { str += " "; needSpace = false; } + str += NLMISC::toString(args.ThreadId); + needSpace = true; }*/ - /*if (!args.ProcessName.empty() && !_Raw) { - if (needSpace) { str += " "; needSpace = false; } - str += args.ProcessName; - needSpace = true; + /*if (!args.ProcessName.empty() && !_Raw) + { + if (needSpace) { str += " "; needSpace = false; } + str += args.ProcessName; + needSpace = true; }*/ - //if (args.FileName != NULL && !_Raw) { + //if (args.FileName != NULL && !_Raw) + //{ // if (needSpace) { str += " "; needSpace = false; } // str += NLMISC::CFile::getFilename(args.FileName); // needSpace = true; //} - /*if (args.Line != -1 && !_Raw) { - if (needSpace) { str += " "; needSpace = false; } - str += NLMISC::toString(args.Line); - needSpace = true; + /*if (args.Line != -1 && !_Raw) + { + if (needSpace) { str += " "; needSpace = false; } + str += NLMISC::toString(args.Line); + needSpace = true; }*/ if (args.FuncName != NULL && !_Raw) diff --git a/code/ryzom/tools/leveldesign/mp_generator/utils.h b/code/ryzom/tools/leveldesign/mp_generator/utils.h index 63148f61f..efa42149d 100644 --- a/code/ryzom/tools/leveldesign/mp_generator/utils.h +++ b/code/ryzom/tools/leveldesign/mp_generator/utils.h @@ -17,6 +17,7 @@ #ifndef UTILS_H_ #define UTILS_H_ +#include // DtName must be the 1st one enum TDataCol { DtName, DtTitle, DtRMFamily, DtGroup, DtEcosystem, DtLevelZone, DtStatQuality, DtProp, DtCreature, DtCreaTitle, DtCraftSlotName, DtCraftCivSpec, DtColor, DtAverageEnergy, DtMaxLevel, DtCustomizedProperties, DtNbCols }; @@ -55,17 +56,17 @@ public: * Display the item as a row of a HTML table. * If (key!=previousKey) and (name==previousName), the row will not be displayed entirely to save space * - * \param keyColumn If not ~0, column used for sorting => this column displays only the field matching the key + * \param keyColumn If not std::numeric_limits::max(), column used for sorting => this column displays only the field matching the key * \param key The key used for sorting (see keyColumn) * \param previousKey Previous key - * \param nameColumn If not ~0, column used for the unique name (column must have exaclty one element) + * \param nameColumn If not std::numeric_limits::max(), column used for the unique name (column must have exaclty one element) * \param previousName Previous name */ - std::string toHTMLRow( uint32 keyColumn=~0, const string& key=string(), const string& previousKey=string(), - uint32 nameColumn=~0, const string& previousName=string() ) const + std::string toHTMLRow( uint32 keyColumn=std::numeric_limits::max(), const string& key=string(), const string& previousKey=string(), + uint32 nameColumn=std::numeric_limits::max(), const string& previousName=string() ) const { std::string s = ""; - bool lightMode = (nameColumn == ~0) ? false : ((key != previousKey) && (Fields[nameColumn][0] == previousName)); + bool lightMode = (nameColumn == std::numeric_limits::max()) ? false : ((key != previousKey) && (Fields[nameColumn][0] == previousName)); for ( uint32 c=0; c!=NC; ++c ) { s += ""; @@ -86,11 +87,11 @@ public: /// - std::string toCSVLine( char columnSeparator=',', string internalSeparator=" - ", uint32 keyColumn=~0, const string& key=string(), const string& previousKey=string(), - uint32 nameColumn=~0, const string& previousName=string() ) const + std::string toCSVLine( char columnSeparator=',', string internalSeparator=" - ", uint32 keyColumn=std::numeric_limits::max(), const string& key=string(), const string& previousKey=string(), + uint32 nameColumn=std::numeric_limits::max(), const string& previousName=string() ) const { std::string s; - bool lightMode = (nameColumn == ~0) ? false : ((key != previousKey) && (Fields[nameColumn][0] == previousName)); + bool lightMode = (nameColumn == std::numeric_limits::max()) ? false : ((key != previousKey) && (Fields[nameColumn][0] == previousName)); for ( uint32 c=0; c!=NC; ++c ) { if ( c == keyColumn ) diff --git a/code/ryzom/tools/leveldesign/prim_export/main.cpp b/code/ryzom/tools/leveldesign/prim_export/main.cpp index 86aeafa62..f9c33d953 100644 --- a/code/ryzom/tools/leveldesign/prim_export/main.cpp +++ b/code/ryzom/tools/leveldesign/prim_export/main.cpp @@ -629,7 +629,7 @@ void addPointPrimitive (CLandscape &landscape, const char *primFilename, uint32 string scaleText; float scale = 1; if (point->getPropertyByName ("scale", scaleText)) - scale = (float) atof (scaleText.c_str ()); + NLMISC::fromString(scaleText, scale); // Get zone coordinates sint x = (sint)floor (position.x / options.CellSize); @@ -654,7 +654,7 @@ void addPointPrimitive (CLandscape &landscape, const char *primFilename, uint32 // Get height if (!snap && point->getPropertyByName ("height", text)) - position.z = (float)atof(text.c_str()); + NLMISC::fromString(text, position.z); // *** Add the instance 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 e99b0eceb..279578293 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 @@ -2595,8 +2595,8 @@ void CExport::transformAdditionnalIG (const std::string &name, const NLMISC::CMa inStream.close(); if (_ExportCB != NULL) { - _ExportCB->dispWarning("Error while reading " + igName); - _ExportCB->dispWarning(e.what()); + _ExportCB->dispWarning("Error while reading " + igName); + _ExportCB->dispWarning(e.what()); } } } diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor/display.cpp b/code/ryzom/tools/leveldesign/world_editor/world_editor/display.cpp index dd2a17d82..09763d27c 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor/display.cpp +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor/display.cpp @@ -309,6 +309,7 @@ void CDisplay::init (CMainFrame *pMF) _TextContext->setFontGenerator(NLMISC::CPath::getWindowsDirectory() + "Fonts\\arial.ttf"); _TextContext->setKeep800x600Ratio(true); _TextContext->setShaded(true); + _TextContext->setShadeOutline(false); _TextContext->setShadeColor(NLMISC::CRGBA::Black); } catch(...) diff --git a/code/ryzom/tools/make_anim_melee_impact/main.cpp b/code/ryzom/tools/make_anim_melee_impact/main.cpp index 10fdeb0ed..3f67edd5e 100644 --- a/code/ryzom/tools/make_anim_melee_impact/main.cpp +++ b/code/ryzom/tools/make_anim_melee_impact/main.cpp @@ -79,7 +79,7 @@ void CAnimCombatState::build(const string &line) { StateCode= line.substr(4, 2); string time= line.substr(10, 5); - MeanAnimTime= (float)atof(time.c_str()); + NLMISC::fromString(time, MeanAnimTime); } diff --git a/code/ryzom/tools/patch_gen/patch_gen_common.cpp b/code/ryzom/tools/patch_gen/patch_gen_common.cpp index 3d28a2439..2437c068e 100644 --- a/code/ryzom/tools/patch_gen/patch_gen_common.cpp +++ b/code/ryzom/tools/patch_gen/patch_gen_common.cpp @@ -19,6 +19,7 @@ //----------------------------------------------------------------------------- #include +#include #include "game_share/bnp_patch.h" #include "nel/misc/path.h" @@ -149,7 +150,7 @@ CPackageDescription::CPackageDescription() void CPackageDescription::clear() { - _NextVersionNumber= ~0u; + _NextVersionNumber= std::numeric_limits::max(); _VersionNumberReserved = false; _Categories.clear(); _IndexFileName.clear(); @@ -345,8 +346,7 @@ void CPackageDescription::generatePatches(CBNPFileSet& packageIndex) const if (packageIndex.getFile(i).versionCount()==1) { prevVersionFileName= _RootDirectory + "empty"; - NLMISC::COFile tmpFile(prevVersionFileName); - tmpFile.close(); + CFile::createEmptyFile(prevVersionFileName); usingTemporaryFile = true; deleteRefAfterDelta= false; } diff --git a/code/ryzom/tools/pd_parser/parser.cpp b/code/ryzom/tools/pd_parser/parser.cpp index 733bad4df..4b5e9f5c1 100644 --- a/code/ryzom/tools/pd_parser/parser.cpp +++ b/code/ryzom/tools/pd_parser/parser.cpp @@ -1189,7 +1189,7 @@ bool CEnumSimpleValueNode::prolog() uint i; for (i=0; iValues.push_back(make_pair(Names[i], CurrentValue)); + CurrentEnumNode->Values.push_back(std::pair(Names[i], CurrentValue)); } if (parent != NULL) ++(parent->CurrentValue); @@ -1214,7 +1214,7 @@ bool CEnumRangeNode::prolog() CurrentValue = 0; } - CurrentEnumNode->Values.push_back(make_pair(Name, CurrentValue)); + CurrentEnumNode->Values.push_back(std::pair(Name, CurrentValue)); return true; } @@ -1238,7 +1238,7 @@ bool CEnumRangeNode::epilog() if (!EndRange.empty()) { - CurrentEnumNode->Values.push_back(make_pair(EndRange, CurrentValue)); + CurrentEnumNode->Values.push_back(std::pair(EndRange, CurrentValue)); } return true; @@ -4709,7 +4709,7 @@ void CLogMsgNode::generateContent() CClassNode *cnd; if ( (tnd = getTypeNode(type, false)) ) { - pair::iterator, bool> res = params.insert(make_pair(name, tnd)); + pair::iterator, bool> res = params.insert(std::pair(name, tnd)); if (!res.second) error("log parameter '"+name+"' already defined"); @@ -4723,7 +4723,7 @@ void CLogMsgNode::generateContent() } else if ( (cnd = getClassNode(type, false)) ) { - pair::iterator, bool> res = params.insert(make_pair(name, cnd)); + pair::iterator, bool> res = params.insert(std::pair(name, cnd)); if (!res.second) error("log parameter '"+name+"' already defined"); @@ -4739,7 +4739,7 @@ void CLogMsgNode::generateContent() { CExtLogTypeNode* extnd = new CExtLogTypeNode(); extnd->ExtLogType = "string"; - pair::iterator, bool> res = params.insert(make_pair(name, extnd)); + pair::iterator, bool> res = params.insert(std::pair(name, extnd)); if (!res.second) error("log parameter '"+name+"' already defined"); diff --git a/code/ryzom/tools/server/CMakeLists.txt b/code/ryzom/tools/server/CMakeLists.txt index 982c47718..1f215ae94 100644 --- a/code/ryzom/tools/server/CMakeLists.txt +++ b/code/ryzom/tools/server/CMakeLists.txt @@ -1,4 +1,3 @@ - IF(WITH_LIGO) ADD_SUBDIRECTORY(ai_build_wmap) ENDIF(WITH_LIGO) diff --git a/code/ryzom/tools/server/admin/smarty/debug.tpl b/code/ryzom/tools/server/admin/smarty/debug.tpl deleted file mode 100644 index 7f1c9d425..000000000 --- a/code/ryzom/tools/server/admin/smarty/debug.tpl +++ /dev/null @@ -1,64 +0,0 @@ -{* Smarty *} - -{* debug.tpl, last updated version 2.0.1 *} - -{assign_debug_info} - -{if isset($_smarty_debug_output) and $_smarty_debug_output eq "html"} - - - - {section name=templates loop=$_debug_tpls} - - {sectionelse} - - {/section} - - {section name=vars loop=$_debug_keys} - - {sectionelse} - - {/section} - - {section name=config_vars loop=$_debug_config_keys} - - {sectionelse} - - {/section} -
Smarty Debug Console
included templates & config files (load time in seconds):
{section name=indent loop=$_debug_tpls[templates].depth}   {/section}{$_debug_tpls[templates].filename|escape:html}{if isset($_debug_tpls[templates].exec_time)} ({$_debug_tpls[templates].exec_time|string_format:"%.5f"}){if %templates.index% eq 0} (total){/if}{/if}
no templates included
assigned template variables:
{ldelim}${$_debug_keys[vars]}{rdelim}{$_debug_vals[vars]|@debug_print_var}
no template variables assigned
assigned config file variables (outer template scope):
{ldelim}#{$_debug_config_keys[config_vars]}#{rdelim}{$_debug_config_vals[config_vars]|@debug_print_var}
no config vars assigned
- -{else} - -{/if} diff --git a/code/ryzom/tools/server/admin/smarty/plugins/modifier.date_format.php b/code/ryzom/tools/server/admin/smarty/plugins/modifier.date_format.php deleted file mode 100644 index 2f36b3b79..000000000 --- a/code/ryzom/tools/server/admin/smarty/plugins/modifier.date_format.php +++ /dev/null @@ -1,48 +0,0 @@ -_get_plugin_filepath('shared','make_timestamp'); -/** - * Smarty date_format modifier plugin - * - * Type: modifier
- * Name: date_format
- * Purpose: format datestamps via strftime
- * Input:
- * - string: input date string - * - format: strftime format for output - * - default_date: default date if $string is empty - * @link http://smarty.php.net/manual/en/language.modifier.date.format.php - * date_format (Smarty online manual) - * @param string - * @param string - * @param string - * @return string|void - * @uses smarty_make_timestamp() - */ -function smarty_modifier_date_format($string, $format="%b %e, %Y", $default_date=null) -{ - if (substr(PHP_OS,0,3) == 'WIN') { - $_win_from = array ('%e', '%T', '%D'); - $_win_to = array ('%#d', '%H:%M:%S', '%m/%d/%y'); - $format = str_replace($_win_from, $_win_to, $format); - } - if($string != '') { - return strftime($format, smarty_make_timestamp($string)); - } elseif (isset($default_date) && $default_date != '') { - return strftime($format, smarty_make_timestamp($default_date)); - } else { - return; - } -} - -/* vim: set expandtab: */ - -?> diff --git a/code/ryzom/tools/server/admin/smarty/plugins/modifier.debug_print_var.php b/code/ryzom/tools/server/admin/smarty/plugins/modifier.debug_print_var.php deleted file mode 100644 index b9bb18488..000000000 --- a/code/ryzom/tools/server/admin/smarty/plugins/modifier.debug_print_var.php +++ /dev/null @@ -1,56 +0,0 @@ - - * Name: debug_print_var
- * Purpose: formats variable contents for display in the console - * @link http://smarty.php.net/manual/en/language.modifier.debug.print.var.php - * debug_print_var (Smarty online manual) - * @param array|object - * @param integer - * @param integer - * @return string - */ -function smarty_modifier_debug_print_var($var, $depth = 0, $length = 40) -{ - $_replace = array("\n"=>'\n', "\r"=>'\r', "\t"=>'\t'); - if (is_array($var)) { - $results = "Array (".count($var).")"; - foreach ($var as $curr_key => $curr_val) { - $return = smarty_modifier_debug_print_var($curr_val, $depth+1, $length); - $results .= "
".str_repeat(' ', $depth*2)."".strtr($curr_key, $_replace)." => $return"; - } - } else if (is_object($var)) { - $object_vars = get_object_vars($var); - $results = "".get_class($var)." Object (".count($object_vars).")"; - foreach ($object_vars as $curr_key => $curr_val) { - $return = smarty_modifier_debug_print_var($curr_val, $depth+1, $length); - $results .= "
".str_repeat(' ', $depth*2)."$curr_key => $return"; - } - } else if (is_resource($var)) { - $results = ''.(string)$var.''; - } else if (empty($var) && $var != "0") { - $results = 'empty'; - } else { - if (strlen($var) > $length ) { - $results = substr($var, 0, $length-3).'...'; - } else { - $results = $var; - } - $results = htmlspecialchars($results); - $results = strtr($results, $_replace); - } - return $results; -} - -/* vim: set expandtab: */ - -?> diff --git a/code/ryzom/tools/server/admin/smarty/plugins/modifier.regex_replace.php b/code/ryzom/tools/server/admin/smarty/plugins/modifier.regex_replace.php deleted file mode 100644 index 7eee497c8..000000000 --- a/code/ryzom/tools/server/admin/smarty/plugins/modifier.regex_replace.php +++ /dev/null @@ -1,33 +0,0 @@ - - * Name: regex_replace
- * Purpose: regular epxression search/replace - * @link http://smarty.php.net/manual/en/language.modifier.regex.replace.php - * regex_replace (Smarty online manual) - * @param string - * @param string|array - * @param string|array - * @return string - */ -function smarty_modifier_regex_replace($string, $search, $replace) -{ - if (preg_match('!\W(\w+)$!s', $search, $match) && (strpos($match[1], 'e') !== false)) { - /* remove eval-modifier from $search */ - $search = substr($search, 0, -strlen($match[1])) . str_replace('e', '', $match[1]); - } - return preg_replace($search, $replace, $string); -} - -/* vim: set expandtab: */ - -?> diff --git a/code/ryzom/tools/server/admin/smarty/plugins/shared.make_timestamp.php b/code/ryzom/tools/server/admin/smarty/plugins/shared.make_timestamp.php deleted file mode 100644 index acdd77735..000000000 --- a/code/ryzom/tools/server/admin/smarty/plugins/shared.make_timestamp.php +++ /dev/null @@ -1,43 +0,0 @@ - - * Purpose: used by other smarty functions to make a timestamp - * from a string. - * @param string - * @return string - */ -function smarty_make_timestamp($string) -{ - if(empty($string)) { - $string = "now"; - } - $time = strtotime($string); - if (is_numeric($time) && $time != -1) - return $time; - - // is mysql timestamp format of YYYYMMDDHHMMSS? - if (preg_match('/^\d{14}$/', $string)) { - $time = mktime(substr($string,8,2),substr($string,10,2),substr($string,12,2), - substr($string,4,2),substr($string,6,2),substr($string,0,4)); - - return $time; - } - - // couldn't recognize it, try to return a time - $time = (int) $string; - if ($time > 0) - return $time; - else - return time(); -} - -/* vim: set expandtab: */ - -?> diff --git a/code/ryzom/tools/server/ai_build_wmap/build_proximity_maps.cpp b/code/ryzom/tools/server/ai_build_wmap/build_proximity_maps.cpp index 5cb7c6922..f5b6af644 100644 --- a/code/ryzom/tools/server/ai_build_wmap/build_proximity_maps.cpp +++ b/code/ryzom/tools/server/ai_build_wmap/build_proximity_maps.cpp @@ -27,11 +27,13 @@ #include "nel/misc/file.h" // Game share -#include "server_share/bmp4image.h" +#include "game_share/bmp4image.h" // AI share #include "ai_share/world_map.h" +// STL +#include //------------------------------------------------------------------------------------------------- // using namespaces... @@ -237,8 +239,8 @@ CProximityZone::CProximityZone(uint32 scanWidth,uint32 scanHeight,sint32 xOffset _MaxOffset = scanWidth * scanHeight -1; - _XMin = ~0u; - _YMin = ~0u; + _XMin = std::numeric_limits::max(); + _YMin = std::numeric_limits::max(); _XMax = 0; _YMax = 0; } @@ -386,7 +388,7 @@ void CProximityMapBuffer::load(const std::string& name) } } // setup the next pixel in the output buffers... - _Buffer[y*_ScanWidth+x]= (isAccessible? 0: (TBufferEntry)~0u); + _Buffer[y*_ScanWidth+x]= (isAccessible? 0: (TBufferEntry)std::numeric_limits::max()); } } } @@ -471,7 +473,7 @@ void CProximityMapBuffer::_prepareBufferForZoneProximityMap(const CProximityZone uint32 zoneWidth= zone.getZoneWidth(); uint32 zoneHeight= zone.getZoneHeight(); zoneBuffer.clear(); - zoneBuffer.resize(zoneWidth*zoneHeight,(TBufferEntry)~0u); + zoneBuffer.resize(zoneWidth*zoneHeight,(TBufferEntry)std::numeric_limits::max()); // setup the buffer's accessible points and prime vects[0] with the set of accessible points in the zone buffer for (uint32 i=0;i force rebuild - delete packedIsland; // remove whatever was serialized + // delete packedIsland; // remove whatever was serialized // NOPE. smart pointer packedIsland = new CPackedWorldHolder; } } diff --git a/code/ryzom/tools/server/build_world_packed_col/packed_world_builder.cpp b/code/ryzom/tools/server/build_world_packed_col/packed_world_builder.cpp index 810540cf8..779e4102d 100644 --- a/code/ryzom/tools/server/build_world_packed_col/packed_world_builder.cpp +++ b/code/ryzom/tools/server/build_world_packed_col/packed_world_builder.cpp @@ -443,7 +443,7 @@ void CPackedWorldBuilder::fly(std::vector &islands, float camSpeed texturedMaterial.setDoubleSided(true); texturedMaterial.setZFunc(CMaterial::lessequal); // - uint currWorldIndex = ~0; + uint currWorldIndex = std::numeric_limits::max(); bool newPosWanted = true; // std::vector zones; diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/dblayer.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/dblayer.php deleted file mode 100644 index 58ea7b80e..000000000 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/dblayer.php +++ /dev/null @@ -1,85 +0,0 @@ - PDO::ERRMODE_EXCEPTION, - PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC - ); - $this->PDO = new PDO($dsn,$cfg['db'][$db]['user'],$cfg['db'][$db]['pass'], $opt); - } else { - global $cfg; - $dsn = "mysql:"; - $dsn .= "host=". $cfg['db'][$dbn]['host'].";"; - $dsn .= "port=". $cfg['db'][$dbn]['port'].";"; - - $opt = array( - PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, - PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC - ); - $this->PDO = new PDO($dsn,$_POST['Username'],$_POST['Password'], $opt); - } - - } - - /** - * execute a query that doesn't have any parameters - * @param $query the mysql query - * @return returns a PDOStatement object - */ - public function executeWithoutParams($query){ - $statement = $this->PDO->prepare($query); - $statement->execute(); - return $statement; - } - - /** - * execute a query that has parameters - * @param $query the mysql query - * @param $params the parameters that are being used by the query - * @return returns a PDOStatement object - */ - public function execute($query,$params){ - $statement = $this->PDO->prepare($query); - $statement->execute($params); - return $statement; - } - - /** - * execute a query (an insertion query) that has parameters and return the id of it's insertion - * @param $query the mysql query - * @param $params the parameters that are being used by the query - * @return returns the id of the last inserted element. - */ - public function executeReturnId($query,$params){ - $statement = $this->PDO->prepare($query); - $this->PDO->beginTransaction(); - $statement->execute($params); - $lastId =$this->PDO->lastInsertId(); - $this->PDO->commit(); - return $lastId; - } - -} \ No newline at end of file diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/helpers.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/helpers.php deleted file mode 100644 index 8f99bfc93..000000000 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/helpers.php +++ /dev/null @@ -1,229 +0,0 @@ -setCompileDir($SITEBASE.'/templates_c/'); - $smarty->setCacheDir($SITEBASE.'/cache/'); - $smarty -> setConfigDir($SITEBASE . '/configs/' ); - // turn smarty debugging on/off - $smarty -> debugging = false; - // caching must be disabled for multi-language support - $smarty -> caching = false; - $smarty -> cache_lifetime = 5; - - //needed by smarty. - helpers :: create_folders (); - global $FORCE_INGAME; - - //if ingame, then use the ingame templates - if ( helpers::check_if_game_client() or $FORCE_INGAME ){ - $smarty -> template_dir = $AMS_LIB . '/ingame_templates/'; - $smarty -> setConfigDir( $AMS_LIB . '/configs' ); - $variables = parse_ini_file( $AMS_LIB . '/configs/ingame_layout.ini', true ); - foreach ( $variables[$INGAME_LAYOUT] as $key => $value ){ - $smarty -> assign( $key, $value ); - } - }else{ - $smarty -> template_dir = $SITEBASE . '/templates/'; - $smarty -> setConfigDir( $SITEBASE . '/configs' ); - } - - foreach ( $vars as $key => $value ){ - $smarty -> assign( $key, $value ); - } - - //load page specific variables that are language dependent - $variables = Helpers::handle_language(); - foreach ( $variables[$template] as $key => $value ){ - $smarty -> assign( $key, $value ); - } - - //load ams content variables that are language dependent - foreach ( $variables['ams_content'] as $key => $value){ - $smarty -> assign( $key, $value); - } - - //smarty inheritance for loading the matching wrapper layout (with the matching menu bar) - if( isset($vars['permission']) && $vars['permission'] == 3 ){ - $inherited = "extends:layout_admin.tpl|"; - }else if( isset($vars['permission']) && $vars['permission'] == 2){ - $inherited = "extends:layout_mod.tpl|"; - }else if( isset($vars['permission']) && $vars['permission'] == 1){ - $inherited = "extends:layout_user.tpl|"; - }else{ - $inherited =""; - } - - //if $returnHTML is set to true, return the html by fetching the template else display the template. - if($returnHTML == true){ - return $smarty ->fetch($inherited . $template . '.tpl' ); - }else{ - $smarty -> display( $inherited . $template . '.tpl' ); - } - } - - - /** - * creates the folders that are needed for smarty. - * @todo for the drupal module it might be possible that drupal_mkdir needs to be used instead of mkdir, also this should be in the install.php instead. - */ - static public function create_folders(){ - global $AMS_LIB; - global $SITEBASE; - $arr = array( $AMS_LIB . '/ingame_templates/', - $AMS_LIB . '/configs', - //$AMS_LIB . '/cache', - $SITEBASE . '/cache/', - $SITEBASE . '/templates/', - $SITEBASE . '/templates_c/', - $SITEBASE . '/configs' - ); - foreach ( $arr as & $value ){ - - if ( !file_exists( $value ) ){ - print($value); - mkdir($value); - } - } - - } - - - /** - * check if the http request is sent ingame or not. - * @return returns true in case it's sent ingame, else false is returned. - */ - static public function check_if_game_client() - { - // if HTTP_USER_AGENT is not set then its ryzom core - global $FORCE_INGAME; - if ( ( isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'],"Ryzom") === 0)) || $FORCE_INGAME || ! isset($_SERVER['HTTP_USER_AGENT']) ){ - return true; - }else{ - return false; - } - } - - - /** - * Handles the language specific aspect. - * The language can be changed by setting the $_GET['Language'] & $_GET['setLang'] together. This will also change the language entry of the user in the db. - * Cookies are also being used in case the user isn't logged in. - * @return returns the parsed content of the language .ini file related to the users language setting. - */ - static public function handle_language(){ - global $DEFAULT_LANGUAGE; - global $AMS_TRANS; - - //if user wants to change the language - if(isset($_GET['Language']) && isset($_GET['setLang'])){ - //The ingame client sometimes sends full words, derive those! - switch($_GET['Language']){ - - case "English": - $lang = "en"; - break; - - case "French": - $lang = "fr"; - break; - - default: - $lang = $_GET['Language']; - } - //if the file exists en the setLang = true - if( file_exists( $AMS_TRANS . '/' . $lang . '.ini' ) && $_GET['setLang'] == "true"){ - //set a cookie & session var and incase logged in write it to the db! - setcookie( 'Language', $lang , time() + 60*60*24*30 ); - $_SESSION['Language'] = $lang; - if(WebUsers::isLoggedIn()){ - WebUsers::setLanguage($_SESSION['id'],$lang); - } - }else{ - $_SESSION['Language'] = $DEFAULT_LANGUAGE; - } - }else{ - //if the session var is not set yet - if(!isset($_SESSION['Language'])){ - //check if a cookie already exists for it - if ( isset( $_COOKIE['Language'] ) ) { - $_SESSION['Language'] = $_COOKIE['Language']; - //else use the default language - }else{ - $_SESSION['Language'] = $DEFAULT_LANGUAGE; - } - } - } - - if ($_SESSION['Language'] == ""){ - $_SESSION['Language'] = $DEFAULT_LANGUAGE; - } - return parse_ini_file( $AMS_TRANS . '/' . $_SESSION['Language'] . '.ini', true ); - - } - - - /** - * Time output function for handling the time display. - * @return returns the time in the format specified in the $TIME_FORMAT global variable. - */ - static public function outputTime($time, $str = 1){ - global $TIME_FORMAT; - if($str){ - return date($TIME_FORMAT,strtotime($time)); - }else{ - return date($TIME_FORMAT,$time); - } - } - - /** - * Auto login function for ingame use. - * This function will allow users who access the website ingame, to log in without entering the username and password. It uses the COOKIE entry in the open_ring db. - * it checks if the cookie sent by the http request matches the one in the db. This cookie in the db is changed everytime the user relogs. - * @return returns "FALSE" if the cookies didn't match, else it returns an array with the user's id and name. - */ - static public function check_login_ingame(){ - if ( helpers :: check_if_game_client () or $forcelibrender = false ){ - $dbr = new DBLayer("ring"); - if (isset($_GET['UserId']) && isset($_COOKIE['ryzomId'])){ - $id = $_GET['UserId']; - $statement = $dbr->execute("SELECT * FROM ring_users WHERE user_id=:id AND cookie =:cookie", array('id' => $id, 'cookie' => $_COOKIE['ryzomId'])); - if ($statement->rowCount() ){ - $entry = $statement->fetch(); - //print_r($entry); - return array('id' => $entry['user_id'], 'name' => $entry['user_name']); - }else{ - return "FALSE"; - } - }else{ - return "FALSE"; - } - }else{ - return "FALSE"; - } - } -} diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/sync.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/sync.php deleted file mode 100644 index e9d4c8748..000000000 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/sync.php +++ /dev/null @@ -1,89 +0,0 @@ -executeWithoutParams("SELECT * FROM ams_querycache"); - $rows = $statement->fetchAll(); - foreach ($rows as $record) { - - $db = new DBLayer($record['db']); - switch($record['type']) { - case 'createPermissions': - $decode = json_decode($record['query']); - $values = array('username' => $decode[0]); - //make connection with and put into shard db & delete from the lib - $sth = $db->execute("SELECT UId FROM user WHERE Login= :username;", $values); - $result = $sth->fetchAll(); - foreach ($result as $UId) { - $ins_values = array('id' => $UId['UId']); - $db->execute("INSERT INTO permission (UId, ClientApplication, AccessPrivilege) VALUES (:id, 'r2', 'OPEN');", $ins_values); - $db->execute("INSERT INTO permission (UId, ClientApplication, AccessPrivilege) VALUES (:id , 'ryzom_open', 'OPEN');", $ins_values); - } - break; - case 'change_pass': - $decode = json_decode($record['query']); - $values = array('user' => $decode[0], 'pass' => $decode[1]); - //make connection with and put into shard db & delete from the lib - $db->execute("UPDATE user SET Password = :pass WHERE Login = :user",$values); - break; - case 'change_mail': - $decode = json_decode($record['query']); - $values = array('user' => $decode[0], 'mail' => $decode[1]); - //make connection with and put into shard db & delete from the lib - $db->execute("UPDATE user SET Email = :mail WHERE Login = :user",$values); - break; - case 'createUser': - $decode = json_decode($record['query']); - $values = array('login' => $decode[0], 'pass' => $decode[1], 'mail' => $decode[2] ); - //make connection with and put into shard db & delete from the lib - $db->execute("INSERT INTO user (Login, Password, Email) VALUES (:login, :pass, :mail)",$values); - break; - } - $dbl->execute("DELETE FROM ams_querycache WHERE SID=:SID",array('SID' => $record['SID'])); - } - if ($display == true) { - print('Syncing completed'); - } - } - catch (PDOException $e) { - if ($display == true) { - print('Something went wrong! The shard is probably still offline!'); - print_r($e); - } - } - unlink($pidfile); - } - - } - } -} diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/debug.tpl b/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/debug.tpl deleted file mode 100644 index 12eef0ffd..000000000 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/debug.tpl +++ /dev/null @@ -1,133 +0,0 @@ -{capture name='_smarty_debug' assign=debug_output} - - - - Smarty Debug Console - - - - -

Smarty Debug Console - {if isset($template_name)}{$template_name|debug_print_var nofilter}{else}Total Time {$execution_time|string_format:"%.5f"}{/if}

- -{if !empty($template_data)} -

included templates & config files (load time in seconds)

- -
-{foreach $template_data as $template} - {$template.name} - - (compile {$template['compile_time']|string_format:"%.5f"}) (render {$template['render_time']|string_format:"%.5f"}) (cache {$template['cache_time']|string_format:"%.5f"}) - -
-{/foreach} -
-{/if} - -

assigned template variables

- - - {foreach $assigned_vars as $vars} - - - - {/foreach} -
${$vars@key|escape:'html'}{$vars|debug_print_var nofilter}
- -

assigned config file variables (outer template scope)

- - - {foreach $config_vars as $vars} - - - - {/foreach} - -
{$vars@key|escape:'html'}{$vars|debug_print_var nofilter}
- - -{/capture} - diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/sysplugins/smarty_internal_compile_block.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/sysplugins/smarty_internal_compile_block.php deleted file mode 100644 index f760e551d..000000000 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/sysplugins/smarty_internal_compile_block.php +++ /dev/null @@ -1,282 +0,0 @@ -getAttributes($compiler, $args); - $save = array($_attr, $compiler->parser->current_buffer, $compiler->nocache, $compiler->smarty->merge_compiled_includes, $compiler->merged_templates, $compiler->smarty->merged_templates_func, $compiler->template->properties, $compiler->template->has_nocache_code); - $this->openTag($compiler, 'block', $save); - if ($_attr['nocache'] == true) { - $compiler->nocache = true; - } - // set flag for {block} tag - $compiler->inheritance = true; - // must merge includes - $compiler->smarty->merge_compiled_includes = true; - - $compiler->parser->current_buffer = new _smarty_template_buffer($compiler->parser); - $compiler->has_code = false; - return true; - } - - /** - * Save or replace child block source by block name during parsing - * - * @param string $block_content block source content - * @param string $block_tag opening block tag - * @param object $template template object - * @param string $filepath filepath of template source - */ - public static function saveBlockData($block_content, $block_tag, $template, $filepath) { - $_rdl = preg_quote($template->smarty->right_delimiter); - $_ldl = preg_quote($template->smarty->left_delimiter); - if (!$template->smarty->auto_literal) { - $al = '\s*'; - } else { - $al = ''; - } - if (0 == preg_match("!({$_ldl}{$al}block\s+)(name=)?(\w+|'.*'|\".*\")(\s*?)?((append|prepend|nocache)?(\s*)?(hide)?)?(\s*{$_rdl})!", $block_tag, $_match)) { - $error_text = 'Syntax Error in template "' . $template->source->filepath . '" "' . htmlspecialchars($block_tag) . '" illegal options'; - throw new SmartyCompilerException($error_text); - } else { - $_name = trim($_match[3], '\'"'); - if ($_match[8] != 'hide' || isset($template->block_data[$_name])) { // replace {$smarty.block.child} - // get nested block tags - if (0 != preg_match_all("!({$_ldl}{$al}block\s+)(name=)?(\w+|'.*'|\".*\")([\s\S]*?)(hide)?(\s*{$_rdl})([\s\S]*?)(.*)?({$_ldl}{$al}/block\s*{$_rdl})!", $block_content, $_match2)) { - foreach ($_match2[3] as $key => $name) { - // get it's replacement - $_name2 = trim($name, '\'"'); - if ($_match2[5][$key] != 'hide' || isset($template->block_data[$_name2])) { - if (isset($template->block_data[$_name2])) { - $replacement = $template->block_data[$_name2]['source']; - } else { - $replacement = ''; - } - // replace {$smarty.block.child} tag - if (preg_match("!{$_ldl}{$al}\\\$smarty\.block\.child\s*{$_rdl}!",$_match2[7][$key])) { - $replacement = preg_replace("!({$_ldl}{$al}\\\$smarty\.block\.child\s*{$_rdl})!", $replacement, $_match2[7][$key]); - $block_content = preg_replace("!(({$_ldl}{$al}block)(.*)?{$name}(.*)?({$_rdl}[\s\S]*?{$_ldl}{$al}/block\s*{$_rdl}))!", $replacement, $block_content); - } - if (preg_match("!{$_ldl}{$al}\\\$smarty\.block\.child\s*{$_rdl}!",$_match2[8][$key])) { - $replacement = preg_replace("!{$_ldl}{$al}\\\$smarty\.block\.child\s*{$_rdl}!", $replacement, $_match2[8][$key]); - $block_content = preg_replace("!(({$_ldl}{$al}block)(.*)?{$name}(.*)?({$_rdl})(.*)?({$_ldl}{$al}/block\s*{$_rdl}))!", $replacement, $block_content); - } - } else { - // remove hidden blocks - $block_content = preg_replace("!(({$_ldl}{$al}block)(.*)?{$name}(.*)?({$_rdl}[\s\S]*?{$_ldl}{$al}/block\s*{$_rdl}))!", '', $block_content); - } - } - } - // do we have not nested {$smart.block.child} - if (0 != preg_match("!({$_ldl}{$al}\\\$smarty\.block\.child\s*{$_rdl})!", $block_content, $_match2)) { - // get child replacement for this block - if (isset($template->block_data[$_name])) { - $replacement = $template->block_data[$_name]['source']; - unset($template->block_data[$_name]); - } else { - $replacement = ''; - } - $block_content = preg_replace("!({$_ldl}{$al}\\\$smarty\.block\.child\s*{$_rdl})!", $replacement, $block_content); - } - if (isset($template->block_data[$_name])) { - if (strpos($template->block_data[$_name]['source'], '%%%%SMARTY_PARENT%%%%') !== false) { - $template->block_data[$_name]['source'] = - str_replace('%%%%SMARTY_PARENT%%%%', $block_content, $template->block_data[$_name]['source']); - } elseif ($template->block_data[$_name]['mode'] == 'prepend') { - $template->block_data[$_name]['source'] .= $block_content; - } elseif ($template->block_data[$_name]['mode'] == 'append') { - $template->block_data[$_name]['source'] = $block_content . $template->block_data[$_name]['source']; - } - } else { - $template->block_data[$_name]['source'] = $block_content; - $template->block_data[$_name]['file'] = $filepath; - } - if ($_match[6] == 'append') { - $template->block_data[$_name]['mode'] = 'append'; - } elseif ($_match[6] == 'prepend') { - $template->block_data[$_name]['mode'] = 'prepend'; - } else { - $template->block_data[$_name]['mode'] = 'replace'; - } - } - } - } - - /** - * Compile saved child block source - * - * @param object $compiler compiler object - * @param string $_name optional name of child block - * @return string compiled code of schild block - */ - public static function compileChildBlock($compiler, $_name = null) { - $_output = ''; - // if called by {$smarty.block.child} we must search the name of enclosing {block} - if ($_name == null) { - $stack_count = count($compiler->_tag_stack); - while (--$stack_count >= 0) { - if ($compiler->_tag_stack[$stack_count][0] == 'block') { - $_name = trim($compiler->_tag_stack[$stack_count][1][0]['name'], "'\""); - break; - } - } - // flag that child is already compile by {$smarty.block.child} inclusion - $compiler->template->block_data[$_name]['compiled'] = true; - } - if ($_name == null) { - $compiler->trigger_template_error('{$smarty.block.child} used out of context', $compiler->lex->taglineno); - } - // undefined child? - if (!isset($compiler->template->block_data[$_name]['source'])) { - return ''; - } - $_tpl = new Smarty_Internal_template('string:' . $compiler->template->block_data[$_name]['source'], $compiler->smarty, $compiler->template, $compiler->template->cache_id, - $compiler->template->compile_id = null, $compiler->template->caching, $compiler->template->cache_lifetime); - $_tpl->variable_filters = $compiler->template->variable_filters; - $_tpl->properties['nocache_hash'] = $compiler->template->properties['nocache_hash']; - $_tpl->source->filepath = $compiler->template->block_data[$_name]['file']; - $_tpl->allow_relative_path = true; - if ($compiler->nocache) { - $_tpl->compiler->forceNocache = 2; - } else { - $_tpl->compiler->forceNocache = 1; - } - $_tpl->compiler->suppressHeader = true; - $_tpl->compiler->suppressTemplatePropertyHeader = true; - $_tpl->compiler->suppressMergedTemplates = true; - if (strpos($compiler->template->block_data[$_name]['source'], '%%%%SMARTY_PARENT%%%%') !== false) { - $_output = str_replace('%%%%SMARTY_PARENT%%%%', $compiler->parser->current_buffer->to_smarty_php(), $_tpl->compiler->compileTemplate($_tpl)); - } elseif ($compiler->template->block_data[$_name]['mode'] == 'prepend') { - $_output = $_tpl->compiler->compileTemplate($_tpl) . $compiler->parser->current_buffer->to_smarty_php(); - } elseif ($compiler->template->block_data[$_name]['mode'] == 'append') { - $_output = $compiler->parser->current_buffer->to_smarty_php() . $_tpl->compiler->compileTemplate($_tpl); - } elseif (!empty($compiler->template->block_data[$_name])) { - $_output = $_tpl->compiler->compileTemplate($_tpl); - } - $compiler->template->properties['file_dependency'] = array_merge($compiler->template->properties['file_dependency'], $_tpl->properties['file_dependency']); - $compiler->template->properties['function'] = array_merge($compiler->template->properties['function'], $_tpl->properties['function']); - $compiler->merged_templates = array_merge($compiler->merged_templates, $_tpl->compiler->merged_templates); - $compiler->template->variable_filters = $_tpl->variable_filters; - if ($_tpl->has_nocache_code) { - $compiler->template->has_nocache_code = true; - } - foreach ($_tpl->required_plugins as $key => $tmp1) { - if ($compiler->nocache && $compiler->template->caching) { - $code = 'nocache'; - } else { - $code = $key; - } - foreach ($tmp1 as $name => $tmp) { - foreach ($tmp as $type => $data) { - $compiler->template->required_plugins[$code][$name][$type] = $data; - } - } - } - unset($_tpl); - return $_output; - } - -} - -/** - * Smarty Internal Plugin Compile BlockClose Class - * - * @package Smarty - * @subpackage Compiler - */ -class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_CompileBase { - - /** - * Compiles code for the {/block} tag - * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @return string compiled code - */ - public function compile($args, $compiler) { - $compiler->has_code = true; - // check and get attributes - $_attr = $this->getAttributes($compiler, $args); - $saved_data = $this->closeTag($compiler, array('block')); - $_name = trim($saved_data[0]['name'], "\"'"); - if (isset($compiler->template->block_data[$_name]) && !isset($compiler->template->block_data[$_name]['compiled'])) { - // restore to status before {block} tag as new subtemplate code of parent {block} is not needed - // TODO: Below code was disabled in 3.1.8 because of problems with {include} in nested {block} tags in child templates - // combined with append/prepend or $smarty.block.parent - // For later versions it should be checked under which conditions it could run for optimisation - // - //$compiler->merged_templates = $saved_data[4]; - //$compiler->smarty->merged_templates_func = $saved_data[5]; - //$compiler->template->properties = $saved_data[6]; - //$compiler->template->has_nocache_code = $saved_data[7]; - $_output = Smarty_Internal_Compile_Block::compileChildBlock($compiler, $_name); - } else { - if (isset($saved_data[0]['hide']) && !isset($compiler->template->block_data[$_name]['source'])) { - $_output = ''; - } else { - $_output = $compiler->parser->current_buffer->to_smarty_php(); - } - unset($compiler->template->block_data[$_name]['compiled']); - } - // reset flags - $compiler->parser->current_buffer = $saved_data[1]; - $compiler->nocache = $saved_data[2]; - $compiler->smarty->merge_compiled_includes = $saved_data[3]; - // reset flag for {block} tag - $compiler->inheritance = false; - // $_output content has already nocache code processed - $compiler->suppressNocacheProcessing = true; - return $_output; - } - -} - -?> \ No newline at end of file diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/sysplugins/smarty_internal_compile_extends.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/sysplugins/smarty_internal_compile_extends.php deleted file mode 100644 index fe14a4081..000000000 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/sysplugins/smarty_internal_compile_extends.php +++ /dev/null @@ -1,133 +0,0 @@ - true, 'eval' => true); - $this->_rdl = preg_quote($compiler->smarty->right_delimiter); - $this->_ldl = preg_quote($compiler->smarty->left_delimiter); - if (!$compiler->smarty->auto_literal) { - $al = '\s*'; - } else { - $al = ''; - } - $filepath = $compiler->template->source->filepath; - $this->mbstring_overload = ini_get('mbstring.func_overload') & 2; - // check and get attributes - $_attr = $this->getAttributes($compiler, $args); - if ($_attr['nocache'] === true) { - $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno); - } - - $_smarty_tpl = $compiler->template; - $include_file = null; - if (strpos($_attr['file'], '$_tmp') !== false) { - $compiler->trigger_template_error('illegal value for file attribute', $compiler->lex->taglineno); - } - eval('$include_file = ' . $_attr['file'] . ';'); - // create template object - $_template = new $compiler->smarty->template_class($include_file, $compiler->smarty, $compiler->template); - // save file dependency - if (isset($_is_stringy[$_template->source->type])) { - $template_sha1 = sha1($include_file); - } else { - $template_sha1 = sha1($_template->source->filepath); - } - if (isset($compiler->template->properties['file_dependency'][$template_sha1])) { - $compiler->trigger_template_error("illegal recursive call of \"{$include_file}\"", $compiler->lex->line - 1); - } - $compiler->template->properties['file_dependency'][$template_sha1] = array($_template->source->filepath, $_template->source->timestamp, $_template->source->type); - $_content = ($this->mbstring_overload ? mb_substr($compiler->lex->data, $compiler->lex->counter - 1, 20000000, 'latin1') : substr($compiler->lex->data, $compiler->lex->counter - 1)); - if (preg_match_all("!({$this->_ldl}{$al}block\s(.+?)\s*{$this->_rdl})!", $_content, $s) != - preg_match_all("!({$this->_ldl}{$al}/block\s*{$this->_rdl})!", $_content, $c)) { - $compiler->trigger_template_error('unmatched {block} {/block} pairs'); - } - preg_match_all("!{$this->_ldl}{$al}block\s(.+?)\s*{$this->_rdl}|{$this->_ldl}{$al}/block\s*{$this->_rdl}|{$this->_ldl}\*([\S\s]*?)\*{$this->_rdl}!", $_content, $_result, PREG_OFFSET_CAPTURE); - $_result_count = count($_result[0]); - $_start = 0; - while ($_start+1 < $_result_count) { - $_end = 0; - $_level = 1; - if (($this->mbstring_overload ? mb_substr($_result[0][$_start][0],0,mb_strlen($compiler->smarty->left_delimiter,'latin1')+1, 'latin1') : substr($_result[0][$_start][0],0,strlen($compiler->smarty->left_delimiter)+1)) == $compiler->smarty->left_delimiter.'*') { - $_start++; - continue; - } - while ($_level != 0) { - $_end++; - if (($this->mbstring_overload ? mb_substr($_result[0][$_start + $_end][0],0,mb_strlen($compiler->smarty->left_delimiter,'latin1')+1, 'latin1') : substr($_result[0][$_start + $_end][0],0,strlen($compiler->smarty->left_delimiter)+1)) == $compiler->smarty->left_delimiter.'*') { - continue; - } - if (!strpos($_result[0][$_start + $_end][0], '/')) { - $_level++; - } else { - $_level--; - } - } - $_block_content = str_replace($compiler->smarty->left_delimiter . '$smarty.block.parent' . $compiler->smarty->right_delimiter, '%%%%SMARTY_PARENT%%%%', - ($this->mbstring_overload ? mb_substr($_content, $_result[0][$_start][1] + mb_strlen($_result[0][$_start][0], 'latin1'), $_result[0][$_start + $_end][1] - $_result[0][$_start][1] - + mb_strlen($_result[0][$_start][0], 'latin1'), 'latin1') : substr($_content, $_result[0][$_start][1] + strlen($_result[0][$_start][0]), $_result[0][$_start + $_end][1] - $_result[0][$_start][1] - + strlen($_result[0][$_start][0])))); - Smarty_Internal_Compile_Block::saveBlockData($_block_content, $_result[0][$_start][0], $compiler->template, $filepath); - $_start = $_start + $_end + 1; - } - if ($_template->source->type == 'extends') { - $_template->block_data = $compiler->template->block_data; - } - $compiler->template->source->content = $_template->source->content; - if ($_template->source->type == 'extends') { - $compiler->template->block_data = $_template->block_data; - foreach ($_template->source->components as $key => $component) { - $compiler->template->properties['file_dependency'][$key] = array($component->filepath, $component->timestamp, $component->type); - } - } - $compiler->template->source->filepath = $_template->source->filepath; - $compiler->abort_and_recompile = true; - return ''; - } - -} - -?> \ No newline at end of file diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/sysplugins/smarty_internal_compile_include.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/sysplugins/smarty_internal_compile_include.php deleted file mode 100644 index 43a144f94..000000000 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/sysplugins/smarty_internal_compile_include.php +++ /dev/null @@ -1,215 +0,0 @@ -getAttributes($compiler, $args); - // save posible attributes - $include_file = $_attr['file']; - - if (isset($_attr['assign'])) { - // output will be stored in a smarty variable instead of beind displayed - $_assign = $_attr['assign']; - } - - $_parent_scope = Smarty::SCOPE_LOCAL; - if (isset($_attr['scope'])) { - $_attr['scope'] = trim($_attr['scope'], "'\""); - if ($_attr['scope'] == 'parent') { - $_parent_scope = Smarty::SCOPE_PARENT; - } elseif ($_attr['scope'] == 'root') { - $_parent_scope = Smarty::SCOPE_ROOT; - } elseif ($_attr['scope'] == 'global') { - $_parent_scope = Smarty::SCOPE_GLOBAL; - } - } - $_caching = 'null'; - if ($compiler->nocache || $compiler->tag_nocache) { - $_caching = Smarty::CACHING_OFF; - } - // default for included templates - if ($compiler->template->caching && !$compiler->nocache && !$compiler->tag_nocache) { - $_caching = self::CACHING_NOCACHE_CODE; - } - /* - * if the {include} tag provides individual parameter for caching - * it will not be included into the common cache file and treated like - * a nocache section - */ - if (isset($_attr['cache_lifetime'])) { - $_cache_lifetime = $_attr['cache_lifetime']; - $compiler->tag_nocache = true; - $_caching = Smarty::CACHING_LIFETIME_CURRENT; - } else { - $_cache_lifetime = 'null'; - } - if (isset($_attr['cache_id'])) { - $_cache_id = $_attr['cache_id']; - $compiler->tag_nocache = true; - $_caching = Smarty::CACHING_LIFETIME_CURRENT; - } else { - $_cache_id = '$_smarty_tpl->cache_id'; - } - if (isset($_attr['compile_id'])) { - $_compile_id = $_attr['compile_id']; - } else { - $_compile_id = '$_smarty_tpl->compile_id'; - } - if ($_attr['caching'] === true) { - $_caching = Smarty::CACHING_LIFETIME_CURRENT; - } - if ($_attr['nocache'] === true) { - $compiler->tag_nocache = true; - $_caching = Smarty::CACHING_OFF; - } - - $has_compiled_template = false; - if (($compiler->smarty->merge_compiled_includes || $_attr['inline'] === true) && !$compiler->template->source->recompiled - && !($compiler->template->caching && ($compiler->tag_nocache || $compiler->nocache)) && $_caching != Smarty::CACHING_LIFETIME_CURRENT) { - // check if compiled code can be merged (contains no variable part) - if (!$compiler->has_variable_string && (substr_count($include_file, '"') == 2 or substr_count($include_file, "'") == 2) - and substr_count($include_file, '(') == 0 and substr_count($include_file, '$_smarty_tpl->') == 0) { - $tpl_name = null; - eval("\$tpl_name = $include_file;"); - if (!isset($compiler->smarty->merged_templates_func[$tpl_name]) || $compiler->inheritance) { - $tpl = new $compiler->smarty->template_class ($tpl_name, $compiler->smarty, $compiler->template, $compiler->template->cache_id, $compiler->template->compile_id); - // save unique function name - $compiler->smarty->merged_templates_func[$tpl_name]['func'] = $tpl->properties['unifunc'] = 'content_'. str_replace('.', '_', uniqid('', true)); - // use current nocache hash for inlined code - $compiler->smarty->merged_templates_func[$tpl_name]['nocache_hash'] = $tpl->properties['nocache_hash'] = $compiler->template->properties['nocache_hash']; - if ($compiler->template->caching) { - // needs code for cached page but no cache file - $tpl->caching = self::CACHING_NOCACHE_CODE; - } - // make sure whole chain gest compiled - $tpl->mustCompile = true; - if (!($tpl->source->uncompiled) && $tpl->source->exists) { - // get compiled code - $compiled_code = $tpl->compiler->compileTemplate($tpl); - // release compiler object to free memory - unset($tpl->compiler); - // merge compiled code for {function} tags - $compiler->template->properties['function'] = array_merge($compiler->template->properties['function'], $tpl->properties['function']); - // merge filedependency - $tpl->properties['file_dependency'][$tpl->source->uid] = array($tpl->source->filepath, $tpl->source->timestamp,$tpl->source->type); - $compiler->template->properties['file_dependency'] = array_merge($compiler->template->properties['file_dependency'], $tpl->properties['file_dependency']); - // remove header code - $compiled_code = preg_replace("/(<\?php \/\*%%SmartyHeaderCode:{$tpl->properties['nocache_hash']}%%\*\/(.+?)\/\*\/%%SmartyHeaderCode%%\*\/\?>\n)/s", '', $compiled_code); - if ($tpl->has_nocache_code) { - // replace nocache_hash - $compiled_code = str_replace("{$tpl->properties['nocache_hash']}", $compiler->template->properties['nocache_hash'], $compiled_code); - $compiler->template->has_nocache_code = true; - } - $compiler->merged_templates[$tpl->properties['unifunc']] = $compiled_code; - $has_compiled_template = true; - } - } else { - $has_compiled_template = true; - } - } - } - // delete {include} standard attributes - unset($_attr['file'], $_attr['assign'], $_attr['cache_id'], $_attr['compile_id'], $_attr['cache_lifetime'], $_attr['nocache'], $_attr['caching'], $_attr['scope'], $_attr['inline']); - // remaining attributes must be assigned as smarty variable - if (!empty($_attr)) { - if ($_parent_scope == Smarty::SCOPE_LOCAL) { - // create variables - foreach ($_attr as $key => $value) { - $_pairs[] = "'$key'=>$value"; - } - $_vars = 'array('.join(',',$_pairs).')'; - $_has_vars = true; - } else { - $compiler->trigger_template_error('variable passing not allowed in parent/global scope', $compiler->lex->taglineno); - } - } else { - $_vars = 'array()'; - $_has_vars = false; - } - if ($has_compiled_template) { - $_hash = $compiler->smarty->merged_templates_func[$tpl_name]['nocache_hash']; - $_output = "setupInlineSubTemplate($include_file, $_cache_id, $_compile_id, $_caching, $_cache_lifetime, $_vars, $_parent_scope, '$_hash');\n"; - if (isset($_assign)) { - $_output .= 'ob_start(); '; - } - $_output .= $compiler->smarty->merged_templates_func[$tpl_name]['func']. "(\$_smarty_tpl);\n"; - $_output .= "\$_smarty_tpl = array_pop(\$_tpl_stack); "; - if (isset($_assign)) { - $_output .= " \$_smarty_tpl->tpl_vars[$_assign] = new Smarty_variable(ob_get_clean());"; - } - $_output .= "/* End of included template \"" . $tpl_name . "\" */?>"; - return $_output; - } - - // was there an assign attribute - if (isset($_assign)) { - $_output = "tpl_vars[$_assign] = new Smarty_variable(\$_smarty_tpl->getSubTemplate ($include_file, $_cache_id, $_compile_id, $_caching, $_cache_lifetime, $_vars, $_parent_scope));?>\n";; - } else { - $_output = "getSubTemplate ($include_file, $_cache_id, $_compile_id, $_caching, $_cache_lifetime, $_vars, $_parent_scope);?>\n"; - } - return $_output; - } - -} - -?> \ No newline at end of file diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/sysplugins/smarty_internal_resource_extends.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/sysplugins/smarty_internal_resource_extends.php deleted file mode 100644 index 29734ae05..000000000 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/sysplugins/smarty_internal_resource_extends.php +++ /dev/null @@ -1,162 +0,0 @@ -name); - $exists = true; - foreach ($components as $component) { - $s = Smarty_Resource::source(null, $source->smarty, $component); - if ($s->type == 'php') { - throw new SmartyException("Resource type {$s->type} cannot be used with the extends resource type"); - } - $sources[$s->uid] = $s; - $uid .= $s->filepath; - if ($_template && $_template->smarty->compile_check) { - $exists = $exists && $s->exists; - } - } - $source->components = $sources; - $source->filepath = $s->filepath; - $source->uid = sha1($uid); - if ($_template && $_template->smarty->compile_check) { - $source->timestamp = $s->timestamp; - $source->exists = $exists; - } - // need the template at getContent() - $source->template = $_template; - } - - /** - * populate Source Object with timestamp and exists from Resource - * - * @param Smarty_Template_Source $source source object - */ - public function populateTimestamp(Smarty_Template_Source $source) - { - $source->exists = true; - foreach ($source->components as $s) { - $source->exists = $source->exists && $s->exists; - } - $source->timestamp = $s->timestamp; - } - - /** - * Load template's source from files into current template object - * - * @param Smarty_Template_Source $source source object - * @return string template source - * @throws SmartyException if source cannot be loaded - */ - public function getContent(Smarty_Template_Source $source) - { - if (!$source->exists) { - throw new SmartyException("Unable to read template {$source->type} '{$source->name}'"); - } - - $this->mbstring_overload = ini_get('mbstring.func_overload') & 2; - $_rdl = preg_quote($source->smarty->right_delimiter); - $_ldl = preg_quote($source->smarty->left_delimiter); - if (!$source->smarty->auto_literal) { - $al = '\s*'; - } else { - $al = ''; - } - $_components = array_reverse($source->components); - $_first = reset($_components); - $_last = end($_components); - - foreach ($_components as $_component) { - // register dependency - if ($_component != $_first) { - $source->template->properties['file_dependency'][$_component->uid] = array($_component->filepath, $_component->timestamp, $_component->type); - } - - // read content - $source->filepath = $_component->filepath; - $_content = $_component->content; - - // extend sources - if ($_component != $_last) { - if (preg_match_all("!({$_ldl}{$al}block\s(.+?)\s*{$_rdl})!", $_content, $_open) != - preg_match_all("!({$_ldl}{$al}/block\s*{$_rdl})!", $_content, $_close)) { - throw new SmartyException("unmatched {block} {/block} pairs in template {$_component->type} '{$_component->name}'"); - } - preg_match_all("!{$_ldl}{$al}block\s(.+?)\s*{$_rdl}|{$_ldl}{$al}/block\s*{$_rdl}|{$_ldl}\*([\S\s]*?)\*{$_rdl}!", $_content, $_result, PREG_OFFSET_CAPTURE); - $_result_count = count($_result[0]); - $_start = 0; - while ($_start+1 < $_result_count) { - $_end = 0; - $_level = 1; - if (($this->mbstring_overload ? mb_substr($_result[0][$_start][0],0,mb_strlen($source->smarty->left_delimiter,'latin1')+1, 'latin1') : substr($_result[0][$_start][0],0,strlen($source->smarty->left_delimiter)+1)) == $source->smarty->left_delimiter.'*') { - $_start++; - continue; - } - while ($_level != 0) { - $_end++; - if (($this->mbstring_overload ? mb_substr($_result[0][$_start + $_end][0],0,mb_strlen($source->smarty->left_delimiter,'latin1')+1, 'latin1') : substr($_result[0][$_start + $_end][0],0,strlen($source->smarty->left_delimiter)+1)) == $source->smarty->left_delimiter.'*') { - continue; - } - if (!strpos($_result[0][$_start + $_end][0], '/')) { - $_level++; - } else { - $_level--; - } - } - $_block_content = str_replace($source->smarty->left_delimiter . '$smarty.block.parent' . $source->smarty->right_delimiter, '%%%%SMARTY_PARENT%%%%', - ($this->mbstring_overload ? mb_substr($_content, $_result[0][$_start][1] + mb_strlen($_result[0][$_start][0], 'latin1'), $_result[0][$_start + $_end][1] - $_result[0][$_start][1] - + mb_strlen($_result[0][$_start][0], 'latin1'), 'latin1') : substr($_content, $_result[0][$_start][1] + strlen($_result[0][$_start][0]), $_result[0][$_start + $_end][1] - $_result[0][$_start][1] - + strlen($_result[0][$_start][0])))); - Smarty_Internal_Compile_Block::saveBlockData($_block_content, $_result[0][$_start][0], $source->template, $_component->filepath); - $_start = $_start + $_end + 1; - } - } else { - return $_content; - } - } - } - - /** - * Determine basename for compiled filename - * - * @param Smarty_Template_Source $source source object - * @return string resource's basename - */ - public function getBasename(Smarty_Template_Source $source) - { - return str_replace(':', '.', basename($source->filepath)); - } - -} - -?> \ No newline at end of file diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/sysplugins/smarty_internal_resource_stream.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/sysplugins/smarty_internal_resource_stream.php deleted file mode 100644 index 58086c179..000000000 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/sysplugins/smarty_internal_resource_stream.php +++ /dev/null @@ -1,78 +0,0 @@ -resource, '://') !== false) { - $source->filepath = $source->resource; - } else { - $source->filepath = str_replace(':', '://', $source->resource); - } - $source->uid = false; - $source->content = $this->getContent($source); - $source->timestamp = false; - $source->exists = !!$source->content; - } - - /** - * Load template's source from stream into current template object - * - * @param Smarty_Template_Source $source source object - * @return string template source - * @throws SmartyException if source cannot be loaded - */ - public function getContent(Smarty_Template_Source $source) - { - $t = ''; - // the availability of the stream has already been checked in Smarty_Resource::fetch() - $fp = fopen($source->filepath, 'r+'); - if ($fp) { - while (!feof($fp) && ($current_line = fgets($fp)) !== false) { - $t .= $current_line; - } - fclose($fp); - return $t; - } else { - return false; - } - } - - /** - * modify resource_name according to resource handlers specifications - * - * @param Smarty $smarty Smarty instance - * @param string $resource_name resource_name to make unique - * @return string unique resource name - */ - protected function buildUniqueResourceName(Smarty $smarty, $resource_name) - { - return get_class($this) . '#' . $resource_name; - } -} diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/sysplugins/smarty_internal_templatelexer.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/sysplugins/smarty_internal_templatelexer.php deleted file mode 100644 index a7d5fa9a5..000000000 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/sysplugins/smarty_internal_templatelexer.php +++ /dev/null @@ -1,1203 +0,0 @@ - '===', - 'NONEIDENTITY' => '!==', - 'EQUALS' => '==', - 'NOTEQUALS' => '!=', - 'GREATEREQUAL' => '(>=,ge)', - 'LESSEQUAL' => '(<=,le)', - 'GREATERTHAN' => '(>,gt)', - 'LESSTHAN' => '(<,lt)', - 'MOD' => '(%,mod)', - 'NOT' => '(!,not)', - 'LAND' => '(&&,and)', - 'LOR' => '(||,or)', - 'LXOR' => 'xor', - 'OPENP' => '(', - 'CLOSEP' => ')', - 'OPENB' => '[', - 'CLOSEB' => ']', - 'PTR' => '->', - 'APTR' => '=>', - 'EQUAL' => '=', - 'NUMBER' => 'number', - 'UNIMATH' => '+" , "-', - 'MATH' => '*" , "/" , "%', - 'INCDEC' => '++" , "--', - 'SPACE' => ' ', - 'DOLLAR' => '$', - 'SEMICOLON' => ';', - 'COLON' => ':', - 'DOUBLECOLON' => '::', - 'AT' => '@', - 'HATCH' => '#', - 'QUOTE' => '"', - 'BACKTICK' => '`', - 'VERT' => '|', - 'DOT' => '.', - 'COMMA' => '","', - 'ANDSYM' => '"&"', - 'QMARK' => '"?"', - 'ID' => 'identifier', - 'TEXT' => 'text', - 'FAKEPHPSTARTTAG' => 'Fake PHP start tag', - 'PHPSTARTTAG' => 'PHP start tag', - 'PHPENDTAG' => 'PHP end tag', - 'LITERALSTART' => 'Literal start', - 'LITERALEND' => 'Literal end', - 'LDELSLASH' => 'closing tag', - 'COMMENT' => 'comment', - 'AS' => 'as', - 'TO' => 'to', - ); - - - function __construct($data,$compiler) - { -// $this->data = preg_replace("/(\r\n|\r|\n)/", "\n", $data); - $this->data = $data; - $this->counter = 0; - $this->line = 1; - $this->smarty = $compiler->smarty; - $this->compiler = $compiler; - $this->ldel = preg_quote($this->smarty->left_delimiter,'/'); - $this->ldel_length = strlen($this->smarty->left_delimiter); - $this->rdel = preg_quote($this->smarty->right_delimiter,'/'); - $this->rdel_length = strlen($this->smarty->right_delimiter); - $this->smarty_token_names['LDEL'] = $this->smarty->left_delimiter; - $this->smarty_token_names['RDEL'] = $this->smarty->right_delimiter; - $this->mbstring_overload = ini_get('mbstring.func_overload') & 2; - } - - - private $_yy_state = 1; - private $_yy_stack = array(); - - function yylex() - { - return $this->{'yylex' . $this->_yy_state}(); - } - - function yypushstate($state) - { - array_push($this->_yy_stack, $this->_yy_state); - $this->_yy_state = $state; - } - - function yypopstate() - { - $this->_yy_state = array_pop($this->_yy_stack); - } - - function yybegin($state) - { - $this->_yy_state = $state; - } - - - - function yylex1() - { - $tokenMap = array ( - 1 => 0, - 2 => 0, - 3 => 1, - 5 => 0, - 6 => 0, - 7 => 0, - 8 => 0, - 9 => 0, - 10 => 0, - 11 => 1, - 13 => 0, - 14 => 0, - 15 => 0, - 16 => 0, - 17 => 0, - 18 => 0, - 19 => 0, - 20 => 0, - 21 => 0, - 22 => 0, - 23 => 0, - 24 => 0, - ); - if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) { - return false; // end of input - } - $yy_global_pattern = "/\G(".$this->ldel."[$]smarty\\.block\\.child".$this->rdel.")|\G(\\{\\})|\G(".$this->ldel."\\*([\S\s]*?)\\*".$this->rdel.")|\G(".$this->ldel."strip".$this->rdel.")|\G(".$this->ldel."\\s{1,}strip\\s{1,}".$this->rdel.")|\G(".$this->ldel."\/strip".$this->rdel.")|\G(".$this->ldel."\\s{1,}\/strip\\s{1,}".$this->rdel.")|\G(".$this->ldel."\\s*literal\\s*".$this->rdel.")|\G(".$this->ldel."\\s{1,}\/)|\G(".$this->ldel."\\s*(if|elseif|else if|while)\\s+)|\G(".$this->ldel."\\s*for\\s+)|\G(".$this->ldel."\\s*foreach(?![^\s]))|\G(".$this->ldel."\\s*setfilter\\s+)|\G(".$this->ldel."\\s{1,})|\G(".$this->ldel."\/)|\G(".$this->ldel.")|\G(<\\?(?:php\\w+|=|[a-zA-Z]+)?)|\G(\\?>)|\G(".$this->rdel.")|\G(<%)|\G(%>)|\G([\S\s])/iS"; - - do { - if ($this->mbstring_overload ? preg_match($yy_global_pattern, mb_substr($this->data, $this->counter,2000000000,'latin1'), $yymatches) : preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) { - $yysubmatches = $yymatches; - $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns - if (!count($yymatches)) { - throw new Exception('Error: lexing failed because a rule matched' . - ' an empty string. Input "' . substr($this->data, - $this->counter, 5) . '... state TEXT'); - } - next($yymatches); // skip global match - $this->token = key($yymatches); // token number - if ($tokenMap[$this->token]) { - // extract sub-patterns for passing to lex function - $yysubmatches = array_slice($yysubmatches, $this->token + 1, - $tokenMap[$this->token]); - } else { - $yysubmatches = array(); - } - $this->value = current($yymatches); // token value - $r = $this->{'yy_r1_' . $this->token}($yysubmatches); - if ($r === null) { - $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value)); - $this->line += substr_count($this->value, "\n"); - // accept this token - return true; - } elseif ($r === true) { - // we have changed state - // process this token in the new state - return $this->yylex(); - } elseif ($r === false) { - $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value)); - $this->line += substr_count($this->value, "\n"); - if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) { - return false; // end of input - } - // skip this token - continue; - } } else { - throw new Exception('Unexpected input at line' . $this->line . - ': ' . $this->data[$this->counter]); - } - break; - } while (true); - - } // end function - - - const TEXT = 1; - function yy_r1_1($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_SMARTYBLOCKCHILD; - } - function yy_r1_2($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } - function yy_r1_3($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_COMMENT; - } - function yy_r1_5($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_STRIPON; - } - function yy_r1_6($yy_subpatterns) - { - - if ($this->smarty->auto_literal) { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->token = Smarty_Internal_Templateparser::TP_STRIPON; - } - } - function yy_r1_7($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_STRIPOFF; - } - function yy_r1_8($yy_subpatterns) - { - - if ($this->smarty->auto_literal) { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->token = Smarty_Internal_Templateparser::TP_STRIPOFF; - } - } - function yy_r1_9($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_LITERALSTART; - $this->yypushstate(self::LITERAL); - } - function yy_r1_10($yy_subpatterns) - { - - if ($this->smarty->auto_literal) { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } - } - function yy_r1_11($yy_subpatterns) - { - - if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->token = Smarty_Internal_Templateparser::TP_LDELIF; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } - } - function yy_r1_13($yy_subpatterns) - { - - if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->token = Smarty_Internal_Templateparser::TP_LDELFOR; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } - } - function yy_r1_14($yy_subpatterns) - { - - if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } - } - function yy_r1_15($yy_subpatterns) - { - - if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->token = Smarty_Internal_Templateparser::TP_LDELSETFILTER; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } - } - function yy_r1_16($yy_subpatterns) - { - - if ($this->smarty->auto_literal) { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->token = Smarty_Internal_Templateparser::TP_LDEL; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } - } - function yy_r1_17($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } - function yy_r1_18($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_LDEL; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } - function yy_r1_19($yy_subpatterns) - { - - if (in_array($this->value, Array('token = Smarty_Internal_Templateparser::TP_PHPSTARTTAG; - } elseif ($this->value == 'token = Smarty_Internal_Templateparser::TP_XMLTAG; - } else { - $this->token = Smarty_Internal_Templateparser::TP_FAKEPHPSTARTTAG; - $this->value = substr($this->value, 0, 2); - } - } - function yy_r1_20($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_PHPENDTAG; - } - function yy_r1_21($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } - function yy_r1_22($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_ASPSTARTTAG; - } - function yy_r1_23($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_ASPENDTAG; - } - function yy_r1_24($yy_subpatterns) - { - - if ($this->mbstring_overload) { - $to = mb_strlen($this->data,'latin1'); - } else { - $to = strlen($this->data); - } - preg_match("/{$this->ldel}|<\?|\?>|<%|%>/",$this->data,$match,PREG_OFFSET_CAPTURE,$this->counter); - if (isset($match[0][1])) { - $to = $match[0][1]; - } - if ($this->mbstring_overload) { - $this->value = mb_substr($this->data,$this->counter,$to-$this->counter,'latin1'); - } else { - $this->value = substr($this->data,$this->counter,$to-$this->counter); - } - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } - - - function yylex2() - { - $tokenMap = array ( - 1 => 0, - 2 => 0, - 3 => 1, - 5 => 0, - 6 => 0, - 7 => 0, - 8 => 0, - 9 => 0, - 10 => 0, - 11 => 0, - 12 => 0, - 13 => 0, - 14 => 0, - 15 => 0, - 16 => 0, - 17 => 0, - 18 => 0, - 19 => 0, - 20 => 1, - 22 => 1, - 24 => 1, - 26 => 0, - 27 => 0, - 28 => 0, - 29 => 0, - 30 => 0, - 31 => 0, - 32 => 0, - 33 => 0, - 34 => 0, - 35 => 0, - 36 => 0, - 37 => 0, - 38 => 0, - 39 => 0, - 40 => 0, - 41 => 0, - 42 => 0, - 43 => 3, - 47 => 0, - 48 => 0, - 49 => 0, - 50 => 0, - 51 => 0, - 52 => 0, - 53 => 0, - 54 => 0, - 55 => 1, - 57 => 1, - 59 => 0, - 60 => 0, - 61 => 0, - 62 => 0, - 63 => 0, - 64 => 0, - 65 => 0, - 66 => 0, - 67 => 0, - 68 => 0, - 69 => 0, - 70 => 0, - 71 => 0, - 72 => 0, - 73 => 0, - 74 => 0, - 75 => 0, - 76 => 0, - 77 => 0, - ); - if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) { - return false; // end of input - } - $yy_global_pattern = "/\G('[^'\\\\]*(?:\\\\.[^'\\\\]*)*')|\G(".$this->ldel."\\s{1,}\/)|\G(".$this->ldel."\\s*(if|elseif|else if|while)\\s+)|\G(".$this->ldel."\\s*for\\s+)|\G(".$this->ldel."\\s*foreach(?![^\s]))|\G(".$this->ldel."\\s{1,})|\G(\\s{1,}".$this->rdel.")|\G(".$this->ldel."\/)|\G(".$this->ldel.")|\G(".$this->rdel.")|\G(\\s+is\\s+in\\s+)|\G(\\s+as\\s+)|\G(\\s+to\\s+)|\G(\\s+step\\s+)|\G(\\s+instanceof\\s+)|\G(\\s*===\\s*)|\G(\\s*!==\\s*)|\G(\\s*==\\s*|\\s+eq\\s+)|\G(\\s*!=\\s*|\\s*<>\\s*|\\s+(ne|neq)\\s+)|\G(\\s*>=\\s*|\\s+(ge|gte)\\s+)|\G(\\s*<=\\s*|\\s+(le|lte)\\s+)|\G(\\s*>\\s*|\\s+gt\\s+)|\G(\\s*<\\s*|\\s+lt\\s+)|\G(\\s+mod\\s+)|\G(!\\s*|not\\s+)|\G(\\s*&&\\s*|\\s*and\\s+)|\G(\\s*\\|\\|\\s*|\\s*or\\s+)|\G(\\s*xor\\s+)|\G(\\s+is\\s+odd\\s+by\\s+)|\G(\\s+is\\s+not\\s+odd\\s+by\\s+)|\G(\\s+is\\s+odd)|\G(\\s+is\\s+not\\s+odd)|\G(\\s+is\\s+even\\s+by\\s+)|\G(\\s+is\\s+not\\s+even\\s+by\\s+)|\G(\\s+is\\s+even)|\G(\\s+is\\s+not\\s+even)|\G(\\s+is\\s+div\\s+by\\s+)|\G(\\s+is\\s+not\\s+div\\s+by\\s+)|\G(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\)\\s*)|\G(\\s*\\(\\s*)|\G(\\s*\\))|\G(\\[\\s*)|\G(\\s*\\])|\G(\\s*->\\s*)|\G(\\s*=>\\s*)|\G(\\s*=\\s*)|\G(\\+\\+|--)|\G(\\s*(\\+|-)\\s*)|\G(\\s*(\\*|\/|%)\\s*)|\G(\\$)|\G(\\s*;)|\G(::)|\G(\\s*:\\s*)|\G(@)|\G(#)|\G(\")|\G(`)|\G(\\|)|\G(\\.)|\G(\\s*,\\s*)|\G(\\s*&\\s*)|\G(\\s*\\?\\s*)|\G(0[xX][0-9a-fA-F]+)|\G(\\s+[0-9]*[a-zA-Z_][a-zA-Z0-9_\-:]*\\s*=\\s*)|\G([0-9]*[a-zA-Z_]\\w*)|\G(\\d+)|\G(\\s+)|\G([\S\s])/iS"; - - do { - if ($this->mbstring_overload ? preg_match($yy_global_pattern, mb_substr($this->data, $this->counter,2000000000,'latin1'), $yymatches) : preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) { - $yysubmatches = $yymatches; - $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns - if (!count($yymatches)) { - throw new Exception('Error: lexing failed because a rule matched' . - ' an empty string. Input "' . substr($this->data, - $this->counter, 5) . '... state SMARTY'); - } - next($yymatches); // skip global match - $this->token = key($yymatches); // token number - if ($tokenMap[$this->token]) { - // extract sub-patterns for passing to lex function - $yysubmatches = array_slice($yysubmatches, $this->token + 1, - $tokenMap[$this->token]); - } else { - $yysubmatches = array(); - } - $this->value = current($yymatches); // token value - $r = $this->{'yy_r2_' . $this->token}($yysubmatches); - if ($r === null) { - $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value)); - $this->line += substr_count($this->value, "\n"); - // accept this token - return true; - } elseif ($r === true) { - // we have changed state - // process this token in the new state - return $this->yylex(); - } elseif ($r === false) { - $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value)); - $this->line += substr_count($this->value, "\n"); - if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) { - return false; // end of input - } - // skip this token - continue; - } } else { - throw new Exception('Unexpected input at line' . $this->line . - ': ' . $this->data[$this->counter]); - } - break; - } while (true); - - } // end function - - - const SMARTY = 2; - function yy_r2_1($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_SINGLEQUOTESTRING; - } - function yy_r2_2($yy_subpatterns) - { - - if ($this->smarty->auto_literal) { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } - } - function yy_r2_3($yy_subpatterns) - { - - if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->token = Smarty_Internal_Templateparser::TP_LDELIF; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } - } - function yy_r2_5($yy_subpatterns) - { - - if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->token = Smarty_Internal_Templateparser::TP_LDELFOR; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } - } - function yy_r2_6($yy_subpatterns) - { - - if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } - } - function yy_r2_7($yy_subpatterns) - { - - if ($this->smarty->auto_literal) { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->token = Smarty_Internal_Templateparser::TP_LDEL; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } - } - function yy_r2_8($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_RDEL; - $this->yypopstate(); - } - function yy_r2_9($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } - function yy_r2_10($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_LDEL; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } - function yy_r2_11($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_RDEL; - $this->yypopstate(); - } - function yy_r2_12($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_ISIN; - } - function yy_r2_13($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_AS; - } - function yy_r2_14($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_TO; - } - function yy_r2_15($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_STEP; - } - function yy_r2_16($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_INSTANCEOF; - } - function yy_r2_17($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_IDENTITY; - } - function yy_r2_18($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_NONEIDENTITY; - } - function yy_r2_19($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_EQUALS; - } - function yy_r2_20($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_NOTEQUALS; - } - function yy_r2_22($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_GREATEREQUAL; - } - function yy_r2_24($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_LESSEQUAL; - } - function yy_r2_26($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_GREATERTHAN; - } - function yy_r2_27($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_LESSTHAN; - } - function yy_r2_28($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_MOD; - } - function yy_r2_29($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_NOT; - } - function yy_r2_30($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_LAND; - } - function yy_r2_31($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_LOR; - } - function yy_r2_32($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_LXOR; - } - function yy_r2_33($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_ISODDBY; - } - function yy_r2_34($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_ISNOTODDBY; - } - function yy_r2_35($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_ISODD; - } - function yy_r2_36($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_ISNOTODD; - } - function yy_r2_37($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_ISEVENBY; - } - function yy_r2_38($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_ISNOTEVENBY; - } - function yy_r2_39($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_ISEVEN; - } - function yy_r2_40($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_ISNOTEVEN; - } - function yy_r2_41($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_ISDIVBY; - } - function yy_r2_42($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_ISNOTDIVBY; - } - function yy_r2_43($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_TYPECAST; - } - function yy_r2_47($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_OPENP; - } - function yy_r2_48($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_CLOSEP; - } - function yy_r2_49($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_OPENB; - } - function yy_r2_50($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_CLOSEB; - } - function yy_r2_51($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_PTR; - } - function yy_r2_52($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_APTR; - } - function yy_r2_53($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_EQUAL; - } - function yy_r2_54($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_INCDEC; - } - function yy_r2_55($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_UNIMATH; - } - function yy_r2_57($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_MATH; - } - function yy_r2_59($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_DOLLAR; - } - function yy_r2_60($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_SEMICOLON; - } - function yy_r2_61($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_DOUBLECOLON; - } - function yy_r2_62($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_COLON; - } - function yy_r2_63($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_AT; - } - function yy_r2_64($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_HATCH; - } - function yy_r2_65($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_QUOTE; - $this->yypushstate(self::DOUBLEQUOTEDSTRING); - } - function yy_r2_66($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_BACKTICK; - $this->yypopstate(); - } - function yy_r2_67($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_VERT; - } - function yy_r2_68($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_DOT; - } - function yy_r2_69($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_COMMA; - } - function yy_r2_70($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_ANDSYM; - } - function yy_r2_71($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_QMARK; - } - function yy_r2_72($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_HEX; - } - function yy_r2_73($yy_subpatterns) - { - - // resolve conflicts with shorttag and right_delimiter starting with '=' - if (substr($this->data, $this->counter + strlen($this->value) - 1, $this->rdel_length) == $this->smarty->right_delimiter) { - preg_match("/\s+/",$this->value,$match); - $this->value = $match[0]; - $this->token = Smarty_Internal_Templateparser::TP_SPACE; - } else { - $this->token = Smarty_Internal_Templateparser::TP_ATTR; - } - } - function yy_r2_74($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_ID; - } - function yy_r2_75($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_INTEGER; - } - function yy_r2_76($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_SPACE; - } - function yy_r2_77($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } - - - - function yylex3() - { - $tokenMap = array ( - 1 => 0, - 2 => 0, - 3 => 0, - 4 => 0, - 5 => 0, - 6 => 0, - 7 => 0, - ); - if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) { - return false; // end of input - } - $yy_global_pattern = "/\G(".$this->ldel."\\s*literal\\s*".$this->rdel.")|\G(".$this->ldel."\\s*\/literal\\s*".$this->rdel.")|\G(<\\?(?:php\\w+|=|[a-zA-Z]+)?)|\G(\\?>)|\G(<%)|\G(%>)|\G([\S\s])/iS"; - - do { - if ($this->mbstring_overload ? preg_match($yy_global_pattern, mb_substr($this->data, $this->counter,2000000000,'latin1'), $yymatches) : preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) { - $yysubmatches = $yymatches; - $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns - if (!count($yymatches)) { - throw new Exception('Error: lexing failed because a rule matched' . - ' an empty string. Input "' . substr($this->data, - $this->counter, 5) . '... state LITERAL'); - } - next($yymatches); // skip global match - $this->token = key($yymatches); // token number - if ($tokenMap[$this->token]) { - // extract sub-patterns for passing to lex function - $yysubmatches = array_slice($yysubmatches, $this->token + 1, - $tokenMap[$this->token]); - } else { - $yysubmatches = array(); - } - $this->value = current($yymatches); // token value - $r = $this->{'yy_r3_' . $this->token}($yysubmatches); - if ($r === null) { - $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value)); - $this->line += substr_count($this->value, "\n"); - // accept this token - return true; - } elseif ($r === true) { - // we have changed state - // process this token in the new state - return $this->yylex(); - } elseif ($r === false) { - $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value)); - $this->line += substr_count($this->value, "\n"); - if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) { - return false; // end of input - } - // skip this token - continue; - } } else { - throw new Exception('Unexpected input at line' . $this->line . - ': ' . $this->data[$this->counter]); - } - break; - } while (true); - - } // end function - - - const LITERAL = 3; - function yy_r3_1($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_LITERALSTART; - $this->yypushstate(self::LITERAL); - } - function yy_r3_2($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_LITERALEND; - $this->yypopstate(); - } - function yy_r3_3($yy_subpatterns) - { - - if (in_array($this->value, Array('token = Smarty_Internal_Templateparser::TP_PHPSTARTTAG; - } else { - $this->token = Smarty_Internal_Templateparser::TP_FAKEPHPSTARTTAG; - $this->value = substr($this->value, 0, 2); - } - } - function yy_r3_4($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_PHPENDTAG; - } - function yy_r3_5($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_ASPSTARTTAG; - } - function yy_r3_6($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_ASPENDTAG; - } - function yy_r3_7($yy_subpatterns) - { - - if ($this->mbstring_overload) { - $to = mb_strlen($this->data,'latin1'); - } else { - $to = strlen($this->data); - } - preg_match("/{$this->ldel}\/?literal{$this->rdel}|<\?|<%|\?>|%>/",$this->data,$match,PREG_OFFSET_CAPTURE,$this->counter); - if (isset($match[0][1])) { - $to = $match[0][1]; - } else { - $this->compiler->trigger_template_error ("missing or misspelled literal closing tag"); - } - if ($this->mbstring_overload) { - $this->value = mb_substr($this->data,$this->counter,$to-$this->counter,'latin1'); - } else { - $this->value = substr($this->data,$this->counter,$to-$this->counter); - } - $this->token = Smarty_Internal_Templateparser::TP_LITERAL; - } - - - function yylex4() - { - $tokenMap = array ( - 1 => 0, - 2 => 1, - 4 => 0, - 5 => 0, - 6 => 0, - 7 => 0, - 8 => 0, - 9 => 0, - 10 => 0, - 11 => 0, - 12 => 0, - 13 => 3, - 17 => 0, - ); - if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) { - return false; // end of input - } - $yy_global_pattern = "/\G(".$this->ldel."\\s{1,}\/)|\G(".$this->ldel."\\s*(if|elseif|else if|while)\\s+)|\G(".$this->ldel."\\s*for\\s+)|\G(".$this->ldel."\\s*foreach(?![^\s]))|\G(".$this->ldel."\\s{1,})|\G(".$this->ldel."\/)|\G(".$this->ldel.")|\G(\")|\G(`\\$)|\G(\\$[0-9]*[a-zA-Z_]\\w*)|\G(\\$)|\G(([^\"\\\\]*?)((?:\\\\.[^\"\\\\]*?)*?)(?=(".$this->ldel."|\\$|`\\$|\")))|\G([\S\s])/iS"; - - do { - if ($this->mbstring_overload ? preg_match($yy_global_pattern, mb_substr($this->data, $this->counter,2000000000,'latin1'), $yymatches) : preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) { - $yysubmatches = $yymatches; - $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns - if (!count($yymatches)) { - throw new Exception('Error: lexing failed because a rule matched' . - ' an empty string. Input "' . substr($this->data, - $this->counter, 5) . '... state DOUBLEQUOTEDSTRING'); - } - next($yymatches); // skip global match - $this->token = key($yymatches); // token number - if ($tokenMap[$this->token]) { - // extract sub-patterns for passing to lex function - $yysubmatches = array_slice($yysubmatches, $this->token + 1, - $tokenMap[$this->token]); - } else { - $yysubmatches = array(); - } - $this->value = current($yymatches); // token value - $r = $this->{'yy_r4_' . $this->token}($yysubmatches); - if ($r === null) { - $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value)); - $this->line += substr_count($this->value, "\n"); - // accept this token - return true; - } elseif ($r === true) { - // we have changed state - // process this token in the new state - return $this->yylex(); - } elseif ($r === false) { - $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value)); - $this->line += substr_count($this->value, "\n"); - if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) { - return false; // end of input - } - // skip this token - continue; - } } else { - throw new Exception('Unexpected input at line' . $this->line . - ': ' . $this->data[$this->counter]); - } - break; - } while (true); - - } // end function - - - const DOUBLEQUOTEDSTRING = 4; - function yy_r4_1($yy_subpatterns) - { - - if ($this->smarty->auto_literal) { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } - } - function yy_r4_2($yy_subpatterns) - { - - if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->token = Smarty_Internal_Templateparser::TP_LDELIF; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } - } - function yy_r4_4($yy_subpatterns) - { - - if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->token = Smarty_Internal_Templateparser::TP_LDELFOR; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } - } - function yy_r4_5($yy_subpatterns) - { - - if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } - } - function yy_r4_6($yy_subpatterns) - { - - if ($this->smarty->auto_literal) { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->token = Smarty_Internal_Templateparser::TP_LDEL; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } - } - function yy_r4_7($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } - function yy_r4_8($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_LDEL; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } - function yy_r4_9($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_QUOTE; - $this->yypopstate(); - } - function yy_r4_10($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_BACKTICK; - $this->value = substr($this->value,0,-1); - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } - function yy_r4_11($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_DOLLARID; - } - function yy_r4_12($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } - function yy_r4_13($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } - function yy_r4_17($yy_subpatterns) - { - - if ($this->mbstring_overload) { - $to = mb_strlen($this->data,'latin1'); - } else { - $to = strlen($this->data); - } - if ($this->mbstring_overload) { - $this->value = mb_substr($this->data,$this->counter,$to-$this->counter,'latin1'); - } else { - $this->value = substr($this->data,$this->counter,$to-$this->counter); - } - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } - -} diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/sysplugins/smarty_internal_templateparser.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/sysplugins/smarty_internal_templateparser.php deleted file mode 100644 index d67be6e6f..000000000 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/sysplugins/smarty_internal_templateparser.php +++ /dev/null @@ -1,3254 +0,0 @@ -string = $s->string; - $this->metadata = $s->metadata; - } else { - $this->string = (string) $s; - if ($m instanceof TP_yyToken) { - $this->metadata = $m->metadata; - } elseif (is_array($m)) { - $this->metadata = $m; - } - } - } - - function __toString() - { - return $this->_string; - } - - function offsetExists($offset) - { - return isset($this->metadata[$offset]); - } - - function offsetGet($offset) - { - return $this->metadata[$offset]; - } - - function offsetSet($offset, $value) - { - if ($offset === null) { - if (isset($value[0])) { - $x = ($value instanceof TP_yyToken) ? - $value->metadata : $value; - $this->metadata = array_merge($this->metadata, $x); - return; - } - $offset = count($this->metadata); - } - if ($value === null) { - return; - } - if ($value instanceof TP_yyToken) { - if ($value->metadata) { - $this->metadata[$offset] = $value->metadata; - } - } elseif ($value) { - $this->metadata[$offset] = $value; - } - } - - function offsetUnset($offset) - { - unset($this->metadata[$offset]); - } -} - -class TP_yyStackEntry -{ - public $stateno; /* The state-number */ - public $major; /* The major token value. This is the code - ** number for the token at this stack level */ - public $minor; /* The user-supplied minor token value. This - ** is the value of the token */ -}; - - -#line 12 "smarty_internal_templateparser.y" -class Smarty_Internal_Templateparser#line 79 "smarty_internal_templateparser.php" -{ -#line 14 "smarty_internal_templateparser.y" - - const Err1 = "Security error: Call to private object member not allowed"; - const Err2 = "Security error: Call to dynamic object member not allowed"; - const Err3 = "PHP in template not allowed. Use SmartyBC to enable it"; - // states whether the parse was successful or not - public $successful = true; - public $retvalue = 0; - private $lex; - private $internalError = false; - private $strip = false; - - function __construct($lex, $compiler) { - $this->lex = $lex; - $this->compiler = $compiler; - $this->smarty = $this->compiler->smarty; - $this->template = $this->compiler->template; - $this->compiler->has_variable_string = false; - $this->compiler->prefix_code = array(); - $this->prefix_number = 0; - $this->block_nesting_level = 0; - if ($this->security = isset($this->smarty->security_policy)) { - $this->php_handling = $this->smarty->security_policy->php_handling; - } else { - $this->php_handling = $this->smarty->php_handling; - } - $this->is_xml = false; - $this->asp_tags = (ini_get('asp_tags') != '0'); - $this->current_buffer = $this->root_buffer = new _smarty_template_buffer($this); - } - - public static function escape_start_tag($tag_text) { - $tag = preg_replace('/\A<\?(.*)\z/', '<?\1', $tag_text, -1 , $count); //Escape tag - return $tag; - } - - public static function escape_end_tag($tag_text) { - return '?>'; - } - - public function compileVariable($variable) { - if (strpos($variable,'(') == 0) { - // not a variable variable - $var = trim($variable,'\''); - $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable($var, null, true, false)->nocache; - $this->template->properties['variables'][$var] = $this->compiler->tag_nocache|$this->compiler->nocache; - } -// return '(isset($_smarty_tpl->tpl_vars['. $variable .'])?$_smarty_tpl->tpl_vars['. $variable .']->value:$_smarty_tpl->getVariable('. $variable .')->value)'; - return '$_smarty_tpl->tpl_vars['. $variable .']->value'; - } -#line 132 "smarty_internal_templateparser.php" - - const TP_VERT = 1; - const TP_COLON = 2; - const TP_COMMENT = 3; - const TP_PHPSTARTTAG = 4; - const TP_PHPENDTAG = 5; - const TP_ASPSTARTTAG = 6; - const TP_ASPENDTAG = 7; - const TP_FAKEPHPSTARTTAG = 8; - const TP_XMLTAG = 9; - const TP_TEXT = 10; - const TP_STRIPON = 11; - const TP_STRIPOFF = 12; - const TP_LITERALSTART = 13; - const TP_LITERALEND = 14; - const TP_LITERAL = 15; - const TP_LDEL = 16; - const TP_RDEL = 17; - const TP_DOLLAR = 18; - const TP_ID = 19; - const TP_EQUAL = 20; - const TP_PTR = 21; - const TP_LDELIF = 22; - const TP_LDELFOR = 23; - const TP_SEMICOLON = 24; - const TP_INCDEC = 25; - const TP_TO = 26; - const TP_STEP = 27; - const TP_LDELFOREACH = 28; - const TP_SPACE = 29; - const TP_AS = 30; - const TP_APTR = 31; - const TP_LDELSETFILTER = 32; - const TP_SMARTYBLOCKCHILD = 33; - const TP_LDELSLASH = 34; - const TP_ATTR = 35; - const TP_INTEGER = 36; - const TP_COMMA = 37; - const TP_OPENP = 38; - const TP_CLOSEP = 39; - const TP_MATH = 40; - const TP_UNIMATH = 41; - const TP_ANDSYM = 42; - const TP_ISIN = 43; - const TP_ISDIVBY = 44; - const TP_ISNOTDIVBY = 45; - const TP_ISEVEN = 46; - const TP_ISNOTEVEN = 47; - const TP_ISEVENBY = 48; - const TP_ISNOTEVENBY = 49; - const TP_ISODD = 50; - const TP_ISNOTODD = 51; - const TP_ISODDBY = 52; - const TP_ISNOTODDBY = 53; - const TP_INSTANCEOF = 54; - const TP_QMARK = 55; - const TP_NOT = 56; - const TP_TYPECAST = 57; - const TP_HEX = 58; - const TP_DOT = 59; - const TP_SINGLEQUOTESTRING = 60; - const TP_DOUBLECOLON = 61; - const TP_AT = 62; - const TP_HATCH = 63; - const TP_OPENB = 64; - const TP_CLOSEB = 65; - const TP_EQUALS = 66; - const TP_NOTEQUALS = 67; - const TP_GREATERTHAN = 68; - const TP_LESSTHAN = 69; - const TP_GREATEREQUAL = 70; - const TP_LESSEQUAL = 71; - const TP_IDENTITY = 72; - const TP_NONEIDENTITY = 73; - const TP_MOD = 74; - const TP_LAND = 75; - const TP_LOR = 76; - const TP_LXOR = 77; - const TP_QUOTE = 78; - const TP_BACKTICK = 79; - const TP_DOLLARID = 80; - const YY_NO_ACTION = 597; - const YY_ACCEPT_ACTION = 596; - const YY_ERROR_ACTION = 595; - - const YY_SZ_ACTTAB = 2383; -static public $yy_action = array( - /* 0 */ 225, 275, 263, 276, 259, 257, 260, 390, 356, 359, - /* 10 */ 353, 193, 18, 127, 42, 317, 381, 351, 196, 350, - /* 20 */ 6, 108, 24, 98, 128, 190, 134, 318, 41, 41, - /* 30 */ 249, 329, 231, 18, 43, 43, 317, 26, 298, 50, - /* 40 */ 47, 48, 44, 10, 13, 305, 306, 12, 11, 340, - /* 50 */ 341, 40, 20, 387, 308, 307, 309, 374, 254, 248, - /* 60 */ 252, 217, 193, 385, 291, 375, 376, 377, 373, 372, - /* 70 */ 368, 367, 369, 370, 371, 378, 379, 225, 312, 255, - /* 80 */ 225, 225, 118, 2, 207, 76, 135, 596, 95, 281, - /* 90 */ 271, 264, 2, 366, 315, 386, 461, 383, 232, 294, - /* 100 */ 303, 388, 313, 389, 227, 41, 144, 225, 461, 245, - /* 110 */ 282, 43, 218, 358, 461, 144, 50, 47, 48, 44, - /* 120 */ 10, 13, 305, 306, 12, 11, 340, 341, 40, 20, - /* 130 */ 105, 177, 522, 46, 46, 41, 19, 522, 143, 297, - /* 140 */ 325, 43, 375, 376, 377, 373, 372, 368, 367, 369, - /* 150 */ 370, 371, 378, 379, 225, 312, 293, 206, 225, 141, - /* 160 */ 124, 225, 54, 119, 123, 225, 459, 38, 173, 246, - /* 170 */ 319, 315, 386, 347, 455, 232, 294, 303, 459, 313, - /* 180 */ 139, 321, 41, 31, 459, 41, 41, 2, 43, 188, - /* 190 */ 2, 43, 43, 50, 47, 48, 44, 10, 13, 305, - /* 200 */ 306, 12, 11, 340, 341, 40, 20, 225, 136, 301, - /* 210 */ 144, 194, 350, 144, 46, 202, 206, 328, 198, 375, - /* 220 */ 376, 377, 373, 372, 368, 367, 369, 370, 371, 378, - /* 230 */ 379, 21, 9, 28, 185, 41, 318, 225, 265, 271, - /* 240 */ 264, 43, 206, 27, 173, 206, 50, 47, 48, 44, - /* 250 */ 10, 13, 305, 306, 12, 11, 340, 341, 40, 20, - /* 260 */ 225, 178, 18, 212, 330, 317, 17, 32, 8, 14, - /* 270 */ 325, 267, 375, 376, 377, 373, 372, 368, 367, 369, - /* 280 */ 370, 371, 378, 379, 136, 363, 363, 207, 41, 4, - /* 290 */ 46, 5, 131, 233, 43, 25, 186, 289, 318, 50, - /* 300 */ 47, 48, 44, 10, 13, 305, 306, 12, 11, 340, - /* 310 */ 341, 40, 20, 225, 100, 161, 18, 355, 361, 317, - /* 320 */ 26, 109, 360, 346, 325, 375, 376, 377, 373, 372, - /* 330 */ 368, 367, 369, 370, 371, 378, 379, 106, 201, 172, - /* 340 */ 25, 206, 288, 25, 18, 261, 181, 317, 325, 45, - /* 350 */ 339, 129, 50, 47, 48, 44, 10, 13, 305, 306, - /* 360 */ 12, 11, 340, 341, 40, 20, 225, 104, 162, 18, - /* 370 */ 16, 205, 317, 206, 248, 238, 43, 325, 375, 376, - /* 380 */ 377, 373, 372, 368, 367, 369, 370, 371, 378, 379, - /* 390 */ 255, 354, 243, 229, 206, 342, 18, 239, 242, 241, - /* 400 */ 248, 266, 300, 330, 240, 50, 47, 48, 44, 10, - /* 410 */ 13, 305, 306, 12, 11, 340, 341, 40, 20, 225, - /* 420 */ 165, 176, 184, 18, 18, 18, 253, 215, 251, 325, - /* 430 */ 325, 375, 376, 377, 373, 372, 368, 367, 369, 370, - /* 440 */ 371, 378, 379, 304, 268, 159, 207, 207, 247, 206, - /* 450 */ 148, 41, 195, 350, 325, 27, 33, 43, 50, 47, - /* 460 */ 48, 44, 10, 13, 305, 306, 12, 11, 340, 341, - /* 470 */ 40, 20, 163, 225, 328, 199, 133, 29, 187, 23, - /* 480 */ 250, 325, 101, 225, 375, 376, 377, 373, 372, 368, - /* 490 */ 367, 369, 370, 371, 378, 379, 225, 298, 207, 334, - /* 500 */ 225, 45, 312, 103, 299, 192, 154, 364, 18, 302, - /* 510 */ 135, 317, 285, 35, 173, 203, 320, 3, 236, 6, - /* 520 */ 108, 41, 232, 294, 303, 134, 313, 43, 130, 249, - /* 530 */ 329, 231, 250, 225, 280, 50, 47, 48, 44, 10, - /* 540 */ 13, 305, 306, 12, 11, 340, 341, 40, 20, 336, - /* 550 */ 36, 166, 212, 230, 332, 228, 338, 8, 132, 330, - /* 560 */ 325, 375, 376, 377, 373, 372, 368, 367, 369, 370, - /* 570 */ 371, 378, 379, 225, 312, 345, 37, 362, 141, 312, - /* 580 */ 94, 77, 135, 156, 236, 182, 173, 135, 122, 204, - /* 590 */ 315, 386, 365, 225, 232, 294, 303, 137, 313, 232, - /* 600 */ 294, 303, 125, 313, 41, 222, 333, 180, 277, 337, - /* 610 */ 43, 225, 50, 47, 48, 44, 10, 13, 305, 306, - /* 620 */ 12, 11, 340, 341, 40, 20, 136, 335, 316, 5, - /* 630 */ 22, 197, 269, 34, 173, 148, 126, 116, 375, 376, - /* 640 */ 377, 373, 372, 368, 367, 369, 370, 371, 378, 379, - /* 650 */ 225, 312, 298, 225, 292, 141, 312, 258, 77, 135, - /* 660 */ 153, 183, 318, 301, 135, 175, 284, 315, 386, 461, - /* 670 */ 117, 232, 294, 303, 325, 313, 232, 294, 303, 382, - /* 680 */ 313, 461, 220, 110, 329, 298, 318, 461, 329, 50, - /* 690 */ 47, 48, 44, 10, 13, 305, 306, 12, 11, 340, - /* 700 */ 341, 40, 20, 225, 30, 191, 46, 189, 314, 107, - /* 710 */ 329, 329, 146, 97, 102, 375, 376, 377, 373, 372, - /* 720 */ 368, 367, 369, 370, 371, 378, 379, 298, 298, 298, - /* 730 */ 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, - /* 740 */ 329, 329, 50, 47, 48, 44, 10, 13, 305, 306, - /* 750 */ 12, 11, 340, 341, 40, 20, 225, 329, 329, 329, - /* 760 */ 329, 329, 329, 329, 329, 114, 160, 115, 375, 376, - /* 770 */ 377, 373, 372, 368, 367, 369, 370, 371, 378, 379, - /* 780 */ 298, 298, 298, 329, 329, 329, 329, 329, 329, 329, - /* 790 */ 329, 329, 329, 329, 283, 50, 47, 48, 44, 10, - /* 800 */ 13, 305, 306, 12, 11, 340, 341, 40, 20, 329, - /* 810 */ 225, 329, 329, 329, 329, 329, 329, 329, 329, 329, - /* 820 */ 329, 375, 376, 377, 373, 372, 368, 367, 369, 370, - /* 830 */ 371, 378, 379, 200, 329, 329, 329, 329, 329, 329, - /* 840 */ 329, 329, 329, 329, 329, 329, 329, 329, 329, 50, - /* 850 */ 47, 48, 44, 10, 13, 305, 306, 12, 11, 340, - /* 860 */ 341, 40, 20, 225, 329, 329, 329, 329, 329, 329, - /* 870 */ 329, 329, 329, 329, 329, 375, 376, 377, 373, 372, - /* 880 */ 368, 367, 369, 370, 371, 378, 379, 329, 329, 329, - /* 890 */ 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, - /* 900 */ 329, 329, 50, 47, 48, 44, 10, 13, 305, 306, - /* 910 */ 12, 11, 340, 341, 40, 20, 329, 329, 329, 329, - /* 920 */ 329, 329, 329, 329, 329, 329, 329, 290, 375, 376, - /* 930 */ 377, 373, 372, 368, 367, 369, 370, 371, 378, 379, - /* 940 */ 225, 312, 329, 225, 329, 141, 312, 329, 77, 135, - /* 950 */ 152, 329, 329, 329, 135, 158, 208, 315, 386, 458, - /* 960 */ 329, 232, 294, 303, 325, 313, 232, 294, 303, 329, - /* 970 */ 313, 458, 223, 329, 329, 329, 318, 458, 329, 50, - /* 980 */ 47, 48, 44, 10, 13, 305, 306, 12, 11, 340, - /* 990 */ 341, 40, 20, 225, 329, 329, 46, 329, 329, 329, - /* 1000 */ 329, 329, 329, 329, 329, 375, 376, 377, 373, 372, - /* 1010 */ 368, 367, 369, 370, 371, 378, 379, 329, 329, 329, - /* 1020 */ 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, - /* 1030 */ 329, 329, 50, 47, 48, 44, 10, 13, 305, 306, - /* 1040 */ 12, 11, 340, 341, 40, 20, 329, 329, 329, 329, - /* 1050 */ 329, 329, 329, 329, 329, 329, 329, 329, 375, 376, - /* 1060 */ 377, 373, 372, 368, 367, 369, 370, 371, 378, 379, - /* 1070 */ 329, 329, 329, 50, 47, 48, 44, 10, 13, 305, - /* 1080 */ 306, 12, 11, 340, 341, 40, 20, 329, 329, 329, - /* 1090 */ 329, 329, 329, 329, 329, 329, 329, 329, 329, 375, - /* 1100 */ 376, 377, 373, 372, 368, 367, 369, 370, 371, 378, - /* 1110 */ 379, 329, 329, 329, 329, 329, 42, 329, 145, 211, - /* 1120 */ 329, 329, 6, 108, 329, 279, 329, 312, 134, 329, - /* 1130 */ 329, 150, 249, 329, 231, 135, 235, 41, 39, 329, - /* 1140 */ 329, 52, 329, 43, 311, 329, 312, 232, 294, 303, - /* 1150 */ 147, 313, 329, 170, 135, 329, 51, 49, 331, 237, - /* 1160 */ 296, 329, 325, 106, 1, 278, 232, 294, 303, 329, - /* 1170 */ 313, 155, 329, 42, 318, 145, 216, 329, 96, 6, - /* 1180 */ 108, 18, 329, 226, 317, 134, 329, 313, 329, 249, - /* 1190 */ 329, 231, 329, 235, 41, 39, 256, 329, 52, 329, - /* 1200 */ 43, 329, 312, 329, 329, 329, 141, 329, 329, 66, - /* 1210 */ 119, 238, 329, 51, 49, 331, 237, 296, 315, 386, - /* 1220 */ 106, 1, 232, 294, 303, 329, 313, 270, 329, 329, - /* 1230 */ 42, 329, 140, 92, 329, 96, 6, 108, 18, 41, - /* 1240 */ 169, 317, 134, 329, 273, 43, 249, 329, 231, 325, - /* 1250 */ 235, 41, 39, 244, 329, 52, 41, 43, 329, 312, - /* 1260 */ 329, 318, 43, 141, 329, 329, 67, 135, 225, 329, - /* 1270 */ 51, 49, 331, 237, 296, 315, 386, 106, 1, 224, - /* 1280 */ 294, 303, 329, 313, 310, 329, 329, 42, 329, 145, - /* 1290 */ 213, 329, 96, 6, 108, 329, 41, 329, 329, 134, - /* 1300 */ 329, 323, 43, 249, 329, 231, 329, 235, 329, 39, - /* 1310 */ 329, 329, 52, 41, 329, 329, 312, 329, 329, 43, - /* 1320 */ 141, 46, 329, 86, 135, 329, 329, 51, 49, 331, - /* 1330 */ 237, 296, 315, 386, 106, 1, 232, 294, 303, 329, - /* 1340 */ 313, 274, 329, 329, 42, 329, 142, 216, 329, 96, - /* 1350 */ 6, 108, 329, 41, 329, 329, 134, 329, 348, 43, - /* 1360 */ 249, 329, 231, 329, 235, 329, 7, 329, 329, 52, - /* 1370 */ 41, 329, 329, 312, 329, 329, 43, 141, 329, 329, - /* 1380 */ 90, 135, 329, 329, 51, 49, 331, 237, 296, 315, - /* 1390 */ 386, 106, 1, 232, 294, 303, 329, 313, 295, 329, - /* 1400 */ 329, 42, 329, 138, 216, 329, 96, 6, 108, 329, - /* 1410 */ 41, 329, 329, 134, 329, 322, 43, 249, 329, 231, - /* 1420 */ 329, 235, 329, 39, 329, 329, 52, 41, 329, 329, - /* 1430 */ 312, 329, 329, 43, 141, 329, 329, 87, 135, 329, - /* 1440 */ 329, 51, 49, 331, 237, 296, 315, 386, 106, 1, - /* 1450 */ 232, 294, 303, 329, 313, 384, 329, 329, 42, 329, - /* 1460 */ 131, 216, 329, 96, 6, 108, 329, 41, 329, 329, - /* 1470 */ 134, 329, 380, 43, 249, 329, 231, 329, 235, 329, - /* 1480 */ 15, 329, 329, 52, 41, 329, 329, 312, 329, 329, - /* 1490 */ 43, 141, 329, 329, 79, 135, 329, 329, 51, 49, - /* 1500 */ 331, 237, 296, 315, 386, 106, 1, 232, 294, 303, - /* 1510 */ 329, 313, 272, 329, 329, 42, 329, 145, 210, 329, - /* 1520 */ 96, 6, 108, 329, 41, 329, 329, 134, 329, 349, - /* 1530 */ 43, 249, 329, 231, 329, 221, 329, 39, 329, 329, - /* 1540 */ 52, 41, 329, 329, 312, 329, 329, 43, 141, 329, - /* 1550 */ 329, 70, 135, 329, 329, 51, 49, 331, 237, 296, - /* 1560 */ 315, 386, 106, 1, 232, 294, 303, 329, 313, 324, - /* 1570 */ 329, 329, 42, 329, 145, 209, 329, 96, 6, 108, - /* 1580 */ 329, 41, 329, 329, 134, 329, 326, 43, 249, 329, - /* 1590 */ 231, 329, 235, 329, 39, 329, 329, 52, 41, 329, - /* 1600 */ 329, 312, 329, 329, 43, 141, 329, 329, 74, 135, - /* 1610 */ 329, 329, 51, 49, 331, 237, 296, 315, 386, 106, - /* 1620 */ 1, 232, 294, 303, 329, 313, 262, 329, 329, 42, - /* 1630 */ 329, 131, 214, 329, 96, 6, 108, 329, 41, 329, - /* 1640 */ 329, 134, 329, 327, 43, 249, 329, 231, 329, 235, - /* 1650 */ 329, 15, 329, 329, 52, 41, 329, 329, 312, 329, - /* 1660 */ 329, 43, 141, 329, 329, 53, 135, 329, 329, 51, - /* 1670 */ 49, 331, 237, 296, 315, 386, 106, 329, 232, 294, - /* 1680 */ 303, 329, 313, 286, 329, 329, 42, 329, 131, 216, - /* 1690 */ 329, 96, 6, 108, 329, 41, 329, 329, 134, 329, - /* 1700 */ 343, 43, 249, 329, 231, 329, 235, 329, 15, 329, - /* 1710 */ 329, 52, 41, 329, 329, 312, 329, 329, 43, 118, - /* 1720 */ 329, 329, 76, 135, 329, 329, 51, 49, 331, 237, - /* 1730 */ 296, 315, 386, 106, 329, 232, 294, 303, 329, 313, - /* 1740 */ 329, 329, 329, 329, 504, 329, 329, 329, 96, 329, - /* 1750 */ 357, 504, 329, 504, 504, 364, 504, 504, 329, 329, - /* 1760 */ 329, 35, 504, 329, 504, 2, 504, 6, 108, 329, - /* 1770 */ 198, 174, 329, 134, 329, 329, 329, 249, 329, 231, - /* 1780 */ 325, 504, 329, 21, 9, 329, 329, 329, 144, 329, - /* 1790 */ 329, 329, 504, 329, 312, 99, 179, 206, 141, 329, - /* 1800 */ 329, 58, 135, 329, 329, 325, 504, 329, 21, 9, - /* 1810 */ 315, 386, 329, 312, 232, 294, 303, 141, 313, 329, - /* 1820 */ 71, 135, 206, 344, 37, 362, 329, 329, 329, 315, - /* 1830 */ 386, 329, 329, 232, 294, 303, 312, 313, 329, 329, - /* 1840 */ 141, 329, 329, 72, 135, 329, 329, 312, 329, 329, - /* 1850 */ 329, 141, 315, 386, 65, 135, 232, 294, 303, 329, - /* 1860 */ 313, 329, 329, 315, 386, 329, 329, 232, 294, 303, - /* 1870 */ 329, 313, 329, 329, 312, 198, 167, 329, 141, 329, - /* 1880 */ 329, 69, 135, 329, 329, 325, 329, 329, 21, 9, - /* 1890 */ 315, 386, 329, 329, 232, 294, 303, 312, 313, 329, - /* 1900 */ 329, 141, 206, 329, 85, 135, 329, 312, 329, 329, - /* 1910 */ 329, 149, 329, 315, 386, 135, 312, 232, 294, 303, - /* 1920 */ 141, 313, 329, 81, 135, 329, 329, 232, 294, 303, - /* 1930 */ 329, 313, 315, 386, 329, 329, 232, 294, 303, 312, - /* 1940 */ 313, 329, 329, 141, 329, 329, 82, 135, 329, 329, - /* 1950 */ 312, 329, 329, 329, 141, 315, 386, 63, 135, 232, - /* 1960 */ 294, 303, 329, 313, 329, 329, 315, 386, 329, 329, - /* 1970 */ 232, 294, 303, 329, 313, 329, 312, 329, 329, 329, - /* 1980 */ 141, 329, 329, 73, 135, 329, 329, 312, 329, 329, - /* 1990 */ 329, 141, 315, 386, 83, 135, 232, 294, 303, 329, - /* 2000 */ 313, 329, 329, 315, 386, 329, 312, 232, 294, 303, - /* 2010 */ 141, 313, 329, 89, 135, 329, 329, 329, 329, 329, - /* 2020 */ 329, 329, 315, 386, 329, 312, 232, 294, 303, 111, - /* 2030 */ 313, 329, 68, 135, 329, 329, 312, 329, 329, 329, - /* 2040 */ 141, 315, 386, 62, 135, 232, 294, 303, 329, 313, - /* 2050 */ 329, 329, 315, 386, 329, 329, 232, 294, 303, 329, - /* 2060 */ 313, 329, 312, 329, 329, 329, 141, 329, 329, 61, - /* 2070 */ 135, 329, 329, 312, 329, 329, 329, 141, 315, 386, - /* 2080 */ 91, 135, 232, 294, 303, 329, 313, 329, 329, 315, - /* 2090 */ 386, 329, 312, 232, 294, 303, 141, 313, 329, 78, - /* 2100 */ 135, 329, 329, 329, 329, 329, 329, 329, 315, 386, - /* 2110 */ 329, 312, 232, 294, 303, 141, 313, 329, 66, 135, - /* 2120 */ 329, 329, 312, 329, 329, 329, 141, 315, 386, 80, - /* 2130 */ 135, 232, 294, 303, 329, 313, 329, 329, 315, 386, - /* 2140 */ 329, 329, 232, 294, 303, 329, 313, 329, 312, 329, - /* 2150 */ 329, 329, 113, 329, 329, 88, 135, 329, 329, 312, - /* 2160 */ 329, 329, 329, 112, 315, 386, 84, 135, 232, 294, - /* 2170 */ 303, 329, 313, 329, 329, 315, 386, 329, 312, 232, - /* 2180 */ 294, 303, 141, 313, 329, 57, 135, 329, 329, 329, - /* 2190 */ 329, 329, 329, 329, 315, 386, 329, 312, 232, 294, - /* 2200 */ 303, 93, 313, 329, 59, 121, 329, 329, 312, 329, - /* 2210 */ 329, 329, 141, 315, 386, 75, 135, 232, 294, 303, - /* 2220 */ 329, 313, 329, 329, 315, 386, 329, 329, 232, 294, - /* 2230 */ 303, 329, 313, 329, 312, 329, 329, 329, 141, 329, - /* 2240 */ 329, 60, 135, 329, 329, 312, 329, 329, 329, 141, - /* 2250 */ 315, 386, 64, 135, 232, 294, 303, 329, 313, 329, - /* 2260 */ 329, 315, 386, 329, 312, 232, 294, 303, 120, 313, - /* 2270 */ 329, 55, 135, 329, 329, 329, 329, 329, 329, 329, - /* 2280 */ 315, 386, 329, 312, 232, 294, 303, 93, 313, 329, - /* 2290 */ 56, 121, 225, 329, 312, 329, 198, 164, 157, 315, - /* 2300 */ 386, 329, 135, 219, 294, 303, 325, 313, 352, 21, - /* 2310 */ 9, 287, 234, 329, 232, 294, 303, 329, 313, 329, - /* 2320 */ 41, 329, 329, 206, 312, 329, 43, 329, 151, 2, - /* 2330 */ 329, 329, 135, 329, 329, 329, 329, 329, 329, 329, - /* 2340 */ 198, 168, 329, 329, 232, 294, 303, 329, 313, 329, - /* 2350 */ 325, 329, 144, 21, 9, 198, 171, 329, 329, 329, - /* 2360 */ 329, 329, 329, 329, 329, 325, 329, 206, 21, 9, - /* 2370 */ 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, - /* 2380 */ 329, 329, 206, - ); - static public $yy_lookahead = array( - /* 0 */ 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, - /* 10 */ 12, 13, 16, 98, 16, 19, 17, 17, 113, 114, - /* 20 */ 22, 23, 16, 97, 18, 19, 28, 112, 29, 29, - /* 30 */ 32, 33, 34, 16, 35, 35, 19, 20, 112, 40, - /* 40 */ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - /* 50 */ 51, 52, 53, 4, 5, 6, 7, 8, 62, 93, - /* 60 */ 94, 95, 13, 14, 15, 66, 67, 68, 69, 70, - /* 70 */ 71, 72, 73, 74, 75, 76, 77, 1, 85, 62, - /* 80 */ 1, 1, 89, 38, 117, 92, 93, 82, 83, 84, - /* 90 */ 85, 86, 38, 17, 101, 102, 17, 17, 105, 106, - /* 100 */ 107, 86, 109, 88, 59, 29, 61, 1, 29, 30, - /* 110 */ 65, 35, 119, 120, 35, 61, 40, 41, 42, 43, - /* 120 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - /* 130 */ 90, 91, 59, 54, 54, 29, 16, 64, 18, 19, - /* 140 */ 100, 35, 66, 67, 68, 69, 70, 71, 72, 73, - /* 150 */ 74, 75, 76, 77, 1, 85, 36, 117, 1, 89, - /* 160 */ 18, 1, 92, 93, 94, 1, 17, 20, 21, 20, - /* 170 */ 17, 101, 102, 17, 17, 105, 106, 107, 29, 109, - /* 180 */ 38, 17, 29, 31, 35, 29, 29, 38, 35, 90, - /* 190 */ 38, 35, 35, 40, 41, 42, 43, 44, 45, 46, - /* 200 */ 47, 48, 49, 50, 51, 52, 53, 1, 61, 111, - /* 210 */ 61, 113, 114, 61, 54, 90, 117, 118, 90, 66, - /* 220 */ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - /* 230 */ 77, 103, 104, 27, 110, 29, 112, 1, 84, 85, - /* 240 */ 86, 35, 117, 20, 21, 117, 40, 41, 42, 43, - /* 250 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - /* 260 */ 1, 91, 16, 59, 25, 19, 20, 31, 64, 16, - /* 270 */ 100, 25, 66, 67, 68, 69, 70, 71, 72, 73, - /* 280 */ 74, 75, 76, 77, 61, 85, 85, 117, 29, 37, - /* 290 */ 54, 38, 18, 19, 35, 37, 110, 39, 112, 40, - /* 300 */ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - /* 310 */ 51, 52, 53, 1, 90, 91, 16, 65, 79, 19, - /* 320 */ 20, 121, 122, 122, 100, 66, 67, 68, 69, 70, - /* 330 */ 71, 72, 73, 74, 75, 76, 77, 63, 24, 91, - /* 340 */ 37, 117, 39, 37, 16, 39, 90, 19, 100, 2, - /* 350 */ 19, 37, 40, 41, 42, 43, 44, 45, 46, 47, - /* 360 */ 48, 49, 50, 51, 52, 53, 1, 90, 91, 16, - /* 370 */ 29, 19, 19, 117, 93, 94, 35, 100, 66, 67, - /* 380 */ 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - /* 390 */ 62, 79, 96, 62, 117, 17, 16, 18, 19, 19, - /* 400 */ 93, 94, 19, 25, 39, 40, 41, 42, 43, 44, - /* 410 */ 45, 46, 47, 48, 49, 50, 51, 52, 53, 1, - /* 420 */ 91, 91, 90, 16, 16, 16, 19, 19, 19, 100, - /* 430 */ 100, 66, 67, 68, 69, 70, 71, 72, 73, 74, - /* 440 */ 75, 76, 77, 108, 29, 91, 117, 117, 30, 117, - /* 450 */ 115, 29, 113, 114, 100, 20, 96, 35, 40, 41, - /* 460 */ 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - /* 470 */ 52, 53, 91, 1, 118, 99, 18, 26, 110, 20, - /* 480 */ 2, 100, 97, 1, 66, 67, 68, 69, 70, 71, - /* 490 */ 72, 73, 74, 75, 76, 77, 1, 112, 117, 17, - /* 500 */ 1, 2, 85, 99, 19, 110, 89, 10, 16, 19, - /* 510 */ 93, 19, 17, 16, 21, 99, 17, 38, 59, 22, - /* 520 */ 23, 29, 105, 106, 107, 28, 109, 35, 18, 32, - /* 530 */ 33, 34, 2, 1, 65, 40, 41, 42, 43, 44, - /* 540 */ 45, 46, 47, 48, 49, 50, 51, 52, 53, 17, - /* 550 */ 20, 91, 59, 21, 36, 19, 19, 64, 19, 25, - /* 560 */ 100, 66, 67, 68, 69, 70, 71, 72, 73, 74, - /* 570 */ 75, 76, 77, 1, 85, 78, 79, 80, 89, 85, - /* 580 */ 19, 92, 93, 89, 59, 63, 21, 93, 19, 17, - /* 590 */ 101, 102, 17, 1, 105, 106, 107, 18, 109, 105, - /* 600 */ 106, 107, 18, 109, 29, 116, 36, 63, 19, 17, - /* 610 */ 35, 1, 40, 41, 42, 43, 44, 45, 46, 47, - /* 620 */ 48, 49, 50, 51, 52, 53, 61, 17, 108, 38, - /* 630 */ 2, 19, 39, 55, 21, 115, 18, 97, 66, 67, - /* 640 */ 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - /* 650 */ 1, 85, 112, 1, 100, 89, 85, 115, 92, 93, - /* 660 */ 89, 110, 112, 111, 93, 91, 17, 101, 102, 17, - /* 670 */ 97, 105, 106, 107, 100, 109, 105, 106, 107, 14, - /* 680 */ 109, 29, 116, 87, 123, 112, 112, 35, 123, 40, - /* 690 */ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - /* 700 */ 51, 52, 53, 1, 2, 110, 54, 110, 114, 110, - /* 710 */ 123, 123, 97, 97, 97, 66, 67, 68, 69, 70, - /* 720 */ 71, 72, 73, 74, 75, 76, 77, 112, 112, 112, - /* 730 */ 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, - /* 740 */ 123, 123, 40, 41, 42, 43, 44, 45, 46, 47, - /* 750 */ 48, 49, 50, 51, 52, 53, 1, 123, 123, 123, - /* 760 */ 123, 123, 123, 123, 123, 97, 97, 97, 66, 67, - /* 770 */ 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - /* 780 */ 112, 112, 112, 123, 123, 123, 123, 123, 123, 123, - /* 790 */ 123, 123, 123, 123, 39, 40, 41, 42, 43, 44, - /* 800 */ 45, 46, 47, 48, 49, 50, 51, 52, 53, 123, - /* 810 */ 1, 123, 123, 123, 123, 123, 123, 123, 123, 123, - /* 820 */ 123, 66, 67, 68, 69, 70, 71, 72, 73, 74, - /* 830 */ 75, 76, 77, 24, 123, 123, 123, 123, 123, 123, - /* 840 */ 123, 123, 123, 123, 123, 123, 123, 123, 123, 40, - /* 850 */ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - /* 860 */ 51, 52, 53, 1, 123, 123, 123, 123, 123, 123, - /* 870 */ 123, 123, 123, 123, 123, 66, 67, 68, 69, 70, - /* 880 */ 71, 72, 73, 74, 75, 76, 77, 123, 123, 123, - /* 890 */ 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, - /* 900 */ 123, 123, 40, 41, 42, 43, 44, 45, 46, 47, - /* 910 */ 48, 49, 50, 51, 52, 53, 123, 123, 123, 123, - /* 920 */ 123, 123, 123, 123, 123, 123, 123, 65, 66, 67, - /* 930 */ 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - /* 940 */ 1, 85, 123, 1, 123, 89, 85, 123, 92, 93, - /* 950 */ 89, 123, 123, 123, 93, 91, 17, 101, 102, 17, - /* 960 */ 123, 105, 106, 107, 100, 109, 105, 106, 107, 123, - /* 970 */ 109, 29, 116, 123, 123, 123, 112, 35, 123, 40, - /* 980 */ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - /* 990 */ 51, 52, 53, 1, 123, 123, 54, 123, 123, 123, - /* 1000 */ 123, 123, 123, 123, 123, 66, 67, 68, 69, 70, - /* 1010 */ 71, 72, 73, 74, 75, 76, 77, 123, 123, 123, - /* 1020 */ 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, - /* 1030 */ 123, 123, 40, 41, 42, 43, 44, 45, 46, 47, - /* 1040 */ 48, 49, 50, 51, 52, 53, 123, 123, 123, 123, - /* 1050 */ 123, 123, 123, 123, 123, 123, 123, 123, 66, 67, - /* 1060 */ 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - /* 1070 */ 123, 123, 123, 40, 41, 42, 43, 44, 45, 46, - /* 1080 */ 47, 48, 49, 50, 51, 52, 53, 123, 123, 123, - /* 1090 */ 123, 123, 123, 123, 123, 123, 123, 123, 123, 66, - /* 1100 */ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - /* 1110 */ 77, 123, 123, 123, 123, 123, 16, 123, 18, 19, - /* 1120 */ 123, 123, 22, 23, 123, 17, 123, 85, 28, 123, - /* 1130 */ 123, 89, 32, 33, 34, 93, 36, 29, 38, 123, - /* 1140 */ 123, 41, 123, 35, 102, 123, 85, 105, 106, 107, - /* 1150 */ 89, 109, 123, 91, 93, 123, 56, 57, 58, 59, - /* 1160 */ 60, 123, 100, 63, 64, 65, 105, 106, 107, 123, - /* 1170 */ 109, 93, 123, 16, 112, 18, 19, 123, 78, 22, - /* 1180 */ 23, 16, 123, 105, 19, 28, 123, 109, 123, 32, - /* 1190 */ 33, 34, 123, 36, 29, 38, 31, 123, 41, 123, - /* 1200 */ 35, 123, 85, 123, 123, 123, 89, 123, 123, 92, - /* 1210 */ 93, 94, 123, 56, 57, 58, 59, 60, 101, 102, - /* 1220 */ 63, 64, 105, 106, 107, 123, 109, 17, 123, 123, - /* 1230 */ 16, 123, 18, 19, 123, 78, 22, 23, 16, 29, - /* 1240 */ 91, 19, 28, 123, 17, 35, 32, 33, 34, 100, - /* 1250 */ 36, 29, 38, 31, 123, 41, 29, 35, 123, 85, - /* 1260 */ 123, 112, 35, 89, 123, 123, 92, 93, 1, 123, - /* 1270 */ 56, 57, 58, 59, 60, 101, 102, 63, 64, 105, - /* 1280 */ 106, 107, 123, 109, 17, 123, 123, 16, 123, 18, - /* 1290 */ 19, 123, 78, 22, 23, 123, 29, 123, 123, 28, - /* 1300 */ 123, 17, 35, 32, 33, 34, 123, 36, 123, 38, - /* 1310 */ 123, 123, 41, 29, 123, 123, 85, 123, 123, 35, - /* 1320 */ 89, 54, 123, 92, 93, 123, 123, 56, 57, 58, - /* 1330 */ 59, 60, 101, 102, 63, 64, 105, 106, 107, 123, - /* 1340 */ 109, 17, 123, 123, 16, 123, 18, 19, 123, 78, - /* 1350 */ 22, 23, 123, 29, 123, 123, 28, 123, 17, 35, - /* 1360 */ 32, 33, 34, 123, 36, 123, 38, 123, 123, 41, - /* 1370 */ 29, 123, 123, 85, 123, 123, 35, 89, 123, 123, - /* 1380 */ 92, 93, 123, 123, 56, 57, 58, 59, 60, 101, - /* 1390 */ 102, 63, 64, 105, 106, 107, 123, 109, 17, 123, - /* 1400 */ 123, 16, 123, 18, 19, 123, 78, 22, 23, 123, - /* 1410 */ 29, 123, 123, 28, 123, 17, 35, 32, 33, 34, - /* 1420 */ 123, 36, 123, 38, 123, 123, 41, 29, 123, 123, - /* 1430 */ 85, 123, 123, 35, 89, 123, 123, 92, 93, 123, - /* 1440 */ 123, 56, 57, 58, 59, 60, 101, 102, 63, 64, - /* 1450 */ 105, 106, 107, 123, 109, 17, 123, 123, 16, 123, - /* 1460 */ 18, 19, 123, 78, 22, 23, 123, 29, 123, 123, - /* 1470 */ 28, 123, 17, 35, 32, 33, 34, 123, 36, 123, - /* 1480 */ 38, 123, 123, 41, 29, 123, 123, 85, 123, 123, - /* 1490 */ 35, 89, 123, 123, 92, 93, 123, 123, 56, 57, - /* 1500 */ 58, 59, 60, 101, 102, 63, 64, 105, 106, 107, - /* 1510 */ 123, 109, 17, 123, 123, 16, 123, 18, 19, 123, - /* 1520 */ 78, 22, 23, 123, 29, 123, 123, 28, 123, 17, - /* 1530 */ 35, 32, 33, 34, 123, 36, 123, 38, 123, 123, - /* 1540 */ 41, 29, 123, 123, 85, 123, 123, 35, 89, 123, - /* 1550 */ 123, 92, 93, 123, 123, 56, 57, 58, 59, 60, - /* 1560 */ 101, 102, 63, 64, 105, 106, 107, 123, 109, 17, - /* 1570 */ 123, 123, 16, 123, 18, 19, 123, 78, 22, 23, - /* 1580 */ 123, 29, 123, 123, 28, 123, 17, 35, 32, 33, - /* 1590 */ 34, 123, 36, 123, 38, 123, 123, 41, 29, 123, - /* 1600 */ 123, 85, 123, 123, 35, 89, 123, 123, 92, 93, - /* 1610 */ 123, 123, 56, 57, 58, 59, 60, 101, 102, 63, - /* 1620 */ 64, 105, 106, 107, 123, 109, 17, 123, 123, 16, - /* 1630 */ 123, 18, 19, 123, 78, 22, 23, 123, 29, 123, - /* 1640 */ 123, 28, 123, 17, 35, 32, 33, 34, 123, 36, - /* 1650 */ 123, 38, 123, 123, 41, 29, 123, 123, 85, 123, - /* 1660 */ 123, 35, 89, 123, 123, 92, 93, 123, 123, 56, - /* 1670 */ 57, 58, 59, 60, 101, 102, 63, 123, 105, 106, - /* 1680 */ 107, 123, 109, 17, 123, 123, 16, 123, 18, 19, - /* 1690 */ 123, 78, 22, 23, 123, 29, 123, 123, 28, 123, - /* 1700 */ 17, 35, 32, 33, 34, 123, 36, 123, 38, 123, - /* 1710 */ 123, 41, 29, 123, 123, 85, 123, 123, 35, 89, - /* 1720 */ 123, 123, 92, 93, 123, 123, 56, 57, 58, 59, - /* 1730 */ 60, 101, 102, 63, 123, 105, 106, 107, 123, 109, - /* 1740 */ 123, 123, 123, 123, 17, 123, 123, 123, 78, 123, - /* 1750 */ 120, 24, 123, 26, 27, 10, 29, 30, 123, 123, - /* 1760 */ 123, 16, 35, 123, 37, 38, 39, 22, 23, 123, - /* 1770 */ 90, 91, 123, 28, 123, 123, 123, 32, 33, 34, - /* 1780 */ 100, 54, 123, 103, 104, 123, 123, 123, 61, 123, - /* 1790 */ 123, 123, 65, 123, 85, 90, 91, 117, 89, 123, - /* 1800 */ 123, 92, 93, 123, 123, 100, 79, 123, 103, 104, - /* 1810 */ 101, 102, 123, 85, 105, 106, 107, 89, 109, 123, - /* 1820 */ 92, 93, 117, 78, 79, 80, 123, 123, 123, 101, - /* 1830 */ 102, 123, 123, 105, 106, 107, 85, 109, 123, 123, - /* 1840 */ 89, 123, 123, 92, 93, 123, 123, 85, 123, 123, - /* 1850 */ 123, 89, 101, 102, 92, 93, 105, 106, 107, 123, - /* 1860 */ 109, 123, 123, 101, 102, 123, 123, 105, 106, 107, - /* 1870 */ 123, 109, 123, 123, 85, 90, 91, 123, 89, 123, - /* 1880 */ 123, 92, 93, 123, 123, 100, 123, 123, 103, 104, - /* 1890 */ 101, 102, 123, 123, 105, 106, 107, 85, 109, 123, - /* 1900 */ 123, 89, 117, 123, 92, 93, 123, 85, 123, 123, - /* 1910 */ 123, 89, 123, 101, 102, 93, 85, 105, 106, 107, - /* 1920 */ 89, 109, 123, 92, 93, 123, 123, 105, 106, 107, - /* 1930 */ 123, 109, 101, 102, 123, 123, 105, 106, 107, 85, - /* 1940 */ 109, 123, 123, 89, 123, 123, 92, 93, 123, 123, - /* 1950 */ 85, 123, 123, 123, 89, 101, 102, 92, 93, 105, - /* 1960 */ 106, 107, 123, 109, 123, 123, 101, 102, 123, 123, - /* 1970 */ 105, 106, 107, 123, 109, 123, 85, 123, 123, 123, - /* 1980 */ 89, 123, 123, 92, 93, 123, 123, 85, 123, 123, - /* 1990 */ 123, 89, 101, 102, 92, 93, 105, 106, 107, 123, - /* 2000 */ 109, 123, 123, 101, 102, 123, 85, 105, 106, 107, - /* 2010 */ 89, 109, 123, 92, 93, 123, 123, 123, 123, 123, - /* 2020 */ 123, 123, 101, 102, 123, 85, 105, 106, 107, 89, - /* 2030 */ 109, 123, 92, 93, 123, 123, 85, 123, 123, 123, - /* 2040 */ 89, 101, 102, 92, 93, 105, 106, 107, 123, 109, - /* 2050 */ 123, 123, 101, 102, 123, 123, 105, 106, 107, 123, - /* 2060 */ 109, 123, 85, 123, 123, 123, 89, 123, 123, 92, - /* 2070 */ 93, 123, 123, 85, 123, 123, 123, 89, 101, 102, - /* 2080 */ 92, 93, 105, 106, 107, 123, 109, 123, 123, 101, - /* 2090 */ 102, 123, 85, 105, 106, 107, 89, 109, 123, 92, - /* 2100 */ 93, 123, 123, 123, 123, 123, 123, 123, 101, 102, - /* 2110 */ 123, 85, 105, 106, 107, 89, 109, 123, 92, 93, - /* 2120 */ 123, 123, 85, 123, 123, 123, 89, 101, 102, 92, - /* 2130 */ 93, 105, 106, 107, 123, 109, 123, 123, 101, 102, - /* 2140 */ 123, 123, 105, 106, 107, 123, 109, 123, 85, 123, - /* 2150 */ 123, 123, 89, 123, 123, 92, 93, 123, 123, 85, - /* 2160 */ 123, 123, 123, 89, 101, 102, 92, 93, 105, 106, - /* 2170 */ 107, 123, 109, 123, 123, 101, 102, 123, 85, 105, - /* 2180 */ 106, 107, 89, 109, 123, 92, 93, 123, 123, 123, - /* 2190 */ 123, 123, 123, 123, 101, 102, 123, 85, 105, 106, - /* 2200 */ 107, 89, 109, 123, 92, 93, 123, 123, 85, 123, - /* 2210 */ 123, 123, 89, 101, 102, 92, 93, 105, 106, 107, - /* 2220 */ 123, 109, 123, 123, 101, 102, 123, 123, 105, 106, - /* 2230 */ 107, 123, 109, 123, 85, 123, 123, 123, 89, 123, - /* 2240 */ 123, 92, 93, 123, 123, 85, 123, 123, 123, 89, - /* 2250 */ 101, 102, 92, 93, 105, 106, 107, 123, 109, 123, - /* 2260 */ 123, 101, 102, 123, 85, 105, 106, 107, 89, 109, - /* 2270 */ 123, 92, 93, 123, 123, 123, 123, 123, 123, 123, - /* 2280 */ 101, 102, 123, 85, 105, 106, 107, 89, 109, 123, - /* 2290 */ 92, 93, 1, 123, 85, 123, 90, 91, 89, 101, - /* 2300 */ 102, 123, 93, 105, 106, 107, 100, 109, 17, 103, - /* 2310 */ 104, 102, 21, 123, 105, 106, 107, 123, 109, 123, - /* 2320 */ 29, 123, 123, 117, 85, 123, 35, 123, 89, 38, - /* 2330 */ 123, 123, 93, 123, 123, 123, 123, 123, 123, 123, - /* 2340 */ 90, 91, 123, 123, 105, 106, 107, 123, 109, 123, - /* 2350 */ 100, 123, 61, 103, 104, 90, 91, 123, 123, 123, - /* 2360 */ 123, 123, 123, 123, 123, 100, 123, 117, 103, 104, - /* 2370 */ 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, - /* 2380 */ 123, 123, 117, -); - const YY_SHIFT_USE_DFLT = -5; - const YY_SHIFT_MAX = 256; - static public $yy_shift_ofst = array( - /* 0 */ -2, 1271, 1157, 1157, 1271, 1157, 1328, 1328, 1100, 1157, - /* 10 */ 1157, 1157, 1157, 1157, 1157, 1157, 1499, 1157, 1157, 1157, - /* 20 */ 1157, 1157, 1556, 1157, 1157, 1157, 1157, 1157, 1157, 1157, - /* 30 */ 1157, 1157, 1157, 1157, 1385, 1214, 1157, 1157, 1157, 1157, - /* 40 */ 1157, 1499, 1214, 1157, 1442, 1442, 1613, 1670, 1670, 1670, - /* 50 */ 1670, 1670, 1670, 206, 153, 76, -1, 259, 259, 259, - /* 60 */ 809, 939, 755, 862, 702, 649, 365, 312, 418, 495, - /* 70 */ 572, 992, 992, 992, 992, 992, 992, 992, 992, 992, - /* 80 */ 992, 992, 992, 992, 992, 992, 992, 992, 992, 992, - /* 90 */ 1033, 1033, 2291, 1267, 106, -2, 1745, 1222, 1165, 157, - /* 100 */ 157, 492, 492, 499, 106, 106, 274, 493, 142, 497, - /* 110 */ 49, 79, 942, 652, 246, 17, 328, 300, 236, 223, - /* 120 */ 80, 147, 532, 1227, 353, 353, 353, 422, 407, 142, - /* 130 */ 353, 353, 610, 353, 341, 565, 379, 353, 380, 142, - /* 140 */ 408, 160, 409, 353, 379, 409, 353, 472, 613, 472, - /* 150 */ 472, 472, 472, 472, 472, 613, 472, -5, 1284, 1210, - /* 160 */ -4, 1108, 0, 156, 575, 1683, 1552, 1512, 1569, 1609, - /* 170 */ 1666, 1324, 1626, 6, 1495, 1398, 1381, 1341, 1438, 1455, - /* 180 */ 73, 482, 73, 204, 592, 204, 204, 204, 164, 204, - /* 190 */ 253, 204, 204, 665, 613, 613, 613, 479, 472, 347, - /* 200 */ 415, 415, 472, 347, -5, -5, -5, -5, -5, 1727, - /* 210 */ 149, 45, 120, 152, 54, 530, 54, 314, 252, 378, - /* 220 */ 306, 459, 258, 303, 239, 331, 522, 536, 469, 537, - /* 230 */ 539, 569, 534, 544, 561, 525, 518, 570, 593, 612, - /* 240 */ 578, 628, 591, 579, 510, 584, 589, 458, 435, 352, - /* 250 */ 485, 478, 451, 479, 490, 383, 618, -); - const YY_REDUCE_USE_DFLT = -96; - const YY_REDUCE_MAX = 208; - static public $yy_reduce_ofst = array( - /* 0 */ 5, -7, 489, 566, 1630, 856, 70, 1117, 1865, 1854, - /* 10 */ 1831, 1812, 1891, 1902, 1977, 1951, 1940, 1921, 1789, 1762, - /* 20 */ 1402, 1345, 1288, 1231, 1459, 1516, 1751, 1728, 1709, 1573, - /* 30 */ 1988, 2007, 2123, 2149, 2160, 2198, 2179, 1174, 2093, 2026, - /* 40 */ 2037, 2063, 2112, 2074, 1042, 2209, 1822, 2239, 1061, 861, - /* 50 */ 494, 417, 571, 2265, 2250, 2206, 1705, 1785, 1680, 1705, - /* 60 */ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, - /* 70 */ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, - /* 80 */ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, - /* 90 */ 128, 128, 277, 224, 40, 154, 200, 864, 1062, 170, - /* 100 */ 330, 574, 1149, 99, 329, 381, 1078, 98, -34, 201, - /* 110 */ 15, 125, 125, 125, -85, 124, 124, 124, 125, -95, - /* 120 */ 125, -95, 332, 354, 573, 616, 617, 460, 615, 307, - /* 130 */ 385, 540, 256, -74, 248, -95, 335, 668, 540, 281, - /* 140 */ 540, 125, 670, 669, 520, 540, 186, 125, 339, 125, - /* 150 */ 125, 125, 125, 125, 125, -95, 125, 125, 554, 554, - /* 160 */ 550, 554, 554, 554, 554, 554, 554, 554, 554, 554, - /* 170 */ 554, 554, 554, 542, 554, 554, 554, 554, 554, 554, - /* 180 */ 595, -33, 551, 552, -33, 552, 552, 552, -33, 552, - /* 190 */ 597, 552, 552, 596, 594, 594, 594, 599, -33, 356, - /* 200 */ 296, 360, -33, 356, 395, 404, 376, 416, 368, -); - static public $yyExpectedTokens = array( - /* 0 */ array(3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16, 22, 23, 28, 32, 33, 34, ), - /* 1 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 2 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 3 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 4 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 5 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 6 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 7 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 8 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 65, 78, ), - /* 9 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 10 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 11 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 12 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 13 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 14 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 15 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 16 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 17 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 18 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 19 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 20 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 21 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 22 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 23 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 24 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 25 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 26 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 27 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 28 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 29 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 30 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 31 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 32 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 33 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 34 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 35 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 36 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 37 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 38 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 39 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 40 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 41 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 42 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 43 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 44 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 45 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 46 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 78, ), - /* 47 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 78, ), - /* 48 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 78, ), - /* 49 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 78, ), - /* 50 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 78, ), - /* 51 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 78, ), - /* 52 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 78, ), - /* 53 */ array(1, 27, 29, 35, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 54 */ array(1, 17, 29, 35, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 55 */ array(1, 17, 29, 35, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 56 */ array(1, 17, 29, 35, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 57 */ array(1, 29, 35, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 58 */ array(1, 29, 35, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 59 */ array(1, 29, 35, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 60 */ array(1, 24, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 61 */ array(1, 17, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 62 */ array(1, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 63 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 64 */ array(1, 2, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 65 */ array(1, 17, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 66 */ array(1, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 67 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 79, ), - /* 68 */ array(1, 30, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 69 */ array(1, 17, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 70 */ array(1, 17, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 71 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 72 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 73 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 74 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 75 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 76 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 77 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 78 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 79 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 80 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 81 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 82 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 83 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 84 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 85 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 86 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 87 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 88 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 89 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 90 */ array(40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 91 */ array(40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 92 */ array(1, 17, 21, 29, 35, 38, 61, ), - /* 93 */ array(1, 17, 29, 35, 54, ), - /* 94 */ array(1, 29, 35, ), - /* 95 */ array(3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16, 22, 23, 28, 32, 33, 34, ), - /* 96 */ array(10, 16, 22, 23, 28, 32, 33, 34, 78, 79, 80, ), - /* 97 */ array(16, 19, 29, 31, 35, ), - /* 98 */ array(16, 19, 29, 31, 35, ), - /* 99 */ array(1, 17, 29, 35, ), - /* 100 */ array(1, 17, 29, 35, ), - /* 101 */ array(16, 19, 29, 35, ), - /* 102 */ array(16, 19, 29, 35, ), - /* 103 */ array(1, 2, 17, ), - /* 104 */ array(1, 29, 35, ), - /* 105 */ array(1, 29, 35, ), - /* 106 */ array(18, 19, 63, ), - /* 107 */ array(21, 59, 64, ), - /* 108 */ array(18, 38, ), - /* 109 */ array(10, 16, 22, 23, 28, 32, 33, 34, 78, 79, 80, ), - /* 110 */ array(4, 5, 6, 7, 8, 13, 14, 15, ), - /* 111 */ array(1, 17, 29, 30, 35, 54, ), - /* 112 */ array(1, 17, 29, 35, 54, ), - /* 113 */ array(1, 17, 29, 35, 54, ), - /* 114 */ array(16, 19, 20, 25, ), - /* 115 */ array(16, 19, 20, 62, ), - /* 116 */ array(16, 19, 62, ), - /* 117 */ array(16, 19, 20, ), - /* 118 */ array(1, 31, 54, ), - /* 119 */ array(20, 21, 61, ), - /* 120 */ array(1, 17, 54, ), - /* 121 */ array(20, 21, 61, ), - /* 122 */ array(1, 17, 21, ), - /* 123 */ array(17, 29, 35, ), - /* 124 */ array(16, 19, ), - /* 125 */ array(16, 19, ), - /* 126 */ array(16, 19, ), - /* 127 */ array(29, 35, ), - /* 128 */ array(16, 19, ), - /* 129 */ array(18, 38, ), - /* 130 */ array(16, 19, ), - /* 131 */ array(16, 19, ), - /* 132 */ array(1, 17, ), - /* 133 */ array(16, 19, ), - /* 134 */ array(29, 35, ), - /* 135 */ array(21, 61, ), - /* 136 */ array(18, 19, ), - /* 137 */ array(16, 19, ), - /* 138 */ array(16, 19, ), - /* 139 */ array(18, 38, ), - /* 140 */ array(16, 19, ), - /* 141 */ array(1, 54, ), - /* 142 */ array(16, 19, ), - /* 143 */ array(16, 19, ), - /* 144 */ array(18, 19, ), - /* 145 */ array(16, 19, ), - /* 146 */ array(16, 19, ), - /* 147 */ array(1, ), - /* 148 */ array(21, ), - /* 149 */ array(1, ), - /* 150 */ array(1, ), - /* 151 */ array(1, ), - /* 152 */ array(1, ), - /* 153 */ array(1, ), - /* 154 */ array(1, ), - /* 155 */ array(21, ), - /* 156 */ array(1, ), - /* 157 */ array(), - /* 158 */ array(17, 29, 35, ), - /* 159 */ array(17, 29, 35, ), - /* 160 */ array(16, 19, 62, ), - /* 161 */ array(17, 29, 35, ), - /* 162 */ array(17, 29, 35, ), - /* 163 */ array(17, 29, 35, ), - /* 164 */ array(17, 29, 35, ), - /* 165 */ array(17, 29, 35, ), - /* 166 */ array(17, 29, 35, ), - /* 167 */ array(17, 29, 35, ), - /* 168 */ array(17, 29, 35, ), - /* 169 */ array(17, 29, 35, ), - /* 170 */ array(17, 29, 35, ), - /* 171 */ array(17, 29, 35, ), - /* 172 */ array(17, 29, 35, ), - /* 173 */ array(16, 18, 19, ), - /* 174 */ array(17, 29, 35, ), - /* 175 */ array(17, 29, 35, ), - /* 176 */ array(17, 29, 35, ), - /* 177 */ array(17, 29, 35, ), - /* 178 */ array(17, 29, 35, ), - /* 179 */ array(17, 29, 35, ), - /* 180 */ array(59, 64, ), - /* 181 */ array(1, 17, ), - /* 182 */ array(59, 64, ), - /* 183 */ array(59, 64, ), - /* 184 */ array(1, 17, ), - /* 185 */ array(59, 64, ), - /* 186 */ array(59, 64, ), - /* 187 */ array(59, 64, ), - /* 188 */ array(1, 17, ), - /* 189 */ array(59, 64, ), - /* 190 */ array(16, 38, ), - /* 191 */ array(59, 64, ), - /* 192 */ array(59, 64, ), - /* 193 */ array(14, ), - /* 194 */ array(21, ), - /* 195 */ array(21, ), - /* 196 */ array(21, ), - /* 197 */ array(38, ), - /* 198 */ array(1, ), - /* 199 */ array(2, ), - /* 200 */ array(29, ), - /* 201 */ array(29, ), - /* 202 */ array(1, ), - /* 203 */ array(2, ), - /* 204 */ array(), - /* 205 */ array(), - /* 206 */ array(), - /* 207 */ array(), - /* 208 */ array(), - /* 209 */ array(17, 24, 26, 27, 29, 30, 35, 37, 38, 39, 54, 61, 65, 79, ), - /* 210 */ array(17, 20, 29, 35, 38, 61, ), - /* 211 */ array(38, 59, 61, 65, ), - /* 212 */ array(16, 18, 19, 36, ), - /* 213 */ array(31, 38, 61, ), - /* 214 */ array(38, 61, ), - /* 215 */ array(2, 20, ), - /* 216 */ array(38, 61, ), - /* 217 */ array(24, 37, ), - /* 218 */ array(37, 65, ), - /* 219 */ array(17, 25, ), - /* 220 */ array(37, 39, ), - /* 221 */ array(20, 59, ), - /* 222 */ array(37, 39, ), - /* 223 */ array(37, 39, ), - /* 224 */ array(25, 79, ), - /* 225 */ array(19, 62, ), - /* 226 */ array(63, ), - /* 227 */ array(19, ), - /* 228 */ array(65, ), - /* 229 */ array(19, ), - /* 230 */ array(19, ), - /* 231 */ array(19, ), - /* 232 */ array(25, ), - /* 233 */ array(63, ), - /* 234 */ array(19, ), - /* 235 */ array(59, ), - /* 236 */ array(36, ), - /* 237 */ array(36, ), - /* 238 */ array(39, ), - /* 239 */ array(19, ), - /* 240 */ array(55, ), - /* 241 */ array(2, ), - /* 242 */ array(38, ), - /* 243 */ array(18, ), - /* 244 */ array(18, ), - /* 245 */ array(18, ), - /* 246 */ array(19, ), - /* 247 */ array(18, ), - /* 248 */ array(20, ), - /* 249 */ array(19, ), - /* 250 */ array(19, ), - /* 251 */ array(2, ), - /* 252 */ array(26, ), - /* 253 */ array(38, ), - /* 254 */ array(19, ), - /* 255 */ array(19, ), - /* 256 */ array(18, ), - /* 257 */ array(), - /* 258 */ array(), - /* 259 */ array(), - /* 260 */ array(), - /* 261 */ array(), - /* 262 */ array(), - /* 263 */ array(), - /* 264 */ array(), - /* 265 */ array(), - /* 266 */ array(), - /* 267 */ array(), - /* 268 */ array(), - /* 269 */ array(), - /* 270 */ array(), - /* 271 */ array(), - /* 272 */ array(), - /* 273 */ array(), - /* 274 */ array(), - /* 275 */ array(), - /* 276 */ array(), - /* 277 */ array(), - /* 278 */ array(), - /* 279 */ array(), - /* 280 */ array(), - /* 281 */ array(), - /* 282 */ array(), - /* 283 */ array(), - /* 284 */ array(), - /* 285 */ array(), - /* 286 */ array(), - /* 287 */ array(), - /* 288 */ array(), - /* 289 */ array(), - /* 290 */ array(), - /* 291 */ array(), - /* 292 */ array(), - /* 293 */ array(), - /* 294 */ array(), - /* 295 */ array(), - /* 296 */ array(), - /* 297 */ array(), - /* 298 */ array(), - /* 299 */ array(), - /* 300 */ array(), - /* 301 */ array(), - /* 302 */ array(), - /* 303 */ array(), - /* 304 */ array(), - /* 305 */ array(), - /* 306 */ array(), - /* 307 */ array(), - /* 308 */ array(), - /* 309 */ array(), - /* 310 */ array(), - /* 311 */ array(), - /* 312 */ array(), - /* 313 */ array(), - /* 314 */ array(), - /* 315 */ array(), - /* 316 */ array(), - /* 317 */ array(), - /* 318 */ array(), - /* 319 */ array(), - /* 320 */ array(), - /* 321 */ array(), - /* 322 */ array(), - /* 323 */ array(), - /* 324 */ array(), - /* 325 */ array(), - /* 326 */ array(), - /* 327 */ array(), - /* 328 */ array(), - /* 329 */ array(), - /* 330 */ array(), - /* 331 */ array(), - /* 332 */ array(), - /* 333 */ array(), - /* 334 */ array(), - /* 335 */ array(), - /* 336 */ array(), - /* 337 */ array(), - /* 338 */ array(), - /* 339 */ array(), - /* 340 */ array(), - /* 341 */ array(), - /* 342 */ array(), - /* 343 */ array(), - /* 344 */ array(), - /* 345 */ array(), - /* 346 */ array(), - /* 347 */ array(), - /* 348 */ array(), - /* 349 */ array(), - /* 350 */ array(), - /* 351 */ array(), - /* 352 */ array(), - /* 353 */ array(), - /* 354 */ array(), - /* 355 */ array(), - /* 356 */ array(), - /* 357 */ array(), - /* 358 */ array(), - /* 359 */ array(), - /* 360 */ array(), - /* 361 */ array(), - /* 362 */ array(), - /* 363 */ array(), - /* 364 */ array(), - /* 365 */ array(), - /* 366 */ array(), - /* 367 */ array(), - /* 368 */ array(), - /* 369 */ array(), - /* 370 */ array(), - /* 371 */ array(), - /* 372 */ array(), - /* 373 */ array(), - /* 374 */ array(), - /* 375 */ array(), - /* 376 */ array(), - /* 377 */ array(), - /* 378 */ array(), - /* 379 */ array(), - /* 380 */ array(), - /* 381 */ array(), - /* 382 */ array(), - /* 383 */ array(), - /* 384 */ array(), - /* 385 */ array(), - /* 386 */ array(), - /* 387 */ array(), - /* 388 */ array(), - /* 389 */ array(), - /* 390 */ array(), -); - static public $yy_default = array( - /* 0 */ 394, 578, 549, 549, 595, 549, 595, 595, 595, 595, - /* 10 */ 595, 595, 595, 595, 595, 595, 595, 595, 595, 595, - /* 20 */ 595, 595, 595, 595, 595, 595, 595, 595, 595, 595, - /* 30 */ 595, 595, 595, 595, 595, 595, 595, 595, 595, 595, - /* 40 */ 595, 595, 595, 595, 595, 595, 595, 595, 595, 595, - /* 50 */ 595, 595, 595, 455, 595, 595, 595, 455, 455, 455, - /* 60 */ 595, 595, 595, 595, 595, 595, 595, 595, 460, 595, - /* 70 */ 595, 466, 465, 484, 547, 579, 581, 548, 580, 489, - /* 80 */ 488, 480, 479, 481, 457, 485, 462, 476, 460, 437, - /* 90 */ 492, 493, 504, 468, 455, 391, 595, 455, 455, 475, - /* 100 */ 512, 455, 455, 595, 455, 455, 595, 561, 595, 595, - /* 110 */ 595, 468, 468, 468, 595, 522, 522, 522, 468, 513, - /* 120 */ 468, 513, 595, 595, 595, 595, 595, 455, 595, 595, - /* 130 */ 595, 595, 595, 595, 455, 513, 595, 595, 595, 595, - /* 140 */ 595, 468, 595, 595, 595, 595, 522, 473, 558, 491, - /* 150 */ 478, 472, 497, 495, 496, 513, 471, 556, 595, 595, - /* 160 */ 523, 595, 595, 595, 595, 595, 595, 595, 595, 595, - /* 170 */ 595, 595, 595, 595, 595, 595, 595, 595, 595, 595, - /* 180 */ 516, 595, 518, 519, 595, 520, 540, 542, 595, 539, - /* 190 */ 522, 517, 541, 410, 562, 559, 536, 522, 475, 551, - /* 200 */ 594, 594, 512, 550, 522, 555, 555, 555, 522, 470, - /* 210 */ 504, 504, 595, 504, 490, 534, 504, 595, 595, 494, - /* 220 */ 595, 500, 595, 595, 494, 595, 595, 595, 595, 595, - /* 230 */ 595, 595, 494, 595, 595, 500, 502, 595, 595, 595, - /* 240 */ 506, 534, 560, 595, 595, 595, 595, 595, 595, 595, - /* 250 */ 595, 534, 463, 534, 595, 595, 595, 401, 543, 400, - /* 260 */ 402, 546, 445, 398, 397, 393, 464, 438, 593, 467, - /* 270 */ 435, 395, 440, 434, 439, 396, 399, 456, 531, 420, - /* 280 */ 529, 392, 528, 506, 527, 535, 444, 557, 545, 544, - /* 290 */ 530, 412, 453, 526, 505, 419, 507, 525, 532, 470, - /* 300 */ 514, 521, 524, 508, 510, 482, 483, 416, 415, 417, - /* 310 */ 418, 477, 511, 515, 538, 469, 509, 534, 533, 432, - /* 320 */ 446, 447, 443, 442, 436, 454, 433, 441, 554, 448, - /* 330 */ 498, 499, 501, 503, 452, 451, 449, 450, 552, 553, - /* 340 */ 486, 487, 589, 430, 582, 583, 584, 431, 429, 426, - /* 350 */ 537, 427, 428, 406, 587, 575, 404, 577, 576, 405, - /* 360 */ 585, 586, 588, 591, 592, 425, 424, 569, 568, 570, - /* 370 */ 571, 572, 567, 566, 414, 563, 564, 565, 573, 574, - /* 380 */ 422, 590, 407, 423, 421, 408, 474, 413, 411, 409, - /* 390 */ 403, -); - const YYNOCODE = 124; - const YYSTACKDEPTH = 100; - const YYNSTATE = 391; - const YYNRULE = 204; - const YYERRORSYMBOL = 81; - const YYERRSYMDT = 'yy0'; - const YYFALLBACK = 0; - static public $yyFallback = array( - ); - static function Trace($TraceFILE, $zTracePrompt) - { - if (!$TraceFILE) { - $zTracePrompt = 0; - } elseif (!$zTracePrompt) { - $TraceFILE = 0; - } - self::$yyTraceFILE = $TraceFILE; - self::$yyTracePrompt = $zTracePrompt; - } - - static function PrintTrace() - { - self::$yyTraceFILE = fopen('php://output', 'w'); - self::$yyTracePrompt = '
'; - } - - static public $yyTraceFILE; - static public $yyTracePrompt; - public $yyidx; /* Index of top element in stack */ - public $yyerrcnt; /* Shifts left before out of the error */ - public $yystack = array(); /* The parser's stack */ - - public $yyTokenName = array( - '$', 'VERT', 'COLON', 'COMMENT', - 'PHPSTARTTAG', 'PHPENDTAG', 'ASPSTARTTAG', 'ASPENDTAG', - 'FAKEPHPSTARTTAG', 'XMLTAG', 'TEXT', 'STRIPON', - 'STRIPOFF', 'LITERALSTART', 'LITERALEND', 'LITERAL', - 'LDEL', 'RDEL', 'DOLLAR', 'ID', - 'EQUAL', 'PTR', 'LDELIF', 'LDELFOR', - 'SEMICOLON', 'INCDEC', 'TO', 'STEP', - 'LDELFOREACH', 'SPACE', 'AS', 'APTR', - 'LDELSETFILTER', 'SMARTYBLOCKCHILD', 'LDELSLASH', 'ATTR', - 'INTEGER', 'COMMA', 'OPENP', 'CLOSEP', - 'MATH', 'UNIMATH', 'ANDSYM', 'ISIN', - 'ISDIVBY', 'ISNOTDIVBY', 'ISEVEN', 'ISNOTEVEN', - 'ISEVENBY', 'ISNOTEVENBY', 'ISODD', 'ISNOTODD', - 'ISODDBY', 'ISNOTODDBY', 'INSTANCEOF', 'QMARK', - 'NOT', 'TYPECAST', 'HEX', 'DOT', - 'SINGLEQUOTESTRING', 'DOUBLECOLON', 'AT', 'HATCH', - 'OPENB', 'CLOSEB', 'EQUALS', 'NOTEQUALS', - 'GREATERTHAN', 'LESSTHAN', 'GREATEREQUAL', 'LESSEQUAL', - 'IDENTITY', 'NONEIDENTITY', 'MOD', 'LAND', - 'LOR', 'LXOR', 'QUOTE', 'BACKTICK', - 'DOLLARID', 'error', 'start', 'template', - 'template_element', 'smartytag', 'literal', 'literal_elements', - 'literal_element', 'value', 'modifierlist', 'attributes', - 'expr', 'varindexed', 'statement', 'statements', - 'optspace', 'varvar', 'foraction', 'modparameters', - 'attribute', 'ternary', 'array', 'ifcond', - 'lop', 'variable', 'function', 'doublequoted_with_quotes', - 'static_class_access', 'object', 'arrayindex', 'indexdef', - 'varvarele', 'objectchain', 'objectelement', 'method', - 'params', 'modifier', 'modparameter', 'arrayelements', - 'arrayelement', 'doublequoted', 'doublequotedcontent', - ); - - static public $yyRuleName = array( - /* 0 */ "start ::= template", - /* 1 */ "template ::= template_element", - /* 2 */ "template ::= template template_element", - /* 3 */ "template ::=", - /* 4 */ "template_element ::= smartytag", - /* 5 */ "template_element ::= COMMENT", - /* 6 */ "template_element ::= literal", - /* 7 */ "template_element ::= PHPSTARTTAG", - /* 8 */ "template_element ::= PHPENDTAG", - /* 9 */ "template_element ::= ASPSTARTTAG", - /* 10 */ "template_element ::= ASPENDTAG", - /* 11 */ "template_element ::= FAKEPHPSTARTTAG", - /* 12 */ "template_element ::= XMLTAG", - /* 13 */ "template_element ::= TEXT", - /* 14 */ "template_element ::= STRIPON", - /* 15 */ "template_element ::= STRIPOFF", - /* 16 */ "literal ::= LITERALSTART LITERALEND", - /* 17 */ "literal ::= LITERALSTART literal_elements LITERALEND", - /* 18 */ "literal_elements ::= literal_elements literal_element", - /* 19 */ "literal_elements ::=", - /* 20 */ "literal_element ::= literal", - /* 21 */ "literal_element ::= LITERAL", - /* 22 */ "literal_element ::= PHPSTARTTAG", - /* 23 */ "literal_element ::= FAKEPHPSTARTTAG", - /* 24 */ "literal_element ::= PHPENDTAG", - /* 25 */ "literal_element ::= ASPSTARTTAG", - /* 26 */ "literal_element ::= ASPENDTAG", - /* 27 */ "smartytag ::= LDEL value RDEL", - /* 28 */ "smartytag ::= LDEL value modifierlist attributes RDEL", - /* 29 */ "smartytag ::= LDEL value attributes RDEL", - /* 30 */ "smartytag ::= LDEL expr modifierlist attributes RDEL", - /* 31 */ "smartytag ::= LDEL expr attributes RDEL", - /* 32 */ "smartytag ::= LDEL DOLLAR ID EQUAL value RDEL", - /* 33 */ "smartytag ::= LDEL DOLLAR ID EQUAL expr RDEL", - /* 34 */ "smartytag ::= LDEL DOLLAR ID EQUAL expr attributes RDEL", - /* 35 */ "smartytag ::= LDEL varindexed EQUAL expr attributes RDEL", - /* 36 */ "smartytag ::= LDEL ID attributes RDEL", - /* 37 */ "smartytag ::= LDEL ID RDEL", - /* 38 */ "smartytag ::= LDEL ID PTR ID attributes RDEL", - /* 39 */ "smartytag ::= LDEL ID modifierlist attributes RDEL", - /* 40 */ "smartytag ::= LDEL ID PTR ID modifierlist attributes RDEL", - /* 41 */ "smartytag ::= LDELIF expr RDEL", - /* 42 */ "smartytag ::= LDELIF expr attributes RDEL", - /* 43 */ "smartytag ::= LDELIF statement RDEL", - /* 44 */ "smartytag ::= LDELIF statement attributes RDEL", - /* 45 */ "smartytag ::= LDELFOR statements SEMICOLON optspace expr SEMICOLON optspace DOLLAR varvar foraction attributes RDEL", - /* 46 */ "foraction ::= EQUAL expr", - /* 47 */ "foraction ::= INCDEC", - /* 48 */ "smartytag ::= LDELFOR statement TO expr attributes RDEL", - /* 49 */ "smartytag ::= LDELFOR statement TO expr STEP expr attributes RDEL", - /* 50 */ "smartytag ::= LDELFOREACH attributes RDEL", - /* 51 */ "smartytag ::= LDELFOREACH SPACE value AS DOLLAR varvar attributes RDEL", - /* 52 */ "smartytag ::= LDELFOREACH SPACE value AS DOLLAR varvar APTR DOLLAR varvar attributes RDEL", - /* 53 */ "smartytag ::= LDELFOREACH SPACE expr AS DOLLAR varvar attributes RDEL", - /* 54 */ "smartytag ::= LDELFOREACH SPACE expr AS DOLLAR varvar APTR DOLLAR varvar attributes RDEL", - /* 55 */ "smartytag ::= LDELSETFILTER ID modparameters RDEL", - /* 56 */ "smartytag ::= LDELSETFILTER ID modparameters modifierlist RDEL", - /* 57 */ "smartytag ::= SMARTYBLOCKCHILD", - /* 58 */ "smartytag ::= LDELSLASH ID RDEL", - /* 59 */ "smartytag ::= LDELSLASH ID modifierlist RDEL", - /* 60 */ "smartytag ::= LDELSLASH ID PTR ID RDEL", - /* 61 */ "smartytag ::= LDELSLASH ID PTR ID modifierlist RDEL", - /* 62 */ "attributes ::= attributes attribute", - /* 63 */ "attributes ::= attribute", - /* 64 */ "attributes ::=", - /* 65 */ "attribute ::= SPACE ID EQUAL ID", - /* 66 */ "attribute ::= ATTR expr", - /* 67 */ "attribute ::= ATTR value", - /* 68 */ "attribute ::= SPACE ID", - /* 69 */ "attribute ::= SPACE expr", - /* 70 */ "attribute ::= SPACE value", - /* 71 */ "attribute ::= SPACE INTEGER EQUAL expr", - /* 72 */ "statements ::= statement", - /* 73 */ "statements ::= statements COMMA statement", - /* 74 */ "statement ::= DOLLAR varvar EQUAL expr", - /* 75 */ "statement ::= varindexed EQUAL expr", - /* 76 */ "statement ::= OPENP statement CLOSEP", - /* 77 */ "expr ::= value", - /* 78 */ "expr ::= ternary", - /* 79 */ "expr ::= DOLLAR ID COLON ID", - /* 80 */ "expr ::= expr MATH value", - /* 81 */ "expr ::= expr UNIMATH value", - /* 82 */ "expr ::= expr ANDSYM value", - /* 83 */ "expr ::= array", - /* 84 */ "expr ::= expr modifierlist", - /* 85 */ "expr ::= expr ifcond expr", - /* 86 */ "expr ::= expr ISIN array", - /* 87 */ "expr ::= expr ISIN value", - /* 88 */ "expr ::= expr lop expr", - /* 89 */ "expr ::= expr ISDIVBY expr", - /* 90 */ "expr ::= expr ISNOTDIVBY expr", - /* 91 */ "expr ::= expr ISEVEN", - /* 92 */ "expr ::= expr ISNOTEVEN", - /* 93 */ "expr ::= expr ISEVENBY expr", - /* 94 */ "expr ::= expr ISNOTEVENBY expr", - /* 95 */ "expr ::= expr ISODD", - /* 96 */ "expr ::= expr ISNOTODD", - /* 97 */ "expr ::= expr ISODDBY expr", - /* 98 */ "expr ::= expr ISNOTODDBY expr", - /* 99 */ "expr ::= value INSTANCEOF ID", - /* 100 */ "expr ::= value INSTANCEOF value", - /* 101 */ "ternary ::= OPENP expr CLOSEP QMARK DOLLAR ID COLON expr", - /* 102 */ "ternary ::= OPENP expr CLOSEP QMARK expr COLON expr", - /* 103 */ "value ::= variable", - /* 104 */ "value ::= UNIMATH value", - /* 105 */ "value ::= NOT value", - /* 106 */ "value ::= TYPECAST value", - /* 107 */ "value ::= variable INCDEC", - /* 108 */ "value ::= HEX", - /* 109 */ "value ::= INTEGER", - /* 110 */ "value ::= INTEGER DOT INTEGER", - /* 111 */ "value ::= INTEGER DOT", - /* 112 */ "value ::= DOT INTEGER", - /* 113 */ "value ::= ID", - /* 114 */ "value ::= function", - /* 115 */ "value ::= OPENP expr CLOSEP", - /* 116 */ "value ::= SINGLEQUOTESTRING", - /* 117 */ "value ::= doublequoted_with_quotes", - /* 118 */ "value ::= ID DOUBLECOLON static_class_access", - /* 119 */ "value ::= varindexed DOUBLECOLON static_class_access", - /* 120 */ "value ::= smartytag", - /* 121 */ "value ::= value modifierlist", - /* 122 */ "variable ::= varindexed", - /* 123 */ "variable ::= DOLLAR varvar AT ID", - /* 124 */ "variable ::= object", - /* 125 */ "variable ::= HATCH ID HATCH", - /* 126 */ "variable ::= HATCH ID HATCH arrayindex", - /* 127 */ "variable ::= HATCH variable HATCH", - /* 128 */ "variable ::= HATCH variable HATCH arrayindex", - /* 129 */ "varindexed ::= DOLLAR varvar arrayindex", - /* 130 */ "arrayindex ::= arrayindex indexdef", - /* 131 */ "arrayindex ::=", - /* 132 */ "indexdef ::= DOT DOLLAR varvar", - /* 133 */ "indexdef ::= DOT DOLLAR varvar AT ID", - /* 134 */ "indexdef ::= DOT ID", - /* 135 */ "indexdef ::= DOT INTEGER", - /* 136 */ "indexdef ::= DOT LDEL expr RDEL", - /* 137 */ "indexdef ::= OPENB ID CLOSEB", - /* 138 */ "indexdef ::= OPENB ID DOT ID CLOSEB", - /* 139 */ "indexdef ::= OPENB expr CLOSEB", - /* 140 */ "indexdef ::= OPENB CLOSEB", - /* 141 */ "varvar ::= varvarele", - /* 142 */ "varvar ::= varvar varvarele", - /* 143 */ "varvarele ::= ID", - /* 144 */ "varvarele ::= LDEL expr RDEL", - /* 145 */ "object ::= varindexed objectchain", - /* 146 */ "objectchain ::= objectelement", - /* 147 */ "objectchain ::= objectchain objectelement", - /* 148 */ "objectelement ::= PTR ID arrayindex", - /* 149 */ "objectelement ::= PTR DOLLAR varvar arrayindex", - /* 150 */ "objectelement ::= PTR LDEL expr RDEL arrayindex", - /* 151 */ "objectelement ::= PTR ID LDEL expr RDEL arrayindex", - /* 152 */ "objectelement ::= PTR method", - /* 153 */ "function ::= ID OPENP params CLOSEP", - /* 154 */ "method ::= ID OPENP params CLOSEP", - /* 155 */ "method ::= DOLLAR ID OPENP params CLOSEP", - /* 156 */ "params ::= params COMMA expr", - /* 157 */ "params ::= expr", - /* 158 */ "params ::=", - /* 159 */ "modifierlist ::= modifierlist modifier modparameters", - /* 160 */ "modifierlist ::= modifier modparameters", - /* 161 */ "modifier ::= VERT AT ID", - /* 162 */ "modifier ::= VERT ID", - /* 163 */ "modparameters ::= modparameters modparameter", - /* 164 */ "modparameters ::=", - /* 165 */ "modparameter ::= COLON value", - /* 166 */ "modparameter ::= COLON array", - /* 167 */ "static_class_access ::= method", - /* 168 */ "static_class_access ::= method objectchain", - /* 169 */ "static_class_access ::= ID", - /* 170 */ "static_class_access ::= DOLLAR ID arrayindex", - /* 171 */ "static_class_access ::= DOLLAR ID arrayindex objectchain", - /* 172 */ "ifcond ::= EQUALS", - /* 173 */ "ifcond ::= NOTEQUALS", - /* 174 */ "ifcond ::= GREATERTHAN", - /* 175 */ "ifcond ::= LESSTHAN", - /* 176 */ "ifcond ::= GREATEREQUAL", - /* 177 */ "ifcond ::= LESSEQUAL", - /* 178 */ "ifcond ::= IDENTITY", - /* 179 */ "ifcond ::= NONEIDENTITY", - /* 180 */ "ifcond ::= MOD", - /* 181 */ "lop ::= LAND", - /* 182 */ "lop ::= LOR", - /* 183 */ "lop ::= LXOR", - /* 184 */ "array ::= OPENB arrayelements CLOSEB", - /* 185 */ "arrayelements ::= arrayelement", - /* 186 */ "arrayelements ::= arrayelements COMMA arrayelement", - /* 187 */ "arrayelements ::=", - /* 188 */ "arrayelement ::= value APTR expr", - /* 189 */ "arrayelement ::= ID APTR expr", - /* 190 */ "arrayelement ::= expr", - /* 191 */ "doublequoted_with_quotes ::= QUOTE QUOTE", - /* 192 */ "doublequoted_with_quotes ::= QUOTE doublequoted QUOTE", - /* 193 */ "doublequoted ::= doublequoted doublequotedcontent", - /* 194 */ "doublequoted ::= doublequotedcontent", - /* 195 */ "doublequotedcontent ::= BACKTICK variable BACKTICK", - /* 196 */ "doublequotedcontent ::= BACKTICK expr BACKTICK", - /* 197 */ "doublequotedcontent ::= DOLLARID", - /* 198 */ "doublequotedcontent ::= LDEL variable RDEL", - /* 199 */ "doublequotedcontent ::= LDEL expr RDEL", - /* 200 */ "doublequotedcontent ::= smartytag", - /* 201 */ "doublequotedcontent ::= TEXT", - /* 202 */ "optspace ::= SPACE", - /* 203 */ "optspace ::=", - ); - - function tokenName($tokenType) - { - if ($tokenType === 0) { - return 'End of Input'; - } - if ($tokenType > 0 && $tokenType < count($this->yyTokenName)) { - return $this->yyTokenName[$tokenType]; - } else { - return "Unknown"; - } - } - - static function yy_destructor($yymajor, $yypminor) - { - switch ($yymajor) { - default: break; /* If no destructor action specified: do nothing */ - } - } - - function yy_pop_parser_stack() - { - if (!count($this->yystack)) { - return; - } - $yytos = array_pop($this->yystack); - if (self::$yyTraceFILE && $this->yyidx >= 0) { - fwrite(self::$yyTraceFILE, - self::$yyTracePrompt . 'Popping ' . $this->yyTokenName[$yytos->major] . - "\n"); - } - $yymajor = $yytos->major; - self::yy_destructor($yymajor, $yytos->minor); - $this->yyidx--; - return $yymajor; - } - - function __destruct() - { - while ($this->yystack !== Array()) { - $this->yy_pop_parser_stack(); - } - if (is_resource(self::$yyTraceFILE)) { - fclose(self::$yyTraceFILE); - } - } - - function yy_get_expected_tokens($token) - { - $state = $this->yystack[$this->yyidx]->stateno; - $expected = self::$yyExpectedTokens[$state]; - if (in_array($token, self::$yyExpectedTokens[$state], true)) { - return $expected; - } - $stack = $this->yystack; - $yyidx = $this->yyidx; - do { - $yyact = $this->yy_find_shift_action($token); - if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) { - // reduce action - $done = 0; - do { - if ($done++ == 100) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - // too much recursion prevents proper detection - // so give up - return array_unique($expected); - } - $yyruleno = $yyact - self::YYNSTATE; - $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs']; - $nextstate = $this->yy_find_reduce_action( - $this->yystack[$this->yyidx]->stateno, - self::$yyRuleInfo[$yyruleno]['lhs']); - if (isset(self::$yyExpectedTokens[$nextstate])) { - $expected = array_merge($expected, self::$yyExpectedTokens[$nextstate]); - if (in_array($token, - self::$yyExpectedTokens[$nextstate], true)) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - return array_unique($expected); - } - } - if ($nextstate < self::YYNSTATE) { - // we need to shift a non-terminal - $this->yyidx++; - $x = new TP_yyStackEntry; - $x->stateno = $nextstate; - $x->major = self::$yyRuleInfo[$yyruleno]['lhs']; - $this->yystack[$this->yyidx] = $x; - continue 2; - } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - // the last token was just ignored, we can't accept - // by ignoring input, this is in essence ignoring a - // syntax error! - return array_unique($expected); - } elseif ($nextstate === self::YY_NO_ACTION) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - // input accepted, but not shifted (I guess) - return $expected; - } else { - $yyact = $nextstate; - } - } while (true); - } - break; - } while (true); - $this->yyidx = $yyidx; - $this->yystack = $stack; - return array_unique($expected); - } - - function yy_is_expected_token($token) - { - if ($token === 0) { - return true; // 0 is not part of this - } - $state = $this->yystack[$this->yyidx]->stateno; - if (in_array($token, self::$yyExpectedTokens[$state], true)) { - return true; - } - $stack = $this->yystack; - $yyidx = $this->yyidx; - do { - $yyact = $this->yy_find_shift_action($token); - if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) { - // reduce action - $done = 0; - do { - if ($done++ == 100) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - // too much recursion prevents proper detection - // so give up - return true; - } - $yyruleno = $yyact - self::YYNSTATE; - $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs']; - $nextstate = $this->yy_find_reduce_action( - $this->yystack[$this->yyidx]->stateno, - self::$yyRuleInfo[$yyruleno]['lhs']); - if (isset(self::$yyExpectedTokens[$nextstate]) && - in_array($token, self::$yyExpectedTokens[$nextstate], true)) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - return true; - } - if ($nextstate < self::YYNSTATE) { - // we need to shift a non-terminal - $this->yyidx++; - $x = new TP_yyStackEntry; - $x->stateno = $nextstate; - $x->major = self::$yyRuleInfo[$yyruleno]['lhs']; - $this->yystack[$this->yyidx] = $x; - continue 2; - } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - if (!$token) { - // end of input: this is valid - return true; - } - // the last token was just ignored, we can't accept - // by ignoring input, this is in essence ignoring a - // syntax error! - return false; - } elseif ($nextstate === self::YY_NO_ACTION) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - // input accepted, but not shifted (I guess) - return true; - } else { - $yyact = $nextstate; - } - } while (true); - } - break; - } while (true); - $this->yyidx = $yyidx; - $this->yystack = $stack; - return true; - } - - function yy_find_shift_action($iLookAhead) - { - $stateno = $this->yystack[$this->yyidx]->stateno; - - /* if ($this->yyidx < 0) return self::YY_NO_ACTION; */ - if (!isset(self::$yy_shift_ofst[$stateno])) { - // no shift actions - return self::$yy_default[$stateno]; - } - $i = self::$yy_shift_ofst[$stateno]; - if ($i === self::YY_SHIFT_USE_DFLT) { - return self::$yy_default[$stateno]; - } - if ($iLookAhead == self::YYNOCODE) { - return self::YY_NO_ACTION; - } - $i += $iLookAhead; - if ($i < 0 || $i >= self::YY_SZ_ACTTAB || - self::$yy_lookahead[$i] != $iLookAhead) { - if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback) - && ($iFallback = self::$yyFallback[$iLookAhead]) != 0) { - if (self::$yyTraceFILE) { - fwrite(self::$yyTraceFILE, self::$yyTracePrompt . "FALLBACK " . - $this->yyTokenName[$iLookAhead] . " => " . - $this->yyTokenName[$iFallback] . "\n"); - } - return $this->yy_find_shift_action($iFallback); - } - return self::$yy_default[$stateno]; - } else { - return self::$yy_action[$i]; - } - } - - function yy_find_reduce_action($stateno, $iLookAhead) - { - /* $stateno = $this->yystack[$this->yyidx]->stateno; */ - - if (!isset(self::$yy_reduce_ofst[$stateno])) { - return self::$yy_default[$stateno]; - } - $i = self::$yy_reduce_ofst[$stateno]; - if ($i == self::YY_REDUCE_USE_DFLT) { - return self::$yy_default[$stateno]; - } - if ($iLookAhead == self::YYNOCODE) { - return self::YY_NO_ACTION; - } - $i += $iLookAhead; - if ($i < 0 || $i >= self::YY_SZ_ACTTAB || - self::$yy_lookahead[$i] != $iLookAhead) { - return self::$yy_default[$stateno]; - } else { - return self::$yy_action[$i]; - } - } - - function yy_shift($yyNewState, $yyMajor, $yypMinor) - { - $this->yyidx++; - if ($this->yyidx >= self::YYSTACKDEPTH) { - $this->yyidx--; - if (self::$yyTraceFILE) { - fprintf(self::$yyTraceFILE, "%sStack Overflow!\n", self::$yyTracePrompt); - } - while ($this->yyidx >= 0) { - $this->yy_pop_parser_stack(); - } -#line 84 "smarty_internal_templateparser.y" - - $this->internalError = true; - $this->compiler->trigger_template_error("Stack overflow in template parser"); -#line 1724 "smarty_internal_templateparser.php" - return; - } - $yytos = new TP_yyStackEntry; - $yytos->stateno = $yyNewState; - $yytos->major = $yyMajor; - $yytos->minor = $yypMinor; - array_push($this->yystack, $yytos); - if (self::$yyTraceFILE && $this->yyidx > 0) { - fprintf(self::$yyTraceFILE, "%sShift %d\n", self::$yyTracePrompt, - $yyNewState); - fprintf(self::$yyTraceFILE, "%sStack:", self::$yyTracePrompt); - for($i = 1; $i <= $this->yyidx; $i++) { - fprintf(self::$yyTraceFILE, " %s", - $this->yyTokenName[$this->yystack[$i]->major]); - } - fwrite(self::$yyTraceFILE,"\n"); - } - } - - static public $yyRuleInfo = array( - array( 'lhs' => 82, 'rhs' => 1 ), - array( 'lhs' => 83, 'rhs' => 1 ), - array( 'lhs' => 83, 'rhs' => 2 ), - array( 'lhs' => 83, 'rhs' => 0 ), - array( 'lhs' => 84, 'rhs' => 1 ), - array( 'lhs' => 84, 'rhs' => 1 ), - array( 'lhs' => 84, 'rhs' => 1 ), - array( 'lhs' => 84, 'rhs' => 1 ), - array( 'lhs' => 84, 'rhs' => 1 ), - array( 'lhs' => 84, 'rhs' => 1 ), - array( 'lhs' => 84, 'rhs' => 1 ), - array( 'lhs' => 84, 'rhs' => 1 ), - array( 'lhs' => 84, 'rhs' => 1 ), - array( 'lhs' => 84, 'rhs' => 1 ), - array( 'lhs' => 84, 'rhs' => 1 ), - array( 'lhs' => 84, 'rhs' => 1 ), - array( 'lhs' => 86, 'rhs' => 2 ), - array( 'lhs' => 86, 'rhs' => 3 ), - array( 'lhs' => 87, 'rhs' => 2 ), - array( 'lhs' => 87, 'rhs' => 0 ), - array( 'lhs' => 88, 'rhs' => 1 ), - array( 'lhs' => 88, 'rhs' => 1 ), - array( 'lhs' => 88, 'rhs' => 1 ), - array( 'lhs' => 88, 'rhs' => 1 ), - array( 'lhs' => 88, 'rhs' => 1 ), - array( 'lhs' => 88, 'rhs' => 1 ), - array( 'lhs' => 88, 'rhs' => 1 ), - array( 'lhs' => 85, 'rhs' => 3 ), - array( 'lhs' => 85, 'rhs' => 5 ), - array( 'lhs' => 85, 'rhs' => 4 ), - array( 'lhs' => 85, 'rhs' => 5 ), - array( 'lhs' => 85, 'rhs' => 4 ), - array( 'lhs' => 85, 'rhs' => 6 ), - array( 'lhs' => 85, 'rhs' => 6 ), - array( 'lhs' => 85, 'rhs' => 7 ), - array( 'lhs' => 85, 'rhs' => 6 ), - array( 'lhs' => 85, 'rhs' => 4 ), - array( 'lhs' => 85, 'rhs' => 3 ), - array( 'lhs' => 85, 'rhs' => 6 ), - array( 'lhs' => 85, 'rhs' => 5 ), - array( 'lhs' => 85, 'rhs' => 7 ), - array( 'lhs' => 85, 'rhs' => 3 ), - array( 'lhs' => 85, 'rhs' => 4 ), - array( 'lhs' => 85, 'rhs' => 3 ), - array( 'lhs' => 85, 'rhs' => 4 ), - array( 'lhs' => 85, 'rhs' => 12 ), - array( 'lhs' => 98, 'rhs' => 2 ), - array( 'lhs' => 98, 'rhs' => 1 ), - array( 'lhs' => 85, 'rhs' => 6 ), - array( 'lhs' => 85, 'rhs' => 8 ), - array( 'lhs' => 85, 'rhs' => 3 ), - array( 'lhs' => 85, 'rhs' => 8 ), - array( 'lhs' => 85, 'rhs' => 11 ), - array( 'lhs' => 85, 'rhs' => 8 ), - array( 'lhs' => 85, 'rhs' => 11 ), - array( 'lhs' => 85, 'rhs' => 4 ), - array( 'lhs' => 85, 'rhs' => 5 ), - array( 'lhs' => 85, 'rhs' => 1 ), - array( 'lhs' => 85, 'rhs' => 3 ), - array( 'lhs' => 85, 'rhs' => 4 ), - array( 'lhs' => 85, 'rhs' => 5 ), - array( 'lhs' => 85, 'rhs' => 6 ), - array( 'lhs' => 91, 'rhs' => 2 ), - array( 'lhs' => 91, 'rhs' => 1 ), - array( 'lhs' => 91, 'rhs' => 0 ), - array( 'lhs' => 100, 'rhs' => 4 ), - array( 'lhs' => 100, 'rhs' => 2 ), - array( 'lhs' => 100, 'rhs' => 2 ), - array( 'lhs' => 100, 'rhs' => 2 ), - array( 'lhs' => 100, 'rhs' => 2 ), - array( 'lhs' => 100, 'rhs' => 2 ), - array( 'lhs' => 100, 'rhs' => 4 ), - array( 'lhs' => 95, 'rhs' => 1 ), - array( 'lhs' => 95, 'rhs' => 3 ), - array( 'lhs' => 94, 'rhs' => 4 ), - array( 'lhs' => 94, 'rhs' => 3 ), - array( 'lhs' => 94, 'rhs' => 3 ), - array( 'lhs' => 92, 'rhs' => 1 ), - array( 'lhs' => 92, 'rhs' => 1 ), - array( 'lhs' => 92, 'rhs' => 4 ), - array( 'lhs' => 92, 'rhs' => 3 ), - array( 'lhs' => 92, 'rhs' => 3 ), - array( 'lhs' => 92, 'rhs' => 3 ), - array( 'lhs' => 92, 'rhs' => 1 ), - array( 'lhs' => 92, 'rhs' => 2 ), - array( 'lhs' => 92, 'rhs' => 3 ), - array( 'lhs' => 92, 'rhs' => 3 ), - array( 'lhs' => 92, 'rhs' => 3 ), - array( 'lhs' => 92, 'rhs' => 3 ), - array( 'lhs' => 92, 'rhs' => 3 ), - array( 'lhs' => 92, 'rhs' => 3 ), - array( 'lhs' => 92, 'rhs' => 2 ), - array( 'lhs' => 92, 'rhs' => 2 ), - array( 'lhs' => 92, 'rhs' => 3 ), - array( 'lhs' => 92, 'rhs' => 3 ), - array( 'lhs' => 92, 'rhs' => 2 ), - array( 'lhs' => 92, 'rhs' => 2 ), - array( 'lhs' => 92, 'rhs' => 3 ), - array( 'lhs' => 92, 'rhs' => 3 ), - array( 'lhs' => 92, 'rhs' => 3 ), - array( 'lhs' => 92, 'rhs' => 3 ), - array( 'lhs' => 101, 'rhs' => 8 ), - array( 'lhs' => 101, 'rhs' => 7 ), - array( 'lhs' => 89, 'rhs' => 1 ), - array( 'lhs' => 89, 'rhs' => 2 ), - array( 'lhs' => 89, 'rhs' => 2 ), - array( 'lhs' => 89, 'rhs' => 2 ), - array( 'lhs' => 89, 'rhs' => 2 ), - array( 'lhs' => 89, 'rhs' => 1 ), - array( 'lhs' => 89, 'rhs' => 1 ), - array( 'lhs' => 89, 'rhs' => 3 ), - array( 'lhs' => 89, 'rhs' => 2 ), - array( 'lhs' => 89, 'rhs' => 2 ), - array( 'lhs' => 89, 'rhs' => 1 ), - array( 'lhs' => 89, 'rhs' => 1 ), - array( 'lhs' => 89, 'rhs' => 3 ), - array( 'lhs' => 89, 'rhs' => 1 ), - array( 'lhs' => 89, 'rhs' => 1 ), - array( 'lhs' => 89, 'rhs' => 3 ), - array( 'lhs' => 89, 'rhs' => 3 ), - array( 'lhs' => 89, 'rhs' => 1 ), - array( 'lhs' => 89, 'rhs' => 2 ), - array( 'lhs' => 105, 'rhs' => 1 ), - array( 'lhs' => 105, 'rhs' => 4 ), - array( 'lhs' => 105, 'rhs' => 1 ), - array( 'lhs' => 105, 'rhs' => 3 ), - array( 'lhs' => 105, 'rhs' => 4 ), - array( 'lhs' => 105, 'rhs' => 3 ), - array( 'lhs' => 105, 'rhs' => 4 ), - array( 'lhs' => 93, 'rhs' => 3 ), - array( 'lhs' => 110, 'rhs' => 2 ), - array( 'lhs' => 110, 'rhs' => 0 ), - array( 'lhs' => 111, 'rhs' => 3 ), - array( 'lhs' => 111, 'rhs' => 5 ), - array( 'lhs' => 111, 'rhs' => 2 ), - array( 'lhs' => 111, 'rhs' => 2 ), - array( 'lhs' => 111, 'rhs' => 4 ), - array( 'lhs' => 111, 'rhs' => 3 ), - array( 'lhs' => 111, 'rhs' => 5 ), - array( 'lhs' => 111, 'rhs' => 3 ), - array( 'lhs' => 111, 'rhs' => 2 ), - array( 'lhs' => 97, 'rhs' => 1 ), - array( 'lhs' => 97, 'rhs' => 2 ), - array( 'lhs' => 112, 'rhs' => 1 ), - array( 'lhs' => 112, 'rhs' => 3 ), - array( 'lhs' => 109, 'rhs' => 2 ), - array( 'lhs' => 113, 'rhs' => 1 ), - array( 'lhs' => 113, 'rhs' => 2 ), - array( 'lhs' => 114, 'rhs' => 3 ), - array( 'lhs' => 114, 'rhs' => 4 ), - array( 'lhs' => 114, 'rhs' => 5 ), - array( 'lhs' => 114, 'rhs' => 6 ), - array( 'lhs' => 114, 'rhs' => 2 ), - array( 'lhs' => 106, 'rhs' => 4 ), - array( 'lhs' => 115, 'rhs' => 4 ), - array( 'lhs' => 115, 'rhs' => 5 ), - array( 'lhs' => 116, 'rhs' => 3 ), - array( 'lhs' => 116, 'rhs' => 1 ), - array( 'lhs' => 116, 'rhs' => 0 ), - array( 'lhs' => 90, 'rhs' => 3 ), - array( 'lhs' => 90, 'rhs' => 2 ), - array( 'lhs' => 117, 'rhs' => 3 ), - array( 'lhs' => 117, 'rhs' => 2 ), - array( 'lhs' => 99, 'rhs' => 2 ), - array( 'lhs' => 99, 'rhs' => 0 ), - array( 'lhs' => 118, 'rhs' => 2 ), - array( 'lhs' => 118, 'rhs' => 2 ), - array( 'lhs' => 108, 'rhs' => 1 ), - array( 'lhs' => 108, 'rhs' => 2 ), - array( 'lhs' => 108, 'rhs' => 1 ), - array( 'lhs' => 108, 'rhs' => 3 ), - array( 'lhs' => 108, 'rhs' => 4 ), - array( 'lhs' => 103, 'rhs' => 1 ), - array( 'lhs' => 103, 'rhs' => 1 ), - array( 'lhs' => 103, 'rhs' => 1 ), - array( 'lhs' => 103, 'rhs' => 1 ), - array( 'lhs' => 103, 'rhs' => 1 ), - array( 'lhs' => 103, 'rhs' => 1 ), - array( 'lhs' => 103, 'rhs' => 1 ), - array( 'lhs' => 103, 'rhs' => 1 ), - array( 'lhs' => 103, 'rhs' => 1 ), - array( 'lhs' => 104, 'rhs' => 1 ), - array( 'lhs' => 104, 'rhs' => 1 ), - array( 'lhs' => 104, 'rhs' => 1 ), - array( 'lhs' => 102, 'rhs' => 3 ), - array( 'lhs' => 119, 'rhs' => 1 ), - array( 'lhs' => 119, 'rhs' => 3 ), - array( 'lhs' => 119, 'rhs' => 0 ), - array( 'lhs' => 120, 'rhs' => 3 ), - array( 'lhs' => 120, 'rhs' => 3 ), - array( 'lhs' => 120, 'rhs' => 1 ), - array( 'lhs' => 107, 'rhs' => 2 ), - array( 'lhs' => 107, 'rhs' => 3 ), - array( 'lhs' => 121, 'rhs' => 2 ), - array( 'lhs' => 121, 'rhs' => 1 ), - array( 'lhs' => 122, 'rhs' => 3 ), - array( 'lhs' => 122, 'rhs' => 3 ), - array( 'lhs' => 122, 'rhs' => 1 ), - array( 'lhs' => 122, 'rhs' => 3 ), - array( 'lhs' => 122, 'rhs' => 3 ), - array( 'lhs' => 122, 'rhs' => 1 ), - array( 'lhs' => 122, 'rhs' => 1 ), - array( 'lhs' => 96, 'rhs' => 1 ), - array( 'lhs' => 96, 'rhs' => 0 ), - ); - - static public $yyReduceMap = array( - 0 => 0, - 1 => 1, - 2 => 1, - 4 => 4, - 5 => 5, - 6 => 6, - 7 => 7, - 8 => 8, - 9 => 9, - 10 => 10, - 11 => 11, - 12 => 12, - 13 => 13, - 14 => 14, - 15 => 15, - 16 => 16, - 19 => 16, - 203 => 16, - 17 => 17, - 76 => 17, - 18 => 18, - 104 => 18, - 106 => 18, - 107 => 18, - 130 => 18, - 168 => 18, - 20 => 20, - 21 => 20, - 47 => 20, - 69 => 20, - 70 => 20, - 77 => 20, - 78 => 20, - 83 => 20, - 103 => 20, - 108 => 20, - 109 => 20, - 114 => 20, - 116 => 20, - 117 => 20, - 124 => 20, - 141 => 20, - 167 => 20, - 169 => 20, - 185 => 20, - 190 => 20, - 202 => 20, - 22 => 22, - 23 => 22, - 24 => 24, - 25 => 25, - 26 => 26, - 27 => 27, - 28 => 28, - 29 => 29, - 31 => 29, - 30 => 30, - 32 => 32, - 33 => 32, - 34 => 34, - 35 => 35, - 36 => 36, - 37 => 37, - 38 => 38, - 39 => 39, - 40 => 40, - 41 => 41, - 42 => 42, - 44 => 42, - 43 => 43, - 45 => 45, - 46 => 46, - 48 => 48, - 49 => 49, - 50 => 50, - 51 => 51, - 52 => 52, - 53 => 53, - 54 => 54, - 55 => 55, - 56 => 56, - 57 => 57, - 58 => 58, - 59 => 59, - 60 => 60, - 61 => 61, - 62 => 62, - 63 => 63, - 72 => 63, - 157 => 63, - 161 => 63, - 165 => 63, - 166 => 63, - 64 => 64, - 158 => 64, - 164 => 64, - 65 => 65, - 66 => 66, - 67 => 66, - 68 => 68, - 71 => 71, - 73 => 73, - 74 => 74, - 75 => 74, - 79 => 79, - 80 => 80, - 81 => 80, - 82 => 80, - 84 => 84, - 121 => 84, - 85 => 85, - 88 => 85, - 99 => 85, - 86 => 86, - 87 => 87, - 89 => 89, - 90 => 90, - 91 => 91, - 96 => 91, - 92 => 92, - 95 => 92, - 93 => 93, - 98 => 93, - 94 => 94, - 97 => 94, - 100 => 100, - 101 => 101, - 102 => 102, - 105 => 105, - 110 => 110, - 111 => 111, - 112 => 112, - 113 => 113, - 115 => 115, - 118 => 118, - 119 => 119, - 120 => 120, - 122 => 122, - 123 => 123, - 125 => 125, - 126 => 126, - 127 => 127, - 128 => 128, - 129 => 129, - 131 => 131, - 187 => 131, - 132 => 132, - 133 => 133, - 134 => 134, - 135 => 135, - 136 => 136, - 139 => 136, - 137 => 137, - 138 => 138, - 140 => 140, - 142 => 142, - 143 => 143, - 144 => 144, - 145 => 145, - 146 => 146, - 147 => 147, - 148 => 148, - 149 => 149, - 150 => 150, - 151 => 151, - 152 => 152, - 153 => 153, - 154 => 154, - 155 => 155, - 156 => 156, - 159 => 159, - 160 => 160, - 162 => 162, - 163 => 163, - 170 => 170, - 171 => 171, - 172 => 172, - 173 => 173, - 174 => 174, - 175 => 175, - 176 => 176, - 177 => 177, - 178 => 178, - 179 => 179, - 180 => 180, - 181 => 181, - 182 => 182, - 183 => 183, - 184 => 184, - 186 => 186, - 188 => 188, - 189 => 189, - 191 => 191, - 192 => 192, - 193 => 193, - 194 => 194, - 195 => 195, - 196 => 195, - 198 => 195, - 197 => 197, - 199 => 199, - 200 => 200, - 201 => 201, - ); -#line 95 "smarty_internal_templateparser.y" - function yy_r0(){ - $this->_retvalue = $this->root_buffer->to_smarty_php(); - } -#line 2160 "smarty_internal_templateparser.php" -#line 103 "smarty_internal_templateparser.y" - function yy_r1(){ - $this->current_buffer->append_subtree($this->yystack[$this->yyidx + 0]->minor); - } -#line 2165 "smarty_internal_templateparser.php" -#line 119 "smarty_internal_templateparser.y" - function yy_r4(){ - if ($this->compiler->has_code) { - $tmp =''; foreach ($this->compiler->prefix_code as $code) {$tmp.=$code;} $this->compiler->prefix_code=array(); - $this->_retvalue = new _smarty_tag($this, $this->compiler->processNocacheCode($tmp.$this->yystack[$this->yyidx + 0]->minor,true)); - } else { - $this->_retvalue = new _smarty_tag($this, $this->yystack[$this->yyidx + 0]->minor); - } - $this->compiler->has_variable_string = false; - $this->block_nesting_level = count($this->compiler->_tag_stack); - } -#line 2177 "smarty_internal_templateparser.php" -#line 131 "smarty_internal_templateparser.y" - function yy_r5(){ - $this->_retvalue = new _smarty_tag($this, ''); - } -#line 2182 "smarty_internal_templateparser.php" -#line 136 "smarty_internal_templateparser.y" - function yy_r6(){ - $this->_retvalue = new _smarty_text($this, $this->yystack[$this->yyidx + 0]->minor); - } -#line 2187 "smarty_internal_templateparser.php" -#line 141 "smarty_internal_templateparser.y" - function yy_r7(){ - if ($this->php_handling == Smarty::PHP_PASSTHRU) { - $this->_retvalue = new _smarty_text($this, self::escape_start_tag($this->yystack[$this->yyidx + 0]->minor)); - } elseif ($this->php_handling == Smarty::PHP_QUOTE) { - $this->_retvalue = new _smarty_text($this, htmlspecialchars($this->yystack[$this->yyidx + 0]->minor, ENT_QUOTES)); - } elseif ($this->php_handling == Smarty::PHP_ALLOW) { - if (!($this->smarty instanceof SmartyBC)) { - $this->compiler->trigger_template_error (self::Err3); - } - $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode('php_handling == Smarty::PHP_REMOVE) { - $this->_retvalue = new _smarty_text($this, ''); - } - } -#line 2203 "smarty_internal_templateparser.php" -#line 157 "smarty_internal_templateparser.y" - function yy_r8(){ - if ($this->is_xml) { - $this->compiler->tag_nocache = true; - $this->is_xml = false; - $save = $this->template->has_nocache_code; - $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode("';?>\n", $this->compiler, true)); - $this->template->has_nocache_code = $save; - } elseif ($this->php_handling == Smarty::PHP_PASSTHRU) { - $this->_retvalue = new _smarty_text($this, '?>'); - } elseif ($this->php_handling == Smarty::PHP_QUOTE) { - $this->_retvalue = new _smarty_text($this, htmlspecialchars('?>', ENT_QUOTES)); - } elseif ($this->php_handling == Smarty::PHP_ALLOW) { - $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode('?>', true)); - } elseif ($this->php_handling == Smarty::PHP_REMOVE) { - $this->_retvalue = new _smarty_text($this, ''); - } - } -#line 2222 "smarty_internal_templateparser.php" -#line 176 "smarty_internal_templateparser.y" - function yy_r9(){ - if ($this->php_handling == Smarty::PHP_PASSTHRU) { - $this->_retvalue = new _smarty_text($this, '<%'); - } elseif ($this->php_handling == Smarty::PHP_QUOTE) { - $this->_retvalue = new _smarty_text($this, htmlspecialchars($this->yystack[$this->yyidx + 0]->minor, ENT_QUOTES)); - } elseif ($this->php_handling == Smarty::PHP_ALLOW) { - if ($this->asp_tags) { - if (!($this->smarty instanceof SmartyBC)) { - $this->compiler->trigger_template_error (self::Err3); - } - $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode('<%', true)); - } else { - $this->_retvalue = new _smarty_text($this, '<%'); - } - } elseif ($this->php_handling == Smarty::PHP_REMOVE) { - if ($this->asp_tags) { - $this->_retvalue = new _smarty_text($this, ''); - } else { - $this->_retvalue = new _smarty_text($this, '<%'); - } - } - } -#line 2246 "smarty_internal_templateparser.php" -#line 200 "smarty_internal_templateparser.y" - function yy_r10(){ - if ($this->php_handling == Smarty::PHP_PASSTHRU) { - $this->_retvalue = new _smarty_text($this, '%>'); - } elseif ($this->php_handling == Smarty::PHP_QUOTE) { - $this->_retvalue = new _smarty_text($this, htmlspecialchars('%>', ENT_QUOTES)); - } elseif ($this->php_handling == Smarty::PHP_ALLOW) { - if ($this->asp_tags) { - $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode('%>', true)); - } else { - $this->_retvalue = new _smarty_text($this, '%>'); - } - } elseif ($this->php_handling == Smarty::PHP_REMOVE) { - if ($this->asp_tags) { - $this->_retvalue = new _smarty_text($this, ''); - } else { - $this->_retvalue = new _smarty_text($this, '%>'); - } - } - } -#line 2267 "smarty_internal_templateparser.php" -#line 220 "smarty_internal_templateparser.y" - function yy_r11(){ - if ($this->strip) { - $this->_retvalue = new _smarty_text($this, preg_replace('![\t ]*[\r\n]+[\t ]*!', '', self::escape_start_tag($this->yystack[$this->yyidx + 0]->minor))); - } else { - $this->_retvalue = new _smarty_text($this, self::escape_start_tag($this->yystack[$this->yyidx + 0]->minor)); - } - } -#line 2276 "smarty_internal_templateparser.php" -#line 229 "smarty_internal_templateparser.y" - function yy_r12(){ - $this->compiler->tag_nocache = true; - $this->is_xml = true; - $save = $this->template->has_nocache_code; - $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode("", $this->compiler, true)); - $this->template->has_nocache_code = $save; - } -#line 2285 "smarty_internal_templateparser.php" -#line 238 "smarty_internal_templateparser.y" - function yy_r13(){ - if ($this->strip) { - $this->_retvalue = new _smarty_text($this, preg_replace('![\t ]*[\r\n]+[\t ]*!', '', $this->yystack[$this->yyidx + 0]->minor)); - } else { - $this->_retvalue = new _smarty_text($this, $this->yystack[$this->yyidx + 0]->minor); - } - } -#line 2294 "smarty_internal_templateparser.php" -#line 247 "smarty_internal_templateparser.y" - function yy_r14(){ - $this->strip = true; - $this->_retvalue = new _smarty_text($this, ''); - } -#line 2300 "smarty_internal_templateparser.php" -#line 252 "smarty_internal_templateparser.y" - function yy_r15(){ - $this->strip = false; - $this->_retvalue = new _smarty_text($this, ''); - } -#line 2306 "smarty_internal_templateparser.php" -#line 258 "smarty_internal_templateparser.y" - function yy_r16(){ - $this->_retvalue = ''; - } -#line 2311 "smarty_internal_templateparser.php" -#line 262 "smarty_internal_templateparser.y" - function yy_r17(){ - $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; - } -#line 2316 "smarty_internal_templateparser.php" -#line 266 "smarty_internal_templateparser.y" - function yy_r18(){ - $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; - } -#line 2321 "smarty_internal_templateparser.php" -#line 274 "smarty_internal_templateparser.y" - function yy_r20(){ - $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; - } -#line 2326 "smarty_internal_templateparser.php" -#line 282 "smarty_internal_templateparser.y" - function yy_r22(){ - $this->_retvalue = self::escape_start_tag($this->yystack[$this->yyidx + 0]->minor); - } -#line 2331 "smarty_internal_templateparser.php" -#line 290 "smarty_internal_templateparser.y" - function yy_r24(){ - $this->_retvalue = self::escape_end_tag($this->yystack[$this->yyidx + 0]->minor); - } -#line 2336 "smarty_internal_templateparser.php" -#line 294 "smarty_internal_templateparser.y" - function yy_r25(){ - $this->_retvalue = '<%'; - } -#line 2341 "smarty_internal_templateparser.php" -#line 298 "smarty_internal_templateparser.y" - function yy_r26(){ - $this->_retvalue = '%>'; - } -#line 2346 "smarty_internal_templateparser.php" -#line 307 "smarty_internal_templateparser.y" - function yy_r27(){ - $this->_retvalue = $this->compiler->compileTag('private_print_expression',array(),array('value'=>$this->yystack[$this->yyidx + -1]->minor)); - } -#line 2351 "smarty_internal_templateparser.php" -#line 311 "smarty_internal_templateparser.y" - function yy_r28(){ - $this->_retvalue = $this->compiler->compileTag('private_print_expression',$this->yystack[$this->yyidx + -1]->minor,array('value'=>$this->yystack[$this->yyidx + -3]->minor, 'modifierlist'=>$this->yystack[$this->yyidx + -2]->minor)); - } -#line 2356 "smarty_internal_templateparser.php" -#line 315 "smarty_internal_templateparser.y" - function yy_r29(){ - $this->_retvalue = $this->compiler->compileTag('private_print_expression',$this->yystack[$this->yyidx + -1]->minor,array('value'=>$this->yystack[$this->yyidx + -2]->minor)); - } -#line 2361 "smarty_internal_templateparser.php" -#line 319 "smarty_internal_templateparser.y" - function yy_r30(){ - $this->_retvalue = $this->compiler->compileTag('private_print_expression',$this->yystack[$this->yyidx + -1]->minor,array('value'=>$this->yystack[$this->yyidx + -3]->minor,'modifierlist'=>$this->yystack[$this->yyidx + -2]->minor)); - } -#line 2366 "smarty_internal_templateparser.php" -#line 332 "smarty_internal_templateparser.y" - function yy_r32(){ - $this->_retvalue = $this->compiler->compileTag('assign',array(array('value'=>$this->yystack[$this->yyidx + -1]->minor),array('var'=>"'".$this->yystack[$this->yyidx + -3]->minor."'"))); - } -#line 2371 "smarty_internal_templateparser.php" -#line 340 "smarty_internal_templateparser.y" - function yy_r34(){ - $this->_retvalue = $this->compiler->compileTag('assign',array_merge(array(array('value'=>$this->yystack[$this->yyidx + -2]->minor),array('var'=>"'".$this->yystack[$this->yyidx + -4]->minor."'")),$this->yystack[$this->yyidx + -1]->minor)); - } -#line 2376 "smarty_internal_templateparser.php" -#line 344 "smarty_internal_templateparser.y" - function yy_r35(){ - $this->_retvalue = $this->compiler->compileTag('assign',array_merge(array(array('value'=>$this->yystack[$this->yyidx + -2]->minor),array('var'=>$this->yystack[$this->yyidx + -4]->minor['var'])),$this->yystack[$this->yyidx + -1]->minor),array('smarty_internal_index'=>$this->yystack[$this->yyidx + -4]->minor['smarty_internal_index'])); - } -#line 2381 "smarty_internal_templateparser.php" -#line 349 "smarty_internal_templateparser.y" - function yy_r36(){ - $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -2]->minor,$this->yystack[$this->yyidx + -1]->minor); - } -#line 2386 "smarty_internal_templateparser.php" -#line 353 "smarty_internal_templateparser.y" - function yy_r37(){ - $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -1]->minor,array()); - } -#line 2391 "smarty_internal_templateparser.php" -#line 358 "smarty_internal_templateparser.y" - function yy_r38(){ - $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -4]->minor,$this->yystack[$this->yyidx + -1]->minor,array('object_methode'=>$this->yystack[$this->yyidx + -2]->minor)); - } -#line 2396 "smarty_internal_templateparser.php" -#line 363 "smarty_internal_templateparser.y" - function yy_r39(){ - $this->_retvalue = ''.$this->compiler->compileTag($this->yystack[$this->yyidx + -3]->minor,$this->yystack[$this->yyidx + -1]->minor).'_retvalue .= $this->compiler->compileTag('private_modifier',array(),array('modifierlist'=>$this->yystack[$this->yyidx + -2]->minor,'value'=>'ob_get_clean()')).'?>'; - } -#line 2402 "smarty_internal_templateparser.php" -#line 369 "smarty_internal_templateparser.y" - function yy_r40(){ - $this->_retvalue = ''.$this->compiler->compileTag($this->yystack[$this->yyidx + -5]->minor,$this->yystack[$this->yyidx + -1]->minor,array('object_methode'=>$this->yystack[$this->yyidx + -3]->minor)).'_retvalue .= $this->compiler->compileTag('private_modifier',array(),array('modifierlist'=>$this->yystack[$this->yyidx + -2]->minor,'value'=>'ob_get_clean()')).'?>'; - } -#line 2408 "smarty_internal_templateparser.php" -#line 375 "smarty_internal_templateparser.y" - function yy_r41(){ - $tag = trim(substr($this->yystack[$this->yyidx + -2]->minor,$this->lex->ldel_length)); - $this->_retvalue = $this->compiler->compileTag(($tag == 'else if')? 'elseif' : $tag,array(),array('if condition'=>$this->yystack[$this->yyidx + -1]->minor)); - } -#line 2414 "smarty_internal_templateparser.php" -#line 380 "smarty_internal_templateparser.y" - function yy_r42(){ - $tag = trim(substr($this->yystack[$this->yyidx + -3]->minor,$this->lex->ldel_length)); - $this->_retvalue = $this->compiler->compileTag(($tag == 'else if')? 'elseif' : $tag,$this->yystack[$this->yyidx + -1]->minor,array('if condition'=>$this->yystack[$this->yyidx + -2]->minor)); - } -#line 2420 "smarty_internal_templateparser.php" -#line 385 "smarty_internal_templateparser.y" - function yy_r43(){ - $tag = trim(substr($this->yystack[$this->yyidx + -2]->minor,$this->lex->ldel_length)); - $this->_retvalue = $this->compiler->compileTag(($tag == 'else if')? 'elseif' : $tag,array(),array('if condition'=>$this->yystack[$this->yyidx + -1]->minor)); - } -#line 2426 "smarty_internal_templateparser.php" -#line 396 "smarty_internal_templateparser.y" - function yy_r45(){ - $this->_retvalue = $this->compiler->compileTag('for',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('start'=>$this->yystack[$this->yyidx + -10]->minor),array('ifexp'=>$this->yystack[$this->yyidx + -7]->minor),array('var'=>$this->yystack[$this->yyidx + -3]->minor),array('step'=>$this->yystack[$this->yyidx + -2]->minor))),1); - } -#line 2431 "smarty_internal_templateparser.php" -#line 400 "smarty_internal_templateparser.y" - function yy_r46(){ - $this->_retvalue = '='.$this->yystack[$this->yyidx + 0]->minor; - } -#line 2436 "smarty_internal_templateparser.php" -#line 408 "smarty_internal_templateparser.y" - function yy_r48(){ - $this->_retvalue = $this->compiler->compileTag('for',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('start'=>$this->yystack[$this->yyidx + -4]->minor),array('to'=>$this->yystack[$this->yyidx + -2]->minor))),0); - } -#line 2441 "smarty_internal_templateparser.php" -#line 412 "smarty_internal_templateparser.y" - function yy_r49(){ - $this->_retvalue = $this->compiler->compileTag('for',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('start'=>$this->yystack[$this->yyidx + -6]->minor),array('to'=>$this->yystack[$this->yyidx + -4]->minor),array('step'=>$this->yystack[$this->yyidx + -2]->minor))),0); - } -#line 2446 "smarty_internal_templateparser.php" -#line 417 "smarty_internal_templateparser.y" - function yy_r50(){ - $this->_retvalue = $this->compiler->compileTag('foreach',$this->yystack[$this->yyidx + -1]->minor); - } -#line 2451 "smarty_internal_templateparser.php" -#line 422 "smarty_internal_templateparser.y" - function yy_r51(){ - $this->_retvalue = $this->compiler->compileTag('foreach',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('from'=>$this->yystack[$this->yyidx + -5]->minor),array('item'=>$this->yystack[$this->yyidx + -2]->minor)))); - } -#line 2456 "smarty_internal_templateparser.php" -#line 426 "smarty_internal_templateparser.y" - function yy_r52(){ - $this->_retvalue = $this->compiler->compileTag('foreach',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('from'=>$this->yystack[$this->yyidx + -8]->minor),array('item'=>$this->yystack[$this->yyidx + -2]->minor),array('key'=>$this->yystack[$this->yyidx + -5]->minor)))); - } -#line 2461 "smarty_internal_templateparser.php" -#line 430 "smarty_internal_templateparser.y" - function yy_r53(){ - $this->_retvalue = $this->compiler->compileTag('foreach',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('from'=>$this->yystack[$this->yyidx + -5]->minor),array('item'=>$this->yystack[$this->yyidx + -2]->minor)))); - } -#line 2466 "smarty_internal_templateparser.php" -#line 434 "smarty_internal_templateparser.y" - function yy_r54(){ - $this->_retvalue = $this->compiler->compileTag('foreach',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('from'=>$this->yystack[$this->yyidx + -8]->minor),array('item'=>$this->yystack[$this->yyidx + -2]->minor),array('key'=>$this->yystack[$this->yyidx + -5]->minor)))); - } -#line 2471 "smarty_internal_templateparser.php" -#line 439 "smarty_internal_templateparser.y" - function yy_r55(){ - $this->_retvalue = $this->compiler->compileTag('setfilter',array(),array('modifier_list'=>array(array_merge(array($this->yystack[$this->yyidx + -2]->minor),$this->yystack[$this->yyidx + -1]->minor)))); - } -#line 2476 "smarty_internal_templateparser.php" -#line 443 "smarty_internal_templateparser.y" - function yy_r56(){ - $this->_retvalue = $this->compiler->compileTag('setfilter',array(),array('modifier_list'=>array_merge(array(array_merge(array($this->yystack[$this->yyidx + -3]->minor),$this->yystack[$this->yyidx + -2]->minor)),$this->yystack[$this->yyidx + -1]->minor))); - } -#line 2481 "smarty_internal_templateparser.php" -#line 448 "smarty_internal_templateparser.y" - function yy_r57(){ - $this->_retvalue = SMARTY_INTERNAL_COMPILE_BLOCK::compileChildBlock($this->compiler); - } -#line 2486 "smarty_internal_templateparser.php" -#line 454 "smarty_internal_templateparser.y" - function yy_r58(){ - $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -1]->minor.'close',array()); - } -#line 2491 "smarty_internal_templateparser.php" -#line 458 "smarty_internal_templateparser.y" - function yy_r59(){ - $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -2]->minor.'close',array(),array('modifier_list'=>$this->yystack[$this->yyidx + -1]->minor)); - } -#line 2496 "smarty_internal_templateparser.php" -#line 463 "smarty_internal_templateparser.y" - function yy_r60(){ - $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -3]->minor.'close',array(),array('object_methode'=>$this->yystack[$this->yyidx + -1]->minor)); - } -#line 2501 "smarty_internal_templateparser.php" -#line 467 "smarty_internal_templateparser.y" - function yy_r61(){ - $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -4]->minor.'close',array(),array('object_methode'=>$this->yystack[$this->yyidx + -2]->minor, 'modifier_list'=>$this->yystack[$this->yyidx + -1]->minor)); - } -#line 2506 "smarty_internal_templateparser.php" -#line 475 "smarty_internal_templateparser.y" - function yy_r62(){ - $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; - $this->_retvalue[] = $this->yystack[$this->yyidx + 0]->minor; - } -#line 2512 "smarty_internal_templateparser.php" -#line 481 "smarty_internal_templateparser.y" - function yy_r63(){ - $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor); - } -#line 2517 "smarty_internal_templateparser.php" -#line 486 "smarty_internal_templateparser.y" - function yy_r64(){ - $this->_retvalue = array(); - } -#line 2522 "smarty_internal_templateparser.php" -#line 491 "smarty_internal_templateparser.y" - function yy_r65(){ - if (preg_match('~^true$~i', $this->yystack[$this->yyidx + 0]->minor)) { - $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>'true'); - } elseif (preg_match('~^false$~i', $this->yystack[$this->yyidx + 0]->minor)) { - $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>'false'); - } elseif (preg_match('~^null$~i', $this->yystack[$this->yyidx + 0]->minor)) { - $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>'null'); - } else { - $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>"'".$this->yystack[$this->yyidx + 0]->minor."'"); - } - } -#line 2535 "smarty_internal_templateparser.php" -#line 503 "smarty_internal_templateparser.y" - function yy_r66(){ - $this->_retvalue = array(trim($this->yystack[$this->yyidx + -1]->minor," =\n\r\t")=>$this->yystack[$this->yyidx + 0]->minor); - } -#line 2540 "smarty_internal_templateparser.php" -#line 511 "smarty_internal_templateparser.y" - function yy_r68(){ - $this->_retvalue = "'".$this->yystack[$this->yyidx + 0]->minor."'"; - } -#line 2545 "smarty_internal_templateparser.php" -#line 523 "smarty_internal_templateparser.y" - function yy_r71(){ - $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>$this->yystack[$this->yyidx + 0]->minor); - } -#line 2550 "smarty_internal_templateparser.php" -#line 536 "smarty_internal_templateparser.y" - function yy_r73(){ - $this->yystack[$this->yyidx + -2]->minor[]=$this->yystack[$this->yyidx + 0]->minor; - $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor; - } -#line 2556 "smarty_internal_templateparser.php" -#line 541 "smarty_internal_templateparser.y" - function yy_r74(){ - $this->_retvalue = array('var' => $this->yystack[$this->yyidx + -2]->minor, 'value'=>$this->yystack[$this->yyidx + 0]->minor); - } -#line 2561 "smarty_internal_templateparser.php" -#line 569 "smarty_internal_templateparser.y" - function yy_r79(){ - $this->_retvalue = '$_smarty_tpl->getStreamVariable(\''. $this->yystack[$this->yyidx + -2]->minor .'://'. $this->yystack[$this->yyidx + 0]->minor . '\')'; - } -#line 2566 "smarty_internal_templateparser.php" -#line 574 "smarty_internal_templateparser.y" - function yy_r80(){ - $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor . trim($this->yystack[$this->yyidx + -1]->minor) . $this->yystack[$this->yyidx + 0]->minor; - } -#line 2571 "smarty_internal_templateparser.php" -#line 593 "smarty_internal_templateparser.y" - function yy_r84(){ - $this->_retvalue = $this->compiler->compileTag('private_modifier',array(),array('value'=>$this->yystack[$this->yyidx + -1]->minor,'modifierlist'=>$this->yystack[$this->yyidx + 0]->minor)); - } -#line 2576 "smarty_internal_templateparser.php" -#line 599 "smarty_internal_templateparser.y" - function yy_r85(){ - $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; - } -#line 2581 "smarty_internal_templateparser.php" -#line 603 "smarty_internal_templateparser.y" - function yy_r86(){ - $this->_retvalue = 'in_array('.$this->yystack[$this->yyidx + -2]->minor.','.$this->yystack[$this->yyidx + 0]->minor.')'; - } -#line 2586 "smarty_internal_templateparser.php" -#line 607 "smarty_internal_templateparser.y" - function yy_r87(){ - $this->_retvalue = 'in_array('.$this->yystack[$this->yyidx + -2]->minor.',(array)'.$this->yystack[$this->yyidx + 0]->minor.')'; - } -#line 2591 "smarty_internal_templateparser.php" -#line 615 "smarty_internal_templateparser.y" - function yy_r89(){ - $this->_retvalue = '!('.$this->yystack[$this->yyidx + -2]->minor.' % '.$this->yystack[$this->yyidx + 0]->minor.')'; - } -#line 2596 "smarty_internal_templateparser.php" -#line 619 "smarty_internal_templateparser.y" - function yy_r90(){ - $this->_retvalue = '('.$this->yystack[$this->yyidx + -2]->minor.' % '.$this->yystack[$this->yyidx + 0]->minor.')'; - } -#line 2601 "smarty_internal_templateparser.php" -#line 623 "smarty_internal_templateparser.y" - function yy_r91(){ - $this->_retvalue = '!(1 & '.$this->yystack[$this->yyidx + -1]->minor.')'; - } -#line 2606 "smarty_internal_templateparser.php" -#line 627 "smarty_internal_templateparser.y" - function yy_r92(){ - $this->_retvalue = '(1 & '.$this->yystack[$this->yyidx + -1]->minor.')'; - } -#line 2611 "smarty_internal_templateparser.php" -#line 631 "smarty_internal_templateparser.y" - function yy_r93(){ - $this->_retvalue = '!(1 & '.$this->yystack[$this->yyidx + -2]->minor.' / '.$this->yystack[$this->yyidx + 0]->minor.')'; - } -#line 2616 "smarty_internal_templateparser.php" -#line 635 "smarty_internal_templateparser.y" - function yy_r94(){ - $this->_retvalue = '(1 & '.$this->yystack[$this->yyidx + -2]->minor.' / '.$this->yystack[$this->yyidx + 0]->minor.')'; - } -#line 2621 "smarty_internal_templateparser.php" -#line 659 "smarty_internal_templateparser.y" - function yy_r100(){ - $this->prefix_number++; - $this->compiler->prefix_code[] = 'prefix_number.'='.$this->yystack[$this->yyidx + 0]->minor.';?>'; - $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.'$_tmp'.$this->prefix_number; - } -#line 2628 "smarty_internal_templateparser.php" -#line 668 "smarty_internal_templateparser.y" - function yy_r101(){ - $this->_retvalue = $this->yystack[$this->yyidx + -6]->minor.' ? '. $this->compileVariable("'".$this->yystack[$this->yyidx + -2]->minor."'") . ' : '.$this->yystack[$this->yyidx + 0]->minor; - } -#line 2633 "smarty_internal_templateparser.php" -#line 672 "smarty_internal_templateparser.y" - function yy_r102(){ - $this->_retvalue = $this->yystack[$this->yyidx + -5]->minor.' ? '.$this->yystack[$this->yyidx + -2]->minor.' : '.$this->yystack[$this->yyidx + 0]->minor; - } -#line 2638 "smarty_internal_templateparser.php" -#line 687 "smarty_internal_templateparser.y" - function yy_r105(){ - $this->_retvalue = '!'.$this->yystack[$this->yyidx + 0]->minor; - } -#line 2643 "smarty_internal_templateparser.php" -#line 708 "smarty_internal_templateparser.y" - function yy_r110(){ - $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'.'.$this->yystack[$this->yyidx + 0]->minor; - } -#line 2648 "smarty_internal_templateparser.php" -#line 712 "smarty_internal_templateparser.y" - function yy_r111(){ - $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.'.'; - } -#line 2653 "smarty_internal_templateparser.php" -#line 716 "smarty_internal_templateparser.y" - function yy_r112(){ - $this->_retvalue = '.'.$this->yystack[$this->yyidx + 0]->minor; - } -#line 2658 "smarty_internal_templateparser.php" -#line 721 "smarty_internal_templateparser.y" - function yy_r113(){ - if (preg_match('~^true$~i', $this->yystack[$this->yyidx + 0]->minor)) { - $this->_retvalue = 'true'; - } elseif (preg_match('~^false$~i', $this->yystack[$this->yyidx + 0]->minor)) { - $this->_retvalue = 'false'; - } elseif (preg_match('~^null$~i', $this->yystack[$this->yyidx + 0]->minor)) { - $this->_retvalue = 'null'; - } else { - $this->_retvalue = "'".$this->yystack[$this->yyidx + 0]->minor."'"; - } - } -#line 2671 "smarty_internal_templateparser.php" -#line 739 "smarty_internal_templateparser.y" - function yy_r115(){ - $this->_retvalue = "(". $this->yystack[$this->yyidx + -1]->minor .")"; - } -#line 2676 "smarty_internal_templateparser.php" -#line 754 "smarty_internal_templateparser.y" - function yy_r118(){ - if (!$this->security || isset($this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor]) || $this->smarty->security_policy->isTrustedStaticClass($this->yystack[$this->yyidx + -2]->minor, $this->compiler)) { - if (isset($this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor])) { - $this->_retvalue = $this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor].'::'.$this->yystack[$this->yyidx + 0]->minor; - } else { - $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'::'.$this->yystack[$this->yyidx + 0]->minor; - } - } else { - $this->compiler->trigger_template_error ("static class '".$this->yystack[$this->yyidx + -2]->minor."' is undefined or not allowed by security setting"); - } - } -#line 2689 "smarty_internal_templateparser.php" -#line 766 "smarty_internal_templateparser.y" - function yy_r119(){ - if ($this->yystack[$this->yyidx + -2]->minor['var'] == '\'smarty\'') { - $this->_retvalue = $this->compiler->compileTag('private_special_variable',array(),$this->yystack[$this->yyidx + -2]->minor['smarty_internal_index']).'::'.$this->yystack[$this->yyidx + 0]->minor; - } else { - $this->_retvalue = $this->compileVariable($this->yystack[$this->yyidx + -2]->minor['var']).$this->yystack[$this->yyidx + -2]->minor['smarty_internal_index'].'::'.$this->yystack[$this->yyidx + 0]->minor; - } - } -#line 2698 "smarty_internal_templateparser.php" -#line 775 "smarty_internal_templateparser.y" - function yy_r120(){ - $this->prefix_number++; - $this->compiler->prefix_code[] = ''.$this->yystack[$this->yyidx + 0]->minor.'prefix_number.'=ob_get_clean();?>'; - $this->_retvalue = '$_tmp'.$this->prefix_number; - } -#line 2705 "smarty_internal_templateparser.php" -#line 790 "smarty_internal_templateparser.y" - function yy_r122(){ - if ($this->yystack[$this->yyidx + 0]->minor['var'] == '\'smarty\'') { - $smarty_var = $this->compiler->compileTag('private_special_variable',array(),$this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']); - $this->_retvalue = $smarty_var; - } else { - // used for array reset,next,prev,end,current - $this->last_variable = $this->yystack[$this->yyidx + 0]->minor['var']; - $this->last_index = $this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']; - $this->_retvalue = $this->compileVariable($this->yystack[$this->yyidx + 0]->minor['var']).$this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']; - } - } -#line 2718 "smarty_internal_templateparser.php" -#line 803 "smarty_internal_templateparser.y" - function yy_r123(){ - $this->_retvalue = '$_smarty_tpl->tpl_vars['. $this->yystack[$this->yyidx + -2]->minor .']->'.$this->yystack[$this->yyidx + 0]->minor; - } -#line 2723 "smarty_internal_templateparser.php" -#line 813 "smarty_internal_templateparser.y" - function yy_r125(){ - $this->_retvalue = '$_smarty_tpl->getConfigVariable(\''. $this->yystack[$this->yyidx + -1]->minor .'\')'; - } -#line 2728 "smarty_internal_templateparser.php" -#line 817 "smarty_internal_templateparser.y" - function yy_r126(){ - $this->_retvalue = '(is_array($tmp = $_smarty_tpl->getConfigVariable(\''. $this->yystack[$this->yyidx + -2]->minor .'\')) ? $tmp'.$this->yystack[$this->yyidx + 0]->minor.' :null)'; - } -#line 2733 "smarty_internal_templateparser.php" -#line 821 "smarty_internal_templateparser.y" - function yy_r127(){ - $this->_retvalue = '$_smarty_tpl->getConfigVariable('. $this->yystack[$this->yyidx + -1]->minor .')'; - } -#line 2738 "smarty_internal_templateparser.php" -#line 825 "smarty_internal_templateparser.y" - function yy_r128(){ - $this->_retvalue = '(is_array($tmp = $_smarty_tpl->getConfigVariable('. $this->yystack[$this->yyidx + -2]->minor .')) ? $tmp'.$this->yystack[$this->yyidx + 0]->minor.' : null)'; - } -#line 2743 "smarty_internal_templateparser.php" -#line 829 "smarty_internal_templateparser.y" - function yy_r129(){ - $this->_retvalue = array('var'=>$this->yystack[$this->yyidx + -1]->minor, 'smarty_internal_index'=>$this->yystack[$this->yyidx + 0]->minor); - } -#line 2748 "smarty_internal_templateparser.php" -#line 842 "smarty_internal_templateparser.y" - function yy_r131(){ - return; - } -#line 2753 "smarty_internal_templateparser.php" -#line 848 "smarty_internal_templateparser.y" - function yy_r132(){ - $this->_retvalue = '['.$this->compileVariable($this->yystack[$this->yyidx + 0]->minor).']'; - } -#line 2758 "smarty_internal_templateparser.php" -#line 852 "smarty_internal_templateparser.y" - function yy_r133(){ - $this->_retvalue = '['.$this->compileVariable($this->yystack[$this->yyidx + -2]->minor).'->'.$this->yystack[$this->yyidx + 0]->minor.']'; - } -#line 2763 "smarty_internal_templateparser.php" -#line 856 "smarty_internal_templateparser.y" - function yy_r134(){ - $this->_retvalue = "['". $this->yystack[$this->yyidx + 0]->minor ."']"; - } -#line 2768 "smarty_internal_templateparser.php" -#line 860 "smarty_internal_templateparser.y" - function yy_r135(){ - $this->_retvalue = "[". $this->yystack[$this->yyidx + 0]->minor ."]"; - } -#line 2773 "smarty_internal_templateparser.php" -#line 864 "smarty_internal_templateparser.y" - function yy_r136(){ - $this->_retvalue = "[". $this->yystack[$this->yyidx + -1]->minor ."]"; - } -#line 2778 "smarty_internal_templateparser.php" -#line 869 "smarty_internal_templateparser.y" - function yy_r137(){ - $this->_retvalue = '['.$this->compiler->compileTag('private_special_variable',array(),'[\'section\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\'][\'index\']').']'; - } -#line 2783 "smarty_internal_templateparser.php" -#line 873 "smarty_internal_templateparser.y" - function yy_r138(){ - $this->_retvalue = '['.$this->compiler->compileTag('private_special_variable',array(),'[\'section\'][\''.$this->yystack[$this->yyidx + -3]->minor.'\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\']').']'; - } -#line 2788 "smarty_internal_templateparser.php" -#line 883 "smarty_internal_templateparser.y" - function yy_r140(){ - $this->_retvalue = '[]'; - } -#line 2793 "smarty_internal_templateparser.php" -#line 896 "smarty_internal_templateparser.y" - function yy_r142(){ - $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.'.'.$this->yystack[$this->yyidx + 0]->minor; - } -#line 2798 "smarty_internal_templateparser.php" -#line 901 "smarty_internal_templateparser.y" - function yy_r143(){ - $this->_retvalue = '\''.$this->yystack[$this->yyidx + 0]->minor.'\''; - } -#line 2803 "smarty_internal_templateparser.php" -#line 906 "smarty_internal_templateparser.y" - function yy_r144(){ - $this->_retvalue = '('.$this->yystack[$this->yyidx + -1]->minor.')'; - } -#line 2808 "smarty_internal_templateparser.php" -#line 913 "smarty_internal_templateparser.y" - function yy_r145(){ - if ($this->yystack[$this->yyidx + -1]->minor['var'] == '\'smarty\'') { - $this->_retvalue = $this->compiler->compileTag('private_special_variable',array(),$this->yystack[$this->yyidx + -1]->minor['smarty_internal_index']).$this->yystack[$this->yyidx + 0]->minor; - } else { - $this->_retvalue = $this->compileVariable($this->yystack[$this->yyidx + -1]->minor['var']).$this->yystack[$this->yyidx + -1]->minor['smarty_internal_index'].$this->yystack[$this->yyidx + 0]->minor; - } - } -#line 2817 "smarty_internal_templateparser.php" -#line 922 "smarty_internal_templateparser.y" - function yy_r146(){ - $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; - } -#line 2822 "smarty_internal_templateparser.php" -#line 927 "smarty_internal_templateparser.y" - function yy_r147(){ - $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; - } -#line 2827 "smarty_internal_templateparser.php" -#line 932 "smarty_internal_templateparser.y" - function yy_r148(){ - if ($this->security && substr($this->yystack[$this->yyidx + -1]->minor,0,1) == '_') { - $this->compiler->trigger_template_error (self::Err1); - } - $this->_retvalue = '->'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; - } -#line 2835 "smarty_internal_templateparser.php" -#line 939 "smarty_internal_templateparser.y" - function yy_r149(){ - if ($this->security) { - $this->compiler->trigger_template_error (self::Err2); - } - $this->_retvalue = '->{'.$this->compileVariable($this->yystack[$this->yyidx + -1]->minor).$this->yystack[$this->yyidx + 0]->minor.'}'; - } -#line 2843 "smarty_internal_templateparser.php" -#line 946 "smarty_internal_templateparser.y" - function yy_r150(){ - if ($this->security) { - $this->compiler->trigger_template_error (self::Err2); - } - $this->_retvalue = '->{'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; - } -#line 2851 "smarty_internal_templateparser.php" -#line 953 "smarty_internal_templateparser.y" - function yy_r151(){ - if ($this->security) { - $this->compiler->trigger_template_error (self::Err2); - } - $this->_retvalue = '->{\''.$this->yystack[$this->yyidx + -4]->minor.'\'.'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; - } -#line 2859 "smarty_internal_templateparser.php" -#line 961 "smarty_internal_templateparser.y" - function yy_r152(){ - $this->_retvalue = '->'.$this->yystack[$this->yyidx + 0]->minor; - } -#line 2864 "smarty_internal_templateparser.php" -#line 969 "smarty_internal_templateparser.y" - function yy_r153(){ - if (!$this->security || $this->smarty->security_policy->isTrustedPhpFunction($this->yystack[$this->yyidx + -3]->minor, $this->compiler)) { - if (strcasecmp($this->yystack[$this->yyidx + -3]->minor,'isset') === 0 || strcasecmp($this->yystack[$this->yyidx + -3]->minor,'empty') === 0 || strcasecmp($this->yystack[$this->yyidx + -3]->minor,'array') === 0 || is_callable($this->yystack[$this->yyidx + -3]->minor)) { - $func_name = strtolower($this->yystack[$this->yyidx + -3]->minor); - if ($func_name == 'isset') { - if (count($this->yystack[$this->yyidx + -1]->minor) == 0) { - $this->compiler->trigger_template_error ('Illegal number of paramer in "isset()"'); - } - $par = implode(',',$this->yystack[$this->yyidx + -1]->minor); - if (strncasecmp($par,'$_smarty_tpl->getConfigVariable',strlen('$_smarty_tpl->getConfigVariable')) === 0) { - $this->prefix_number++; - $this->compiler->prefix_code[] = 'prefix_number.'='.str_replace(')',', false)',$par).';?>'; - $isset_par = '$_tmp'.$this->prefix_number; - } else { - $isset_par=str_replace("')->value","',null,true,false)->value",$par); - } - $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . "(". $isset_par .")"; - } elseif (in_array($func_name,array('empty','reset','current','end','prev','next'))){ - if (count($this->yystack[$this->yyidx + -1]->minor) != 1) { - $this->compiler->trigger_template_error ('Illegal number of paramer in "empty()"'); - } - if ($func_name == 'empty') { - $this->_retvalue = $func_name.'('.str_replace("')->value","',null,true,false)->value",$this->yystack[$this->yyidx + -1]->minor[0]).')'; - } else { - $this->_retvalue = $func_name.'('.$this->yystack[$this->yyidx + -1]->minor[0].')'; - } - } else { - $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . "(". implode(',',$this->yystack[$this->yyidx + -1]->minor) .")"; - } - } else { - $this->compiler->trigger_template_error ("unknown function \"" . $this->yystack[$this->yyidx + -3]->minor . "\""); - } - } - } -#line 2900 "smarty_internal_templateparser.php" -#line 1007 "smarty_internal_templateparser.y" - function yy_r154(){ - if ($this->security && substr($this->yystack[$this->yyidx + -3]->minor,0,1) == '_') { - $this->compiler->trigger_template_error (self::Err1); - } - $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . "(". implode(',',$this->yystack[$this->yyidx + -1]->minor) .")"; - } -#line 2908 "smarty_internal_templateparser.php" -#line 1014 "smarty_internal_templateparser.y" - function yy_r155(){ - if ($this->security) { - $this->compiler->trigger_template_error (self::Err2); - } - $this->prefix_number++; - $this->compiler->prefix_code[] = 'prefix_number.'='.$this->compileVariable("'".$this->yystack[$this->yyidx + -3]->minor."'").';?>'; - $this->_retvalue = '$_tmp'.$this->prefix_number.'('. implode(',',$this->yystack[$this->yyidx + -1]->minor) .')'; - } -#line 2918 "smarty_internal_templateparser.php" -#line 1025 "smarty_internal_templateparser.y" - function yy_r156(){ - $this->_retvalue = array_merge($this->yystack[$this->yyidx + -2]->minor,array($this->yystack[$this->yyidx + 0]->minor)); - } -#line 2923 "smarty_internal_templateparser.php" -#line 1042 "smarty_internal_templateparser.y" - function yy_r159(){ - $this->_retvalue = array_merge($this->yystack[$this->yyidx + -2]->minor,array(array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor))); - } -#line 2928 "smarty_internal_templateparser.php" -#line 1046 "smarty_internal_templateparser.y" - function yy_r160(){ - $this->_retvalue = array(array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor)); - } -#line 2933 "smarty_internal_templateparser.php" -#line 1054 "smarty_internal_templateparser.y" - function yy_r162(){ - $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor); - } -#line 2938 "smarty_internal_templateparser.php" -#line 1062 "smarty_internal_templateparser.y" - function yy_r163(){ - $this->_retvalue = array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor); - } -#line 2943 "smarty_internal_templateparser.php" -#line 1096 "smarty_internal_templateparser.y" - function yy_r170(){ - $this->_retvalue = '$'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; - } -#line 2948 "smarty_internal_templateparser.php" -#line 1101 "smarty_internal_templateparser.y" - function yy_r171(){ - $this->_retvalue = '$'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; - } -#line 2953 "smarty_internal_templateparser.php" -#line 1107 "smarty_internal_templateparser.y" - function yy_r172(){ - $this->_retvalue = '=='; - } -#line 2958 "smarty_internal_templateparser.php" -#line 1111 "smarty_internal_templateparser.y" - function yy_r173(){ - $this->_retvalue = '!='; - } -#line 2963 "smarty_internal_templateparser.php" -#line 1115 "smarty_internal_templateparser.y" - function yy_r174(){ - $this->_retvalue = '>'; - } -#line 2968 "smarty_internal_templateparser.php" -#line 1119 "smarty_internal_templateparser.y" - function yy_r175(){ - $this->_retvalue = '<'; - } -#line 2973 "smarty_internal_templateparser.php" -#line 1123 "smarty_internal_templateparser.y" - function yy_r176(){ - $this->_retvalue = '>='; - } -#line 2978 "smarty_internal_templateparser.php" -#line 1127 "smarty_internal_templateparser.y" - function yy_r177(){ - $this->_retvalue = '<='; - } -#line 2983 "smarty_internal_templateparser.php" -#line 1131 "smarty_internal_templateparser.y" - function yy_r178(){ - $this->_retvalue = '==='; - } -#line 2988 "smarty_internal_templateparser.php" -#line 1135 "smarty_internal_templateparser.y" - function yy_r179(){ - $this->_retvalue = '!=='; - } -#line 2993 "smarty_internal_templateparser.php" -#line 1139 "smarty_internal_templateparser.y" - function yy_r180(){ - $this->_retvalue = '%'; - } -#line 2998 "smarty_internal_templateparser.php" -#line 1143 "smarty_internal_templateparser.y" - function yy_r181(){ - $this->_retvalue = '&&'; - } -#line 3003 "smarty_internal_templateparser.php" -#line 1147 "smarty_internal_templateparser.y" - function yy_r182(){ - $this->_retvalue = '||'; - } -#line 3008 "smarty_internal_templateparser.php" -#line 1151 "smarty_internal_templateparser.y" - function yy_r183(){ - $this->_retvalue = ' XOR '; - } -#line 3013 "smarty_internal_templateparser.php" -#line 1158 "smarty_internal_templateparser.y" - function yy_r184(){ - $this->_retvalue = 'array('.$this->yystack[$this->yyidx + -1]->minor.')'; - } -#line 3018 "smarty_internal_templateparser.php" -#line 1166 "smarty_internal_templateparser.y" - function yy_r186(){ - $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.','.$this->yystack[$this->yyidx + 0]->minor; - } -#line 3023 "smarty_internal_templateparser.php" -#line 1174 "smarty_internal_templateparser.y" - function yy_r188(){ - $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'=>'.$this->yystack[$this->yyidx + 0]->minor; - } -#line 3028 "smarty_internal_templateparser.php" -#line 1178 "smarty_internal_templateparser.y" - function yy_r189(){ - $this->_retvalue = '\''.$this->yystack[$this->yyidx + -2]->minor.'\'=>'.$this->yystack[$this->yyidx + 0]->minor; - } -#line 3033 "smarty_internal_templateparser.php" -#line 1190 "smarty_internal_templateparser.y" - function yy_r191(){ - $this->_retvalue = "''"; - } -#line 3038 "smarty_internal_templateparser.php" -#line 1194 "smarty_internal_templateparser.y" - function yy_r192(){ - $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor->to_smarty_php(); - } -#line 3043 "smarty_internal_templateparser.php" -#line 1199 "smarty_internal_templateparser.y" - function yy_r193(){ - $this->yystack[$this->yyidx + -1]->minor->append_subtree($this->yystack[$this->yyidx + 0]->minor); - $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; - } -#line 3049 "smarty_internal_templateparser.php" -#line 1204 "smarty_internal_templateparser.y" - function yy_r194(){ - $this->_retvalue = new _smarty_doublequoted($this, $this->yystack[$this->yyidx + 0]->minor); - } -#line 3054 "smarty_internal_templateparser.php" -#line 1208 "smarty_internal_templateparser.y" - function yy_r195(){ - $this->_retvalue = new _smarty_code($this, '(string)'.$this->yystack[$this->yyidx + -1]->minor); - } -#line 3059 "smarty_internal_templateparser.php" -#line 1216 "smarty_internal_templateparser.y" - function yy_r197(){ - $this->_retvalue = new _smarty_code($this, '(string)$_smarty_tpl->tpl_vars[\''. substr($this->yystack[$this->yyidx + 0]->minor,1) .'\']->value'); - } -#line 3064 "smarty_internal_templateparser.php" -#line 1224 "smarty_internal_templateparser.y" - function yy_r199(){ - $this->_retvalue = new _smarty_code($this, '(string)('.$this->yystack[$this->yyidx + -1]->minor.')'); - } -#line 3069 "smarty_internal_templateparser.php" -#line 1228 "smarty_internal_templateparser.y" - function yy_r200(){ - $this->_retvalue = new _smarty_tag($this, $this->yystack[$this->yyidx + 0]->minor); - } -#line 3074 "smarty_internal_templateparser.php" -#line 1232 "smarty_internal_templateparser.y" - function yy_r201(){ - $this->_retvalue = new _smarty_dq_content($this, $this->yystack[$this->yyidx + 0]->minor); - } -#line 3079 "smarty_internal_templateparser.php" - - private $_retvalue; - - function yy_reduce($yyruleno) - { - $yymsp = $this->yystack[$this->yyidx]; - if (self::$yyTraceFILE && $yyruleno >= 0 - && $yyruleno < count(self::$yyRuleName)) { - fprintf(self::$yyTraceFILE, "%sReduce (%d) [%s].\n", - self::$yyTracePrompt, $yyruleno, - self::$yyRuleName[$yyruleno]); - } - - $this->_retvalue = $yy_lefthand_side = null; - if (array_key_exists($yyruleno, self::$yyReduceMap)) { - // call the action - $this->_retvalue = null; - $this->{'yy_r' . self::$yyReduceMap[$yyruleno]}(); - $yy_lefthand_side = $this->_retvalue; - } - $yygoto = self::$yyRuleInfo[$yyruleno]['lhs']; - $yysize = self::$yyRuleInfo[$yyruleno]['rhs']; - $this->yyidx -= $yysize; - for($i = $yysize; $i; $i--) { - // pop all of the right-hand side parameters - array_pop($this->yystack); - } - $yyact = $this->yy_find_reduce_action($this->yystack[$this->yyidx]->stateno, $yygoto); - if ($yyact < self::YYNSTATE) { - if (!self::$yyTraceFILE && $yysize) { - $this->yyidx++; - $x = new TP_yyStackEntry; - $x->stateno = $yyact; - $x->major = $yygoto; - $x->minor = $yy_lefthand_side; - $this->yystack[$this->yyidx] = $x; - } else { - $this->yy_shift($yyact, $yygoto, $yy_lefthand_side); - } - } elseif ($yyact == self::YYNSTATE + self::YYNRULE + 1) { - $this->yy_accept(); - } - } - - function yy_parse_failed() - { - if (self::$yyTraceFILE) { - fprintf(self::$yyTraceFILE, "%sFail!\n", self::$yyTracePrompt); - } - while ($this->yyidx >= 0) { - $this->yy_pop_parser_stack(); - } - } - - function yy_syntax_error($yymajor, $TOKEN) - { -#line 77 "smarty_internal_templateparser.y" - - $this->internalError = true; - $this->yymajor = $yymajor; - $this->compiler->trigger_template_error(); -#line 3142 "smarty_internal_templateparser.php" - } - - function yy_accept() - { - if (self::$yyTraceFILE) { - fprintf(self::$yyTraceFILE, "%sAccept!\n", self::$yyTracePrompt); - } - while ($this->yyidx >= 0) { - $stack = $this->yy_pop_parser_stack(); - } -#line 69 "smarty_internal_templateparser.y" - - $this->successful = !$this->internalError; - $this->internalError = false; - $this->retvalue = $this->_retvalue; - //echo $this->retvalue."\n\n"; -#line 3160 "smarty_internal_templateparser.php" - } - - function doParse($yymajor, $yytokenvalue) - { - $yyerrorhit = 0; /* True if yymajor has invoked an error */ - - if ($this->yyidx === null || $this->yyidx < 0) { - $this->yyidx = 0; - $this->yyerrcnt = -1; - $x = new TP_yyStackEntry; - $x->stateno = 0; - $x->major = 0; - $this->yystack = array(); - array_push($this->yystack, $x); - } - $yyendofinput = ($yymajor==0); - - if (self::$yyTraceFILE) { - fprintf(self::$yyTraceFILE, "%sInput %s\n", - self::$yyTracePrompt, $this->yyTokenName[$yymajor]); - } - - do { - $yyact = $this->yy_find_shift_action($yymajor); - if ($yymajor < self::YYERRORSYMBOL && - !$this->yy_is_expected_token($yymajor)) { - // force a syntax error - $yyact = self::YY_ERROR_ACTION; - } - if ($yyact < self::YYNSTATE) { - $this->yy_shift($yyact, $yymajor, $yytokenvalue); - $this->yyerrcnt--; - if ($yyendofinput && $this->yyidx >= 0) { - $yymajor = 0; - } else { - $yymajor = self::YYNOCODE; - } - } elseif ($yyact < self::YYNSTATE + self::YYNRULE) { - $this->yy_reduce($yyact - self::YYNSTATE); - } elseif ($yyact == self::YY_ERROR_ACTION) { - if (self::$yyTraceFILE) { - fprintf(self::$yyTraceFILE, "%sSyntax Error!\n", - self::$yyTracePrompt); - } - if (self::YYERRORSYMBOL) { - if ($this->yyerrcnt < 0) { - $this->yy_syntax_error($yymajor, $yytokenvalue); - } - $yymx = $this->yystack[$this->yyidx]->major; - if ($yymx == self::YYERRORSYMBOL || $yyerrorhit ){ - if (self::$yyTraceFILE) { - fprintf(self::$yyTraceFILE, "%sDiscard input token %s\n", - self::$yyTracePrompt, $this->yyTokenName[$yymajor]); - } - $this->yy_destructor($yymajor, $yytokenvalue); - $yymajor = self::YYNOCODE; - } else { - while ($this->yyidx >= 0 && - $yymx != self::YYERRORSYMBOL && - ($yyact = $this->yy_find_shift_action(self::YYERRORSYMBOL)) >= self::YYNSTATE - ){ - $this->yy_pop_parser_stack(); - } - if ($this->yyidx < 0 || $yymajor==0) { - $this->yy_destructor($yymajor, $yytokenvalue); - $this->yy_parse_failed(); - $yymajor = self::YYNOCODE; - } elseif ($yymx != self::YYERRORSYMBOL) { - $u2 = 0; - $this->yy_shift($yyact, self::YYERRORSYMBOL, $u2); - } - } - $this->yyerrcnt = 3; - $yyerrorhit = 1; - } else { - if ($this->yyerrcnt <= 0) { - $this->yy_syntax_error($yymajor, $yytokenvalue); - } - $this->yyerrcnt = 3; - $this->yy_destructor($yymajor, $yytokenvalue); - if ($yyendofinput) { - $this->yy_parse_failed(); - } - $yymajor = self::YYNOCODE; - } - } else { - $this->yy_accept(); - $yymajor = self::YYNOCODE; - } - } while ($yymajor != self::YYNOCODE && $this->yyidx >= 0); - } -} diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/oldmodule/ryzommanage.module b/code/ryzom/tools/server/ryzom_ams/drupal_module/oldmodule/ryzommanage.module index e5e184556..f09b06a37 100644 --- a/code/ryzom/tools/server/ryzom_ams/drupal_module/oldmodule/ryzommanage.module +++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/oldmodule/ryzommanage.module @@ -659,12 +659,12 @@ function createPermissions($values) { $sth = $dbh->prepare("SELECT UId FROM user WHERE Login='" . $values[0] . "';"); $sth->execute(); $result = $sth->fetchAll(); - foreach ($result as $UId) { + /*foreach ($result as $UId) { $statement = $dbh->prepare("INSERT INTO permission (UId, ClientApplication, AccessPrivilege) VALUES ('" . $UId['UId'] . "', 'r2', 'OPEN');"); $statement->execute($values); $statement = $dbh->prepare("INSERT INTO permission (UId, ClientApplication, AccessPrivilege) VALUES ('" . $UId['UId'] . "', 'ryzom_open', 'OPEN');"); $statement->execute($values); - } + }*///FIXME: GARBAGE } catch (PDOException $e) { watchdog('ryzommanage', $e->getMessage(), NULL, WATCHDOG_ERROR); diff --git a/code/ryzom/tools/server/ryzom_ams/www/config.default.php b/code/ryzom/tools/server/ryzom_ams/www/config.php similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/www/config.default.php rename to code/ryzom/tools/server/ryzom_ams/www/config.php diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/css/charisma-app.css b/code/ryzom/tools/server/ryzom_ams/www/html/css/charisma-app.css deleted file mode 100644 index 7b6ae40fa..000000000 --- a/code/ryzom/tools/server/ryzom_ams/www/html/css/charisma-app.css +++ /dev/null @@ -1,501 +0,0 @@ -@import url(https://fonts.googleapis.com/css?family=Shojumaru); - -select{ -background-color:#fff; -} - -.top-block{ -font-size:14px; -text-align: center; -padding: 5px; -margin-bottom:10px; -font-weight:bold; -position: relative; -display: block; -line-height: 22px; -text-shadow: 0 0 1px #DDD; -text-decoration:none; --webkit-box-shadow: inset 0 0 0 1px #FAFAFA; --moz-box-shadow: inset 0 0 0 1px #FAFAFA; -box-shadow: inset 0 0 0 1px #FAFAFA; -background: -moz-linear-gradient(top, rgba(30,87,153,0.2) 0%, rgba(125,185,232,0) 100%); -background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(30,87,153,0.2)), color-stop(100%,rgba(125,185,232,0))); -background: -webkit-linear-gradient(top, rgba(30,87,153,0.2) 0%,rgba(125,185,232,0) 100%); -background: -o-linear-gradient(top, rgba(30,87,153,0.2) 0%,rgba(125,185,232,0) 100%); -background: -ms-linear-gradient(top, rgba(30,87,153,0.2) 0%,rgba(125,185,232,0) 100%); -background: linear-gradient(to bottom, rgba(30,87,153,0.2) 0%,rgba(125,185,232,0) 100%); -filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#331e5799', endColorstr='#007db9e8',GradientType=0 ); -} - -.top-block span{ -clear:both; -} - - -.top-block:hover{ -text-decoration:none; -} - -.notification { -display: block; -position: absolute; -top: -10px; -right: -5px; -line-height: 16px; -height: 16px; -padding: 0 5px; -font-family: Arial, sans-serif; -color: white !important; -text-shadow: 0 1px -hsla(0, 0%, 0%, 0.25); -border-width: 1px; -border-style: solid; -border-radius: 10px; --webkit-border-radius: 10px; --moz-border-radius: 10px; --webkit-box-shadow: 0 1px 1px -hsla(0, 0%, 0%, 0.08), inset 0 1px -hsla(0, 100%, 100%, 0.3); --moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08), inset 0 1px rgba(255, 255, 255, 0.3); -box-shadow: 0 1px 1px -hsla(0, 0%, 0%, 0.08), inset 0 1px -hsla(0, 100%, 100%, 0.3); -} - -.notification { -border-color: #2FABE9; -background-color: #67C2EF; -background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, hsl(200, 80%, 82%)), color-stop(100%, hsl(200, 81%, 67%))); -background-image: -webkit-linear-gradient(top, hsl(200, 80%, 82%), hsl(200, 81%, 67%)); -background-image: -moz-linear-gradient(top, hsl(200, 80%, 82%), hsl(200, 81%, 67%)); -background-image: -ms-linear-gradient(top, hsl(200, 80%, 82%), hsl(200, 81%, 67%)); -background-image: -o-linear-gradient(top, hsl(200, 80%, 82%), hsl(200, 81%, 67%)); -background-image: linear-gradient(top, hsl(200, 80%, 82%), hsl(200, 81%, 67%)); -} - -.notification.green { -border-color: #5AAD34; -background-color: #78CD51; -background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, hsl(101, 54%, 71%)), color-stop(100%, hsl(101, 55%, 56%))); -background-image: -webkit-linear-gradient(top, hsl(101, 54%, 71%), hsl(101, 55%, 56%)); -background-image: -moz-linear-gradient(top, hsl(101, 54%, 71%), hsl(101, 55%, 56%)); -background-image: -ms-linear-gradient(top, hsl(101, 54%, 71%), hsl(101, 55%, 56%)); -background-image: -o-linear-gradient(top, hsl(101, 54%, 71%), hsl(101, 55%, 56%)); -background-image: linear-gradient(top, hsl(101, 54%, 71%), hsl(101, 55%, 56%)); -} - -.notification.yellow { -border-color: #F4A506; -background-color: #FABB3D; -background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, hsl(40, 95%, 76%)), color-stop(100%, hsl(40, 95%, 61%))); -background-image: -webkit-linear-gradient(top, hsl(40, 95%, 76%), hsl(40, 95%, 61%)); -background-image: -moz-linear-gradient(top, hsl(40, 95%, 76%), hsl(40, 95%, 61%)); -background-image: -ms-linear-gradient(top, hsl(40, 95%, 76%), hsl(40, 95%, 61%)); -background-image: -o-linear-gradient(top, hsl(40, 95%, 76%), hsl(40, 95%, 61%)); -background-image: linear-gradient(top, hsl(40, 95%, 76%), hsl(40, 95%, 61%)); -} - -.notification.red { -border-color: #FA5833; -background-color: #FA603D; -background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, hsl(11, 95%, 76%)), color-stop(100%, hsl(11, 95%, 61%))); -background-image: -webkit-linear-gradient(top, hsl(11, 95%, 76%), hsl(11, 95%, 61%)); -background-image: -moz-linear-gradient(top, hsl(11, 95%, 76%), hsl(11, 95%, 61%)); -background-image: -ms-linear-gradient(top, hsl(11, 95%, 76%), hsl(11, 95%, 61%)); -background-image: -o-linear-gradient(top, hsl(11, 95%, 76%), hsl(11, 95%, 61%)); -background-image: linear-gradient(top, hsl(11, 95%, 76%), hsl(11, 95%, 61%)); -} - -#external-events { -float: left; -width: 15%; -padding: 10px; -text-align: left; -} -.external-event{ -margin: 5px; -cursor:move; -} -#calendar { -float: right; -width: 80%; -} - - - -.box{ -border: 1px solid #DEDEDE; -border-radius:3px; --webkit-border-radius:3px; --moz-border-radius:3px; -margin-top: 10px; -margin-bottom: 10px ; -box-shadow: 0 0 10px rgba(189, 189, 189, 0.4); --webkit-box-shadow: 0 0 10px rgba(189, 189, 189, 0.4); --moz-box-shadow: 0 0 10px rgba(189, 189, 189, 0.4); -} - -.box-header{ -border:none; -padding-top:5px; -border-bottom: 1px solid #DEDEDE; -border-radius:3px 3px 0 0; --webkit-border-radius:3px 3px 0 0; --moz-border-radius:3px 3px 0 0; -height:12px; -min-height:12px; -margin-bottom: 0; -cursor:move; -font-weight:bold; -font-size:16px; -background: -moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(0,0,0,0.1) 100%); -background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0)), color-stop(100%,rgba(0,0,0,0.1))); -background: -webkit-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(0,0,0,0.1) 100%); -background: -o-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(0,0,0,0.1) 100%); -background: -ms-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(0,0,0,0.1) 100%); -background: linear-gradient(to bottom, rgba(255,255,255,0) 0%,rgba(0,0,0,0.1) 100%); -filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#1a000000',GradientType=0 ); - -} - -.box-header h2{ -font-size:15px; -width:auto; -clear:none; -float:left; -line-height:25px; -} -.box-header h3{ -font-size:13px; -width:auto; -clear:none; -float:left; -line-height:25px; -} -.box-header h2 > i{ -margin-top:1px; -} -.box-icon{ -float:right; -} -.box-icon a{ -clear:none; -float:left; -margin:0 2px; -height: 18px; -width:5px; -margin-top: -1px; -} -.box-icon a i{ -margin-left:-4.5px; -} -.box-content{ -padding:10px; -} - - -.btn-round{ -border-radius: 40px; --webkit-border-radius: 40px; --moz-border-radius: 40px; -font-size:12px; -padding-top:4px; -} - -ul.dashboard-list li{ -padding: 7px 0; -list-style:none; -border-bottom: 1px solid #EBEBEB; -border-top: 1px solid white; -} - -ul.dashboard-list a:hover{ -text-decoration:none; -} - -ul.dashboard-list{ -margin:0; -} - -ul.dashboard-list li a span { -display: inline-block; -font-size: 18px; -font-weight: bold; -margin-right: 10px; -text-align: right; -width: 70px; -zoom: 1; -} - -.dashboard-avatar{ -height: 50px; -width: 50px; -padding: 1px; -float: left; -margin-left: 15px; -margin-right: 15px; -border: 1px solid #EBEBEB; -} - -#prependedInput,#appendedPrependedInput,#appendedInputButtons,#appendedInputButton{ -width:200px; -} -#appendedInput{ -width:75px; -} -.thumbnail{ -background-color:white; -z-index:2; -position:relative; -margin-bottom:40px !important; -} -.thumbnails > li{ -margin-left:15px; -} -.thumbnail img,.thumbnail > a{ -z-index:2; -height:100px; -width:100px; -position:relative; -display: block; -} - -img.grayscale{ --webkit-filter: grayscale(1); --webkit-filter: grayscale(100%); --moz-filter: grayscale(100%); --ms-filter: grayscale(100%); --o-filter: grayscale(100%); -/*filter: url(desaturate.svg#grayscale); -filter: gray; -filter: grayscale(100%); */ -} - -.thumbnail .gallery-controls{ -position:absolute; -z-index:1; -margin-top:-30px; -height:22px; -min-height:22px; -width:80px; -padding:9px; -} -.thumbnail .gallery-controls p{ -display:block; -margin:auto; -width:100%; -} -label div.checker,label div.radio{ -margin-bottom:3px; -} -div.uploader{ -border-radius:14px; --webkit-border-radius:14px; --moz-border-radius:14px; -} -footer{ -clear:both; -} -footer .pull-right{ -float:right; -margin-right:10px; -} -footer .pull-left{ -float:left; -margin-left:10px; -} -.docs-input-sizes select, .docs-input-sizes input[type="text"] { -display: block; -margin-bottom: 9px; -} - -div.center,p.center,img.center{ -margin-left: auto !important; -margin-right: auto !important; -float:none !important; -display: block; -text-align:center; -} - -.stackControls{ -padding:5px; -} - -.clear{ -clear:both; -width:0px; -height:0px; -} - -.sidebar-nav{ -min-height:0; -box-shadow: 0 0 10px #BDBDBD; --webkit-box-shadow: 0 0 10px #BDBDBD; --moz-box-shadow: 0 0 10px #BDBDBD; -border-radius: 5px; --webkit-border-radius: 5px; --moz-border-radius: 5px; -margin-bottom: 0; -padding-bottom:0; -} -.sidebar-nav > ul > li:not(.nav-header){ -margin-right:-2px; -margin-left:-2px; -} -.brand{ -font-family: 'Shojumaru', cursive, Arial, serif; -letter-spacing:2px; -text-shadow:1px 1px 5px rgba(0, 0, 0, 0.5); -width:166px; -} -.brand img{ -float:left; -height:20px; -width:20px; -margin-right:5px; -} -.brand span{ -float:left; -} -@media (max-width: 979px){ -.sidebar-nav{ -padding:0; -margin-bottom:0; -} -.theme-text{ - display:none; -} -} -@media (min-width: 768px) and (max-width: 979px) { -.box-icon{ - display:none; -} -.box-header h2{ - font-size:13px !important; -} -.box-header h3{ - font-size:11px !important; -} -.main-menu-span{ - width:6.2% !important; - margin-right:4%; -} -} - -.navbar-search{ -margin-left:10px; -} -.navbar-inner{ -border-radius:0 0 10px 10px; --webkit-border-radius:0 0 10px 10px; --moz-border-radius:0 0 10px 10px; -padding-top:5px; -padding-bottom:5px; -} -div.dataTables_length select { -width: 50px; -} -.dataTables_filter input, .dataTables_length select { -display: inline-block; -margin-bottom: 0; -} -ul.ajax-loaders li{ -display:inline-block; -list-style:none; -padding:10px; -} -ul.ajax-loaders{ -min-height:80px; -} -.bs-icons li{ -list-style:none; -} -#for-is-ajax{ -padding-left: 12px; -cursor:pointer; -} -#loading{ -margin-top: 20px; -width:128px; -font-weight: bold; -} -#loading div.center{ -margin-top:10px; -height:15px; -width:128px; -background:url(../img/ajax-loaders/ajax-loader-6.gif); -} - -.box-content .nav-tabs{ -margin-right:-10px; -margin-left:-10px; -} -#inputIcon{ -width:200px; -} -.show-grid [class*="span"] { -background-color: #EDEDED; -text-align: center; --webkit-border-radius: 3px; --moz-border-radius: 3px; -border-radius: 3px; -min-height: 30px; -line-height: 30px; -} -.show-grid { -margin-top: 10px; -margin-bottom: 20px; -color:black; -} -.show-grid:hover [class*="span"] { -background: #DEDEDE; -} -.login-header{ -padding-top:30px; -height:120px; -} -.pull-left{ -float:left !important; -} -.pull-right{ -float:right !important; -} -.remember{ -margin-top:3px; -} -.green { -color: #458746; -} -.red { -color: #B94846; -} -.blue { -color: #3986AC; -} -.yellow { -color: #F99406; -} -.login-box{ - -} -.login-box .input-prepend{ -margin-bottom: 10px; -} -.login-box .btn{ -margin-top:15px; -width:100% -} -.charisma_qr{ -height:136px; -width:136px; -border:solid grey 1px; -border-radius:2px; --webkit-border-radius:2px; --moz-border-radius:2px; -box-shadow: 0 0 10px #BDBDBD; --webkit-box-shadow: 0 0 10px #BDBDBD; --moz-box-shadow: 0 0 10px #BDBDBD; -} -.box-content.buttons{ -min-height:297px; -} diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/css/custom.css b/code/ryzom/tools/server/ryzom_ams/www/html/css/custom.css deleted file mode 100644 index 425da8427..000000000 --- a/code/ryzom/tools/server/ryzom_ams/www/html/css/custom.css +++ /dev/null @@ -1,51 +0,0 @@ -.box-content { - background: white; -} - -.box-header { - background-color: white; -} - -.top-block { - background-color: white; -} - -.row-fluid [class*="span"] { - min-height: 28px; -} - -.login-header -{ - height:190px; -} - -.brand img -{ - height:100%; - margin-bottom:-18px; - margin-top:-15px; - width:auto; -} - -#for-is-ajax -{ - display:none; -} - -.navbar { - border-bottom: 0px; -} - -.flags { - display: block; - position:relative; - left:290px; - top:28px; -} - -.flags_no_visible_elements{ - display: block; - position:relative; - left:67%; - top:210px; -} \ No newline at end of file diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/index.php b/code/ryzom/tools/server/ryzom_ams/www/html/index.php deleted file mode 100644 index b4827bfe2..000000000 --- a/code/ryzom/tools/server/ryzom_ams/www/html/index.php +++ /dev/null @@ -1,126 +0,0 @@ -getPermission(); -}else{ - //default permission - $return['permission'] = 0; -} - - -//hide sidebar + topbar in case of login/register -if($page == 'login' || $page == 'register' || $page == 'logout' || $page == 'forgot_password' || $page == 'reset_password'){ - $return['no_visible_elements'] = 'TRUE'; -}else{ - $return['no_visible_elements'] = 'FALSE'; -} - -//handle error page -if($page == 'error'){ - $return['permission'] = 0; - $return['no_visible_elements'] = 'FALSE'; -} - -//load the template with the variables in the $return array -helpers :: loadTemplate( $page , $return ); diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/installer/libsetup.php b/code/ryzom/tools/server/ryzom_ams/www/html/installer/libsetup.php deleted file mode 100644 index 2901918e2..000000000 --- a/code/ryzom/tools/server/ryzom_ams/www/html/installer/libsetup.php +++ /dev/null @@ -1,1767 +0,0 @@ -Reload! '; - exit; - } else { - require_once( '../config.php' ); - } - } - } - - require_once( $AMS_LIB.'/libinclude.php' ); - - //var used to access the DB; - global $cfg; - - try{ - //SETUP THE WWW DB - $dbw = new DBLayer("install", "web"); - $sql = " - CREATE DATABASE IF NOT EXISTS `" . $cfg['db']['web']['name'] ."` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; - USE `". $cfg['db']['web']['name'] . "`; - DROP TABLE IF EXISTS ams_user; - - CREATE TABLE IF NOT EXISTS `ams_user` ( - `UId` int(10) NOT NULL AUTO_INCREMENT, - `Login` varchar(64) NOT NULL DEFAULT '', - `Password` varchar(13) DEFAULT NULL, - `Email` varchar(255) NOT NULL DEFAULT '', - `Permission` int(3) NOT NULL DEFAULT 1, - `FirstName` varchar(255) NOT NULL DEFAULT '', - `LastName` varchar(255) NOT NULL DEFAULT '', - `Gender` tinyint(1) unsigned NOT NULL DEFAULT '0', - `Country` char(2) NOT NULL DEFAULT '', - `ReceiveMail` int(1) NOT NULL DEFAULT 1, - `Language` varchar(3) DEFAULT NULL, - PRIMARY KEY (`UId`) - ) ENGINE = InnoDB; - GRANT ALL ON `" . $cfg['db']['web']['name'] ."`.* TO `" . $cfg['db']['web']['user'] ."`@".$cfg['db']['web']['host']." identified by '".$cfg['db']['web']['pass']."'; - "; - $dbw->executeWithoutParams($sql); - - //SETUP THE AMS_LIB DB - $dbl = new DBLayer("install", "lib"); - - $sql = " - CREATE DATABASE IF NOT EXISTS `" . $cfg['db']['lib']['name'] ."` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; - USE `" . $cfg['db']['lib']['name'] ."`; - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`ams_querycache`; - - CREATE TABLE ams_querycache ( - `SID` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , - `type` VARCHAR( 64 ) NOT NULL , - `query` VARCHAR( 512 ) NOT NULL, - `db` VARCHAR( 80 ) NOT NULL - ); - - -- ----------------------------------------------------------------------------------------------------------------------- - -- ----------------------------------------------------------------------------------------------------------------------- - - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`ticket_log` ; - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`tagged` ; - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`tag` ; - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`in_support_group` ; - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`in_group` ; - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`ticket_group` ; - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`ticket_info` ; - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`email` ; - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`forwarded` ; - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`assigned` ; - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`ticket_reply` ; - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`ticket_content` ; - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`ticket` ; - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`support_group` ; - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`ticket_category` ; - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`ticket_user` ; - - - -- ----------------------------------------------------- - -- Table `" . $cfg['db']['lib']['name'] ."`.`ticket_category` - -- ----------------------------------------------------- - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`ticket_category` ; - - CREATE TABLE IF NOT EXISTS `" . $cfg['db']['lib']['name'] ."`.`ticket_category` ( - `TCategoryId` INT UNSIGNED NOT NULL AUTO_INCREMENT , - `Name` VARCHAR(45) NOT NULL , - PRIMARY KEY (`TCategoryId`) , - UNIQUE INDEX `Name_UNIQUE` (`Name` ASC) ) - ENGINE = InnoDB; - - - -- ----------------------------------------------------- - -- Table `" . $cfg['db']['lib']['name'] ."`.`ticket_user` - -- ----------------------------------------------------- - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`ticket_user` ; - - CREATE TABLE IF NOT EXISTS `" . $cfg['db']['lib']['name'] ."`.`ticket_user` ( - `TUserId` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT , - `Permission` INT(3) NOT NULL DEFAULT 1 , - `ExternId` INT(10) UNSIGNED NOT NULL , - PRIMARY KEY (`TUserId`) ) - ENGINE = InnoDB; - - - -- ----------------------------------------------------- - -- Table `" . $cfg['db']['lib']['name'] ."`.`ticket` - -- ----------------------------------------------------- - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`ticket` ; - - CREATE TABLE IF NOT EXISTS `" . $cfg['db']['lib']['name'] ."`.`ticket` ( - `TId` INT UNSIGNED NOT NULL AUTO_INCREMENT , - `Timestamp` TIMESTAMP NOT NULL , - `Title` VARCHAR(120) NOT NULL , - `Status` INT NULL DEFAULT 0 , - `Queue` INT NULL DEFAULT 0 , - `Ticket_Category` INT UNSIGNED NOT NULL , - `Author` INT UNSIGNED NOT NULL , - `Priority` INT(3) NULL DEFAULT 0 , - PRIMARY KEY (`TId`) , - INDEX `fk_ticket_ticket_category_idx` (`Ticket_Category` ASC) , - INDEX `fk_ticket_ams_user_idx` (`Author` ASC) , - CONSTRAINT `fk_ticket_ticket_category` - FOREIGN KEY (`Ticket_Category` ) - REFERENCES `" . $cfg['db']['lib']['name'] ."`.`ticket_category` (`TCategoryId` ) - ON DELETE NO ACTION - ON UPDATE NO ACTION, - CONSTRAINT `fk_ticket_ams_user` - FOREIGN KEY (`Author` ) - REFERENCES `" . $cfg['db']['lib']['name'] ."`.`ticket_user` (`TUserId` ) - ON DELETE NO ACTION - ON UPDATE NO ACTION) - ENGINE = InnoDB; - - - -- ----------------------------------------------------- - -- Table `" . $cfg['db']['lib']['name'] ."`.`assigned` - -- ----------------------------------------------------- - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`assigned` ; - - CREATE TABLE IF NOT EXISTS `" . $cfg['db']['lib']['name'] ."`.`assigned` ( - `Ticket` INT UNSIGNED NOT NULL , - `User` INT UNSIGNED NOT NULL , - INDEX `fk_assigned_ticket_idx` (`Ticket` ASC) , - PRIMARY KEY (`Ticket`, `User`) , - INDEX `fk_assigned_ams_user_idx` (`User` ASC) , - CONSTRAINT `fk_assigned_ticket` - FOREIGN KEY (`Ticket` ) - REFERENCES `" . $cfg['db']['lib']['name'] ."`.`ticket` (`TId` ) - ON DELETE NO ACTION - ON UPDATE NO ACTION, - CONSTRAINT `fk_assigned_ams_user` - FOREIGN KEY (`User` ) - REFERENCES `" . $cfg['db']['lib']['name'] ."`.`ticket_user` (`TUserId` ) - ON DELETE NO ACTION - ON UPDATE NO ACTION) - ENGINE = InnoDB; - - - -- ----------------------------------------------------- - -- Table `" . $cfg['db']['lib']['name'] ."`.`tag` - -- ----------------------------------------------------- - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`tag` ; - - CREATE TABLE IF NOT EXISTS `" . $cfg['db']['lib']['name'] ."`.`tag` ( - `TagId` INT UNSIGNED NOT NULL AUTO_INCREMENT , - `Value` VARCHAR(60) NOT NULL , - PRIMARY KEY (`TagId`) , - UNIQUE INDEX `Value_UNIQUE` (`Value` ASC) ) - ENGINE = InnoDB; - - - -- ----------------------------------------------------- - -- Table `" . $cfg['db']['lib']['name'] ."`.`tagged` - -- ----------------------------------------------------- - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`tagged` ; - - CREATE TABLE IF NOT EXISTS `" . $cfg['db']['lib']['name'] ."`.`tagged` ( - `Ticket` INT UNSIGNED NOT NULL , - `Tag` INT UNSIGNED NOT NULL , - PRIMARY KEY (`Ticket`, `Tag`) , - INDEX `fk_tagged_tag_idx` (`Tag` ASC) , - CONSTRAINT `fk_tagged_ticket` - FOREIGN KEY (`Ticket` ) - REFERENCES `" . $cfg['db']['lib']['name'] ."`.`ticket` (`TId` ) - ON DELETE NO ACTION - ON UPDATE NO ACTION, - CONSTRAINT `fk_tagged_tag` - FOREIGN KEY (`Tag` ) - REFERENCES `" . $cfg['db']['lib']['name'] ."`.`tag` (`TagId` ) - ON DELETE NO ACTION - ON UPDATE NO ACTION) - ENGINE = InnoDB; - - - -- ----------------------------------------------------- - -- Table `" . $cfg['db']['lib']['name'] ."`.`ticket_content` - -- ----------------------------------------------------- - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`ticket_content` ; - - CREATE TABLE IF NOT EXISTS `" . $cfg['db']['lib']['name'] ."`.`ticket_content` ( - `TContentId` INT UNSIGNED NOT NULL AUTO_INCREMENT , - `Content` TEXT NULL , - PRIMARY KEY (`TContentId`) ) - ENGINE = InnoDB - DEFAULT CHARACTER SET = utf8; - - - -- ----------------------------------------------------- - -- Table `" . $cfg['db']['lib']['name'] ."`.`ticket_reply` - -- ----------------------------------------------------- - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`ticket_reply` ; - - CREATE TABLE IF NOT EXISTS `" . $cfg['db']['lib']['name'] ."`.`ticket_reply` ( - `TReplyId` INT UNSIGNED NOT NULL AUTO_INCREMENT , - `Ticket` INT UNSIGNED NOT NULL , - `Author` INT UNSIGNED NOT NULL , - `Content` INT UNSIGNED NOT NULL , - `Timestamp` TIMESTAMP NULL , - `Hidden` TINYINT(1) NULL DEFAULT 0 , - PRIMARY KEY (`TReplyId`) , - INDEX `fk_ticket_reply_ticket_idx` (`Ticket` ASC) , - INDEX `fk_ticket_reply_ams_user_idx` (`Author` ASC) , - INDEX `fk_ticket_reply_content_idx` (`Content` ASC) , - CONSTRAINT `fk_ticket_reply_ticket` - FOREIGN KEY (`Ticket` ) - REFERENCES `" . $cfg['db']['lib']['name'] ."`.`ticket` (`TId` ) - ON DELETE NO ACTION - ON UPDATE NO ACTION, - CONSTRAINT `fk_ticket_reply_ams_user` - FOREIGN KEY (`Author` ) - REFERENCES `" . $cfg['db']['lib']['name'] ."`.`ticket_user` (`TUserId` ) - ON DELETE NO ACTION - ON UPDATE NO ACTION, - CONSTRAINT `fk_ticket_reply_ticket_content` - FOREIGN KEY (`Content` ) - REFERENCES `" . $cfg['db']['lib']['name'] ."`.`ticket_content` (`TContentId` ) - ON DELETE NO ACTION - ON UPDATE NO ACTION) - ENGINE = InnoDB; - - - -- ----------------------------------------------------- - -- Table `" . $cfg['db']['lib']['name'] ."`.`ticket_group` - -- ----------------------------------------------------- - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`ticket_group` ; - - CREATE TABLE IF NOT EXISTS `" . $cfg['db']['lib']['name'] ."`.`ticket_group` ( - `TGroupId` INT UNSIGNED NOT NULL AUTO_INCREMENT , - `Title` VARCHAR(80) NOT NULL , - PRIMARY KEY (`TGroupId`) , - UNIQUE INDEX `Title_UNIQUE` (`Title` ASC) ) - ENGINE = InnoDB; - - - -- ----------------------------------------------------- - -- Table `" . $cfg['db']['lib']['name'] ."`.`in_group` - -- ----------------------------------------------------- - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`in_group` ; - - CREATE TABLE IF NOT EXISTS `" . $cfg['db']['lib']['name'] ."`.`in_group` ( - `Ticket_Group` INT UNSIGNED NOT NULL , - `Ticket` INT UNSIGNED NOT NULL , - PRIMARY KEY (`Ticket_Group`, `Ticket`) , - INDEX `fk_in_group_ticket_group_idx` (`Ticket_Group` ASC) , - INDEX `fk_in_group_ticket_idx` (`Ticket` ASC) , - CONSTRAINT `fk_in_group_ticket_group` - FOREIGN KEY (`Ticket_Group` ) - REFERENCES `" . $cfg['db']['lib']['name'] ."`.`ticket_group` (`TGroupId` ) - ON DELETE NO ACTION - ON UPDATE NO ACTION, - CONSTRAINT `fk_in_group_ticket` - FOREIGN KEY (`Ticket` ) - REFERENCES `" . $cfg['db']['lib']['name'] ."`.`ticket` (`TId` ) - ON DELETE NO ACTION - ON UPDATE NO ACTION) - ENGINE = InnoDB; - - - -- ----------------------------------------------------- - -- Table `" . $cfg['db']['lib']['name'] ."`.`ticket_log` - -- ----------------------------------------------------- - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`ticket_log` ; - - CREATE TABLE IF NOT EXISTS `" . $cfg['db']['lib']['name'] ."`.`ticket_log` ( - `TLogId` INT UNSIGNED NOT NULL AUTO_INCREMENT , - `Timestamp` TIMESTAMP NOT NULL , - `Query` VARCHAR(255) NOT NULL , - `Ticket` INT UNSIGNED NOT NULL , - `Author` INT(10) UNSIGNED NULL , - PRIMARY KEY (`TLogId`) , - INDEX `fk_ticket_log_ticket1` (`Ticket` ASC) , - INDEX `fk_ticket_log_ticket_user1` (`Author` ASC) , - CONSTRAINT `fk_ticket_log_ticket1` - FOREIGN KEY (`Ticket` ) - REFERENCES `" . $cfg['db']['lib']['name'] ."`.`ticket` (`TId` ) - ON DELETE NO ACTION - ON UPDATE NO ACTION, - CONSTRAINT `fk_ticket_log_ticket_user1` - FOREIGN KEY (`Author` ) - REFERENCES `" . $cfg['db']['lib']['name'] ."`.`ticket_user` (`TUserId` ) - ON DELETE NO ACTION - ON UPDATE NO ACTION) - ENGINE = InnoDB; - - INSERT IGNORE INTO `" . $cfg['db']['lib']['name'] ."`.`ticket_category` (`Name`) VALUES ('Uncategorized'),('Hacking'),('Ingame-Bug'),('Website-Bug'),('Installation'); - - - - -- ----------------------------------------------------- - -- Table `" . $cfg['db']['lib']['name'] ."`.`support_group` - -- ----------------------------------------------------- - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`support_group` ; - - CREATE TABLE IF NOT EXISTS `" . $cfg['db']['lib']['name'] ."`.`support_group` ( - `SGroupId` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT , - `Name` VARCHAR(22) NOT NULL , - `Tag` VARCHAR(7) NOT NULL , - `GroupEmail` VARCHAR(45) NULL , - `IMAP_MailServer` VARCHAR(60) NULL , - `IMAP_Username` VARCHAR(45) NULL , - `IMAP_Password` VARCHAR(90) NULL , - PRIMARY KEY (`SGroupId`) , - UNIQUE INDEX `Name_UNIQUE` (`Name` ASC) , - UNIQUE INDEX `Tag_UNIQUE` (`Tag` ASC) ) - ENGINE = InnoDB; - - - -- ----------------------------------------------------- - -- Table `" . $cfg['db']['lib']['name'] ."`.`in_support_group` - -- ----------------------------------------------------- - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`in_support_group` ; - - CREATE TABLE IF NOT EXISTS `" . $cfg['db']['lib']['name'] ."`.`in_support_group` ( - `User` INT(10) UNSIGNED NOT NULL , - `Group` INT(10) UNSIGNED NOT NULL , - INDEX `fk_in_support_group_ticket_user1` (`User` ASC) , - INDEX `fk_in_support_group_support_group1` (`Group` ASC) , - CONSTRAINT `fk_in_support_group_ticket_user1` - FOREIGN KEY (`User` ) - REFERENCES `" . $cfg['db']['lib']['name'] ."`.`ticket_user` (`TUserId` ) - ON DELETE NO ACTION - ON UPDATE NO ACTION, - CONSTRAINT `fk_in_support_group_support_group1` - FOREIGN KEY (`Group` ) - REFERENCES `" . $cfg['db']['lib']['name'] ."`.`support_group` (`SGroupId` ) - ON DELETE CASCADE - ON UPDATE NO ACTION) - ENGINE = InnoDB; - - -- ----------------------------------------------------- - -- Table `" . $cfg['db']['lib']['name'] ."`.`forwarded` - -- ----------------------------------------------------- - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`forwarded` ; - - CREATE TABLE IF NOT EXISTS `" . $cfg['db']['lib']['name'] ."`.`forwarded` ( - `Group` INT(10) UNSIGNED NOT NULL , - `Ticket` INT UNSIGNED NOT NULL , - INDEX `fk_forwarded_support_group1` (`Group` ASC) , - INDEX `fk_forwarded_ticket1` (`Ticket` ASC) , - CONSTRAINT `fk_forwarded_support_group1` - FOREIGN KEY (`Group` ) - REFERENCES `" . $cfg['db']['lib']['name'] ."`.`support_group` (`SGroupId` ) - ON DELETE CASCADE - ON UPDATE NO ACTION, - CONSTRAINT `fk_forwarded_ticket1` - FOREIGN KEY (`Ticket` ) - REFERENCES `" . $cfg['db']['lib']['name'] ."`.`ticket` (`TId` ) - ON DELETE NO ACTION - ON UPDATE NO ACTION) - ENGINE = InnoDB; - - - -- ----------------------------------------------------- - -- Table `" . $cfg['db']['lib']['name'] ."`.`email` - -- ----------------------------------------------------- - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`email` ; - - CREATE TABLE IF NOT EXISTS `" . $cfg['db']['lib']['name'] ."`.`email` ( - `MailId` INT NOT NULL AUTO_INCREMENT , - `Recipient` VARCHAR(50) NULL , - `Subject` VARCHAR(60) NULL , - `Body` VARCHAR(400) NULL , - `Status` VARCHAR(45) NULL , - `Attempts` VARCHAR(45) NULL DEFAULT 0 , - `UserId` INT(10) UNSIGNED NULL , - `MessageId` VARCHAR(45) NULL , - `TicketId` INT UNSIGNED NULL , - `Sender` INT(10) UNSIGNED NULL , - PRIMARY KEY (`MailId`) , - INDEX `fk_email_ticket_user2` (`UserId` ASC) , - INDEX `fk_email_ticket1` (`TicketId` ASC) , - INDEX `fk_email_support_group1` (`Sender` ASC) , - CONSTRAINT `fk_email_ticket_user2` - FOREIGN KEY (`UserId` ) - REFERENCES `" . $cfg['db']['lib']['name'] ."`.`ticket_user` (`TUserId` ) - ON DELETE NO ACTION - ON UPDATE NO ACTION, - CONSTRAINT `fk_email_ticket1` - FOREIGN KEY (`TicketId` ) - REFERENCES `" . $cfg['db']['lib']['name'] ."`.`ticket` (`TId` ) - ON DELETE NO ACTION - ON UPDATE NO ACTION, - CONSTRAINT `fk_email_support_group1` - FOREIGN KEY (`Sender` ) - REFERENCES `" . $cfg['db']['lib']['name'] ."`.`support_group` (`SGroupId` ) - ON DELETE CASCADE - ON UPDATE NO ACTION) - ENGINE = InnoDB; - - - -- ----------------------------------------------------- - -- Table `" . $cfg['db']['lib']['name'] ."`.`ticket_info` - -- ----------------------------------------------------- - DROP TABLE IF EXISTS `" . $cfg['db']['lib']['name'] ."`.`ticket_info` ; - - CREATE TABLE IF NOT EXISTS `" . $cfg['db']['lib']['name'] ."`.`ticket_info` ( - `TInfoId` INT UNSIGNED NOT NULL AUTO_INCREMENT , - `Ticket` INT UNSIGNED NOT NULL , - `ShardId` INT NULL , - `UserPosition` VARCHAR(65) NULL , - `ViewPosition` VARCHAR(65) NULL , - `ClientVersion` VARCHAR(65) NULL , - `PatchVersion` VARCHAR(65) NULL , - `ServerTick` VARCHAR(40) NULL , - `ConnectState` VARCHAR(40) NULL , - `LocalAddress` VARCHAR(70) NULL , - `Memory` VARCHAR(60) NULL , - `OS` VARCHAR(120) NULL , - `Processor` VARCHAR(120) NULL , - `CPUID` VARCHAR(50) NULL , - `CpuMask` VARCHAR(50) NULL , - `HT` VARCHAR(35) NULL , - `NeL3D` VARCHAR(120) NULL , - `PlayerName` VARCHAR(45) NULL , - `UserId` INT NULL , - `TimeInGame` VARCHAR(50) NULL , - PRIMARY KEY (`TInfoId`) , - INDEX `fk_ticket_info_ticket1` (`Ticket` ASC) , - CONSTRAINT `fk_ticket_info_ticket1` - FOREIGN KEY (`Ticket` ) - REFERENCES `" . $cfg['db']['lib']['name'] ."`.`ticket` (`TId` ) - ON DELETE NO ACTION - ON UPDATE NO ACTION) - ENGINE = InnoDB; - GRANT ALL ON `" . $cfg['db']['lib']['name'] ."`.* TO `" . $cfg['db']['lib']['user'] ."`@".$cfg['db']['lib']['host']." identified by '".$cfg['db']['lib']['pass']."'; - "; - $dbl->executeWithoutParams($sql); - print "The Lib & Web database were correctly installed!
"; - - //SETUP THE SHARD DB - $dbs = new DBLayer("install", "shard"); - $sql = " - CREATE DATABASE IF NOT EXISTS `" . $cfg['db']['shard']['name'] ."` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; - USE `". $cfg['db']['shard']['name'] . "`; - - CREATE TABLE IF NOT EXISTS `domain` ( - `domain_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `domain_name` varchar(32) NOT NULL DEFAULT '', - `status` enum('ds_close','ds_dev','ds_restricted','ds_open') NOT NULL DEFAULT 'ds_dev', - `patch_version` int(10) unsigned NOT NULL DEFAULT '0', - `backup_patch_url` varchar(255) DEFAULT NULL, - `patch_urls` text, - `login_address` varchar(255) NOT NULL DEFAULT '', - `session_manager_address` varchar(255) NOT NULL DEFAULT '', - `ring_db_name` varchar(255) NOT NULL DEFAULT '', - `web_host` varchar(255) NOT NULL DEFAULT '', - `web_host_php` varchar(255) NOT NULL DEFAULT '', - `description` varchar(200) DEFAULT NULL, - PRIMARY KEY (`domain_id`), - UNIQUE KEY `name_idx` (`domain_name`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 ; - - INSERT INTO `domain` (`domain_id`, `domain_name`, `status`, `patch_version`, `backup_patch_url`, `patch_urls`, `login_address`, `session_manager_address`, `ring_db_name`, `web_host`, `web_host_php`, `description`) VALUES - (12, 'ryzom_open', 'ds_open', 610, 'http://127.0.0.1:23001', NULL, '127.0.0.1:49998', '127.0.0.1:49999', 'ring_open', '127.0.0.1:30000', '127.0.0.1:40916', 'Open Domain'); - - CREATE TABLE IF NOT EXISTS `permission` ( - `UId` int(10) unsigned NOT NULL DEFAULT '0', - `ClientApplication` char(64) NOT NULL DEFAULT 'ryzom', - `ShardId` int(10) NOT NULL DEFAULT '-1', - `AccessPrivilege` set('OPEN','DEV','RESTRICTED') NOT NULL DEFAULT 'OPEN', - `prim` int(10) unsigned NOT NULL AUTO_INCREMENT, - PRIMARY KEY (`prim`), - KEY `UIDIndex` (`UId`) - ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; - - CREATE TABLE IF NOT EXISTS `shard` ( - `ShardId` int(10) NOT NULL DEFAULT '0', - `domain_id` int(11) unsigned NOT NULL DEFAULT '0', - `WsAddr` varchar(64) DEFAULT NULL, - `NbPlayers` int(10) unsigned DEFAULT '0', - `Name` varchar(255) DEFAULT 'unknown shard', - `Online` tinyint(1) unsigned DEFAULT '0', - `ClientApplication` varchar(64) DEFAULT 'ryzom', - `Version` varchar(64) NOT NULL DEFAULT '', - `PatchURL` varchar(255) NOT NULL DEFAULT '', - `DynPatchURL` varchar(255) NOT NULL DEFAULT '', - `FixedSessionId` int(11) unsigned NOT NULL DEFAULT '0', - `State` enum('ds_close','ds_dev','ds_restricted','ds_open') NOT NULL DEFAULT 'ds_dev', - `MOTD` text NOT NULL, - `prim` int(10) unsigned NOT NULL AUTO_INCREMENT, - PRIMARY KEY (`prim`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='contains all shards informations for login system' AUTO_INCREMENT=31 ; - - INSERT INTO `shard` (`ShardId`, `domain_id`, `WsAddr`, `NbPlayers`, `Name`, `Online`, `ClientApplication`, `Version`, `PatchURL`, `DynPatchURL`, `FixedSessionId`, `State`, `MOTD`, `prim`) VALUES - (302, 12, '127.0.0.1', 0, 'Open Shard', 0, 'ryzom_open', '', '', '', 0, 'ds_dev', '', 30); - - CREATE TABLE IF NOT EXISTS `user` ( - `UId` int(10) NOT NULL AUTO_INCREMENT, - `Login` varchar(64) NOT NULL DEFAULT '', - `Password` varchar(13) DEFAULT NULL, - `ShardId` int(10) NOT NULL DEFAULT '-1', - `State` enum('Offline','Online') NOT NULL DEFAULT 'Offline', - `Privilege` varchar(255) NOT NULL DEFAULT '', - `GroupName` varchar(255) NOT NULL DEFAULT '', - `FirstName` varchar(255) NOT NULL DEFAULT '', - `LastName` varchar(255) NOT NULL DEFAULT '', - `Birthday` varchar(32) NOT NULL DEFAULT '', - `Gender` tinyint(1) unsigned NOT NULL DEFAULT '0', - `Country` char(2) NOT NULL DEFAULT '', - `Email` varchar(255) NOT NULL DEFAULT '', - `Address` varchar(255) NOT NULL DEFAULT '', - `City` varchar(100) NOT NULL DEFAULT '', - `PostalCode` varchar(10) NOT NULL DEFAULT '', - `USState` char(2) NOT NULL DEFAULT '', - `Chat` char(2) NOT NULL DEFAULT '0', - `BetaKeyId` int(10) unsigned NOT NULL DEFAULT '0', - `CachedCoupons` varchar(255) NOT NULL DEFAULT '', - `ProfileAccess` varchar(45) DEFAULT NULL, - `Level` int(2) NOT NULL DEFAULT '0', - `CurrentFunds` int(4) NOT NULL DEFAULT '0', - `IdBilling` varchar(255) NOT NULL DEFAULT '', - `Community` char(2) NOT NULL DEFAULT '--', - `Newsletter` tinyint(1) NOT NULL DEFAULT '1', - `Account` varchar(64) NOT NULL DEFAULT '', - `ChoiceSubLength` tinyint(2) NOT NULL DEFAULT '0', - `CurrentSubLength` varchar(255) NOT NULL DEFAULT '0', - `ValidIdBilling` int(4) NOT NULL DEFAULT '0', - `GMId` int(4) NOT NULL DEFAULT '0', - `ExtendedPrivilege` varchar(128) NOT NULL DEFAULT '', - `ToolsGroup` varchar(20) NOT NULL DEFAULT '', - `Unsubscribe` date NOT NULL DEFAULT '0000-00-00', - `SubDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `SubIp` varchar(20) NOT NULL DEFAULT '', - `SecurePassword` varchar(32) NOT NULL DEFAULT '', - `LastInvoiceEmailCheck` date NOT NULL DEFAULT '0000-00-00', - `FromSource` varchar(8) NOT NULL DEFAULT '', - `ValidMerchantCode` varchar(13) NOT NULL DEFAULT '', - `PBC` tinyint(1) NOT NULL DEFAULT '0', - `ApiKeySeed` varchar(8) DEFAULT NULL, - PRIMARY KEY (`UId`), - KEY `LoginIndex` (`Login`), - KEY `GroupIndex` (`GroupName`), - KEY `ToolsGroup` (`ToolsGroup`), - KEY `CurrentSubLength` (`CurrentSubLength`), - KEY `Community` (`Community`), - KEY `Email` (`Email`), - KEY `GMId` (`GMId`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='contains all users informations for login system' AUTO_INCREMENT=1 ; - - GRANT ALL ON `" . $cfg['db']['shard']['name'] ."`.* TO `" . $cfg['db']['shard']['user'] ."`@".$cfg['db']['shard']['host']." identified by '".$cfg['db']['shard']['pass']."'; - "; - $dbs->executeWithoutParams($sql); - print "The shard database was correctly installed!
"; - - //SETUP THE Nel_Tool DB - $dbn = new DBLayer("install", "tool"); - $sql = " - CREATE DATABASE IF NOT EXISTS `" . $cfg['db']['tool']['name'] ."`; - USE `". $cfg['db']['tool']['name'] . "`; - - CREATE DATABASE IF NOT EXISTS `" . $cfg['db']['tool']['name'] ."` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; - USE `" . $cfg['db']['tool']['name'] ."`; - - CREATE TABLE IF NOT EXISTS `neltool_annotations` ( - `annotation_id` int(11) NOT NULL AUTO_INCREMENT, - `annotation_domain_id` int(11) DEFAULT NULL, - `annotation_shard_id` int(11) DEFAULT NULL, - `annotation_data` varchar(255) NOT NULL DEFAULT '', - `annotation_user_name` varchar(32) NOT NULL DEFAULT '', - `annotation_date` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`annotation_id`), - UNIQUE KEY `annotation_shard_id` (`annotation_shard_id`), - UNIQUE KEY `annotation_domain_id` (`annotation_domain_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 ; - - INSERT INTO `neltool_annotations` (`annotation_id`, `annotation_domain_id`, `annotation_shard_id`, `annotation_data`, `annotation_user_name`, `annotation_date`) VALUES - (12, NULL, 106, 'Welcome to the Shard Admin Website!', 'vl', 1272378352); - - CREATE TABLE IF NOT EXISTS `neltool_applications` ( - `application_id` int(11) NOT NULL AUTO_INCREMENT, - `application_name` varchar(64) NOT NULL DEFAULT '', - `application_uri` varchar(255) NOT NULL DEFAULT '', - `application_restriction` varchar(64) NOT NULL DEFAULT '', - `application_order` int(11) NOT NULL DEFAULT '0', - `application_visible` int(11) NOT NULL DEFAULT '0', - `application_icon` varchar(128) NOT NULL DEFAULT '', - PRIMARY KEY (`application_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=40 ; - - INSERT INTO `neltool_applications` (`application_id`, `application_name`, `application_uri`, `application_restriction`, `application_order`, `application_visible`, `application_icon`) VALUES - (1, 'Main', 'index.php', '', 100, 1, 'imgs/icon_main.gif'), - (2, 'Logout', 'index.php?mode=logout', '', 999999, 1, 'imgs/icon_logout.gif'), - (3, 'Admin', 'tool_administration.php', 'tool_admin', 1500, 1, 'imgs/icon_admin.gif'), - (4, 'Prefs', 'tool_preferences.php', 'tool_preferences', 1000, 1, 'imgs/icon_preferences.gif'), - (5, 'Admin/Users', '', 'tool_admin_user', 1502, 0, ''), - (6, 'Admin/Applications', '', 'tool_admin_application', 1501, 0, ''), - (7, 'Admin/Domains', '', 'tool_admin_domain', 1504, 0, ''), - (8, 'Admin/Shards', '', 'tool_admin_shard', 1505, 0, ''), - (9, 'Admin/Groups', '', 'tool_admin_group', 1503, 0, ''), - (10, 'Admin/Logs', '', 'tool_admin_logs', 1506, 0, ''), - (11, 'Main/Start', '', 'tool_main_start', 101, 0, ''), - (12, 'Main/Stop', '', 'tool_main_stop', 102, 0, ''), - (13, 'Main/Restart', '', 'tool_main_restart', 103, 0, ''), - (14, 'Main/Kill', '', 'tool_main_kill', 104, 0, ''), - (15, 'Main/Abort', '', 'tool_main_abort', 105, 0, ''), - (16, 'Main/Execute', '', 'tool_main_execute', 108, 0, ''), - (18, 'Notes', 'tool_notes.php', 'tool_notes', 900, 1, 'imgs/icon_notes.gif'), - (19, 'Player Locator', 'tool_player_locator.php', 'tool_player_locator', 200, 1, 'imgs/icon_player_locator.gif'), - (20, 'Player Locator/Display Players', '', 'tool_player_locator_display_players', 201, 0, ''), - (21, 'Player Locator/Locate', '', 'tool_player_locator_locate', 202, 0, ''), - (22, 'Main/LockDomain', '', 'tool_main_lock_domain', 110, 0, ''), - (23, 'Main/LockShard', '', 'tool_main_lock_shard', 111, 0, ''), - (24, 'Main/WS', '', 'tool_main_ws', 112, 0, ''), - (25, 'Main/ResetCounters', '', 'tool_main_reset_counters', 113, 0, ''), - (26, 'Main/ServiceAutoStart', '', 'tool_main_service_autostart', 114, 0, ''), - (27, 'Main/ShardAutoStart', '', 'tool_main_shard_autostart', 115, 0, ''), - (28, 'Main/WS/Old', '', 'tool_main_ws_old', 112, 0, ''), - (29, 'Graphs', 'tool_graphs.php', 'tool_graph', 500, 1, 'imgs/icon_graphs.gif'), - (30, 'Notes/Global', '', 'tool_notes_global', 901, 0, ''), - (31, 'Log Analyser', 'tool_log_analyser.php', 'tool_las', 400, 1, 'imgs/icon_log_analyser.gif'), - (32, 'Guild Locator', 'tool_guild_locator.php', 'tool_guild_locator', 300, 1, 'imgs/icon_guild_locator.gif'), - (33, 'Player Locator/UserID Check', '', 'tool_player_locator_userid_check', 203, 0, ''), - (34, 'Player Locator/CSR Relocate', '', 'tool_player_locator_csr_relocate', 204, 0, ''), - (35, 'Guild Locator/Guilds Update', '', 'tool_guild_locator_manage_guild', 301, 0, ''), - (36, 'Guild Locator/Members Update', '', 'tool_guild_locator_manage_members', 302, 0, ''), - (37, 'Entities', 'tool_event_entities.php', 'tool_event_entities', 350, 1, 'imgs/icon_entity.gif'), - (38, 'Admin/Restarts', '', 'tool_admin_restart', 1507, 0, ''), - (39, 'Main/EasyRestart', '', 'tool_main_easy_restart', 116, 0, ''); - - CREATE TABLE IF NOT EXISTS `neltool_domains` ( - `domain_id` int(11) NOT NULL AUTO_INCREMENT, - `domain_name` varchar(128) NOT NULL DEFAULT '', - `domain_as_host` varchar(128) NOT NULL DEFAULT '', - `domain_as_port` int(11) NOT NULL DEFAULT '0', - `domain_rrd_path` varchar(255) NOT NULL DEFAULT '', - `domain_las_admin_path` varchar(255) NOT NULL DEFAULT '', - `domain_las_local_path` varchar(255) NOT NULL DEFAULT '', - `domain_application` varchar(128) NOT NULL DEFAULT '', - `domain_sql_string` varchar(128) NOT NULL DEFAULT '', - `domain_hd_check` int(11) NOT NULL DEFAULT '0', - `domain_mfs_web` text, - `domain_cs_sql_string` varchar(255) DEFAULT NULL, - PRIMARY KEY (`domain_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 ; - - INSERT INTO `neltool_domains` (`domain_id`, `domain_name`, `domain_as_host`, `domain_as_port`, `domain_rrd_path`, `domain_las_admin_path`, `domain_las_local_path`, `domain_application`, `domain_sql_string`, `domain_hd_check`, `domain_mfs_web`, `domain_cs_sql_string`) VALUES - (12, 'ryzom_open', '127.0.0.1', 46700, '/home/ryzom/code/ryzom/server/save_shard/rrd_graphs', '', '', 'ryzom_open', 'mysql://shard@127.0.0.1/ring_open', 0, '', 'mysql://shard@127.0.0.1/atrium_forums'); - - CREATE TABLE IF NOT EXISTS `neltool_groups` ( - `group_id` int(11) NOT NULL AUTO_INCREMENT, - `group_name` varchar(32) NOT NULL DEFAULT 'NewGroup', - `group_level` int(11) NOT NULL DEFAULT '0', - `group_default` int(11) NOT NULL DEFAULT '0', - `group_active` int(11) NOT NULL DEFAULT '0', - `group_default_domain_id` tinyint(3) unsigned DEFAULT NULL, - `group_default_shard_id` tinyint(3) unsigned DEFAULT NULL, - PRIMARY KEY (`group_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=12 ; - - INSERT INTO `neltool_groups` (`group_id`, `group_name`, `group_level`, `group_default`, `group_active`, `group_default_domain_id`, `group_default_shard_id`) VALUES - (1, 'AdminGroup', 0, 0, 1, 12, 106), - (2, 'NevraxGroup', 0, 1, 1, NULL, NULL), - (3, 'AdminDebugGroup', 10, 0, 1, 9, 56), - (4, 'SupportSGMGroup', 0, 0, 1, NULL, NULL), - (5, 'NevraxATSGroup', 0, 0, 1, NULL, NULL), - (6, 'SupportGMGroup', 0, 0, 1, NULL, NULL), - (7, 'SupportReadOnlyGroup', 0, 0, 1, NULL, NULL), - (8, 'NevraxLevelDesigners', 0, 0, 1, NULL, NULL), - (9, 'NevraxReadOnlyGroup', 0, 0, 1, 9, 56), - (10, 'YubDevGroup', 0, 0, 1, 12, 106), - (11, 'GuestGroup', 0, 0, 1, 12, 106); - - CREATE TABLE IF NOT EXISTS `neltool_group_applications` ( - `group_application_id` int(11) NOT NULL AUTO_INCREMENT, - `group_application_group_id` int(11) NOT NULL DEFAULT '0', - `group_application_application_id` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`group_application_id`), - KEY `group_application_group_id` (`group_application_group_id`), - KEY `group_application_application_id` (`group_application_application_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=966 ; - - INSERT INTO `neltool_group_applications` (`group_application_id`, `group_application_group_id`, `group_application_application_id`) VALUES - (879, 1, 10), - (878, 1, 8), - (877, 1, 7), - (876, 1, 9), - (875, 1, 5), - (874, 1, 6), - (873, 1, 3), - (872, 1, 4), - (871, 1, 30), - (870, 1, 18), - (869, 1, 29), - (868, 1, 31), - (867, 1, 37), - (866, 1, 36), - (865, 1, 35), - (864, 1, 32), - (863, 1, 34), - (862, 1, 33), - (861, 1, 21), - (860, 1, 20), - (859, 1, 19), - (858, 1, 39), - (857, 1, 27), - (856, 1, 26), - (843, 3, 10), - (842, 3, 8), - (841, 3, 7), - (840, 3, 9), - (839, 3, 5), - (838, 3, 6), - (837, 3, 3), - (836, 3, 4), - (835, 3, 30), - (834, 3, 18), - (833, 3, 29), - (832, 3, 31), - (831, 3, 37), - (830, 3, 36), - (829, 3, 35), - (828, 3, 32), - (827, 3, 34), - (826, 3, 33), - (825, 3, 21), - (824, 3, 20), - (823, 3, 19), - (822, 3, 39), - (821, 3, 27), - (820, 3, 26), - (597, 4, 36), - (596, 4, 35), - (595, 4, 32), - (594, 4, 21), - (593, 4, 20), - (592, 4, 19), - (591, 4, 24), - (590, 4, 23), - (589, 4, 14), - (588, 4, 12), - (632, 2, 18), - (631, 2, 37), - (630, 2, 32), - (629, 2, 21), - (628, 2, 20), - (627, 2, 19), - (626, 2, 24), - (625, 2, 23), - (624, 2, 22), - (623, 2, 16), - (622, 2, 15), - (621, 2, 14), - (620, 2, 13), - (819, 3, 25), - (855, 1, 25), - (619, 2, 12), - (818, 3, 28), - (854, 1, 28), - (817, 3, 24), - (718, 5, 18), - (717, 5, 37), - (716, 5, 32), - (715, 5, 21), - (714, 5, 20), - (713, 5, 19), - (712, 5, 27), - (711, 5, 26), - (710, 5, 24), - (709, 5, 23), - (708, 5, 22), - (707, 5, 16), - (706, 5, 15), - (705, 5, 14), - (816, 3, 23), - (609, 6, 35), - (608, 6, 32), - (607, 6, 21), - (606, 6, 20), - (605, 6, 19), - (604, 6, 24), - (603, 6, 23), - (602, 6, 14), - (601, 6, 12), - (600, 6, 11), - (815, 3, 22), - (814, 3, 16), - (853, 1, 24), - (704, 5, 13), - (703, 5, 12), - (852, 1, 23), - (587, 4, 11), - (618, 2, 11), - (702, 5, 11), - (612, 7, 19), - (851, 1, 22), - (813, 3, 15), - (812, 3, 14), - (598, 4, 18), - (599, 4, 4), - (610, 6, 18), - (611, 6, 4), - (613, 7, 20), - (614, 7, 21), - (615, 7, 32), - (616, 7, 35), - (617, 7, 4), - (633, 2, 4), - (811, 3, 13), - (810, 3, 12), - (850, 1, 16), - (849, 1, 15), - (848, 1, 14), - (847, 1, 13), - (846, 1, 12), - (719, 5, 4), - (720, 8, 11), - (721, 8, 12), - (722, 8, 13), - (723, 8, 14), - (724, 8, 15), - (725, 8, 16), - (726, 8, 22), - (727, 8, 23), - (728, 8, 24), - (729, 8, 25), - (730, 8, 26), - (731, 8, 27), - (732, 8, 19), - (733, 8, 20), - (734, 8, 21), - (735, 8, 37), - (736, 8, 4), - (737, 9, 29), - (738, 9, 4), - (809, 3, 11), - (845, 1, 11), - (844, 3, 38), - (880, 1, 38), - (909, 10, 18), - (908, 10, 29), - (907, 10, 37), - (906, 10, 36), - (905, 10, 35), - (904, 10, 32), - (903, 10, 34), - (902, 10, 33), - (901, 10, 21), - (900, 10, 20), - (899, 10, 19), - (898, 10, 23), - (897, 10, 13), - (910, 10, 30), - (965, 11, 29), - (964, 11, 37), - (963, 11, 32), - (962, 11, 34), - (961, 11, 33), - (960, 11, 21), - (959, 11, 20), - (958, 11, 19); - - CREATE TABLE IF NOT EXISTS `neltool_group_domains` ( - `group_domain_id` int(11) NOT NULL AUTO_INCREMENT, - `group_domain_group_id` int(11) NOT NULL DEFAULT '0', - `group_domain_domain_id` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`group_domain_id`), - KEY `group_domain_group_id` (`group_domain_group_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=90 ; - - INSERT INTO `neltool_group_domains` (`group_domain_id`, `group_domain_group_id`, `group_domain_domain_id`) VALUES - (79, 1, 9), - (84, 3, 3), - (78, 1, 8), - (43, 2, 1), - (20, 4, 4), - (80, 1, 1), - (77, 1, 3), - (40, 5, 4), - (21, 4, 1), - (22, 6, 1), - (42, 2, 4), - (76, 1, 12), - (83, 3, 12), - (75, 1, 2), - (41, 5, 8), - (44, 2, 8), - (82, 3, 2), - (74, 1, 4), - (73, 9, 9), - (81, 3, 4), - (85, 3, 8), - (86, 3, 9), - (87, 3, 1), - (88, 10, 12), - (89, 11, 12); - - CREATE TABLE IF NOT EXISTS `neltool_group_shards` ( - `group_shard_id` int(11) NOT NULL AUTO_INCREMENT, - `group_shard_group_id` int(11) NOT NULL DEFAULT '0', - `group_shard_shard_id` int(11) NOT NULL DEFAULT '0', - `group_shard_domain_id` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`group_shard_id`), - KEY `group_shard_group_id` (`group_shard_group_id`), - KEY `group_shard_domain_id` (`group_shard_domain_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1522 ; - - INSERT INTO `neltool_group_shards` (`group_shard_id`, `group_shard_group_id`, `group_shard_shard_id`, `group_shard_domain_id`) VALUES - (1513, 3, 43, 1), - (1473, 1, 42, 1), - (1472, 1, 2, 1), - (1471, 1, 3, 1), - (1470, 1, 1, 1), - (1512, 3, 46, 1), - (1511, 3, 45, 1), - (1510, 3, 6, 1), - (1509, 3, 5, 1), - (1508, 3, 58, 9), - (1507, 3, 102, 9), - (1506, 3, 103, 9), - (841, 2, 37, 8), - (840, 2, 36, 8), - (839, 2, 31, 8), - (838, 2, 47, 8), - (837, 2, 32, 8), - (836, 2, 30, 8), - (1469, 1, 44, 1), - (1468, 1, 43, 1), - (1467, 1, 46, 1), - (1466, 1, 45, 1), - (1465, 1, 6, 1), - (1464, 1, 5, 1), - (1463, 1, 58, 9), - (1505, 3, 104, 9), - (1504, 3, 57, 9), - (1488, 3, 10, 2), - (1487, 3, 14, 2), - (1493, 3, 54, 3), - (1486, 3, 8, 2), - (1485, 3, 13, 2), - (1503, 3, 56, 9), - (1502, 3, 40, 8), - (1501, 3, 37, 8), - (1500, 3, 36, 8), - (1499, 3, 31, 8), - (1498, 3, 47, 8), - (1497, 3, 32, 8), - (1496, 3, 30, 8), - (1462, 1, 102, 9), - (1461, 1, 103, 9), - (1492, 3, 53, 3), - (1460, 1, 104, 9), - (1459, 1, 57, 9), - (1458, 1, 56, 9), - (1457, 1, 40, 8), - (903, 5, 37, 8), - (902, 5, 36, 8), - (901, 5, 31, 8), - (900, 5, 47, 8), - (899, 5, 32, 8), - (898, 5, 30, 8), - (897, 5, 39, 8), - (1456, 1, 37, 8), - (652, 4, 26, 4), - (651, 4, 20, 4), - (650, 4, 19, 4), - (1491, 3, 15, 3), - (1455, 1, 36, 8), - (896, 5, 41, 8), - (1490, 3, 106, 12), - (1454, 1, 31, 8), - (895, 5, 18, 4), - (894, 5, 26, 4), - (893, 5, 20, 4), - (646, 4, 23, 4), - (645, 4, 22, 4), - (644, 4, 21, 4), - (835, 2, 39, 8), - (834, 2, 41, 8), - (833, 2, 4, 1), - (832, 2, 44, 1), - (831, 2, 43, 1), - (830, 2, 42, 1), - (829, 2, 2, 1), - (828, 2, 46, 1), - (827, 2, 45, 1), - (826, 2, 3, 1), - (825, 2, 1, 1), - (824, 2, 6, 1), - (892, 5, 19, 4), - (1495, 3, 39, 8), - (1484, 3, 7, 2), - (891, 5, 24, 4), - (1489, 3, 107, 12), - (1483, 3, 18, 4), - (1482, 3, 26, 4), - (1481, 3, 20, 4), - (1480, 3, 19, 4), - (1479, 3, 24, 4), - (1453, 1, 47, 8), - (1452, 1, 32, 8), - (1474, 1, 4, 1), - (887, 5, 23, 4), - (886, 5, 22, 4), - (1451, 1, 30, 8), - (1450, 1, 39, 8), - (1449, 1, 41, 8), - (1448, 1, 54, 3), - (1447, 1, 53, 3), - (885, 5, 21, 4), - (904, 5, 40, 8), - (884, 5, 17, 4), - (823, 2, 5, 1), - (822, 2, 18, 4), - (821, 2, 26, 4), - (820, 2, 20, 4), - (819, 2, 19, 4), - (818, 2, 24, 4), - (1446, 1, 15, 3), - (1385, 9, 58, 9), - (1445, 1, 106, 12), - (1444, 1, 107, 12), - (1443, 1, 10, 2), - (1478, 3, 23, 4), - (1477, 3, 22, 4), - (1494, 3, 41, 8), - (814, 2, 23, 4), - (813, 2, 22, 4), - (812, 2, 21, 4), - (653, 4, 42, 1), - (654, 4, 43, 1), - (655, 4, 44, 1), - (1384, 9, 102, 9), - (842, 2, 40, 8), - (1383, 9, 103, 9), - (1382, 9, 104, 9), - (811, 2, 17, 4), - (1381, 9, 57, 9), - (1442, 1, 14, 2), - (1476, 3, 21, 4), - (1441, 1, 8, 2), - (1440, 1, 13, 2), - (1380, 9, 56, 9), - (1439, 1, 7, 2), - (1438, 1, 18, 4), - (1437, 1, 26, 4), - (1436, 1, 20, 4), - (1435, 1, 19, 4), - (1434, 1, 24, 4), - (1433, 1, 23, 4), - (1432, 1, 22, 4), - (1431, 1, 21, 4), - (1430, 1, 17, 4), - (1475, 3, 17, 4), - (1514, 3, 44, 1), - (1515, 3, 1, 1), - (1516, 3, 3, 1), - (1517, 3, 2, 1), - (1518, 3, 42, 1), - (1519, 3, 4, 1), - (1520, 10, 106, 12), - (1521, 11, 106, 12); - - CREATE TABLE IF NOT EXISTS `neltool_locks` ( - `lock_id` int(11) NOT NULL AUTO_INCREMENT, - `lock_domain_id` int(11) DEFAULT NULL, - `lock_shard_id` int(11) DEFAULT NULL, - `lock_user_name` varchar(32) NOT NULL DEFAULT '', - `lock_date` int(11) NOT NULL DEFAULT '0', - `lock_update` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`lock_id`), - UNIQUE KEY `lock_shard_id` (`lock_shard_id`), - UNIQUE KEY `lock_domain_id` (`lock_domain_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; - - CREATE TABLE IF NOT EXISTS `neltool_logs` ( - `logs_id` int(11) NOT NULL AUTO_INCREMENT, - `logs_user_name` varchar(32) NOT NULL DEFAULT '0', - `logs_date` int(11) NOT NULL DEFAULT '0', - `logs_data` varchar(255) NOT NULL DEFAULT '', - PRIMARY KEY (`logs_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; - - CREATE TABLE IF NOT EXISTS `neltool_notes` ( - `note_id` int(11) NOT NULL AUTO_INCREMENT, - `note_user_id` int(11) NOT NULL DEFAULT '0', - `note_title` varchar(128) NOT NULL DEFAULT '', - `note_data` text NOT NULL, - `note_date` int(11) NOT NULL DEFAULT '0', - `note_active` int(11) NOT NULL DEFAULT '0', - `note_global` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`note_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ; - - INSERT INTO `neltool_notes` (`note_id`, `note_user_id`, `note_title`, `note_data`, `note_date`, `note_active`, `note_global`) VALUES - (2, 27, 'Welcome', 'Welcome to the shard administration website!\r\n\r\nThis website is used to monitor and restart shards.\r\n\r\nIt also gives some player characters informations.', 1272378065, 1, 1), - (3, 27, 'Shard Start', '# At the same time : NS and TS\r\n[1 min] : all MS, you can boot them all at the same time\r\n[1 min] : IOS\r\n[3 mins] : GMPS\r\n[3 mins] : EGS\r\n[5 mins] : AI Fyros\r\n[1 min 30] : AI Zorai\r\n[1 min 30] : AI Matis\r\n[1 min 30] : AI TNP\r\n[1 min 30] : AI NPE\r\n[1 min 30] : AI Tryker\r\n[1 min 30] : All FS and SBS at the same time\r\n[30 secs] : WS (atm the WS starts in OPEN mode by default, so be fast before CSR checkage, fix for that inc soon)\r\n\r\nNOTE: you can check the uptime for those timers in the right column of the admin tool: UpTime\r\n', 1158751126, 1, 0), - (5, 27, 'shutting supplementary', 'the writing wont change when lock the ws\r\n\r\nuntick previous boxes as you shut down\r\n\r\nwait 5 between the ws and the egs ie egs is 5 past rest is 10 past', 1153395380, 1, 0), - (4, 27, 'Shard Stop', '1. Broadcast to warn players\r\n\r\n2. 10 mins before shutdown, lock the WS\r\n\r\n3. At the right time shut down WS\r\n\r\n4. Shut down EGS\r\nOnly the EGS. Wait 5 reals minutes. Goal is to give enough time to egs, in order to save all the info he has to, and letting him sending those message to all services who need it.\r\n\r\n5. Shut down the rest, et voilà, you're done.', 1153314198, 1, 0), - (6, 27, 'Start (EGS to high?)', 'If [EGS] is to high on startup:\r\n\r\n[shut down egs]\r\n[5 mins]\r\n\r\n[IOS] & [GPMS] (shut down at same time)\r\n\r\nAfter the services are down follow "UP" process with timers again.\r\n\r\nIOS\r\n[3 mins]\r\nGPMS\r\n[3 mins]\r\nEGS\r\n[5 mins]\r\nbla bla...', 1153395097, 1, 0), - (7, 27, 'opening if the egs is too high on reboot', '<kadael> here my note on admin about egs to high on startup\r\n<kadael> ---\r\n<kadael> If [EGS] is to high on startup:\r\n<kadael> [shut down egs]\r\n<kadael> [5 mins]\r\n<kadael> [IOS] & [GPMS] (at same time shut down )\r\n<kadael> after the services are down follow "UP" process with timers again.\r\n<kadael> IOS\r\n<kadael> [3 mins]\r\n<kadael> GPMS\r\n<kadael> [3 mins]\r\n<kadael> EGS\r\n<kadael> [5 mins]\r\n<kadael> bla bla...\r\n<kadael> ---', 1153395362, 1, 0), - (10, 27, 'Ring points', 'Commande pour donner tout les points ring à tout le monde :\r\n\r\nDans le DSS d'un Shard Ring entrer : DefaultCharRingAccess f7:j7:l6:d7:p13:g9:a9', 1155722296, 1, 0), - (9, 27, 'Start (EGS to high?)', 'If [EGS] is to high on startup: \r\n \r\n [shut down egs] \r\n [5 mins] \r\n \r\n [IOS] & [GPMS] (shut down at same time) \r\n \r\n After the services are down follow "UP" process with timers again. \r\n \r\n IOS \r\n [3 mins] \r\n GPMS \r\n [3 mins] \r\n EGS \r\n [5 mins] \r\n bla bla...', 1153929658, 1, 0); - - CREATE TABLE IF NOT EXISTS `neltool_restart_groups` ( - `restart_group_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `restart_group_name` varchar(50) DEFAULT NULL, - `restart_group_list` varchar(50) DEFAULT NULL, - `restart_group_order` varchar(50) DEFAULT NULL, - PRIMARY KEY (`restart_group_id`), - UNIQUE KEY `restart_group_id` (`restart_group_id`), - KEY `restart_group_id_2` (`restart_group_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ; - - INSERT INTO `neltool_restart_groups` (`restart_group_id`, `restart_group_name`, `restart_group_list`, `restart_group_order`) VALUES - (1, 'Low Level', 'rns,ts,ms', '1'), - (3, 'Mid Level', 'ios,gpms,egs', '2'), - (4, 'High Level', 'ais', '3'), - (5, 'Front Level', 'fes,sbs,dss,rws', '4'); - - CREATE TABLE IF NOT EXISTS `neltool_restart_messages` ( - `restart_message_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `restart_message_name` varchar(20) DEFAULT NULL, - `restart_message_value` varchar(128) DEFAULT NULL, - `restart_message_lang` varchar(5) DEFAULT NULL, - PRIMARY KEY (`restart_message_id`), - UNIQUE KEY `restart_message_id` (`restart_message_id`), - KEY `restart_message_id_2` (`restart_message_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ; - - INSERT INTO `neltool_restart_messages` (`restart_message_id`, `restart_message_name`, `restart_message_value`, `restart_message_lang`) VALUES - (5, 'reboot', 'The shard is about to go down. Please find a safe location and log out.', 'en'), - (4, 'reboot', 'Le serveur va redemarrer dans minutes. Merci de vous deconnecter en lieu sur.', 'fr'), - (6, 'reboot', 'Der Server wird heruntergefahren. Findet eine sichere Stelle und logt aus.', 'de'), - (10, 'reboot', 'Arret du serveur dans minutes', 'fr'); - - CREATE TABLE IF NOT EXISTS `neltool_restart_sequences` ( - `restart_sequence_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `restart_sequence_domain_id` int(10) unsigned NOT NULL DEFAULT '0', - `restart_sequence_shard_id` int(10) unsigned NOT NULL DEFAULT '0', - `restart_sequence_user_name` varchar(50) DEFAULT NULL, - `restart_sequence_step` int(10) unsigned NOT NULL DEFAULT '0', - `restart_sequence_date_start` int(11) DEFAULT NULL, - `restart_sequence_date_end` int(11) DEFAULT NULL, - `restart_sequence_timer` int(11) unsigned DEFAULT '0', - PRIMARY KEY (`restart_sequence_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; - - CREATE TABLE IF NOT EXISTS `neltool_shards` ( - `shard_id` int(11) NOT NULL AUTO_INCREMENT, - `shard_name` varchar(128) NOT NULL DEFAULT '', - `shard_as_id` varchar(255) NOT NULL DEFAULT '0', - `shard_domain_id` int(11) NOT NULL DEFAULT '0', - `shard_lang` char(2) NOT NULL DEFAULT 'en', - `shard_restart` int(10) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`shard_id`), - KEY `shard_domain_id` (`shard_domain_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=107 ; - - INSERT INTO `neltool_shards` (`shard_id`, `shard_name`, `shard_as_id`, `shard_domain_id`, `shard_lang`, `shard_restart`) VALUES - (106, 'Open', 'open', 12, 'en', 0); - - CREATE TABLE IF NOT EXISTS `neltool_stats_hd_datas` ( - `hd_id` int(11) NOT NULL AUTO_INCREMENT, - `hd_domain_id` int(11) NOT NULL DEFAULT '0', - `hd_server` varchar(32) NOT NULL DEFAULT '', - `hd_device` varchar(64) NOT NULL DEFAULT '', - `hd_size` varchar(16) NOT NULL DEFAULT '', - `hd_used` varchar(16) NOT NULL DEFAULT '', - `hd_free` varchar(16) NOT NULL DEFAULT '', - `hd_percent` int(11) NOT NULL DEFAULT '0', - `hd_mount` varchar(128) NOT NULL DEFAULT '', - PRIMARY KEY (`hd_id`), - KEY `hd_domain_id` (`hd_domain_id`), - KEY `hd_server` (`hd_server`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; - - CREATE TABLE IF NOT EXISTS `neltool_stats_hd_times` ( - `hd_domain_id` int(11) NOT NULL DEFAULT '0', - `hd_last_time` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`hd_domain_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1; - - CREATE TABLE IF NOT EXISTS `neltool_users` ( - `user_id` int(11) NOT NULL AUTO_INCREMENT, - `user_name` varchar(32) NOT NULL DEFAULT '', - `user_password` varchar(64) NOT NULL DEFAULT '', - `user_group_id` int(11) NOT NULL DEFAULT '0', - `user_created` int(11) NOT NULL DEFAULT '0', - `user_active` int(11) NOT NULL DEFAULT '0', - `user_logged_last` int(11) NOT NULL DEFAULT '0', - `user_logged_count` int(11) NOT NULL DEFAULT '0', - `user_menu_style` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`user_id`), - UNIQUE KEY `user_login` (`user_name`), - KEY `user_group_id` (`user_group_id`), - KEY `user_active` (`user_active`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=33 ; - - INSERT INTO `neltool_users` (`user_id`, `user_name`, `user_password`, `user_group_id`, `user_created`, `user_active`, `user_logged_last`, `user_logged_count`, `user_menu_style`) VALUES - (27, 'admin', '084e0343a0486ff05530df6c705c8bb4', 1, 1213886454, 1, 1273158945, 382, 2), - (32, 'guest', '084e0343a0486ff05530df6c705c8bb4', 1, 1272379014, 1, 1277452380, 274, 2); - - CREATE TABLE IF NOT EXISTS `neltool_user_applications` ( - `user_application_id` int(11) NOT NULL AUTO_INCREMENT, - `user_application_user_id` int(11) NOT NULL DEFAULT '0', - `user_application_application_id` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`user_application_id`), - KEY `user_application_user_id` (`user_application_user_id`), - KEY `user_application_application_id` (`user_application_application_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=22 ; - - INSERT INTO `neltool_user_applications` (`user_application_id`, `user_application_user_id`, `user_application_application_id`) VALUES - (8, 12, 33), - (20, 6, 31), - (19, 6, 34), - (9, 12, 31), - (21, 10, 34); - - CREATE TABLE IF NOT EXISTS `neltool_user_domains` ( - `user_domain_id` int(11) NOT NULL AUTO_INCREMENT, - `user_domain_user_id` int(11) NOT NULL DEFAULT '0', - `user_domain_domain_id` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`user_domain_id`), - KEY `user_domain_user_id` (`user_domain_user_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=20 ; - - INSERT INTO `neltool_user_domains` (`user_domain_id`, `user_domain_user_id`, `user_domain_domain_id`) VALUES - (5, 6, 2), - (9, 22, 1), - (10, 23, 4), - (4, 12, 3), - (6, 6, 3), - (11, 23, 2), - (12, 23, 1), - (13, 23, 8), - (18, 15, 1), - (17, 15, 2), - (19, 31, 9); - - CREATE TABLE IF NOT EXISTS `neltool_user_shards` ( - `user_shard_id` int(11) NOT NULL AUTO_INCREMENT, - `user_shard_user_id` int(11) NOT NULL DEFAULT '0', - `user_shard_shard_id` int(11) NOT NULL DEFAULT '0', - `user_shard_domain_id` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`user_shard_id`), - KEY `user_shard_user_id` (`user_shard_user_id`), - KEY `user_shard_domain_id` (`user_shard_domain_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=166 ; - - INSERT INTO `neltool_user_shards` (`user_shard_id`, `user_shard_user_id`, `user_shard_shard_id`, `user_shard_domain_id`) VALUES - (1, 8, 1, 1), - (2, 9, 2, 1), - (68, 7, 3, 1), - (143, 6, 4, 1), - (142, 6, 2, 1), - (141, 6, 45, 1), - (140, 6, 3, 1), - (90, 23, 26, 4), - (89, 23, 20, 4), - (13, 14, 1, 1), - (14, 14, 3, 1), - (15, 14, 2, 1), - (139, 6, 1, 1), - (74, 17, 2, 1), - (73, 17, 45, 1), - (72, 17, 3, 1), - (71, 17, 1, 1), - (70, 17, 18, 4), - (88, 23, 19, 4), - (87, 23, 24, 4), - (83, 23, 23, 4), - (82, 23, 22, 4), - (81, 23, 21, 4), - (34, 12, 15, 3), - (36, 18, 2, 1), - (138, 6, 7, 2), - (80, 23, 17, 4), - (79, 22, 45, 1), - (78, 22, 3, 1), - (77, 21, 45, 1), - (76, 21, 3, 1), - (75, 17, 4, 1), - (69, 7, 45, 1), - (146, 6, 54, 3), - (91, 23, 18, 4), - (92, 23, 7, 2), - (93, 23, 13, 2), - (94, 23, 8, 2), - (95, 23, 14, 2), - (145, 6, 53, 3), - (97, 23, 10, 2), - (144, 6, 15, 3), - (99, 23, 5, 1), - (100, 23, 6, 1), - (101, 23, 1, 1), - (102, 23, 3, 1), - (103, 23, 45, 1), - (104, 23, 46, 1), - (105, 23, 2, 1), - (106, 23, 42, 1), - (107, 23, 43, 1), - (108, 23, 44, 1), - (109, 23, 4, 1), - (110, 23, 41, 8), - (111, 23, 39, 8), - (112, 23, 30, 8), - (113, 23, 32, 8), - (114, 23, 47, 8), - (115, 23, 31, 8), - (116, 23, 36, 8), - (117, 23, 37, 8), - (118, 23, 40, 8), - (156, 15, 45, 1), - (155, 15, 3, 1), - (154, 15, 1, 1), - (153, 15, 6, 1), - (152, 15, 5, 1), - (151, 15, 10, 2), - (150, 15, 14, 2), - (149, 15, 8, 2), - (148, 15, 13, 2), - (147, 15, 7, 2), - (157, 15, 46, 1), - (158, 15, 2, 1), - (159, 15, 42, 1), - (160, 15, 43, 1), - (161, 15, 44, 1), - (162, 15, 4, 1), - (163, 31, 57, 9), - (164, 31, 104, 9), - (165, 31, 103, 9); - - GRANT ALL ON `" . $cfg['db']['tool']['name'] ."`.* TO `" . $cfg['db']['tool']['user'] ."`@".$cfg['db']['tool']['host']." identified by '".$cfg['db']['tool']['pass']."'; - "; - $dbn->executeWithoutParams($sql); - print "The nel_tool database was correctly installed!
"; - - //SETUP THE OPEN_SHARD DB - $dbw = new DBLayer("install", "ring"); - $sql = " - CREATE DATABASE IF NOT EXISTS `" . $cfg['db']['ring']['name'] ."` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; - USE `" . $cfg['db']['ring']['name'] ."`; - - CREATE TABLE IF NOT EXISTS `characters` ( - `char_id` int(10) unsigned NOT NULL DEFAULT '0', - `char_name` varchar(20) NOT NULL DEFAULT '', - `user_id` int(10) unsigned NOT NULL DEFAULT '0', - `guild_id` int(10) unsigned NOT NULL DEFAULT '0', - `best_combat_level` int(10) unsigned NOT NULL DEFAULT '0', - `home_mainland_session_id` int(10) unsigned NOT NULL DEFAULT '0', - `ring_access` varchar(63) NOT NULL DEFAULT '', - `race` enum('r_fyros','r_matis','r_tryker','r_zorai') NOT NULL DEFAULT 'r_fyros', - `civilisation` enum('c_neutral','c_fyros','c_fyros','c_matis','c_tryker','c_zorai') NOT NULL DEFAULT 'c_neutral', - `cult` enum('c_neutral','c_kami','c_karavan') NOT NULL DEFAULT 'c_neutral', - `current_session` int(11) unsigned NOT NULL DEFAULT '0', - `rrp_am` int(11) unsigned NOT NULL DEFAULT '0', - `rrp_masterless` int(11) unsigned NOT NULL DEFAULT '0', - `rrp_author` int(11) unsigned NOT NULL DEFAULT '0', - `newcomer` tinyint(1) NOT NULL DEFAULT '1', - `creation_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `last_played_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - PRIMARY KEY (`char_id`), - UNIQUE KEY `char_name_idx` (`char_name`,`home_mainland_session_id`), - KEY `user_id_idx` (`user_id`), - KEY `guild_idx` (`guild_id`), - KEY `guild_id_idx` (`guild_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1; - - CREATE TABLE IF NOT EXISTS `folder` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `owner` int(10) unsigned NOT NULL DEFAULT '0', - `title` varchar(40) NOT NULL DEFAULT '', - `comments` text NOT NULL, - PRIMARY KEY (`Id`), - KEY `owner_idx` (`owner`), - KEY `title_idx` (`title`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; - - - CREATE TABLE IF NOT EXISTS `folder_access` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `folder_id` int(10) unsigned NOT NULL DEFAULT '0', - `user_id` int(10) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`Id`), - KEY `folder_id_idx` (`folder_id`), - KEY `user_idx` (`user_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED AUTO_INCREMENT=1 ; - - - CREATE TABLE IF NOT EXISTS `guild_invites` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `session_id` int(10) unsigned NOT NULL DEFAULT '0', - `guild_id` int(10) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`Id`), - KEY `guild_id_idx` (`guild_id`), - KEY `session_id_idx` (`session_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED AUTO_INCREMENT=1 ; - - - CREATE TABLE IF NOT EXISTS `guilds` ( - `guild_id` int(10) unsigned NOT NULL DEFAULT '0', - `guild_name` varchar(50) NOT NULL DEFAULT '', - `shard_id` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`guild_id`), - KEY `shard_id_idx` (`shard_id`), - KEY `guild_name_idx` (`guild_name`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC; - - - CREATE TABLE IF NOT EXISTS `journal_entry` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `session_id` int(10) unsigned NOT NULL DEFAULT '0', - `author` int(10) unsigned NOT NULL DEFAULT '0', - `type` enum('jet_credits','jet_notes') NOT NULL DEFAULT 'jet_notes', - `text` text NOT NULL, - `time_stamp` datetime NOT NULL DEFAULT '2005-09-07 12:41:33', - PRIMARY KEY (`Id`), - KEY `session_id_idx` (`session_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; - - - CREATE TABLE IF NOT EXISTS `known_users` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `owner` int(10) unsigned NOT NULL DEFAULT '0', - `targer_user` int(10) unsigned NOT NULL DEFAULT '0', - `targer_character` int(10) unsigned NOT NULL DEFAULT '0', - `relation_type` enum('rt_friend','rt_banned','rt_friend_dm') NOT NULL DEFAULT 'rt_friend', - `comments` varchar(255) NOT NULL DEFAULT '', - PRIMARY KEY (`Id`), - KEY `user_index` (`owner`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; - - - CREATE TABLE IF NOT EXISTS `mfs_erased_mail_series` ( - `erased_char_id` int(11) unsigned NOT NULL DEFAULT '0', - `erased_char_name` varchar(32) NOT NULL DEFAULT '', - `erased_series` int(11) unsigned NOT NULL AUTO_INCREMENT, - `erase_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - PRIMARY KEY (`erased_series`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; - - - CREATE TABLE IF NOT EXISTS `mfs_guild_thread` ( - `thread_id` int(11) NOT NULL AUTO_INCREMENT, - `guild_id` int(11) unsigned NOT NULL DEFAULT '0', - `topic` varchar(255) NOT NULL DEFAULT '', - `author_name` varchar(32) NOT NULL DEFAULT '', - `last_post_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `post_count` int(11) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`thread_id`), - KEY `guild_index` (`guild_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; - - - CREATE TABLE IF NOT EXISTS `mfs_guild_thread_message` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `thread_id` int(11) unsigned NOT NULL DEFAULT '0', - `author_name` varchar(32) NOT NULL DEFAULT '', - `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `content` text NOT NULL, - PRIMARY KEY (`id`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; - - - CREATE TABLE IF NOT EXISTS `mfs_mail` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `sender_name` varchar(32) NOT NULL DEFAULT '', - `subject` varchar(250) NOT NULL DEFAULT '', - `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `status` enum('ms_new','ms_read','ms_erased') NOT NULL DEFAULT 'ms_new', - `dest_char_id` int(11) unsigned NOT NULL DEFAULT '0', - `erase_series` int(11) unsigned NOT NULL DEFAULT '0', - `content` text NOT NULL, - PRIMARY KEY (`id`), - KEY `dest_index` (`dest_char_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; - - - CREATE TABLE IF NOT EXISTS `outlands` ( - `session_id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `island_name` text NOT NULL, - `billing_instance_id` int(11) unsigned NOT NULL DEFAULT '0', - `anim_session_id` int(11) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`session_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; - - - CREATE TABLE IF NOT EXISTS `player_rating` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `scenario_id` int(10) unsigned NOT NULL DEFAULT '0', - `session_id` int(10) unsigned NOT NULL DEFAULT '0', - `rate_fun` tinyint(3) unsigned NOT NULL DEFAULT '0', - `rate_difficulty` tinyint(3) unsigned NOT NULL DEFAULT '0', - `rate_accessibility` tinyint(3) unsigned NOT NULL DEFAULT '0', - `rate_originality` tinyint(3) unsigned NOT NULL DEFAULT '0', - `rate_direction` tinyint(3) unsigned NOT NULL DEFAULT '0', - `author` int(10) unsigned NOT NULL DEFAULT '0', - `rating` int(10) NOT NULL DEFAULT '0', - `comments` text NOT NULL, - `time_stamp` datetime NOT NULL DEFAULT '2005-09-07 12:41:33', - PRIMARY KEY (`Id`), - KEY `session_id_idx` (`scenario_id`), - KEY `author_idx` (`author`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; - - - CREATE TABLE IF NOT EXISTS `ring_users` ( - `user_id` int(10) unsigned NOT NULL DEFAULT '0', - `user_name` varchar(20) NOT NULL DEFAULT '', - `user_type` enum('ut_character','ut_pioneer') NOT NULL DEFAULT 'ut_character', - `current_session` int(10) unsigned NOT NULL DEFAULT '0', - `current_activity` enum('ca_none','ca_play','ca_edit','ca_anim') NOT NULL DEFAULT 'ca_none', - `current_status` enum('cs_offline','cs_logged','cs_online') NOT NULL DEFAULT 'cs_offline', - `public_level` enum('pl_none','pl_public') NOT NULL DEFAULT 'pl_none', - `account_type` enum('at_normal','at_gold') NOT NULL DEFAULT 'at_normal', - `content_access_level` varchar(20) NOT NULL DEFAULT '', - `description` text NOT NULL, - `lang` enum('lang_en','lang_fr','lang_de') NOT NULL DEFAULT 'lang_en', - `cookie` varchar(30) NOT NULL DEFAULT '', - `current_domain_id` int(10) NOT NULL DEFAULT '-1', - `pioneer_char_id` int(11) unsigned NOT NULL DEFAULT '0', - `current_char` int(11) NOT NULL DEFAULT '0', - `add_privileges` varchar(64) NOT NULL, - PRIMARY KEY (`user_id`), - UNIQUE KEY `user_name_idx` (`user_name`), - KEY `cookie_idx` (`cookie`), - KEY `current_session_idx` (`current_session`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC; - - CREATE TABLE IF NOT EXISTS `scenario` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `md5` varchar(64) NOT NULL DEFAULT '', - `title` varchar(32) NOT NULL DEFAULT '', - `description` text NOT NULL, - `author` varchar(32) NOT NULL DEFAULT '', - `rrp_total` int(11) unsigned NOT NULL DEFAULT '0', - `anim_mode` enum('am_dm','am_autonomous') NOT NULL DEFAULT 'am_dm', - `language` varchar(11) NOT NULL DEFAULT '', - `orientation` enum('so_newbie_training','so_story_telling','so_mistery','so_hack_slash','so_guild_training','so_other') NOT NULL DEFAULT 'so_other', - `level` enum('sl_a','sl_b','sl_c','sl_d','sl_e','sl_f') NOT NULL DEFAULT 'sl_a', - `allow_free_trial` tinyint(1) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; - - - CREATE TABLE IF NOT EXISTS `scenario_desc` ( - `session_id` int(10) unsigned NOT NULL DEFAULT '0', - `parent_scenario` int(10) unsigned NOT NULL DEFAULT '0', - `description` text NOT NULL, - `relation_to_parent` enum('rtp_same','rtp_variant','rtp_different') NOT NULL DEFAULT 'rtp_same', - `title` varchar(40) NOT NULL DEFAULT '', - `num_player` int(10) unsigned NOT NULL DEFAULT '0', - `content_access_level` varchar(20) NOT NULL DEFAULT '', - PRIMARY KEY (`session_id`), - UNIQUE KEY `title_idx` (`title`), - KEY `parent_idx` (`parent_scenario`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC; - - - CREATE TABLE IF NOT EXISTS `session_log` ( - `id` int(11) NOT NULL DEFAULT '0', - `scenario_id` int(11) unsigned NOT NULL DEFAULT '0', - `rrp_scored` int(11) unsigned NOT NULL DEFAULT '0', - `scenario_point_scored` int(11) unsigned NOT NULL DEFAULT '0', - `time_taken` int(11) unsigned NOT NULL DEFAULT '0', - `participants` text NOT NULL, - `launch_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `owner` varchar(32) NOT NULL DEFAULT '0', - `guild_name` varchar(50) DEFAULT NULL, - PRIMARY KEY (`id`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC; - - - CREATE TABLE IF NOT EXISTS `session_participant` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `session_id` int(10) unsigned NOT NULL DEFAULT '0', - `char_id` int(10) unsigned NOT NULL DEFAULT '0', - `status` enum('sps_play_subscribed','sps_play_invited','sps_edit_invited','sps_anim_invited','sps_playing','sps_editing','sps_animating') NOT NULL DEFAULT 'sps_play_subscribed', - `kicked` tinyint(1) unsigned NOT NULL DEFAULT '0', - `session_rated` tinyint(1) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`Id`), - KEY `session_idx` (`session_id`), - KEY `user_idx` (`char_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED AUTO_INCREMENT=1 ; - - - CREATE TABLE IF NOT EXISTS `sessions` ( - `session_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `session_type` enum('st_edit','st_anim','st_outland','st_mainland') NOT NULL DEFAULT 'st_edit', - `title` varchar(40) NOT NULL DEFAULT '', - `owner` int(10) unsigned NOT NULL DEFAULT '0', - `plan_date` datetime NOT NULL DEFAULT '2005-09-21 12:41:33', - `start_date` datetime NOT NULL DEFAULT '2005-08-31 00:00:00', - `description` text NOT NULL, - `orientation` enum('so_newbie_training','so_story_telling','so_mistery','so_hack_slash','so_guild_training','so_other') NOT NULL DEFAULT 'so_other', - `level` enum('sl_a','sl_b','sl_c','sl_d','sl_e','sl_f') NOT NULL DEFAULT 'sl_a', - `rule_type` enum('rt_strict','rt_liberal') NOT NULL DEFAULT 'rt_strict', - `access_type` enum('at_public','at_private') NOT NULL DEFAULT 'at_private', - `state` enum('ss_planned','ss_open','ss_locked','ss_closed') NOT NULL DEFAULT 'ss_planned', - `host_shard_id` int(11) NOT NULL DEFAULT '0', - `subscription_slots` int(11) unsigned NOT NULL DEFAULT '0', - `reserved_slots` int(10) unsigned NOT NULL DEFAULT '0', - `free_slots` int(10) unsigned NOT NULL DEFAULT '0', - `estimated_duration` enum('et_short','et_medium','et_long') NOT NULL DEFAULT 'et_short', - `final_duration` int(10) unsigned NOT NULL DEFAULT '0', - `folder_id` int(10) unsigned NOT NULL DEFAULT '0', - `lang` varchar(20) NOT NULL DEFAULT '', - `icone` varchar(70) NOT NULL DEFAULT '', - `anim_mode` enum('am_dm','am_autonomous') NOT NULL DEFAULT 'am_dm', - `race_filter` set('rf_fyros','rf_matis','rf_tryker','rf_zorai') NOT NULL DEFAULT '', - `religion_filter` set('rf_kami','rf_karavan','rf_neutral') NOT NULL DEFAULT '', - `guild_filter` enum('gf_only_my_guild','gf_any_player') DEFAULT 'gf_only_my_guild', - `shard_filter` set('sf_shard00','sf_shard01','sf_shard02','sf_shard03','sf_shard04','sf_shard05','sf_shard06','sf_shard07','sf_shard08','sf_shard09','sf_shard10','sf_shard11','sf_shard12','sf_shard13','sf_shard14','sf_shard15','sf_shard16','sf_shard17','sf_shard18','sf_shard19','sf_shard20','sf_shard21','sf_shard22','sf_shard23','sf_shard24','sf_shard25','sf_shard26','sf_shard27','sf_shard28','sf_shard29','sf_shard30','sf_shard31') NOT NULL DEFAULT 'sf_shard00,sf_shard01,sf_shard02,sf_shard03,sf_shard04,sf_shard05,sf_shard06,sf_shard07,sf_shard08,sf_shard09,sf_shard10,sf_shard11,sf_shard12,sf_shard13,sf_shard14,sf_shard15,sf_shard16,sf_shard17,sf_shard18,sf_shard19,sf_shard20,sf_shard21,sf_shard22,sf_shard23,sf_shard24,sf_shard25,sf_shard26,sf_shard27,sf_shard28,sf_shard29,sf_shard30,sf_shard31', - `level_filter` set('lf_a','lf_b','lf_c','lf_d','lf_e','lf_f') NOT NULL DEFAULT 'lf_a,lf_b,lf_c,lf_d,lf_e,lf_f', - `subscription_closed` tinyint(1) NOT NULL DEFAULT '0', - `newcomer` tinyint(1) unsigned zerofill NOT NULL DEFAULT '0', - PRIMARY KEY (`session_id`), - KEY `owner_idx` (`owner`), - KEY `folder_idx` (`folder_id`), - KEY `state_type_idx` (`state`,`session_type`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=303 ; - - INSERT INTO `sessions` (`session_id`, `session_type`, `title`, `owner`, `plan_date`, `start_date`, `description`, `orientation`, `level`, `rule_type`, `access_type`, `state`, `host_shard_id`, `subscription_slots`, `reserved_slots`, `free_slots`, `estimated_duration`, `final_duration`, `folder_id`, `lang`, `icone`, `anim_mode`, `race_filter`, `religion_filter`, `guild_filter`, `shard_filter`, `level_filter`, `subscription_closed`, `newcomer`) VALUES - (302, 'st_mainland', 'open shard mainland', 0, '2005-09-21 12:41:33', '2005-08-31 00:00:00', '', 'so_other', 'sl_a', 'rt_strict', 'at_public', 'ss_planned', 0, 0, 0, 0, 'et_short', 0, 0, 'lang_en', '', 'am_dm', 'rf_fyros,rf_matis,rf_tryker,rf_zorai', 'rf_kami,rf_karavan,rf_neutral', 'gf_any_player', '', 'lf_a,lf_b,lf_c,lf_d,lf_e,lf_f', 0, 0); - - CREATE TABLE IF NOT EXISTS `shard` ( - `shard_id` int(10) NOT NULL DEFAULT '0', - `WSOnline` tinyint(1) NOT NULL DEFAULT '0', - `MOTD` text NOT NULL, - `OldState` enum('ds_close','ds_dev','ds_restricted','ds_open') NOT NULL DEFAULT 'ds_restricted', - `RequiredState` enum('ds_close','ds_dev','ds_restricted','ds_open') NOT NULL DEFAULT 'ds_dev', - PRIMARY KEY (`shard_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED; - - INSERT INTO `shard` (`shard_id`, `WSOnline`, `MOTD`, `OldState`, `RequiredState`) VALUES - (302, 1, 'Shard up', 'ds_restricted', 'ds_open'); - - INSERT INTO `sessions` (`session_id`, `session_type`, `title`, `owner`, `plan_date`, `start_date`, `description`, `orientation`, `level`, `rule_type`, `access_type`, `state`, `host_shard_id`, `subscription_slots`, `reserved_slots`, `free_slots`, `estimated_duration`, `final_duration`, `folder_id`, `lang`, `icone`, `anim_mode`, `race_filter`, `religion_filter`, `guild_filter`, `shard_filter`, `level_filter`, `subscription_closed`, `newcomer`) VALUES (302, 'st_mainland', 'open shard mainland', 0, '2005-09-21 12:41:33', '2005-08-31 00:00:00', '', 'so_other', 'sl_a', 'rt_strict', 'at_public', 'ss_planned', 0, 0, 0, 0, 'et_short', 0, 0, 'lang_en', '', 'am_dm', 'rf_fyros,rf_matis,rf_tryker,rf_zorai', 'rf_kami,rf_karavan,rf_neutral', 'gf_any_player', '', 'lf_a,lf_b,lf_c,lf_d,lf_e,lf_f', 0, 0); - - GRANT ALL ON `" . $cfg['db']['ring']['name'] ."`.* TO `" . $cfg['db']['ring']['user'] ."`@".$cfg['db']['ring']['host']." identified by '".$cfg['db']['ring']['pass']."'; - "; - $dbw->executeWithoutParams($sql); - - print "The ring_open database was correctly installed!
"; - - - //Now create an admin account! - $hashpass = crypt("admin", Users::generateSALT()); - $params = array( - 'name' => "admin", - 'pass' => $hashpass, - 'mail' => "admin@admin.com", - ); - try{ - $user_id = WebUsers::createWebuser($params['name'], $params['pass'],$params['mail']); - $result = Webusers::createUser($params, $user_id); - Users::createPermissions(array($params['name'])); - $dbl = new DBLayer("lib"); - $dbl->execute("UPDATE ticket_user SET Permission = 3 WHERE TUserId = :user_id",array('user_id' => $user_id)); - print "The admin account is created, you can login with id: admin, pass: admin!"; - }catch (PDOException $e){ - print "There was an error while creating the admin account! "; - print_r($e); - } - - - echo '
Reload! '; - - touch("../is_installed"); - - exit; - - - - }catch (PDOException $e) { - //go to error page or something, because can't access website db - print "There was an error while installing"; - print_r($e); - } - } - diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/js/charisma.js b/code/ryzom/tools/server/ryzom_ams/www/html/js/charisma.js deleted file mode 100644 index 42c64932b..000000000 --- a/code/ryzom/tools/server/ryzom_ams/www/html/js/charisma.js +++ /dev/null @@ -1,691 +0,0 @@ -$(document).ready(function(){ - //themes, change CSS with JS - //default theme(CSS) is cerulean, change it if needed - var current_theme = $.cookie('current_theme')==null ? 'cerulean' :$.cookie('current_theme'); - switch_theme(current_theme); - - $('#themes a[data-value="'+current_theme+'"]').find('i').addClass('icon-ok'); - - $('#themes a').click(function(e){ - e.preventDefault(); - current_theme=$(this).attr('data-value'); - $.cookie('current_theme',current_theme,{expires:365}); - switch_theme(current_theme); - $('#themes i').removeClass('icon-ok'); - $(this).find('i').addClass('icon-ok'); - }); - - - function switch_theme(theme_name) - { - $('#bs-css').attr('href','css/bootstrap-'+theme_name+'.css'); - } - - //ajax menu checkbox - $('#is-ajax').click(function(e){ - $.cookie('is-ajax',$(this).prop('checked'),{expires:365}); - }); - $('#is-ajax').prop('checked',$.cookie('is-ajax')==='true' ? true : false); - - //disbaling some functions for Internet Explorer - if($.browser.msie) - { - $('#is-ajax').prop('checked',false); - $('#for-is-ajax').hide(); - $('#toggle-fullscreen').hide(); - $('.login-box').find('.input-large').removeClass('span10'); - - } - - - //highlight current / active link - $('ul.main-menu li a').each(function(){ - if($($(this))[0].href==String(window.location)) - $(this).parent().addClass('active'); - }); - - //establish history variables - var - History = window.History, // Note: We are using a capital H instead of a lower h - State = History.getState(), - $log = $('#log'); - - //bind to State Change - History.Adapter.bind(window,'statechange',function(){ // Note: We are using statechange instead of popstate - var State = History.getState(); // Note: We are using History.getState() instead of event.state - $.ajax({ - url:State.url, - success:function(msg){ - $('#content').html($(msg).find('#content').html()); - $('#loading').remove(); - $('#content').fadeIn(); - var newTitle = $(msg).filter('title').text(); - $('title').text(newTitle); - docReady(); - } - }); - }); - - //ajaxify menus - $('a.ajax-link').click(function(e){ - if($.browser.msie) e.which=1; - if(e.which!=1 || !$('#is-ajax').prop('checked') || $(this).parent().hasClass('active')) return; - e.preventDefault(); - if($('.btn-navbar').is(':visible')) - { - $('.btn-navbar').click(); - } - $('#loading').remove(); - $('#content').fadeOut().parent().append('
Loading...
'); - var $clink=$(this); - History.pushState(null, null, $clink.attr('href')); - $('ul.main-menu li.active').removeClass('active'); - $clink.parent('li').addClass('active'); - }); - - //animating menus on hover - $('ul.main-menu li:not(.nav-header)').hover(function(){ - $(this).animate({'margin-left':'+=5'},300); - }, - function(){ - $(this).animate({'margin-left':'-=5'},300); - }); - - //other things to do on document ready, seperated for ajax calls - docReady(); -}); - - -function docReady(){ - //prevent # links from moving to top - $('a[href="#"][data-top!=true]').click(function(e){ - e.preventDefault(); - }); - - //rich text editor - $('.cleditor').cleditor(); - - //datepicker - $('.datepicker').datepicker(); - - //notifications - $('.noty').click(function(e){ - e.preventDefault(); - var options = $.parseJSON($(this).attr('data-noty-options')); - noty(options); - }); - - - //uniform - styler for checkbox, radio and file input - $("input:checkbox, input:radio, input:file").not('[data-no-uniform="true"],#uniform-is-ajax').uniform(); - - //chosen - improves select - $('[data-rel="chosen"],[rel="chosen"]').chosen(); - - //tabs - $('#myTab a:first').tab('show'); - $('#myTab a').click(function (e) { - e.preventDefault(); - $(this).tab('show'); - }); - - //makes elements soratble, elements that sort need to have id attribute to save the result - $('.sortable').sortable({ - revert:true, - cancel:'.btn,.box-content,.nav-header', - update:function(event,ui){ - //line below gives the ids of elements, you can make ajax call here to save it to the database - //console.log($(this).sortable('toArray')); - } - }); - - //slider - $('.slider').slider({range:true,values:[10,65]}); - - //tooltip - $('[rel="tooltip"],[data-rel="tooltip"]').tooltip({"placement":"bottom",delay: { show: 400, hide: 200 }}); - - //auto grow textarea - $('textarea.autogrow').autogrow(); - - //popover - $('[rel="popover"],[data-rel="popover"]').popover(); - - //file manager - var elf = $('.file-manager').elfinder({ - url : 'misc/elfinder-connector/connector.php' // connector URL (REQUIRED) - }).elfinder('instance'); - - //iOS / iPhone style toggle switch - $('.iphone-toggle').iphoneStyle(); - - //star rating - $('.raty').raty({ - score : 4 //default stars - }); - - //uploadify - multiple uploads - $('#file_upload').uploadify({ - 'swf' : 'misc/uploadify.swf', - 'uploader' : 'misc/uploadify.php' - // Put your options here - }); - - //gallery controlls container animation - $('ul.gallery li').hover(function(){ - $('img',this).fadeToggle(1000); - $(this).find('.gallery-controls').remove(); - $(this).append(''); - $(this).find('.gallery-controls').stop().animate({'margin-top':'-1'},400,'easeInQuint'); - },function(){ - $('img',this).fadeToggle(1000); - $(this).find('.gallery-controls').stop().animate({'margin-top':'-30'},200,'easeInQuint',function(){ - $(this).remove(); - }); - }); - - - //gallery image controls example - //gallery delete - $('.thumbnails').on('click','.gallery-delete',function(e){ - e.preventDefault(); - //get image id - //alert($(this).parents('.thumbnail').attr('id')); - $(this).parents('.thumbnail').fadeOut(); - }); - //gallery edit - $('.thumbnails').on('click','.gallery-edit',function(e){ - e.preventDefault(); - //get image id - //alert($(this).parents('.thumbnail').attr('id')); - }); - - //gallery colorbox - $('.thumbnail a').colorbox({rel:'thumbnail a', transition:"elastic", maxWidth:"95%", maxHeight:"95%"}); - - //gallery fullscreen - $('#toggle-fullscreen').button().click(function () { - var button = $(this), root = document.documentElement; - if (!button.hasClass('active')) { - $('#thumbnails').addClass('modal-fullscreen'); - if (root.webkitRequestFullScreen) { - root.webkitRequestFullScreen( - window.Element.ALLOW_KEYBOARD_INPUT - ); - } else if (root.mozRequestFullScreen) { - root.mozRequestFullScreen(); - } - } else { - $('#thumbnails').removeClass('modal-fullscreen'); - (document.webkitCancelFullScreen || - document.mozCancelFullScreen || - $.noop).apply(document); - } - }); - - //tour - if($('.tour').length && typeof(tour)=='undefined') - { - var tour = new Tour(); - tour.addStep({ - element: ".span10:first", /* html element next to which the step popover should be shown */ - placement: "top", - title: "Custom Tour", /* title of the popover */ - content: "You can create tour like this. Click Next." /* content of the popover */ - }); - tour.addStep({ - element: ".theme-container", - placement: "left", - title: "Themes", - content: "You change your theme from here." - }); - tour.addStep({ - element: "ul.main-menu a:first", - title: "Dashboard", - content: "This is your dashboard from here you will find highlights." - }); - - tour.restart(); - } - - //datatable - $('.datatable').dataTable({ - "sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span12'i><'span12 center'p>>", - "sPaginationType": "bootstrap", - "oLanguage": { - "sLengthMenu": "_MENU_ records per page" - } - } ); - $('.btn-close').click(function(e){ - e.preventDefault(); - $(this).parent().parent().parent().fadeOut(); - }); - $('.btn-minimize').click(function(e){ - e.preventDefault(); - var $target = $(this).parent().parent().next('.box-content'); - if($target.is(':visible')) $('i',$(this)).removeClass('icon-chevron-up').addClass('icon-chevron-down'); - else $('i',$(this)).removeClass('icon-chevron-down').addClass('icon-chevron-up'); - $target.slideToggle(); - }); - $('.btn-setting').click(function(e){ - e.preventDefault(); - $('#myModal').modal('show'); - }); - - - - - //initialize the external events for calender - - $('#external-events div.external-event').each(function() { - - // it doesn't need to have a start or end - var eventObject = { - title: $.trim($(this).text()) // use the element's text as the event title - }; - - // store the Event Object in the DOM element so we can get to it later - $(this).data('eventObject', eventObject); - - // make the event draggable using jQuery UI - $(this).draggable({ - zIndex: 999, - revert: true, // will cause the event to go back to its - revertDuration: 0 // original position after the drag - }); - - }); - - - //initialize the calendar - $('#calendar').fullCalendar({ - header: { - left: 'prev,next today', - center: 'title', - right: 'month,agendaWeek,agendaDay' - }, - editable: true, - droppable: true, // this allows things to be dropped onto the calendar !!! - drop: function(date, allDay) { // this function is called when something is dropped - - // retrieve the dropped element's stored Event Object - var originalEventObject = $(this).data('eventObject'); - - // we need to copy it, so that multiple events don't have a reference to the same object - var copiedEventObject = $.extend({}, originalEventObject); - - // assign it the date that was reported - copiedEventObject.start = date; - copiedEventObject.allDay = allDay; - - // render the event on the calendar - // the last `true` argument determines if the event "sticks" (http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/) - $('#calendar').fullCalendar('renderEvent', copiedEventObject, true); - - // is the "remove after drop" checkbox checked? - if ($('#drop-remove').is(':checked')) { - // if so, remove the element from the "Draggable Events" list - $(this).remove(); - } - - } - }); - - - //chart with points - if($("#sincos").length) - { - var sin = [], cos = []; - - for (var i = 0; i < 14; i += 0.5) { - sin.push([i, Math.sin(i)/i]); - cos.push([i, Math.cos(i)]); - } - - var plot = $.plot($("#sincos"), - [ { data: sin, label: "sin(x)/x"}, { data: cos, label: "cos(x)" } ], { - series: { - lines: { show: true }, - points: { show: true } - }, - grid: { hoverable: true, clickable: true, backgroundColor: { colors: ["#fff", "#eee"] } }, - yaxis: { min: -1.2, max: 1.2 }, - colors: ["#539F2E", "#3C67A5"] - }); - - function showTooltip(x, y, contents) { - $('
' + contents + '
').css( { - position: 'absolute', - display: 'none', - top: y + 5, - left: x + 5, - border: '1px solid #fdd', - padding: '2px', - 'background-color': '#dfeffc', - opacity: 0.80 - }).appendTo("body").fadeIn(200); - } - - var previousPoint = null; - $("#sincos").bind("plothover", function (event, pos, item) { - $("#x").text(pos.x.toFixed(2)); - $("#y").text(pos.y.toFixed(2)); - - if (item) { - if (previousPoint != item.dataIndex) { - previousPoint = item.dataIndex; - - $("#tooltip").remove(); - var x = item.datapoint[0].toFixed(2), - y = item.datapoint[1].toFixed(2); - - showTooltip(item.pageX, item.pageY, - item.series.label + " of " + x + " = " + y); - } - } - else { - $("#tooltip").remove(); - previousPoint = null; - } - }); - - - - $("#sincos").bind("plotclick", function (event, pos, item) { - if (item) { - $("#clickdata").text("You clicked point " + item.dataIndex + " in " + item.series.label + "."); - plot.highlight(item.series, item.datapoint); - } - }); - } - - //flot chart - if($("#flotchart").length) - { - var d1 = []; - for (var i = 0; i < Math.PI * 2; i += 0.25) - d1.push([i, Math.sin(i)]); - - var d2 = []; - for (var i = 0; i < Math.PI * 2; i += 0.25) - d2.push([i, Math.cos(i)]); - - var d3 = []; - for (var i = 0; i < Math.PI * 2; i += 0.1) - d3.push([i, Math.tan(i)]); - - $.plot($("#flotchart"), [ - { label: "sin(x)", data: d1}, - { label: "cos(x)", data: d2}, - { label: "tan(x)", data: d3} - ], { - series: { - lines: { show: true }, - points: { show: true } - }, - xaxis: { - ticks: [0, [Math.PI/2, "\u03c0/2"], [Math.PI, "\u03c0"], [Math.PI * 3/2, "3\u03c0/2"], [Math.PI * 2, "2\u03c0"]] - }, - yaxis: { - ticks: 10, - min: -2, - max: 2 - }, - grid: { - backgroundColor: { colors: ["#fff", "#eee"] } - } - }); - } - - //stack chart - if($("#stackchart").length) - { - var d1 = []; - for (var i = 0; i <= 10; i += 1) - d1.push([i, parseInt(Math.random() * 30)]); - - var d2 = []; - for (var i = 0; i <= 10; i += 1) - d2.push([i, parseInt(Math.random() * 30)]); - - var d3 = []; - for (var i = 0; i <= 10; i += 1) - d3.push([i, parseInt(Math.random() * 30)]); - - var stack = 0, bars = true, lines = false, steps = false; - - function plotWithOptions() { - $.plot($("#stackchart"), [ d1, d2, d3 ], { - series: { - stack: stack, - lines: { show: lines, fill: true, steps: steps }, - bars: { show: bars, barWidth: 0.6 } - } - }); - } - - plotWithOptions(); - - $(".stackControls input").click(function (e) { - e.preventDefault(); - stack = $(this).val() == "With stacking" ? true : null; - plotWithOptions(); - }); - $(".graphControls input").click(function (e) { - e.preventDefault(); - bars = $(this).val().indexOf("Bars") != -1; - lines = $(this).val().indexOf("Lines") != -1; - steps = $(this).val().indexOf("steps") != -1; - plotWithOptions(); - }); - } - - //pie chart - var data = [ - { label: "Internet Explorer", data: 12}, - { label: "Mobile", data: 27}, - { label: "Safari", data: 85}, - { label: "Opera", data: 64}, - { label: "Firefox", data: 90}, - { label: "Chrome", data: 112} - ]; - - if($("#piechart").length) - { - $.plot($("#piechart"), data, - { - series: { - pie: { - show: true - } - }, - grid: { - hoverable: true, - clickable: true - }, - legend: { - show: false - } - }); - - function pieHover(event, pos, obj) - { - if (!obj) - return; - percent = parseFloat(obj.series.percent).toFixed(2); - $("#hover").html(''+obj.series.label+' ('+percent+'%)'); - } - $("#piechart").bind("plothover", pieHover); - } - - //donut chart - if($("#donutchart").length) - { - $.plot($("#donutchart"), data, - { - series: { - pie: { - innerRadius: 0.5, - show: true - } - }, - legend: { - show: false - } - }); - } - - - - - // we use an inline data source in the example, usually data would - // be fetched from a server - var data = [], totalPoints = 300; - function getRandomData() { - if (data.length > 0) - data = data.slice(1); - - // do a random walk - while (data.length < totalPoints) { - var prev = data.length > 0 ? data[data.length - 1] : 50; - var y = prev + Math.random() * 10 - 5; - if (y < 0) - y = 0; - if (y > 100) - y = 100; - data.push(y); - } - - // zip the generated y values with the x values - var res = []; - for (var i = 0; i < data.length; ++i) - res.push([i, data[i]]) - return res; - } - - // setup control widget - var updateInterval = 30; - $("#updateInterval").val(updateInterval).change(function () { - var v = $(this).val(); - if (v && !isNaN(+v)) { - updateInterval = +v; - if (updateInterval < 1) - updateInterval = 1; - if (updateInterval > 2000) - updateInterval = 2000; - $(this).val("" + updateInterval); - } - }); - - //realtime chart - if($("#realtimechart").length) - { - var options = { - series: { shadowSize: 1 }, // drawing is faster without shadows - yaxis: { min: 0, max: 100 }, - xaxis: { show: false } - }; - var plot = $.plot($("#realtimechart"), [ getRandomData() ], options); - function update() { - plot.setData([ getRandomData() ]); - // since the axes don't change, we don't need to call plot.setupGrid() - plot.draw(); - - setTimeout(update, updateInterval); - } - - update(); - } -} - - -//additional functions for data table -$.fn.dataTableExt.oApi.fnPagingInfo = function ( oSettings ) -{ - return { - "iStart": oSettings._iDisplayStart, - "iEnd": oSettings.fnDisplayEnd(), - "iLength": oSettings._iDisplayLength, - "iTotal": oSettings.fnRecordsTotal(), - "iFilteredTotal": oSettings.fnRecordsDisplay(), - "iPage": Math.ceil( oSettings._iDisplayStart / oSettings._iDisplayLength ), - "iTotalPages": Math.ceil( oSettings.fnRecordsDisplay() / oSettings._iDisplayLength ) - }; -} -$.extend( $.fn.dataTableExt.oPagination, { - "bootstrap": { - "fnInit": function( oSettings, nPaging, fnDraw ) { - var oLang = oSettings.oLanguage.oPaginate; - var fnClickHandler = function ( e ) { - e.preventDefault(); - if ( oSettings.oApi._fnPageChange(oSettings, e.data.action) ) { - fnDraw( oSettings ); - } - }; - - $(nPaging).addClass('pagination').append( - '' - ); - var els = $('a', nPaging); - $(els[0]).bind( 'click.DT', { action: "previous" }, fnClickHandler ); - $(els[1]).bind( 'click.DT', { action: "next" }, fnClickHandler ); - }, - - "fnUpdate": function ( oSettings, fnDraw ) { - var iListLength = 5; - var oPaging = oSettings.oInstance.fnPagingInfo(); - var an = oSettings.aanFeatures.p; - var i, j, sClass, iStart, iEnd, iHalf=Math.floor(iListLength/2); - - if ( oPaging.iTotalPages < iListLength) { - iStart = 1; - iEnd = oPaging.iTotalPages; - } - else if ( oPaging.iPage <= iHalf ) { - iStart = 1; - iEnd = iListLength; - } else if ( oPaging.iPage >= (oPaging.iTotalPages-iHalf) ) { - iStart = oPaging.iTotalPages - iListLength + 1; - iEnd = oPaging.iTotalPages; - } else { - iStart = oPaging.iPage - iHalf + 1; - iEnd = iStart + iListLength - 1; - } - - for ( i=0, iLen=an.length ; i'+j+'') - .insertBefore( $('li:last', an[i])[0] ) - .bind('click', function (e) { - e.preventDefault(); - oSettings._iDisplayStart = (parseInt($('a', this).text(),10)-1) * oPaging.iLength; - fnDraw( oSettings ); - } ); - } - - // add / remove disabled classes from the static elements - if ( oPaging.iPage === 0 ) { - $('li:first', an[i]).addClass('disabled'); - } else { - $('li:first', an[i]).removeClass('disabled'); - } - - if ( oPaging.iPage === oPaging.iTotalPages-1 || oPaging.iTotalPages === 0 ) { - $('li:last', an[i]).addClass('disabled'); - } else { - $('li:last', an[i]).removeClass('disabled'); - } - } - } - } -}); diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/templates/layout_admin.tpl b/code/ryzom/tools/server/ryzom_ams/www/html/templates/layout_admin.tpl deleted file mode 100644 index c50c1c20d..000000000 --- a/code/ryzom/tools/server/ryzom_ams/www/html/templates/layout_admin.tpl +++ /dev/null @@ -1,15 +0,0 @@ -{extends file="layout.tpl"} -{block name=menu} - -
  • Dashboard
  • -
  • Profile
  • -
  • Settings
  • - -
  • Users
  • -
  • Queues
  • -
  • Support Groups
  • - -
  • Syncing
  • -
  • Logout
  • -{/block} - diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/templates/layout_mod.tpl b/code/ryzom/tools/server/ryzom_ams/www/html/templates/layout_mod.tpl deleted file mode 100644 index e0a77d99a..000000000 --- a/code/ryzom/tools/server/ryzom_ams/www/html/templates/layout_mod.tpl +++ /dev/null @@ -1,14 +0,0 @@ -{extends file="layout.tpl"} -{block name=menu} - -
  • Dashboard
  • -
  • Profile
  • -
  • Settings
  • - -
  • Users
  • -
  • Queues
  • -
  • Support Groups
  • - -
  • Logout
  • -{/block} - diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/templates/layout_user.tpl b/code/ryzom/tools/server/ryzom_ams/www/html/templates/layout_user.tpl deleted file mode 100644 index 301af12b6..000000000 --- a/code/ryzom/tools/server/ryzom_ams/www/html/templates/layout_user.tpl +++ /dev/null @@ -1,10 +0,0 @@ -{extends file="layout.tpl"} -{block name=menu} - -
  • Profile
  • -
  • Settings
  • - -
  • Create New Ticket
  • -
  • Logout
  • -{/block} - diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/templates/settings.tpl b/code/ryzom/tools/server/ryzom_ams/www/html/templates/settings.tpl deleted file mode 100644 index e4c545c98..000000000 --- a/code/ryzom/tools/server/ryzom_ams/www/html/templates/settings.tpl +++ /dev/null @@ -1,338 +0,0 @@ -{block name=content} -
    -
    -
    -

    Change Password

    -
    - - -
    -
    -
    -
    -
    - Change Password - - {if !isset($changesOther) or $changesOther eq "FALSE"} -
    - -
    -
    - - - {if isset($MATCH_ERROR) and $MATCH_ERROR eq "TRUE"}The password is incorrect{/if} -
    -
    -
    - {/if} -
    - -
    -
    - - - {if isset($NEWPASSWORD_ERROR) and $NEWPASSWORD_ERROR eq "TRUE"}{$newpass_error_message}{/if} -
    -
    -
    - -
    - -
    -
    - - - {if isset($CNEWPASSWORD_ERROR) and $CNEWPASSWORD_ERROR eq "TRUE"}{$confirmnewpass_error_message}{/if} -
    -
    -
    - - - - {if isset($SUCCESS_PASS) and $SUCCESS_PASS eq "OK"} -
    - The password has been changed! -
    - {/if} - - {if isset($SUCCESS_PASS) and $SUCCESS_PASS eq "SHARDOFF"} -
    - The password has been changed, though the shard seems offline, it may take some time to see the change on the shard. -
    - {/if} - - - -
    - -
    - -
    -
    -
    -
    -
    -
    - - -
    -
    -

    Add User

    -
    - - -
    -
    -
    -
    -
    - Add User - -
    - -
    -
    - - -
    -
    -
    - -
    - -
    -
    - - -
    -
    -
    - -
    - -
    -
    - - -
    -
    -
    - -
    - -
    -
    - - -
    -
    -
    - - - {if isset($SUCCESS_PASS) and $SUCCESS_PASS eq "OK"} -
    - The user is created! -
    - {/if} - - {if isset($SUCCESS_PASS) and $SUCCESS_PASS eq "SHARDOFF"} -
    - The user can't be created. -
    - {/if} - - - -
    - -
    - -
    -
    -
    -
    -
    -
    - - -
    -
    -

    Change Email

    -
    - - -
    -
    -
    -
    -
    - Change Email -
    - -
    -
    - - - {if isset($EMAIL_ERROR) and $EMAIL_ERROR eq "TRUE"}{$EMAIL}{/if} - -
    -
    -
    - - - {if isset($SUCCESS_MAIL) and $SUCCESS_MAIL eq "OK"} -
    - The email has been changed! -
    - {/if} - - {if isset($SUCCESS_MAIL) and $SUCCESS_MAIL eq "SHARDOFF"} -
    - The email has been changed, though the shard seems offline, it may take some time to see the change on the shard. -
    - {/if} - - - -
    - -
    - -
    -
    -
    -
    -
    -
    - -
    - -
    -

    Ticket updates

    -
    - - -
    -
    - - -
    -
    -
    - Ticket-Update Mail Settings - -
    - -
    - -
    - -
    - - - -
    - -
    - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Change Info

    -
    - - -
    -
    -
    -
    -
    - Change Info - -
    - -
    -
    - - -
    -
    -
    - -
    - -
    -
    - - -
    -
    -
    - -
    - -
    - -
    -
    - -
    - -
    - -
    - -
    - -
    -
    - - {if isset($info_updated) and $info_updated eq "OK"} -
    - The Info has been updated! -
    - {/if} - - - -
    - -
    - -
    -
    -
    -
    -
    -
    -
    - - - -{/block} - diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_reply.tpl b/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_reply.tpl deleted file mode 100644 index 65f3f679b..000000000 --- a/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_reply.tpl +++ /dev/null @@ -1,33 +0,0 @@ -{block name=content} -
    -
    -
    -

    Show Reply

    -
    - - -
    -
    -
    -
    - Reply ID#{$reply_id} of Ticket #{$ticket_id} - - - - -
    -

    {$reply_timestamp} - {if $author_permission eq '1'} - {if isset($isMod) and $isMod eq "TRUE"} {$authorName}{else} {$authorName} {/if}

    - {else if $author_permission gt '1'} - {if isset($isMod) and $isMod eq "TRUE"} {$authorName}{else} {$authorName} {/if}

    - {/if} -

    {if $hidden eq 1}{/if}{$reply_content}{if $hidden eq 1}{/if}

    - -
    -
    -
    -
    -
    -{/block} - diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/templates/syncing.tpl b/code/ryzom/tools/server/ryzom_ams/www/html/templates/syncing.tpl deleted file mode 100644 index 56bd0cca3..000000000 --- a/code/ryzom/tools/server/ryzom_ams/www/html/templates/syncing.tpl +++ /dev/null @@ -1,82 +0,0 @@ -{block name=content} - -
    -
    -
    -

    {$syncing_title}

    -
    - - - - -
    -
    -
    -
    -

    {$syncing_info}

    - {if $shard eq "online"} -
    - {$shard_online}{$syncing_sync} - -
    - {else} -
    - {$shard_offline} -
    - {/if} -
    -
    -
    -
    -
    -
    -
    -
    -

    {$members}

    -
    - - - -
    -
    -
    - - - - - - - - - {foreach from=$liblist item=element} - - - - - - - {/foreach} - - -
    {$id}{$type}
    {$element.id}{$element.type}
    -
    -
      -
    • «
    • - {foreach from=$links item=link} -
    • {$link}
    • - {/foreach} -
    • »
    • -
    -
    -
    -
    - -
    -{/block} - diff --git a/code/ryzom/tools/server/admin/crons/index.html b/code/ryzom/tools/server/ryzom_ams/www/is_installed similarity index 100% rename from code/ryzom/tools/server/admin/crons/index.html rename to code/ryzom/tools/server/ryzom_ams/www/is_installed diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/add__sgroup_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/add__sgroup_8php.html deleted file mode 100644 index f525076f5..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/add__sgroup_8php.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/add_sgroup.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/add_sgroup.php File Reference
    -
    -
    - - - - -

    -Functions

     add_sgroup ()
     This function is beign used to add a new Support Group to the database.
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    add_sgroup ()
    -
    -
    - -

    This function is beign used to add a new Support Group to the database.

    -

    What it will do is check if the user who executed the function is an Admin, if so then it will filter all POST'ed data and use it to create a new Support_Group entry. if not logged in or not an admin, an appropriate redirection to an error page will take place.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/add__user_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/add__user_8php.html deleted file mode 100644 index 0b89554f9..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/add__user_8php.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/add_user.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/add_user.php File Reference
    -
    -
    - - - - - -

    -Functions

     add_user ()
     This function is beign used to add a new user to the www database.
     write_user ($newUser)
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    add_user ()
    -
    -
    - -

    This function is beign used to add a new user to the www database.

    -

    it will first check if the sent $_POST variables are valid for registering, if one or more rules are broken (eg the username is too short) the template will be reloaded but this time with the appropriate error messages. If the checking was successful it will call the write_user() function (located in this same file). That function will create a new www user and matching ticket_user. It will also push the newly created user to the shard. In case the shard is offline, the new user will be temporary stored in the ams_querycache, waiting for the sync cron job to update it.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    - -
    -
    - - - - - - - - -
    write_user (newUser)
    -
    -
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/add__user__to__sgroup_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/add__user__to__sgroup_8php.html deleted file mode 100644 index 878ce18d0..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/add__user__to__sgroup_8php.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/add_user_to_sgroup.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/add_user_to_sgroup.php File Reference
    -
    -
    - - - - -

    -Functions

     add_user_to_sgroup ()
     This function is beign used to add a user to a support group.
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    add_user_to_sgroup ()
    -
    -
    - -

    This function is beign used to add a user to a support group.

    -

    It will first check if the user who executed this function is an admin. If the user exists it will try to add it to the supportgroup, in case it's not a mod or admin it will not add it to the group. if the executing user is not an admin or not logged in, the page will be redirected to the error page.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/annotated.html b/code/ryzom/tools/server/ryzom_ams_docs/html/annotated.html deleted file mode 100644 index dd7fc058c..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/annotated.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - - -Ryzom Account Management System: Data Structures - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    -
    -
    Data Structures
    -
    -
    -
    Here are the data structures with brief descriptions:
    - - - - - - - - - - - - - - - - - - - - - - - -
    AssignedHandles the assigning of a ticket to a user
    DBLayerHandles the database connections
    ForwardedHandles the forwarding of a ticket to a support_group
    Gui_ElementsHelper class for generating gui related elements
    HelpersHelper class for more site specific functions
    In_Support_GroupHandles the linkage of users being in a support group
    Mail_HandlerHandles the mailing functionality
    MyCryptBasic encryption/decryption class
    PaginationHandles returning arrays based on a given pagenumber
    QuerycacheClass for storing changes when shard is offline
    Support_GroupGroups moderators & admins together
    SyncHandler for performing changes when shard is back online after being offline
    TicketClass that handles most ticket related functions
    Ticket_CategoryClass related to the ticket categories
    Ticket_ContentClass that handles the content of a reply
    Ticket_InfoClass that handles additional info sent by ticket creation ingame
    Ticket_LogClass that handles the logging
    Ticket_QueueData class that holds a lot of queries that load specific tickets
    Ticket_Queue_HandlerReturns tickets (queues) that are related in some way
    Ticket_ReplyHandles functions related to replies on tickets
    Ticket_UserUser entry point in the ticket system
    UsersHandles basic user registration & management functions (shard related)
    WebUsersHandles CMS/WWW related functions regarding user management & registration
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/assigned_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/assigned_8php.html deleted file mode 100644 index 54e26a775..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/assigned_8php.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/assigned.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/assigned.php File Reference
    -
    -
    - - - - -

    -Data Structures

    class  Assigned
     Handles the assigning of a ticket to a user. More...
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/bc_s.png b/code/ryzom/tools/server/ryzom_ams_docs/html/bc_s.png deleted file mode 100644 index e4018628b..000000000 Binary files a/code/ryzom/tools/server/ryzom_ams_docs/html/bc_s.png and /dev/null differ diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/change__info_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/change__info_8php.html deleted file mode 100644 index 4b5bb8b4b..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/change__info_8php.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/change_info.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/change_info.php File Reference
    -
    -
    - - - - -

    -Functions

     change_info ()
     This function is beign used to change the users personal info.
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    change_info ()
    -
    -
    - -

    This function is beign used to change the users personal info.

    -

    It will first check if the user who executed this function is the person of whom the information is or if it's a mod/admin. If this is not the case the page will be redirected to an error page. afterwards the current info will be loaded, which will be used to determine what to update. After updating the information, the settings template will be reloaded. Errors made by invalid data will be shown also after reloading the template.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/change__mail_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/change__mail_8php.html deleted file mode 100644 index 1a177af49..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/change__mail_8php.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/change_mail.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/change_mail.php File Reference
    -
    -
    - - - - -

    -Functions

     change_mail ()
     This function is beign used to change the users emailaddress info.
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    change_mail ()
    -
    -
    - -

    This function is beign used to change the users emailaddress info.

    -

    It will first check if the user who executed this function is the person of whom the emailaddress is or if it's a mod/admin. If this is not the case the page will be redirected to an error page. The emailaddress will be validated first. If the checking was successful the email will be updated and the settings template will be reloaded. Errors made by invalid data will be shown also after reloading the template.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/change__password_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/change__password_8php.html deleted file mode 100644 index a8cc2bbc1..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/change__password_8php.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/change_password.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/change_password.php File Reference
    -
    -
    - - - - -

    -Functions

     change_password ()
     This function is beign used to change the users password.
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    change_password ()
    -
    -
    - -

    This function is beign used to change the users password.

    -

    It will first check if the user who executed this function is the person of whom the emailaddress is or if it's a mod/admin. If this is not the case the page will be redirected to an error page. If the executing user tries to change someone elses password, he doesn't has to fill in the previous password. The password will be validated first. If the checking was successful the password will be updated and the settings template will be reloaded. Errors made by invalid data will be shown also after reloading the template.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/change__permission_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/change__permission_8php.html deleted file mode 100644 index f8eccb214..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/change__permission_8php.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/change_permission.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/change_permission.php File Reference
    -
    -
    - - - - -

    -Functions

     change_permission ()
     This function is beign used to change the permission of a ticket_user.
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    change_permission ()
    -
    -
    - -

    This function is beign used to change the permission of a ticket_user.

    -

    It will first check if the user who executed this function is an admin. If this is not the case the page will be redirected to an error page. in case the $_GET['value'] is smaller than 4 and the user whoes permission is being changed is different from the admin(id 1), the change will be executed and the page will redirect to the users profile page.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/change__receivemail_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/change__receivemail_8php.html deleted file mode 100644 index fbb0d77e5..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/change__receivemail_8php.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/change_receivemail.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/change_receivemail.php File Reference
    -
    -
    - - - - -

    -Functions

     change_receivemail ()
     This function is beign used to change the users receiveMail setting.
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    change_receivemail ()
    -
    -
    - -

    This function is beign used to change the users receiveMail setting.

    -

    It will first check if the user who executed this function is the person of whom the setting is or if it's a mod/admin. If this is not the case the page will be redirected to an error page. it will check if the new value equals 1 or 0 and it will update the setting and redirect the page again.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/classAssigned.html b/code/ryzom/tools/server/ryzom_ams_docs/html/classAssigned.html deleted file mode 100644 index e91a4c362..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/classAssigned.html +++ /dev/null @@ -1,529 +0,0 @@ - - - - - -Ryzom Account Management System: Assigned Class Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    - -
    - -

    Handles the assigning of a ticket to a user. - More...

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    -Public Member Functions

     __construct ()
     A constructor.
     set ($values)
     sets the object's attributes.
     create ()
     creates a new 'assigned' entry.
     delete ()
     deletes an existing 'assigned' entry.
     load ($ticket_id)
     loads the object's attributes.
     getUser ()
     get user attribute of the object.
     getTicket ()
     get ticket attribute of the object.
     setUser ($u)
     set user attribute of the object.
     setTicket ($t)
     set ticket attribute of the object.

    -Static Public Member Functions

    static assignTicket ($user_id, $ticket_id)
     Assigns a ticket to a user or returns an error message.
    static unAssignTicket ($user_id, $ticket_id)
     Unassign a ticket being coupled to a user or return an error message.
    static getUserAssignedToTicket ($ticket_id)
     Get the (external) id of the user assigned to a ticket.
    static isAssigned ($ticket_id, $user_id=0)
     Check if a ticket is already assigned (in case the user_id param is used, it will check if it's assigned to that user)

    -Private Attributes

     $user
     The id of the user being assigned.
     $ticket
     The id of the ticket being assigned.
    -

    Detailed Description

    -

    Handles the assigning of a ticket to a user.

    -

    This is being used to make someone responsible for the handling and solving of a ticket. The idea is that someone can easily assign a ticket to himself and by doing that, he makes aware to the other moderators that he will deal with the ticket in the future.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    -

    Constructor & Destructor Documentation

    - -
    -
    - - - - - - - -
    __construct ()
    -
    -
    - -

    A constructor.

    -

    Empty constructor

    - -
    -
    -

    Member Function Documentation

    - -
    -
    - - - - - - - - - - - - - - - - - - -
    static assignTicket (user_id,
    ticket_id 
    ) [static]
    -
    -
    - -

    Assigns a ticket to a user or returns an error message.

    -

    It will first check if the ticket isn't already assigned, if not, it will create a new 'assigned' entry.

    -
    Parameters:
    - - - -
    $user_idthe id of the user we want to assign to the ticket
    $ticket_idthe id of the ticket.
    -
    -
    -
    Returns:
    A string, if assigning succeedded "SUCCESS_ASSIGNED" will be returned, else "ALREADY_ASSIGNED" will be returned.
    - -
    -
    - -
    -
    - - - - - - - -
    create ()
    -
    -
    - -

    creates a new 'assigned' entry.

    -

    this method will use the object's attributes for creating a new 'assigned' entry in the database.

    - -
    -
    - -
    -
    - - - - - - - -
    delete ()
    -
    -
    - -

    deletes an existing 'assigned' entry.

    -

    this method will use the object's attributes for deleting an existing 'assigned' entry in the database.

    - -
    -
    - -
    -
    - - - - - - - -
    getTicket ()
    -
    -
    - -

    get ticket attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getUser ()
    -
    -
    - -

    get user attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - - -
    static getUserAssignedToTicket (ticket_id) [static]
    -
    -
    - -

    Get the (external) id of the user assigned to a ticket.

    -
    Parameters:
    - - -
    $ticket_idthe Id of the ticket that's being queried
    -
    -
    -
    Returns:
    The (external)id of the user being assigned to the ticket
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    static isAssigned (ticket_id,
    user_id = 0 
    ) [static]
    -
    -
    - -

    Check if a ticket is already assigned (in case the user_id param is used, it will check if it's assigned to that user)

    -
    Parameters:
    - - - -
    $ticket_idthe Id of the ticket that's being queried
    $user_idthe id of the user, default parameter = 0, by using a user_id, it will check if that user is assigned to the ticket.
    -
    -
    -
    Returns:
    true in case it's assigned, false in case it isn't.
    - -
    -
    - -
    -
    - - - - - - - - -
    load (ticket_id)
    -
    -
    - -

    loads the object's attributes.

    -

    loads the object's attributes by giving a ticket_id, it will put the matching user_id and the ticket_id into the attributes.

    -
    Parameters:
    - - -
    $ticket_idthe id of the ticket that should be loaded
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    set (values)
    -
    -
    - -

    sets the object's attributes.

    -
    Parameters:
    - - -
    $valuesshould be an array of the form array('User' => user_id, 'Ticket' => ticket_id).
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setTicket (t)
    -
    -
    - -

    set ticket attribute of the object.

    -
    Parameters:
    - - -
    $tinteger id of the ticket
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setUser (u)
    -
    -
    - -

    set user attribute of the object.

    -
    Parameters:
    - - -
    $uinteger id of the user
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    static unAssignTicket (user_id,
    ticket_id 
    ) [static]
    -
    -
    - -

    Unassign a ticket being coupled to a user or return an error message.

    -

    It will first check if the ticket is assigned, if this is indeed the case it will delete the 'assigned' entry.

    -
    Parameters:
    - - - -
    $user_idthe id of the user we want to unassign from the ticket
    $ticket_idthe id of the ticket.
    -
    -
    -
    Returns:
    A string, if unassigning succeedded "SUCCESS_UNASSIGNED" will be returned, else "NOT_ASSIGNED" will be returned.
    - -
    -
    -

    Field Documentation

    - -
    -
    - - - - -
    $ticket [private]
    -
    -
    - -

    The id of the ticket being assigned.

    - -
    -
    - -
    -
    - - - - -
    $user [private]
    -
    -
    - -

    The id of the user being assigned.

    - -
    -
    -
    The documentation for this class was generated from the following file:
      -
    • /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/assigned.php
    • -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/classDBLayer.html b/code/ryzom/tools/server/ryzom_ams_docs/html/classDBLayer.html deleted file mode 100644 index 8d405ef53..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/classDBLayer.html +++ /dev/null @@ -1,284 +0,0 @@ - - - - - -Ryzom Account Management System: DBLayer Class Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    DBLayer Class Reference
    -
    -
    - -

    Handles the database connections. - More...

    - - - - - - - - - - - - - -

    -Public Member Functions

     __construct ($db)
     The constructor.
     executeWithoutParams ($query)
     execute a query that doesn't have any parameters
     execute ($query, $params)
     execute a query that has parameters
     executeReturnId ($query, $params)
     execute a query (an insertion query) that has parameters and return the id of it's insertion

    -Private Attributes

     $PDO
     The PDO object, instantiated by the constructor.
    -

    Detailed Description

    -

    Handles the database connections.

    -

    It uses PDO to connect to the different databases. It will use the argument of the constructor to setup a connection to the database with the matching entry in the $cfg global variable.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    -

    Constructor & Destructor Documentation

    - -
    -
    - - - - - - - - -
    __construct (db)
    -
    -
    - -

    The constructor.

    -

    Instantiates the PDO object attribute by connecting to the arguments matching database(the db info is stored in the $cfg global var)

    -
    Parameters:
    - - -
    $dbString, the name of the databases entry in the $cfg global var.
    -
    -
    - -
    -
    -

    Member Function Documentation

    - -
    -
    - - - - - - - - - - - - - - - - - - -
    execute (query,
    params 
    )
    -
    -
    - -

    execute a query that has parameters

    -
    Parameters:
    - - - -
    $querythe mysql query
    $paramsthe parameters that are being used by the query
    -
    -
    -
    Returns:
    returns a PDOStatement object
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    executeReturnId (query,
    params 
    )
    -
    -
    - -

    execute a query (an insertion query) that has parameters and return the id of it's insertion

    -
    Parameters:
    - - - -
    $querythe mysql query
    $paramsthe parameters that are being used by the query
    -
    -
    -
    Returns:
    returns the id of the last inserted element.
    - -
    -
    - -
    -
    - - - - - - - - -
    executeWithoutParams (query)
    -
    -
    - -

    execute a query that doesn't have any parameters

    -
    Parameters:
    - - -
    $querythe mysql query
    -
    -
    -
    Returns:
    returns a PDOStatement object
    - -
    -
    -

    Field Documentation

    - -
    -
    - - - - -
    $PDO [private]
    -
    -
    - -

    The PDO object, instantiated by the constructor.

    - -
    -
    -
    The documentation for this class was generated from the following file:
      -
    • /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/dblayer.php
    • -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/classForwarded.html b/code/ryzom/tools/server/ryzom_ams_docs/html/classForwarded.html deleted file mode 100644 index be376db96..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/classForwarded.html +++ /dev/null @@ -1,478 +0,0 @@ - - - - - -Ryzom Account Management System: Forwarded Class Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    - -
    - -

    Handles the forwarding of a ticket to a support_group. - More...

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    -Public Member Functions

     __construct ()
     A constructor.
     set ($values)
     sets the object's attributes.
     create ()
     creates a new 'forwarded' entry.
     delete ()
     deletes an existing 'forwarded' entry.
     load ($ticket_id)
     loads the object's attributes.
     getGroup ()
     get group attribute of the object.
     getTicket ()
     get ticket attribute of the object.
     setGroup ($g)
     set group attribute of the object.
     setTicket ($t)
     set ticket attribute of the object.

    -Static Public Member Functions

    static forwardTicket ($group_id, $ticket_id)
     Forward a ticket to a group, also removes the previous group where it was forwarded to.
    static getSGroupOfTicket ($ticket_id)
     get the id of the group a ticket is forwarded to.
    static isForwarded ($ticket_id)
     check if the ticket is forwarded

    -Private Attributes

     $group
     The id of the group to which the ticket is being forwarded.
     $ticket
     The id of the ticket being forwarded.
    -

    Detailed Description

    -

    Handles the forwarding of a ticket to a support_group.

    -

    This is being used to transfer tickets to different groups (eg Developers, Website-Team, SupportGroup etc..) The idea is that someone can easily forward a ticket to a group and by doing that, the moderators that are in that group will receive the ticket in their todo queue.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    -

    Constructor & Destructor Documentation

    - -
    -
    - - - - - - - -
    __construct ()
    -
    -
    - -

    A constructor.

    -

    Empty constructor

    - -
    -
    -

    Member Function Documentation

    - -
    -
    - - - - - - - -
    create ()
    -
    -
    - -

    creates a new 'forwarded' entry.

    -

    this method will use the object's attributes for creating a new 'forwarded' entry in the database.

    - -
    -
    - -
    -
    - - - - - - - -
    delete ()
    -
    -
    - -

    deletes an existing 'forwarded' entry.

    -

    this method will use the object's attributes for deleting an existing 'forwarded' entry in the database.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    static forwardTicket (group_id,
    ticket_id 
    ) [static]
    -
    -
    - -

    Forward a ticket to a group, also removes the previous group where it was forwarded to.

    -

    It will first check if the ticket is already forwarded, if that's the case, it will delete that entry. Afterwards it creates the new forward entry

    -
    Parameters:
    - - - -
    $group_idthe id of the support group we want to forward the ticket to.
    $ticket_idthe id of the ticket.
    -
    -
    -
    Returns:
    A string, if assigning succeedded "SUCCESS_FORWARDED" will be returned.
    - -
    -
    - -
    -
    - - - - - - - -
    getGroup ()
    -
    -
    - -

    get group attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - - -
    static getSGroupOfTicket (ticket_id) [static]
    -
    -
    - -

    get the id of the group a ticket is forwarded to.

    -
    Parameters:
    - - -
    $ticket_idthe id of the ticket.
    -
    -
    -
    Returns:
    the id of the group
    - -
    -
    - -
    -
    - - - - - - - -
    getTicket ()
    -
    -
    - -

    get ticket attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - - -
    static isForwarded (ticket_id) [static]
    -
    -
    - -

    check if the ticket is forwarded

    -
    Parameters:
    - - -
    $ticket_idthe id of the ticket.
    -
    -
    -
    Returns:
    returns true if the ticket is forwarded, else return false;
    - -
    -
    - -
    -
    - - - - - - - - -
    load (ticket_id)
    -
    -
    - -

    loads the object's attributes.

    -

    loads the object's attributes by giving a ticket_id, it will put the matching group_id and the ticket_id into the attributes.

    -
    Parameters:
    - - -
    $ticket_idthe id of the ticket that should be loaded
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    set (values)
    -
    -
    - -

    sets the object's attributes.

    -
    Parameters:
    - - -
    $valuesshould be an array of the form array('Group' => group_id, 'Ticket' => ticket_id).
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setGroup (g)
    -
    -
    - -

    set group attribute of the object.

    -
    Parameters:
    - - -
    $ginteger id of the group
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setTicket (t)
    -
    -
    - -

    set ticket attribute of the object.

    -
    Parameters:
    - - -
    $tinteger id of the ticket
    -
    -
    - -
    -
    -

    Field Documentation

    - -
    -
    - - - - -
    $group [private]
    -
    -
    - -

    The id of the group to which the ticket is being forwarded.

    - -
    -
    - -
    -
    - - - - -
    $ticket [private]
    -
    -
    - -

    The id of the ticket being forwarded.

    - -
    -
    -
    The documentation for this class was generated from the following file:
      -
    • /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/forwarded.php
    • -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/classGui__Elements.html b/code/ryzom/tools/server/ryzom_ams_docs/html/classGui__Elements.html deleted file mode 100644 index 98e30a949..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/classGui__Elements.html +++ /dev/null @@ -1,250 +0,0 @@ - - - - - -Ryzom Account Management System: Gui_Elements Class Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    Gui_Elements Class Reference
    -
    -
    - -

    Helper class for generating gui related elements. - More...

    - - - - - - - - -

    -Static Public Member Functions

    static make_table ($inputList, $funcArray, $fieldArray)
     creates an array of information out of a list of objects which can be used to form a table.
    static make_table_with_key_is_id ($inputList, $funcArray, $idFunction)
     creates an array of information out of a list of objects which can be used to form a table with a key as id.
    static time_elapsed_string ($ptime)
     returns the elapsed time from a timestamp up till now.
    -

    Detailed Description

    -

    Helper class for generating gui related elements.

    -

    This class contains functions that generate data-arrays for tables, or other visual entities

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    -

    Member Function Documentation

    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    static make_table (inputList,
    funcArray,
    fieldArray 
    ) [static]
    -
    -
    - -

    creates an array of information out of a list of objects which can be used to form a table.

    -

    The idea of this is that you can pass an array of objects, an array of functions to perform on each object and a name for the index of the returning array to store the result.

    -
    Parameters:
    - - - - -
    $inputListthe list of objects of which we want to make a table.
    $funcArraya list of methods of that object we want to perform.
    $fieldArraya list of strings, that will be used to store our result into.
    -
    -
    -
    Returns:
    an array with the indexes listed in $fieldArray and which holds the results of the methods in $funcArray on each object in the $inputList
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    static make_table_with_key_is_id (inputList,
    funcArray,
    idFunction 
    ) [static]
    -
    -
    - -

    creates an array of information out of a list of objects which can be used to form a table with a key as id.

    -

    The idea is comparable to the make_table() function, though this time the results are stored in the index that is returned by the idFunction()

    -
    Parameters:
    - - - - -
    $inputListthe list of objects of which we want to make a table.
    $funcArraya list of methods of that object we want to perform.
    $idFunctiona function that returns an id that will be used as index to store our result
    -
    -
    -
    Returns:
    an array which holds the results of the methods in $funcArray on each object in the $inputList, though thearrays indexes are formed by using the idFunction.
    - -
    -
    - -
    -
    - - - - - - - - -
    static time_elapsed_string (ptime) [static]
    -
    -
    - -

    returns the elapsed time from a timestamp up till now.

    -
    Parameters:
    - - -
    $ptimea timestamp.
    -
    -
    -
    Returns:
    a string in the form of A years, B months, C days, D hours, E minutes, F seconds ago.
    - -
    -
    -
    The documentation for this class was generated from the following file:
      -
    • /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/gui_elements.php
    • -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/classHelpers.html b/code/ryzom/tools/server/ryzom_ams_docs/html/classHelpers.html deleted file mode 100644 index e0109cd70..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/classHelpers.html +++ /dev/null @@ -1,292 +0,0 @@ - - - - - -Ryzom Account Management System: Helpers Class Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    Helpers Class Reference
    -
    -
    - -

    Helper class for more site specific functions. - More...

    - - - - - - - - - - - - - - -

    -Static Public Member Functions

    static loadTemplate ($template, $vars=array(), $returnHTML=false)
     workhorse of the website, it loads the template and shows it or returns th html.
    static create_folders ()
     creates the folders that are needed for smarty.
    static check_if_game_client ()
     check if the http request is sent ingame or not.
    static handle_language ()
     Handles the language specific aspect.
    static outputTime ($time, $str=1)
     Time output function for handling the time display.
    static check_login_ingame ()
     Auto login function for ingame use.
    -

    Detailed Description

    -

    Helper class for more site specific functions.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    -

    Member Function Documentation

    - -
    -
    - - - - - - - -
    static check_if_game_client () [static]
    -
    -
    - -

    check if the http request is sent ingame or not.

    -
    Returns:
    returns true in case it's sent ingame, else false is returned.
    - -
    -
    - -
    -
    - - - - - - - -
    static check_login_ingame () [static]
    -
    -
    - -

    Auto login function for ingame use.

    -

    This function will allow users who access the website ingame, to log in without entering the username and password. It uses the COOKIE entry in the open_ring db. it checks if the cookie sent by the http request matches the one in the db. This cookie in the db is changed everytime the user relogs.

    -
    Returns:
    returns "FALSE" if the cookies didn't match, else it returns an array with the user's id and name.
    - -
    -
    - -
    -
    - - - - - - - -
    static create_folders () [static]
    -
    -
    - -

    creates the folders that are needed for smarty.

    -
    Todo:
    for the drupal module it might be possible that drupal_mkdir needs to be used instead of mkdir, also this should be in the install.php instead.
    - -
    -
    - -
    -
    - - - - - - - -
    static handle_language () [static]
    -
    -
    - -

    Handles the language specific aspect.

    -

    The language can be changed by setting the $_GET['Language'] & $_GET['setLang'] together. This will also change the language entry of the user in the db. Cookies are also being used in case the user isn't logged in.

    -
    Returns:
    returns the parsed content of the language .ini file related to the users language setting.
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    static loadTemplate (template,
    vars = array (),
    returnHTML = false 
    ) [static]
    -
    -
    - -

    workhorse of the website, it loads the template and shows it or returns th html.

    -

    it uses smarty to load the $template, but before displaying the template it will pass the $vars to smarty. Also based on your language settings a matching array of words & sentences for that page will be loaded. In case the $returnHTML parameter is set to true, it will return the html instead of displaying the template.

    -
    Parameters:
    - - - - -
    $templatethe name of the template(page) that we want to load.
    $varsan array of variables that should be loaded by smarty before displaying or returning the html.
    $returnHTML(default=false) if set to true, the html that should have been displayed, will be returned.
    -
    -
    -
    Returns:
    in case $returnHTML=true, it returns the html of the template being loaded.
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    static outputTime (time,
    str = 1 
    ) [static]
    -
    -
    - -

    Time output function for handling the time display.

    -
    Returns:
    returns the time in the format specified in the $TIME_FORMAT global variable.
    - -
    -
    -
    The documentation for this class was generated from the following file:
      -
    • /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/helpers.php
    • -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/classIn__Support__Group.html b/code/ryzom/tools/server/ryzom_ams_docs/html/classIn__Support__Group.html deleted file mode 100644 index 206752abf..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/classIn__Support__Group.html +++ /dev/null @@ -1,393 +0,0 @@ - - - - - -Ryzom Account Management System: In_Support_Group Class Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    In_Support_Group Class Reference
    -
    -
    - -

    Handles the linkage of users being in a support group. - More...

    - - - - - - - - - - - - - - - - - - - - - - - - - - -

    -Public Member Functions

     __construct ()
     A constructor.
     set ($values)
     sets the object's attributes.
     create ()
     creates a new 'in_support_group' entry.
     delete ()
     deletes an existing 'in_support_group' entry.
     getUser ()
     get user attribute of the object.
     getGroup ()
     get group attribute of the object.
     setUser ($u)
     set user attribute of the object.
     setGroup ($g)
     set group attribute of the object.

    -Static Public Member Functions

    static userExistsInSGroup ($user_id, $group_id)
     Check if user is in in_support_group.

    -Private Attributes

     $user
     The id of the user being in a support group.
     $group
     The id of the support group.
    -

    Detailed Description

    -

    Handles the linkage of users being in a support group.

    -

    Moderators and Admins can be part of a support group, this class offers functionality to check if a link between a user and group is existing.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    -

    Constructor & Destructor Documentation

    - -
    -
    - - - - - - - -
    __construct ()
    -
    -
    - -

    A constructor.

    -

    Empty constructor

    - -
    -
    -

    Member Function Documentation

    - -
    -
    - - - - - - - -
    create ()
    -
    -
    - -

    creates a new 'in_support_group' entry.

    -

    this method will use the object's attributes for creating a new 'in_support_group' entry in the database.

    - -
    -
    - -
    -
    - - - - - - - -
    delete ()
    -
    -
    - -

    deletes an existing 'in_support_group' entry.

    -

    this method will use the object's attributes for deleting an existing 'in_support_group' entry in the database.

    - -
    -
    - -
    -
    - - - - - - - -
    getGroup ()
    -
    -
    - -

    get group attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getUser ()
    -
    -
    - -

    get user attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - - -
    set (values)
    -
    -
    - -

    sets the object's attributes.

    -
    Parameters:
    - - -
    $valuesshould be an array of the form array('User' => user_id, 'Group' => support_groups_id).
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setGroup (g)
    -
    -
    - -

    set group attribute of the object.

    -
    Parameters:
    - - -
    $ginteger id of the support group
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setUser (u)
    -
    -
    - -

    set user attribute of the object.

    -
    Parameters:
    - - -
    $uinteger id of the user
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    static userExistsInSGroup (user_id,
    group_id 
    ) [static]
    -
    -
    - -

    Check if user is in in_support_group.

    -
    Parameters:
    - - - -
    $user_idthe id of the user.
    $group_idthe id of the support group.
    -
    -
    -
    Returns:
    true is returned in case the user is in the support group, else false is returned.
    - -
    -
    -

    Field Documentation

    - -
    -
    - - - - -
    $group [private]
    -
    -
    - -

    The id of the support group.

    - -
    -
    - -
    -
    - - - - -
    $user [private]
    -
    -
    - -

    The id of the user being in a support group.

    - -
    -
    -
    The documentation for this class was generated from the following file:
      -
    • /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/in_support_group.php
    • -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/classMail__Handler.html b/code/ryzom/tools/server/ryzom_ams_docs/html/classMail__Handler.html deleted file mode 100644 index a11be88a0..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/classMail__Handler.html +++ /dev/null @@ -1,524 +0,0 @@ - - - - - -Ryzom Account Management System: Mail_Handler Class Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    - -
    - -

    Handles the mailing functionality. - More...

    - - - - - - - - - - - - - - - - - - - - - - - - - - -

    -Public Member Functions

     cron ()
     the cron funtion (workhorse of the mailing system).
     new_message_id ($ticketId)
     creates a new message id for a email about to send.
     get_ticket_id_from_subject ($subject)
     try to fetch the ticket_id out of the subject.
     incoming_mail_handler ($mbox, $i, $group)
     Handles an incomming email Read the content of one email by using imap's functionality.
     decode_utf8 ($str)
     decode utf8
     get_mime_type (&$structure)
     returns the mime type of a structure of a email
     get_part ($stream, $msg_number, $mime_type, $structure=false, $part_number=false)

    -Static Public Member Functions

    static send_ticketing_mail ($receiver, $ticketObj, $content, $type, $sender=0)
     Wrapper for sending emails, creates the content of the email Based on the type of the ticketing mail it will create a specific email, it will use the language.ini files to load the correct language of the email for the receiver.
    static send_mail ($recipient, $subject, $body, $ticket_id=0, $from=NULL)
     send mail function that will add the email to the db.

    -Private Member Functions

     mail_fork ()
     Start a new child process and return the process id this is used because imap might take some time, we dont want the cron parent process waiting on that.

    -Private Attributes

     $db
     db object used by various methods.
    -

    Detailed Description

    -

    Handles the mailing functionality.

    -

    This class covers the reading of the mail boxes of the support_groups, handling those emails, updating tickets accoring to the content & title of the emails, but also the sending of emails after creating a new ticket and when someone else replies on your ticket.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    -

    Member Function Documentation

    - -
    -
    - - - - - - - -
    cron ()
    -
    -
    - -

    the cron funtion (workhorse of the mailing system).

    -

    The cron job will create a child process, which will first send the emails that are in the email table in the database, we use some kind of semaphore (a temp file) to make sure that if the cron job is called multiple times, it wont email those mails multiple times. After this, we will read the mail inboxes of the support groups and the default group using IMAP and we will add new tickets or new replies according to the incoming emails.

    - -
    -
    - -
    -
    - - - - - - - - -
    decode_utf8 (str)
    -
    -
    - -

    decode utf8

    -
    Parameters:
    - - -
    $strstr to be decoded
    -
    -
    -
    Returns:
    decoded string
    - -
    -
    - -
    -
    - - - - - - - - -
    get_mime_type (&$ structure)
    -
    -
    - -

    returns the mime type of a structure of a email

    -
    Parameters:
    - - -
    &$structurethe structure of an email message.
    -
    -
    -
    Returns:
    "TEXT", "MULTIPART","MESSAGE", "APPLICATION", "AUDIO","IMAGE", "VIDEO", "OTHER","TEXT/PLAIN"
    -
    Todo:
    take care of the HTML part of incoming emails.
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    get_part (stream,
    msg_number,
    mime_type,
    structure = false,
    part_number = false 
    )
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    get_ticket_id_from_subject (subject)
    -
    -
    - -

    try to fetch the ticket_id out of the subject.

    -

    The subject should have a substring of the form [Ticket #ticket_id], where ticket_id should be the integer ID of the ticket.

    -
    Parameters:
    - - -
    $subjectthe subject of an incomming email.
    -
    -
    -
    Returns:
    if the ticket's id is succesfully parsed, it will return the ticket_id, else it returns 0.
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    incoming_mail_handler (mbox,
    i,
    group 
    )
    -
    -
    - -

    Handles an incomming email Read the content of one email by using imap's functionality.

    -

    If a ticket id is found inside the message_id or else in the subject line, then a reply will be added (if the email is not being sent from the authors email address it won't be added though and a warning will be sent to both parties). If no ticket id is found, then a new ticket will be created.

    -
    Parameters:
    - - - - -
    $mboxa mailbox object
    $ithe email's id in the mailbox (integer)
    $groupthe group object that owns the inbox.
    -
    -
    -
    Returns:
    a string based on the found ticket i and timestamp (will be used to store a copy of the email locally)
    - -
    -
    - -
    -
    - - - - - - - -
    mail_fork () [private]
    -
    -
    - -

    Start a new child process and return the process id this is used because imap might take some time, we dont want the cron parent process waiting on that.

    -
    Returns:
    return the child process id
    - -
    -
    - -
    -
    - - - - - - - - -
    new_message_id (ticketId)
    -
    -
    - -

    creates a new message id for a email about to send.

    -
    Parameters:
    - - -
    $ticketIdthe ticket id of the ticket that is mentioned in the email.
    -
    -
    -
    Returns:
    returns a string, that consist out of some variable parts, a consistent part and the ticket_id. The ticket_id will be used lateron, if someone replies on the message, to see to which ticket the reply should be added.
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    static send_mail (recipient,
    subject,
    body,
    ticket_id = 0,
    from = NULL 
    ) [static]
    -
    -
    - -

    send mail function that will add the email to the db.

    -

    this function is being used by the send_ticketing_mail() function. It adds the email as an entry to the `email` table in the database, which will be sent later on when we run the cron job.

    -
    Parameters:
    - - - - - - -
    $recipientif integer, then it refers to the id of the user to whom we want to mail, if it's a string(email-address) then we will use that.
    $subjectthe subject of the email
    $bodythe body of the email
    $ticket_idthe id of the ticket
    $fromthe sending support_group's id (NULL in case the default group is sending))
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    static send_ticketing_mail (receiver,
    ticketObj,
    content,
    type,
    sender = 0 
    ) [static]
    -
    -
    - -

    Wrapper for sending emails, creates the content of the email Based on the type of the ticketing mail it will create a specific email, it will use the language.ini files to load the correct language of the email for the receiver.

    -

    Also if the $TICKET_MAILING_SUPPORT is set to false or if the user's personal 'ReceiveMail' entry is set to false then no mail will be sent.

    -
    Parameters:
    - - - - - - -
    $receiverif integer, then it refers to the id of the user to whom we want to mail, if it's a string(email-address) then we will use that.
    $ticketObjthe ticket object itself, this is being used for including ticket related information into the email.
    $contentthe content of a reply or new ticket
    $typeREPLY, NEW, WARNAUTHOR, WARNSENDER, WARNUNKNOWNSENDER
    $sender(default = 0 (if it is not forwarded)) else use the id of the support group to which the ticket is currently forwarded, the support groups email address will be used to send the ticket.
    -
    -
    - -
    -
    -

    Field Documentation

    - -
    -
    - - - - -
    $db [private]
    -
    -
    - -

    db object used by various methods.

    - -
    -
    -
    The documentation for this class was generated from the following file:
      -
    • /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/mail_handler.php
    • -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/classMyCrypt.html b/code/ryzom/tools/server/ryzom_ams_docs/html/classMyCrypt.html deleted file mode 100644 index f08d22b88..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/classMyCrypt.html +++ /dev/null @@ -1,327 +0,0 @@ - - - - - -Ryzom Account Management System: MyCrypt Class Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    - -
    - -

    Basic encryption/decryption class. - More...

    - - - - - - - - - - - - - - - - -

    -Public Member Functions

     __construct ($cryptinfo)
     constructor.
     encrypt ($data)
     encrypts by using the given enc_method and hash_method.
     decrypt ($edata)
     decrypts by using the given enc_method and hash_method.

    -Static Private Member Functions

    static hashIV ($key, $method, $iv_size)
     hashes the key by using a hash method specified.
    static check_methods ($enc, $hash)
     checks if the encryption and hash methods are supported

    -Private Attributes

     $config
     array that should contain the enc_method & hash_method & key
    -

    Detailed Description

    -

    Basic encryption/decryption class.

    -

    We use this class atm for encrypting & decrypting the imap passwords.

    -

    Constructor & Destructor Documentation

    - -
    -
    - - - - - - - - -
    __construct (cryptinfo)
    -
    -
    - -

    constructor.

    -

    loads the config array with the given argument.

    -
    Parameters:
    - - -
    $cryptinfoan array containing the info needed to encrypt & decrypt.(enc_method & hash_method & key)
    -
    -
    - -
    -
    -

    Member Function Documentation

    - -
    -
    - - - - - - - - - - - - - - - - - - -
    static check_methods (enc,
    hash 
    ) [static, private]
    -
    -
    - -

    checks if the encryption and hash methods are supported

    -
    Parameters:
    - - - -
    $encthe encryption method.
    $hashthe hash method.
    -
    -
    -
    Exceptions:
    - - -
    Exceptionin case a method is not supported.
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    decrypt (edata)
    -
    -
    - -

    decrypts by using the given enc_method and hash_method.

    -
    Parameters:
    - - -
    $edatathe encrypted string that we want to decrypt
    -
    -
    -
    Returns:
    the decrypted string.
    - -
    -
    - -
    -
    - - - - - - - - -
    encrypt (data)
    -
    -
    - -

    encrypts by using the given enc_method and hash_method.

    -

    It will first check if the methods are supported, if not it will throw an error, if so it will encrypt the $data

    -
    Parameters:
    - - -
    $datathe string that we want to encrypt.
    -
    -
    -
    Returns:
    the encrypted string.
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    static hashIV (key,
    method,
    iv_size 
    ) [static, private]
    -
    -
    - -

    hashes the key by using a hash method specified.

    -
    Parameters:
    - - - - -
    $keythe key to be hashed
    $methodthe metho of hashing to be used
    $iv_sizethe size of the initialization vector.
    -
    -
    -
    Returns:
    return the hashed key up till the size of the iv_size param.
    - -
    -
    -

    Field Documentation

    - -
    -
    - - - - -
    $config [private]
    -
    -
    - -

    array that should contain the enc_method & hash_method & key

    - -
    -
    -
    The documentation for this class was generated from the following file:
      -
    • /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/mycrypt.php
    • -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/classPagination.html b/code/ryzom/tools/server/ryzom_ams_docs/html/classPagination.html deleted file mode 100644 index 3623ac807..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/classPagination.html +++ /dev/null @@ -1,368 +0,0 @@ - - - - - -Ryzom Account Management System: Pagination Class Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    Pagination Class Reference
    -
    -
    - -

    Handles returning arrays based on a given pagenumber. - More...

    - - - - - - - - - - - - - - - - - - - - - - - -

    -Public Member Functions

     __construct ($query, $db, $nrDisplayed, $resultClass, $params=array())
     Constructor.
     getLast ()
     return the number of the 'last' object attribute
     getCurrent ()
     return the number of the 'current' object attribute
     getElements ()
     return the elements array of the object
     getAmountOfRows ()
     return total amount of rows for the original query
     getLinks ($nrOfLinks)
     return the page links.

    -Private Attributes

     $element_array
     Array containing the elements that are extracted for that specific page number.
     $last
     The last page number.
     $current
     The current page number (read from $_GET['pagenum'])
     $amountOfRows
     Total amount of rows that a query would return (if no limits would be used)
    -

    Detailed Description

    -

    Handles returning arrays based on a given pagenumber.

    -

    By specifing a $_GET['pagenum'] or if not(page = 1 will be used) a few elements from a specific query will be returned. Not all elements have to be loaded into objects, only the elements needed for that specific page, this is a good thing performance wise. This is done by passign the query to the constructor and specifying how many you want to display.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    -

    Constructor & Destructor Documentation

    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    __construct (query,
    db,
    nrDisplayed,
    resultClass,
    params = array() 
    )
    -
    -
    - -

    Constructor.

    -

    will fetch the correct elements that match to a specific page (specified by the $_GET['pagenum'] variable). The query has to be passed as a string to the function that way it will only load the specific elements that are related to the pagenumber. The $params, parameter is optional and is used to pass the parameters for the query. The result class will be used to instantiate the found elements with, their set() function will be called. The class its getters can be later used to get the info out of the object.

    -
    Parameters:
    - - - - - - -
    $querythe query to be paginated
    $dbthe db on which the query should be performed
    $nrDisplayedthe amount of elements that should be displayed /page
    $resultClassthe elements that should be returned should be of that specific class.
    $paramsthe parameters used by the query (optional)
    -
    -
    - -
    -
    -

    Member Function Documentation

    - -
    -
    - - - - - - - -
    getAmountOfRows ()
    -
    -
    - -

    return total amount of rows for the original query

    -
    Returns:
    the total amount of rows for the original query
    - -
    -
    - -
    -
    - - - - - - - -
    getCurrent ()
    -
    -
    - -

    return the number of the 'current' object attribute

    -
    Returns:
    the number of the current page
    - -
    -
    - -
    -
    - - - - - - - -
    getElements ()
    -
    -
    - -

    return the elements array of the object

    -
    Returns:
    the elements of a specific page (these are instantiations of the class passed as parameter ($resultClass) to the constructor)
    - -
    -
    - -
    -
    - - - - - - - -
    getLast ()
    -
    -
    - -

    return the number of the 'last' object attribute

    -
    Returns:
    the number of the last page
    - -
    -
    - -
    -
    - - - - - - - - -
    getLinks (nrOfLinks)
    -
    -
    - -

    return the page links.

    -

    (for browsing the pages, placed under a table for example) the $nrOfLinks parameter specifies the amount of links you want to return. it will show the links closest to the current page on both sides (in case one side can't show more, it will show more on the other side)

    -
    Returns:
    an array of integerswhich refer to the clickable pagenumbers for browsing other pages.
    - -
    -
    -

    Field Documentation

    - -
    -
    - - - - -
    $amountOfRows [private]
    -
    -
    - -

    Total amount of rows that a query would return (if no limits would be used)

    - -
    -
    - -
    -
    - - - - -
    $current [private]
    -
    -
    - -

    The current page number (read from $_GET['pagenum'])

    - -
    -
    - -
    -
    - - - - -
    $element_array [private]
    -
    -
    - -

    Array containing the elements that are extracted for that specific page number.

    - -
    -
    - -
    -
    - - - - -
    $last [private]
    -
    -
    - -

    The last page number.

    - -
    -
    -
    The documentation for this class was generated from the following file:
      -
    • /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/pagination.php
    • -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/classQuerycache.html b/code/ryzom/tools/server/ryzom_ams_docs/html/classQuerycache.html deleted file mode 100644 index 320125d43..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/classQuerycache.html +++ /dev/null @@ -1,485 +0,0 @@ - - - - - -Ryzom Account Management System: Querycache Class Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    Querycache Class Reference
    -
    -
    - -

    class for storing changes when shard is offline. - More...

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    -Public Member Functions

     __construct ()
     A constructor.
     set ($values)
     sets the object's attributes.
     load_With_SID ($id)
     loads the object's attributes.
     update ()
     updates the entry.
     getSID ()
     get SID attribute of the object.
     getType ()
     get type attribute of the object.
     getQuery ()
     get query attribute of the object.
     getDb ()
     get db attribute of the object.
     setSID ($s)
     set SID attribute of the object.
     setType ($t)
     set type attribute of the object.
     setQuery ($q)
     set query attribute of the object.
     setDb ($d)
     set db attribute of the object.

    -Private Attributes

     $SID
     The queries ID.
     $type
     The type of query.
     $query
     The query itself (json encoded)
     $db
     the db where the query should be performed
    -

    Detailed Description

    -

    class for storing changes when shard is offline.

    -
    Todo:
    make sure that the querycache class is being used by the sync class and also for inserting the queries themselfs into it. Atm this class isn't used yet if I remember correctly
    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    -

    Constructor & Destructor Documentation

    - -
    -
    - - - - - - - -
    __construct ()
    -
    -
    - -

    A constructor.

    -

    Empty constructor

    - -
    -
    -

    Member Function Documentation

    - -
    -
    - - - - - - - -
    getDb ()
    -
    -
    - -

    get db attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getQuery ()
    -
    -
    - -

    get query attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getSID ()
    -
    -
    - -

    get SID attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getType ()
    -
    -
    - -

    get type attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - - -
    load_With_SID (id)
    -
    -
    - -

    loads the object's attributes.

    -

    loads the object's attributes by giving a SID as parameter

    -
    Parameters:
    - - -
    $idthe id of the querycaches row
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    set (values)
    -
    -
    - -

    sets the object's attributes.

    -
    Parameters:
    - - -
    $valuesshould be an array of the form array('SID' => sid, 'type' => type, 'query' => query, 'db' => db).
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setDb (d)
    -
    -
    - -

    set db attribute of the object.

    -
    Parameters:
    - - -
    $dthe name of the database in the config global var that we want to use.
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setQuery (q)
    -
    -
    - -

    set query attribute of the object.

    -
    Parameters:
    - - -
    $qquery string
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setSID (s)
    -
    -
    - -

    set SID attribute of the object.

    -
    Parameters:
    - - -
    $sinteger id
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setType (t)
    -
    -
    - -

    set type attribute of the object.

    -
    Parameters:
    - - -
    $ttype of the query, could be changePassword, changePermissions, changeEmail, createUser
    -
    -
    - -
    -
    - -
    -
    - - - - - - - -
    update ()
    -
    -
    - -

    updates the entry.

    - -
    -
    -

    Field Documentation

    - -
    -
    - - - - -
    $db [private]
    -
    -
    - -

    the db where the query should be performed

    - -
    -
    - -
    -
    - - - - -
    $query [private]
    -
    -
    - -

    The query itself (json encoded)

    - -
    -
    - -
    -
    - - - - -
    $SID [private]
    -
    -
    - -

    The queries ID.

    - -
    -
    - -
    -
    - - - - -
    $type [private]
    -
    -
    - -

    The type of query.

    - -
    -
    -
    The documentation for this class was generated from the following file:
      -
    • /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/querycache.php
    • -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/classSupport__Group.html b/code/ryzom/tools/server/ryzom_ams_docs/html/classSupport__Group.html deleted file mode 100644 index badfc9e03..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/classSupport__Group.html +++ /dev/null @@ -1,1082 +0,0 @@ - - - - - -Ryzom Account Management System: Support_Group Class Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    - -
    - -

    groups moderators & admins together. - More...

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    -Public Member Functions

     __construct ()
     A constructor.
     set ($values)
     sets the object's attributes.
     create ()
     creates a new 'support_group' entry.
     load_With_SGroupId ($id)
     loads the object's attributes.
     update ()
     update the objects attributes to the db.
     delete ()
     deletes an existing 'support_group' entry.
     getSGroupId ()
     get sGroupId attribute of the object.
     getName ()
     get name attribute of the object.
     getTag ()
     get tag attribute of the object.
     getGroupEmail ()
     get groupEmail attribute of the object.
     getIMAP_MailServer ()
     get iMAP_MailServer attribute of the object.
     getIMAP_Username ()
     get iMAP_Username attribute of the object.
     getIMAP_Password ()
     get iMAP_Password attribute of the object.
     setSGroupId ($id)
     set sGroupId attribute of the object.
     setName ($n)
     set name attribute of the object.
     setTag ($t)
     set tag attribute of the object.
     setGroupEmail ($ge)
     set groupEmail attribute of the object.
     setIMAP_MailServer ($ms)
     set iMAP_MailServer attribute of the object.
     setIMAP_Username ($u)
     set iMAP_Username attribute of the object.
     setIMAP_Password ($p)
     set iMAP_Password attribute of the object.

    -Static Public Member Functions

    static getGroup ($id)
     return a specific support_group object.
    static getGroups ()
     return all support_group objects.
    static createSupportGroup ($name, $tag, $groupemail, $imap_mailserver, $imap_username, $imap_password)
     Wrapper for creating a support group.
    static supportGroup_EntryNotExists ($name, $tag)
     check if support group name/tag doesn't exist yet.
    static supportGroup_Exists ($id)
     check if support group entry coupled to a given id exist or not.
    static constr_SGroupId ($id)
     construct an object based on the SGroupId.
    static getAllUsersOfSupportGroup ($group_id)
     get list of all users that are enlisted to a support group.
    static deleteSupportGroup ($group_id)
     wrapper for deleting a support group.
    static deleteUserOfSupportGroup ($user_id, $group_id)
     wrapper for deleting a user that's in a specified support group.
    static addUserToSupportGroup ($user_id, $group_id)
     wrapper for adding a user to a specified support group.
    static getAllSupportGroups ()
     return all support_group objects.

    -Private Attributes

     $sGroupId
     The id of the support group.
     $name
     The name of the support group.
     $tag
     The tag of the support group, a tag is max 4 letters big, and will be used in the future as easy reference to indicate what group it is refered to (eg [DEV])
     $groupEmail
     The email address of the group.
     $iMAP_MailServer
     The imap server connection string.
     $iMAP_Username
     The imap username of the account.
     $iMAP_Password
     The imap matching password.
    -

    Detailed Description

    -

    groups moderators & admins together.

    -

    A Support Group is a group of people with the same skills or knowledge. A typical example will be the (Developers group, webteam group, management, etc..) The idea is that tickets can be forwarded to a group of persons that might be able to answer that specific question. Support Groups are also the key of handling the emails, because the email addresses of the support groups will be used by the Mail_Handler class.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    -

    Constructor & Destructor Documentation

    - -
    -
    - - - - - - - -
    __construct ()
    -
    -
    - -

    A constructor.

    -

    Empty constructor

    - -
    -
    -

    Member Function Documentation

    - -
    -
    - - - - - - - - - - - - - - - - - - -
    static addUserToSupportGroup (user_id,
    group_id 
    ) [static]
    -
    -
    - -

    wrapper for adding a user to a specified support group.

    -

    We will first check if the group really exists, if not than "GROUP_NOT_EXISING" will be returned. Afterwards we will check if the user exists in the support group, if so "ALREADY_ADDED" will be returned. Else the user will be added to the in_support_group table and "SUCCESS" will be returned.

    -
    Parameters:
    - - - -
    $user_idthe id of the user we want to add to the group.
    $group_idthe id of the group the user wants to be in
    -
    -
    -
    Returns:
    a string (SUCCESS, ALREADY_ADDED or GROUP_NOT_EXISTING)
    - -
    -
    - -
    -
    - - - - - - - - -
    static constr_SGroupId (id) [static]
    -
    -
    - -

    construct an object based on the SGroupId.

    -
    Parameters:
    - - -
    $idthe id of the group we want to construct
    -
    -
    -
    Returns:
    the constructed support group object
    - -
    -
    - -
    -
    - - - - - - - -
    create ()
    -
    -
    - -

    creates a new 'support_group' entry.

    -

    this method will use the object's attributes for creating a new 'support_group' entry in the database.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    static createSupportGroup (name,
    tag,
    groupemail,
    imap_mailserver,
    imap_username,
    imap_password 
    ) [static]
    -
    -
    - -

    Wrapper for creating a support group.

    -

    It will check if the support group doesn't exist yet, if the tag or name already exists then NAME_TAKEN or TAG_TAKEN will be returned. If the name is bigger than 20 characters or smaller than 4 and the tag greater than 7 or smaller than 2 a SIZE_ERROR will be returned. Else it will return SUCCESS

    -
    Returns:
    a string that specifies if it was a success or not (SUCCESS, SIZE_ERROR, NAME_TAKEN or TAG_TAKEN )
    - -
    -
    - -
    -
    - - - - - - - -
    delete ()
    -
    -
    - -

    deletes an existing 'support_group' entry.

    -

    this method will use the object's attributes for deleting an existing 'support_group' entry in the database.

    - -
    -
    - -
    -
    - - - - - - - - -
    static deleteSupportGroup (group_id) [static]
    -
    -
    - -

    wrapper for deleting a support group.

    -

    We will first check if the group really exists, if not than "GROUP_NOT_EXISING" will be returned.

    -
    Parameters:
    - - -
    $group_idthe id of the group we want to delete
    -
    -
    -
    Returns:
    an array of ticket_user objects that are in the support group.
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    static deleteUserOfSupportGroup (user_id,
    group_id 
    ) [static]
    -
    -
    - -

    wrapper for deleting a user that's in a specified support group.

    -

    We will first check if the group really exists, if not than "GROUP_NOT_EXISING" will be returned. Afterwards we will check if the user exists in the support group, if not "USER_NOT_IN_GROUP" will be returned. Else the users entry in the in_support_group table will be deleted and "SUCCESS" will be returned.

    -
    Parameters:
    - - - -
    $user_idthe id of the user we want to remove out of the group.
    $group_idthe id of the group the user should be in
    -
    -
    -
    Returns:
    a string (SUCCESS, USER_NOT_IN_GROUP or GROUP_NOT_EXISTING)
    - -
    -
    - -
    -
    - - - - - - - -
    static getAllSupportGroups () [static]
    -
    -
    - -

    return all support_group objects.

    -
    Returns:
    an array containing all support_group objects.
    -
    Deprecated:
    should be removed in the future, because getGroups does the same.
    - -
    -
    - -
    -
    - - - - - - - - -
    static getAllUsersOfSupportGroup (group_id) [static]
    -
    -
    - -

    get list of all users that are enlisted to a support group.

    -
    Parameters:
    - - -
    $group_idthe id of the group we want to query
    -
    -
    -
    Returns:
    an array of ticket_user objects that are in the support group.
    - -
    -
    - -
    -
    - - - - - - - - -
    static getGroup (id) [static]
    -
    -
    - -

    return a specific support_group object.

    -
    Parameters:
    - - -
    $idthe id of the support group that we want to return
    -
    -
    -
    Returns:
    a support_group object.
    - -
    -
    - -
    -
    - - - - - - - -
    getGroupEmail ()
    -
    -
    - -

    get groupEmail attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    static getGroups () [static]
    -
    -
    - -

    return all support_group objects.

    -
    Returns:
    an array containing all support_group objects.
    - -
    -
    - -
    -
    - - - - - - - -
    getIMAP_MailServer ()
    -
    -
    - -

    get iMAP_MailServer attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getIMAP_Password ()
    -
    -
    - -

    get iMAP_Password attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getIMAP_Username ()
    -
    -
    - -

    get iMAP_Username attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getName ()
    -
    -
    - -

    get name attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getSGroupId ()
    -
    -
    - -

    get sGroupId attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getTag ()
    -
    -
    - -

    get tag attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - - -
    load_With_SGroupId (id)
    -
    -
    - -

    loads the object's attributes.

    -

    loads the object's attributes by giving a group id, it will put the matching groups attributes in the object.

    -
    Parameters:
    - - -
    $idthe id of the support group that should be loaded
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    set (values)
    -
    -
    - -

    sets the object's attributes.

    -
    Parameters:
    - - -
    $valuesshould be an array of the form array('SGroupId' => groupid, 'Name' => name, 'Tag' => tag, 'GroupEmail' => mail, 'IMAP_MailServer' => server, 'IMAP_Username' => username,'IMAP_Password' => pass).
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setGroupEmail (ge)
    -
    -
    - -

    set groupEmail attribute of the object.

    -
    Parameters:
    - - -
    $geemail of the group
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setIMAP_MailServer (ms)
    -
    -
    - -

    set iMAP_MailServer attribute of the object.

    -
    Parameters:
    - - -
    $msmailserver of the group
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setIMAP_Password (p)
    -
    -
    - -

    set iMAP_Password attribute of the object.

    -
    Parameters:
    - - -
    $pimap password of the group
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setIMAP_Username (u)
    -
    -
    - -

    set iMAP_Username attribute of the object.

    -
    Parameters:
    - - -
    $uimap username of the group
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setName (n)
    -
    -
    - -

    set name attribute of the object.

    -
    Parameters:
    - - -
    $nname of the group
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setSGroupId (id)
    -
    -
    - -

    set sGroupId attribute of the object.

    -
    Parameters:
    - - -
    $idinteger id of the group
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setTag (t)
    -
    -
    - -

    set tag attribute of the object.

    -
    Parameters:
    - - -
    $ttag of the group
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    static supportGroup_EntryNotExists (name,
    tag 
    ) [static]
    -
    -
    - -

    check if support group name/tag doesn't exist yet.

    -
    Parameters:
    - - - -
    $namethe name of the group we want to check
    $tagthe tag of the group we want to check
    -
    -
    -
    Returns:
    if name is already taken return NAME_TAKEN, else if tag is already taken return TAG_TAKEN, else return success.
    - -
    -
    - -
    -
    - - - - - - - - -
    static supportGroup_Exists (id) [static]
    -
    -
    - -

    check if support group entry coupled to a given id exist or not.

    -
    Parameters:
    - - -
    $idthe id of the group we want to check
    -
    -
    -
    Returns:
    true or false.
    - -
    -
    - -
    -
    - - - - - - - -
    update ()
    -
    -
    - -

    update the objects attributes to the db.

    - -
    -
    -

    Field Documentation

    - -
    -
    - - - - -
    $groupEmail [private]
    -
    -
    - -

    The email address of the group.

    - -
    -
    - -
    -
    - - - - -
    $iMAP_MailServer [private]
    -
    -
    - -

    The imap server connection string.

    - -
    -
    - -
    -
    - - - - -
    $iMAP_Password [private]
    -
    -
    - -

    The imap matching password.

    - -
    -
    - -
    -
    - - - - -
    $iMAP_Username [private]
    -
    -
    - -

    The imap username of the account.

    - -
    -
    - -
    -
    - - - - -
    $name [private]
    -
    -
    - -

    The name of the support group.

    - -
    -
    - -
    -
    - - - - -
    $sGroupId [private]
    -
    -
    - -

    The id of the support group.

    - -
    -
    - -
    -
    - - - - -
    $tag [private]
    -
    -
    - -

    The tag of the support group, a tag is max 4 letters big, and will be used in the future as easy reference to indicate what group it is refered to (eg [DEV])

    - -
    -
    -
    The documentation for this class was generated from the following file:
      -
    • /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/support_group.php
    • -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/classSync.html b/code/ryzom/tools/server/ryzom_ams_docs/html/classSync.html deleted file mode 100644 index a8dd8f45e..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/classSync.html +++ /dev/null @@ -1,149 +0,0 @@ - - - - - -Ryzom Account Management System: Sync Class Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    Sync Class Reference
    -
    -
    - -

    handler for performing changes when shard is back online after being offline. - More...

    - - - - -

    -Static Public Member Functions

    static syncdata ()
     performs the actions listed in the querycache.
    -

    Detailed Description

    -

    handler for performing changes when shard is back online after being offline.

    -

    the sync class is responsible for the syncdata function, which will synchronise the website with the shard (when the shard is offline, users can still change their password, email or even register)

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    -

    Member Function Documentation

    - -
    -
    - - - - - - - -
    static syncdata () [static]
    -
    -
    - -

    performs the actions listed in the querycache.

    -

    All entries in the querycache will be read and performed depending on their type. This is done because the shard could have been offline and we want changes made on the website (which is still online) to eventually hit the shard. These changes are: createPermissions, createUser, change_pass, change_mail

    - -
    -
    -
    The documentation for this class was generated from the following file:
      -
    • /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/sync.php
    • -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/classTicket.html b/code/ryzom/tools/server/ryzom_ams_docs/html/classTicket.html deleted file mode 100644 index 939c11d57..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/classTicket.html +++ /dev/null @@ -1,1429 +0,0 @@ - - - - - -Ryzom Account Management System: Ticket Class Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    - -
    - -

    class that handles most ticket related functions. - More...

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    -Public Member Functions

     __construct ()
     A constructor.
     set ($values)
     sets the object's attributes.
     create ()
     creates a new 'ticket' entry.
     load_With_TId ($id)
     loads the object's attributes.
     update ()
     update the objects attributes to the db.
     hasInfo ()
     check if a ticket has a ticket_info page or not.
     getTId ()
     get tId attribute of the object.
     getTimestamp ()
     get timestamp attribute of the object in the format defined in the outputTime function of the Helperclass.
     getTitle ()
     get title attribute of the object.
     getStatus ()
     get status attribute of the object.
     getStatusText ()
     get status attribute of the object in the form of text (string).
     getCategoryName ()
     get category attribute of the object in the form of text (string).
     getQueue ()
     get queue attribute of the object.
     getTicket_Category ()
     get ticket_category attribute of the object (int).
     getAuthor ()
     get author attribute of the object (int).
     getPriority ()
     get priority attribute of the object (int).
     getPriorityText ()
     get priority attribute of the object in the form of text (string).
     getAssigned ()
     get the user assigned to the ticket.
     getForwardedGroupName ()
     get the name of the support group to whom the ticket is forwarded or return 0 in case not forwarded.
     getForwardedGroupId ()
     get the id of the support group to whom the ticket is forwarded or return 0 in case not forwarded.
     setTId ($id)
     set tId attribute of the object.
     setTimestamp ($ts)
     set timestamp attribute of the object.
     setTitle ($t)
     set title attribute of the object.
     setStatus ($s)
     set status attribute of the object.
     setQueue ($q)
     set queue attribute of the object.
     setTicket_Category ($tc)
     set ticket_category attribute of the object.
     setAuthor ($a)
     set author attribute of the object.
     setPriority ($p)
     set priority attribute of the object.

    -Static Public Member Functions

    static ticketExists ($id)
     check if a ticket exists.
    static getStatusArray ()
     return an array of the possible statuses
    static getPriorityArray ()
     return an array of the possible priorities
    static getEntireTicket ($id, $view_as_admin)
     return an entire ticket.
    static getTicketsOf ($author)
     return all tickets of a specific user.
    static create_Ticket ($title, $content, $category, $author, $real_author, $for_support_group=0, $extra_info=0)
     function that creates a new ticket.
    static updateTicketStatus ($ticket_id, $newStatus, $author)
     updates the ticket's status.
    static updateTicketStatusAndPriority ($ticket_id, $newStatus, $newPriority, $author)
     updates the ticket's status & priority.
    static getLatestReply ($ticket_id)
     return the latest reply of a ticket
    static createReply ($content, $author, $ticket_id, $hidden)
     create a new reply for a ticket.
    static assignTicket ($user_id, $ticket_id)
     assign a ticket to a user.
    static unAssignTicket ($user_id, $ticket_id)
     unassign a ticket of a user.
    static forwardTicket ($user_id, $ticket_id, $group_id)
     forward a ticket to a specific support group.

    -Private Attributes

     $tId
     The id of ticket.
     $timestamp
     Timestamp of the ticket.
     $title
     Title of the ticket.
     $status
     Status of the ticket (0 = waiting on user reply, 1 = waiting on support, (2= not used atm), 3 = closed.
     $queue
     (not in use atm)
     $ticket_category
     the id of the category belonging to the ticket
     $author
     The ticket_users id.
     $priority
     The priority of the ticket where 0 = low, 3= supadupahigh.
    -

    Detailed Description

    -

    class that handles most ticket related functions.

    -

    the ticket class is used for most ticketing related functions, it also holds some wrapper functions.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    -

    Constructor & Destructor Documentation

    - -
    -
    - - - - - - - -
    __construct ()
    -
    -
    - -

    A constructor.

    -

    Empty constructor

    - -
    -
    -

    Member Function Documentation

    - -
    -
    - - - - - - - - - - - - - - - - - - -
    static assignTicket (user_id,
    ticket_id 
    ) [static]
    -
    -
    - -

    assign a ticket to a user.

    -

    Checks if the ticket exists, if so then it will try to assign the user to it, a log entry will be written about this.

    -
    Parameters:
    - - - -
    $user_idthe id of user trying to be assigned to the ticket.
    $ticket_idthe id of the ticket that we try to assign to the user.
    -
    -
    -
    Returns:
    SUCCESS_ASSIGNED, TICKET_NOT_EXISTING or ALREADY_ASSIGNED
    - -
    -
    - -
    -
    - - - - - - - -
    create ()
    -
    -
    - -

    creates a new 'ticket' entry.

    -

    this method will use the object's attributes for creating a new 'ticket' entry in the database.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    static create_Ticket (title,
    content,
    category,
    author,
    real_author,
    for_support_group = 0,
    extra_info = 0 
    ) [static]
    -
    -
    - -

    function that creates a new ticket.

    -

    A new ticket will be created, in case the extra_info != 0 and the http request came from ingame, then a ticket_info page will be created. A log entry will be written, depending on the $real_authors value. In case the for_support_group parameter is set, the ticket will be forwarded immediately. Also the mail handler will create a new email that will be sent to the author to notify him that his ticket is freshly created.

    -
    Parameters:
    - - - - - - - - -
    $titlethe title we want to give to the ticket.
    $contentthe content we want to give to the starting post of the ticket.
    $categorythe id of the category that should be related to the ticket.
    $authorthe person who's id will be stored in the database as creator of the ticket.
    $real_authorshould be the same id, or a moderator/admin who creates a ticket for another user (this is used for logging purposes).
    $for_support_groupin case you directly want to forward the ticket after creating it. (default value = 0 = don't forward)
    $extra_infoused for creating an ticket_info page related to the ticket, this only happens when the ticket is made ingame.
    -
    -
    -
    Returns:
    the created tickets id.
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    static createReply (content,
    author,
    ticket_id,
    hidden 
    ) [static]
    -
    -
    - -

    create a new reply for a ticket.

    -

    A reply will only be added if the content isn't empty and if the ticket isn't closed. The ticket creator will be notified by email that someone else replied on his ticket.

    -
    Parameters:
    - - - - - -
    $contentthe content of the reply
    $authorthe author of the reply
    $ticket_idthe id of the ticket to which we want to add the reply.
    $hiddenboolean that specifies if the reply should only be shown to mods/admins or all users.
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    static forwardTicket (user_id,
    ticket_id,
    group_id 
    ) [static]
    -
    -
    - -

    forward a ticket to a specific support group.

    -

    Checks if the ticket exists, if so then it will try to forward the ticket to the support group specified, a log entry will be written about this. if no log entry should be written then the user_id should be 0, else te $user_id will be used in the log to specify who forwarded it.

    -
    Parameters:
    - - - - -
    $user_idthe id of user trying to forward the ticket.
    $ticket_idthe id of the ticket that we try to forward to a support group.
    $group_idthe id of the support group.
    -
    -
    -
    Returns:
    SUCCESS_FORWARDED, TICKET_NOT_EXISTING or INVALID_SGROUP
    - -
    -
    - -
    -
    - - - - - - - -
    getAssigned ()
    -
    -
    - -

    get the user assigned to the ticket.

    -

    or return 0 in case not assigned.

    - -
    -
    - -
    -
    - - - - - - - -
    getAuthor ()
    -
    -
    - -

    get author attribute of the object (int).

    - -
    -
    - -
    -
    - - - - - - - -
    getCategoryName ()
    -
    -
    - -

    get category attribute of the object in the form of text (string).

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    static getEntireTicket (id,
    view_as_admin 
    ) [static]
    -
    -
    - -

    return an entire ticket.

    -

    returns the ticket object and an array of all replies to that ticket.

    -
    Parameters:
    - - - -
    $idthe id of the ticket.
    $view_as_admintrue if the viewer of the ticket is a mod, else false (depending on this it will also show the hidden comments)
    -
    -
    -
    Returns:
    an array containing the 'ticket_obj' and a 'reply_array', which is an array containing all replies to that ticket.
    - -
    -
    - -
    -
    - - - - - - - -
    getForwardedGroupId ()
    -
    -
    - -

    get the id of the support group to whom the ticket is forwarded or return 0 in case not forwarded.

    - -
    -
    - -
    -
    - - - - - - - -
    getForwardedGroupName ()
    -
    -
    - -

    get the name of the support group to whom the ticket is forwarded or return 0 in case not forwarded.

    - -
    -
    - -
    -
    - - - - - - - - -
    static getLatestReply (ticket_id) [static]
    -
    -
    - -

    return the latest reply of a ticket

    -
    Parameters:
    - - -
    $ticket_idthe id of the ticket.
    -
    -
    -
    Returns:
    a ticket_reply object.
    - -
    -
    - -
    -
    - - - - - - - -
    getPriority ()
    -
    -
    - -

    get priority attribute of the object (int).

    - -
    -
    - -
    -
    - - - - - - - -
    static getPriorityArray () [static]
    -
    -
    - -

    return an array of the possible priorities

    -
    Returns:
    an array containing the string values that represent the different priorities.
    - -
    -
    - -
    -
    - - - - - - - -
    getPriorityText ()
    -
    -
    - -

    get priority attribute of the object in the form of text (string).

    - -
    -
    - -
    -
    - - - - - - - -
    getQueue ()
    -
    -
    - -

    get queue attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getStatus ()
    -
    -
    - -

    get status attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    static getStatusArray () [static]
    -
    -
    - -

    return an array of the possible statuses

    -
    Returns:
    an array containing the string values that represent the different statuses.
    - -
    -
    - -
    -
    - - - - - - - -
    getStatusText ()
    -
    -
    - -

    get status attribute of the object in the form of text (string).

    - -
    -
    - -
    -
    - - - - - - - -
    getTicket_Category ()
    -
    -
    - -

    get ticket_category attribute of the object (int).

    - -
    -
    - -
    -
    - - - - - - - - -
    static getTicketsOf (author) [static]
    -
    -
    - -

    return all tickets of a specific user.

    -

    an array of all tickets created by a specific user are returned by this function.

    -
    Parameters:
    - - -
    $authorthe id of the user of whom we want all tickets from.
    -
    -
    -
    Returns:
    an array containing all ticket objects related to a user.
    - -
    -
    - -
    -
    - - - - - - - -
    getTId ()
    -
    -
    - -

    get tId attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getTimestamp ()
    -
    -
    - -

    get timestamp attribute of the object in the format defined in the outputTime function of the Helperclass.

    - -
    -
    - -
    -
    - - - - - - - -
    getTitle ()
    -
    -
    - -

    get title attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    hasInfo ()
    -
    -
    - -

    check if a ticket has a ticket_info page or not.

    -
    Returns:
    true or false
    - -
    -
    - -
    -
    - - - - - - - - -
    load_With_TId (id)
    -
    -
    - -

    loads the object's attributes.

    -

    loads the object's attributes by giving a TId (ticket id).

    -
    Parameters:
    - - -
    $idthe id of the ticket that should be loaded
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    set (values)
    -
    -
    - -

    sets the object's attributes.

    -
    Parameters:
    - - -
    $valuesshould be an array of the form array('TId' => ticket_id, 'Title' => title, 'Status'=> status, 'Timestamp' => ts, 'Queue' => queue, 'Ticket_Category' => tc, 'Author' => author, 'Priority' => priority).
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setAuthor (a)
    -
    -
    - -

    set author attribute of the object.

    -
    Parameters:
    - - -
    $aauthor of the ticket
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setPriority (p)
    -
    -
    - -

    set priority attribute of the object.

    -
    Parameters:
    - - -
    $ppriority of the ticket
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setQueue (q)
    -
    -
    - -

    set queue attribute of the object.

    -
    Parameters:
    - - -
    $qqueue of the ticket
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setStatus (s)
    -
    -
    - -

    set status attribute of the object.

    -
    Parameters:
    - - -
    $sstatus of the ticket(int)
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setTicket_Category (tc)
    -
    -
    - -

    set ticket_category attribute of the object.

    -
    Parameters:
    - - -
    $tcticket_category id of the ticket(int)
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setTId (id)
    -
    -
    - -

    set tId attribute of the object.

    -
    Parameters:
    - - -
    $idinteger id of the ticket
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setTimestamp (ts)
    -
    -
    - -

    set timestamp attribute of the object.

    -
    Parameters:
    - - -
    $tstimestamp of the ticket
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setTitle (t)
    -
    -
    - -

    set title attribute of the object.

    -
    Parameters:
    - - -
    $ttitle of the ticket
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    static ticketExists (id) [static]
    -
    -
    - -

    check if a ticket exists.

    -
    Parameters:
    - - -
    $idthe id of the ticket to be checked.
    -
    -
    -
    Returns:
    true if the ticket exists, else false.
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    static unAssignTicket (user_id,
    ticket_id 
    ) [static]
    -
    -
    - -

    unassign a ticket of a user.

    -

    Checks if the ticket exists, if so then it will try to unassign the user of it, a log entry will be written about this.

    -
    Parameters:
    - - - -
    $user_idthe id of user trying to be assigned to the ticket.
    $ticket_idthe id of the ticket that we try to assign to the user.
    -
    -
    -
    Returns:
    SUCCESS_UNASSIGNED, TICKET_NOT_EXISTING or NOT_ASSIGNED
    - -
    -
    - -
    -
    - - - - - - - -
    update ()
    -
    -
    - -

    update the objects attributes to the db.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    static updateTicketStatus (ticket_id,
    newStatus,
    author 
    ) [static]
    -
    -
    - -

    updates the ticket's status.

    -

    A log entry about this will be created only if the newStatus is different from the current status.

    -
    Parameters:
    - - - - -
    $ticket_idthe id of the ticket of which we want to change the status.
    $newStatusthe new status value (integer)
    $authorthe user (id) that performed the update status action
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    static updateTicketStatusAndPriority (ticket_id,
    newStatus,
    newPriority,
    author 
    ) [static]
    -
    -
    - -

    updates the ticket's status & priority.

    -

    A log entry about this will be created only if the newStatus is different from the current status and also when the newPriority is different from the current priority.

    -
    Todo:
    break this function up into a updateStatus (already exists) and updatePriority function and perhaps write a wrapper function for the combo.
    -
    Parameters:
    - - - - - -
    $ticket_idthe id of the ticket of which we want to change the status & priority
    $newStatusthe new status value (integer)
    $newPrioritythe new priority value (integer)
    $authorthe user (id) that performed the update
    -
    -
    - -
    -
    -

    Field Documentation

    - -
    -
    - - - - -
    $author [private]
    -
    -
    - -

    The ticket_users id.

    - -
    -
    - -
    -
    - - - - -
    $priority [private]
    -
    -
    - -

    The priority of the ticket where 0 = low, 3= supadupahigh.

    - -
    -
    - -
    -
    - - - - -
    $queue [private]
    -
    -
    - -

    (not in use atm)

    - -
    -
    - -
    -
    - - - - -
    $status [private]
    -
    -
    - -

    Status of the ticket (0 = waiting on user reply, 1 = waiting on support, (2= not used atm), 3 = closed.

    - -
    -
    - -
    -
    - - - - -
    $ticket_category [private]
    -
    -
    - -

    the id of the category belonging to the ticket

    - -
    -
    - -
    -
    - - - - -
    $tId [private]
    -
    -
    - -

    The id of ticket.

    - -
    -
    - -
    -
    - - - - -
    $timestamp [private]
    -
    -
    - -

    Timestamp of the ticket.

    - -
    -
    - -
    -
    - - - - -
    $title [private]
    -
    -
    - -

    Title of the ticket.

    - -
    -
    -
    The documentation for this class was generated from the following file:
      -
    • /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket.php
    • -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/classTicket__Category.html b/code/ryzom/tools/server/ryzom_ams_docs/html/classTicket__Category.html deleted file mode 100644 index 4a04b6b8d..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/classTicket__Category.html +++ /dev/null @@ -1,402 +0,0 @@ - - - - - -Ryzom Account Management System: Ticket_Category Class Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    Ticket_Category Class Reference
    -
    -
    - -

    Class related to the ticket categories. - More...

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    -Public Member Functions

     __construct ()
     A constructor.
     load_With_TCategoryId ($id)
     loads the object's attributes.
     update ()
     update object attributes to the DB.
     getName ()
     get name attribute of the object.
     getTCategoryId ()
     get tCategoryId attribute of the object.
     setName ($n)
     set name attribute of the object.
     setTCategoryId ($id)
     set tCategoryId attribute of the object.

    -Static Public Member Functions

    static createTicketCategory ($name)
     creates a ticket_Catergory in the DB.
    static constr_TCategoryId ($id)
     construct a category object based on the TCategoryId.
    static getAllCategories ()
     return a list of all category objects.

    -Private Attributes

     $tCategoryId
     The id of the category.
     $name
     The name of the category.
    -

    Detailed Description

    -

    Class related to the ticket categories.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    -

    Constructor & Destructor Documentation

    - -
    -
    - - - - - - - -
    __construct ()
    -
    -
    - -

    A constructor.

    -

    Empty constructor

    - -
    -
    -

    Member Function Documentation

    - -
    -
    - - - - - - - - -
    static constr_TCategoryId (id) [static]
    -
    -
    - -

    construct a category object based on the TCategoryId.

    -
    Returns:
    constructed element based on TCategoryId
    - -
    -
    - -
    -
    - - - - - - - - -
    static createTicketCategory (name) [static]
    -
    -
    - -

    creates a ticket_Catergory in the DB.

    -
    Parameters:
    - - -
    $namename we want to give to the new category.
    -
    -
    - -
    -
    - -
    -
    - - - - - - - -
    static getAllCategories () [static]
    -
    -
    - -

    return a list of all category objects.

    -
    Returns:
    an array consisting of all category objects.
    - -
    -
    - -
    -
    - - - - - - - -
    getName ()
    -
    -
    - -

    get name attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getTCategoryId ()
    -
    -
    - -

    get tCategoryId attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - - -
    load_With_TCategoryId (id)
    -
    -
    - -

    loads the object's attributes.

    -

    loads the object's attributes by giving a categories id.

    -
    Parameters:
    - - -
    $idthe id of the ticket_category that should be loaded
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setName (n)
    -
    -
    - -

    set name attribute of the object.

    -
    Parameters:
    - - -
    $nname of the category
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setTCategoryId (id)
    -
    -
    - -

    set tCategoryId attribute of the object.

    -
    Parameters:
    - - -
    $idinteger id of the category
    -
    -
    - -
    -
    - -
    -
    - - - - - - - -
    update ()
    -
    -
    - -

    update object attributes to the DB.

    - -
    -
    -

    Field Documentation

    - -
    -
    - - - - -
    $name [private]
    -
    -
    - -

    The name of the category.

    - -
    -
    - -
    -
    - - - - -
    $tCategoryId [private]
    -
    -
    - -

    The id of the category.

    - -
    -
    -
    The documentation for this class was generated from the following file:
      -
    • /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_category.php
    • -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/classTicket__Content.html b/code/ryzom/tools/server/ryzom_ams_docs/html/classTicket__Content.html deleted file mode 100644 index 0f375bbb7..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/classTicket__Content.html +++ /dev/null @@ -1,382 +0,0 @@ - - - - - -Ryzom Account Management System: Ticket_Content Class Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    Ticket_Content Class Reference
    -
    -
    - -

    Class that handles the content of a reply. - More...

    - - - - - - - - - - - - - - - - - - - - - - - - - - -

    -Public Member Functions

     __construct ()
     A constructor.
     create ()
     creates a new 'tickt_content' entry.
     load_With_TContentId ($id)
     loads the object's attributes.
     update ()
     update the object's attributes to the database.
     getContent ()
     get content attribute of the object.
     getTContentId ()
     get tContentId attribute of the object.
     setContent ($c)
     set content attribute of the object.
     setTContentId ($c)
     set tContentId attribute of the object.

    -Static Public Member Functions

    static constr_TContentId ($id)
     return constructed element based on TContentId.

    -Private Attributes

     $tContentId
     The id of ticket_content entry.
     $content
     The content of an entry.
    -

    Detailed Description

    -

    Class that handles the content of a reply.

    -

    The Ticket_Content has a one-to-one relation with a ticket_reply, it contains the content of a reply, this way the content doesn't always have to be loaded when we query the database when we only need information regarding to the replies basic information.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    -

    Constructor & Destructor Documentation

    - -
    -
    - - - - - - - -
    __construct ()
    -
    -
    - -

    A constructor.

    -

    Empty constructor

    - -
    -
    -

    Member Function Documentation

    - -
    -
    - - - - - - - - -
    static constr_TContentId (id) [static]
    -
    -
    - -

    return constructed element based on TContentId.

    -
    Parameters:
    - - -
    $idthe id of ticket_content entry.
    -
    -
    -
    Returns:
    a constructed ticket_content object by specifying the TContentId.
    - -
    -
    - -
    -
    - - - - - - - -
    create ()
    -
    -
    - -

    creates a new 'tickt_content' entry.

    -

    this method will use the object's attributes for creating a new 'ticket_content' entry in the database.

    - -
    -
    - -
    -
    - - - - - - - -
    getContent ()
    -
    -
    - -

    get content attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getTContentId ()
    -
    -
    - -

    get tContentId attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - - -
    load_With_TContentId (id)
    -
    -
    - -

    loads the object's attributes.

    -

    loads the object's attributes by giving a ticket_content's id,

    -
    Parameters:
    - - -
    $idthe id of the ticket_content entry that should be loaded
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setContent (c)
    -
    -
    - -

    set content attribute of the object.

    -
    Parameters:
    - - -
    $ccontent of a reply
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setTContentId (c)
    -
    -
    - -

    set tContentId attribute of the object.

    -
    Parameters:
    - - -
    $cinteger id of ticket_content entry
    -
    -
    - -
    -
    - -
    -
    - - - - - - - -
    update ()
    -
    -
    - -

    update the object's attributes to the database.

    - -
    -
    -

    Field Documentation

    - -
    -
    - - - - -
    $content [private]
    -
    -
    - -

    The content of an entry.

    - -
    -
    - -
    -
    - - - - -
    $tContentId [private]
    -
    -
    - -

    The id of ticket_content entry.

    - -
    -
    -
    The documentation for this class was generated from the following file:
      -
    • /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_content.php
    • -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/classTicket__Info.html b/code/ryzom/tools/server/ryzom_ams_docs/html/classTicket__Info.html deleted file mode 100644 index c88c41481..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/classTicket__Info.html +++ /dev/null @@ -1,1463 +0,0 @@ - - - - - -Ryzom Account Management System: Ticket_Info Class Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    - -
    - -

    Class that handles additional info sent by ticket creation ingame. - More...

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    -Public Member Functions

     __construct ()
     A constructor.
     set ($values)
     sets the object's attributes.
     load_With_TInfoId ($id)
     loads the object's attributes by using a ticket_info id.
     load_With_Ticket ($id)
     loads the object's attributes by using a ticket's id.
     create ()
     creates a new 'ticket_info' entry.
     getTInfoId ()
     get tInfoId attribute of the object.
     getTicket ()
     get ticket attribute of the object.
     getShardId ()
     get shardid attribute of the object.
     getUser_Position ()
     get user_position attribute of the object.
     getView_Position ()
     get view_position attribute of the object.
     getClient_Version ()
     get client_version attribute of the object.
     getPatch_Version ()
     get patch_version attribute of the object.
     getServer_Tick ()
     get server_tick attribute of the object.
     getConnect_State ()
     get connect_state attribute of the object.
     getLocal_Address ()
     get local_address attribute of the object.
     getMemory ()
     get memory attribute of the object.
     getOS ()
     get os attribute of the object.
     getProcessor ()
     get processor attribute of the object.
     getCPUId ()
     get cpu_id attribute of the object.
     getCPU_Mask ()
     get cpu_mask attribute of the object.
     getHT ()
     get ht attribute of the object.
     getNel3D ()
     get nel3d attribute of the object.
     getUser_Id ()
     get user_id attribute of the object.
     setTInfoId ($id)
     set tInfoId attribute of the object.
     setTicket ($t)
     set ticket attribute of the object.
     setShardId ($s)
     set shardid attribute of the object.
     setUser_Position ($u)
     set user_position attribute of the object.
     setView_Position ($v)
     set view_position attribute of the object.
     setClient_Version ($c)
     set client_version attribute of the object.
     setPatch_Version ($p)
     set patch_version attribute of the object.
     setServer_Tick ($s)
     set server_tick attribute of the object.
     setConnect_State ($c)
     set connect_state attribute of the object.
     setLocal_Address ($l)
     set local_address attribute of the object.
     setMemory ($m)
     set memory attribute of the object.
     setOS ($o)
     set os attribute of the object.
     setProcessor ($p)
     set processor attribute of the object.
     setCPUId ($c)
     set cpu_id attribute of the object.
     setCPU_Mask ($c)
     set cpu_mask attribute of the object.
     setHT ($h)
     set ht attribute of the object.
     setNel3D ($n)
     set nel3d attribute of the object.
     setUser_Id ($u)
     set user_id attribute of the object.

    -Static Public Member Functions

    static create_Ticket_Info ($info_array)
     create a ticket_info entry.
    static TicketHasInfo ($ticket_id)
     check if a specific ticket has extra info or not.

    -Private Attributes

     $tInfoId
     The id of ticket_info entry.
     $ticket
     The ticket linked to this ticket_info entry.
     $shardid
     The shard id.
     $user_position
     The user's character position.
     $view_position
     The view position of the character.
     $client_version
     The client version in use.
     $patch_version
     The patch version in use.
     $server_tick
     The current server tick.
     $connect_state
     The connect state.
     $local_address
     local ip
     $memory
     memory usage information
     $os
     os information
     $processor
     processor information
     $cpu_id
     the cpu id
     $cpu_mask
     the cpu mask
     $ht
     tbh I have no idea :D
     $nel3d
     the nel3d version
     $user_id
     The users id.
    -

    Detailed Description

    -

    Class that handles additional info sent by ticket creation ingame.

    -

    If a user creates a ticket ingame, there are a lot of extra $_GET parameters being sent inside the http request that might have something todo with the ticket. for example the OS the user uses or the processor of it's computer, but also the current client version etc. This information can be stored and retrieved by using the ticket_info class.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    -

    Constructor & Destructor Documentation

    - -
    -
    - - - - - - - -
    __construct ()
    -
    -
    - -

    A constructor.

    -

    Empty constructor

    - -
    -
    -

    Member Function Documentation

    - -
    -
    - - - - - - - -
    create ()
    -
    -
    - -

    creates a new 'ticket_info' entry.

    -

    this method will use the object's attributes for creating a new 'ticket_info' entry in the database.

    - -
    -
    - -
    -
    - - - - - - - - -
    static create_Ticket_Info (info_array) [static]
    -
    -
    - -

    create a ticket_info entry.

    -
    Parameters:
    - - -
    $info_arraythe info array (this can be the entire $_GET array being sent by the ingame browser)
    -
    -
    - -
    -
    - -
    -
    - - - - - - - -
    getClient_Version ()
    -
    -
    - -

    get client_version attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getConnect_State ()
    -
    -
    - -

    get connect_state attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getCPU_Mask ()
    -
    -
    - -

    get cpu_mask attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getCPUId ()
    -
    -
    - -

    get cpu_id attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getHT ()
    -
    -
    - -

    get ht attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getLocal_Address ()
    -
    -
    - -

    get local_address attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getMemory ()
    -
    -
    - -

    get memory attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getNel3D ()
    -
    -
    - -

    get nel3d attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getOS ()
    -
    -
    - -

    get os attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getPatch_Version ()
    -
    -
    - -

    get patch_version attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getProcessor ()
    -
    -
    - -

    get processor attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getServer_Tick ()
    -
    -
    - -

    get server_tick attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getShardId ()
    -
    -
    - -

    get shardid attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getTicket ()
    -
    -
    - -

    get ticket attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getTInfoId ()
    -
    -
    - -

    get tInfoId attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getUser_Id ()
    -
    -
    - -

    get user_id attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getUser_Position ()
    -
    -
    - -

    get user_position attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getView_Position ()
    -
    -
    - -

    get view_position attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - - -
    load_With_Ticket (id)
    -
    -
    - -

    loads the object's attributes by using a ticket's id.

    -

    loads the object's attributes by giving a ticket's entry id.

    -
    Parameters:
    - - -
    $idthe id of the ticket, the ticket_info entry of that ticket should be loaded.
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    load_With_TInfoId (id)
    -
    -
    - -

    loads the object's attributes by using a ticket_info id.

    -

    loads the object's attributes by giving a ticket_info's entry id.

    -
    Parameters:
    - - -
    $idthe id of the ticket_info entry that should be loaded
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    set (values)
    -
    -
    - -

    sets the object's attributes.

    -
    Parameters:
    - - -
    $valuesshould be an array.
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setClient_Version (c)
    -
    -
    - -

    set client_version attribute of the object.

    -
    Parameters:
    - - -
    $cclient version number
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setConnect_State (c)
    -
    -
    - -

    set connect_state attribute of the object.

    -
    Parameters:
    - - -
    $cstring that defines the connect state.
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setCPU_Mask (c)
    -
    -
    - -

    set cpu_mask attribute of the object.

    -
    Parameters:
    - - -
    $cmask of the cpu
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setCPUId (c)
    -
    -
    - -

    set cpu_id attribute of the object.

    -
    Parameters:
    - - -
    $ccpu id information
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setHT (h)
    -
    -
    - -

    set ht attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - - -
    setLocal_Address (l)
    -
    -
    - -

    set local_address attribute of the object.

    -
    Parameters:
    - - -
    $llocal address
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setMemory (m)
    -
    -
    - -

    set memory attribute of the object.

    -
    Parameters:
    - - -
    $mmemory usage
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setNel3D (n)
    -
    -
    - -

    set nel3d attribute of the object.

    -
    Parameters:
    - - -
    $nversion information about NeL3D
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setOS (o)
    -
    -
    - -

    set os attribute of the object.

    -
    Parameters:
    - - -
    $oset os version information
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setPatch_Version (p)
    -
    -
    - -

    set patch_version attribute of the object.

    -
    Parameters:
    - - -
    $ppatch version number
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setProcessor (p)
    -
    -
    - -

    set processor attribute of the object.

    -
    Parameters:
    - - -
    $pprocessor information
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setServer_Tick (s)
    -
    -
    - -

    set server_tick attribute of the object.

    -
    Parameters:
    - - -
    $sinteger that resembles the server tick
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setShardId (s)
    -
    -
    - -

    set shardid attribute of the object.

    -
    Parameters:
    - - -
    $s(integer) shard id
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setTicket (t)
    -
    -
    - -

    set ticket attribute of the object.

    -
    Parameters:
    - - -
    $tinteger id of the ticket linked to the info object
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setTInfoId (id)
    -
    -
    - -

    set tInfoId attribute of the object.

    -
    Parameters:
    - - -
    $idinteger id of ticket_info object itself
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setUser_Id (u)
    -
    -
    - -

    set user_id attribute of the object.

    -
    Parameters:
    - - -
    $uthe user_id.
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setUser_Position (u)
    -
    -
    - -

    set user_position attribute of the object.

    -
    Parameters:
    - - -
    $uthe users position
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setView_Position (v)
    -
    -
    - -

    set view_position attribute of the object.

    -
    Parameters:
    - - -
    $vthe view position
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    static TicketHasInfo (ticket_id) [static]
    -
    -
    - -

    check if a specific ticket has extra info or not.

    -

    Not all tickets have extra info, only tickets made ingame do. This function checks if a specific ticket does have a ticket_info entry linked to it.

    -
    Parameters:
    - - -
    $ticket_idthe id of the ticket that we want to query
    -
    -
    -
    Returns:
    true or false
    - -
    -
    -

    Field Documentation

    - -
    -
    - - - - -
    $client_version [private]
    -
    -
    - -

    The client version in use.

    - -
    -
    - -
    -
    - - - - -
    $connect_state [private]
    -
    -
    - -

    The connect state.

    - -
    -
    - -
    -
    - - - - -
    $cpu_id [private]
    -
    -
    - -

    the cpu id

    - -
    -
    - -
    -
    - - - - -
    $cpu_mask [private]
    -
    -
    - -

    the cpu mask

    - -
    -
    - -
    -
    - - - - -
    $ht [private]
    -
    -
    - -

    tbh I have no idea :D

    - -
    -
    - -
    -
    - - - - -
    $local_address [private]
    -
    -
    - -

    local ip

    - -
    -
    - -
    -
    - - - - -
    $memory [private]
    -
    -
    - -

    memory usage information

    - -
    -
    - -
    -
    - - - - -
    $nel3d [private]
    -
    -
    - -

    the nel3d version

    - -
    -
    - -
    -
    - - - - -
    $os [private]
    -
    -
    - -

    os information

    - -
    -
    - -
    -
    - - - - -
    $patch_version [private]
    -
    -
    - -

    The patch version in use.

    - -
    -
    - -
    -
    - - - - -
    $processor [private]
    -
    -
    - -

    processor information

    - -
    -
    - -
    -
    - - - - -
    $server_tick [private]
    -
    -
    - -

    The current server tick.

    - -
    -
    - -
    -
    - - - - -
    $shardid [private]
    -
    -
    - -

    The shard id.

    - -
    -
    - -
    -
    - - - - -
    $ticket [private]
    -
    -
    - -

    The ticket linked to this ticket_info entry.

    - -
    -
    - -
    -
    - - - - -
    $tInfoId [private]
    -
    -
    - -

    The id of ticket_info entry.

    - -
    -
    - -
    -
    - - - - -
    $user_id [private]
    -
    -
    - -

    The users id.

    - -
    -
    - -
    -
    - - - - -
    $user_position [private]
    -
    -
    - -

    The user's character position.

    - -
    -
    - -
    -
    - - - - -
    $view_position [private]
    -
    -
    - -

    The view position of the character.

    - -
    -
    -
    The documentation for this class was generated from the following file:
      -
    • /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_info.php
    • -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/classTicket__Log.html b/code/ryzom/tools/server/ryzom_ams_docs/html/classTicket__Log.html deleted file mode 100644 index 59efe7def..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/classTicket__Log.html +++ /dev/null @@ -1,763 +0,0 @@ - - - - - -Ryzom Account Management System: Ticket_Log Class Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    - -
    - -

    Class that handles the logging. - More...

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    -Public Member Functions

     __construct ()
     A constructor.
     set ($values)
     sets the object's attributes.
     load_With_TLogId ($id)
     loads the object's attributes.
     update ()
     update attributes of the object to the DB.
     getTLogId ()
     get tLogId attribute of the object.
     getTimestamp ()
     get timestamp attribute of the object.
     getQuery ()
     get query attribute of the object.
     getAuthor ()
     get author attribute of the object.
     getTicket ()
     get ticket attribute of the object.
     getAction ()
     get the action id out of the query by decoding it.
     getArgument ()
     get the argument out of the query by decoding it.
     getActionTextArray ()
     get the action text(string) array.
     setTLogId ($id)
     set tLogId attribute of the object.
     setTimestamp ($t)
     set timestamp attribute of the object.
     setQuery ($q)
     set query attribute of the object.
     setAuthor ($a)
     set author attribute of the object.
     setTicket ($t)
     set ticket attribute of the object.

    -Static Public Member Functions

    static getLogsOfTicket ($ticket_id)
     return all log entries related to a ticket.
    static createLogEntry ($ticket_id, $author_id, $action, $arg=-1)
     create a new log entry.
    static constr_TLogId ($id)
     return constructed element based on TLogId
    static getAllLogs ($ticket_id)
     return all log entries related to a ticket.

    -Private Attributes

     $tLogId
     The id of the log entry.
     $timestamp
     The timestamp of the log entry.
     $query
     The query (json encoded array containing action id & argument)
     $author
     author of the log
     $ticket
     the id of the ticket related to the log entry
    -

    Detailed Description

    -

    Class that handles the logging.

    -

    The logging will be used when a ticket is created, a reply is added, if someone views a ticket, if someone assigns a ticket to him or if someone forwards a ticket. This class provides functions to get retrieve those logs and also make them.

    -

    -the Action IDs being used are:

    -
      -
    1. User X Created ticket
    2. -
    3. Admin X created ticket for arg
    4. -
    5. Read ticket
    6. -
    7. Added Reply ID: arg to ticket
    8. -
    9. Changed status to arg
    10. -
    11. Changed Priority to arg
    12. -
    13. assigned to the ticket
    14. -
    15. forwarded ticket to support group arg
    16. -
    17. unassigned to the ticket
    18. -
    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    -

    Constructor & Destructor Documentation

    - -
    -
    - - - - - - - -
    __construct ()
    -
    -
    - -

    A constructor.

    -

    Empty constructor

    - -
    -
    -

    Member Function Documentation

    - -
    -
    - - - - - - - - -
    static constr_TLogId (id) [static]
    -
    -
    - -

    return constructed element based on TLogId

    -
    Parameters:
    - - -
    $idticket_log id of the entry that we want to load into our object.
    -
    -
    -
    Returns:
    constructed ticket_log object.
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    static createLogEntry (ticket_id,
    author_id,
    action,
    arg = -1 
    ) [static]
    -
    -
    - -

    create a new log entry.

    -

    It will check if the $TICKET_LOGGING global var is true, this var is used to turn logging on and off. In case it's on, the log message will be stored. the action id and argument (which is -1 by default), will be json encoded and stored in the query field in the db.

    -
    Parameters:
    - - - - - -
    $ticket_idthe id of the ticket related to the new log entry
    $author_idthe id of the user that instantiated the logging.
    $actionthe action id (see the list in the class description)
    $argargument for the action (default = -1)
    -
    -
    - -
    -
    - -
    -
    - - - - - - - -
    getAction ()
    -
    -
    - -

    get the action id out of the query by decoding it.

    - -
    -
    - -
    -
    - - - - - - - -
    getActionTextArray ()
    -
    -
    - -

    get the action text(string) array.

    -

    this is being read from the language .ini files.

    - -
    -
    - -
    -
    - - - - - - - - -
    static getAllLogs (ticket_id) [static]
    -
    -
    - -

    return all log entries related to a ticket.

    -
    Parameters:
    - - -
    $ticket_idthe id of the ticket of which we want all related log entries returned.
    -
    -
    -
    Returns:
    an array of ticket_log objects, here the author is an integer.
    -
    Todo:
    only use one of the 2 comparable functions in the future and make the other depricated.
    - -
    -
    - -
    -
    - - - - - - - -
    getArgument ()
    -
    -
    - -

    get the argument out of the query by decoding it.

    - -
    -
    - -
    -
    - - - - - - - -
    getAuthor ()
    -
    -
    - -

    get author attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - - -
    static getLogsOfTicket (ticket_id) [static]
    -
    -
    - -

    return all log entries related to a ticket.

    -
    Parameters:
    - - -
    $ticket_idthe id of the ticket of which we want all related log entries returned.
    -
    -
    -
    Returns:
    an array of ticket_log objects, be aware that the author in the ticket_log object is a ticket_user object on its own (so not a simple integer).
    - -
    -
    - -
    -
    - - - - - - - -
    getQuery ()
    -
    -
    - -

    get query attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getTicket ()
    -
    -
    - -

    get ticket attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getTimestamp ()
    -
    -
    - -

    get timestamp attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getTLogId ()
    -
    -
    - -

    get tLogId attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - - -
    load_With_TLogId (id)
    -
    -
    - -

    loads the object's attributes.

    -

    loads the object's attributes by giving a ticket_log entries ID (TLogId).

    -
    Parameters:
    - - -
    idthe id of the ticket_log entry that should be loaded
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    set (values)
    -
    -
    - -

    sets the object's attributes.

    -
    Parameters:
    - - -
    $valuesshould be an array.
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setAuthor (a)
    -
    -
    - -

    set author attribute of the object.

    -
    Parameters:
    - - -
    $ainteger id of the user who created the log entry
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setQuery (q)
    -
    -
    - -

    set query attribute of the object.

    -
    Parameters:
    - - -
    $qthe encoded query
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setTicket (t)
    -
    -
    - -

    set ticket attribute of the object.

    -
    Parameters:
    - - -
    $tinteger id of ticket of which the log entry is related to.
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setTimestamp (t)
    -
    -
    - -

    set timestamp attribute of the object.

    -
    Parameters:
    - - -
    $ttimestamp of the log entry
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setTLogId (id)
    -
    -
    - -

    set tLogId attribute of the object.

    -
    Parameters:
    - - -
    $idinteger id of the log entry
    -
    -
    - -
    -
    - -
    -
    - - - - - - - -
    update ()
    -
    -
    - -

    update attributes of the object to the DB.

    - -
    -
    -

    Field Documentation

    - -
    -
    - - - - -
    $author [private]
    -
    -
    - -

    author of the log

    - -
    -
    - -
    -
    - - - - -
    $query [private]
    -
    -
    - -

    The query (json encoded array containing action id & argument)

    - -
    -
    - -
    -
    - - - - -
    $ticket [private]
    -
    -
    - -

    the id of the ticket related to the log entry

    - -
    -
    - -
    -
    - - - - -
    $timestamp [private]
    -
    -
    - -

    The timestamp of the log entry.

    - -
    -
    - -
    -
    - - - - -
    $tLogId [private]
    -
    -
    - -

    The id of the log entry.

    - -
    -
    -
    The documentation for this class was generated from the following file:
      -
    • /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_log.php
    • -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/classTicket__Queue.html b/code/ryzom/tools/server/ryzom_ams_docs/html/classTicket__Queue.html deleted file mode 100644 index 63ebf5e09..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/classTicket__Queue.html +++ /dev/null @@ -1,401 +0,0 @@ - - - - - -Ryzom Account Management System: Ticket_Queue Class Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    Ticket_Queue Class Reference
    -
    -
    - -

    Data class that holds a lot of queries that load specific tickets. - More...

    - - - - - - - - - - - - - - - - - - - - - - - - - -

    -Public Member Functions

     loadAllNotAssignedTickets ()
     loads the not yet assigned tickets query into the objects attributes.
     loadAllTickets ()
     loads the 'all' tickets query into the objects attributes.
     loadAllOpenTickets ()
     loads the 'all open' tickets query into the objects attributes.
     loadAllClosedTickets ()
     loads the 'closed' tickets query into the objects attributes.
     loadToDoTickets ($user_id)
     loads the 'todo' tickets query & params into the objects attributes.
     loadAssignedandWaiting ($user_id)
     loads the 'tickets asssigned to a user and waiting on support' query & params into the objects attributes.
     createQueue ($userid, $groupid, $what, $how, $who)
     loads the 'created' query & params into the objects attributes.
     getQuery ()
     get query attribute of the object.
     getParams ()
     get params attribute of the object.

    -Private Attributes

     $query
     The query that loads specific tickets.
     $params
     The parameter array that's being needed by the query.
    -

    Detailed Description

    -

    Data class that holds a lot of queries that load specific tickets.

    -

    These queries are being used by the ticket_queue_handler class. An object of this class holds 2 attributes: the query and the params used for the query.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    -

    Member Function Documentation

    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    createQueue (userid,
    groupid,
    what,
    how,
    who 
    )
    -
    -
    - -

    loads the 'created' query & params into the objects attributes.

    -

    This function creates dynamically a query based on the selected features.

    -
    Parameters:
    - - - - - - -
    $whospecifies if we want to user the user_id or group_id to form the query.
    $useridthe user's id to whom the tickets should be assigned/not assigned
    $groupidthe group's id to whom the tickets should be forwarded/not forwarded
    $whatspecifies what kind of tickets we want to return: waiting for support, waiting on user, closed
    $howspecifies if the tickets should be or shouldn't be assigned/forwarded to the group/user selected.
    -
    -
    - -
    -
    - -
    -
    - - - - - - - -
    getParams ()
    -
    -
    - -

    get params attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getQuery ()
    -
    -
    - -

    get query attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    loadAllClosedTickets ()
    -
    -
    - -

    loads the 'closed' tickets query into the objects attributes.

    - -
    -
    - -
    -
    - - - - - - - -
    loadAllNotAssignedTickets ()
    -
    -
    - -

    loads the not yet assigned tickets query into the objects attributes.

    - -
    -
    - -
    -
    - - - - - - - -
    loadAllOpenTickets ()
    -
    -
    - -

    loads the 'all open' tickets query into the objects attributes.

    - -
    -
    - -
    -
    - - - - - - - -
    loadAllTickets ()
    -
    -
    - -

    loads the 'all' tickets query into the objects attributes.

    - -
    -
    - -
    -
    - - - - - - - - -
    loadAssignedandWaiting (user_id)
    -
    -
    - -

    loads the 'tickets asssigned to a user and waiting on support' query & params into the objects attributes.

    -
    Parameters:
    - - -
    $user_idthe user's id to whom the tickets should be assigned
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    loadToDoTickets (user_id)
    -
    -
    - -

    loads the 'todo' tickets query & params into the objects attributes.

    -

    first: find the tickets assigned to the user with status = waiting on support, second find all not assigned tickets that aren't forwarded yet. find all tickets assigned to someone else witht status waiting on support, with timestamp of last reply > 1 day, find all non-assigned tickets forwarded to the support groups to which that user belongs

    -
    Parameters:
    - - -
    $user_idthe user's id to whom the tickets should be assigned
    -
    -
    - -
    -
    -

    Field Documentation

    - -
    -
    - - - - -
    $params [private]
    -
    -
    - -

    The parameter array that's being needed by the query.

    - -
    -
    - -
    -
    - - - - -
    $query [private]
    -
    -
    - -

    The query that loads specific tickets.

    - -
    -
    -
    The documentation for this class was generated from the following file:
      -
    • /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_queue.php
    • -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/classTicket__Queue__Handler.html b/code/ryzom/tools/server/ryzom_ams_docs/html/classTicket__Queue__Handler.html deleted file mode 100644 index 93d3cb996..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/classTicket__Queue__Handler.html +++ /dev/null @@ -1,395 +0,0 @@ - - - - - -Ryzom Account Management System: Ticket_Queue_Handler Class Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    Ticket_Queue_Handler Class Reference
    -
    -
    - -

    returns tickets (queues) that are related in some way. - More...

    - - - - - - - - - - - - - - - - - - - - - - - - -

    -Public Member Functions

     __construct ()
     A constructor.
     getTickets ($input, $user_id)
     returns the tickets that are related in someway defined by $input.
     getPagination ()
     get pagination attribute of the object.
     createQueue ($userid, $groupid, $what, $how, $who)
     creates the queue.

    -Static Public Member Functions

    static getNrOfTicketsToDo ($user_id)
     get the number of tickets in the todo queue for a specific user.
    static getNrOfTicketsAssignedWaiting ($user_id)
     get the number of tickets assigned to a specific user and waiting for support.
    static getNrOfTickets ()
     get the total number of tickets.
    static getNewestTicket ()
     get the ticket object of the latest added ticket.

    -Private Attributes

     $pagination
     Pagination object, this way only a few tickets (related to that pagenumber) will be shown.
     $queue
     The queue object, being used to get the queries and parameters.
    -

    Detailed Description

    -

    returns tickets (queues) that are related in some way.

    -

    This class handles the creation and returning of existing ticket queues. Normally a $_GET['get'] parameter is being used to identify what kind of tickets should be shown. the getTickets() function uses this parameter($input) and uses the ticket_queue class to load the specific query.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    -

    Constructor & Destructor Documentation

    - -
    -
    - - - - - - - -
    __construct ()
    -
    -
    - -

    A constructor.

    -

    Instantiates the queue object.

    - -
    -
    -

    Member Function Documentation

    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    createQueue (userid,
    groupid,
    what,
    how,
    who 
    )
    -
    -
    - -

    creates the queue.

    -

    afterwards the getTickets function should be called, else a lot of extra parameters had to be added to the getTickets function..

    - -
    -
    - -
    -
    - - - - - - - -
    static getNewestTicket () [static]
    -
    -
    - -

    get the ticket object of the latest added ticket.

    - -
    -
    - -
    -
    - - - - - - - -
    static getNrOfTickets () [static]
    -
    -
    - -

    get the total number of tickets.

    - -
    -
    - -
    -
    - - - - - - - - -
    static getNrOfTicketsAssignedWaiting (user_id) [static]
    -
    -
    - -

    get the number of tickets assigned to a specific user and waiting for support.

    -
    Parameters:
    - - -
    $user_idthe user being queried
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    static getNrOfTicketsToDo (user_id) [static]
    -
    -
    - -

    get the number of tickets in the todo queue for a specific user.

    -
    Parameters:
    - - -
    $user_idthe user being queried
    -
    -
    - -
    -
    - -
    -
    - - - - - - - -
    getPagination ()
    -
    -
    - -

    get pagination attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    getTickets (input,
    user_id 
    )
    -
    -
    - -

    returns the tickets that are related in someway defined by $input.

    -

    The $input parameter should be a string that defines what kind of queue should be loaded. A new pagination object will be instantiated and will load 10 entries, related to the $_GET['pagenum'] variable.

    -
    Parameters:
    - - - -
    $inputidentifier that defines what queue to load.
    $user_idthe id of the user that browses the queues, some queues can be depending on this.
    -
    -
    -
    Returns:
    an array consisting of ticket objects, beware, the author & category of a ticket, are objects on their own (no integers are used this time).
    - -
    -
    -

    Field Documentation

    - -
    -
    - - - - -
    $pagination [private]
    -
    -
    - -

    Pagination object, this way only a few tickets (related to that pagenumber) will be shown.

    - -
    -
    - -
    -
    - - - - -
    $queue [private]
    -
    -
    - -

    The queue object, being used to get the queries and parameters.

    - -
    -
    -
    The documentation for this class was generated from the following file: -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/classTicket__Reply.html b/code/ryzom/tools/server/ryzom_ams_docs/html/classTicket__Reply.html deleted file mode 100644 index eed01a154..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/classTicket__Reply.html +++ /dev/null @@ -1,764 +0,0 @@ - - - - - -Ryzom Account Management System: Ticket_Reply Class Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    - -
    - -

    handles functions related to replies on tickets. - More...

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    -Public Member Functions

     __construct ()
     A constructor.
     set ($values)
     sets the object's attributes.
     create ()
     creates a new 'ticket_reply' entry.
     load_With_TReplyId ($id)
     loads the object's attributes.
     update ()
     updates a ticket_reply entry based on the objects attributes.
     getTicket ()
     get ticket attribute of the object.
     getContent ()
     get content attribute of the object.
     getAuthor ()
     get author attribute of the object.
     getTimestamp ()
     get timestamp attribute of the object.
     getTReplyId ()
     get tReplyId attribute of the object.
     getHidden ()
     get hidden attribute of the object.
     setTicket ($t)
     set ticket attribute of the object.
     setContent ($c)
     set content attribute of the object.
     setAuthor ($a)
     set author attribute of the object.
     setTimestamp ($t)
     set timestamp attribute of the object.
     setTReplyId ($i)
     set tReplyId attribute of the object.
     setHidden ($h)
     set hidden attribute of the object.

    -Static Public Member Functions

    static constr_TReplyId ($id)
     return constructed element based on TReplyId.
    static getRepliesOfTicket ($ticket_id, $view_as_admin)
     return all replies on a specific ticket.
    static createReply ($content, $author, $ticket_id, $hidden, $ticket_creator)
     creates a new reply on a ticket.

    -Private Attributes

     $tReplyId
     The id of the reply.
     $ticket
     the ticket id related to the reply
     $content
     the content of the reply
     $author
     The id of the user that made the reply.
     $timestamp
     The timestamp of the reply.
     $hidden
     indicates if reply should be hidden for normal users or not
    -

    Detailed Description

    -

    handles functions related to replies on tickets.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    -

    Constructor & Destructor Documentation

    - -
    -
    - - - - - - - -
    __construct ()
    -
    -
    - -

    A constructor.

    -

    Empty constructor

    - -
    -
    -

    Member Function Documentation

    - -
    -
    - - - - - - - - -
    static constr_TReplyId (id) [static]
    -
    -
    - -

    return constructed element based on TReplyId.

    -
    Parameters:
    - - -
    $idthe Id the reply we want to load.
    -
    -
    -
    Returns:
    the loaded object.
    - -
    -
    - -
    -
    - - - - - - - -
    create ()
    -
    -
    - -

    creates a new 'ticket_reply' entry.

    -

    this method will use the object's attributes for creating a new 'ticket_reply' entry in the database (the now() function will create the timestamp).

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    static createReply (content,
    author,
    ticket_id,
    hidden,
    ticket_creator 
    ) [static]
    -
    -
    - -

    creates a new reply on a ticket.

    -

    Creates a ticket_content entry and links it with a new created ticket_reply, a log entry will be written about this. In case the ticket creator replies on a ticket, he will set the status by default to 'waiting on support'.

    -
    Parameters:
    - - - - - - -
    $contentthe content of the reply
    $authorthe id of the reply creator.
    $ticket_idthe id of the ticket of which we want the replies.
    $hiddenshould be 0 or 1
    $ticket_creatorthe ticket's starter his id.
    -
    -
    - -
    -
    - -
    -
    - - - - - - - -
    getAuthor ()
    -
    -
    - -

    get author attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getContent ()
    -
    -
    - -

    get content attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getHidden ()
    -
    -
    - -

    get hidden attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    static getRepliesOfTicket (ticket_id,
    view_as_admin 
    ) [static]
    -
    -
    - -

    return all replies on a specific ticket.

    -
    Parameters:
    - - - -
    $ticket_idthe id of the ticket of which we want the replies.
    $view_as_adminif the browsing user is an admin/mod it should be 1, this will also show the hidden replies.
    -
    -
    -
    Returns:
    an array with ticket_reply objects (beware the author and content are objects on their own, not integers!)
    - -
    -
    - -
    -
    - - - - - - - -
    getTicket ()
    -
    -
    - -

    get ticket attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getTimestamp ()
    -
    -
    - -

    get timestamp attribute of the object.

    -

    The output format is defined by the Helpers class function, outputTime().

    - -
    -
    - -
    -
    - - - - - - - -
    getTReplyId ()
    -
    -
    - -

    get tReplyId attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - - -
    load_With_TReplyId (id)
    -
    -
    - -

    loads the object's attributes.

    -

    loads the object's attributes by giving a ticket_reply's id.

    -
    Parameters:
    - - -
    $idthe id of the ticket_reply that should be loaded
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    set (values)
    -
    -
    - -

    sets the object's attributes.

    -
    Parameters:
    - - -
    $valuesshould be an array.
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setAuthor (a)
    -
    -
    - -

    set author attribute of the object.

    -
    Parameters:
    - - -
    $ainteger id of the user
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setContent (c)
    -
    -
    - -

    set content attribute of the object.

    -
    Parameters:
    - - -
    $cinteger id of the ticket_content entry
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setHidden (h)
    -
    -
    - -

    set hidden attribute of the object.

    -
    Parameters:
    - - -
    $hshould be 0 or 1
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setTicket (t)
    -
    -
    - -

    set ticket attribute of the object.

    -
    Parameters:
    - - -
    $tinteger id of the ticket
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setTimestamp (t)
    -
    -
    - -

    set timestamp attribute of the object.

    -
    Parameters:
    - - -
    $ttimestamp of the reply
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setTReplyId (i)
    -
    -
    - -

    set tReplyId attribute of the object.

    -
    Parameters:
    - - -
    $iinteger id of the ticket_reply
    -
    -
    - -
    -
    - -
    -
    - - - - - - - -
    update ()
    -
    -
    - -

    updates a ticket_reply entry based on the objects attributes.

    - -
    -
    -

    Field Documentation

    - -
    -
    - - - - -
    $author [private]
    -
    -
    - -

    The id of the user that made the reply.

    - -
    -
    - -
    -
    - - - - -
    $content [private]
    -
    -
    - -

    the content of the reply

    - -
    -
    - -
    -
    - - - - -
    $hidden [private]
    -
    -
    - -

    indicates if reply should be hidden for normal users or not

    - -
    -
    - -
    -
    - - - - -
    $ticket [private]
    -
    -
    - -

    the ticket id related to the reply

    - -
    -
    - -
    -
    - - - - -
    $timestamp [private]
    -
    -
    - -

    The timestamp of the reply.

    - -
    -
    - -
    -
    - - - - -
    $tReplyId [private]
    -
    -
    - -

    The id of the reply.

    - -
    -
    -
    The documentation for this class was generated from the following file:
      -
    • /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_reply.php
    • -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/classTicket__User.html b/code/ryzom/tools/server/ryzom_ams_docs/html/classTicket__User.html deleted file mode 100644 index 3e74dc034..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/classTicket__User.html +++ /dev/null @@ -1,745 +0,0 @@ - - - - - -Ryzom Account Management System: Ticket_User Class Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    - -
    - -

    user entry point in the ticket system. - More...

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    -Public Member Functions

     __construct ()
     A constructor.
     set ($values)
     sets the object's attributes.
     load_With_TUserId ($id)
     loads the object's attributes.
     update ()
     update the object's attributes to the db.
     getPermission ()
     get permission attribute of the object.
     getExternId ()
     get externId attribute of the object.
     getTUserId ()
     get tUserId attribute of the object.
     setPermission ($perm)
     set permission attribute of the object.
     setExternId ($id)
     set externId attribute of the object.
     setTUserId ($id)
     set tUserId attribute of the object.

    -Static Public Member Functions

    static createTicketUser ($extern_id, $permission)
     create a new ticket user.
    static isMod ($user)
     check if a ticket_user object is a mod or not.
    static isAdmin ($user)
     check if a ticket_user object is an admin or not.
    static constr_TUserId ($id)
     return constructed ticket_user object based on TUserId.
    static getModsAndAdmins ()
     return a list of all mods/admins.
    static constr_ExternId ($id)
     return constructed ticket_user object based on ExternId.
    static change_permission ($user_id, $perm)
     change the permission of a ticket_user.
    static get_email_by_user_id ($id)
     return the email address of a ticket_user.
    static get_username_from_id ($id)
     return the username of a ticket_user.
    static get_id_from_username ($username)
     return the TUserId of a ticket_user by giving a username.
    static get_id_from_email ($email)
     return the ticket_user id from an email address.

    -Private Attributes

     $tUserId
     The id of the user inside the ticket system.
     $permission
     The permission of the user.
     $externId
     The id of the user account in the www (could be drupal,...) that is linked to the ticket_user.
    -

    Detailed Description

    -

    user entry point in the ticket system.

    -

    The ticket_user makes a link between the entire ticket system's lib db and the www user, which is stored in another db (this is the external ID). The externalID could be the ID of a drupal user or wordpress user,.. The ticket_user also stores the permission of that user, this way the permission system is inside the lib itself and can be used in any www version that you like. permission 1 = user, 2 = mod, 3 = admin.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    -

    Constructor & Destructor Documentation

    - -
    -
    - - - - - - - -
    __construct ()
    -
    -
    - -

    A constructor.

    -

    Empty constructor

    - -
    -
    -

    Member Function Documentation

    - -
    -
    - - - - - - - - - - - - - - - - - - -
    static change_permission (user_id,
    perm 
    ) [static]
    -
    -
    - -

    change the permission of a ticket_user.

    -
    Parameters:
    - - - -
    $user_idthe TUserId of the entry.
    $permthe new permission value.
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    static constr_ExternId (id) [static]
    -
    -
    - -

    return constructed ticket_user object based on ExternId.

    -
    Parameters:
    - - -
    $idthe ExternId of the entry.
    -
    -
    -
    Returns:
    constructed ticket_user object
    - -
    -
    - -
    -
    - - - - - - - - -
    static constr_TUserId (id) [static]
    -
    -
    - -

    return constructed ticket_user object based on TUserId.

    -
    Parameters:
    - - -
    $idthe TUserId of the entry.
    -
    -
    -
    Returns:
    constructed ticket_user object
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    static createTicketUser (extern_id,
    permission 
    ) [static]
    -
    -
    - -

    create a new ticket user.

    -
    Parameters:
    - - - -
    $extern_idthe id of the user account in the www version (drupal,...)
    $permissionthe permission that will be given to the user. 1=user, 2=mod, 3=admin
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    static get_email_by_user_id (id) [static]
    -
    -
    - -

    return the email address of a ticket_user.

    -
    Parameters:
    - - -
    $idthe TUserId of the entry.
    -
    -
    -
    Returns:
    string containing the email address of that user.
    - -
    -
    - -
    -
    - - - - - - - - -
    static get_id_from_email (email) [static]
    -
    -
    - -

    return the ticket_user id from an email address.

    -
    Parameters:
    - - -
    $emailthe emailaddress of a user.
    -
    -
    -
    Returns:
    the ticket_user id related to that email address, in case none, return "FALSE".
    - -
    -
    - -
    -
    - - - - - - - - -
    static get_id_from_username (username) [static]
    -
    -
    - -

    return the TUserId of a ticket_user by giving a username.

    -
    Parameters:
    - - -
    $usernamethe username of a user.
    -
    -
    -
    Returns:
    the TUserId related to that username.
    - -
    -
    - -
    -
    - - - - - - - - -
    static get_username_from_id (id) [static]
    -
    -
    - -

    return the username of a ticket_user.

    -
    Parameters:
    - - -
    $idthe TUserId of the entry.
    -
    -
    -
    Returns:
    string containing username of that user.
    - -
    -
    - -
    -
    - - - - - - - -
    getExternId ()
    -
    -
    - -

    get externId attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    static getModsAndAdmins () [static]
    -
    -
    - -

    return a list of all mods/admins.

    -
    Returns:
    an array consisting of ticket_user objects that are mods & admins.
    - -
    -
    - -
    -
    - - - - - - - -
    getPermission ()
    -
    -
    - -

    get permission attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getTUserId ()
    -
    -
    - -

    get tUserId attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - - -
    static isAdmin (user) [static]
    -
    -
    - -

    check if a ticket_user object is an admin or not.

    -
    Parameters:
    - - -
    $userthe ticket_user object itself
    -
    -
    -
    Returns:
    true or false
    - -
    -
    - -
    -
    - - - - - - - - -
    static isMod (user) [static]
    -
    -
    - -

    check if a ticket_user object is a mod or not.

    -
    Parameters:
    - - -
    $userthe ticket_user object itself
    -
    -
    -
    Returns:
    true or false
    - -
    -
    - -
    -
    - - - - - - - - -
    load_With_TUserId (id)
    -
    -
    - -

    loads the object's attributes.

    -

    loads the object's attributes by giving a TUserId.

    -
    Parameters:
    - - -
    $idthe id of the ticket_user that should be loaded
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    set (values)
    -
    -
    - -

    sets the object's attributes.

    -
    Parameters:
    - - -
    $valuesshould be an array of the form array('TUserId' => id, 'Permission' => perm, 'ExternId' => ext_id).
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setExternId (id)
    -
    -
    - -

    set externId attribute of the object.

    -
    Parameters:
    - - -
    $idthe external id.
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setPermission (perm)
    -
    -
    - -

    set permission attribute of the object.

    -
    Parameters:
    - - -
    $perminteger that indicates the permission level. (1= user, 2= mod, 3= admin)
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    setTUserId (id)
    -
    -
    - -

    set tUserId attribute of the object.

    -
    Parameters:
    - - -
    $idthe ticket_user id
    -
    -
    - -
    -
    - -
    -
    - - - - - - - -
    update ()
    -
    -
    - -

    update the object's attributes to the db.

    - -
    -
    -

    Field Documentation

    - -
    -
    - - - - -
    $externId [private]
    -
    -
    - -

    The id of the user account in the www (could be drupal,...) that is linked to the ticket_user.

    - -
    -
    - -
    -
    - - - - -
    $permission [private]
    -
    -
    - -

    The permission of the user.

    - -
    -
    - -
    -
    - - - - -
    $tUserId [private]
    -
    -
    - -

    The id of the user inside the ticket system.

    - -
    -
    -
    The documentation for this class was generated from the following file:
      -
    • /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_user.php
    • -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/classUsers.html b/code/ryzom/tools/server/ryzom_ams_docs/html/classUsers.html deleted file mode 100644 index 4083fde9c..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/classUsers.html +++ /dev/null @@ -1,641 +0,0 @@ - - - - - -Ryzom Account Management System: Users Class Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    - -
    - -

    handles basic user registration & management functions (shard related). - More...

    -
    -Inheritance diagram for Users:
    -
    -
    - - -WebUsers -WebUsers - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    -Public Member Functions

     check_Register ($values)
     checks if entered values before registering are valid.
     checkUser ($username)
     checks if entered username is valid.
     checkPassword ($pass)
     checks if the password is valid.
     checkEmail ($email)
     wrapper to check if the email address is valid.
     validEmail ($email)
     check if the emailaddress structure is valid.
     check_change_password ($values)
     check if the changing of a password is valid.

    -Static Public Member Functions

    static generateSALT ($length=2)
     generate a SALT.
    static createUser ($values, $user_id)
     creates a user in the shard.
    static createPermissions ($pvalues)
     creates permissions in the shard db for a user.

    -Protected Member Functions

     checkUserNameExists ($username)
     check if username already exists.
     checkEmailExists ($email)
     check if email already exists.
     checkLoginMatch ($user, $pass)
     check if username and password matches.
     setAmsPassword ($user, $pass)
     sets the shards password.
     setAmsEmail ($user, $mail)
     sets the shards email.

    -Private Member Functions

     confirmPassword ($pass_result, $pass, $confirmpass)
     checks if the confirmPassword matches the original.
    -

    Detailed Description

    -

    handles basic user registration & management functions (shard related).

    -

    The Users class is the basis class of WebUsers, this class provides functions being used by all CMS's and our own www version. The WebUsers class however needs to be reimplemented by using the CMS's it's funcionality. This class handles the writing to the shard db mainly, and in case it's offline: writing to the ams_querycache.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    -

    Member Function Documentation

    - -
    -
    - - - - - - - - -
    check_change_password (values)
    -
    -
    - -

    check if the changing of a password is valid.

    -

    a mod/admin doesn't has to fill in the previous password when he wants to change the password, however for changing his own password he has to fill it in.

    -
    Parameters:
    - - -
    $valuesan array containing the CurrentPass, ConfirmNewPass, NewPass and adminChangesOthers
    -
    -
    -
    Returns:
    if it is valid "success will be returned, else an array with errors will be returned.
    - -
    -
    - -
    -
    - - - - - - - - -
    check_Register (values)
    -
    -
    - -

    checks if entered values before registering are valid.

    -
    Parameters:
    - - -
    $valuesarray with Username,Password, ConfirmPass and Email.
    -
    -
    -
    Returns:
    string Info: Returns a string, if input data is valid then "success" is returned, else an array with errors
    - -
    -
    - -
    -
    - - - - - - - - -
    checkEmail (email)
    -
    -
    - -

    wrapper to check if the email address is valid.

    -
    Parameters:
    - - -
    $emailthe email address
    -
    -
    -
    Returns:
    "success", else in case it isn't valid an error will be returned.
    - -
    -
    - -
    -
    - - - - - - - - -
    checkEmailExists (email) [protected]
    -
    -
    - -

    check if email already exists.

    -

    This is the base function, it should be overwritten by the WebUsers class.

    -
    Parameters:
    - - -
    $emailthe email address
    -
    -
    -
    Returns:
    string Info: Returns true or false if the email is in the www db.
    - -

    Reimplemented in WebUsers, and WebUsers.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    checkLoginMatch (user,
    pass 
    ) [protected]
    -
    -
    - -

    check if username and password matches.

    -

    This is the base function, it should be overwritten by the WebUsers class.

    -
    Parameters:
    - - - -
    $userthe inserted username
    $passthe inserted password
    -
    -
    - -

    Reimplemented in WebUsers, and WebUsers.

    - -
    -
    - -
    -
    - - - - - - - - -
    checkPassword (pass)
    -
    -
    - -

    checks if the password is valid.

    -
    Parameters:
    - - -
    $passthe password willing to be used.
    -
    -
    -
    Returns:
    string Info: Returns a string based on if the password is valid, if valid then "success" is returned
    - -
    -
    - -
    -
    - - - - - - - - -
    checkUser (username)
    -
    -
    - -

    checks if entered username is valid.

    -
    Parameters:
    - - -
    $usernamethe username that the user wants to use.
    -
    -
    -
    Returns:
    string Info: Returns a string based on if the username is valid, if valid then "success" is returned
    - -
    -
    - -
    -
    - - - - - - - - -
    checkUserNameExists (username) [protected]
    -
    -
    - -

    check if username already exists.

    -

    This is the base function, it should be overwritten by the WebUsers class.

    -
    Parameters:
    - - -
    $usernamethe username
    -
    -
    -
    Returns:
    string Info: Returns true or false if the user is in the www db.
    - -

    Reimplemented in WebUsers, and WebUsers.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    confirmPassword (pass_result,
    pass,
    confirmpass 
    ) [private]
    -
    -
    - -

    checks if the confirmPassword matches the original.

    -
    Parameters:
    - - - - -
    $pass_resultthe result of the previous password check.
    $passthe original pass.
    $confirmpassthe confirmation password.
    -
    -
    -
    Returns:
    string Info: Verify's $_POST["Password"] is the same as $_POST["ConfirmPass"]
    - -
    -
    - -
    -
    - - - - - - - - -
    static createPermissions (pvalues) [static]
    -
    -
    - -

    creates permissions in the shard db for a user.

    -

    incase the shard is offline it will place it in the ams_querycache.

    -
    Parameters:
    - - -
    $pvalueswith username
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    static createUser (values,
    user_id 
    ) [static]
    -
    -
    - -

    creates a user in the shard.

    -

    incase the shard is offline it will place it in the ams_querycache. You have to create a user first in the CMS/WWW and use the id for this function.

    -
    Parameters:
    - - - -
    $valueswith name,pass and mail
    $user_idthe extern id of the user (the id given by the www/CMS)
    -
    -
    -
    Returns:
    ok if it's get correctly added to the shard, else return lib offline and put in libDB, if libDB is also offline return liboffline.
    - -
    -
    - -
    -
    - - - - - - - - -
    static generateSALT (length = 2) [static]
    -
    -
    - -

    generate a SALT.

    -
    Parameters:
    - - -
    $lengththe length of the SALT which is by default 2
    -
    -
    -
    Returns:
    a random salt of 2 chars
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    setAmsEmail (user,
    mail 
    ) [protected]
    -
    -
    - -

    sets the shards email.

    -

    in case the shard is offline, the entry will be stored in the ams_querycache.

    -
    Parameters:
    - - - -
    $userthe usersname of the account of which we want to change the emailaddress.
    $mailthe new email address
    -
    -
    -
    Returns:
    ok if it worked, if the lib or shard is offline it will return liboffline or shardoffline.
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    setAmsPassword (user,
    pass 
    ) [protected]
    -
    -
    - -

    sets the shards password.

    -

    in case the shard is offline, the entry will be stored in the ams_querycache.

    -
    Parameters:
    - - - -
    $userthe usersname of the account of which we want to change the password.
    $passthe new password.
    -
    -
    -
    Returns:
    ok if it worked, if the lib or shard is offline it will return liboffline or shardoffline.
    - -
    -
    - -
    -
    - - - - - - - - -
    validEmail (email)
    -
    -
    - -

    check if the emailaddress structure is valid.

    -
    Parameters:
    - - -
    $emailthe email address
    -
    -
    -
    Returns:
    true or false
    - -
    -
    -
    The documentation for this class was generated from the following file:
      -
    • /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/users.php
    • -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/classUsers.png b/code/ryzom/tools/server/ryzom_ams_docs/html/classUsers.png deleted file mode 100644 index 85efb81d9..000000000 Binary files a/code/ryzom/tools/server/ryzom_ams_docs/html/classUsers.png and /dev/null differ diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/classWebUsers.html b/code/ryzom/tools/server/ryzom_ams_docs/html/classWebUsers.html deleted file mode 100644 index edb9aed56..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/classWebUsers.html +++ /dev/null @@ -1,1509 +0,0 @@ - - - - - -Ryzom Account Management System: WebUsers Class Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    - -
    - -

    handles CMS/WWW related functions regarding user management & registration. - More...

    -
    -Inheritance diagram for WebUsers:
    -
    -
    - - -Users -Users - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    -Public Member Functions

     __construct ($UId=0)
     A constructor.
     set ($values)
     sets the object's attributes.
     checkLoginMatch ($username, $password)
     check if the login username and password match the db.
     getUId ()
     get uId attribute of the object.
     getUsername ()
     get login attribute of the object.
     getEmail ()
     get email attribute of the object.
     getInfo ()
     get basic info of the object.
     getReceiveMail ()
     get receiveMail attribute of the object.
     getLanguage ()
     get language attribute of the object.
     isLoggedIn ()
     check if the user is logged in.
     setPassword ($user, $pass)
     update the password.
     setEmail ($user, $mail)
     update the emailaddress.
     getUsers ()
     return all users.
     __construct ($UId=0)
     A constructor.
     set ($values)
     sets the object's attributes.
     checkLoginMatch ($username, $password)
     check if the login username and password match the db.
     getUId ()
     get uId attribute of the object.
     getUsername ()
     get login attribute of the object.
     getEmail ()
     get email attribute of the object.
     getInfo ()
     get basic info of the object.
     getReceiveMail ()
     get receiveMail attribute of the object.
     getLanguage ()
     get language attribute of the object.
     isLoggedIn ()
     check if the user is logged in.
     setPassword ($user, $pass)
     update the password.
     setEmail ($user, $mail)
     update the emailaddress.
     getUsers ()
     return all users.

    -Static Public Member Functions

    static getId ($username)
     returns te id for a given username
    static getIdFromEmail ($email)
     returns te id for a given emailaddress
    static setReceiveMail ($user, $receivemail)
     update the setReceiveMail value in the db.
    static setLanguage ($user, $language)
     update the language value in the db.
    static getAllUsersQuery ()
     return the query that should get all users.
    static createWebuser ($name, $pass, $mail)
     creates a webuser.
    static getId ($username)
     returns te id for a given username
    static getIdFromEmail ($email)
     returns te id for a given emailaddress
    static setReceiveMail ($user, $receivemail)
     update the setReceiveMail value in the db.
    static setLanguage ($user, $language)
     update the language value in the db.
    static getAllUsersQuery ()
     return the query that should get all users.
    static createWebuser ($name, $pass, $mail)
     creates a webuser.

    -Protected Member Functions

     checkUserNameExists ($username)
     function that checks if a username exists already or not.
     checkEmailExists ($email)
     function that checks if a email exists already or not.
     checkUserNameExists ($username)
     function that checks if a username exists already or not.
     checkEmailExists ($email)
     function that checks if a email exists already or not.

    -Private Attributes

     $uId
     The user id.
     $login
     The username.
     $email
     The email address.
     $firstname
     The users first name.
     $lastname
     The users last name.
     $gender
     The gender.
     $country
     2 letter word matching the country of the user
     $receiveMail
     configuration regarding if the user wants to receive email notifications or not.
     $language
     Language of the user.
    -

    Detailed Description

    -

    handles CMS/WWW related functions regarding user management & registration.

    -

    inherits from the Users class. The methods of this class have to be rewritten according to the CMS's functionality that you wish to use. The drupal_module has a webusers class of its own in the module itself.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    -

    Constructor & Destructor Documentation

    - -
    -
    - - - - - - - - -
    __construct (UId = 0)
    -
    -
    - -

    A constructor.

    -

    loads the object with the UID, if none is given it will use 0.

    -
    Parameters:
    - - -
    $UIdthe UID of the user you want to instantiate.
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    __construct (UId = 0)
    -
    -
    - -

    A constructor.

    -

    loads the object with the UID, if none is given it will use 0.

    -
    Parameters:
    - - -
    $UIdthe UID of the user you want to instantiate.
    -
    -
    - -
    -
    -

    Member Function Documentation

    - -
    -
    - - - - - - - - -
    checkEmailExists (email) [protected]
    -
    -
    - -

    function that checks if a email exists already or not.

    -

    This function overrides the function of the base class.

    -
    Parameters:
    - - -
    $emailthe email address in question.
    -
    -
    -
    Returns:
    string Info: Returns 0 if the email address is not in the web db, else a positive number is returned.
    - -

    Reimplemented from Users.

    - -
    -
    - -
    -
    - - - - - - - - -
    checkEmailExists (email) [protected]
    -
    -
    - -

    function that checks if a email exists already or not.

    -

    This function overrides the function of the base class.

    -
    Parameters:
    - - -
    $emailthe email address in question.
    -
    -
    -
    Returns:
    string Info: Returns 0 if the email address is not in the web db, else a positive number is returned.
    - -

    Reimplemented from Users.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    checkLoginMatch (username,
    password 
    )
    -
    -
    - -

    check if the login username and password match the db.

    -
    Parameters:
    - - - -
    $usernamethe inserted username
    $passwordthe inserted password (unhashed)
    -
    -
    -
    Returns:
    the logged in user's db row as array if login was a success, else "fail" will be returned.
    - -

    Reimplemented from Users.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    checkLoginMatch (username,
    password 
    )
    -
    -
    - -

    check if the login username and password match the db.

    -
    Parameters:
    - - - -
    $usernamethe inserted username
    $passwordthe inserted password (unhashed)
    -
    -
    -
    Returns:
    the logged in user's db row as array if login was a success, else "fail" will be returned.
    - -

    Reimplemented from Users.

    - -
    -
    - -
    -
    - - - - - - - - -
    checkUserNameExists (username) [protected]
    -
    -
    - -

    function that checks if a username exists already or not.

    -

    This function overrides the function of the base class.

    -
    Parameters:
    - - -
    $usernamethe username in question
    -
    -
    -
    Returns:
    string Info: Returns 0 if the user is not in the web db, else a positive number is returned.
    - -

    Reimplemented from Users.

    - -
    -
    - -
    -
    - - - - - - - - -
    checkUserNameExists (username) [protected]
    -
    -
    - -

    function that checks if a username exists already or not.

    -

    This function overrides the function of the base class.

    -
    Parameters:
    - - -
    $usernamethe username in question
    -
    -
    -
    Returns:
    string Info: Returns 0 if the user is not in the web db, else a positive number is returned.
    - -

    Reimplemented from Users.

    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    static createWebuser (name,
    pass,
    mail 
    ) [static]
    -
    -
    - -

    creates a webuser.

    -

    it will set the language matching to the language cookie setting and add it to the www/CMS's DB.

    -
    Parameters:
    - - - - -
    $namethe username
    $passthe unhashed password
    $mailthe email address
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    static createWebuser (name,
    pass,
    mail 
    ) [static]
    -
    -
    - -

    creates a webuser.

    -

    it will set the language matching to the language cookie setting and add it to the www/CMS's DB.

    -
    Parameters:
    - - - - -
    $namethe username
    $passthe unhashed password
    $mailthe email address
    -
    -
    - -
    -
    - -
    -
    - - - - - - - -
    static getAllUsersQuery () [static]
    -
    -
    - -

    return the query that should get all users.

    -
    Returns:
    string: the query to receive all users.
    - -
    -
    - -
    -
    - - - - - - - -
    static getAllUsersQuery () [static]
    -
    -
    - -

    return the query that should get all users.

    -
    Returns:
    string: the query to receive all users.
    - -
    -
    - -
    -
    - - - - - - - -
    getEmail ()
    -
    -
    - -

    get email attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getEmail ()
    -
    -
    - -

    get email attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - - -
    static getId (username) [static]
    -
    -
    - -

    returns te id for a given username

    -
    Parameters:
    - - -
    $usernamethe username
    -
    -
    -
    Returns:
    the user's id linked to the username
    - -
    -
    - -
    -
    - - - - - - - - -
    static getId (username) [static]
    -
    -
    - -

    returns te id for a given username

    -
    Parameters:
    - - -
    $usernamethe username
    -
    -
    -
    Returns:
    the user's id linked to the username
    - -
    -
    - -
    -
    - - - - - - - - -
    static getIdFromEmail (email) [static]
    -
    -
    - -

    returns te id for a given emailaddress

    -
    Parameters:
    - - -
    $emailthe emailaddress
    -
    -
    -
    Returns:
    the user's id linked to the emailaddress
    - -
    -
    - -
    -
    - - - - - - - - -
    static getIdFromEmail (email) [static]
    -
    -
    - -

    returns te id for a given emailaddress

    -
    Parameters:
    - - -
    $emailthe emailaddress
    -
    -
    -
    Returns:
    the user's id linked to the emailaddress
    - -
    -
    - -
    -
    - - - - - - - -
    getInfo ()
    -
    -
    - -

    get basic info of the object.

    -
    Returns:
    returns an array in the form of Array('FirstName' => $this->firstname, 'LastName' => $this->lastname, 'Gender' => $this->gender, 'Country' => $this->country, 'ReceiveMail' => $this->receiveMail)
    - -
    -
    - -
    -
    - - - - - - - -
    getInfo ()
    -
    -
    - -

    get basic info of the object.

    -
    Returns:
    returns an array in the form of Array('FirstName' => $this->firstname, 'LastName' => $this->lastname, 'Gender' => $this->gender, 'Country' => $this->country, 'ReceiveMail' => $this->receiveMail)
    - -
    -
    - -
    -
    - - - - - - - -
    getLanguage ()
    -
    -
    - -

    get language attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getLanguage ()
    -
    -
    - -

    get language attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getReceiveMail ()
    -
    -
    - -

    get receiveMail attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getReceiveMail ()
    -
    -
    - -

    get receiveMail attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getUId ()
    -
    -
    - -

    get uId attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getUId ()
    -
    -
    - -

    get uId attribute of the object.

    - -
    -
    - -
    -
    - - - - - - - -
    getUsername ()
    -
    -
    - -

    get login attribute of the object.

    -

    (username)

    - -
    -
    - -
    -
    - - - - - - - -
    getUsername ()
    -
    -
    - -

    get login attribute of the object.

    -

    (username)

    - -
    -
    - -
    -
    - - - - - - - -
    getUsers ()
    -
    -
    - -

    return all users.

    -
    Returns:
    return an array of users
    - -
    -
    - -
    -
    - - - - - - - -
    getUsers ()
    -
    -
    - -

    return all users.

    -
    Returns:
    return an array of users
    - -
    -
    - -
    -
    - - - - - - - -
    isLoggedIn ()
    -
    -
    - -

    check if the user is logged in.

    -
    Returns:
    true or false
    - -
    -
    - -
    -
    - - - - - - - -
    isLoggedIn ()
    -
    -
    - -

    check if the user is logged in.

    -
    Returns:
    true or false
    - -
    -
    - -
    -
    - - - - - - - - -
    set (values)
    -
    -
    - -

    sets the object's attributes.

    -
    Parameters:
    - - -
    $valuesshould be an array.
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - -
    set (values)
    -
    -
    - -

    sets the object's attributes.

    -
    Parameters:
    - - -
    $valuesshould be an array.
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    setEmail (user,
    mail 
    )
    -
    -
    - -

    update the emailaddress.

    -

    update the emailaddress in the shard + update the emailaddress in the www/CMS version.

    -
    Parameters:
    - - - -
    $userthe username
    $mailthe new emailaddress.
    -
    -
    -
    Returns:
    ok if it worked, if the lib or shard is offline it will return liboffline or shardoffline.
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    setEmail (user,
    mail 
    )
    -
    -
    - -

    update the emailaddress.

    -

    update the emailaddress in the shard + update the emailaddress in the www/CMS version.

    -
    Parameters:
    - - - -
    $userthe username
    $mailthe new emailaddress.
    -
    -
    -
    Returns:
    ok if it worked, if the lib or shard is offline it will return liboffline or shardoffline.
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    static setLanguage (user,
    language 
    ) [static]
    -
    -
    - -

    update the language value in the db.

    -

    update the language in the www/CMS version.

    -
    Parameters:
    - - - -
    $userthe username
    $languagethe new language value.
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    static setLanguage (user,
    language 
    ) [static]
    -
    -
    - -

    update the language value in the db.

    -

    update the language in the www/CMS version.

    -
    Parameters:
    - - - -
    $userthe username
    $languagethe new language value.
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    setPassword (user,
    pass 
    )
    -
    -
    - -

    update the password.

    -

    update the password in the shard + update the password in the www/CMS version.

    -
    Parameters:
    - - - -
    $userthe username
    $passthe new password.
    -
    -
    -
    Returns:
    ok if it worked, if the lib or shard is offline it will return liboffline or shardoffline.
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    setPassword (user,
    pass 
    )
    -
    -
    - -

    update the password.

    -

    update the password in the shard + update the password in the www/CMS version.

    -
    Parameters:
    - - - -
    $userthe username
    $passthe new password.
    -
    -
    -
    Returns:
    ok if it worked, if the lib or shard is offline it will return liboffline or shardoffline.
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    static setReceiveMail (user,
    receivemail 
    ) [static]
    -
    -
    - -

    update the setReceiveMail value in the db.

    -

    update the receiveMail in the www/CMS version.

    -
    Parameters:
    - - - -
    $userthe username
    $receivemailthe receivemail setting .
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    static setReceiveMail (user,
    receivemail 
    ) [static]
    -
    -
    - -

    update the setReceiveMail value in the db.

    -

    update the receiveMail in the www/CMS version.

    -
    Parameters:
    - - - -
    $userthe username
    $receivemailthe receivemail setting .
    -
    -
    - -
    -
    -

    Field Documentation

    - -
    -
    - - - - -
    $country [private]
    -
    -
    - -

    2 letter word matching the country of the user

    - -
    -
    - -
    -
    - - - - -
    $email [private]
    -
    -
    - -

    The email address.

    - -
    -
    - -
    -
    - - - - -
    $firstname [private]
    -
    -
    - -

    The users first name.

    - -
    -
    - -
    -
    - - - - -
    $gender [private]
    -
    -
    - -

    The gender.

    - -
    -
    - -
    -
    - - - - -
    $language [private]
    -
    -
    - -

    Language of the user.

    - -
    -
    - -
    -
    - - - - -
    $lastname [private]
    -
    -
    - -

    The users last name.

    - -
    -
    - -
    -
    - - - - -
    $login [private]
    -
    -
    - -

    The username.

    - -
    -
    - -
    -
    - - - - -
    $receiveMail [private]
    -
    -
    - -

    configuration regarding if the user wants to receive email notifications or not.

    - -
    -
    - -
    -
    - - - - -
    $uId [private]
    -
    -
    - -

    The user id.

    - -
    -
    -
    The documentation for this class was generated from the following files:
      -
    • /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/autoload/webusers.php
    • -
    • /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/autoload/webusers.php
    • -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/classWebUsers.png b/code/ryzom/tools/server/ryzom_ams_docs/html/classWebUsers.png deleted file mode 100644 index 8aca4ddb0..000000000 Binary files a/code/ryzom/tools/server/ryzom_ams_docs/html/classWebUsers.png and /dev/null differ diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/classes.html b/code/ryzom/tools/server/ryzom_ams_docs/html/classes.html deleted file mode 100644 index 33b1ba697..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/classes.html +++ /dev/null @@ -1,141 +0,0 @@ - - - - - -Ryzom Account Management System: Data Structure Index - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    -
    -
    Data Structure Index
    -
    -
    -
    A | D | F | G | H | I | M | P | Q | S | T | U | W
    - - - - - - - - - - - - - - -
      A  
    -
      H  
    -
      P  
    -
      T  
    -
    Ticket_User   
      U  
    -
    Assigned   Helpers   Pagination   Ticket   
      D  
    -
      I  
    -
      Q  
    -
    Ticket_Category   Users   
    Ticket_Content   
      W  
    -
    DBLayer   In_Support_Group   Querycache   Ticket_Info   
      F  
    -
      M  
    -
      S  
    -
    Ticket_Log   WebUsers   
    Ticket_Queue   
    Forwarded   Mail_Handler   Support_Group   Ticket_Queue_Handler   
      G  
    -
    MyCrypt   Sync   Ticket_Reply   
    Gui_Elements   
    -
    A | D | F | G | H | I | M | P | Q | S | T | U | W
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/closed.png b/code/ryzom/tools/server/ryzom_ams_docs/html/closed.png deleted file mode 100644 index b7d4bd9fe..000000000 Binary files a/code/ryzom/tools/server/ryzom_ams_docs/html/closed.png and /dev/null differ diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/create__ticket_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/create__ticket_8php.html deleted file mode 100644 index ba969a5eb..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/create__ticket_8php.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/create_ticket.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/create_ticket.php File Reference
    -
    -
    - - - - -

    -Functions

     create_ticket ()
     This function is beign used to create a new ticket.
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    create_ticket ()
    -
    -
    - -

    This function is beign used to create a new ticket.

    -

    It will first check if the user who executed this function is the person of whom the setting is or if it's a mod/admin. If this is not the case the page will be redirected to an error page. next it will filter the POST data and it will try to create the new ticket. Afterwards a redirecion to the ticket will occur.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/createticket_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/createticket_8php.html deleted file mode 100644 index 8b9fd9b2f..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/createticket_8php.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/createticket.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/createticket.php File Reference
    -
    -
    - - - - -

    -Functions

     createticket ()
     This function is beign used to load info that's needed for the createticket page.
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    createticket ()
    -
    -
    - -

    This function is beign used to load info that's needed for the createticket page.

    -

    the $_GET['user_id'] identifies for which user you try to create a ticket. A normal user can only create a ticket for himself, a mod/admin however can also create tickets for other users. It will also load all categories and return these, they will be used by the template.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/dashboard_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/dashboard_8php.html deleted file mode 100644 index 593ae1be9..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/dashboard_8php.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/dashboard.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/dashboard.php File Reference
    -
    -
    - - - - -

    -Functions

     dashboard ()
     This function is beign used to load info that's needed for the dashboard page.
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    dashboard ()
    -
    -
    - -

    This function is beign used to load info that's needed for the dashboard page.

    -

    check if the person who wants to view this page is a mod/admin, if this is not the case, he will be redirected to an error page. next it will fetch a lot of information regarding to the status of the ticket system (eg return the total amount of tickets) and return this information so it can be used by the template.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/db.png b/code/ryzom/tools/server/ryzom_ams_docs/html/db.png deleted file mode 100644 index 63cb4c92b..000000000 Binary files a/code/ryzom/tools/server/ryzom_ams_docs/html/db.png and /dev/null differ diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/dblayer_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/dblayer_8php.html deleted file mode 100644 index 278d76934..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/dblayer_8php.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/dblayer.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/dblayer.php File Reference
    -
    -
    - - - - -

    -Data Structures

    class  DBLayer
     Handles the database connections. More...
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/deprecated.html b/code/ryzom/tools/server/ryzom_ams_docs/html/deprecated.html deleted file mode 100644 index 932150748..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/deprecated.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - -Ryzom Account Management System: Deprecated List - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - -
    -
    -
    -
    Deprecated List
    -
    -
    -
    -
    Global Support_Group ()
    -
    should be removed in the future, because getGroups does the same.
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/design.html b/code/ryzom/tools/server/ryzom_ams_docs/html/design.html deleted file mode 100644 index 5c3f1db25..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/design.html +++ /dev/null @@ -1,216 +0,0 @@ - - - - - -Ryzom Account Management System: Design Info - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - -
    -
    -
    -
    Design Info
    -
    -
    -

    -A brief introduction to the design of the AMS

    -

    We will take a look at the current db design, the way the classes are designed, the way the WWW version works and how it was reused in the drupal module.

    -

    -The database structure

    -

    My project started with the design of our database. I had to think about the advanced AMS features in advance. This is the reason why there are still a few unused DB tables in the design, the plan however is to use those as soon as possible by implementing the extra features.

    -

    The tables that are unused are the following:

    -
      -
    • -ticket_group
    • -
    • -in_group
    • -
    • -tag
    • -
    • -tagged
    • -
    -

    The idea for the ticket_groups was to provide the ability to bundle multiple tickets together in groups, this could be used for tickets that are alike or are in a weird way related. The idea for the tagging was to provide an extra system that allows to query tickets based on their tags (datamining). These features can be easily added in the future!

    -

    Let's take a look at the 'used' tables. The database structure is shown in the image below. For each table I made a matching class that handles the info of that table.

    -

    Quite central you can see the ticket table. As you can see, a ticket has a ticket_category field and author field, these hold the id of the related row in the ticket_category and ticket_user table. There's also the relation between a ticket and it's log entries, this is done by the ticket foreign key in the ticket_log table. The same counts for most other tables that are related to the ticket, they all got a ticket column used as foreign key.

    -

    Another thing that you might notice is the separation between ticket_reply and ticket_content, this is a 1-to-1 relation and this makes it easier to search between the replies if we only need their general information without having to take care of the content. The ticket_user is another quite important table that's being foreigned keyed by the others. It holds the permission of a user and the externID links to an ID given by the CMS(or our own www version)

    -

    Most things are pretty clear and straight forward, you can find the MYSQL Workbench file in the ryzom_ams/www/html/sql folder, which might give a better overview and can be used to update the DB easily when adding/modifying features in the future.

    -
    -db.png -
    -

    -Technologies used

    - -

    -Information regarding the structure

    -

    As you might have noticed, the ryzom_ams directory contains 3 directories: the ams_lib dir, the www dir and a drupal_module dir.

    -

    the ams_lib contains the following important dirs/files:

    -
      -
    • -autoload dir holds all classes of the lib
    • -
    • -cron dir holds the cron functions regarding email and the ams_querycache
    • -
    • -ingame_templates dir holds the templates that are being used while ingame
    • -
    • -smarty dir the smarty files (http://www.smarty.net/)
    • -
    • -translations dir multiple .ini files, one for each language that's being supported.
    • -
    • -libinclude.php php file that holds the __autoload function
    • -
    -

    the www contains the following important dirs/files:

    -
      -
    • -autoload dir holds the webusers.php file (which extends the Users.php file in the lib)
    • -
    • -func dir holds php files that contain a function that is being executed after filling in a form.
    • -
    • -inc dir holds php files that contain a function that is being executed before loading a specific file.
    • -
    • -templates dir holds the templates being used outgame.
    • -
    • -config.php php file that holds configuration settings
    • -
    -

    the drupal_module contains the following important dirs/files:

    -
      -
    • -autoload dir holds the webusers.php file that uses drupal functions (which extends the Users.php file in the lib)
    • -
    • -func dir holds php files that contain a function that is being executed after filling in a form.
    • -
    • -inc dir holds php files that contain a function that is being executed before loading a specific file.
    • -
    • -templates dir holds the templates being used outgame.
    • -
    • -config.php php file that holds configuration settings
    • -
    • -ryzommanage.info drupal file that holds information being used by drupal
    • -
    • -ryzommanage.install drupal file thats being used for installing the module
    • -
    • -ryzommanage.module drupal file that holds all functionality that's being needed to handle the AMS in drupal. (read more about it at the wiki page)
    • -
    -

    Important: the func dir and inc dir in the drupal_module are almost empty, that's because the inc/func directories of the WWW version can be copied to the drupal version, they are exactly the same. However, because the drupal_module isn't completely up to date, the settings page doesn't has the extra fields (like gender,country,..) therefore the ingame template file, inc files related to that are still in the module.

    -

    -How does the page loading work?

    -
    -info.jpg -
    -

    -How are the classes being used?

    -

    Like I mentioned above, each DB table has a class related that handles the data linked to that table and has functions working with that data.

    -

    The private attributes of each class are similar to the fields in the DB table. Every class also has the following functions:

    -
      -
    • -function __construct()
    • -
    • -function set($values)
    • -
    • -function create()
    • -
    • -function delete()
    • -
    • -function load( $id) or named similar
    • -
    • -some also have: update ()
    • -
    -

    These methods are being used by the public static functions of that class, which represent the 'real' AMS-functions, the ones being used by the inc/func files.

    -

    You can reference for example the Support_Group class's information, which shows this setup!

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/doxygen.css b/code/ryzom/tools/server/ryzom_ams_docs/html/doxygen.css deleted file mode 100644 index cee0d06b5..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/doxygen.css +++ /dev/null @@ -1,949 +0,0 @@ -/* The standard CSS for doxygen */ - -body, table, div, p, dl { - font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif; - font-size: 13px; - line-height: 1.3; -} - -/* @group Heading Levels */ - -h1 { - font-size: 150%; -} - -.title { - font-size: 150%; - font-weight: bold; - margin: 10px 2px; -} - -h2 { - font-size: 120%; -} - -h3 { - font-size: 100%; -} - -dt { - font-weight: bold; -} - -div.multicol { - -moz-column-gap: 1em; - -webkit-column-gap: 1em; - -moz-column-count: 3; - -webkit-column-count: 3; -} - -p.startli, p.startdd, p.starttd { - margin-top: 2px; -} - -p.endli { - margin-bottom: 0px; -} - -p.enddd { - margin-bottom: 4px; -} - -p.endtd { - margin-bottom: 2px; -} - -/* @end */ - -caption { - font-weight: bold; -} - -span.legend { - font-size: 70%; - text-align: center; -} - -h3.version { - font-size: 90%; - text-align: center; -} - -div.qindex, div.navtab{ - background-color: #EBEFF6; - border: 1px solid #A3B4D7; - text-align: center; -} - -div.qindex, div.navpath { - width: 100%; - line-height: 140%; -} - -div.navtab { - margin-right: 15px; -} - -/* @group Link Styling */ - -a { - color: #3D578C; - font-weight: normal; - text-decoration: none; -} - -.contents a:visited { - color: #4665A2; -} - -a:hover { - text-decoration: underline; -} - -a.qindex { - font-weight: bold; -} - -a.qindexHL { - font-weight: bold; - background-color: #9CAFD4; - color: #ffffff; - border: 1px double #869DCA; -} - -.contents a.qindexHL:visited { - color: #ffffff; -} - -a.el { - font-weight: bold; -} - -a.elRef { -} - -a.code, a.code:visited { - color: #4665A2; -} - -a.codeRef, a.codeRef:visited { - color: #4665A2; -} - -/* @end */ - -dl.el { - margin-left: -1cm; -} - -.fragment { - font-family: monospace, fixed; - font-size: 105%; -} - -pre.fragment { - border: 1px solid #C4CFE5; - background-color: #FBFCFD; - padding: 4px 6px; - margin: 4px 8px 4px 2px; - overflow: auto; - word-wrap: break-word; - font-size: 9pt; - line-height: 125%; -} - -div.ah { - background-color: black; - font-weight: bold; - color: #ffffff; - margin-bottom: 3px; - margin-top: 3px; - padding: 0.2em; - border: solid thin #333; - border-radius: 0.5em; - -webkit-border-radius: .5em; - -moz-border-radius: .5em; - box-shadow: 2px 2px 3px #999; - -webkit-box-shadow: 2px 2px 3px #999; - -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; - background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); - background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000); -} - -div.groupHeader { - margin-left: 16px; - margin-top: 12px; - font-weight: bold; -} - -div.groupText { - margin-left: 16px; - font-style: italic; -} - -body { - background-color: white; - color: black; - margin: 0; -} - -div.contents { - margin-top: 10px; - margin-left: 8px; - margin-right: 8px; -} - -td.indexkey { - background-color: #EBEFF6; - font-weight: bold; - border: 1px solid #C4CFE5; - margin: 2px 0px 2px 0; - padding: 2px 10px; - white-space: nowrap; - vertical-align: top; -} - -td.indexvalue { - background-color: #EBEFF6; - border: 1px solid #C4CFE5; - padding: 2px 10px; - margin: 2px 0px; -} - -tr.memlist { - background-color: #EEF1F7; -} - -p.formulaDsp { - text-align: center; -} - -img.formulaDsp { - -} - -img.formulaInl { - vertical-align: middle; -} - -div.center { - text-align: center; - margin-top: 0px; - margin-bottom: 0px; - padding: 0px; -} - -div.center img { - border: 0px; -} - -address.footer { - text-align: right; - padding-right: 12px; -} - -img.footer { - border: 0px; - vertical-align: middle; -} - -/* @group Code Colorization */ - -span.keyword { - color: #008000 -} - -span.keywordtype { - color: #604020 -} - -span.keywordflow { - color: #e08000 -} - -span.comment { - color: #800000 -} - -span.preprocessor { - color: #806020 -} - -span.stringliteral { - color: #002080 -} - -span.charliteral { - color: #008080 -} - -span.vhdldigit { - color: #ff00ff -} - -span.vhdlchar { - color: #000000 -} - -span.vhdlkeyword { - color: #700070 -} - -span.vhdllogic { - color: #ff0000 -} - -/* @end */ - -/* -.search { - color: #003399; - font-weight: bold; -} - -form.search { - margin-bottom: 0px; - margin-top: 0px; -} - -input.search { - font-size: 75%; - color: #000080; - font-weight: normal; - background-color: #e8eef2; -} -*/ - -td.tiny { - font-size: 75%; -} - -.dirtab { - padding: 4px; - border-collapse: collapse; - border: 1px solid #A3B4D7; -} - -th.dirtab { - background: #EBEFF6; - font-weight: bold; -} - -hr { - height: 0px; - border: none; - border-top: 1px solid #4A6AAA; -} - -hr.footer { - height: 1px; -} - -/* @group Member Descriptions */ - -table.memberdecls { - border-spacing: 0px; - padding: 0px; -} - -.mdescLeft, .mdescRight, -.memItemLeft, .memItemRight, -.memTemplItemLeft, .memTemplItemRight, .memTemplParams { - background-color: #F9FAFC; - border: none; - margin: 4px; - padding: 1px 0 0 8px; -} - -.mdescLeft, .mdescRight { - padding: 0px 8px 4px 8px; - color: #555; -} - -.memItemLeft, .memItemRight, .memTemplParams { - border-top: 1px solid #C4CFE5; -} - -.memItemLeft, .memTemplItemLeft { - white-space: nowrap; -} - -.memItemRight { - width: 100%; -} - -.memTemplParams { - color: #4665A2; - white-space: nowrap; -} - -/* @end */ - -/* @group Member Details */ - -/* Styles for detailed member documentation */ - -.memtemplate { - font-size: 80%; - color: #4665A2; - font-weight: normal; - margin-left: 9px; -} - -.memnav { - background-color: #EBEFF6; - border: 1px solid #A3B4D7; - text-align: center; - margin: 2px; - margin-right: 15px; - padding: 2px; -} - -.mempage { - width: 100%; -} - -.memitem { - padding: 0; - margin-bottom: 10px; - margin-right: 5px; -} - -.memname { - white-space: nowrap; - font-weight: bold; - margin-left: 6px; -} - -.memproto, dl.reflist dt { - border-top: 1px solid #A8B8D9; - border-left: 1px solid #A8B8D9; - border-right: 1px solid #A8B8D9; - padding: 6px 0px 6px 0px; - color: #253555; - font-weight: bold; - text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); - /* opera specific markup */ - box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); - border-top-right-radius: 8px; - border-top-left-radius: 8px; - /* firefox specific markup */ - -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; - -moz-border-radius-topright: 8px; - -moz-border-radius-topleft: 8px; - /* webkit specific markup */ - -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); - -webkit-border-top-right-radius: 8px; - -webkit-border-top-left-radius: 8px; - background-image:url('nav_f.png'); - background-repeat:repeat-x; - background-color: #E2E8F2; - -} - -.memdoc, dl.reflist dd { - border-bottom: 1px solid #A8B8D9; - border-left: 1px solid #A8B8D9; - border-right: 1px solid #A8B8D9; - padding: 2px 5px; - background-color: #FBFCFD; - border-top-width: 0; - /* opera specific markup */ - border-bottom-left-radius: 8px; - border-bottom-right-radius: 8px; - box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); - /* firefox specific markup */ - -moz-border-radius-bottomleft: 8px; - -moz-border-radius-bottomright: 8px; - -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; - background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F7F8FB 95%, #EEF1F7); - /* webkit specific markup */ - -webkit-border-bottom-left-radius: 8px; - -webkit-border-bottom-right-radius: 8px; - -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); - background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.6,#FFFFFF), color-stop(0.60,#FFFFFF), color-stop(0.95,#F7F8FB), to(#EEF1F7)); -} - -dl.reflist dt { - padding: 5px; -} - -dl.reflist dd { - margin: 0px 0px 10px 0px; - padding: 5px; -} - -.paramkey { - text-align: right; -} - -.paramtype { - white-space: nowrap; -} - -.paramname { - color: #602020; - white-space: nowrap; -} -.paramname em { - font-style: normal; -} - -.params, .retval, .exception, .tparams { - border-spacing: 6px 2px; -} - -.params .paramname, .retval .paramname { - font-weight: bold; - vertical-align: top; -} - -.params .paramtype { - font-style: italic; - vertical-align: top; -} - -.params .paramdir { - font-family: "courier new",courier,monospace; - vertical-align: top; -} - - - - -/* @end */ - -/* @group Directory (tree) */ - -/* for the tree view */ - -.ftvtree { - font-family: sans-serif; - margin: 0px; -} - -/* these are for tree view when used as main index */ - -.directory { - font-size: 9pt; - font-weight: bold; - margin: 5px; -} - -.directory h3 { - margin: 0px; - margin-top: 1em; - font-size: 11pt; -} - -/* -The following two styles can be used to replace the root node title -with an image of your choice. Simply uncomment the next two styles, -specify the name of your image and be sure to set 'height' to the -proper pixel height of your image. -*/ - -/* -.directory h3.swap { - height: 61px; - background-repeat: no-repeat; - background-image: url("yourimage.gif"); -} -.directory h3.swap span { - display: none; -} -*/ - -.directory > h3 { - margin-top: 0; -} - -.directory p { - margin: 0px; - white-space: nowrap; -} - -.directory div { - display: none; - margin: 0px; -} - -.directory img { - vertical-align: -30%; -} - -/* these are for tree view when not used as main index */ - -.directory-alt { - font-size: 100%; - font-weight: bold; -} - -.directory-alt h3 { - margin: 0px; - margin-top: 1em; - font-size: 11pt; -} - -.directory-alt > h3 { - margin-top: 0; -} - -.directory-alt p { - margin: 0px; - white-space: nowrap; -} - -.directory-alt div { - display: none; - margin: 0px; -} - -.directory-alt img { - vertical-align: -30%; -} - -/* @end */ - -div.dynheader { - margin-top: 8px; -} - -address { - font-style: normal; - color: #2A3D61; -} - -table.doxtable { - border-collapse:collapse; -} - -table.doxtable td, table.doxtable th { - border: 1px solid #2D4068; - padding: 3px 7px 2px; -} - -table.doxtable th { - background-color: #374F7F; - color: #FFFFFF; - font-size: 110%; - padding-bottom: 4px; - padding-top: 5px; - text-align:left; -} - -table.fieldtable { - width: 100%; - margin-bottom: 10px; - border: 1px solid #A8B8D9; - border-spacing: 0px; - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - border-radius: 4px; - -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; - -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); - box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); -} - -.fieldtable td, .fieldtable th { - padding: 3px 7px 2px; -} - -.fieldtable td.fieldtype, .fieldtable td.fieldname { - white-space: nowrap; - border-right: 1px solid #A8B8D9; - border-bottom: 1px solid #A8B8D9; - vertical-align: top; -} - -.fieldtable td.fielddoc { - border-bottom: 1px solid #A8B8D9; - width: 100%; -} - -.fieldtable tr:last-child td { - border-bottom: none; -} - -.fieldtable th { - background-image:url('nav_f.png'); - background-repeat:repeat-x; - background-color: #E2E8F2; - font-size: 90%; - color: #253555; - padding-bottom: 4px; - padding-top: 5px; - text-align:left; - -moz-border-radius-topleft: 4px; - -moz-border-radius-topright: 4px; - -webkit-border-top-left-radius: 4px; - -webkit-border-top-right-radius: 4px; - border-top-left-radius: 4px; - border-top-right-radius: 4px; - border-bottom: 1px solid #A8B8D9; -} - - -.tabsearch { - top: 0px; - left: 10px; - height: 36px; - background-image: url('tab_b.png'); - z-index: 101; - overflow: hidden; - font-size: 13px; -} - -.navpath ul -{ - font-size: 11px; - background-image:url('tab_b.png'); - background-repeat:repeat-x; - height:30px; - line-height:30px; - color:#8AA0CC; - border:solid 1px #C2CDE4; - overflow:hidden; - margin:0px; - padding:0px; -} - -.navpath li -{ - list-style-type:none; - float:left; - padding-left:10px; - padding-right:15px; - background-image:url('bc_s.png'); - background-repeat:no-repeat; - background-position:right; - color:#364D7C; -} - -.navpath li.navelem a -{ - height:32px; - display:block; - text-decoration: none; - outline: none; -} - -.navpath li.navelem a:hover -{ - color:#6884BD; -} - -.navpath li.footer -{ - list-style-type:none; - float:right; - padding-left:10px; - padding-right:15px; - background-image:none; - background-repeat:no-repeat; - background-position:right; - color:#364D7C; - font-size: 8pt; -} - - -div.summary -{ - float: right; - font-size: 8pt; - padding-right: 5px; - width: 50%; - text-align: right; -} - -div.summary a -{ - white-space: nowrap; -} - -div.ingroups -{ - margin-left: 5px; - font-size: 8pt; - padding-left: 5px; - width: 50%; - text-align: left; -} - -div.ingroups a -{ - white-space: nowrap; -} - -div.header -{ - background-image:url('nav_h.png'); - background-repeat:repeat-x; - background-color: #F9FAFC; - margin: 0px; - border-bottom: 1px solid #C4CFE5; -} - -div.headertitle -{ - padding: 5px 5px 5px 7px; -} - -dl -{ - padding: 0 0 0 10px; -} - -dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug -{ - border-left:4px solid; - padding: 0 0 0 6px; -} - -dl.note -{ - border-color: #D0C000; -} - -dl.warning, dl.attention -{ - border-color: #FF0000; -} - -dl.pre, dl.post, dl.invariant -{ - border-color: #00D000; -} - -dl.deprecated -{ - border-color: #505050; -} - -dl.todo -{ - border-color: #00C0E0; -} - -dl.test -{ - border-color: #3030E0; -} - -dl.bug -{ - border-color: #C08050; -} - -#projectlogo -{ - text-align: center; - vertical-align: bottom; - border-collapse: separate; -} - -#projectlogo img -{ - border: 0px none; -} - -#projectname -{ - font: 300% Tahoma, Arial,sans-serif; - margin: 0px; - padding: 2px 0px; -} - -#projectbrief -{ - font: 120% Tahoma, Arial,sans-serif; - margin: 0px; - padding: 0px; -} - -#projectnumber -{ - font: 50% Tahoma, Arial,sans-serif; - margin: 0px; - padding: 0px; -} - -#titlearea -{ - padding: 0px; - margin: 0px; - width: 100%; - border-bottom: 1px solid #5373B4; -} - -.image -{ - text-align: center; -} - -.dotgraph -{ - text-align: center; -} - -.mscgraph -{ - text-align: center; -} - -.caption -{ - font-weight: bold; -} - -div.zoom -{ - border: 1px solid #90A5CE; -} - -dl.citelist { - margin-bottom:50px; -} - -dl.citelist dt { - color:#334975; - float:left; - font-weight:bold; - margin-right:10px; - padding:5px; -} - -dl.citelist dd { - margin:2px 0; - padding:5px 0; -} - -@media print -{ - #top { display: none; } - #side-nav { display: none; } - #nav-path { display: none; } - body { overflow:visible; } - h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } - .summary { display: none; } - .memitem { page-break-inside: avoid; } - #doc-content - { - margin-left:0 !important; - height:auto !important; - width:auto !important; - overflow:inherit; - display:inline; - } - pre.fragment - { - overflow: visible; - text-wrap: unrestricted; - white-space: -moz-pre-wrap; /* Moz */ - white-space: -pre-wrap; /* Opera 4-6 */ - white-space: -o-pre-wrap; /* Opera 7 */ - white-space: pre-wrap; /* CSS3 */ - word-wrap: break-word; /* IE 5.5+ */ - } -} - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/doxygen.png b/code/ryzom/tools/server/ryzom_ams_docs/html/doxygen.png deleted file mode 100644 index 635ed52fc..000000000 Binary files a/code/ryzom/tools/server/ryzom_ams_docs/html/doxygen.png and /dev/null differ diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/drupal__module_2ryzommanage_2autoload_2webusers_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/drupal__module_2ryzommanage_2autoload_2webusers_8php.html deleted file mode 100644 index 6cd2773c7..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/drupal__module_2ryzommanage_2autoload_2webusers_8php.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/autoload/webusers.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/autoload/webusers.php File Reference
    -
    -
    - - - - -

    -Data Structures

    class  WebUsers
     handles CMS/WWW related functions regarding user management & registration. More...
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/drupal__module_2ryzommanage_2config_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/drupal__module_2ryzommanage_2config_8php.html deleted file mode 100644 index 612e717e2..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/drupal__module_2ryzommanage_2config_8php.html +++ /dev/null @@ -1,820 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/config.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/config.php File Reference
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    -Variables

     $cfg ['db']['web']['host'] = variable_get('ryzommanage_webserverurl', 'localhost')
     This file contains all variables needed by other php scripts.
     $cfg ['db']['web']['port'] = variable_get('ryzommanage_webmysqlport', '3306')
     $cfg ['db']['web']['name'] = variable_get('ryzommanage_webdbname', 'drupal')
     $cfg ['db']['web']['user'] = variable_get('ryzommanage_webusername', 'shard')
     $cfg ['db']['web']['pass'] = variable_get('ryzommanage_webpassword', '')
     $cfg ['db']['lib']['host'] = variable_get('ryzommanage_libserverurl', 'localhost')
     $cfg ['db']['lib']['port'] = variable_get('ryzommanage_libmysqlport', '3306')
     $cfg ['db']['lib']['name'] = variable_get('ryzommanage_libdbname', 'ryzom_ams_lib')
     $cfg ['db']['lib']['user'] = variable_get('ryzommanage_libusername', 'shard')
     $cfg ['db']['lib']['pass'] = variable_get('ryzommanage_libpassword', '')
     $cfg ['db']['shard']['host'] = variable_get('ryzommanage_shardserverurl', 'localhost')
     $cfg ['db']['shard']['port'] = variable_get('ryzommanage_shardmysqlport', '3306')
     $cfg ['db']['shard']['name'] = variable_get('ryzommanage_sharddbname', 'nel')
     $cfg ['db']['shard']['user'] = variable_get('ryzommanage_shardusername', 'shard')
     $cfg ['db']['shard']['pass'] = variable_get('ryzommanage_shardpassword', '')
     $cfg ['db']['ring']['host'] = variable_get('ryzommanage_ringserverurl', 'localhost')
     $cfg ['db']['ring']['port'] = variable_get('ryzommanage_ringmysqlport', '3306')
     $cfg ['db']['ring']['name'] = variable_get('ryzommanage_ringdbname', 'ring_open')
     $cfg ['db']['ring']['user'] = variable_get('ryzommanage_ringusername', 'shard')
     $cfg ['db']['ring']['pass'] = variable_get('ryzommanage_ringpassword', '')
     $cfg ['mail']['default_mailserver'] = '{imap.gmail.com:993/imap/ssl}INBOX'
     $cfg ['mail']['default_groupemail'] = 'amsryzom@gmail.com'
     $cfg ['mail']['default_groupname'] = 'Ryzomcore Support'
     $cfg ['mail']['default_username'] = 'amsryzom@gmail.com'
     $cfg ['mail']['default_password'] = 'lol123bol'
     $cfg ['mail']['host'] = "ryzomcore.com"
     $SUPPORT_GROUP_IMAP_CRYPTKEY = "azerty"
     $TICKET_MAILING_SUPPORT = false
     $MAIL_DIR = "/tmp/mail"
     $MAIL_LOG_PATH = "/tmp/mail/cron_mail.log"
     $cfg ['crypt']['key'] = 'Sup3rS3cr3tStuff'
     $cfg ['crypt']['enc_method'] = 'AES-256-CBC'
     $cfg ['crypt']['hash_method'] = "SHA512"
     $TOS_URL = variable_get('ryzommanage_TOS', 'www.mytosurlhere.com')
     $ALLOW_UNKNOWN = true
     $CREATE_RING = true
     $AMS_LIB = dirname( __FILE__ ) . '/ams_lib'
     $AMS_TRANS = $AMS_LIB . '/translations'
     $AMS_CACHEDIR = $AMS_LIB . '/cache'
     $SITEBASE = dirname( __FILE__ )
     $BASE_WEBPATH = 'http://localhost:40917/drupal'
     $IMAGELOC_WEBPATH = $BASE_WEBPATH. '/sites/all/modules/ryzommanage/ams_lib/img'
     $WEBPATH = $BASE_WEBPATH .'/ams'
     $INGAME_WEBPATH = $BASE_WEBPATH . '/ingame'
     $CONFIG_PATH = dirname( __FILE__ )
     $DEFAULT_LANGUAGE = 'en'
     $TICKET_LOGGING = true
     $TIME_FORMAT = "m-d-Y H:i:s"
     $INGAME_LAYOUT = "basic"
     $FORCE_INGAME = false
    -

    Variable Documentation

    - -
    -
    - - - - -
    $ALLOW_UNKNOWN = true
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $AMS_CACHEDIR = $AMS_LIB . '/cache'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $AMS_LIB = dirname( __FILE__ ) . '/ams_lib'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $AMS_TRANS = $AMS_LIB . '/translations'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $BASE_WEBPATH = 'http://localhost:40917/drupal'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['web']['host'] = variable_get('ryzommanage_webserverurl', 'localhost')
    -
    -
    - -

    This file contains all variables needed by other php scripts.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['web']['port'] = variable_get('ryzommanage_webmysqlport', '3306')
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['web']['name'] = variable_get('ryzommanage_webdbname', 'drupal')
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['web']['user'] = variable_get('ryzommanage_webusername', 'shard')
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['web']['pass'] = variable_get('ryzommanage_webpassword', '')
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['lib']['host'] = variable_get('ryzommanage_libserverurl', 'localhost')
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['lib']['port'] = variable_get('ryzommanage_libmysqlport', '3306')
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['lib']['name'] = variable_get('ryzommanage_libdbname', 'ryzom_ams_lib')
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['lib']['user'] = variable_get('ryzommanage_libusername', 'shard')
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['lib']['pass'] = variable_get('ryzommanage_libpassword', '')
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['shard']['host'] = variable_get('ryzommanage_shardserverurl', 'localhost')
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['shard']['port'] = variable_get('ryzommanage_shardmysqlport', '3306')
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['shard']['name'] = variable_get('ryzommanage_sharddbname', 'nel')
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['shard']['user'] = variable_get('ryzommanage_shardusername', 'shard')
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['shard']['pass'] = variable_get('ryzommanage_shardpassword', '')
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['ring']['host'] = variable_get('ryzommanage_ringserverurl', 'localhost')
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['ring']['port'] = variable_get('ryzommanage_ringmysqlport', '3306')
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['ring']['name'] = variable_get('ryzommanage_ringdbname', 'ring_open')
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['ring']['user'] = variable_get('ryzommanage_ringusername', 'shard')
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['ring']['pass'] = variable_get('ryzommanage_ringpassword', '')
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['mail']['default_mailserver'] = '{imap.gmail.com:993/imap/ssl}INBOX'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['mail']['default_groupemail'] = 'amsryzom@gmail.com'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['mail']['default_groupname'] = 'Ryzomcore Support'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['mail']['default_username'] = 'amsryzom@gmail.com'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['mail']['default_password'] = 'lol123bol'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['mail']['host'] = "ryzomcore.com"
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['crypt']['key'] = 'Sup3rS3cr3tStuff'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['crypt']['enc_method'] = 'AES-256-CBC'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['crypt']['hash_method'] = "SHA512"
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $CONFIG_PATH = dirname( __FILE__ )
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $CREATE_RING = true
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $DEFAULT_LANGUAGE = 'en'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $FORCE_INGAME = false
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $IMAGELOC_WEBPATH = $BASE_WEBPATH. '/sites/all/modules/ryzommanage/ams_lib/img'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $INGAME_LAYOUT = "basic"
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $INGAME_WEBPATH = $BASE_WEBPATH . '/ingame'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $MAIL_DIR = "/tmp/mail"
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $MAIL_LOG_PATH = "/tmp/mail/cron_mail.log"
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $SITEBASE = dirname( __FILE__ )
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $SUPPORT_GROUP_IMAP_CRYPTKEY = "azerty"
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $TICKET_LOGGING = true
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $TICKET_MAILING_SUPPORT = false
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $TIME_FORMAT = "m-d-Y H:i:s"
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $TOS_URL = variable_get('ryzommanage_TOS', 'www.mytosurlhere.com')
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $WEBPATH = $BASE_WEBPATH .'/ams'
    -
    -
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/drupal__module_2ryzommanage_2inc_2logout_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/drupal__module_2ryzommanage_2inc_2logout_8php.html deleted file mode 100644 index 5bfd6bf13..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/drupal__module_2ryzommanage_2inc_2logout_8php.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/logout.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/logout.php File Reference
    -
    -
    - - - -

    -Functions

     logout ()
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    logout ()
    -
    -
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/drupal__module_2ryzommanage_2inc_2settings_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/drupal__module_2ryzommanage_2inc_2settings_8php.html deleted file mode 100644 index 6c4aad8c5..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/drupal__module_2ryzommanage_2inc_2settings_8php.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/settings.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/settings.php File Reference
    -
    -
    - - - - -

    -Functions

     settings ()
     getCountryArray ()
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    getCountryArray ()
    -
    -
    - -
    -
    - -
    -
    - - - - - - - -
    settings ()
    -
    -
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/drupal__module_2ryzommanage_2inc_2show__user_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/drupal__module_2ryzommanage_2inc_2show__user_8php.html deleted file mode 100644 index 089184d66..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/drupal__module_2ryzommanage_2inc_2show__user_8php.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_user.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_user.php File Reference
    -
    -
    - - - -

    -Functions

     show_user ()
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    show_user ()
    -
    -
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/error_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/error_8php.html deleted file mode 100644 index 18103076e..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/error_8php.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/error.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/error.php File Reference
    -
    -
    - - - - -

    -Functions

     error ()
     This function is beign used to load info that's needed for the error page.
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    error ()
    -
    -
    - -

    This function is beign used to load info that's needed for the error page.

    -

    if a error_code session var is set it will unset it (else 404 is used), and it will return the error code so it can be used in the template.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/files.html b/code/ryzom/tools/server/ryzom_ams_docs/html/files.html deleted file mode 100644 index ac4afa38c..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/files.html +++ /dev/null @@ -1,175 +0,0 @@ - - - - - -Ryzom Account Management System: File List - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    -
    -
    File List
    -
    -
    -
    Here is a list of all files with brief descriptions:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/libinclude.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/assigned.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/dblayer.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/forwarded.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/gui_elements.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/helpers.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/in_support_group.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/mail_handler.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/mycrypt.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/pagination.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/querycache.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/support_group.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/sync.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_category.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_content.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_info.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_log.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_queue.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_queue_handler.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_reply.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_user.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/users.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/cron/mail_cron.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/cron/sync_cron.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/config.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/autoload/webusers.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/logout.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/settings.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/show_user.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/config.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/index.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/autoload/webusers.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/add_sgroup.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/add_user.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/add_user_to_sgroup.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/change_info.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/change_mail.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/change_password.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/change_receivemail.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/create_ticket.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/login.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/modify_email_of_sgroup.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/reply_on_ticket.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/change_permission.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/createticket.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/dashboard.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/error.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/login.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/logout.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/register.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/settings.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/sgroup_list.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_queue.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_reply.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_sgroup.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_ticket.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_ticket_info.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_ticket_log.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_user.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/syncing.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/userlist.php
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/sql/install.php
    info.php
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/forwarded_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/forwarded_8php.html deleted file mode 100644 index c63feb786..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/forwarded_8php.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/forwarded.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/forwarded.php File Reference
    -
    -
    - - - - -

    -Data Structures

    class  Forwarded
     Handles the forwarding of a ticket to a support_group. More...
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/func_2login_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/func_2login_8php.html deleted file mode 100644 index 42c3b2cfc..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/func_2login_8php.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/login.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/login.php File Reference
    -
    -
    - - - - -

    -Functions

     login ()
     This function is beign used to login a user.
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    login ()
    -
    -
    - -

    This function is beign used to login a user.

    -

    It will first check if the sent POST data returns a match with the DB, if it does, some session variables will be appointed to the user and he will be redirected to the index page again. If it didn't match, the template will be reloaded and a matching error message will be shown.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions.html deleted file mode 100644 index 15739f418..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions.html +++ /dev/null @@ -1,351 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -
    Here is a list of all struct and union fields with links to the structures/unions they belong to:
    - -

    - $ -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x5f.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x5f.html deleted file mode 100644 index d3ed223bd..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x5f.html +++ /dev/null @@ -1,159 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -
    Here is a list of all struct and union fields with links to the structures/unions they belong to:
    - -

    - _ -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x61.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x61.html deleted file mode 100644 index 71b75926d..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x61.html +++ /dev/null @@ -1,147 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -
    Here is a list of all struct and union fields with links to the structures/unions they belong to:
    - -

    - a -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x63.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x63.html deleted file mode 100644 index e54bfdd94..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x63.html +++ /dev/null @@ -1,254 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -
    Here is a list of all struct and union fields with links to the structures/unions they belong to:
    - -

    - c -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x64.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x64.html deleted file mode 100644 index ccb18fba0..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x64.html +++ /dev/null @@ -1,158 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -
    Here is a list of all struct and union fields with links to the structures/unions they belong to:
    - -

    - d -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x65.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x65.html deleted file mode 100644 index 5b0059440..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x65.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -
    Here is a list of all struct and union fields with links to the structures/unions they belong to:
    - -

    - e -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x66.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x66.html deleted file mode 100644 index a3f6b19ed..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x66.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -
    Here is a list of all struct and union fields with links to the structures/unions they belong to:
    - -

    - f -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x67.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x67.html deleted file mode 100644 index 6545e7d84..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x67.html +++ /dev/null @@ -1,461 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -
    Here is a list of all struct and union fields with links to the structures/unions they belong to:
    - -

    - g -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x68.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x68.html deleted file mode 100644 index 50b2e6fd2..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x68.html +++ /dev/null @@ -1,149 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -
    Here is a list of all struct and union fields with links to the structures/unions they belong to:
    - -

    - h -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x69.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x69.html deleted file mode 100644 index 10bdba341..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x69.html +++ /dev/null @@ -1,158 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -
    Here is a list of all struct and union fields with links to the structures/unions they belong to:
    - -

    - i -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x6c.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x6c.html deleted file mode 100644 index b3146013a..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x6c.html +++ /dev/null @@ -1,195 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -
    Here is a list of all struct and union fields with links to the structures/unions they belong to:
    - -

    - l -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x6d.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x6d.html deleted file mode 100644 index 69ab3be22..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x6d.html +++ /dev/null @@ -1,149 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -
    Here is a list of all struct and union fields with links to the structures/unions they belong to:
    - -

    - m -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x6e.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x6e.html deleted file mode 100644 index 78bc0f4c2..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x6e.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -
    Here is a list of all struct and union fields with links to the structures/unions they belong to:
    - -

    - n -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x6f.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x6f.html deleted file mode 100644 index f33e2ca29..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x6f.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -
    Here is a list of all struct and union fields with links to the structures/unions they belong to:
    - -

    - o -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x73.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x73.html deleted file mode 100644 index eb3fce49c..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x73.html +++ /dev/null @@ -1,344 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -
    Here is a list of all struct and union fields with links to the structures/unions they belong to:
    - -

    - s -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x74.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x74.html deleted file mode 100644 index 737b1e6f0..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x74.html +++ /dev/null @@ -1,149 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -
    Here is a list of all struct and union fields with links to the structures/unions they belong to:
    - -

    - t -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x75.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x75.html deleted file mode 100644 index 76a7f2de4..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x75.html +++ /dev/null @@ -1,163 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -
    Here is a list of all struct and union fields with links to the structures/unions they belong to:
    - -

    - u -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x76.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x76.html deleted file mode 100644 index 4eea14d7c..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_0x76.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -
    Here is a list of all struct and union fields with links to the structures/unions they belong to:
    - -

    - v -

      -
    • validEmail() -: Users -
    • -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func.html deleted file mode 100644 index 95c9509f0..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func.html +++ /dev/null @@ -1,158 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - Functions - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    - - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x61.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x61.html deleted file mode 100644 index eecdf704b..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x61.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - Functions - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -  - -

    - a -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x63.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x63.html deleted file mode 100644 index 4601329e1..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x63.html +++ /dev/null @@ -1,253 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - Functions - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -  - -

    - c -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x64.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x64.html deleted file mode 100644 index 1b13f2d4f..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x64.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - Functions - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -  - -

    - d -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x65.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x65.html deleted file mode 100644 index ccaad6ae0..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x65.html +++ /dev/null @@ -1,151 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - Functions - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -  - -

    - e -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x66.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x66.html deleted file mode 100644 index 5db22a523..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x66.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - Functions - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -  - -

    - f -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x67.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x67.html deleted file mode 100644 index 1737c3390..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x67.html +++ /dev/null @@ -1,460 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - Functions - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -  - -

    - g -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x68.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x68.html deleted file mode 100644 index 9904982e0..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x68.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - Functions - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -  - -

    - h -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x69.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x69.html deleted file mode 100644 index dc34cf2ba..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x69.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - Functions - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -  - -

    - i -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x6c.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x6c.html deleted file mode 100644 index 714735a9f..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x6c.html +++ /dev/null @@ -1,194 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - Functions - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -  - -

    - l -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x6d.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x6d.html deleted file mode 100644 index d9e0a3d0f..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x6d.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - Functions - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -  - -

    - m -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x6e.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x6e.html deleted file mode 100644 index e63e0096d..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x6e.html +++ /dev/null @@ -1,142 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - Functions - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -  - -

    - n -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x6f.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x6f.html deleted file mode 100644 index 052a9e878..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x6f.html +++ /dev/null @@ -1,142 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - Functions - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -  - -

    - o -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x73.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x73.html deleted file mode 100644 index e54b1d413..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x73.html +++ /dev/null @@ -1,343 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - Functions - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -  - -

    - s -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x74.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x74.html deleted file mode 100644 index 01dc511f8..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x74.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - Functions - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -  - -

    - t -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x75.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x75.html deleted file mode 100644 index 8461fb53c..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x75.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - Functions - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -  - -

    - u -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x76.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x76.html deleted file mode 100644 index df3e6c9d6..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_func_0x76.html +++ /dev/null @@ -1,142 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - Functions - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -  - -

    - v -

      -
    • validEmail() -: Users -
    • -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_vars.html b/code/ryzom/tools/server/ryzom_ams_docs/html/functions_vars.html deleted file mode 100644 index 3e1822ad5..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/functions_vars.html +++ /dev/null @@ -1,334 +0,0 @@ - - - - - -Ryzom Account Management System: Data Fields - Variables - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -  - -

    - $ -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/globals.html b/code/ryzom/tools/server/ryzom_ams_docs/html/globals.html deleted file mode 100644 index e47399641..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/globals.html +++ /dev/null @@ -1,345 +0,0 @@ - - - - - -Ryzom Account Management System: Globals - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -
    Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
    - -

    - $ -

    - - -

    - _ -

    - - -

    - a -

    - - -

    - c -

    - - -

    - d -

    - - -

    - e -

    - - -

    - g -

    - - -

    - l -

    - - -

    - m -

    - - -

    - r -

    - - -

    - s -

    - - -

    - u -

    - - -

    - w -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/globals_func.html b/code/ryzom/tools/server/ryzom_ams_docs/html/globals_func.html deleted file mode 100644 index 72b667802..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/globals_func.html +++ /dev/null @@ -1,269 +0,0 @@ - - - - - -Ryzom Account Management System: Globals - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -  - -

    - _ -

    - - -

    - a -

    - - -

    - c -

    - - -

    - d -

    - - -

    - e -

    - - -

    - g -

    - - -

    - l -

    - - -

    - m -

    - - -

    - r -

    - - -

    - s -

    - - -

    - u -

    - - -

    - w -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/globals_vars.html b/code/ryzom/tools/server/ryzom_ams_docs/html/globals_vars.html deleted file mode 100644 index 3bf8fc1ea..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/globals_vars.html +++ /dev/null @@ -1,192 +0,0 @@ - - - - - -Ryzom Account Management System: Globals - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - - - -
    -
    -  - -

    - $ -

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/gui__elements_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/gui__elements_8php.html deleted file mode 100644 index 871ced11e..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/gui__elements_8php.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/gui_elements.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/gui_elements.php File Reference
    -
    -
    - - - - -

    -Data Structures

    class  Gui_Elements
     Helper class for generating gui related elements. More...
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/helpers_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/helpers_8php.html deleted file mode 100644 index c69ac3d2d..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/helpers_8php.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/helpers.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/helpers.php File Reference
    -
    -
    - - - - -

    -Data Structures

    class  Helpers
     Helper class for more site specific functions. More...
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/hierarchy.html b/code/ryzom/tools/server/ryzom_ams_docs/html/hierarchy.html deleted file mode 100644 index d4224c3d0..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/hierarchy.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - - -Ryzom Account Management System: Class Hierarchy - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    -
    -
    Class Hierarchy
    -
    - - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/in__support__group_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/in__support__group_8php.html deleted file mode 100644 index 3df89eb62..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/in__support__group_8php.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/in_support_group.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/in_support_group.php File Reference
    -
    -
    - - - - -

    -Data Structures

    class  In_Support_Group
     Handles the linkage of users being in a support group. More...
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/inc_2login_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/inc_2login_8php.html deleted file mode 100644 index 428266ea6..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/inc_2login_8php.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/login.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/login.php File Reference
    -
    -
    - - - - -

    -Functions

     login ()
     This function is beign used to load info that's needed for the login page.
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    login ()
    -
    -
    - -

    This function is beign used to load info that's needed for the login page.

    -

    it will try to auto-login, this can only be used while ingame, the web browser sends additional cookie information that's also stored in the open_ring db. We will compare the values and if they match, the user will be automatically logged in!

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/index.html b/code/ryzom/tools/server/ryzom_ams_docs/html/index.html deleted file mode 100644 index 82188ca7c..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - -Ryzom Account Management System: The Ryzom AMS information pages. - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - -
    -
    -
    -
    The Ryzom AMS information pages.
    -
    -
    -

    -Introduction

    -

    Welcome to the documentation pages of the ryzom account management system library.
    - Doxygen is being used to generate these webpages. They should offer a good reference for anyone who is interested in working with the AMS library.

    -

    -More info?

    -

    if you want more information take a look at the ryzomcore wikipages and the design pages

    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/index_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/index_8php.html deleted file mode 100644 index 1a7125c9f..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/index_8php.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/index.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/index.php File Reference
    -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/info.jpg b/code/ryzom/tools/server/ryzom_ams_docs/html/info.jpg deleted file mode 100644 index 9c9f05092..000000000 Binary files a/code/ryzom/tools/server/ryzom_ams_docs/html/info.jpg and /dev/null differ diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/info_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/info_8php.html deleted file mode 100644 index 815bd4679..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/info_8php.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - -Ryzom Account Management System: info.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    -
    -
    info.php File Reference
    -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/install_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/install_8php.html deleted file mode 100644 index e05c51d76..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/install_8php.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/sql/install.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/sql/install.php File Reference
    -
    -
    - - - -

    -Variables

    global $cfg
    -

    Variable Documentation

    - -
    -
    - - - - -
    global $cfg
    -
    -
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/installdox b/code/ryzom/tools/server/ryzom_ams_docs/html/installdox deleted file mode 100755 index edf5bbfe3..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/installdox +++ /dev/null @@ -1,112 +0,0 @@ -#!/usr/bin/perl - -%subst = ( ); -$quiet = 0; - -while ( @ARGV ) { - $_ = shift @ARGV; - if ( s/^-// ) { - if ( /^l(.*)/ ) { - $v = ($1 eq "") ? shift @ARGV : $1; - ($v =~ /\/$/) || ($v .= "/"); - $_ = $v; - if ( /(.+)\@(.+)/ ) { - if ( exists $subst{$1} ) { - $subst{$1} = $2; - } else { - print STDERR "Unknown tag file $1 given with option -l\n"; - &usage(); - } - } else { - print STDERR "Argument $_ is invalid for option -l\n"; - &usage(); - } - } - elsif ( /^q/ ) { - $quiet = 1; - } - elsif ( /^\?|^h/ ) { - &usage(); - } - else { - print STDERR "Illegal option -$_\n"; - &usage(); - } - } - else { - push (@files, $_ ); - } -} - -foreach $sub (keys %subst) -{ - if ( $subst{$sub} eq "" ) - { - print STDERR "No substitute given for tag file `$sub'\n"; - &usage(); - } - elsif ( ! $quiet && $sub ne "_doc" && $sub ne "_cgi" ) - { - print "Substituting $subst{$sub} for each occurrence of tag file $sub\n"; - } -} - -if ( ! @files ) { - if (opendir(D,".")) { - foreach $file ( readdir(D) ) { - $match = ".html"; - next if ( $file =~ /^\.\.?$/ ); - ($file =~ /$match/) && (push @files, $file); - ($file =~ /\.svg/) && (push @files, $file); - ($file =~ "navtree.js") && (push @files, $file); - } - closedir(D); - } -} - -if ( ! @files ) { - print STDERR "Warning: No input files given and none found!\n"; -} - -foreach $f (@files) -{ - if ( ! $quiet ) { - print "Editing: $f...\n"; - } - $oldf = $f; - $f .= ".bak"; - unless (rename $oldf,$f) { - print STDERR "Error: cannot rename file $oldf\n"; - exit 1; - } - if (open(F,"<$f")) { - unless (open(G,">$oldf")) { - print STDERR "Error: opening file $oldf for writing\n"; - exit 1; - } - if ($oldf ne "tree.js") { - while () { - s/doxygen\=\"([^ \"\:\t\>\<]*)\:([^ \"\t\>\<]*)\" (xlink:href|href|src)=\"\2/doxygen\=\"$1:$subst{$1}\" \3=\"$subst{$1}/g; - print G "$_"; - } - } - else { - while () { - s/\"([^ \"\:\t\>\<]*)\:([^ \"\t\>\<]*)\", \"\2/\"$1:$subst{$1}\" ,\"$subst{$1}/g; - print G "$_"; - } - } - } - else { - print STDERR "Warning file $f does not exist\n"; - } - unlink $f; -} - -sub usage { - print STDERR "Usage: installdox [options] [html-file [html-file ...]]\n"; - print STDERR "Options:\n"; - print STDERR " -l tagfile\@linkName tag file + URL or directory \n"; - print STDERR " -q Quiet mode\n\n"; - exit 1; -} diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/jquery.js b/code/ryzom/tools/server/ryzom_ams_docs/html/jquery.js deleted file mode 100644 index 90b3a2bc3..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/jquery.js +++ /dev/null @@ -1,64 +0,0 @@ -/* - * jQuery JavaScript Library v1.3.2 - * http://jquery.com/ - * - * Copyright (c) 2009 John Resig - * Dual licensed under the MIT and GPL licenses. - * http://docs.jquery.com/License - * - * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) - * Revision: 6246 - */ -(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
    "]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
    ","
    "]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); -/* - * Sizzle CSS Selector Engine - v0.9.3 - * Copyright 2009, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return UT[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="

    ";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="
    ";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0) -{I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("
    ").append(M.responseText.replace(//g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function() -{G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='
    ';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); - -/* - * jQuery hashchange event - v1.3 - 7/21/2010 - * http://benalman.com/projects/jquery-hashchange-plugin/ - * - * Copyright (c) 2010 "Cowboy" Ben Alman - * Dual licensed under the MIT and GPL licenses. - * http://benalman.com/about/license/ - */ -(function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$(' -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/logo.png b/code/ryzom/tools/server/ryzom_ams_docs/html/logo.png deleted file mode 100644 index a072d6eaf..000000000 Binary files a/code/ryzom/tools/server/ryzom_ams_docs/html/logo.png and /dev/null differ diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/mail__cron_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/mail__cron_8php.html deleted file mode 100644 index d08742e2a..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/mail__cron_8php.html +++ /dev/null @@ -1,134 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/cron/mail_cron.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/cron/mail_cron.php File Reference
    -
    -
    - - - - -

    -Variables

     $mail_handler = new Mail_Handler()
     This small piece of php code calls the cron() function of the Mail_Handler.
    -

    Variable Documentation

    - -
    -
    - - - - -
    $mail_handler = new Mail_Handler()
    -
    -
    - -

    This small piece of php code calls the cron() function of the Mail_Handler.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/mail__handler_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/mail__handler_8php.html deleted file mode 100644 index 51c5ead9e..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/mail__handler_8php.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/mail_handler.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/mail_handler.php File Reference
    -
    -
    - - - - -

    -Data Structures

    class  Mail_Handler
     Handles the mailing functionality. More...
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/modify__email__of__sgroup_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/modify__email__of__sgroup_8php.html deleted file mode 100644 index 12cc4f71b..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/modify__email__of__sgroup_8php.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/modify_email_of_sgroup.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/modify_email_of_sgroup.php File Reference
    -
    -
    - - - - -

    -Functions

     modify_email_of_sgroup ()
     This function is beign used to modify the email related to a support group.
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    modify_email_of_sgroup ()
    -
    -
    - -

    This function is beign used to modify the email related to a support group.

    -

    It will first check if the user who executed this function is an admin. If this is not the case the page will be redirected to an error page. the new email will be validated and in case it's valid we'll add it to the db. Before adding it, we will encrypt the password by using the MyCrypt class. Afterwards the password gets updated and the page redirected again.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/mycrypt_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/mycrypt_8php.html deleted file mode 100644 index 6c440fabe..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/mycrypt_8php.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/mycrypt.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/mycrypt.php File Reference
    -
    -
    - - - - -

    -Data Structures

    class  MyCrypt
     Basic encryption/decryption class. More...
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/nav_f.png b/code/ryzom/tools/server/ryzom_ams_docs/html/nav_f.png deleted file mode 100644 index 1b07a1620..000000000 Binary files a/code/ryzom/tools/server/ryzom_ams_docs/html/nav_f.png and /dev/null differ diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/nav_h.png b/code/ryzom/tools/server/ryzom_ams_docs/html/nav_h.png deleted file mode 100644 index 01f5fa6a5..000000000 Binary files a/code/ryzom/tools/server/ryzom_ams_docs/html/nav_h.png and /dev/null differ diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/open.png b/code/ryzom/tools/server/ryzom_ams_docs/html/open.png deleted file mode 100644 index 7b35d2c2c..000000000 Binary files a/code/ryzom/tools/server/ryzom_ams_docs/html/open.png and /dev/null differ diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/pages.html b/code/ryzom/tools/server/ryzom_ams_docs/html/pages.html deleted file mode 100644 index 493c8b632..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/pages.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - -Ryzom Account Management System: Related Pages - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - -
    -
    -
    -
    Related Pages
    -
    -
    -
    Here is a list of all related documentation pages:
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/pagination_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/pagination_8php.html deleted file mode 100644 index 880e06a36..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/pagination_8php.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/pagination.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/pagination.php File Reference
    -
    -
    - - - - -

    -Data Structures

    class  Pagination
     Handles returning arrays based on a given pagenumber. More...
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/querycache_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/querycache_8php.html deleted file mode 100644 index 0a9593825..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/querycache_8php.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/querycache.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/querycache.php File Reference
    -
    -
    - - - - -

    -Data Structures

    class  Querycache
     class for storing changes when shard is offline. More...
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/register_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/register_8php.html deleted file mode 100644 index d326886af..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/register_8php.html +++ /dev/null @@ -1,137 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/register.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/register.php File Reference
    -
    -
    - - - - -

    -Functions

     register ()
     This function is beign used to load info that's needed for the register page.
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    register ()
    -
    -
    - -

    This function is beign used to load info that's needed for the register page.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/reply__on__ticket_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/reply__on__ticket_8php.html deleted file mode 100644 index aed5249ba..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/reply__on__ticket_8php.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/reply_on_ticket.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/func/reply_on_ticket.php File Reference
    -
    -
    - - - - -

    -Functions

     reply_on_ticket ()
     This function is beign used to reply on a ticket.
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    reply_on_ticket ()
    -
    -
    - -

    This function is beign used to reply on a ticket.

    -

    It will first check if the user who executed this function is a mod/admin or the topic creator himself. If this is not the case the page will be redirected to an error page. in case the isset($_POST['hidden'] is set and the user is a mod, the message will be hidden for the topic starter. The reply will be created. If $_POST['ChangeStatus']) & $_POST['ChangePriority'] is set it will try to update the status and priority. Afterwards the page is being redirecte to the ticket again.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_24.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_24.html deleted file mode 100644 index 476d13496..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_24.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_24.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_24.js deleted file mode 100644 index 8e8a493e9..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_24.js +++ /dev/null @@ -1,91 +0,0 @@ -var searchData= -[ - ['_24allow_5funknown',['$ALLOW_UNKNOWN',['../drupal__module_2ryzommanage_2config_8php.html#a384355265e4331097d55252f901eddff',1,'$ALLOW_UNKNOWN(): config.php'],['../www_2config_8php.html#a384355265e4331097d55252f901eddff',1,'$ALLOW_UNKNOWN(): config.php']]], - ['_24amountofrows',['$amountOfRows',['../classPagination.html#a6b5c716eec440d8dc5b9754c53c545ec',1,'Pagination']]], - ['_24ams_5fcachedir',['$AMS_CACHEDIR',['../drupal__module_2ryzommanage_2config_8php.html#a92879a931e7a7d0ae6919e70a1529747',1,'$AMS_CACHEDIR(): config.php'],['../www_2config_8php.html#a92879a931e7a7d0ae6919e70a1529747',1,'$AMS_CACHEDIR(): config.php']]], - ['_24ams_5flib',['$AMS_LIB',['../drupal__module_2ryzommanage_2config_8php.html#a75086b9c8602bf3417773bae7ef0cdc8',1,'$AMS_LIB(): config.php'],['../www_2config_8php.html#a75086b9c8602bf3417773bae7ef0cdc8',1,'$AMS_LIB(): config.php']]], - ['_24ams_5ftrans',['$AMS_TRANS',['../drupal__module_2ryzommanage_2config_8php.html#acc96a0076127356b4f9f00f4bdfa9b65',1,'$AMS_TRANS(): config.php'],['../www_2config_8php.html#acc96a0076127356b4f9f00f4bdfa9b65',1,'$AMS_TRANS(): config.php']]], - ['_24author',['$author',['../classTicket.html#ac35b828f7d4064a7c9f849c255468ee3',1,'Ticket\$author()'],['../classTicket__Log.html#ac35b828f7d4064a7c9f849c255468ee3',1,'Ticket_Log\$author()'],['../classTicket__Reply.html#ac35b828f7d4064a7c9f849c255468ee3',1,'Ticket_Reply\$author()']]], - ['_24base_5fwebpath',['$BASE_WEBPATH',['../drupal__module_2ryzommanage_2config_8php.html#a2e954ee09fb5f52b9d05caf9dfc3d5ad',1,'$BASE_WEBPATH(): config.php'],['../www_2config_8php.html#a2e954ee09fb5f52b9d05caf9dfc3d5ad',1,'$BASE_WEBPATH(): config.php']]], - ['_24cfg',['$cfg',['../drupal__module_2ryzommanage_2config_8php.html#a32f90fc68bcb40de0bae38354fd0a5fe',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a6b776651fa7defe140c03ed3bd86aa96',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a68f172c430a17022c9f74ae1acd24a00',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a1805c74760836f682459a12a17d50589',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a94213b6df61b8a6b62abbe7c956493a4',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a4b555022064138fee1d7edea873c5e9e',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a1b49c1f0de42e603443bea2c93276c13',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a7c5f3fd8aea7ae8363c6cdc9addd9b62',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a7b5bbf5b3c541b46d06deaffeeb76424',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a1dca44c652dd54f6879957cf8d4a039c',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a56e7e53dac48b99f62d41d387c8624e6',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#adc2648938b5135f1f2aab1d92d33418e',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a1324eeda6b288c0a26d7071db555090c',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a63d97fffb2ff86525bb6cacb74113a73',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a7147f422b8150cd3f3c8a68325208607',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a53f42728714b4e86b885c12f7846cd06',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#aa68c438d0b6b38d756d8724bac554f1b',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#ae4ae1095a3543d5607464a88e6330a07',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a7cf20f61de759c233272150b12e866d8',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#aed7bed5da2b934c742cb60d23c06f752',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a1606e0620d5a628b865e0df5c217ce7e',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a41e3a386ec52e0f05bdcad04acecf619',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#ac2c263a1e16ebd69dbf247e8d82c9f63',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a9996bf49f150442cf9d564725d0dea24',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#aa7eb09eb019c344553a61b54606cb650',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a79b711e7ee81b7435a8dba7cb132b34a',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a8578ffa00c2dbcf5d34a97bcff79058b',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a50d80d35dbd37739f844a93a36fce557',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a55031a1c3c2b9d87e37558811b311ff8',1,'$cfg(): config.php'],['../www_2config_8php.html#a32f90fc68bcb40de0bae38354fd0a5fe',1,'$cfg(): config.php'],['../www_2config_8php.html#a6b776651fa7defe140c03ed3bd86aa96',1,'$cfg(): config.php'],['../www_2config_8php.html#a68f172c430a17022c9f74ae1acd24a00',1,'$cfg(): config.php'],['../www_2config_8php.html#a1805c74760836f682459a12a17d50589',1,'$cfg(): config.php'],['../www_2config_8php.html#a94213b6df61b8a6b62abbe7c956493a4',1,'$cfg(): config.php'],['../www_2config_8php.html#a4b555022064138fee1d7edea873c5e9e',1,'$cfg(): config.php'],['../www_2config_8php.html#a1b49c1f0de42e603443bea2c93276c13',1,'$cfg(): config.php'],['../www_2config_8php.html#a7c5f3fd8aea7ae8363c6cdc9addd9b62',1,'$cfg(): config.php'],['../www_2config_8php.html#a7b5bbf5b3c541b46d06deaffeeb76424',1,'$cfg(): config.php'],['../www_2config_8php.html#a1dca44c652dd54f6879957cf8d4a039c',1,'$cfg(): config.php'],['../www_2config_8php.html#a56e7e53dac48b99f62d41d387c8624e6',1,'$cfg(): config.php'],['../www_2config_8php.html#adc2648938b5135f1f2aab1d92d33418e',1,'$cfg(): config.php'],['../www_2config_8php.html#a1324eeda6b288c0a26d7071db555090c',1,'$cfg(): config.php'],['../www_2config_8php.html#a63d97fffb2ff86525bb6cacb74113a73',1,'$cfg(): config.php'],['../www_2config_8php.html#a7147f422b8150cd3f3c8a68325208607',1,'$cfg(): config.php'],['../www_2config_8php.html#a53f42728714b4e86b885c12f7846cd06',1,'$cfg(): config.php'],['../www_2config_8php.html#aa68c438d0b6b38d756d8724bac554f1b',1,'$cfg(): config.php'],['../www_2config_8php.html#ae4ae1095a3543d5607464a88e6330a07',1,'$cfg(): config.php'],['../www_2config_8php.html#a7cf20f61de759c233272150b12e866d8',1,'$cfg(): config.php'],['../www_2config_8php.html#aed7bed5da2b934c742cb60d23c06f752',1,'$cfg(): config.php'],['../www_2config_8php.html#a1606e0620d5a628b865e0df5c217ce7e',1,'$cfg(): config.php'],['../www_2config_8php.html#a41e3a386ec52e0f05bdcad04acecf619',1,'$cfg(): config.php'],['../www_2config_8php.html#ac2c263a1e16ebd69dbf247e8d82c9f63',1,'$cfg(): config.php'],['../www_2config_8php.html#a9996bf49f150442cf9d564725d0dea24',1,'$cfg(): config.php'],['../www_2config_8php.html#aa7eb09eb019c344553a61b54606cb650',1,'$cfg(): config.php'],['../www_2config_8php.html#a79b711e7ee81b7435a8dba7cb132b34a',1,'$cfg(): config.php'],['../www_2config_8php.html#a8578ffa00c2dbcf5d34a97bcff79058b',1,'$cfg(): config.php'],['../www_2config_8php.html#a50d80d35dbd37739f844a93a36fce557',1,'$cfg(): config.php'],['../www_2config_8php.html#a55031a1c3c2b9d87e37558811b311ff8',1,'$cfg(): config.php'],['../install_8php.html#a449cc4bf6cfd310810993b3ef5251aa5',1,'$cfg(): install.php']]], - ['_24client_5fversion',['$client_version',['../classTicket__Info.html#ac43fbb88dcd0696ad49d5f805f369a61',1,'Ticket_Info']]], - ['_24config',['$config',['../classMyCrypt.html#a49c7011be9c979d9174c52a8b83e5d8e',1,'MyCrypt']]], - ['_24config_5fpath',['$CONFIG_PATH',['../drupal__module_2ryzommanage_2config_8php.html#ae15921e2ebd5885ecf37d31a2cf6ab7a',1,'$CONFIG_PATH(): config.php'],['../www_2config_8php.html#ae15921e2ebd5885ecf37d31a2cf6ab7a',1,'$CONFIG_PATH(): config.php']]], - ['_24connect_5fstate',['$connect_state',['../classTicket__Info.html#a33f4c9badf7f0c5c6728bba0ffacd66e',1,'Ticket_Info']]], - ['_24content',['$content',['../classTicket__Content.html#a57b284fe00866494b33afa80ba729bed',1,'Ticket_Content\$content()'],['../classTicket__Reply.html#a57b284fe00866494b33afa80ba729bed',1,'Ticket_Reply\$content()']]], - ['_24country',['$country',['../classWebUsers.html#a1437a5f6eb157f0eb267a26e0ad4f1ba',1,'WebUsers']]], - ['_24cpu_5fid',['$cpu_id',['../classTicket__Info.html#abea88d0d04f0d548115a0e85eef42e42',1,'Ticket_Info']]], - ['_24cpu_5fmask',['$cpu_mask',['../classTicket__Info.html#a9b0c63551b567630d1aa82f33c328ab0',1,'Ticket_Info']]], - ['_24create_5fring',['$CREATE_RING',['../drupal__module_2ryzommanage_2config_8php.html#a16031d9d4e5065229bc3b00dfd4202fa',1,'$CREATE_RING(): config.php'],['../www_2config_8php.html#a16031d9d4e5065229bc3b00dfd4202fa',1,'$CREATE_RING(): config.php']]], - ['_24current',['$current',['../classPagination.html#a2c4c58e377f6c66ca38c8ea97666fc5e',1,'Pagination']]], - ['_24db',['$db',['../classMail__Handler.html#a1fa3127fc82f96b1436d871ef02be319',1,'Mail_Handler\$db()'],['../classQuerycache.html#a1fa3127fc82f96b1436d871ef02be319',1,'Querycache\$db()']]], - ['_24default_5flanguage',['$DEFAULT_LANGUAGE',['../drupal__module_2ryzommanage_2config_8php.html#a7b56c2ed5a82ceb21fc73cef77beb150',1,'$DEFAULT_LANGUAGE(): config.php'],['../www_2config_8php.html#a7b56c2ed5a82ceb21fc73cef77beb150',1,'$DEFAULT_LANGUAGE(): config.php']]], - ['_24element_5farray',['$element_array',['../classPagination.html#a8fa0f6a15481ba69e7be913eaa15594c',1,'Pagination']]], - ['_24email',['$email',['../classWebUsers.html#ad634f418b20382e2802f80532d76d3cd',1,'WebUsers']]], - ['_24externid',['$externId',['../classTicket__User.html#af51400fe5820e964cb38fcc60b3afd84',1,'Ticket_User']]], - ['_24firstname',['$firstname',['../classWebUsers.html#a55793c72c535d153ffd3f0e43377898b',1,'WebUsers']]], - ['_24force_5fingame',['$FORCE_INGAME',['../drupal__module_2ryzommanage_2config_8php.html#aabd939b29ed900f5fc489f1a957fc6ce',1,'$FORCE_INGAME(): config.php'],['../www_2config_8php.html#aabd939b29ed900f5fc489f1a957fc6ce',1,'$FORCE_INGAME(): config.php']]], - ['_24gender',['$gender',['../classWebUsers.html#a0f1d7cfb9dc6f494b9014885205fc47e',1,'WebUsers']]], - ['_24group',['$group',['../classForwarded.html#ad530a85733b0ec1dc321859fd8faa0dc',1,'Forwarded\$group()'],['../classIn__Support__Group.html#ad530a85733b0ec1dc321859fd8faa0dc',1,'In_Support_Group\$group()']]], - ['_24groupemail',['$groupEmail',['../classSupport__Group.html#ab7ad611af238b28f1f65a32cb152acd1',1,'Support_Group']]], - ['_24hidden',['$hidden',['../classTicket__Reply.html#a4a374564d2858d8ae869a8fb890aad56',1,'Ticket_Reply']]], - ['_24ht',['$ht',['../classTicket__Info.html#a969583a6605ed731abf5849a5202db1e',1,'Ticket_Info']]], - ['_24imageloc_5fwebpath',['$IMAGELOC_WEBPATH',['../drupal__module_2ryzommanage_2config_8php.html#a16820074dcd11e4881ca6461377db000',1,'$IMAGELOC_WEBPATH(): config.php'],['../www_2config_8php.html#a16820074dcd11e4881ca6461377db000',1,'$IMAGELOC_WEBPATH(): config.php']]], - ['_24imap_5fmailserver',['$iMAP_MailServer',['../classSupport__Group.html#ad9f2ef2089fe446a9ac49a19a450d636',1,'Support_Group']]], - ['_24imap_5fpassword',['$iMAP_Password',['../classSupport__Group.html#a4166a2fc4b594ee425d7f40870e16455',1,'Support_Group']]], - ['_24imap_5fusername',['$iMAP_Username',['../classSupport__Group.html#a2b549eb4d5773efd741a2990817af0ea',1,'Support_Group']]], - ['_24ingame_5flayout',['$INGAME_LAYOUT',['../drupal__module_2ryzommanage_2config_8php.html#a0deedf69fea8c97030373e15a68c4cc5',1,'$INGAME_LAYOUT(): config.php'],['../www_2config_8php.html#a0deedf69fea8c97030373e15a68c4cc5',1,'$INGAME_LAYOUT(): config.php']]], - ['_24ingame_5fwebpath',['$INGAME_WEBPATH',['../drupal__module_2ryzommanage_2config_8php.html#ae9f6aa9c61501bca7b8851925c636d87',1,'$INGAME_WEBPATH(): config.php'],['../www_2config_8php.html#ae9f6aa9c61501bca7b8851925c636d87',1,'$INGAME_WEBPATH(): config.php']]], - ['_24language',['$language',['../classWebUsers.html#a83170d318260a5a2e2a79dccdd371b10',1,'WebUsers']]], - ['_24last',['$last',['../classPagination.html#acf48db609a946d13953d8060363fd1d3',1,'Pagination']]], - ['_24lastname',['$lastname',['../classWebUsers.html#a1d2ddb6354180329b59e8b90ed94dc7f',1,'WebUsers']]], - ['_24local_5faddress',['$local_address',['../classTicket__Info.html#a467dca5673d4c9f737dac972ab05720c',1,'Ticket_Info']]], - ['_24login',['$login',['../classWebUsers.html#afc31993e855f9631572adfedcfe6f34b',1,'WebUsers']]], - ['_24mail_5fdir',['$MAIL_DIR',['../drupal__module_2ryzommanage_2config_8php.html#a9f8fc644554910de5434f78a5f23044e',1,'$MAIL_DIR(): config.php'],['../www_2config_8php.html#a9f8fc644554910de5434f78a5f23044e',1,'$MAIL_DIR(): config.php']]], - ['_24mail_5fhandler',['$mail_handler',['../mail__cron_8php.html#a160a75d95407d877e9c2542e3ddd8c43',1,'mail_cron.php']]], - ['_24mail_5flog_5fpath',['$MAIL_LOG_PATH',['../drupal__module_2ryzommanage_2config_8php.html#afe6e9ed40480c14cb7a119fb84cb557a',1,'$MAIL_LOG_PATH(): config.php'],['../www_2config_8php.html#afe6e9ed40480c14cb7a119fb84cb557a',1,'$MAIL_LOG_PATH(): config.php']]], - ['_24memory',['$memory',['../classTicket__Info.html#a5e20a9a3e12271b3b8d685805590c9e0',1,'Ticket_Info']]], - ['_24name',['$name',['../classSupport__Group.html#ab2fc40d43824ea3e1ce5d86dee0d763b',1,'Support_Group\$name()'],['../classTicket__Category.html#ab2fc40d43824ea3e1ce5d86dee0d763b',1,'Ticket_Category\$name()']]], - ['_24nel3d',['$nel3d',['../classTicket__Info.html#a9b616e5fbafadc93aa4bdf3ccbf31498',1,'Ticket_Info']]], - ['_24os',['$os',['../classTicket__Info.html#a292791d5d8e3ded85cb2e8ec80dea0d9',1,'Ticket_Info']]], - ['_24pagination',['$pagination',['../classTicket__Queue__Handler.html#a388a4a950e936f746d3b9c1b56450ce7',1,'Ticket_Queue_Handler']]], - ['_24params',['$params',['../classTicket__Queue.html#afe68e6fbe7acfbffc0af0c84a1996466',1,'Ticket_Queue']]], - ['_24patch_5fversion',['$patch_version',['../classTicket__Info.html#a55fc0854f90ed36ab9774ba7bd2af53f',1,'Ticket_Info']]], - ['_24pdo',['$PDO',['../classDBLayer.html#acdb2149c05a21fe144fb05ec524a51f3',1,'DBLayer']]], - ['_24permission',['$permission',['../classTicket__User.html#aad04b6f3304fe6a13d5be37f7cd28938',1,'Ticket_User']]], - ['_24priority',['$priority',['../classTicket.html#a2677e505e860db863720ac4e216fd3f2',1,'Ticket']]], - ['_24processor',['$processor',['../classTicket__Info.html#a11fe8ad69d64b596f8b712b0b7e7e1e3',1,'Ticket_Info']]], - ['_24query',['$query',['../classQuerycache.html#af59a5f7cd609e592c41dc3643efd3c98',1,'Querycache\$query()'],['../classTicket__Log.html#af59a5f7cd609e592c41dc3643efd3c98',1,'Ticket_Log\$query()'],['../classTicket__Queue.html#af59a5f7cd609e592c41dc3643efd3c98',1,'Ticket_Queue\$query()']]], - ['_24queue',['$queue',['../classTicket.html#a4a0b48f6ae2fcb248a4f0288c7c344a6',1,'Ticket\$queue()'],['../classTicket__Queue__Handler.html#a4a0b48f6ae2fcb248a4f0288c7c344a6',1,'Ticket_Queue_Handler\$queue()']]], - ['_24receivemail',['$receiveMail',['../classWebUsers.html#a3c74ba660e348124f36d978b137f691d',1,'WebUsers']]], - ['_24server_5ftick',['$server_tick',['../classTicket__Info.html#aeac33ccad750e9ee81a22414db1224ab',1,'Ticket_Info']]], - ['_24sgroupid',['$sGroupId',['../classSupport__Group.html#a23265908fce0f131e03ba1ede7f42647',1,'Support_Group']]], - ['_24shardid',['$shardid',['../classTicket__Info.html#ac73283a0a8308fb7594543e4a049942c',1,'Ticket_Info']]], - ['_24sid',['$SID',['../classQuerycache.html#a69c31f890638fa4930097cf55ae27995',1,'Querycache']]], - ['_24sitebase',['$SITEBASE',['../drupal__module_2ryzommanage_2config_8php.html#a9eb41824afc2b8150c27648859f07357',1,'$SITEBASE(): config.php'],['../www_2config_8php.html#a9eb41824afc2b8150c27648859f07357',1,'$SITEBASE(): config.php']]], - ['_24status',['$status',['../classTicket.html#a58391ea75f2d29d5d708d7050b641c33',1,'Ticket']]], - ['_24support_5fgroup_5fimap_5fcryptkey',['$SUPPORT_GROUP_IMAP_CRYPTKEY',['../drupal__module_2ryzommanage_2config_8php.html#a3ed2ac4433023af3e95f8912f00125ea',1,'$SUPPORT_GROUP_IMAP_CRYPTKEY(): config.php'],['../www_2config_8php.html#a3ed2ac4433023af3e95f8912f00125ea',1,'$SUPPORT_GROUP_IMAP_CRYPTKEY(): config.php']]], - ['_24tag',['$tag',['../classSupport__Group.html#a81d5015d41ed8ec66e9db8cdc5db9555',1,'Support_Group']]], - ['_24tcategoryid',['$tCategoryId',['../classTicket__Category.html#a0111df4559c9f524272d94df0b7f9d6b',1,'Ticket_Category']]], - ['_24tcontentid',['$tContentId',['../classTicket__Content.html#a2249787a24edd706ae7a54609a601d6f',1,'Ticket_Content']]], - ['_24ticket',['$ticket',['../classAssigned.html#abf7832c7c53a3be2ca8a8fc305006bb0',1,'Assigned\$ticket()'],['../classForwarded.html#abf7832c7c53a3be2ca8a8fc305006bb0',1,'Forwarded\$ticket()'],['../classTicket__Info.html#abf7832c7c53a3be2ca8a8fc305006bb0',1,'Ticket_Info\$ticket()'],['../classTicket__Log.html#abf7832c7c53a3be2ca8a8fc305006bb0',1,'Ticket_Log\$ticket()'],['../classTicket__Reply.html#abf7832c7c53a3be2ca8a8fc305006bb0',1,'Ticket_Reply\$ticket()']]], - ['_24ticket_5fcategory',['$ticket_category',['../classTicket.html#a86e470072892575063c478122fb65184',1,'Ticket']]], - ['_24ticket_5flogging',['$TICKET_LOGGING',['../drupal__module_2ryzommanage_2config_8php.html#aa59491d29009336d89423cccd3adc5de',1,'$TICKET_LOGGING(): config.php'],['../www_2config_8php.html#aa59491d29009336d89423cccd3adc5de',1,'$TICKET_LOGGING(): config.php']]], - ['_24ticket_5fmailing_5fsupport',['$TICKET_MAILING_SUPPORT',['../drupal__module_2ryzommanage_2config_8php.html#a23c3d413e56a57bc04d69627a4ed2b14',1,'$TICKET_MAILING_SUPPORT(): config.php'],['../www_2config_8php.html#a23c3d413e56a57bc04d69627a4ed2b14',1,'$TICKET_MAILING_SUPPORT(): config.php']]], - ['_24tid',['$tId',['../classTicket.html#a3eda2fecc2433b6b6b3b957110e937ca',1,'Ticket']]], - ['_24time_5fformat',['$TIME_FORMAT',['../drupal__module_2ryzommanage_2config_8php.html#a613b2c043c06772e7119587b26eb9989',1,'$TIME_FORMAT(): config.php'],['../www_2config_8php.html#a613b2c043c06772e7119587b26eb9989',1,'$TIME_FORMAT(): config.php']]], - ['_24timestamp',['$timestamp',['../classTicket.html#a2b69de9676dd97c675cd4d9bcceb684c',1,'Ticket\$timestamp()'],['../classTicket__Log.html#a2b69de9676dd97c675cd4d9bcceb684c',1,'Ticket_Log\$timestamp()'],['../classTicket__Reply.html#a2b69de9676dd97c675cd4d9bcceb684c',1,'Ticket_Reply\$timestamp()']]], - ['_24tinfoid',['$tInfoId',['../classTicket__Info.html#a4c2ae13b7827d13b9629e3fc57335f8f',1,'Ticket_Info']]], - ['_24title',['$title',['../classTicket.html#ada57e7bb7c152edad18fe2f166188691',1,'Ticket']]], - ['_24tlogid',['$tLogId',['../classTicket__Log.html#a734657bd8aac85b5a33e03646c17eb65',1,'Ticket_Log']]], - ['_24tos_5furl',['$TOS_URL',['../drupal__module_2ryzommanage_2config_8php.html#aef688ce4c627fa2fbd8037fd2cceef78',1,'$TOS_URL(): config.php'],['../www_2config_8php.html#aef688ce4c627fa2fbd8037fd2cceef78',1,'$TOS_URL(): config.php']]], - ['_24treplyid',['$tReplyId',['../classTicket__Reply.html#a29f22c2783e510d4764a99a648a0cc36',1,'Ticket_Reply']]], - ['_24tuserid',['$tUserId',['../classTicket__User.html#a2f1828693b198682ae3e926e63a4c110',1,'Ticket_User']]], - ['_24type',['$type',['../classQuerycache.html#a9a4a6fba2208984cabb3afacadf33919',1,'Querycache']]], - ['_24uid',['$uId',['../classWebUsers.html#a8f11c60ae8f70a5059b97bc0ea9d0de5',1,'WebUsers']]], - ['_24user',['$user',['../classAssigned.html#a598ca4e71b15a1313ec95f0df1027ca5',1,'Assigned\$user()'],['../classIn__Support__Group.html#a598ca4e71b15a1313ec95f0df1027ca5',1,'In_Support_Group\$user()']]], - ['_24user_5fid',['$user_id',['../classTicket__Info.html#af0fcd925f00973e32f7214859dfb3c6b',1,'Ticket_Info']]], - ['_24user_5fposition',['$user_position',['../classTicket__Info.html#afc9fcd144a71e56898632daf43854aa7',1,'Ticket_Info']]], - ['_24view_5fposition',['$view_position',['../classTicket__Info.html#ae325cbe2a7e27757b90b12d595c4dfe9',1,'Ticket_Info']]], - ['_24webpath',['$WEBPATH',['../drupal__module_2ryzommanage_2config_8php.html#a562d30b98806af1e001a3ff855e8890a',1,'$WEBPATH(): config.php'],['../www_2config_8php.html#a562d30b98806af1e001a3ff855e8890a',1,'$WEBPATH(): config.php']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_5f.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_5f.html deleted file mode 100644 index 1f27755ab..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_5f.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_5f.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_5f.js deleted file mode 100644 index 844048eb7..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_5f.js +++ /dev/null @@ -1,5 +0,0 @@ -var searchData= -[ - ['_5f_5fautoload',['__autoload',['../libinclude_8php.html#a2ecfde85f554ea0b3fef0993aef304a9',1,'libinclude.php']]], - ['_5f_5fconstruct',['__construct',['../classAssigned.html#a095c5d389db211932136b53f25f39685',1,'Assigned\__construct()'],['../classDBLayer.html#a800f8efee13692788b13ee57c5960092',1,'DBLayer\__construct()'],['../classForwarded.html#a095c5d389db211932136b53f25f39685',1,'Forwarded\__construct()'],['../classIn__Support__Group.html#a095c5d389db211932136b53f25f39685',1,'In_Support_Group\__construct()'],['../classMyCrypt.html#af200cbfd49bfea2fecf5629ab2361033',1,'MyCrypt\__construct()'],['../classPagination.html#a2a1aecb8f526796b3d62e8278edc07c3',1,'Pagination\__construct()'],['../classQuerycache.html#a095c5d389db211932136b53f25f39685',1,'Querycache\__construct()'],['../classSupport__Group.html#a095c5d389db211932136b53f25f39685',1,'Support_Group\__construct()'],['../classTicket.html#a095c5d389db211932136b53f25f39685',1,'Ticket\__construct()'],['../classTicket__Category.html#a095c5d389db211932136b53f25f39685',1,'Ticket_Category\__construct()'],['../classTicket__Content.html#a095c5d389db211932136b53f25f39685',1,'Ticket_Content\__construct()'],['../classTicket__Info.html#a095c5d389db211932136b53f25f39685',1,'Ticket_Info\__construct()'],['../classTicket__Log.html#a095c5d389db211932136b53f25f39685',1,'Ticket_Log\__construct()'],['../classTicket__Queue__Handler.html#a095c5d389db211932136b53f25f39685',1,'Ticket_Queue_Handler\__construct()'],['../classTicket__Reply.html#a095c5d389db211932136b53f25f39685',1,'Ticket_Reply\__construct()'],['../classTicket__User.html#a095c5d389db211932136b53f25f39685',1,'Ticket_User\__construct()'],['../classWebUsers.html#a4e63742e531873e01e1e97dd7530539b',1,'WebUsers\__construct($UId=0)'],['../classWebUsers.html#a4e63742e531873e01e1e97dd7530539b',1,'WebUsers\__construct($UId=0)']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_61.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_61.html deleted file mode 100644 index a3164d553..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_61.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_61.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_61.js deleted file mode 100644 index a077db22c..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_61.js +++ /dev/null @@ -1,13 +0,0 @@ -var searchData= -[ - ['add_5fsgroup',['add_sgroup',['../add__sgroup_8php.html#a45490c056bdd114ef28893fc29286d2b',1,'add_sgroup.php']]], - ['add_5fsgroup_2ephp',['add_sgroup.php',['../add__sgroup_8php.html',1,'']]], - ['add_5fuser',['add_user',['../add__user_8php.html#a69e8de25de7560db0292bb474882a489',1,'add_user.php']]], - ['add_5fuser_2ephp',['add_user.php',['../add__user_8php.html',1,'']]], - ['add_5fuser_5fto_5fsgroup',['add_user_to_sgroup',['../add__user__to__sgroup_8php.html#a6ad0c5a1bfd563e11a107bf0023b6150',1,'add_user_to_sgroup.php']]], - ['add_5fuser_5fto_5fsgroup_2ephp',['add_user_to_sgroup.php',['../add__user__to__sgroup_8php.html',1,'']]], - ['addusertosupportgroup',['addUserToSupportGroup',['../classSupport__Group.html#a4616317379ffef08dbaeea2a9dbba02c',1,'Support_Group']]], - ['assigned',['Assigned',['../classAssigned.html',1,'']]], - ['assigned_2ephp',['assigned.php',['../assigned_8php.html',1,'']]], - ['assignticket',['assignTicket',['../classAssigned.html#a51c3d5b6f78de455619581fd3e591f17',1,'Assigned\assignTicket()'],['../classTicket.html#a51c3d5b6f78de455619581fd3e591f17',1,'Ticket\assignTicket()']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_63.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_63.html deleted file mode 100644 index 56b5ad1e9..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_63.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_63.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_63.js deleted file mode 100644 index c54f2f697..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_63.js +++ /dev/null @@ -1,51 +0,0 @@ -var searchData= -[ - ['change_5finfo',['change_info',['../change__info_8php.html#a1bbc74a7da07012d55b0b45726534265',1,'change_info.php']]], - ['change_5finfo_2ephp',['change_info.php',['../change__info_8php.html',1,'']]], - ['change_5fmail',['change_mail',['../change__mail_8php.html#a03d0bca67a96c8744bd74623e128ab83',1,'change_mail.php']]], - ['change_5fmail_2ephp',['change_mail.php',['../change__mail_8php.html',1,'']]], - ['change_5fpassword',['change_password',['../change__password_8php.html#a888360ab43db15eba1d5cc3623d4100f',1,'change_password.php']]], - ['change_5fpassword_2ephp',['change_password.php',['../change__password_8php.html',1,'']]], - ['change_5fpermission',['change_permission',['../classTicket__User.html#a78d4d6de74b1ee26cb9192f36e022416',1,'Ticket_User\change_permission()'],['../change__permission_8php.html#a9ad639fafd67bdc579cf3170cd0d26e7',1,'change_permission(): change_permission.php']]], - ['change_5fpermission_2ephp',['change_permission.php',['../change__permission_8php.html',1,'']]], - ['change_5freceivemail',['change_receivemail',['../change__receivemail_8php.html#a22ae748f60d7b4200dce30c94a52c421',1,'change_receivemail.php']]], - ['change_5freceivemail_2ephp',['change_receivemail.php',['../change__receivemail_8php.html',1,'']]], - ['check_5fchange_5fpassword',['check_change_password',['../classUsers.html#a9c78408d50465957eeb8068810315a8e',1,'Users']]], - ['check_5fif_5fgame_5fclient',['check_if_game_client',['../classHelpers.html#a4e3e5309a66456d81a1effdabcc9cd79',1,'Helpers']]], - ['check_5flogin_5fingame',['check_login_ingame',['../classHelpers.html#abd01528a1145831a4fc98eae7ffaca36',1,'Helpers']]], - ['check_5fmethods',['check_methods',['../classMyCrypt.html#ad72fefc790b0bb1ac6edc252427b0970',1,'MyCrypt']]], - ['check_5fregister',['check_Register',['../classUsers.html#a740de04dc3aa7cf3bed959540ffab8f8',1,'Users']]], - ['checkemail',['checkEmail',['../classUsers.html#a76646237ab053cdde386c06aa5437d8a',1,'Users']]], - ['checkemailexists',['checkEmailExists',['../classUsers.html#a37275e677004927b6b1a30e16c5b5b38',1,'Users\checkEmailExists()'],['../classWebUsers.html#a37275e677004927b6b1a30e16c5b5b38',1,'WebUsers\checkEmailExists($email)'],['../classWebUsers.html#a37275e677004927b6b1a30e16c5b5b38',1,'WebUsers\checkEmailExists($email)']]], - ['checkloginmatch',['checkLoginMatch',['../classUsers.html#af0b98012abb190cf4617999f008de27e',1,'Users\checkLoginMatch()'],['../classWebUsers.html#a11894eb69bb2f172baf5186e8f92246d',1,'WebUsers\checkLoginMatch($username, $password)'],['../classWebUsers.html#a11894eb69bb2f172baf5186e8f92246d',1,'WebUsers\checkLoginMatch($username, $password)']]], - ['checkpassword',['checkPassword',['../classUsers.html#a4cb5e34b56fb6de0ec318fb59e90838f',1,'Users']]], - ['checkuser',['checkUser',['../classUsers.html#adfffce17947a9f72d68838db250c9ab8',1,'Users']]], - ['checkusernameexists',['checkUserNameExists',['../classUsers.html#ac3a8cb9a038f6aef0bd98be091274122',1,'Users\checkUserNameExists()'],['../classWebUsers.html#ac3a8cb9a038f6aef0bd98be091274122',1,'WebUsers\checkUserNameExists($username)'],['../classWebUsers.html#ac3a8cb9a038f6aef0bd98be091274122',1,'WebUsers\checkUserNameExists($username)']]], - ['config_2ephp',['config.php',['../www_2config_8php.html',1,'']]], - ['config_2ephp',['config.php',['../drupal__module_2ryzommanage_2config_8php.html',1,'']]], - ['confirmpassword',['confirmPassword',['../classUsers.html#a2f5349025bed3874f08d80652cab2fe0',1,'Users']]], - ['constr_5fexternid',['constr_ExternId',['../classTicket__User.html#a4e5c577ed0a9da4b1c56397912f02ba0',1,'Ticket_User']]], - ['constr_5fsgroupid',['constr_SGroupId',['../classSupport__Group.html#a873beb80bd0b5d572704cdb6d2ec34eb',1,'Support_Group']]], - ['constr_5ftcategoryid',['constr_TCategoryId',['../classTicket__Category.html#a332d2dd59b46fc933a3c9a1b2967803a',1,'Ticket_Category']]], - ['constr_5ftcontentid',['constr_TContentId',['../classTicket__Content.html#aa28ad9a063c1914ff75d19afd25c707f',1,'Ticket_Content']]], - ['constr_5ftlogid',['constr_TLogId',['../classTicket__Log.html#a001ec13f64bb026b1c8a3b3bd02ee22b',1,'Ticket_Log']]], - ['constr_5ftreplyid',['constr_TReplyId',['../classTicket__Reply.html#a4b4493d28e8518a87667d285c49e5e24',1,'Ticket_Reply']]], - ['constr_5ftuserid',['constr_TUserId',['../classTicket__User.html#a10939bce9b667f26d3827993b4e3df1d',1,'Ticket_User']]], - ['create',['create',['../classAssigned.html#a435e7d7525d4bcd0ed5e34a469f3adf6',1,'Assigned\create()'],['../classForwarded.html#a435e7d7525d4bcd0ed5e34a469f3adf6',1,'Forwarded\create()'],['../classIn__Support__Group.html#a435e7d7525d4bcd0ed5e34a469f3adf6',1,'In_Support_Group\create()'],['../classSupport__Group.html#a435e7d7525d4bcd0ed5e34a469f3adf6',1,'Support_Group\create()'],['../classTicket.html#a435e7d7525d4bcd0ed5e34a469f3adf6',1,'Ticket\create()'],['../classTicket__Content.html#a435e7d7525d4bcd0ed5e34a469f3adf6',1,'Ticket_Content\create()'],['../classTicket__Info.html#a435e7d7525d4bcd0ed5e34a469f3adf6',1,'Ticket_Info\create()'],['../classTicket__Reply.html#a435e7d7525d4bcd0ed5e34a469f3adf6',1,'Ticket_Reply\create()']]], - ['create_5ffolders',['create_folders',['../classHelpers.html#add8ef9ce82106c505f6f04c2a8e3b2b4',1,'Helpers']]], - ['create_5fticket',['create_Ticket',['../classTicket.html#a81b3285033bc3c9e89adfa8da34d61de',1,'Ticket\create_Ticket()'],['../create__ticket_8php.html#a65bcbfccf737c72927d15c06783cd9f4',1,'create_ticket(): create_ticket.php']]], - ['create_5fticket_2ephp',['create_ticket.php',['../create__ticket_8php.html',1,'']]], - ['create_5fticket_5finfo',['create_Ticket_Info',['../classTicket__Info.html#aaa4e26c92338b70e874135af9c02bba9',1,'Ticket_Info']]], - ['createlogentry',['createLogEntry',['../classTicket__Log.html#a345a2da9c23780c7e6aef7134baa1749',1,'Ticket_Log']]], - ['createpermissions',['createPermissions',['../classUsers.html#aeac9f32fd53c97c92e5c774e154399df',1,'Users']]], - ['createqueue',['createQueue',['../classTicket__Queue.html#af077496b6071af47c19a873bf025c1f3',1,'Ticket_Queue\createQueue()'],['../classTicket__Queue__Handler.html#af077496b6071af47c19a873bf025c1f3',1,'Ticket_Queue_Handler\createQueue()']]], - ['createreply',['createReply',['../classTicket.html#af6568341f5052034440f79c0e74707a3',1,'Ticket\createReply()'],['../classTicket__Reply.html#aa6fa056fff4ddafc3eabf3ed72143e1b',1,'Ticket_Reply\createReply()']]], - ['createsupportgroup',['createSupportGroup',['../classSupport__Group.html#a31ee7c68c0ffb77438bb9ff095962568',1,'Support_Group']]], - ['createticket',['createticket',['../createticket_8php.html#aa8253d883a3ba14c6449a13ed2bb9c8f',1,'createticket.php']]], - ['createticket_2ephp',['createticket.php',['../createticket_8php.html',1,'']]], - ['createticketcategory',['createTicketCategory',['../classTicket__Category.html#a506fc7f32de9547e91a5dbb68c391907',1,'Ticket_Category']]], - ['createticketuser',['createTicketUser',['../classTicket__User.html#a37c416f7d3723874f3ac49c7f9f5a21c',1,'Ticket_User']]], - ['createuser',['createUser',['../classUsers.html#ac93aebf1960fb12975b120a2c394a8af',1,'Users']]], - ['createwebuser',['createWebuser',['../classWebUsers.html#a0cb7168a6b8358106512804ff28cea17',1,'WebUsers\createWebuser($name, $pass, $mail)'],['../classWebUsers.html#a0cb7168a6b8358106512804ff28cea17',1,'WebUsers\createWebuser($name, $pass, $mail)']]], - ['cron',['cron',['../classMail__Handler.html#a1b65890aa4eb8c0c6129c3e787a53405',1,'Mail_Handler']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_64.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_64.html deleted file mode 100644 index b53ff083e..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_64.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_64.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_64.js deleted file mode 100644 index a897983e6..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_64.js +++ /dev/null @@ -1,12 +0,0 @@ -var searchData= -[ - ['dashboard',['dashboard',['../dashboard_8php.html#a54d0c80ff20df9df6439bb87608c375a',1,'dashboard.php']]], - ['dashboard_2ephp',['dashboard.php',['../dashboard_8php.html',1,'']]], - ['dblayer',['DBLayer',['../classDBLayer.html',1,'']]], - ['dblayer_2ephp',['dblayer.php',['../dblayer_8php.html',1,'']]], - ['decode_5futf8',['decode_utf8',['../classMail__Handler.html#a6fc5947eaa45b0724f8720b374481275',1,'Mail_Handler']]], - ['decrypt',['decrypt',['../classMyCrypt.html#aed69cdc691e1155856c905ee1c08d9b7',1,'MyCrypt']]], - ['delete',['delete',['../classAssigned.html#a13bdffdd926f26b825ea57066334ff01',1,'Assigned\delete()'],['../classForwarded.html#a13bdffdd926f26b825ea57066334ff01',1,'Forwarded\delete()'],['../classIn__Support__Group.html#a13bdffdd926f26b825ea57066334ff01',1,'In_Support_Group\delete()'],['../classSupport__Group.html#a13bdffdd926f26b825ea57066334ff01',1,'Support_Group\delete()']]], - ['deletesupportgroup',['deleteSupportGroup',['../classSupport__Group.html#ab4a7d3ba86333a058027c7d58b9137f1',1,'Support_Group']]], - ['deleteuserofsupportgroup',['deleteUserOfSupportGroup',['../classSupport__Group.html#ad2d1a010903640e39545085b93b9a4f1',1,'Support_Group']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_65.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_65.html deleted file mode 100644 index 66cc83487..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_65.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_65.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_65.js deleted file mode 100644 index 537250038..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_65.js +++ /dev/null @@ -1,9 +0,0 @@ -var searchData= -[ - ['encrypt',['encrypt',['../classMyCrypt.html#a07bcc8ef1d23370470ecb5ae8fc07dfa',1,'MyCrypt']]], - ['error',['error',['../error_8php.html#a43b8d30b879d4f09ceb059b02af2bc02',1,'error.php']]], - ['error_2ephp',['error.php',['../error_8php.html',1,'']]], - ['execute',['execute',['../classDBLayer.html#a9a0e3ecb193fecd94263eda79c54bcc4',1,'DBLayer']]], - ['executereturnid',['executeReturnId',['../classDBLayer.html#a9a8137347ec2d551de3ec54cfb3bdb1a',1,'DBLayer']]], - ['executewithoutparams',['executeWithoutParams',['../classDBLayer.html#a33552c5325c469ac1aa0d049d2312468',1,'DBLayer']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_66.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_66.html deleted file mode 100644 index 3d1f8b35e..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_66.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_66.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_66.js deleted file mode 100644 index 9959a693e..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_66.js +++ /dev/null @@ -1,6 +0,0 @@ -var searchData= -[ - ['forwarded',['Forwarded',['../classForwarded.html',1,'']]], - ['forwarded_2ephp',['forwarded.php',['../forwarded_8php.html',1,'']]], - ['forwardticket',['forwardTicket',['../classForwarded.html#aa6f01e425a0f845ce55c2d90aeb11db0',1,'Forwarded\forwardTicket()'],['../classTicket.html#a3fdc6def6a0feaf4c2458811b8c75050',1,'Ticket\forwardTicket()']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_67.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_67.html deleted file mode 100644 index 41a459ae7..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_67.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_67.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_67.js deleted file mode 100644 index d55d29ded..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_67.js +++ /dev/null @@ -1,108 +0,0 @@ -var searchData= -[ - ['generatesalt',['generateSALT',['../classUsers.html#afb7603ac9556c1069fbf1c0062251203',1,'Users']]], - ['get_5femail_5fby_5fuser_5fid',['get_email_by_user_id',['../classTicket__User.html#a7274bc305ccce731091c68d1607cb6e9',1,'Ticket_User']]], - ['get_5fid_5ffrom_5femail',['get_id_from_email',['../classTicket__User.html#a7feeb7a909bf6733de21300d0ea0e1bd',1,'Ticket_User']]], - ['get_5fid_5ffrom_5fusername',['get_id_from_username',['../classTicket__User.html#a0bcfa281f41b948eb42dd18992724543',1,'Ticket_User']]], - ['get_5fmime_5ftype',['get_mime_type',['../classMail__Handler.html#a719c5051ef00fbb0d7c7ce2c78e3b4e1',1,'Mail_Handler']]], - ['get_5fpart',['get_part',['../classMail__Handler.html#ab3a5e8f69692826c6dae96f873859642',1,'Mail_Handler']]], - ['get_5fticket_5fid_5ffrom_5fsubject',['get_ticket_id_from_subject',['../classMail__Handler.html#a8604569b1e012ea3b1fe466018f75ce2',1,'Mail_Handler']]], - ['get_5fusername_5ffrom_5fid',['get_username_from_id',['../classTicket__User.html#a266ff1e60e08dcd8c7e70f22f5a33e93',1,'Ticket_User']]], - ['getaction',['getAction',['../classTicket__Log.html#a189a4abe5faf11f4320d5d3f1d3d1715',1,'Ticket_Log']]], - ['getactiontextarray',['getActionTextArray',['../classTicket__Log.html#ac760071c0ce36337c16d8146fcb3bade',1,'Ticket_Log']]], - ['getallcategories',['getAllCategories',['../classTicket__Category.html#a1e4b8ecfd737337e35976126b521499f',1,'Ticket_Category']]], - ['getalllogs',['getAllLogs',['../classTicket__Log.html#aeaf1c995cc807afe241f6e7bdc684921',1,'Ticket_Log']]], - ['getallsupportgroups',['getAllSupportGroups',['../classSupport__Group.html#ad3fc18cb894f789d19a768ea63d9b673',1,'Support_Group']]], - ['getallusersofsupportgroup',['getAllUsersOfSupportGroup',['../classSupport__Group.html#a7f1662394a31e2a05e9863def178df12',1,'Support_Group']]], - ['getallusersquery',['getAllUsersQuery',['../classWebUsers.html#a2f8e928ed02e462b40e909965250fb7d',1,'WebUsers\getAllUsersQuery()'],['../classWebUsers.html#a2f8e928ed02e462b40e909965250fb7d',1,'WebUsers\getAllUsersQuery()']]], - ['getamountofrows',['getAmountOfRows',['../classPagination.html#ae43f78382809e3cd2aaa3c455cb0b2b4',1,'Pagination']]], - ['getargument',['getArgument',['../classTicket__Log.html#a88ec9370bcbdb60301f89e401c9e64e1',1,'Ticket_Log']]], - ['getassigned',['getAssigned',['../classTicket.html#a8234a4e23319778d234b3957f8b5d06c',1,'Ticket']]], - ['getauthor',['getAuthor',['../classTicket.html#a5286e30390ae3e1b274940286493dd24',1,'Ticket\getAuthor()'],['../classTicket__Log.html#a5286e30390ae3e1b274940286493dd24',1,'Ticket_Log\getAuthor()'],['../classTicket__Reply.html#a5286e30390ae3e1b274940286493dd24',1,'Ticket_Reply\getAuthor()']]], - ['getcategoryname',['getCategoryName',['../classTicket.html#a689e9d131777e7f1219ee0d65b088cb3',1,'Ticket']]], - ['getclient_5fversion',['getClient_Version',['../classTicket__Info.html#a5a9884f9f9b63d4a6ed8c6112704277d',1,'Ticket_Info']]], - ['getconnect_5fstate',['getConnect_State',['../classTicket__Info.html#a51a5247b7c82f60479ccdcfa33041c27',1,'Ticket_Info']]], - ['getcontent',['getContent',['../classTicket__Content.html#a58e43f09a06ce4e29b192c4e17ce7915',1,'Ticket_Content\getContent()'],['../classTicket__Reply.html#a58e43f09a06ce4e29b192c4e17ce7915',1,'Ticket_Reply\getContent()']]], - ['getcountryarray',['getCountryArray',['../drupal__module_2ryzommanage_2inc_2settings_8php.html#a9342547984d3c9a5ece41572951f8edf',1,'getCountryArray(): settings.php'],['../www_2html_2inc_2settings_8php.html#a9342547984d3c9a5ece41572951f8edf',1,'getCountryArray(): settings.php']]], - ['getcpu_5fmask',['getCPU_Mask',['../classTicket__Info.html#ae85e54574e6e0b17cd33b8c49255d228',1,'Ticket_Info']]], - ['getcpuid',['getCPUId',['../classTicket__Info.html#aba21caccb000efb673b8b66ca70a36c7',1,'Ticket_Info']]], - ['getcurrent',['getCurrent',['../classPagination.html#ad926899d7cac34a3f1a90e552d8eb27d',1,'Pagination']]], - ['getdb',['getDb',['../classQuerycache.html#aceb656ee5135578ab3a9947252caa772',1,'Querycache']]], - ['getelements',['getElements',['../classPagination.html#a97a3a3e912139aa222a7ca13fdb27d33',1,'Pagination']]], - ['getemail',['getEmail',['../classWebUsers.html#a02a01849f28e2535e888ae4ec87b20f2',1,'WebUsers\getEmail()'],['../classWebUsers.html#a02a01849f28e2535e888ae4ec87b20f2',1,'WebUsers\getEmail()']]], - ['getentireticket',['getEntireTicket',['../classTicket.html#a00572e06f01ae1cadb5949f1b45e8f04',1,'Ticket']]], - ['getexternid',['getExternId',['../classTicket__User.html#ace230deb485c9f115f7fea4ce92442a3',1,'Ticket_User']]], - ['getforwardedgroupid',['getForwardedGroupId',['../classTicket.html#aedbfa4efd5aaa96ac713817d12156f7e',1,'Ticket']]], - ['getforwardedgroupname',['getForwardedGroupName',['../classTicket.html#a34e17d1cc053a7b86ce2b58a3a347c7e',1,'Ticket']]], - ['getgroup',['getGroup',['../classForwarded.html#a4f44e7bc9de772c21b4304d11e87bf16',1,'Forwarded\getGroup()'],['../classIn__Support__Group.html#a4f44e7bc9de772c21b4304d11e87bf16',1,'In_Support_Group\getGroup()'],['../classSupport__Group.html#af6697615443145a2981e62aa741c3afa',1,'Support_Group\getGroup()']]], - ['getgroupemail',['getGroupEmail',['../classSupport__Group.html#a9d0f36a53db49c1f57e3cab8a61a7d90',1,'Support_Group']]], - ['getgroups',['getGroups',['../classSupport__Group.html#a562142b89699a1063ea9769030250365',1,'Support_Group']]], - ['gethidden',['getHidden',['../classTicket__Reply.html#a1d032efbce2b4edb7c269a1e13562f40',1,'Ticket_Reply']]], - ['getht',['getHT',['../classTicket__Info.html#a90d3c0edc1e767875c7fb98880886e73',1,'Ticket_Info']]], - ['getid',['getId',['../classWebUsers.html#a585ef354b38d0fad9d92f45e183b639f',1,'WebUsers\getId($username)'],['../classWebUsers.html#a585ef354b38d0fad9d92f45e183b639f',1,'WebUsers\getId($username)']]], - ['getidfromemail',['getIdFromEmail',['../classWebUsers.html#aee8d6b322defc5dfe8e47f382becca62',1,'WebUsers\getIdFromEmail($email)'],['../classWebUsers.html#aee8d6b322defc5dfe8e47f382becca62',1,'WebUsers\getIdFromEmail($email)']]], - ['getimap_5fmailserver',['getIMAP_MailServer',['../classSupport__Group.html#a30d67354e52f95489b93923440ff0661',1,'Support_Group']]], - ['getimap_5fpassword',['getIMAP_Password',['../classSupport__Group.html#a4983db184794db8f05ce93f5ba11ba7e',1,'Support_Group']]], - ['getimap_5fusername',['getIMAP_Username',['../classSupport__Group.html#a0ace9f66f2541d29e060cb7728030e93',1,'Support_Group']]], - ['getinfo',['getInfo',['../classWebUsers.html#a164026f74736817927e1cacd282a2e28',1,'WebUsers\getInfo()'],['../classWebUsers.html#a164026f74736817927e1cacd282a2e28',1,'WebUsers\getInfo()']]], - ['getlanguage',['getLanguage',['../classWebUsers.html#afcef2403c4111bc44ef0530f1e493909',1,'WebUsers\getLanguage()'],['../classWebUsers.html#afcef2403c4111bc44ef0530f1e493909',1,'WebUsers\getLanguage()']]], - ['getlast',['getLast',['../classPagination.html#a9316ede6960667d832997c8e20223623',1,'Pagination']]], - ['getlatestreply',['getLatestReply',['../classTicket.html#a3a4ce7e9c445dd245b3370304d0afd92',1,'Ticket']]], - ['getlinks',['getLinks',['../classPagination.html#aeecf550e63b55ecd5d737ecc46e07d3a',1,'Pagination']]], - ['getlocal_5faddress',['getLocal_Address',['../classTicket__Info.html#a49b4c851eff2f3d06531a39baa8423f5',1,'Ticket_Info']]], - ['getlogsofticket',['getLogsOfTicket',['../classTicket__Log.html#a37ad4d95b0bb2d5a6dfc2dd7c3744292',1,'Ticket_Log']]], - ['getmemory',['getMemory',['../classTicket__Info.html#a144248575cd034a40315155a9b48ff87',1,'Ticket_Info']]], - ['getmodsandadmins',['getModsAndAdmins',['../classTicket__User.html#a71099747902fb7e064ec1d4128ea4576',1,'Ticket_User']]], - ['getname',['getName',['../classSupport__Group.html#a3d0963e68bb313b163a73f2803c64600',1,'Support_Group\getName()'],['../classTicket__Category.html#a3d0963e68bb313b163a73f2803c64600',1,'Ticket_Category\getName()']]], - ['getnel3d',['getNel3D',['../classTicket__Info.html#abe3ae528bfd5495720c3adeff59fe11e',1,'Ticket_Info']]], - ['getnewestticket',['getNewestTicket',['../classTicket__Queue__Handler.html#ab5a79318a0c771083f03400093b3b2ec',1,'Ticket_Queue_Handler']]], - ['getnroftickets',['getNrOfTickets',['../classTicket__Queue__Handler.html#ada8f87ed8466c5e0477fa20359c3c8ad',1,'Ticket_Queue_Handler']]], - ['getnrofticketsassignedwaiting',['getNrOfTicketsAssignedWaiting',['../classTicket__Queue__Handler.html#a0d3daaaf5c79188eb62bb3adda11fa2a',1,'Ticket_Queue_Handler']]], - ['getnrofticketstodo',['getNrOfTicketsToDo',['../classTicket__Queue__Handler.html#ae8d1a2a66991583c05c173147e8dc657',1,'Ticket_Queue_Handler']]], - ['getos',['getOS',['../classTicket__Info.html#a9a1b88474ad97701d67a752d0c4d65c5',1,'Ticket_Info']]], - ['getpagination',['getPagination',['../classTicket__Queue__Handler.html#ab45a102a508e9727b108e8f24486c464',1,'Ticket_Queue_Handler']]], - ['getparams',['getParams',['../classTicket__Queue.html#ae32cd7c32721b02d676bb63b4b1366db',1,'Ticket_Queue']]], - ['getpatch_5fversion',['getPatch_Version',['../classTicket__Info.html#a6e41e115b03a1f152bd2c28c77d5fbac',1,'Ticket_Info']]], - ['getpermission',['getPermission',['../classTicket__User.html#a478067ecf173884c2ee3e5b94e746200',1,'Ticket_User']]], - ['getpriority',['getPriority',['../classTicket.html#a1e7a3c168dcd0901a0d2669c67575b55',1,'Ticket']]], - ['getpriorityarray',['getPriorityArray',['../classTicket.html#a509625cccc0b41f4ab3a658df705b3dc',1,'Ticket']]], - ['getprioritytext',['getPriorityText',['../classTicket.html#ae07f7808a12f2789593722f3293bd105',1,'Ticket']]], - ['getprocessor',['getProcessor',['../classTicket__Info.html#a3ace868ad456ff61f545cb44ee01c562',1,'Ticket_Info']]], - ['getquery',['getQuery',['../classQuerycache.html#a55f162785567258fe5138af282e588c2',1,'Querycache\getQuery()'],['../classTicket__Log.html#a55f162785567258fe5138af282e588c2',1,'Ticket_Log\getQuery()'],['../classTicket__Queue.html#a55f162785567258fe5138af282e588c2',1,'Ticket_Queue\getQuery()']]], - ['getqueue',['getQueue',['../classTicket.html#aa7a8055e5ee1eb792f29443ddb79c4d3',1,'Ticket']]], - ['getreceivemail',['getReceiveMail',['../classWebUsers.html#ae4680f622bd8d571530615fb616d37e7',1,'WebUsers\getReceiveMail()'],['../classWebUsers.html#ae4680f622bd8d571530615fb616d37e7',1,'WebUsers\getReceiveMail()']]], - ['getrepliesofticket',['getRepliesOfTicket',['../classTicket__Reply.html#a7e80a6437bb6ee90be42a32f3a82fe76',1,'Ticket_Reply']]], - ['getserver_5ftick',['getServer_Tick',['../classTicket__Info.html#a5a5799e4e54d3fa4858716b4464710c0',1,'Ticket_Info']]], - ['getsgroupid',['getSGroupId',['../classSupport__Group.html#a77d0961efe9609ebb268f8672e71bba4',1,'Support_Group']]], - ['getsgroupofticket',['getSGroupOfTicket',['../classForwarded.html#a4de002d45322cf62ce493f49933d33bd',1,'Forwarded']]], - ['getshardid',['getShardId',['../classTicket__Info.html#a36306b5367015050fb516fcaaff8351f',1,'Ticket_Info']]], - ['getsid',['getSID',['../classQuerycache.html#a5bac91964d19751986cccad6fad28dda',1,'Querycache']]], - ['getstatus',['getStatus',['../classTicket.html#a9d21636071f529e2154051d3ea6e5921',1,'Ticket']]], - ['getstatusarray',['getStatusArray',['../classTicket.html#aa728c6a1f8ddd7030acbf5a4ca913b50',1,'Ticket']]], - ['getstatustext',['getStatusText',['../classTicket.html#aab26af198dc3a59295747084b85435ff',1,'Ticket']]], - ['gettag',['getTag',['../classSupport__Group.html#ab86ba36154b20e6bbfa3ba705f12f9d6',1,'Support_Group']]], - ['gettcategoryid',['getTCategoryId',['../classTicket__Category.html#acb530a119e5e52230a92ece95cc7ec82',1,'Ticket_Category']]], - ['gettcontentid',['getTContentId',['../classTicket__Content.html#a9245dceab917ad08e5244c9395b347ae',1,'Ticket_Content']]], - ['getticket',['getTicket',['../classAssigned.html#a42ddf34a72af750b7013fa309b67e46c',1,'Assigned\getTicket()'],['../classForwarded.html#a42ddf34a72af750b7013fa309b67e46c',1,'Forwarded\getTicket()'],['../classTicket__Info.html#a42ddf34a72af750b7013fa309b67e46c',1,'Ticket_Info\getTicket()'],['../classTicket__Log.html#a42ddf34a72af750b7013fa309b67e46c',1,'Ticket_Log\getTicket()'],['../classTicket__Reply.html#a42ddf34a72af750b7013fa309b67e46c',1,'Ticket_Reply\getTicket()']]], - ['getticket_5fcategory',['getTicket_Category',['../classTicket.html#addff2fc457fe07664f4eb39efcea45f9',1,'Ticket']]], - ['gettickets',['getTickets',['../classTicket__Queue__Handler.html#a45e8c11ba9485041fa92c7c470a8f9f9',1,'Ticket_Queue_Handler']]], - ['getticketsof',['getTicketsOf',['../classTicket.html#aa426904463cd0eb50d9b2f4becdd242f',1,'Ticket']]], - ['gettid',['getTId',['../classTicket.html#aa7af74696d9898008992c494cec136dd',1,'Ticket']]], - ['gettimestamp',['getTimestamp',['../classTicket.html#a92aa1d82129ec8cd803d64c28efcb30f',1,'Ticket\getTimestamp()'],['../classTicket__Log.html#a92aa1d82129ec8cd803d64c28efcb30f',1,'Ticket_Log\getTimestamp()'],['../classTicket__Reply.html#a92aa1d82129ec8cd803d64c28efcb30f',1,'Ticket_Reply\getTimestamp()']]], - ['gettinfoid',['getTInfoId',['../classTicket__Info.html#ad7c7ccc1926763c252d32d1fee5a7f69',1,'Ticket_Info']]], - ['gettitle',['getTitle',['../classTicket.html#a95e859a4588a39a1824b717378a84c29',1,'Ticket']]], - ['gettlogid',['getTLogId',['../classTicket__Log.html#ab174d340ee116d8cc3aa377003421fc5',1,'Ticket_Log']]], - ['gettreplyid',['getTReplyId',['../classTicket__Reply.html#ade0c35755c1a1af8fa4c9bae8b4c51f1',1,'Ticket_Reply']]], - ['gettuserid',['getTUserId',['../classTicket__User.html#a4a31c27c61f9794200b647bf810461f5',1,'Ticket_User']]], - ['gettype',['getType',['../classQuerycache.html#a830b5c75df72b32396701bc563fbe3c7',1,'Querycache']]], - ['getuid',['getUId',['../classWebUsers.html#aa36a98da4146d85e7813e99df7d97497',1,'WebUsers\getUId()'],['../classWebUsers.html#aa36a98da4146d85e7813e99df7d97497',1,'WebUsers\getUId()']]], - ['getuser',['getUser',['../classAssigned.html#ae81b7186fb97a7c6457edcc68c9aa2ef',1,'Assigned\getUser()'],['../classIn__Support__Group.html#ae81b7186fb97a7c6457edcc68c9aa2ef',1,'In_Support_Group\getUser()']]], - ['getuser_5fid',['getUser_Id',['../classTicket__Info.html#a9c2fe31c14609e2255773d5a4dd154d8',1,'Ticket_Info']]], - ['getuser_5fposition',['getUser_Position',['../classTicket__Info.html#a3f5a46d846543219d6321d2f8751d1f0',1,'Ticket_Info']]], - ['getuserassignedtoticket',['getUserAssignedToTicket',['../classAssigned.html#afcfb156712a9477a97423a49238d13c5',1,'Assigned']]], - ['getusername',['getUsername',['../classWebUsers.html#a81b37a3c9d639574e394f80c1138c75e',1,'WebUsers\getUsername()'],['../classWebUsers.html#a81b37a3c9d639574e394f80c1138c75e',1,'WebUsers\getUsername()']]], - ['getusers',['getUsers',['../classWebUsers.html#a0fc10b64683021b70c7eb95fb514c119',1,'WebUsers\getUsers()'],['../classWebUsers.html#a0fc10b64683021b70c7eb95fb514c119',1,'WebUsers\getUsers()']]], - ['getview_5fposition',['getView_Position',['../classTicket__Info.html#a525dbd26fc788c7c152f6c686a9a5d11',1,'Ticket_Info']]], - ['gui_5felements',['Gui_Elements',['../classGui__Elements.html',1,'']]], - ['gui_5felements_2ephp',['gui_elements.php',['../gui__elements_8php.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_68.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_68.html deleted file mode 100644 index 6df909782..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_68.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_68.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_68.js deleted file mode 100644 index 551ff1628..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_68.js +++ /dev/null @@ -1,8 +0,0 @@ -var searchData= -[ - ['handle_5flanguage',['handle_language',['../classHelpers.html#a334920d0652c160c6145d3bd7be31a22',1,'Helpers']]], - ['hashiv',['hashIV',['../classMyCrypt.html#a1bdf94a5906655bf0965338c9d17ab27',1,'MyCrypt']]], - ['hasinfo',['hasInfo',['../classTicket.html#afca07df3cc25a0e1a15d3f69bd6afa62',1,'Ticket']]], - ['helpers',['Helpers',['../classHelpers.html',1,'']]], - ['helpers_2ephp',['helpers.php',['../helpers_8php.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_69.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_69.html deleted file mode 100644 index 1a00b554d..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_69.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_69.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_69.js deleted file mode 100644 index a0e19a9ec..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_69.js +++ /dev/null @@ -1,14 +0,0 @@ -var searchData= -[ - ['in_5fsupport_5fgroup',['In_Support_Group',['../classIn__Support__Group.html',1,'']]], - ['in_5fsupport_5fgroup_2ephp',['in_support_group.php',['../in__support__group_8php.html',1,'']]], - ['incoming_5fmail_5fhandler',['incoming_mail_handler',['../classMail__Handler.html#a2896dabadb8e435de7ba7bbb258f8a96',1,'Mail_Handler']]], - ['index_2ephp',['index.php',['../index_8php.html',1,'']]], - ['info_2ephp',['info.php',['../info_8php.html',1,'']]], - ['install_2ephp',['install.php',['../install_8php.html',1,'']]], - ['isadmin',['isAdmin',['../classTicket__User.html#ae8a7d91474cde916fced2127fab426d2',1,'Ticket_User']]], - ['isassigned',['isAssigned',['../classAssigned.html#ade127364a5e5635077119b7217b6059c',1,'Assigned']]], - ['isforwarded',['isForwarded',['../classForwarded.html#ac1fa2045188edf04b07c523e1c6f68a0',1,'Forwarded']]], - ['isloggedin',['isLoggedIn',['../classWebUsers.html#a33bdd79e5da367ebddd4cfbdbbfc7cff',1,'WebUsers\isLoggedIn()'],['../classWebUsers.html#a33bdd79e5da367ebddd4cfbdbbfc7cff',1,'WebUsers\isLoggedIn()']]], - ['ismod',['isMod',['../classTicket__User.html#a8d88cdbf205bf7d24be03157d25bb7d8',1,'Ticket_User']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_6c.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_6c.html deleted file mode 100644 index f6383cc22..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_6c.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_6c.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_6c.js deleted file mode 100644 index d76ada768..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_6c.js +++ /dev/null @@ -1,28 +0,0 @@ -var searchData= -[ - ['libinclude_2ephp',['libinclude.php',['../libinclude_8php.html',1,'']]], - ['load',['load',['../classAssigned.html#a689011be59ec3d216ebe6852f07ab37f',1,'Assigned\load()'],['../classForwarded.html#a689011be59ec3d216ebe6852f07ab37f',1,'Forwarded\load()']]], - ['load_5fwith_5fsgroupid',['load_With_SGroupId',['../classSupport__Group.html#a6beae177f45da42a57b100b5481f49bf',1,'Support_Group']]], - ['load_5fwith_5fsid',['load_With_SID',['../classQuerycache.html#ae960510ccb242704233c38d787242f53',1,'Querycache']]], - ['load_5fwith_5ftcategoryid',['load_With_TCategoryId',['../classTicket__Category.html#ab3a70940917530d91a39536a6d45a21d',1,'Ticket_Category']]], - ['load_5fwith_5ftcontentid',['load_With_TContentId',['../classTicket__Content.html#ad8b1226537a055701bcc3fe4af87257b',1,'Ticket_Content']]], - ['load_5fwith_5fticket',['load_With_Ticket',['../classTicket__Info.html#afcf4006cdd19b05919b5df34d3345ad2',1,'Ticket_Info']]], - ['load_5fwith_5ftid',['load_With_TId',['../classTicket.html#ac17d9e1158fb77707da1f6cd3e425d54',1,'Ticket']]], - ['load_5fwith_5ftinfoid',['load_With_TInfoId',['../classTicket__Info.html#a1681685f76483b7944bf6848b29caa4a',1,'Ticket_Info']]], - ['load_5fwith_5ftlogid',['load_With_TLogId',['../classTicket__Log.html#a76e8e991002c7e408f7b182556cdeade',1,'Ticket_Log']]], - ['load_5fwith_5ftreplyid',['load_With_TReplyId',['../classTicket__Reply.html#ac9a387c63aad0b81a8161d2515f697d9',1,'Ticket_Reply']]], - ['load_5fwith_5ftuserid',['load_With_TUserId',['../classTicket__User.html#af43df1ba39e073e4b3a0120e6e4d3140',1,'Ticket_User']]], - ['loadallclosedtickets',['loadAllClosedTickets',['../classTicket__Queue.html#af2a9b20ac9dc0e1992f717abbb418be7',1,'Ticket_Queue']]], - ['loadallnotassignedtickets',['loadAllNotAssignedTickets',['../classTicket__Queue.html#a771627a0bd387cd666474a6ef0d5eaaf',1,'Ticket_Queue']]], - ['loadallopentickets',['loadAllOpenTickets',['../classTicket__Queue.html#a3a1cf8a88a3604e093f7d276050f1c49',1,'Ticket_Queue']]], - ['loadalltickets',['loadAllTickets',['../classTicket__Queue.html#a80542bde30a8a589f1d088422cb7719b',1,'Ticket_Queue']]], - ['loadassignedandwaiting',['loadAssignedandWaiting',['../classTicket__Queue.html#a348c76f7ae32437b7e91b57671d6f33d',1,'Ticket_Queue']]], - ['loadtemplate',['loadTemplate',['../classHelpers.html#a78997ab39ba0237dc7a5441b58601211',1,'Helpers']]], - ['loadtodotickets',['loadToDoTickets',['../classTicket__Queue.html#ad88848edf9a9132eb0cfcac904a8459f',1,'Ticket_Queue']]], - ['login',['login',['../func_2login_8php.html#aa311da27ba5706f5710cea7706c8eae1',1,'login(): login.php'],['../inc_2login_8php.html#aa311da27ba5706f5710cea7706c8eae1',1,'login(): login.php']]], - ['login_2ephp',['login.php',['../func_2login_8php.html',1,'']]], - ['login_2ephp',['login.php',['../inc_2login_8php.html',1,'']]], - ['logout',['logout',['../drupal__module_2ryzommanage_2inc_2logout_8php.html#a082405d89acd6835c3a7c7a08a7adbab',1,'logout(): logout.php'],['../www_2html_2inc_2logout_8php.html#a082405d89acd6835c3a7c7a08a7adbab',1,'logout(): logout.php']]], - ['logout_2ephp',['logout.php',['../www_2html_2inc_2logout_8php.html',1,'']]], - ['logout_2ephp',['logout.php',['../drupal__module_2ryzommanage_2inc_2logout_8php.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_6d.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_6d.html deleted file mode 100644 index 2e27d4d64..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_6d.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_6d.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_6d.js deleted file mode 100644 index fb08a60ab..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_6d.js +++ /dev/null @@ -1,13 +0,0 @@ -var searchData= -[ - ['mail_5fcron_2ephp',['mail_cron.php',['../mail__cron_8php.html',1,'']]], - ['mail_5ffork',['mail_fork',['../classMail__Handler.html#ac6f9bcfab65cc93fdd4723284fff6b7a',1,'Mail_Handler']]], - ['mail_5fhandler',['Mail_Handler',['../classMail__Handler.html',1,'']]], - ['mail_5fhandler_2ephp',['mail_handler.php',['../mail__handler_8php.html',1,'']]], - ['make_5ftable',['make_table',['../classGui__Elements.html#a639930203d81ff01840ac90a51cbbfe7',1,'Gui_Elements']]], - ['make_5ftable_5fwith_5fkey_5fis_5fid',['make_table_with_key_is_id',['../classGui__Elements.html#ae3c8c19fce4cdd7d87d4ae759ab06f24',1,'Gui_Elements']]], - ['modify_5femail_5fof_5fsgroup',['modify_email_of_sgroup',['../modify__email__of__sgroup_8php.html#acb8c4a7ad3e36662d1d22ba56a98d0ab',1,'modify_email_of_sgroup.php']]], - ['modify_5femail_5fof_5fsgroup_2ephp',['modify_email_of_sgroup.php',['../modify__email__of__sgroup_8php.html',1,'']]], - ['mycrypt',['MyCrypt',['../classMyCrypt.html',1,'']]], - ['mycrypt_2ephp',['mycrypt.php',['../mycrypt_8php.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_6e.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_6e.html deleted file mode 100644 index 1f92ee5b6..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_6e.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_6e.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_6e.js deleted file mode 100644 index 0831ed960..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_6e.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['new_5fmessage_5fid',['new_message_id',['../classMail__Handler.html#a667ca75b6c659157d855c3d19978a436',1,'Mail_Handler']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_6f.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_6f.html deleted file mode 100644 index 61827e82e..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_6f.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_6f.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_6f.js deleted file mode 100644 index f8a8b3016..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_6f.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['outputtime',['outputTime',['../classHelpers.html#a4370c805a72fe32c03b178b03ad2e393',1,'Helpers']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_70.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_70.html deleted file mode 100644 index 0340151b6..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_70.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_70.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_70.js deleted file mode 100644 index e09f3f7d0..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_70.js +++ /dev/null @@ -1,5 +0,0 @@ -var searchData= -[ - ['pagination',['Pagination',['../classPagination.html',1,'']]], - ['pagination_2ephp',['pagination.php',['../pagination_8php.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_71.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_71.html deleted file mode 100644 index b4dc1e6ee..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_71.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_71.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_71.js deleted file mode 100644 index 8b0805dd8..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_71.js +++ /dev/null @@ -1,5 +0,0 @@ -var searchData= -[ - ['querycache',['Querycache',['../classQuerycache.html',1,'']]], - ['querycache_2ephp',['querycache.php',['../querycache_8php.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_72.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_72.html deleted file mode 100644 index 0ab18d65f..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_72.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_72.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_72.js deleted file mode 100644 index ece0a9538..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_72.js +++ /dev/null @@ -1,7 +0,0 @@ -var searchData= -[ - ['register',['register',['../register_8php.html#acc294a6cc8e69743746820e3d15e3f78',1,'register.php']]], - ['register_2ephp',['register.php',['../register_8php.html',1,'']]], - ['reply_5fon_5fticket',['reply_on_ticket',['../reply__on__ticket_8php.html#a79f0a445c77e8e1e59eb9e72cbf39dba',1,'reply_on_ticket.php']]], - ['reply_5fon_5fticket_2ephp',['reply_on_ticket.php',['../reply__on__ticket_8php.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_73.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_73.html deleted file mode 100644 index 1ec8f174d..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_73.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_73.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_73.js deleted file mode 100644 index aee17ff0a..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_73.js +++ /dev/null @@ -1,90 +0,0 @@ -var searchData= -[ - ['send_5fmail',['send_mail',['../classMail__Handler.html#a50308ad0711aee080dacef7e3f574699',1,'Mail_Handler']]], - ['send_5fticketing_5fmail',['send_ticketing_mail',['../classMail__Handler.html#abe649044c8b8bd8eb05787a401865e6d',1,'Mail_Handler']]], - ['set',['set',['../classAssigned.html#a8bdfe0a5256e35367225bcd6d278ef21',1,'Assigned\set()'],['../classForwarded.html#a8bdfe0a5256e35367225bcd6d278ef21',1,'Forwarded\set()'],['../classIn__Support__Group.html#a8bdfe0a5256e35367225bcd6d278ef21',1,'In_Support_Group\set()'],['../classQuerycache.html#a8bdfe0a5256e35367225bcd6d278ef21',1,'Querycache\set()'],['../classSupport__Group.html#a8bdfe0a5256e35367225bcd6d278ef21',1,'Support_Group\set()'],['../classTicket.html#a8bdfe0a5256e35367225bcd6d278ef21',1,'Ticket\set()'],['../classTicket__Info.html#a8bdfe0a5256e35367225bcd6d278ef21',1,'Ticket_Info\set()'],['../classTicket__Log.html#a8bdfe0a5256e35367225bcd6d278ef21',1,'Ticket_Log\set()'],['../classTicket__Reply.html#a8bdfe0a5256e35367225bcd6d278ef21',1,'Ticket_Reply\set()'],['../classTicket__User.html#a8bdfe0a5256e35367225bcd6d278ef21',1,'Ticket_User\set()'],['../classWebUsers.html#a8bdfe0a5256e35367225bcd6d278ef21',1,'WebUsers\set($values)'],['../classWebUsers.html#a8bdfe0a5256e35367225bcd6d278ef21',1,'WebUsers\set($values)']]], - ['setamsemail',['setAmsEmail',['../classUsers.html#ad1cbb1fe6ee72f46dc385bec6e274363',1,'Users']]], - ['setamspassword',['setAmsPassword',['../classUsers.html#ab89812058b0a71baf492af4652d67501',1,'Users']]], - ['setauthor',['setAuthor',['../classTicket.html#a0c8f116992af7c8737c70119dae00d45',1,'Ticket\setAuthor()'],['../classTicket__Log.html#a0c8f116992af7c8737c70119dae00d45',1,'Ticket_Log\setAuthor()'],['../classTicket__Reply.html#a0c8f116992af7c8737c70119dae00d45',1,'Ticket_Reply\setAuthor()']]], - ['setclient_5fversion',['setClient_Version',['../classTicket__Info.html#af06e75f73ae40120cc371f6ddd9ab49c',1,'Ticket_Info']]], - ['setconnect_5fstate',['setConnect_State',['../classTicket__Info.html#a4de823fc3a051d3aac3d526badef313c',1,'Ticket_Info']]], - ['setcontent',['setContent',['../classTicket__Content.html#a76e94f05c5cc0044993a35492097df4d',1,'Ticket_Content\setContent()'],['../classTicket__Reply.html#a76e94f05c5cc0044993a35492097df4d',1,'Ticket_Reply\setContent()']]], - ['setcpu_5fmask',['setCPU_Mask',['../classTicket__Info.html#a5f19999ab39a2ac0b7d6f2ced9223ae6',1,'Ticket_Info']]], - ['setcpuid',['setCPUId',['../classTicket__Info.html#af1f04d3bdcbaf28b246eb94a484f397c',1,'Ticket_Info']]], - ['setdb',['setDb',['../classQuerycache.html#afa9c249972ca269a2b1a399ed2faf9b4',1,'Querycache']]], - ['setemail',['setEmail',['../classWebUsers.html#a0cd214763f395718db166fbd598689f4',1,'WebUsers\setEmail($user, $mail)'],['../classWebUsers.html#a0cd214763f395718db166fbd598689f4',1,'WebUsers\setEmail($user, $mail)']]], - ['setexternid',['setExternId',['../classTicket__User.html#ad38846bb954052a5293ae2d26cf810d2',1,'Ticket_User']]], - ['setgroup',['setGroup',['../classForwarded.html#a3116db27c2e2f33cbb10a9488db34da3',1,'Forwarded\setGroup()'],['../classIn__Support__Group.html#a3116db27c2e2f33cbb10a9488db34da3',1,'In_Support_Group\setGroup()']]], - ['setgroupemail',['setGroupEmail',['../classSupport__Group.html#abbb0e975fd21a42439970ebb3eba5fea',1,'Support_Group']]], - ['sethidden',['setHidden',['../classTicket__Reply.html#a0b67f1016974c7b153b8944a94c88045',1,'Ticket_Reply']]], - ['setht',['setHT',['../classTicket__Info.html#a9ef93ff2fede4bd9b1cb8da2129dee20',1,'Ticket_Info']]], - ['setimap_5fmailserver',['setIMAP_MailServer',['../classSupport__Group.html#a71f266f2bba1fc4fb6df4cf083988938',1,'Support_Group']]], - ['setimap_5fpassword',['setIMAP_Password',['../classSupport__Group.html#ad6fcb63d4ae129567e8bea8786a75d87',1,'Support_Group']]], - ['setimap_5fusername',['setIMAP_Username',['../classSupport__Group.html#a6856519261b543f27bc001616c2881eb',1,'Support_Group']]], - ['setlanguage',['setLanguage',['../classWebUsers.html#a5ab1bd5f0959a3c33a46c176d9412c80',1,'WebUsers\setLanguage($user, $language)'],['../classWebUsers.html#a5ab1bd5f0959a3c33a46c176d9412c80',1,'WebUsers\setLanguage($user, $language)']]], - ['setlocal_5faddress',['setLocal_Address',['../classTicket__Info.html#a144b42f39cea6b24624c6c547df6aeeb',1,'Ticket_Info']]], - ['setmemory',['setMemory',['../classTicket__Info.html#a6f6f6925a18d24d2ecd5166a325be609',1,'Ticket_Info']]], - ['setname',['setName',['../classSupport__Group.html#aa3dcc220094e19fef1f918a3a917dba7',1,'Support_Group\setName()'],['../classTicket__Category.html#aa3dcc220094e19fef1f918a3a917dba7',1,'Ticket_Category\setName()']]], - ['setnel3d',['setNel3D',['../classTicket__Info.html#a77fbf6da57aa02e075be0905dc6cdd48',1,'Ticket_Info']]], - ['setos',['setOS',['../classTicket__Info.html#aacb7cbb0f04959ae64ba1c3aac36df54',1,'Ticket_Info']]], - ['setpassword',['setPassword',['../classWebUsers.html#a91506e5f74c9884045e865ef7c314fed',1,'WebUsers\setPassword($user, $pass)'],['../classWebUsers.html#a91506e5f74c9884045e865ef7c314fed',1,'WebUsers\setPassword($user, $pass)']]], - ['setpatch_5fversion',['setPatch_Version',['../classTicket__Info.html#a1d0f55ed3b50a72bf882591474d2ff72',1,'Ticket_Info']]], - ['setpermission',['setPermission',['../classTicket__User.html#adf7c497fb026ee6e05f6ece91f541839',1,'Ticket_User']]], - ['setpriority',['setPriority',['../classTicket.html#a3080d0b46978a8f82022bbb6e5fc0c1c',1,'Ticket']]], - ['setprocessor',['setProcessor',['../classTicket__Info.html#a8b66f72ec1928b89058cd0a9b4dd8c11',1,'Ticket_Info']]], - ['setquery',['setQuery',['../classQuerycache.html#adbd6075ec5d3bd84122e52b0134ed8e7',1,'Querycache\setQuery()'],['../classTicket__Log.html#adbd6075ec5d3bd84122e52b0134ed8e7',1,'Ticket_Log\setQuery()']]], - ['setqueue',['setQueue',['../classTicket.html#a1595d3fe708fe4f453922054407a1c03',1,'Ticket']]], - ['setreceivemail',['setReceiveMail',['../classWebUsers.html#aa0f439ff7a5cd6377a557f545fbeb45c',1,'WebUsers\setReceiveMail($user, $receivemail)'],['../classWebUsers.html#aa0f439ff7a5cd6377a557f545fbeb45c',1,'WebUsers\setReceiveMail($user, $receivemail)']]], - ['setserver_5ftick',['setServer_Tick',['../classTicket__Info.html#ab6ff52082590b43d90f8f37fd5b31086',1,'Ticket_Info']]], - ['setsgroupid',['setSGroupId',['../classSupport__Group.html#aa49cb914be98fc354a45584c6f2b8be1',1,'Support_Group']]], - ['setshardid',['setShardId',['../classTicket__Info.html#a4026e593012113e253b80e3bbd5f6c13',1,'Ticket_Info']]], - ['setsid',['setSID',['../classQuerycache.html#a2f536a1f8c8e463eb0346ac375f2a24d',1,'Querycache']]], - ['setstatus',['setStatus',['../classTicket.html#a66605893c4afc9855f1e0cf8ccccac09',1,'Ticket']]], - ['settag',['setTag',['../classSupport__Group.html#a4de944a53debc51843530fe96296f220',1,'Support_Group']]], - ['settcategoryid',['setTCategoryId',['../classTicket__Category.html#a39a64c3f7ab33ba3f5a67c31647e889f',1,'Ticket_Category']]], - ['settcontentid',['setTContentId',['../classTicket__Content.html#ae07366727208e060372063e96591c5d4',1,'Ticket_Content']]], - ['setticket',['setTicket',['../classAssigned.html#a47c6ae5b3cd713fdbf0a7f4d568b7c27',1,'Assigned\setTicket()'],['../classForwarded.html#a47c6ae5b3cd713fdbf0a7f4d568b7c27',1,'Forwarded\setTicket()'],['../classTicket__Info.html#a47c6ae5b3cd713fdbf0a7f4d568b7c27',1,'Ticket_Info\setTicket()'],['../classTicket__Log.html#a47c6ae5b3cd713fdbf0a7f4d568b7c27',1,'Ticket_Log\setTicket()'],['../classTicket__Reply.html#a47c6ae5b3cd713fdbf0a7f4d568b7c27',1,'Ticket_Reply\setTicket()']]], - ['setticket_5fcategory',['setTicket_Category',['../classTicket.html#a4e38b2a263b5a934b76cd77f026308c3',1,'Ticket']]], - ['settid',['setTId',['../classTicket.html#a8c72dc7b09645b390043f5a4664e7c7f',1,'Ticket']]], - ['settimestamp',['setTimestamp',['../classTicket.html#a4e05995d5cc78cdc9ffe72d864811ac6',1,'Ticket\setTimestamp()'],['../classTicket__Log.html#aa8903a0020a17d745524806f4e751f4c',1,'Ticket_Log\setTimestamp()'],['../classTicket__Reply.html#aa8903a0020a17d745524806f4e751f4c',1,'Ticket_Reply\setTimestamp()']]], - ['settinfoid',['setTInfoId',['../classTicket__Info.html#a5e98fba0b50f74645a2fdaa8f4d0c1ea',1,'Ticket_Info']]], - ['settings',['settings',['../drupal__module_2ryzommanage_2inc_2settings_8php.html#ad7354383714c6ae99d6ee1bfb95ab49f',1,'settings(): settings.php'],['../www_2html_2inc_2settings_8php.html#ad7354383714c6ae99d6ee1bfb95ab49f',1,'settings(): settings.php']]], - ['settings_2ephp',['settings.php',['../drupal__module_2ryzommanage_2inc_2settings_8php.html',1,'']]], - ['settings_2ephp',['settings.php',['../www_2html_2inc_2settings_8php.html',1,'']]], - ['settitle',['setTitle',['../classTicket.html#ac765da6fa83b06ea39c0edc9b3e6c6c0',1,'Ticket']]], - ['settlogid',['setTLogId',['../classTicket__Log.html#aca708aae8c7320e11d9e08936ec74dec',1,'Ticket_Log']]], - ['settreplyid',['setTReplyId',['../classTicket__Reply.html#a7b91b481de87eb1515212d62b298cb94',1,'Ticket_Reply']]], - ['settuserid',['setTUserId',['../classTicket__User.html#a0faf8954e86346e7b566870b1a3c0a4a',1,'Ticket_User']]], - ['settype',['setType',['../classQuerycache.html#a0f29af8d4b9fdd8959739727a33acee5',1,'Querycache']]], - ['setuser',['setUser',['../classAssigned.html#af560ca7f201e2f871384a150e8ffd9aa',1,'Assigned\setUser()'],['../classIn__Support__Group.html#af560ca7f201e2f871384a150e8ffd9aa',1,'In_Support_Group\setUser()']]], - ['setuser_5fid',['setUser_Id',['../classTicket__Info.html#aec77405f6e096f2c0493383724f33034',1,'Ticket_Info']]], - ['setuser_5fposition',['setUser_Position',['../classTicket__Info.html#a41cfb7786d3252b2ec7aec42d77add9f',1,'Ticket_Info']]], - ['setview_5fposition',['setView_Position',['../classTicket__Info.html#a58912ec04451ab232d88bd78b6a8c2ea',1,'Ticket_Info']]], - ['sgroup_5flist',['sgroup_list',['../sgroup__list_8php.html#ab3af46486585b0ddced2de27a5d7a000',1,'sgroup_list.php']]], - ['sgroup_5flist_2ephp',['sgroup_list.php',['../sgroup__list_8php.html',1,'']]], - ['show_5fqueue',['show_queue',['../show__queue_8php.html#a48695b07fef725dbf0b4f261b1fe1547',1,'show_queue.php']]], - ['show_5fqueue_2ephp',['show_queue.php',['../show__queue_8php.html',1,'']]], - ['show_5freply',['show_reply',['../show__reply_8php.html#ad8e51d3b3a4bf996fb07199a08ca9a3e',1,'show_reply.php']]], - ['show_5freply_2ephp',['show_reply.php',['../show__reply_8php.html',1,'']]], - ['show_5fsgroup',['show_sgroup',['../show__sgroup_8php.html#a118719426cb30ed43e39c2af24cfea2d',1,'show_sgroup.php']]], - ['show_5fsgroup_2ephp',['show_sgroup.php',['../show__sgroup_8php.html',1,'']]], - ['show_5fticket',['show_ticket',['../show__ticket_8php.html#a1249d6cae97f6949ce3a7754fa1b7016',1,'show_ticket.php']]], - ['show_5fticket_2ephp',['show_ticket.php',['../show__ticket_8php.html',1,'']]], - ['show_5fticket_5finfo',['show_ticket_info',['../show__ticket__info_8php.html#a579a5c89b55189455a8237369a78f0d8',1,'show_ticket_info.php']]], - ['show_5fticket_5finfo_2ephp',['show_ticket_info.php',['../show__ticket__info_8php.html',1,'']]], - ['show_5fticket_5flog',['show_ticket_log',['../show__ticket__log_8php.html#ab37298a659581e85338601f2259ead49',1,'show_ticket_log.php']]], - ['show_5fticket_5flog_2ephp',['show_ticket_log.php',['../show__ticket__log_8php.html',1,'']]], - ['show_5fuser',['show_user',['../drupal__module_2ryzommanage_2inc_2show__user_8php.html#ac755ca62882d4caca41c7822793b8812',1,'show_user(): show_user.php'],['../www_2html_2inc_2show__user_8php.html#ac755ca62882d4caca41c7822793b8812',1,'show_user(): show_user.php']]], - ['show_5fuser_2ephp',['show_user.php',['../drupal__module_2ryzommanage_2inc_2show__user_8php.html',1,'']]], - ['show_5fuser_2ephp',['show_user.php',['../www_2html_2inc_2show__user_8php.html',1,'']]], - ['support_5fgroup',['Support_Group',['../classSupport__Group.html',1,'']]], - ['support_5fgroup_2ephp',['support_group.php',['../support__group_8php.html',1,'']]], - ['supportgroup_5fentrynotexists',['supportGroup_EntryNotExists',['../classSupport__Group.html#aa557f337f57a3bb530f1f04df78c0f1e',1,'Support_Group']]], - ['supportgroup_5fexists',['supportGroup_Exists',['../classSupport__Group.html#ac235662693dcc9c2be51e6f1a2c426b6',1,'Support_Group']]], - ['sync',['Sync',['../classSync.html',1,'']]], - ['sync_2ephp',['sync.php',['../sync_8php.html',1,'']]], - ['sync_5fcron_2ephp',['sync_cron.php',['../sync__cron_8php.html',1,'']]], - ['syncdata',['syncdata',['../classSync.html#ad1211cc677b7aafcc4ebcc25f3cacdda',1,'Sync']]], - ['syncing',['syncing',['../syncing_8php.html#a8d4df31796dab54a8d0c9c9ec32cf7f9',1,'syncing.php']]], - ['syncing_2ephp',['syncing.php',['../syncing_8php.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_74.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_74.html deleted file mode 100644 index fdc6589d0..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_74.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_74.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_74.js deleted file mode 100644 index 4c4c97839..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_74.js +++ /dev/null @@ -1,24 +0,0 @@ -var searchData= -[ - ['ticket',['Ticket',['../classTicket.html',1,'']]], - ['ticket_2ephp',['ticket.php',['../ticket_8php.html',1,'']]], - ['ticket_5fcategory',['Ticket_Category',['../classTicket__Category.html',1,'']]], - ['ticket_5fcategory_2ephp',['ticket_category.php',['../ticket__category_8php.html',1,'']]], - ['ticket_5fcontent',['Ticket_Content',['../classTicket__Content.html',1,'']]], - ['ticket_5fcontent_2ephp',['ticket_content.php',['../ticket__content_8php.html',1,'']]], - ['ticket_5finfo',['Ticket_Info',['../classTicket__Info.html',1,'']]], - ['ticket_5finfo_2ephp',['ticket_info.php',['../ticket__info_8php.html',1,'']]], - ['ticket_5flog',['Ticket_Log',['../classTicket__Log.html',1,'']]], - ['ticket_5flog_2ephp',['ticket_log.php',['../ticket__log_8php.html',1,'']]], - ['ticket_5fqueue',['Ticket_Queue',['../classTicket__Queue.html',1,'']]], - ['ticket_5fqueue_2ephp',['ticket_queue.php',['../ticket__queue_8php.html',1,'']]], - ['ticket_5fqueue_5fhandler',['Ticket_Queue_Handler',['../classTicket__Queue__Handler.html',1,'']]], - ['ticket_5fqueue_5fhandler_2ephp',['ticket_queue_handler.php',['../ticket__queue__handler_8php.html',1,'']]], - ['ticket_5freply',['Ticket_Reply',['../classTicket__Reply.html',1,'']]], - ['ticket_5freply_2ephp',['ticket_reply.php',['../ticket__reply_8php.html',1,'']]], - ['ticket_5fuser',['Ticket_User',['../classTicket__User.html',1,'']]], - ['ticket_5fuser_2ephp',['ticket_user.php',['../ticket__user_8php.html',1,'']]], - ['ticketexists',['ticketExists',['../classTicket.html#a091d7ec56d4dc4bf980b81e8069b76d0',1,'Ticket']]], - ['tickethasinfo',['TicketHasInfo',['../classTicket__Info.html#a361217eb1d85e13aa534dabfbbd64a86',1,'Ticket_Info']]], - ['time_5felapsed_5fstring',['time_elapsed_string',['../classGui__Elements.html#a04d9bc70e65231a470426f0a94b7583d',1,'Gui_Elements']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_75.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_75.html deleted file mode 100644 index ab8455ed5..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_75.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_75.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_75.js deleted file mode 100644 index ad5f4cb36..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_75.js +++ /dev/null @@ -1,12 +0,0 @@ -var searchData= -[ - ['unassignticket',['unAssignTicket',['../classAssigned.html#a8263a9c223957bb558a2c16d4431ca29',1,'Assigned\unAssignTicket()'],['../classTicket.html#a8263a9c223957bb558a2c16d4431ca29',1,'Ticket\unAssignTicket()']]], - ['update',['update',['../classQuerycache.html#a842e4774e3b3601a005b995c02f7e883',1,'Querycache\update()'],['../classSupport__Group.html#a842e4774e3b3601a005b995c02f7e883',1,'Support_Group\update()'],['../classTicket.html#a842e4774e3b3601a005b995c02f7e883',1,'Ticket\update()'],['../classTicket__Category.html#a842e4774e3b3601a005b995c02f7e883',1,'Ticket_Category\update()'],['../classTicket__Content.html#a842e4774e3b3601a005b995c02f7e883',1,'Ticket_Content\update()'],['../classTicket__Log.html#a842e4774e3b3601a005b995c02f7e883',1,'Ticket_Log\update()'],['../classTicket__Reply.html#a842e4774e3b3601a005b995c02f7e883',1,'Ticket_Reply\update()'],['../classTicket__User.html#a842e4774e3b3601a005b995c02f7e883',1,'Ticket_User\update()']]], - ['updateticketstatus',['updateTicketStatus',['../classTicket.html#a6da2625040e9f06c583e9303082c556f',1,'Ticket']]], - ['updateticketstatusandpriority',['updateTicketStatusAndPriority',['../classTicket.html#a64f08c8987c9eb00d4bfc9ef94e45326',1,'Ticket']]], - ['userexistsinsgroup',['userExistsInSGroup',['../classIn__Support__Group.html#a1a25afa24efc6c01ffd236f735281543',1,'In_Support_Group']]], - ['userlist',['userlist',['../userlist_8php.html#a55709a05f18e09358e2b02531eb859ad',1,'userlist.php']]], - ['userlist_2ephp',['userlist.php',['../userlist_8php.html',1,'']]], - ['users',['Users',['../classUsers.html',1,'']]], - ['users_2ephp',['users.php',['../users_8php.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_76.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_76.html deleted file mode 100644 index 0ff5edd34..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_76.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_76.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_76.js deleted file mode 100644 index 1566125d3..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_76.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['validemail',['validEmail',['../classUsers.html#a73637e760498c5cea55074896ec982ac',1,'Users']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_77.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_77.html deleted file mode 100644 index 73323d316..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_77.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_77.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_77.js deleted file mode 100644 index 5a36cb483..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/all_77.js +++ /dev/null @@ -1,7 +0,0 @@ -var searchData= -[ - ['webusers',['WebUsers',['../classWebUsers.html',1,'']]], - ['webusers_2ephp',['webusers.php',['../drupal__module_2ryzommanage_2autoload_2webusers_8php.html',1,'']]], - ['webusers_2ephp',['webusers.php',['../www_2html_2autoload_2webusers_8php.html',1,'']]], - ['write_5fuser',['write_user',['../add__user_8php.html#a09df49f177966f5b08af71ec43760e0c',1,'add_user.php']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_61.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_61.html deleted file mode 100644 index 85e5d72a3..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_61.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_61.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_61.js deleted file mode 100644 index 39d4914a1..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_61.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['assigned',['Assigned',['../classAssigned.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_64.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_64.html deleted file mode 100644 index 590270830..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_64.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_64.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_64.js deleted file mode 100644 index db9b214c1..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_64.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['dblayer',['DBLayer',['../classDBLayer.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_66.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_66.html deleted file mode 100644 index 941988c65..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_66.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_66.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_66.js deleted file mode 100644 index 518614d90..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_66.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['forwarded',['Forwarded',['../classForwarded.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_67.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_67.html deleted file mode 100644 index 78b514df0..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_67.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_67.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_67.js deleted file mode 100644 index e85658e41..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_67.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['gui_5felements',['Gui_Elements',['../classGui__Elements.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_68.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_68.html deleted file mode 100644 index 475eeb738..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_68.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_68.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_68.js deleted file mode 100644 index 9e86cb7a3..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_68.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['helpers',['Helpers',['../classHelpers.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_69.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_69.html deleted file mode 100644 index 961dbea27..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_69.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_69.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_69.js deleted file mode 100644 index 49e6133b0..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_69.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['in_5fsupport_5fgroup',['In_Support_Group',['../classIn__Support__Group.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_6d.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_6d.html deleted file mode 100644 index abe6f0d1d..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_6d.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_6d.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_6d.js deleted file mode 100644 index ae1e0f417..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_6d.js +++ /dev/null @@ -1,5 +0,0 @@ -var searchData= -[ - ['mail_5fhandler',['Mail_Handler',['../classMail__Handler.html',1,'']]], - ['mycrypt',['MyCrypt',['../classMyCrypt.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_70.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_70.html deleted file mode 100644 index e4b520874..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_70.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_70.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_70.js deleted file mode 100644 index 157d7c6b6..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_70.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['pagination',['Pagination',['../classPagination.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_71.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_71.html deleted file mode 100644 index 80a4fbb83..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_71.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_71.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_71.js deleted file mode 100644 index e2ca060ac..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_71.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['querycache',['Querycache',['../classQuerycache.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_73.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_73.html deleted file mode 100644 index a1bf0b912..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_73.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_73.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_73.js deleted file mode 100644 index 8941e45df..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_73.js +++ /dev/null @@ -1,5 +0,0 @@ -var searchData= -[ - ['support_5fgroup',['Support_Group',['../classSupport__Group.html',1,'']]], - ['sync',['Sync',['../classSync.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_74.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_74.html deleted file mode 100644 index f7f27cea7..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_74.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_74.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_74.js deleted file mode 100644 index 90ec7727d..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_74.js +++ /dev/null @@ -1,12 +0,0 @@ -var searchData= -[ - ['ticket',['Ticket',['../classTicket.html',1,'']]], - ['ticket_5fcategory',['Ticket_Category',['../classTicket__Category.html',1,'']]], - ['ticket_5fcontent',['Ticket_Content',['../classTicket__Content.html',1,'']]], - ['ticket_5finfo',['Ticket_Info',['../classTicket__Info.html',1,'']]], - ['ticket_5flog',['Ticket_Log',['../classTicket__Log.html',1,'']]], - ['ticket_5fqueue',['Ticket_Queue',['../classTicket__Queue.html',1,'']]], - ['ticket_5fqueue_5fhandler',['Ticket_Queue_Handler',['../classTicket__Queue__Handler.html',1,'']]], - ['ticket_5freply',['Ticket_Reply',['../classTicket__Reply.html',1,'']]], - ['ticket_5fuser',['Ticket_User',['../classTicket__User.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_75.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_75.html deleted file mode 100644 index 807d7426e..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_75.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_75.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_75.js deleted file mode 100644 index 432c5d270..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_75.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['users',['Users',['../classUsers.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_77.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_77.html deleted file mode 100644 index e3967e972..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_77.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_77.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_77.js deleted file mode 100644 index 0e579ee3d..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/classes_77.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['webusers',['WebUsers',['../classWebUsers.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/close.png b/code/ryzom/tools/server/ryzom_ams_docs/html/search/close.png deleted file mode 100644 index 9342d3dfe..000000000 Binary files a/code/ryzom/tools/server/ryzom_ams_docs/html/search/close.png and /dev/null differ diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_61.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_61.html deleted file mode 100644 index 5a8e45499..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_61.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_61.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_61.js deleted file mode 100644 index db9b27c9e..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_61.js +++ /dev/null @@ -1,7 +0,0 @@ -var searchData= -[ - ['add_5fsgroup_2ephp',['add_sgroup.php',['../add__sgroup_8php.html',1,'']]], - ['add_5fuser_2ephp',['add_user.php',['../add__user_8php.html',1,'']]], - ['add_5fuser_5fto_5fsgroup_2ephp',['add_user_to_sgroup.php',['../add__user__to__sgroup_8php.html',1,'']]], - ['assigned_2ephp',['assigned.php',['../assigned_8php.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_63.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_63.html deleted file mode 100644 index 6611a5b91..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_63.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_63.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_63.js deleted file mode 100644 index 47c38c050..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_63.js +++ /dev/null @@ -1,12 +0,0 @@ -var searchData= -[ - ['change_5finfo_2ephp',['change_info.php',['../change__info_8php.html',1,'']]], - ['change_5fmail_2ephp',['change_mail.php',['../change__mail_8php.html',1,'']]], - ['change_5fpassword_2ephp',['change_password.php',['../change__password_8php.html',1,'']]], - ['change_5fpermission_2ephp',['change_permission.php',['../change__permission_8php.html',1,'']]], - ['change_5freceivemail_2ephp',['change_receivemail.php',['../change__receivemail_8php.html',1,'']]], - ['config_2ephp',['config.php',['../www_2config_8php.html',1,'']]], - ['config_2ephp',['config.php',['../drupal__module_2ryzommanage_2config_8php.html',1,'']]], - ['create_5fticket_2ephp',['create_ticket.php',['../create__ticket_8php.html',1,'']]], - ['createticket_2ephp',['createticket.php',['../createticket_8php.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_64.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_64.html deleted file mode 100644 index 1a32bf882..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_64.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_64.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_64.js deleted file mode 100644 index 8307e204b..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_64.js +++ /dev/null @@ -1,5 +0,0 @@ -var searchData= -[ - ['dashboard_2ephp',['dashboard.php',['../dashboard_8php.html',1,'']]], - ['dblayer_2ephp',['dblayer.php',['../dblayer_8php.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_65.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_65.html deleted file mode 100644 index 1eadd1b02..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_65.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_65.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_65.js deleted file mode 100644 index ec7451ee2..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_65.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['error_2ephp',['error.php',['../error_8php.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_66.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_66.html deleted file mode 100644 index c05640363..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_66.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_66.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_66.js deleted file mode 100644 index ab77df41b..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_66.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['forwarded_2ephp',['forwarded.php',['../forwarded_8php.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_67.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_67.html deleted file mode 100644 index d5df283f3..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_67.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_67.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_67.js deleted file mode 100644 index e6e52c243..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_67.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['gui_5felements_2ephp',['gui_elements.php',['../gui__elements_8php.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_68.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_68.html deleted file mode 100644 index 8ead5893f..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_68.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_68.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_68.js deleted file mode 100644 index 05d1801f3..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_68.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['helpers_2ephp',['helpers.php',['../helpers_8php.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_69.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_69.html deleted file mode 100644 index 7fbd757cd..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_69.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_69.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_69.js deleted file mode 100644 index 74065c1ec..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_69.js +++ /dev/null @@ -1,7 +0,0 @@ -var searchData= -[ - ['in_5fsupport_5fgroup_2ephp',['in_support_group.php',['../in__support__group_8php.html',1,'']]], - ['index_2ephp',['index.php',['../index_8php.html',1,'']]], - ['info_2ephp',['info.php',['../info_8php.html',1,'']]], - ['install_2ephp',['install.php',['../install_8php.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_6c.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_6c.html deleted file mode 100644 index 642a54585..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_6c.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_6c.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_6c.js deleted file mode 100644 index 3b8359fc2..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_6c.js +++ /dev/null @@ -1,8 +0,0 @@ -var searchData= -[ - ['libinclude_2ephp',['libinclude.php',['../libinclude_8php.html',1,'']]], - ['login_2ephp',['login.php',['../inc_2login_8php.html',1,'']]], - ['login_2ephp',['login.php',['../func_2login_8php.html',1,'']]], - ['logout_2ephp',['logout.php',['../www_2html_2inc_2logout_8php.html',1,'']]], - ['logout_2ephp',['logout.php',['../drupal__module_2ryzommanage_2inc_2logout_8php.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_6d.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_6d.html deleted file mode 100644 index d9d93006b..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_6d.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_6d.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_6d.js deleted file mode 100644 index b19770b9b..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_6d.js +++ /dev/null @@ -1,7 +0,0 @@ -var searchData= -[ - ['mail_5fcron_2ephp',['mail_cron.php',['../mail__cron_8php.html',1,'']]], - ['mail_5fhandler_2ephp',['mail_handler.php',['../mail__handler_8php.html',1,'']]], - ['modify_5femail_5fof_5fsgroup_2ephp',['modify_email_of_sgroup.php',['../modify__email__of__sgroup_8php.html',1,'']]], - ['mycrypt_2ephp',['mycrypt.php',['../mycrypt_8php.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_70.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_70.html deleted file mode 100644 index abcae9a6f..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_70.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_70.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_70.js deleted file mode 100644 index f1c0593fa..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_70.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['pagination_2ephp',['pagination.php',['../pagination_8php.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_71.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_71.html deleted file mode 100644 index bb4ccc7cc..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_71.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_71.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_71.js deleted file mode 100644 index c2eeb72ca..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_71.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['querycache_2ephp',['querycache.php',['../querycache_8php.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_72.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_72.html deleted file mode 100644 index 609fb48fc..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_72.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_72.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_72.js deleted file mode 100644 index 721d27957..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_72.js +++ /dev/null @@ -1,5 +0,0 @@ -var searchData= -[ - ['register_2ephp',['register.php',['../register_8php.html',1,'']]], - ['reply_5fon_5fticket_2ephp',['reply_on_ticket.php',['../reply__on__ticket_8php.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_73.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_73.html deleted file mode 100644 index e0de9e6b5..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_73.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_73.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_73.js deleted file mode 100644 index 2ce5655bb..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_73.js +++ /dev/null @@ -1,18 +0,0 @@ -var searchData= -[ - ['settings_2ephp',['settings.php',['../drupal__module_2ryzommanage_2inc_2settings_8php.html',1,'']]], - ['settings_2ephp',['settings.php',['../www_2html_2inc_2settings_8php.html',1,'']]], - ['sgroup_5flist_2ephp',['sgroup_list.php',['../sgroup__list_8php.html',1,'']]], - ['show_5fqueue_2ephp',['show_queue.php',['../show__queue_8php.html',1,'']]], - ['show_5freply_2ephp',['show_reply.php',['../show__reply_8php.html',1,'']]], - ['show_5fsgroup_2ephp',['show_sgroup.php',['../show__sgroup_8php.html',1,'']]], - ['show_5fticket_2ephp',['show_ticket.php',['../show__ticket_8php.html',1,'']]], - ['show_5fticket_5finfo_2ephp',['show_ticket_info.php',['../show__ticket__info_8php.html',1,'']]], - ['show_5fticket_5flog_2ephp',['show_ticket_log.php',['../show__ticket__log_8php.html',1,'']]], - ['show_5fuser_2ephp',['show_user.php',['../www_2html_2inc_2show__user_8php.html',1,'']]], - ['show_5fuser_2ephp',['show_user.php',['../drupal__module_2ryzommanage_2inc_2show__user_8php.html',1,'']]], - ['support_5fgroup_2ephp',['support_group.php',['../support__group_8php.html',1,'']]], - ['sync_2ephp',['sync.php',['../sync_8php.html',1,'']]], - ['sync_5fcron_2ephp',['sync_cron.php',['../sync__cron_8php.html',1,'']]], - ['syncing_2ephp',['syncing.php',['../syncing_8php.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_74.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_74.html deleted file mode 100644 index 017b3fe9f..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_74.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_74.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_74.js deleted file mode 100644 index 47b5068e4..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_74.js +++ /dev/null @@ -1,12 +0,0 @@ -var searchData= -[ - ['ticket_2ephp',['ticket.php',['../ticket_8php.html',1,'']]], - ['ticket_5fcategory_2ephp',['ticket_category.php',['../ticket__category_8php.html',1,'']]], - ['ticket_5fcontent_2ephp',['ticket_content.php',['../ticket__content_8php.html',1,'']]], - ['ticket_5finfo_2ephp',['ticket_info.php',['../ticket__info_8php.html',1,'']]], - ['ticket_5flog_2ephp',['ticket_log.php',['../ticket__log_8php.html',1,'']]], - ['ticket_5fqueue_2ephp',['ticket_queue.php',['../ticket__queue_8php.html',1,'']]], - ['ticket_5fqueue_5fhandler_2ephp',['ticket_queue_handler.php',['../ticket__queue__handler_8php.html',1,'']]], - ['ticket_5freply_2ephp',['ticket_reply.php',['../ticket__reply_8php.html',1,'']]], - ['ticket_5fuser_2ephp',['ticket_user.php',['../ticket__user_8php.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_75.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_75.html deleted file mode 100644 index 8ea7b3d4b..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_75.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_75.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_75.js deleted file mode 100644 index 2d05f2341..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_75.js +++ /dev/null @@ -1,5 +0,0 @@ -var searchData= -[ - ['userlist_2ephp',['userlist.php',['../userlist_8php.html',1,'']]], - ['users_2ephp',['users.php',['../users_8php.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_77.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_77.html deleted file mode 100644 index 69f689782..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_77.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_77.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_77.js deleted file mode 100644 index 5c7ec501b..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/files_77.js +++ /dev/null @@ -1,5 +0,0 @@ -var searchData= -[ - ['webusers_2ephp',['webusers.php',['../drupal__module_2ryzommanage_2autoload_2webusers_8php.html',1,'']]], - ['webusers_2ephp',['webusers.php',['../www_2html_2autoload_2webusers_8php.html',1,'']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_5f.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_5f.html deleted file mode 100644 index cb54e927d..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_5f.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_5f.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_5f.js deleted file mode 100644 index 844048eb7..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_5f.js +++ /dev/null @@ -1,5 +0,0 @@ -var searchData= -[ - ['_5f_5fautoload',['__autoload',['../libinclude_8php.html#a2ecfde85f554ea0b3fef0993aef304a9',1,'libinclude.php']]], - ['_5f_5fconstruct',['__construct',['../classAssigned.html#a095c5d389db211932136b53f25f39685',1,'Assigned\__construct()'],['../classDBLayer.html#a800f8efee13692788b13ee57c5960092',1,'DBLayer\__construct()'],['../classForwarded.html#a095c5d389db211932136b53f25f39685',1,'Forwarded\__construct()'],['../classIn__Support__Group.html#a095c5d389db211932136b53f25f39685',1,'In_Support_Group\__construct()'],['../classMyCrypt.html#af200cbfd49bfea2fecf5629ab2361033',1,'MyCrypt\__construct()'],['../classPagination.html#a2a1aecb8f526796b3d62e8278edc07c3',1,'Pagination\__construct()'],['../classQuerycache.html#a095c5d389db211932136b53f25f39685',1,'Querycache\__construct()'],['../classSupport__Group.html#a095c5d389db211932136b53f25f39685',1,'Support_Group\__construct()'],['../classTicket.html#a095c5d389db211932136b53f25f39685',1,'Ticket\__construct()'],['../classTicket__Category.html#a095c5d389db211932136b53f25f39685',1,'Ticket_Category\__construct()'],['../classTicket__Content.html#a095c5d389db211932136b53f25f39685',1,'Ticket_Content\__construct()'],['../classTicket__Info.html#a095c5d389db211932136b53f25f39685',1,'Ticket_Info\__construct()'],['../classTicket__Log.html#a095c5d389db211932136b53f25f39685',1,'Ticket_Log\__construct()'],['../classTicket__Queue__Handler.html#a095c5d389db211932136b53f25f39685',1,'Ticket_Queue_Handler\__construct()'],['../classTicket__Reply.html#a095c5d389db211932136b53f25f39685',1,'Ticket_Reply\__construct()'],['../classTicket__User.html#a095c5d389db211932136b53f25f39685',1,'Ticket_User\__construct()'],['../classWebUsers.html#a4e63742e531873e01e1e97dd7530539b',1,'WebUsers\__construct($UId=0)'],['../classWebUsers.html#a4e63742e531873e01e1e97dd7530539b',1,'WebUsers\__construct($UId=0)']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_61.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_61.html deleted file mode 100644 index 7f395337e..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_61.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_61.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_61.js deleted file mode 100644 index 8bc0ff34b..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_61.js +++ /dev/null @@ -1,8 +0,0 @@ -var searchData= -[ - ['add_5fsgroup',['add_sgroup',['../add__sgroup_8php.html#a45490c056bdd114ef28893fc29286d2b',1,'add_sgroup.php']]], - ['add_5fuser',['add_user',['../add__user_8php.html#a69e8de25de7560db0292bb474882a489',1,'add_user.php']]], - ['add_5fuser_5fto_5fsgroup',['add_user_to_sgroup',['../add__user__to__sgroup_8php.html#a6ad0c5a1bfd563e11a107bf0023b6150',1,'add_user_to_sgroup.php']]], - ['addusertosupportgroup',['addUserToSupportGroup',['../classSupport__Group.html#a4616317379ffef08dbaeea2a9dbba02c',1,'Support_Group']]], - ['assignticket',['assignTicket',['../classAssigned.html#a51c3d5b6f78de455619581fd3e591f17',1,'Assigned\assignTicket()'],['../classTicket.html#a51c3d5b6f78de455619581fd3e591f17',1,'Ticket\assignTicket()']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_63.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_63.html deleted file mode 100644 index 9ebe11d69..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_63.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_63.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_63.js deleted file mode 100644 index dfdf9b93d..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_63.js +++ /dev/null @@ -1,42 +0,0 @@ -var searchData= -[ - ['change_5finfo',['change_info',['../change__info_8php.html#a1bbc74a7da07012d55b0b45726534265',1,'change_info.php']]], - ['change_5fmail',['change_mail',['../change__mail_8php.html#a03d0bca67a96c8744bd74623e128ab83',1,'change_mail.php']]], - ['change_5fpassword',['change_password',['../change__password_8php.html#a888360ab43db15eba1d5cc3623d4100f',1,'change_password.php']]], - ['change_5fpermission',['change_permission',['../classTicket__User.html#a78d4d6de74b1ee26cb9192f36e022416',1,'Ticket_User\change_permission()'],['../change__permission_8php.html#a9ad639fafd67bdc579cf3170cd0d26e7',1,'change_permission(): change_permission.php']]], - ['change_5freceivemail',['change_receivemail',['../change__receivemail_8php.html#a22ae748f60d7b4200dce30c94a52c421',1,'change_receivemail.php']]], - ['check_5fchange_5fpassword',['check_change_password',['../classUsers.html#a9c78408d50465957eeb8068810315a8e',1,'Users']]], - ['check_5fif_5fgame_5fclient',['check_if_game_client',['../classHelpers.html#a4e3e5309a66456d81a1effdabcc9cd79',1,'Helpers']]], - ['check_5flogin_5fingame',['check_login_ingame',['../classHelpers.html#abd01528a1145831a4fc98eae7ffaca36',1,'Helpers']]], - ['check_5fmethods',['check_methods',['../classMyCrypt.html#ad72fefc790b0bb1ac6edc252427b0970',1,'MyCrypt']]], - ['check_5fregister',['check_Register',['../classUsers.html#a740de04dc3aa7cf3bed959540ffab8f8',1,'Users']]], - ['checkemail',['checkEmail',['../classUsers.html#a76646237ab053cdde386c06aa5437d8a',1,'Users']]], - ['checkemailexists',['checkEmailExists',['../classUsers.html#a37275e677004927b6b1a30e16c5b5b38',1,'Users\checkEmailExists()'],['../classWebUsers.html#a37275e677004927b6b1a30e16c5b5b38',1,'WebUsers\checkEmailExists($email)'],['../classWebUsers.html#a37275e677004927b6b1a30e16c5b5b38',1,'WebUsers\checkEmailExists($email)']]], - ['checkloginmatch',['checkLoginMatch',['../classUsers.html#af0b98012abb190cf4617999f008de27e',1,'Users\checkLoginMatch()'],['../classWebUsers.html#a11894eb69bb2f172baf5186e8f92246d',1,'WebUsers\checkLoginMatch($username, $password)'],['../classWebUsers.html#a11894eb69bb2f172baf5186e8f92246d',1,'WebUsers\checkLoginMatch($username, $password)']]], - ['checkpassword',['checkPassword',['../classUsers.html#a4cb5e34b56fb6de0ec318fb59e90838f',1,'Users']]], - ['checkuser',['checkUser',['../classUsers.html#adfffce17947a9f72d68838db250c9ab8',1,'Users']]], - ['checkusernameexists',['checkUserNameExists',['../classUsers.html#ac3a8cb9a038f6aef0bd98be091274122',1,'Users\checkUserNameExists()'],['../classWebUsers.html#ac3a8cb9a038f6aef0bd98be091274122',1,'WebUsers\checkUserNameExists($username)'],['../classWebUsers.html#ac3a8cb9a038f6aef0bd98be091274122',1,'WebUsers\checkUserNameExists($username)']]], - ['confirmpassword',['confirmPassword',['../classUsers.html#a2f5349025bed3874f08d80652cab2fe0',1,'Users']]], - ['constr_5fexternid',['constr_ExternId',['../classTicket__User.html#a4e5c577ed0a9da4b1c56397912f02ba0',1,'Ticket_User']]], - ['constr_5fsgroupid',['constr_SGroupId',['../classSupport__Group.html#a873beb80bd0b5d572704cdb6d2ec34eb',1,'Support_Group']]], - ['constr_5ftcategoryid',['constr_TCategoryId',['../classTicket__Category.html#a332d2dd59b46fc933a3c9a1b2967803a',1,'Ticket_Category']]], - ['constr_5ftcontentid',['constr_TContentId',['../classTicket__Content.html#aa28ad9a063c1914ff75d19afd25c707f',1,'Ticket_Content']]], - ['constr_5ftlogid',['constr_TLogId',['../classTicket__Log.html#a001ec13f64bb026b1c8a3b3bd02ee22b',1,'Ticket_Log']]], - ['constr_5ftreplyid',['constr_TReplyId',['../classTicket__Reply.html#a4b4493d28e8518a87667d285c49e5e24',1,'Ticket_Reply']]], - ['constr_5ftuserid',['constr_TUserId',['../classTicket__User.html#a10939bce9b667f26d3827993b4e3df1d',1,'Ticket_User']]], - ['create',['create',['../classAssigned.html#a435e7d7525d4bcd0ed5e34a469f3adf6',1,'Assigned\create()'],['../classForwarded.html#a435e7d7525d4bcd0ed5e34a469f3adf6',1,'Forwarded\create()'],['../classIn__Support__Group.html#a435e7d7525d4bcd0ed5e34a469f3adf6',1,'In_Support_Group\create()'],['../classSupport__Group.html#a435e7d7525d4bcd0ed5e34a469f3adf6',1,'Support_Group\create()'],['../classTicket.html#a435e7d7525d4bcd0ed5e34a469f3adf6',1,'Ticket\create()'],['../classTicket__Content.html#a435e7d7525d4bcd0ed5e34a469f3adf6',1,'Ticket_Content\create()'],['../classTicket__Info.html#a435e7d7525d4bcd0ed5e34a469f3adf6',1,'Ticket_Info\create()'],['../classTicket__Reply.html#a435e7d7525d4bcd0ed5e34a469f3adf6',1,'Ticket_Reply\create()']]], - ['create_5ffolders',['create_folders',['../classHelpers.html#add8ef9ce82106c505f6f04c2a8e3b2b4',1,'Helpers']]], - ['create_5fticket',['create_Ticket',['../classTicket.html#a81b3285033bc3c9e89adfa8da34d61de',1,'Ticket\create_Ticket()'],['../create__ticket_8php.html#a65bcbfccf737c72927d15c06783cd9f4',1,'create_ticket(): create_ticket.php']]], - ['create_5fticket_5finfo',['create_Ticket_Info',['../classTicket__Info.html#aaa4e26c92338b70e874135af9c02bba9',1,'Ticket_Info']]], - ['createlogentry',['createLogEntry',['../classTicket__Log.html#a345a2da9c23780c7e6aef7134baa1749',1,'Ticket_Log']]], - ['createpermissions',['createPermissions',['../classUsers.html#aeac9f32fd53c97c92e5c774e154399df',1,'Users']]], - ['createqueue',['createQueue',['../classTicket__Queue.html#af077496b6071af47c19a873bf025c1f3',1,'Ticket_Queue\createQueue()'],['../classTicket__Queue__Handler.html#af077496b6071af47c19a873bf025c1f3',1,'Ticket_Queue_Handler\createQueue()']]], - ['createreply',['createReply',['../classTicket.html#af6568341f5052034440f79c0e74707a3',1,'Ticket\createReply()'],['../classTicket__Reply.html#aa6fa056fff4ddafc3eabf3ed72143e1b',1,'Ticket_Reply\createReply()']]], - ['createsupportgroup',['createSupportGroup',['../classSupport__Group.html#a31ee7c68c0ffb77438bb9ff095962568',1,'Support_Group']]], - ['createticket',['createticket',['../createticket_8php.html#aa8253d883a3ba14c6449a13ed2bb9c8f',1,'createticket.php']]], - ['createticketcategory',['createTicketCategory',['../classTicket__Category.html#a506fc7f32de9547e91a5dbb68c391907',1,'Ticket_Category']]], - ['createticketuser',['createTicketUser',['../classTicket__User.html#a37c416f7d3723874f3ac49c7f9f5a21c',1,'Ticket_User']]], - ['createuser',['createUser',['../classUsers.html#ac93aebf1960fb12975b120a2c394a8af',1,'Users']]], - ['createwebuser',['createWebuser',['../classWebUsers.html#a0cb7168a6b8358106512804ff28cea17',1,'WebUsers\createWebuser($name, $pass, $mail)'],['../classWebUsers.html#a0cb7168a6b8358106512804ff28cea17',1,'WebUsers\createWebuser($name, $pass, $mail)']]], - ['cron',['cron',['../classMail__Handler.html#a1b65890aa4eb8c0c6129c3e787a53405',1,'Mail_Handler']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_64.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_64.html deleted file mode 100644 index d8b63943c..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_64.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_64.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_64.js deleted file mode 100644 index da5e1ad06..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_64.js +++ /dev/null @@ -1,9 +0,0 @@ -var searchData= -[ - ['dashboard',['dashboard',['../dashboard_8php.html#a54d0c80ff20df9df6439bb87608c375a',1,'dashboard.php']]], - ['decode_5futf8',['decode_utf8',['../classMail__Handler.html#a6fc5947eaa45b0724f8720b374481275',1,'Mail_Handler']]], - ['decrypt',['decrypt',['../classMyCrypt.html#aed69cdc691e1155856c905ee1c08d9b7',1,'MyCrypt']]], - ['delete',['delete',['../classAssigned.html#a13bdffdd926f26b825ea57066334ff01',1,'Assigned\delete()'],['../classForwarded.html#a13bdffdd926f26b825ea57066334ff01',1,'Forwarded\delete()'],['../classIn__Support__Group.html#a13bdffdd926f26b825ea57066334ff01',1,'In_Support_Group\delete()'],['../classSupport__Group.html#a13bdffdd926f26b825ea57066334ff01',1,'Support_Group\delete()']]], - ['deletesupportgroup',['deleteSupportGroup',['../classSupport__Group.html#ab4a7d3ba86333a058027c7d58b9137f1',1,'Support_Group']]], - ['deleteuserofsupportgroup',['deleteUserOfSupportGroup',['../classSupport__Group.html#ad2d1a010903640e39545085b93b9a4f1',1,'Support_Group']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_65.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_65.html deleted file mode 100644 index a77debae0..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_65.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_65.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_65.js deleted file mode 100644 index 348a0bc5f..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_65.js +++ /dev/null @@ -1,8 +0,0 @@ -var searchData= -[ - ['encrypt',['encrypt',['../classMyCrypt.html#a07bcc8ef1d23370470ecb5ae8fc07dfa',1,'MyCrypt']]], - ['error',['error',['../error_8php.html#a43b8d30b879d4f09ceb059b02af2bc02',1,'error.php']]], - ['execute',['execute',['../classDBLayer.html#a9a0e3ecb193fecd94263eda79c54bcc4',1,'DBLayer']]], - ['executereturnid',['executeReturnId',['../classDBLayer.html#a9a8137347ec2d551de3ec54cfb3bdb1a',1,'DBLayer']]], - ['executewithoutparams',['executeWithoutParams',['../classDBLayer.html#a33552c5325c469ac1aa0d049d2312468',1,'DBLayer']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_66.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_66.html deleted file mode 100644 index 319a5316a..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_66.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_66.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_66.js deleted file mode 100644 index 608fb4187..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_66.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['forwardticket',['forwardTicket',['../classForwarded.html#aa6f01e425a0f845ce55c2d90aeb11db0',1,'Forwarded\forwardTicket()'],['../classTicket.html#a3fdc6def6a0feaf4c2458811b8c75050',1,'Ticket\forwardTicket()']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_67.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_67.html deleted file mode 100644 index d0ab42a3f..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_67.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_67.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_67.js deleted file mode 100644 index 6f68d029b..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_67.js +++ /dev/null @@ -1,106 +0,0 @@ -var searchData= -[ - ['generatesalt',['generateSALT',['../classUsers.html#afb7603ac9556c1069fbf1c0062251203',1,'Users']]], - ['get_5femail_5fby_5fuser_5fid',['get_email_by_user_id',['../classTicket__User.html#a7274bc305ccce731091c68d1607cb6e9',1,'Ticket_User']]], - ['get_5fid_5ffrom_5femail',['get_id_from_email',['../classTicket__User.html#a7feeb7a909bf6733de21300d0ea0e1bd',1,'Ticket_User']]], - ['get_5fid_5ffrom_5fusername',['get_id_from_username',['../classTicket__User.html#a0bcfa281f41b948eb42dd18992724543',1,'Ticket_User']]], - ['get_5fmime_5ftype',['get_mime_type',['../classMail__Handler.html#a719c5051ef00fbb0d7c7ce2c78e3b4e1',1,'Mail_Handler']]], - ['get_5fpart',['get_part',['../classMail__Handler.html#ab3a5e8f69692826c6dae96f873859642',1,'Mail_Handler']]], - ['get_5fticket_5fid_5ffrom_5fsubject',['get_ticket_id_from_subject',['../classMail__Handler.html#a8604569b1e012ea3b1fe466018f75ce2',1,'Mail_Handler']]], - ['get_5fusername_5ffrom_5fid',['get_username_from_id',['../classTicket__User.html#a266ff1e60e08dcd8c7e70f22f5a33e93',1,'Ticket_User']]], - ['getaction',['getAction',['../classTicket__Log.html#a189a4abe5faf11f4320d5d3f1d3d1715',1,'Ticket_Log']]], - ['getactiontextarray',['getActionTextArray',['../classTicket__Log.html#ac760071c0ce36337c16d8146fcb3bade',1,'Ticket_Log']]], - ['getallcategories',['getAllCategories',['../classTicket__Category.html#a1e4b8ecfd737337e35976126b521499f',1,'Ticket_Category']]], - ['getalllogs',['getAllLogs',['../classTicket__Log.html#aeaf1c995cc807afe241f6e7bdc684921',1,'Ticket_Log']]], - ['getallsupportgroups',['getAllSupportGroups',['../classSupport__Group.html#ad3fc18cb894f789d19a768ea63d9b673',1,'Support_Group']]], - ['getallusersofsupportgroup',['getAllUsersOfSupportGroup',['../classSupport__Group.html#a7f1662394a31e2a05e9863def178df12',1,'Support_Group']]], - ['getallusersquery',['getAllUsersQuery',['../classWebUsers.html#a2f8e928ed02e462b40e909965250fb7d',1,'WebUsers\getAllUsersQuery()'],['../classWebUsers.html#a2f8e928ed02e462b40e909965250fb7d',1,'WebUsers\getAllUsersQuery()']]], - ['getamountofrows',['getAmountOfRows',['../classPagination.html#ae43f78382809e3cd2aaa3c455cb0b2b4',1,'Pagination']]], - ['getargument',['getArgument',['../classTicket__Log.html#a88ec9370bcbdb60301f89e401c9e64e1',1,'Ticket_Log']]], - ['getassigned',['getAssigned',['../classTicket.html#a8234a4e23319778d234b3957f8b5d06c',1,'Ticket']]], - ['getauthor',['getAuthor',['../classTicket.html#a5286e30390ae3e1b274940286493dd24',1,'Ticket\getAuthor()'],['../classTicket__Log.html#a5286e30390ae3e1b274940286493dd24',1,'Ticket_Log\getAuthor()'],['../classTicket__Reply.html#a5286e30390ae3e1b274940286493dd24',1,'Ticket_Reply\getAuthor()']]], - ['getcategoryname',['getCategoryName',['../classTicket.html#a689e9d131777e7f1219ee0d65b088cb3',1,'Ticket']]], - ['getclient_5fversion',['getClient_Version',['../classTicket__Info.html#a5a9884f9f9b63d4a6ed8c6112704277d',1,'Ticket_Info']]], - ['getconnect_5fstate',['getConnect_State',['../classTicket__Info.html#a51a5247b7c82f60479ccdcfa33041c27',1,'Ticket_Info']]], - ['getcontent',['getContent',['../classTicket__Content.html#a58e43f09a06ce4e29b192c4e17ce7915',1,'Ticket_Content\getContent()'],['../classTicket__Reply.html#a58e43f09a06ce4e29b192c4e17ce7915',1,'Ticket_Reply\getContent()']]], - ['getcountryarray',['getCountryArray',['../drupal__module_2ryzommanage_2inc_2settings_8php.html#a9342547984d3c9a5ece41572951f8edf',1,'getCountryArray(): settings.php'],['../www_2html_2inc_2settings_8php.html#a9342547984d3c9a5ece41572951f8edf',1,'getCountryArray(): settings.php']]], - ['getcpu_5fmask',['getCPU_Mask',['../classTicket__Info.html#ae85e54574e6e0b17cd33b8c49255d228',1,'Ticket_Info']]], - ['getcpuid',['getCPUId',['../classTicket__Info.html#aba21caccb000efb673b8b66ca70a36c7',1,'Ticket_Info']]], - ['getcurrent',['getCurrent',['../classPagination.html#ad926899d7cac34a3f1a90e552d8eb27d',1,'Pagination']]], - ['getdb',['getDb',['../classQuerycache.html#aceb656ee5135578ab3a9947252caa772',1,'Querycache']]], - ['getelements',['getElements',['../classPagination.html#a97a3a3e912139aa222a7ca13fdb27d33',1,'Pagination']]], - ['getemail',['getEmail',['../classWebUsers.html#a02a01849f28e2535e888ae4ec87b20f2',1,'WebUsers\getEmail()'],['../classWebUsers.html#a02a01849f28e2535e888ae4ec87b20f2',1,'WebUsers\getEmail()']]], - ['getentireticket',['getEntireTicket',['../classTicket.html#a00572e06f01ae1cadb5949f1b45e8f04',1,'Ticket']]], - ['getexternid',['getExternId',['../classTicket__User.html#ace230deb485c9f115f7fea4ce92442a3',1,'Ticket_User']]], - ['getforwardedgroupid',['getForwardedGroupId',['../classTicket.html#aedbfa4efd5aaa96ac713817d12156f7e',1,'Ticket']]], - ['getforwardedgroupname',['getForwardedGroupName',['../classTicket.html#a34e17d1cc053a7b86ce2b58a3a347c7e',1,'Ticket']]], - ['getgroup',['getGroup',['../classForwarded.html#a4f44e7bc9de772c21b4304d11e87bf16',1,'Forwarded\getGroup()'],['../classIn__Support__Group.html#a4f44e7bc9de772c21b4304d11e87bf16',1,'In_Support_Group\getGroup()'],['../classSupport__Group.html#af6697615443145a2981e62aa741c3afa',1,'Support_Group\getGroup()']]], - ['getgroupemail',['getGroupEmail',['../classSupport__Group.html#a9d0f36a53db49c1f57e3cab8a61a7d90',1,'Support_Group']]], - ['getgroups',['getGroups',['../classSupport__Group.html#a562142b89699a1063ea9769030250365',1,'Support_Group']]], - ['gethidden',['getHidden',['../classTicket__Reply.html#a1d032efbce2b4edb7c269a1e13562f40',1,'Ticket_Reply']]], - ['getht',['getHT',['../classTicket__Info.html#a90d3c0edc1e767875c7fb98880886e73',1,'Ticket_Info']]], - ['getid',['getId',['../classWebUsers.html#a585ef354b38d0fad9d92f45e183b639f',1,'WebUsers\getId($username)'],['../classWebUsers.html#a585ef354b38d0fad9d92f45e183b639f',1,'WebUsers\getId($username)']]], - ['getidfromemail',['getIdFromEmail',['../classWebUsers.html#aee8d6b322defc5dfe8e47f382becca62',1,'WebUsers\getIdFromEmail($email)'],['../classWebUsers.html#aee8d6b322defc5dfe8e47f382becca62',1,'WebUsers\getIdFromEmail($email)']]], - ['getimap_5fmailserver',['getIMAP_MailServer',['../classSupport__Group.html#a30d67354e52f95489b93923440ff0661',1,'Support_Group']]], - ['getimap_5fpassword',['getIMAP_Password',['../classSupport__Group.html#a4983db184794db8f05ce93f5ba11ba7e',1,'Support_Group']]], - ['getimap_5fusername',['getIMAP_Username',['../classSupport__Group.html#a0ace9f66f2541d29e060cb7728030e93',1,'Support_Group']]], - ['getinfo',['getInfo',['../classWebUsers.html#a164026f74736817927e1cacd282a2e28',1,'WebUsers\getInfo()'],['../classWebUsers.html#a164026f74736817927e1cacd282a2e28',1,'WebUsers\getInfo()']]], - ['getlanguage',['getLanguage',['../classWebUsers.html#afcef2403c4111bc44ef0530f1e493909',1,'WebUsers\getLanguage()'],['../classWebUsers.html#afcef2403c4111bc44ef0530f1e493909',1,'WebUsers\getLanguage()']]], - ['getlast',['getLast',['../classPagination.html#a9316ede6960667d832997c8e20223623',1,'Pagination']]], - ['getlatestreply',['getLatestReply',['../classTicket.html#a3a4ce7e9c445dd245b3370304d0afd92',1,'Ticket']]], - ['getlinks',['getLinks',['../classPagination.html#aeecf550e63b55ecd5d737ecc46e07d3a',1,'Pagination']]], - ['getlocal_5faddress',['getLocal_Address',['../classTicket__Info.html#a49b4c851eff2f3d06531a39baa8423f5',1,'Ticket_Info']]], - ['getlogsofticket',['getLogsOfTicket',['../classTicket__Log.html#a37ad4d95b0bb2d5a6dfc2dd7c3744292',1,'Ticket_Log']]], - ['getmemory',['getMemory',['../classTicket__Info.html#a144248575cd034a40315155a9b48ff87',1,'Ticket_Info']]], - ['getmodsandadmins',['getModsAndAdmins',['../classTicket__User.html#a71099747902fb7e064ec1d4128ea4576',1,'Ticket_User']]], - ['getname',['getName',['../classSupport__Group.html#a3d0963e68bb313b163a73f2803c64600',1,'Support_Group\getName()'],['../classTicket__Category.html#a3d0963e68bb313b163a73f2803c64600',1,'Ticket_Category\getName()']]], - ['getnel3d',['getNel3D',['../classTicket__Info.html#abe3ae528bfd5495720c3adeff59fe11e',1,'Ticket_Info']]], - ['getnewestticket',['getNewestTicket',['../classTicket__Queue__Handler.html#ab5a79318a0c771083f03400093b3b2ec',1,'Ticket_Queue_Handler']]], - ['getnroftickets',['getNrOfTickets',['../classTicket__Queue__Handler.html#ada8f87ed8466c5e0477fa20359c3c8ad',1,'Ticket_Queue_Handler']]], - ['getnrofticketsassignedwaiting',['getNrOfTicketsAssignedWaiting',['../classTicket__Queue__Handler.html#a0d3daaaf5c79188eb62bb3adda11fa2a',1,'Ticket_Queue_Handler']]], - ['getnrofticketstodo',['getNrOfTicketsToDo',['../classTicket__Queue__Handler.html#ae8d1a2a66991583c05c173147e8dc657',1,'Ticket_Queue_Handler']]], - ['getos',['getOS',['../classTicket__Info.html#a9a1b88474ad97701d67a752d0c4d65c5',1,'Ticket_Info']]], - ['getpagination',['getPagination',['../classTicket__Queue__Handler.html#ab45a102a508e9727b108e8f24486c464',1,'Ticket_Queue_Handler']]], - ['getparams',['getParams',['../classTicket__Queue.html#ae32cd7c32721b02d676bb63b4b1366db',1,'Ticket_Queue']]], - ['getpatch_5fversion',['getPatch_Version',['../classTicket__Info.html#a6e41e115b03a1f152bd2c28c77d5fbac',1,'Ticket_Info']]], - ['getpermission',['getPermission',['../classTicket__User.html#a478067ecf173884c2ee3e5b94e746200',1,'Ticket_User']]], - ['getpriority',['getPriority',['../classTicket.html#a1e7a3c168dcd0901a0d2669c67575b55',1,'Ticket']]], - ['getpriorityarray',['getPriorityArray',['../classTicket.html#a509625cccc0b41f4ab3a658df705b3dc',1,'Ticket']]], - ['getprioritytext',['getPriorityText',['../classTicket.html#ae07f7808a12f2789593722f3293bd105',1,'Ticket']]], - ['getprocessor',['getProcessor',['../classTicket__Info.html#a3ace868ad456ff61f545cb44ee01c562',1,'Ticket_Info']]], - ['getquery',['getQuery',['../classQuerycache.html#a55f162785567258fe5138af282e588c2',1,'Querycache\getQuery()'],['../classTicket__Log.html#a55f162785567258fe5138af282e588c2',1,'Ticket_Log\getQuery()'],['../classTicket__Queue.html#a55f162785567258fe5138af282e588c2',1,'Ticket_Queue\getQuery()']]], - ['getqueue',['getQueue',['../classTicket.html#aa7a8055e5ee1eb792f29443ddb79c4d3',1,'Ticket']]], - ['getreceivemail',['getReceiveMail',['../classWebUsers.html#ae4680f622bd8d571530615fb616d37e7',1,'WebUsers\getReceiveMail()'],['../classWebUsers.html#ae4680f622bd8d571530615fb616d37e7',1,'WebUsers\getReceiveMail()']]], - ['getrepliesofticket',['getRepliesOfTicket',['../classTicket__Reply.html#a7e80a6437bb6ee90be42a32f3a82fe76',1,'Ticket_Reply']]], - ['getserver_5ftick',['getServer_Tick',['../classTicket__Info.html#a5a5799e4e54d3fa4858716b4464710c0',1,'Ticket_Info']]], - ['getsgroupid',['getSGroupId',['../classSupport__Group.html#a77d0961efe9609ebb268f8672e71bba4',1,'Support_Group']]], - ['getsgroupofticket',['getSGroupOfTicket',['../classForwarded.html#a4de002d45322cf62ce493f49933d33bd',1,'Forwarded']]], - ['getshardid',['getShardId',['../classTicket__Info.html#a36306b5367015050fb516fcaaff8351f',1,'Ticket_Info']]], - ['getsid',['getSID',['../classQuerycache.html#a5bac91964d19751986cccad6fad28dda',1,'Querycache']]], - ['getstatus',['getStatus',['../classTicket.html#a9d21636071f529e2154051d3ea6e5921',1,'Ticket']]], - ['getstatusarray',['getStatusArray',['../classTicket.html#aa728c6a1f8ddd7030acbf5a4ca913b50',1,'Ticket']]], - ['getstatustext',['getStatusText',['../classTicket.html#aab26af198dc3a59295747084b85435ff',1,'Ticket']]], - ['gettag',['getTag',['../classSupport__Group.html#ab86ba36154b20e6bbfa3ba705f12f9d6',1,'Support_Group']]], - ['gettcategoryid',['getTCategoryId',['../classTicket__Category.html#acb530a119e5e52230a92ece95cc7ec82',1,'Ticket_Category']]], - ['gettcontentid',['getTContentId',['../classTicket__Content.html#a9245dceab917ad08e5244c9395b347ae',1,'Ticket_Content']]], - ['getticket',['getTicket',['../classAssigned.html#a42ddf34a72af750b7013fa309b67e46c',1,'Assigned\getTicket()'],['../classForwarded.html#a42ddf34a72af750b7013fa309b67e46c',1,'Forwarded\getTicket()'],['../classTicket__Info.html#a42ddf34a72af750b7013fa309b67e46c',1,'Ticket_Info\getTicket()'],['../classTicket__Log.html#a42ddf34a72af750b7013fa309b67e46c',1,'Ticket_Log\getTicket()'],['../classTicket__Reply.html#a42ddf34a72af750b7013fa309b67e46c',1,'Ticket_Reply\getTicket()']]], - ['getticket_5fcategory',['getTicket_Category',['../classTicket.html#addff2fc457fe07664f4eb39efcea45f9',1,'Ticket']]], - ['gettickets',['getTickets',['../classTicket__Queue__Handler.html#a45e8c11ba9485041fa92c7c470a8f9f9',1,'Ticket_Queue_Handler']]], - ['getticketsof',['getTicketsOf',['../classTicket.html#aa426904463cd0eb50d9b2f4becdd242f',1,'Ticket']]], - ['gettid',['getTId',['../classTicket.html#aa7af74696d9898008992c494cec136dd',1,'Ticket']]], - ['gettimestamp',['getTimestamp',['../classTicket.html#a92aa1d82129ec8cd803d64c28efcb30f',1,'Ticket\getTimestamp()'],['../classTicket__Log.html#a92aa1d82129ec8cd803d64c28efcb30f',1,'Ticket_Log\getTimestamp()'],['../classTicket__Reply.html#a92aa1d82129ec8cd803d64c28efcb30f',1,'Ticket_Reply\getTimestamp()']]], - ['gettinfoid',['getTInfoId',['../classTicket__Info.html#ad7c7ccc1926763c252d32d1fee5a7f69',1,'Ticket_Info']]], - ['gettitle',['getTitle',['../classTicket.html#a95e859a4588a39a1824b717378a84c29',1,'Ticket']]], - ['gettlogid',['getTLogId',['../classTicket__Log.html#ab174d340ee116d8cc3aa377003421fc5',1,'Ticket_Log']]], - ['gettreplyid',['getTReplyId',['../classTicket__Reply.html#ade0c35755c1a1af8fa4c9bae8b4c51f1',1,'Ticket_Reply']]], - ['gettuserid',['getTUserId',['../classTicket__User.html#a4a31c27c61f9794200b647bf810461f5',1,'Ticket_User']]], - ['gettype',['getType',['../classQuerycache.html#a830b5c75df72b32396701bc563fbe3c7',1,'Querycache']]], - ['getuid',['getUId',['../classWebUsers.html#aa36a98da4146d85e7813e99df7d97497',1,'WebUsers\getUId()'],['../classWebUsers.html#aa36a98da4146d85e7813e99df7d97497',1,'WebUsers\getUId()']]], - ['getuser',['getUser',['../classAssigned.html#ae81b7186fb97a7c6457edcc68c9aa2ef',1,'Assigned\getUser()'],['../classIn__Support__Group.html#ae81b7186fb97a7c6457edcc68c9aa2ef',1,'In_Support_Group\getUser()']]], - ['getuser_5fid',['getUser_Id',['../classTicket__Info.html#a9c2fe31c14609e2255773d5a4dd154d8',1,'Ticket_Info']]], - ['getuser_5fposition',['getUser_Position',['../classTicket__Info.html#a3f5a46d846543219d6321d2f8751d1f0',1,'Ticket_Info']]], - ['getuserassignedtoticket',['getUserAssignedToTicket',['../classAssigned.html#afcfb156712a9477a97423a49238d13c5',1,'Assigned']]], - ['getusername',['getUsername',['../classWebUsers.html#a81b37a3c9d639574e394f80c1138c75e',1,'WebUsers\getUsername()'],['../classWebUsers.html#a81b37a3c9d639574e394f80c1138c75e',1,'WebUsers\getUsername()']]], - ['getusers',['getUsers',['../classWebUsers.html#a0fc10b64683021b70c7eb95fb514c119',1,'WebUsers\getUsers()'],['../classWebUsers.html#a0fc10b64683021b70c7eb95fb514c119',1,'WebUsers\getUsers()']]], - ['getview_5fposition',['getView_Position',['../classTicket__Info.html#a525dbd26fc788c7c152f6c686a9a5d11',1,'Ticket_Info']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_68.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_68.html deleted file mode 100644 index 66b85be31..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_68.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_68.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_68.js deleted file mode 100644 index 68cc67ed7..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_68.js +++ /dev/null @@ -1,6 +0,0 @@ -var searchData= -[ - ['handle_5flanguage',['handle_language',['../classHelpers.html#a334920d0652c160c6145d3bd7be31a22',1,'Helpers']]], - ['hashiv',['hashIV',['../classMyCrypt.html#a1bdf94a5906655bf0965338c9d17ab27',1,'MyCrypt']]], - ['hasinfo',['hasInfo',['../classTicket.html#afca07df3cc25a0e1a15d3f69bd6afa62',1,'Ticket']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_69.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_69.html deleted file mode 100644 index e2041976c..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_69.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_69.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_69.js deleted file mode 100644 index e23cc85fc..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_69.js +++ /dev/null @@ -1,9 +0,0 @@ -var searchData= -[ - ['incoming_5fmail_5fhandler',['incoming_mail_handler',['../classMail__Handler.html#a2896dabadb8e435de7ba7bbb258f8a96',1,'Mail_Handler']]], - ['isadmin',['isAdmin',['../classTicket__User.html#ae8a7d91474cde916fced2127fab426d2',1,'Ticket_User']]], - ['isassigned',['isAssigned',['../classAssigned.html#ade127364a5e5635077119b7217b6059c',1,'Assigned']]], - ['isforwarded',['isForwarded',['../classForwarded.html#ac1fa2045188edf04b07c523e1c6f68a0',1,'Forwarded']]], - ['isloggedin',['isLoggedIn',['../classWebUsers.html#a33bdd79e5da367ebddd4cfbdbbfc7cff',1,'WebUsers\isLoggedIn()'],['../classWebUsers.html#a33bdd79e5da367ebddd4cfbdbbfc7cff',1,'WebUsers\isLoggedIn()']]], - ['ismod',['isMod',['../classTicket__User.html#a8d88cdbf205bf7d24be03157d25bb7d8',1,'Ticket_User']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_6c.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_6c.html deleted file mode 100644 index da371cfab..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_6c.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_6c.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_6c.js deleted file mode 100644 index 51fb577db..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_6c.js +++ /dev/null @@ -1,23 +0,0 @@ -var searchData= -[ - ['load',['load',['../classAssigned.html#a689011be59ec3d216ebe6852f07ab37f',1,'Assigned\load()'],['../classForwarded.html#a689011be59ec3d216ebe6852f07ab37f',1,'Forwarded\load()']]], - ['load_5fwith_5fsgroupid',['load_With_SGroupId',['../classSupport__Group.html#a6beae177f45da42a57b100b5481f49bf',1,'Support_Group']]], - ['load_5fwith_5fsid',['load_With_SID',['../classQuerycache.html#ae960510ccb242704233c38d787242f53',1,'Querycache']]], - ['load_5fwith_5ftcategoryid',['load_With_TCategoryId',['../classTicket__Category.html#ab3a70940917530d91a39536a6d45a21d',1,'Ticket_Category']]], - ['load_5fwith_5ftcontentid',['load_With_TContentId',['../classTicket__Content.html#ad8b1226537a055701bcc3fe4af87257b',1,'Ticket_Content']]], - ['load_5fwith_5fticket',['load_With_Ticket',['../classTicket__Info.html#afcf4006cdd19b05919b5df34d3345ad2',1,'Ticket_Info']]], - ['load_5fwith_5ftid',['load_With_TId',['../classTicket.html#ac17d9e1158fb77707da1f6cd3e425d54',1,'Ticket']]], - ['load_5fwith_5ftinfoid',['load_With_TInfoId',['../classTicket__Info.html#a1681685f76483b7944bf6848b29caa4a',1,'Ticket_Info']]], - ['load_5fwith_5ftlogid',['load_With_TLogId',['../classTicket__Log.html#a76e8e991002c7e408f7b182556cdeade',1,'Ticket_Log']]], - ['load_5fwith_5ftreplyid',['load_With_TReplyId',['../classTicket__Reply.html#ac9a387c63aad0b81a8161d2515f697d9',1,'Ticket_Reply']]], - ['load_5fwith_5ftuserid',['load_With_TUserId',['../classTicket__User.html#af43df1ba39e073e4b3a0120e6e4d3140',1,'Ticket_User']]], - ['loadallclosedtickets',['loadAllClosedTickets',['../classTicket__Queue.html#af2a9b20ac9dc0e1992f717abbb418be7',1,'Ticket_Queue']]], - ['loadallnotassignedtickets',['loadAllNotAssignedTickets',['../classTicket__Queue.html#a771627a0bd387cd666474a6ef0d5eaaf',1,'Ticket_Queue']]], - ['loadallopentickets',['loadAllOpenTickets',['../classTicket__Queue.html#a3a1cf8a88a3604e093f7d276050f1c49',1,'Ticket_Queue']]], - ['loadalltickets',['loadAllTickets',['../classTicket__Queue.html#a80542bde30a8a589f1d088422cb7719b',1,'Ticket_Queue']]], - ['loadassignedandwaiting',['loadAssignedandWaiting',['../classTicket__Queue.html#a348c76f7ae32437b7e91b57671d6f33d',1,'Ticket_Queue']]], - ['loadtemplate',['loadTemplate',['../classHelpers.html#a78997ab39ba0237dc7a5441b58601211',1,'Helpers']]], - ['loadtodotickets',['loadToDoTickets',['../classTicket__Queue.html#ad88848edf9a9132eb0cfcac904a8459f',1,'Ticket_Queue']]], - ['login',['login',['../func_2login_8php.html#aa311da27ba5706f5710cea7706c8eae1',1,'login(): login.php'],['../inc_2login_8php.html#aa311da27ba5706f5710cea7706c8eae1',1,'login(): login.php']]], - ['logout',['logout',['../drupal__module_2ryzommanage_2inc_2logout_8php.html#a082405d89acd6835c3a7c7a08a7adbab',1,'logout(): logout.php'],['../www_2html_2inc_2logout_8php.html#a082405d89acd6835c3a7c7a08a7adbab',1,'logout(): logout.php']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_6d.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_6d.html deleted file mode 100644 index d01ac5376..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_6d.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_6d.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_6d.js deleted file mode 100644 index 2f5fc5e1e..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_6d.js +++ /dev/null @@ -1,7 +0,0 @@ -var searchData= -[ - ['mail_5ffork',['mail_fork',['../classMail__Handler.html#ac6f9bcfab65cc93fdd4723284fff6b7a',1,'Mail_Handler']]], - ['make_5ftable',['make_table',['../classGui__Elements.html#a639930203d81ff01840ac90a51cbbfe7',1,'Gui_Elements']]], - ['make_5ftable_5fwith_5fkey_5fis_5fid',['make_table_with_key_is_id',['../classGui__Elements.html#ae3c8c19fce4cdd7d87d4ae759ab06f24',1,'Gui_Elements']]], - ['modify_5femail_5fof_5fsgroup',['modify_email_of_sgroup',['../modify__email__of__sgroup_8php.html#acb8c4a7ad3e36662d1d22ba56a98d0ab',1,'modify_email_of_sgroup.php']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_6e.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_6e.html deleted file mode 100644 index d734dd07e..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_6e.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_6e.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_6e.js deleted file mode 100644 index 0831ed960..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_6e.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['new_5fmessage_5fid',['new_message_id',['../classMail__Handler.html#a667ca75b6c659157d855c3d19978a436',1,'Mail_Handler']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_6f.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_6f.html deleted file mode 100644 index 222f0f836..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_6f.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_6f.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_6f.js deleted file mode 100644 index f8a8b3016..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_6f.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['outputtime',['outputTime',['../classHelpers.html#a4370c805a72fe32c03b178b03ad2e393',1,'Helpers']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_72.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_72.html deleted file mode 100644 index a4336f7c4..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_72.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_72.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_72.js deleted file mode 100644 index 857dcd26f..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_72.js +++ /dev/null @@ -1,5 +0,0 @@ -var searchData= -[ - ['register',['register',['../register_8php.html#acc294a6cc8e69743746820e3d15e3f78',1,'register.php']]], - ['reply_5fon_5fticket',['reply_on_ticket',['../reply__on__ticket_8php.html#a79f0a445c77e8e1e59eb9e72cbf39dba',1,'reply_on_ticket.php']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_73.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_73.html deleted file mode 100644 index 774d577f5..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_73.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_73.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_73.js deleted file mode 100644 index 50284d9b1..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_73.js +++ /dev/null @@ -1,73 +0,0 @@ -var searchData= -[ - ['send_5fmail',['send_mail',['../classMail__Handler.html#a50308ad0711aee080dacef7e3f574699',1,'Mail_Handler']]], - ['send_5fticketing_5fmail',['send_ticketing_mail',['../classMail__Handler.html#abe649044c8b8bd8eb05787a401865e6d',1,'Mail_Handler']]], - ['set',['set',['../classAssigned.html#a8bdfe0a5256e35367225bcd6d278ef21',1,'Assigned\set()'],['../classForwarded.html#a8bdfe0a5256e35367225bcd6d278ef21',1,'Forwarded\set()'],['../classIn__Support__Group.html#a8bdfe0a5256e35367225bcd6d278ef21',1,'In_Support_Group\set()'],['../classQuerycache.html#a8bdfe0a5256e35367225bcd6d278ef21',1,'Querycache\set()'],['../classSupport__Group.html#a8bdfe0a5256e35367225bcd6d278ef21',1,'Support_Group\set()'],['../classTicket.html#a8bdfe0a5256e35367225bcd6d278ef21',1,'Ticket\set()'],['../classTicket__Info.html#a8bdfe0a5256e35367225bcd6d278ef21',1,'Ticket_Info\set()'],['../classTicket__Log.html#a8bdfe0a5256e35367225bcd6d278ef21',1,'Ticket_Log\set()'],['../classTicket__Reply.html#a8bdfe0a5256e35367225bcd6d278ef21',1,'Ticket_Reply\set()'],['../classTicket__User.html#a8bdfe0a5256e35367225bcd6d278ef21',1,'Ticket_User\set()'],['../classWebUsers.html#a8bdfe0a5256e35367225bcd6d278ef21',1,'WebUsers\set($values)'],['../classWebUsers.html#a8bdfe0a5256e35367225bcd6d278ef21',1,'WebUsers\set($values)']]], - ['setamsemail',['setAmsEmail',['../classUsers.html#ad1cbb1fe6ee72f46dc385bec6e274363',1,'Users']]], - ['setamspassword',['setAmsPassword',['../classUsers.html#ab89812058b0a71baf492af4652d67501',1,'Users']]], - ['setauthor',['setAuthor',['../classTicket.html#a0c8f116992af7c8737c70119dae00d45',1,'Ticket\setAuthor()'],['../classTicket__Log.html#a0c8f116992af7c8737c70119dae00d45',1,'Ticket_Log\setAuthor()'],['../classTicket__Reply.html#a0c8f116992af7c8737c70119dae00d45',1,'Ticket_Reply\setAuthor()']]], - ['setclient_5fversion',['setClient_Version',['../classTicket__Info.html#af06e75f73ae40120cc371f6ddd9ab49c',1,'Ticket_Info']]], - ['setconnect_5fstate',['setConnect_State',['../classTicket__Info.html#a4de823fc3a051d3aac3d526badef313c',1,'Ticket_Info']]], - ['setcontent',['setContent',['../classTicket__Content.html#a76e94f05c5cc0044993a35492097df4d',1,'Ticket_Content\setContent()'],['../classTicket__Reply.html#a76e94f05c5cc0044993a35492097df4d',1,'Ticket_Reply\setContent()']]], - ['setcpu_5fmask',['setCPU_Mask',['../classTicket__Info.html#a5f19999ab39a2ac0b7d6f2ced9223ae6',1,'Ticket_Info']]], - ['setcpuid',['setCPUId',['../classTicket__Info.html#af1f04d3bdcbaf28b246eb94a484f397c',1,'Ticket_Info']]], - ['setdb',['setDb',['../classQuerycache.html#afa9c249972ca269a2b1a399ed2faf9b4',1,'Querycache']]], - ['setemail',['setEmail',['../classWebUsers.html#a0cd214763f395718db166fbd598689f4',1,'WebUsers\setEmail($user, $mail)'],['../classWebUsers.html#a0cd214763f395718db166fbd598689f4',1,'WebUsers\setEmail($user, $mail)']]], - ['setexternid',['setExternId',['../classTicket__User.html#ad38846bb954052a5293ae2d26cf810d2',1,'Ticket_User']]], - ['setgroup',['setGroup',['../classForwarded.html#a3116db27c2e2f33cbb10a9488db34da3',1,'Forwarded\setGroup()'],['../classIn__Support__Group.html#a3116db27c2e2f33cbb10a9488db34da3',1,'In_Support_Group\setGroup()']]], - ['setgroupemail',['setGroupEmail',['../classSupport__Group.html#abbb0e975fd21a42439970ebb3eba5fea',1,'Support_Group']]], - ['sethidden',['setHidden',['../classTicket__Reply.html#a0b67f1016974c7b153b8944a94c88045',1,'Ticket_Reply']]], - ['setht',['setHT',['../classTicket__Info.html#a9ef93ff2fede4bd9b1cb8da2129dee20',1,'Ticket_Info']]], - ['setimap_5fmailserver',['setIMAP_MailServer',['../classSupport__Group.html#a71f266f2bba1fc4fb6df4cf083988938',1,'Support_Group']]], - ['setimap_5fpassword',['setIMAP_Password',['../classSupport__Group.html#ad6fcb63d4ae129567e8bea8786a75d87',1,'Support_Group']]], - ['setimap_5fusername',['setIMAP_Username',['../classSupport__Group.html#a6856519261b543f27bc001616c2881eb',1,'Support_Group']]], - ['setlanguage',['setLanguage',['../classWebUsers.html#a5ab1bd5f0959a3c33a46c176d9412c80',1,'WebUsers\setLanguage($user, $language)'],['../classWebUsers.html#a5ab1bd5f0959a3c33a46c176d9412c80',1,'WebUsers\setLanguage($user, $language)']]], - ['setlocal_5faddress',['setLocal_Address',['../classTicket__Info.html#a144b42f39cea6b24624c6c547df6aeeb',1,'Ticket_Info']]], - ['setmemory',['setMemory',['../classTicket__Info.html#a6f6f6925a18d24d2ecd5166a325be609',1,'Ticket_Info']]], - ['setname',['setName',['../classSupport__Group.html#aa3dcc220094e19fef1f918a3a917dba7',1,'Support_Group\setName()'],['../classTicket__Category.html#aa3dcc220094e19fef1f918a3a917dba7',1,'Ticket_Category\setName()']]], - ['setnel3d',['setNel3D',['../classTicket__Info.html#a77fbf6da57aa02e075be0905dc6cdd48',1,'Ticket_Info']]], - ['setos',['setOS',['../classTicket__Info.html#aacb7cbb0f04959ae64ba1c3aac36df54',1,'Ticket_Info']]], - ['setpassword',['setPassword',['../classWebUsers.html#a91506e5f74c9884045e865ef7c314fed',1,'WebUsers\setPassword($user, $pass)'],['../classWebUsers.html#a91506e5f74c9884045e865ef7c314fed',1,'WebUsers\setPassword($user, $pass)']]], - ['setpatch_5fversion',['setPatch_Version',['../classTicket__Info.html#a1d0f55ed3b50a72bf882591474d2ff72',1,'Ticket_Info']]], - ['setpermission',['setPermission',['../classTicket__User.html#adf7c497fb026ee6e05f6ece91f541839',1,'Ticket_User']]], - ['setpriority',['setPriority',['../classTicket.html#a3080d0b46978a8f82022bbb6e5fc0c1c',1,'Ticket']]], - ['setprocessor',['setProcessor',['../classTicket__Info.html#a8b66f72ec1928b89058cd0a9b4dd8c11',1,'Ticket_Info']]], - ['setquery',['setQuery',['../classQuerycache.html#adbd6075ec5d3bd84122e52b0134ed8e7',1,'Querycache\setQuery()'],['../classTicket__Log.html#adbd6075ec5d3bd84122e52b0134ed8e7',1,'Ticket_Log\setQuery()']]], - ['setqueue',['setQueue',['../classTicket.html#a1595d3fe708fe4f453922054407a1c03',1,'Ticket']]], - ['setreceivemail',['setReceiveMail',['../classWebUsers.html#aa0f439ff7a5cd6377a557f545fbeb45c',1,'WebUsers\setReceiveMail($user, $receivemail)'],['../classWebUsers.html#aa0f439ff7a5cd6377a557f545fbeb45c',1,'WebUsers\setReceiveMail($user, $receivemail)']]], - ['setserver_5ftick',['setServer_Tick',['../classTicket__Info.html#ab6ff52082590b43d90f8f37fd5b31086',1,'Ticket_Info']]], - ['setsgroupid',['setSGroupId',['../classSupport__Group.html#aa49cb914be98fc354a45584c6f2b8be1',1,'Support_Group']]], - ['setshardid',['setShardId',['../classTicket__Info.html#a4026e593012113e253b80e3bbd5f6c13',1,'Ticket_Info']]], - ['setsid',['setSID',['../classQuerycache.html#a2f536a1f8c8e463eb0346ac375f2a24d',1,'Querycache']]], - ['setstatus',['setStatus',['../classTicket.html#a66605893c4afc9855f1e0cf8ccccac09',1,'Ticket']]], - ['settag',['setTag',['../classSupport__Group.html#a4de944a53debc51843530fe96296f220',1,'Support_Group']]], - ['settcategoryid',['setTCategoryId',['../classTicket__Category.html#a39a64c3f7ab33ba3f5a67c31647e889f',1,'Ticket_Category']]], - ['settcontentid',['setTContentId',['../classTicket__Content.html#ae07366727208e060372063e96591c5d4',1,'Ticket_Content']]], - ['setticket',['setTicket',['../classAssigned.html#a47c6ae5b3cd713fdbf0a7f4d568b7c27',1,'Assigned\setTicket()'],['../classForwarded.html#a47c6ae5b3cd713fdbf0a7f4d568b7c27',1,'Forwarded\setTicket()'],['../classTicket__Info.html#a47c6ae5b3cd713fdbf0a7f4d568b7c27',1,'Ticket_Info\setTicket()'],['../classTicket__Log.html#a47c6ae5b3cd713fdbf0a7f4d568b7c27',1,'Ticket_Log\setTicket()'],['../classTicket__Reply.html#a47c6ae5b3cd713fdbf0a7f4d568b7c27',1,'Ticket_Reply\setTicket()']]], - ['setticket_5fcategory',['setTicket_Category',['../classTicket.html#a4e38b2a263b5a934b76cd77f026308c3',1,'Ticket']]], - ['settid',['setTId',['../classTicket.html#a8c72dc7b09645b390043f5a4664e7c7f',1,'Ticket']]], - ['settimestamp',['setTimestamp',['../classTicket.html#a4e05995d5cc78cdc9ffe72d864811ac6',1,'Ticket\setTimestamp()'],['../classTicket__Log.html#aa8903a0020a17d745524806f4e751f4c',1,'Ticket_Log\setTimestamp()'],['../classTicket__Reply.html#aa8903a0020a17d745524806f4e751f4c',1,'Ticket_Reply\setTimestamp()']]], - ['settinfoid',['setTInfoId',['../classTicket__Info.html#a5e98fba0b50f74645a2fdaa8f4d0c1ea',1,'Ticket_Info']]], - ['settings',['settings',['../drupal__module_2ryzommanage_2inc_2settings_8php.html#ad7354383714c6ae99d6ee1bfb95ab49f',1,'settings(): settings.php'],['../www_2html_2inc_2settings_8php.html#ad7354383714c6ae99d6ee1bfb95ab49f',1,'settings(): settings.php']]], - ['settitle',['setTitle',['../classTicket.html#ac765da6fa83b06ea39c0edc9b3e6c6c0',1,'Ticket']]], - ['settlogid',['setTLogId',['../classTicket__Log.html#aca708aae8c7320e11d9e08936ec74dec',1,'Ticket_Log']]], - ['settreplyid',['setTReplyId',['../classTicket__Reply.html#a7b91b481de87eb1515212d62b298cb94',1,'Ticket_Reply']]], - ['settuserid',['setTUserId',['../classTicket__User.html#a0faf8954e86346e7b566870b1a3c0a4a',1,'Ticket_User']]], - ['settype',['setType',['../classQuerycache.html#a0f29af8d4b9fdd8959739727a33acee5',1,'Querycache']]], - ['setuser',['setUser',['../classAssigned.html#af560ca7f201e2f871384a150e8ffd9aa',1,'Assigned\setUser()'],['../classIn__Support__Group.html#af560ca7f201e2f871384a150e8ffd9aa',1,'In_Support_Group\setUser()']]], - ['setuser_5fid',['setUser_Id',['../classTicket__Info.html#aec77405f6e096f2c0493383724f33034',1,'Ticket_Info']]], - ['setuser_5fposition',['setUser_Position',['../classTicket__Info.html#a41cfb7786d3252b2ec7aec42d77add9f',1,'Ticket_Info']]], - ['setview_5fposition',['setView_Position',['../classTicket__Info.html#a58912ec04451ab232d88bd78b6a8c2ea',1,'Ticket_Info']]], - ['sgroup_5flist',['sgroup_list',['../sgroup__list_8php.html#ab3af46486585b0ddced2de27a5d7a000',1,'sgroup_list.php']]], - ['show_5fqueue',['show_queue',['../show__queue_8php.html#a48695b07fef725dbf0b4f261b1fe1547',1,'show_queue.php']]], - ['show_5freply',['show_reply',['../show__reply_8php.html#ad8e51d3b3a4bf996fb07199a08ca9a3e',1,'show_reply.php']]], - ['show_5fsgroup',['show_sgroup',['../show__sgroup_8php.html#a118719426cb30ed43e39c2af24cfea2d',1,'show_sgroup.php']]], - ['show_5fticket',['show_ticket',['../show__ticket_8php.html#a1249d6cae97f6949ce3a7754fa1b7016',1,'show_ticket.php']]], - ['show_5fticket_5finfo',['show_ticket_info',['../show__ticket__info_8php.html#a579a5c89b55189455a8237369a78f0d8',1,'show_ticket_info.php']]], - ['show_5fticket_5flog',['show_ticket_log',['../show__ticket__log_8php.html#ab37298a659581e85338601f2259ead49',1,'show_ticket_log.php']]], - ['show_5fuser',['show_user',['../drupal__module_2ryzommanage_2inc_2show__user_8php.html#ac755ca62882d4caca41c7822793b8812',1,'show_user(): show_user.php'],['../www_2html_2inc_2show__user_8php.html#ac755ca62882d4caca41c7822793b8812',1,'show_user(): show_user.php']]], - ['supportgroup_5fentrynotexists',['supportGroup_EntryNotExists',['../classSupport__Group.html#aa557f337f57a3bb530f1f04df78c0f1e',1,'Support_Group']]], - ['supportgroup_5fexists',['supportGroup_Exists',['../classSupport__Group.html#ac235662693dcc9c2be51e6f1a2c426b6',1,'Support_Group']]], - ['syncdata',['syncdata',['../classSync.html#ad1211cc677b7aafcc4ebcc25f3cacdda',1,'Sync']]], - ['syncing',['syncing',['../syncing_8php.html#a8d4df31796dab54a8d0c9c9ec32cf7f9',1,'syncing.php']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_74.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_74.html deleted file mode 100644 index e3c96c339..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_74.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_74.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_74.js deleted file mode 100644 index 62c7f6f79..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_74.js +++ /dev/null @@ -1,6 +0,0 @@ -var searchData= -[ - ['ticketexists',['ticketExists',['../classTicket.html#a091d7ec56d4dc4bf980b81e8069b76d0',1,'Ticket']]], - ['tickethasinfo',['TicketHasInfo',['../classTicket__Info.html#a361217eb1d85e13aa534dabfbbd64a86',1,'Ticket_Info']]], - ['time_5felapsed_5fstring',['time_elapsed_string',['../classGui__Elements.html#a04d9bc70e65231a470426f0a94b7583d',1,'Gui_Elements']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_75.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_75.html deleted file mode 100644 index 2d61754d1..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_75.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_75.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_75.js deleted file mode 100644 index 08d9856d5..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_75.js +++ /dev/null @@ -1,9 +0,0 @@ -var searchData= -[ - ['unassignticket',['unAssignTicket',['../classAssigned.html#a8263a9c223957bb558a2c16d4431ca29',1,'Assigned\unAssignTicket()'],['../classTicket.html#a8263a9c223957bb558a2c16d4431ca29',1,'Ticket\unAssignTicket()']]], - ['update',['update',['../classQuerycache.html#a842e4774e3b3601a005b995c02f7e883',1,'Querycache\update()'],['../classSupport__Group.html#a842e4774e3b3601a005b995c02f7e883',1,'Support_Group\update()'],['../classTicket.html#a842e4774e3b3601a005b995c02f7e883',1,'Ticket\update()'],['../classTicket__Category.html#a842e4774e3b3601a005b995c02f7e883',1,'Ticket_Category\update()'],['../classTicket__Content.html#a842e4774e3b3601a005b995c02f7e883',1,'Ticket_Content\update()'],['../classTicket__Log.html#a842e4774e3b3601a005b995c02f7e883',1,'Ticket_Log\update()'],['../classTicket__Reply.html#a842e4774e3b3601a005b995c02f7e883',1,'Ticket_Reply\update()'],['../classTicket__User.html#a842e4774e3b3601a005b995c02f7e883',1,'Ticket_User\update()']]], - ['updateticketstatus',['updateTicketStatus',['../classTicket.html#a6da2625040e9f06c583e9303082c556f',1,'Ticket']]], - ['updateticketstatusandpriority',['updateTicketStatusAndPriority',['../classTicket.html#a64f08c8987c9eb00d4bfc9ef94e45326',1,'Ticket']]], - ['userexistsinsgroup',['userExistsInSGroup',['../classIn__Support__Group.html#a1a25afa24efc6c01ffd236f735281543',1,'In_Support_Group']]], - ['userlist',['userlist',['../userlist_8php.html#a55709a05f18e09358e2b02531eb859ad',1,'userlist.php']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_76.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_76.html deleted file mode 100644 index 2ec05695c..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_76.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_76.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_76.js deleted file mode 100644 index 1566125d3..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_76.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['validemail',['validEmail',['../classUsers.html#a73637e760498c5cea55074896ec982ac',1,'Users']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_77.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_77.html deleted file mode 100644 index 8fe97554f..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_77.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_77.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_77.js deleted file mode 100644 index ed7a85370..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/functions_77.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['write_5fuser',['write_user',['../add__user_8php.html#a09df49f177966f5b08af71ec43760e0c',1,'add_user.php']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/mag_sel.png b/code/ryzom/tools/server/ryzom_ams_docs/html/search/mag_sel.png deleted file mode 100644 index 81f6040a2..000000000 Binary files a/code/ryzom/tools/server/ryzom_ams_docs/html/search/mag_sel.png and /dev/null differ diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/nomatches.html b/code/ryzom/tools/server/ryzom_ams_docs/html/search/nomatches.html deleted file mode 100644 index b1ded27e9..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/nomatches.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - -
    -
    No Matches
    -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/search.css b/code/ryzom/tools/server/ryzom_ams_docs/html/search/search.css deleted file mode 100644 index d18c1da8c..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/search.css +++ /dev/null @@ -1,238 +0,0 @@ -/*---------------- Search Box */ - -#FSearchBox { - float: left; -} - -#MSearchBox { - white-space : nowrap; - position: absolute; - float: none; - display: inline; - margin-top: 8px; - right: 0px; - width: 170px; - z-index: 102; - background-color: white; -} - -#MSearchBox .left -{ - display:block; - position:absolute; - left:10px; - width:20px; - height:19px; - background:url('search_l.png') no-repeat; - background-position:right; -} - -#MSearchSelect { - display:block; - position:absolute; - width:20px; - height:19px; -} - -.left #MSearchSelect { - left:4px; -} - -.right #MSearchSelect { - right:5px; -} - -#MSearchField { - display:block; - position:absolute; - height:19px; - background:url('search_m.png') repeat-x; - border:none; - width:116px; - margin-left:20px; - padding-left:4px; - color: #909090; - outline: none; - font: 9pt Arial, Verdana, sans-serif; -} - -#FSearchBox #MSearchField { - margin-left:15px; -} - -#MSearchBox .right { - display:block; - position:absolute; - right:10px; - top:0px; - width:20px; - height:19px; - background:url('search_r.png') no-repeat; - background-position:left; -} - -#MSearchClose { - display: none; - position: absolute; - top: 4px; - background : none; - border: none; - margin: 0px 4px 0px 0px; - padding: 0px 0px; - outline: none; -} - -.left #MSearchClose { - left: 6px; -} - -.right #MSearchClose { - right: 2px; -} - -.MSearchBoxActive #MSearchField { - color: #000000; -} - -/*---------------- Search filter selection */ - -#MSearchSelectWindow { - display: none; - position: absolute; - left: 0; top: 0; - border: 1px solid #90A5CE; - background-color: #F9FAFC; - z-index: 1; - padding-top: 4px; - padding-bottom: 4px; - -moz-border-radius: 4px; - -webkit-border-top-left-radius: 4px; - -webkit-border-top-right-radius: 4px; - -webkit-border-bottom-left-radius: 4px; - -webkit-border-bottom-right-radius: 4px; - -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); -} - -.SelectItem { - font: 8pt Arial, Verdana, sans-serif; - padding-left: 2px; - padding-right: 12px; - border: 0px; -} - -span.SelectionMark { - margin-right: 4px; - font-family: monospace; - outline-style: none; - text-decoration: none; -} - -a.SelectItem { - display: block; - outline-style: none; - color: #000000; - text-decoration: none; - padding-left: 6px; - padding-right: 12px; -} - -a.SelectItem:focus, -a.SelectItem:active { - color: #000000; - outline-style: none; - text-decoration: none; -} - -a.SelectItem:hover { - color: #FFFFFF; - background-color: #3D578C; - outline-style: none; - text-decoration: none; - cursor: pointer; - display: block; -} - -/*---------------- Search results window */ - -iframe#MSearchResults { - width: 60ex; - height: 15em; -} - -#MSearchResultsWindow { - display: none; - position: absolute; - left: 0; top: 0; - border: 1px solid #000; - background-color: #EEF1F7; -} - -/* ----------------------------------- */ - - -#SRIndex { - clear:both; - padding-bottom: 15px; -} - -.SREntry { - font-size: 10pt; - padding-left: 1ex; -} - -.SRPage .SREntry { - font-size: 8pt; - padding: 1px 5px; -} - -body.SRPage { - margin: 5px 2px; -} - -.SRChildren { - padding-left: 3ex; padding-bottom: .5em -} - -.SRPage .SRChildren { - display: none; -} - -.SRSymbol { - font-weight: bold; - color: #425E97; - font-family: Arial, Verdana, sans-serif; - text-decoration: none; - outline: none; -} - -a.SRScope { - display: block; - color: #425E97; - font-family: Arial, Verdana, sans-serif; - text-decoration: none; - outline: none; -} - -a.SRSymbol:focus, a.SRSymbol:active, -a.SRScope:focus, a.SRScope:active { - text-decoration: underline; -} - -span.SRScope { - padding-left: 4px; -} - -.SRPage .SRStatus { - padding: 2px 5px; - font-size: 8pt; - font-style: italic; -} - -.SRResult { - display: none; -} - -DIV.searchresults { - margin-left: 10px; - margin-right: 10px; -} diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/search.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/search.js deleted file mode 100644 index 9746f607f..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/search.js +++ /dev/null @@ -1,803 +0,0 @@ -// Search script generated by doxygen -// Copyright (C) 2009 by Dimitri van Heesch. - -// The code in this file is loosly based on main.js, part of Natural Docs, -// which is Copyright (C) 2003-2008 Greg Valure -// Natural Docs is licensed under the GPL. - -var indexSectionsWithContent = -{ - 0: "0000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000010101111111001111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - 1: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100101111000100110111010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - 2: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101111111001100111111010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - 3: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010101111111001111001111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - 4: "0000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" -}; - -var indexSectionNames = -{ - 0: "all", - 1: "classes", - 2: "files", - 3: "functions", - 4: "variables" -}; - -function convertToId(search) -{ - var result = ''; - for (i=0;i do a search - { - this.Search(); - } - } - - this.OnSearchSelectKey = function(evt) - { - var e = (evt) ? evt : window.event; // for IE - if (e.keyCode==40 && this.searchIndex0) // Up - { - this.searchIndex--; - this.OnSelectItem(this.searchIndex); - } - else if (e.keyCode==13 || e.keyCode==27) - { - this.OnSelectItem(this.searchIndex); - this.CloseSelectionWindow(); - this.DOMSearchField().focus(); - } - return false; - } - - // --------- Actions - - // Closes the results window. - this.CloseResultsWindow = function() - { - this.DOMPopupSearchResultsWindow().style.display = 'none'; - this.DOMSearchClose().style.display = 'none'; - this.Activate(false); - } - - this.CloseSelectionWindow = function() - { - this.DOMSearchSelectWindow().style.display = 'none'; - } - - // Performs a search. - this.Search = function() - { - this.keyTimeout = 0; - - // strip leading whitespace - var searchValue = this.DOMSearchField().value.replace(/^ +/, ""); - - var code = searchValue.toLowerCase().charCodeAt(0); - var hexCode; - if (code<16) - { - hexCode="0"+code.toString(16); - } - else - { - hexCode=code.toString(16); - } - - var resultsPage; - var resultsPageWithSearch; - var hasResultsPage; - - if (indexSectionsWithContent[this.searchIndex].charAt(code) == '1') - { - resultsPage = this.resultsPath + '/' + indexSectionNames[this.searchIndex] + '_' + hexCode + '.html'; - resultsPageWithSearch = resultsPage+'?'+escape(searchValue); - hasResultsPage = true; - } - else // nothing available for this search term - { - resultsPage = this.resultsPath + '/nomatches.html'; - resultsPageWithSearch = resultsPage; - hasResultsPage = false; - } - - window.frames.MSearchResults.location = resultsPageWithSearch; - var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow(); - - if (domPopupSearchResultsWindow.style.display!='block') - { - var domSearchBox = this.DOMSearchBox(); - this.DOMSearchClose().style.display = 'inline'; - if (this.insideFrame) - { - var domPopupSearchResults = this.DOMPopupSearchResults(); - domPopupSearchResultsWindow.style.position = 'relative'; - domPopupSearchResultsWindow.style.display = 'block'; - var width = document.body.clientWidth - 8; // the -8 is for IE :-( - domPopupSearchResultsWindow.style.width = width + 'px'; - domPopupSearchResults.style.width = width + 'px'; - } - else - { - var domPopupSearchResults = this.DOMPopupSearchResults(); - var left = getXPos(domSearchBox) + 150; // domSearchBox.offsetWidth; - var top = getYPos(domSearchBox) + 20; // domSearchBox.offsetHeight + 1; - domPopupSearchResultsWindow.style.display = 'block'; - left -= domPopupSearchResults.offsetWidth; - domPopupSearchResultsWindow.style.top = top + 'px'; - domPopupSearchResultsWindow.style.left = left + 'px'; - } - } - - this.lastSearchValue = searchValue; - this.lastResultsPage = resultsPage; - } - - // -------- Activation Functions - - // Activates or deactivates the search panel, resetting things to - // their default values if necessary. - this.Activate = function(isActive) - { - if (isActive || // open it - this.DOMPopupSearchResultsWindow().style.display == 'block' - ) - { - this.DOMSearchBox().className = 'MSearchBoxActive'; - - var searchField = this.DOMSearchField(); - - if (searchField.value == this.searchLabel) // clear "Search" term upon entry - { - searchField.value = ''; - this.searchActive = true; - } - } - else if (!isActive) // directly remove the panel - { - this.DOMSearchBox().className = 'MSearchBoxInactive'; - this.DOMSearchField().value = this.searchLabel; - this.searchActive = false; - this.lastSearchValue = '' - this.lastResultsPage = ''; - } - } -} - -// ----------------------------------------------------------------------- - -// The class that handles everything on the search results page. -function SearchResults(name) -{ - // The number of matches from the last run of . - this.lastMatchCount = 0; - this.lastKey = 0; - this.repeatOn = false; - - // Toggles the visibility of the passed element ID. - this.FindChildElement = function(id) - { - var parentElement = document.getElementById(id); - var element = parentElement.firstChild; - - while (element && element!=parentElement) - { - if (element.nodeName == 'DIV' && element.className == 'SRChildren') - { - return element; - } - - if (element.nodeName == 'DIV' && element.hasChildNodes()) - { - element = element.firstChild; - } - else if (element.nextSibling) - { - element = element.nextSibling; - } - else - { - do - { - element = element.parentNode; - } - while (element && element!=parentElement && !element.nextSibling); - - if (element && element!=parentElement) - { - element = element.nextSibling; - } - } - } - } - - this.Toggle = function(id) - { - var element = this.FindChildElement(id); - if (element) - { - if (element.style.display == 'block') - { - element.style.display = 'none'; - } - else - { - element.style.display = 'block'; - } - } - } - - // Searches for the passed string. If there is no parameter, - // it takes it from the URL query. - // - // Always returns true, since other documents may try to call it - // and that may or may not be possible. - this.Search = function(search) - { - if (!search) // get search word from URL - { - search = window.location.search; - search = search.substring(1); // Remove the leading '?' - search = unescape(search); - } - - search = search.replace(/^ +/, ""); // strip leading spaces - search = search.replace(/ +$/, ""); // strip trailing spaces - search = search.toLowerCase(); - search = convertToId(search); - - var resultRows = document.getElementsByTagName("div"); - var matches = 0; - - var i = 0; - while (i < resultRows.length) - { - var row = resultRows.item(i); - if (row.className == "SRResult") - { - var rowMatchName = row.id.toLowerCase(); - rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_' - - if (search.length<=rowMatchName.length && - rowMatchName.substr(0, search.length)==search) - { - row.style.display = 'block'; - matches++; - } - else - { - row.style.display = 'none'; - } - } - i++; - } - document.getElementById("Searching").style.display='none'; - if (matches == 0) // no results - { - document.getElementById("NoMatches").style.display='block'; - } - else // at least one result - { - document.getElementById("NoMatches").style.display='none'; - } - this.lastMatchCount = matches; - return true; - } - - // return the first item with index index or higher that is visible - this.NavNext = function(index) - { - var focusItem; - while (1) - { - var focusName = 'Item'+index; - focusItem = document.getElementById(focusName); - if (focusItem && focusItem.parentNode.parentNode.style.display=='block') - { - break; - } - else if (!focusItem) // last element - { - break; - } - focusItem=null; - index++; - } - return focusItem; - } - - this.NavPrev = function(index) - { - var focusItem; - while (1) - { - var focusName = 'Item'+index; - focusItem = document.getElementById(focusName); - if (focusItem && focusItem.parentNode.parentNode.style.display=='block') - { - break; - } - else if (!focusItem) // last element - { - break; - } - focusItem=null; - index--; - } - return focusItem; - } - - this.ProcessKeys = function(e) - { - if (e.type == "keydown") - { - this.repeatOn = false; - this.lastKey = e.keyCode; - } - else if (e.type == "keypress") - { - if (!this.repeatOn) - { - if (this.lastKey) this.repeatOn = true; - return false; // ignore first keypress after keydown - } - } - else if (e.type == "keyup") - { - this.lastKey = 0; - this.repeatOn = false; - } - return this.lastKey!=0; - } - - this.Nav = function(evt,itemIndex) - { - var e = (evt) ? evt : window.event; // for IE - if (e.keyCode==13) return true; - if (!this.ProcessKeys(e)) return false; - - if (this.lastKey==38) // Up - { - var newIndex = itemIndex-1; - var focusItem = this.NavPrev(newIndex); - if (focusItem) - { - var child = this.FindChildElement(focusItem.parentNode.parentNode.id); - if (child && child.style.display == 'block') // children visible - { - var n=0; - var tmpElem; - while (1) // search for last child - { - tmpElem = document.getElementById('Item'+newIndex+'_c'+n); - if (tmpElem) - { - focusItem = tmpElem; - } - else // found it! - { - break; - } - n++; - } - } - } - if (focusItem) - { - focusItem.focus(); - } - else // return focus to search field - { - parent.document.getElementById("MSearchField").focus(); - } - } - else if (this.lastKey==40) // Down - { - var newIndex = itemIndex+1; - var focusItem; - var item = document.getElementById('Item'+itemIndex); - var elem = this.FindChildElement(item.parentNode.parentNode.id); - if (elem && elem.style.display == 'block') // children visible - { - focusItem = document.getElementById('Item'+itemIndex+'_c0'); - } - if (!focusItem) focusItem = this.NavNext(newIndex); - if (focusItem) focusItem.focus(); - } - else if (this.lastKey==39) // Right - { - var item = document.getElementById('Item'+itemIndex); - var elem = this.FindChildElement(item.parentNode.parentNode.id); - if (elem) elem.style.display = 'block'; - } - else if (this.lastKey==37) // Left - { - var item = document.getElementById('Item'+itemIndex); - var elem = this.FindChildElement(item.parentNode.parentNode.id); - if (elem) elem.style.display = 'none'; - } - else if (this.lastKey==27) // Escape - { - parent.searchBox.CloseResultsWindow(); - parent.document.getElementById("MSearchField").focus(); - } - else if (this.lastKey==13) // Enter - { - return true; - } - return false; - } - - this.NavChild = function(evt,itemIndex,childIndex) - { - var e = (evt) ? evt : window.event; // for IE - if (e.keyCode==13) return true; - if (!this.ProcessKeys(e)) return false; - - if (this.lastKey==38) // Up - { - if (childIndex>0) - { - var newIndex = childIndex-1; - document.getElementById('Item'+itemIndex+'_c'+newIndex).focus(); - } - else // already at first child, jump to parent - { - document.getElementById('Item'+itemIndex).focus(); - } - } - else if (this.lastKey==40) // Down - { - var newIndex = childIndex+1; - var elem = document.getElementById('Item'+itemIndex+'_c'+newIndex); - if (!elem) // last child, jump to parent next parent - { - elem = this.NavNext(itemIndex+1); - } - if (elem) - { - elem.focus(); - } - } - else if (this.lastKey==27) // Escape - { - parent.searchBox.CloseResultsWindow(); - parent.document.getElementById("MSearchField").focus(); - } - else if (this.lastKey==13) // Enter - { - return true; - } - return false; - } -} - -function setKeyActions(elem,action) -{ - elem.setAttribute('onkeydown',action); - elem.setAttribute('onkeypress',action); - elem.setAttribute('onkeyup',action); -} - -function setClassAttr(elem,attr) -{ - elem.setAttribute('class',attr); - elem.setAttribute('className',attr); -} - -function createResults() -{ - var results = document.getElementById("SRResults"); - for (var e=0; e - - - - - - - -
    -
    Loading...
    -
    - -
    Searching...
    -
    No Matches
    - -
    - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/search/variables_24.js b/code/ryzom/tools/server/ryzom_ams_docs/html/search/variables_24.js deleted file mode 100644 index 8e8a493e9..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/search/variables_24.js +++ /dev/null @@ -1,91 +0,0 @@ -var searchData= -[ - ['_24allow_5funknown',['$ALLOW_UNKNOWN',['../drupal__module_2ryzommanage_2config_8php.html#a384355265e4331097d55252f901eddff',1,'$ALLOW_UNKNOWN(): config.php'],['../www_2config_8php.html#a384355265e4331097d55252f901eddff',1,'$ALLOW_UNKNOWN(): config.php']]], - ['_24amountofrows',['$amountOfRows',['../classPagination.html#a6b5c716eec440d8dc5b9754c53c545ec',1,'Pagination']]], - ['_24ams_5fcachedir',['$AMS_CACHEDIR',['../drupal__module_2ryzommanage_2config_8php.html#a92879a931e7a7d0ae6919e70a1529747',1,'$AMS_CACHEDIR(): config.php'],['../www_2config_8php.html#a92879a931e7a7d0ae6919e70a1529747',1,'$AMS_CACHEDIR(): config.php']]], - ['_24ams_5flib',['$AMS_LIB',['../drupal__module_2ryzommanage_2config_8php.html#a75086b9c8602bf3417773bae7ef0cdc8',1,'$AMS_LIB(): config.php'],['../www_2config_8php.html#a75086b9c8602bf3417773bae7ef0cdc8',1,'$AMS_LIB(): config.php']]], - ['_24ams_5ftrans',['$AMS_TRANS',['../drupal__module_2ryzommanage_2config_8php.html#acc96a0076127356b4f9f00f4bdfa9b65',1,'$AMS_TRANS(): config.php'],['../www_2config_8php.html#acc96a0076127356b4f9f00f4bdfa9b65',1,'$AMS_TRANS(): config.php']]], - ['_24author',['$author',['../classTicket.html#ac35b828f7d4064a7c9f849c255468ee3',1,'Ticket\$author()'],['../classTicket__Log.html#ac35b828f7d4064a7c9f849c255468ee3',1,'Ticket_Log\$author()'],['../classTicket__Reply.html#ac35b828f7d4064a7c9f849c255468ee3',1,'Ticket_Reply\$author()']]], - ['_24base_5fwebpath',['$BASE_WEBPATH',['../drupal__module_2ryzommanage_2config_8php.html#a2e954ee09fb5f52b9d05caf9dfc3d5ad',1,'$BASE_WEBPATH(): config.php'],['../www_2config_8php.html#a2e954ee09fb5f52b9d05caf9dfc3d5ad',1,'$BASE_WEBPATH(): config.php']]], - ['_24cfg',['$cfg',['../drupal__module_2ryzommanage_2config_8php.html#a32f90fc68bcb40de0bae38354fd0a5fe',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a6b776651fa7defe140c03ed3bd86aa96',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a68f172c430a17022c9f74ae1acd24a00',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a1805c74760836f682459a12a17d50589',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a94213b6df61b8a6b62abbe7c956493a4',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a4b555022064138fee1d7edea873c5e9e',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a1b49c1f0de42e603443bea2c93276c13',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a7c5f3fd8aea7ae8363c6cdc9addd9b62',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a7b5bbf5b3c541b46d06deaffeeb76424',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a1dca44c652dd54f6879957cf8d4a039c',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a56e7e53dac48b99f62d41d387c8624e6',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#adc2648938b5135f1f2aab1d92d33418e',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a1324eeda6b288c0a26d7071db555090c',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a63d97fffb2ff86525bb6cacb74113a73',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a7147f422b8150cd3f3c8a68325208607',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a53f42728714b4e86b885c12f7846cd06',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#aa68c438d0b6b38d756d8724bac554f1b',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#ae4ae1095a3543d5607464a88e6330a07',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a7cf20f61de759c233272150b12e866d8',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#aed7bed5da2b934c742cb60d23c06f752',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a1606e0620d5a628b865e0df5c217ce7e',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a41e3a386ec52e0f05bdcad04acecf619',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#ac2c263a1e16ebd69dbf247e8d82c9f63',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a9996bf49f150442cf9d564725d0dea24',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#aa7eb09eb019c344553a61b54606cb650',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a79b711e7ee81b7435a8dba7cb132b34a',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a8578ffa00c2dbcf5d34a97bcff79058b',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a50d80d35dbd37739f844a93a36fce557',1,'$cfg(): config.php'],['../drupal__module_2ryzommanage_2config_8php.html#a55031a1c3c2b9d87e37558811b311ff8',1,'$cfg(): config.php'],['../www_2config_8php.html#a32f90fc68bcb40de0bae38354fd0a5fe',1,'$cfg(): config.php'],['../www_2config_8php.html#a6b776651fa7defe140c03ed3bd86aa96',1,'$cfg(): config.php'],['../www_2config_8php.html#a68f172c430a17022c9f74ae1acd24a00',1,'$cfg(): config.php'],['../www_2config_8php.html#a1805c74760836f682459a12a17d50589',1,'$cfg(): config.php'],['../www_2config_8php.html#a94213b6df61b8a6b62abbe7c956493a4',1,'$cfg(): config.php'],['../www_2config_8php.html#a4b555022064138fee1d7edea873c5e9e',1,'$cfg(): config.php'],['../www_2config_8php.html#a1b49c1f0de42e603443bea2c93276c13',1,'$cfg(): config.php'],['../www_2config_8php.html#a7c5f3fd8aea7ae8363c6cdc9addd9b62',1,'$cfg(): config.php'],['../www_2config_8php.html#a7b5bbf5b3c541b46d06deaffeeb76424',1,'$cfg(): config.php'],['../www_2config_8php.html#a1dca44c652dd54f6879957cf8d4a039c',1,'$cfg(): config.php'],['../www_2config_8php.html#a56e7e53dac48b99f62d41d387c8624e6',1,'$cfg(): config.php'],['../www_2config_8php.html#adc2648938b5135f1f2aab1d92d33418e',1,'$cfg(): config.php'],['../www_2config_8php.html#a1324eeda6b288c0a26d7071db555090c',1,'$cfg(): config.php'],['../www_2config_8php.html#a63d97fffb2ff86525bb6cacb74113a73',1,'$cfg(): config.php'],['../www_2config_8php.html#a7147f422b8150cd3f3c8a68325208607',1,'$cfg(): config.php'],['../www_2config_8php.html#a53f42728714b4e86b885c12f7846cd06',1,'$cfg(): config.php'],['../www_2config_8php.html#aa68c438d0b6b38d756d8724bac554f1b',1,'$cfg(): config.php'],['../www_2config_8php.html#ae4ae1095a3543d5607464a88e6330a07',1,'$cfg(): config.php'],['../www_2config_8php.html#a7cf20f61de759c233272150b12e866d8',1,'$cfg(): config.php'],['../www_2config_8php.html#aed7bed5da2b934c742cb60d23c06f752',1,'$cfg(): config.php'],['../www_2config_8php.html#a1606e0620d5a628b865e0df5c217ce7e',1,'$cfg(): config.php'],['../www_2config_8php.html#a41e3a386ec52e0f05bdcad04acecf619',1,'$cfg(): config.php'],['../www_2config_8php.html#ac2c263a1e16ebd69dbf247e8d82c9f63',1,'$cfg(): config.php'],['../www_2config_8php.html#a9996bf49f150442cf9d564725d0dea24',1,'$cfg(): config.php'],['../www_2config_8php.html#aa7eb09eb019c344553a61b54606cb650',1,'$cfg(): config.php'],['../www_2config_8php.html#a79b711e7ee81b7435a8dba7cb132b34a',1,'$cfg(): config.php'],['../www_2config_8php.html#a8578ffa00c2dbcf5d34a97bcff79058b',1,'$cfg(): config.php'],['../www_2config_8php.html#a50d80d35dbd37739f844a93a36fce557',1,'$cfg(): config.php'],['../www_2config_8php.html#a55031a1c3c2b9d87e37558811b311ff8',1,'$cfg(): config.php'],['../install_8php.html#a449cc4bf6cfd310810993b3ef5251aa5',1,'$cfg(): install.php']]], - ['_24client_5fversion',['$client_version',['../classTicket__Info.html#ac43fbb88dcd0696ad49d5f805f369a61',1,'Ticket_Info']]], - ['_24config',['$config',['../classMyCrypt.html#a49c7011be9c979d9174c52a8b83e5d8e',1,'MyCrypt']]], - ['_24config_5fpath',['$CONFIG_PATH',['../drupal__module_2ryzommanage_2config_8php.html#ae15921e2ebd5885ecf37d31a2cf6ab7a',1,'$CONFIG_PATH(): config.php'],['../www_2config_8php.html#ae15921e2ebd5885ecf37d31a2cf6ab7a',1,'$CONFIG_PATH(): config.php']]], - ['_24connect_5fstate',['$connect_state',['../classTicket__Info.html#a33f4c9badf7f0c5c6728bba0ffacd66e',1,'Ticket_Info']]], - ['_24content',['$content',['../classTicket__Content.html#a57b284fe00866494b33afa80ba729bed',1,'Ticket_Content\$content()'],['../classTicket__Reply.html#a57b284fe00866494b33afa80ba729bed',1,'Ticket_Reply\$content()']]], - ['_24country',['$country',['../classWebUsers.html#a1437a5f6eb157f0eb267a26e0ad4f1ba',1,'WebUsers']]], - ['_24cpu_5fid',['$cpu_id',['../classTicket__Info.html#abea88d0d04f0d548115a0e85eef42e42',1,'Ticket_Info']]], - ['_24cpu_5fmask',['$cpu_mask',['../classTicket__Info.html#a9b0c63551b567630d1aa82f33c328ab0',1,'Ticket_Info']]], - ['_24create_5fring',['$CREATE_RING',['../drupal__module_2ryzommanage_2config_8php.html#a16031d9d4e5065229bc3b00dfd4202fa',1,'$CREATE_RING(): config.php'],['../www_2config_8php.html#a16031d9d4e5065229bc3b00dfd4202fa',1,'$CREATE_RING(): config.php']]], - ['_24current',['$current',['../classPagination.html#a2c4c58e377f6c66ca38c8ea97666fc5e',1,'Pagination']]], - ['_24db',['$db',['../classMail__Handler.html#a1fa3127fc82f96b1436d871ef02be319',1,'Mail_Handler\$db()'],['../classQuerycache.html#a1fa3127fc82f96b1436d871ef02be319',1,'Querycache\$db()']]], - ['_24default_5flanguage',['$DEFAULT_LANGUAGE',['../drupal__module_2ryzommanage_2config_8php.html#a7b56c2ed5a82ceb21fc73cef77beb150',1,'$DEFAULT_LANGUAGE(): config.php'],['../www_2config_8php.html#a7b56c2ed5a82ceb21fc73cef77beb150',1,'$DEFAULT_LANGUAGE(): config.php']]], - ['_24element_5farray',['$element_array',['../classPagination.html#a8fa0f6a15481ba69e7be913eaa15594c',1,'Pagination']]], - ['_24email',['$email',['../classWebUsers.html#ad634f418b20382e2802f80532d76d3cd',1,'WebUsers']]], - ['_24externid',['$externId',['../classTicket__User.html#af51400fe5820e964cb38fcc60b3afd84',1,'Ticket_User']]], - ['_24firstname',['$firstname',['../classWebUsers.html#a55793c72c535d153ffd3f0e43377898b',1,'WebUsers']]], - ['_24force_5fingame',['$FORCE_INGAME',['../drupal__module_2ryzommanage_2config_8php.html#aabd939b29ed900f5fc489f1a957fc6ce',1,'$FORCE_INGAME(): config.php'],['../www_2config_8php.html#aabd939b29ed900f5fc489f1a957fc6ce',1,'$FORCE_INGAME(): config.php']]], - ['_24gender',['$gender',['../classWebUsers.html#a0f1d7cfb9dc6f494b9014885205fc47e',1,'WebUsers']]], - ['_24group',['$group',['../classForwarded.html#ad530a85733b0ec1dc321859fd8faa0dc',1,'Forwarded\$group()'],['../classIn__Support__Group.html#ad530a85733b0ec1dc321859fd8faa0dc',1,'In_Support_Group\$group()']]], - ['_24groupemail',['$groupEmail',['../classSupport__Group.html#ab7ad611af238b28f1f65a32cb152acd1',1,'Support_Group']]], - ['_24hidden',['$hidden',['../classTicket__Reply.html#a4a374564d2858d8ae869a8fb890aad56',1,'Ticket_Reply']]], - ['_24ht',['$ht',['../classTicket__Info.html#a969583a6605ed731abf5849a5202db1e',1,'Ticket_Info']]], - ['_24imageloc_5fwebpath',['$IMAGELOC_WEBPATH',['../drupal__module_2ryzommanage_2config_8php.html#a16820074dcd11e4881ca6461377db000',1,'$IMAGELOC_WEBPATH(): config.php'],['../www_2config_8php.html#a16820074dcd11e4881ca6461377db000',1,'$IMAGELOC_WEBPATH(): config.php']]], - ['_24imap_5fmailserver',['$iMAP_MailServer',['../classSupport__Group.html#ad9f2ef2089fe446a9ac49a19a450d636',1,'Support_Group']]], - ['_24imap_5fpassword',['$iMAP_Password',['../classSupport__Group.html#a4166a2fc4b594ee425d7f40870e16455',1,'Support_Group']]], - ['_24imap_5fusername',['$iMAP_Username',['../classSupport__Group.html#a2b549eb4d5773efd741a2990817af0ea',1,'Support_Group']]], - ['_24ingame_5flayout',['$INGAME_LAYOUT',['../drupal__module_2ryzommanage_2config_8php.html#a0deedf69fea8c97030373e15a68c4cc5',1,'$INGAME_LAYOUT(): config.php'],['../www_2config_8php.html#a0deedf69fea8c97030373e15a68c4cc5',1,'$INGAME_LAYOUT(): config.php']]], - ['_24ingame_5fwebpath',['$INGAME_WEBPATH',['../drupal__module_2ryzommanage_2config_8php.html#ae9f6aa9c61501bca7b8851925c636d87',1,'$INGAME_WEBPATH(): config.php'],['../www_2config_8php.html#ae9f6aa9c61501bca7b8851925c636d87',1,'$INGAME_WEBPATH(): config.php']]], - ['_24language',['$language',['../classWebUsers.html#a83170d318260a5a2e2a79dccdd371b10',1,'WebUsers']]], - ['_24last',['$last',['../classPagination.html#acf48db609a946d13953d8060363fd1d3',1,'Pagination']]], - ['_24lastname',['$lastname',['../classWebUsers.html#a1d2ddb6354180329b59e8b90ed94dc7f',1,'WebUsers']]], - ['_24local_5faddress',['$local_address',['../classTicket__Info.html#a467dca5673d4c9f737dac972ab05720c',1,'Ticket_Info']]], - ['_24login',['$login',['../classWebUsers.html#afc31993e855f9631572adfedcfe6f34b',1,'WebUsers']]], - ['_24mail_5fdir',['$MAIL_DIR',['../drupal__module_2ryzommanage_2config_8php.html#a9f8fc644554910de5434f78a5f23044e',1,'$MAIL_DIR(): config.php'],['../www_2config_8php.html#a9f8fc644554910de5434f78a5f23044e',1,'$MAIL_DIR(): config.php']]], - ['_24mail_5fhandler',['$mail_handler',['../mail__cron_8php.html#a160a75d95407d877e9c2542e3ddd8c43',1,'mail_cron.php']]], - ['_24mail_5flog_5fpath',['$MAIL_LOG_PATH',['../drupal__module_2ryzommanage_2config_8php.html#afe6e9ed40480c14cb7a119fb84cb557a',1,'$MAIL_LOG_PATH(): config.php'],['../www_2config_8php.html#afe6e9ed40480c14cb7a119fb84cb557a',1,'$MAIL_LOG_PATH(): config.php']]], - ['_24memory',['$memory',['../classTicket__Info.html#a5e20a9a3e12271b3b8d685805590c9e0',1,'Ticket_Info']]], - ['_24name',['$name',['../classSupport__Group.html#ab2fc40d43824ea3e1ce5d86dee0d763b',1,'Support_Group\$name()'],['../classTicket__Category.html#ab2fc40d43824ea3e1ce5d86dee0d763b',1,'Ticket_Category\$name()']]], - ['_24nel3d',['$nel3d',['../classTicket__Info.html#a9b616e5fbafadc93aa4bdf3ccbf31498',1,'Ticket_Info']]], - ['_24os',['$os',['../classTicket__Info.html#a292791d5d8e3ded85cb2e8ec80dea0d9',1,'Ticket_Info']]], - ['_24pagination',['$pagination',['../classTicket__Queue__Handler.html#a388a4a950e936f746d3b9c1b56450ce7',1,'Ticket_Queue_Handler']]], - ['_24params',['$params',['../classTicket__Queue.html#afe68e6fbe7acfbffc0af0c84a1996466',1,'Ticket_Queue']]], - ['_24patch_5fversion',['$patch_version',['../classTicket__Info.html#a55fc0854f90ed36ab9774ba7bd2af53f',1,'Ticket_Info']]], - ['_24pdo',['$PDO',['../classDBLayer.html#acdb2149c05a21fe144fb05ec524a51f3',1,'DBLayer']]], - ['_24permission',['$permission',['../classTicket__User.html#aad04b6f3304fe6a13d5be37f7cd28938',1,'Ticket_User']]], - ['_24priority',['$priority',['../classTicket.html#a2677e505e860db863720ac4e216fd3f2',1,'Ticket']]], - ['_24processor',['$processor',['../classTicket__Info.html#a11fe8ad69d64b596f8b712b0b7e7e1e3',1,'Ticket_Info']]], - ['_24query',['$query',['../classQuerycache.html#af59a5f7cd609e592c41dc3643efd3c98',1,'Querycache\$query()'],['../classTicket__Log.html#af59a5f7cd609e592c41dc3643efd3c98',1,'Ticket_Log\$query()'],['../classTicket__Queue.html#af59a5f7cd609e592c41dc3643efd3c98',1,'Ticket_Queue\$query()']]], - ['_24queue',['$queue',['../classTicket.html#a4a0b48f6ae2fcb248a4f0288c7c344a6',1,'Ticket\$queue()'],['../classTicket__Queue__Handler.html#a4a0b48f6ae2fcb248a4f0288c7c344a6',1,'Ticket_Queue_Handler\$queue()']]], - ['_24receivemail',['$receiveMail',['../classWebUsers.html#a3c74ba660e348124f36d978b137f691d',1,'WebUsers']]], - ['_24server_5ftick',['$server_tick',['../classTicket__Info.html#aeac33ccad750e9ee81a22414db1224ab',1,'Ticket_Info']]], - ['_24sgroupid',['$sGroupId',['../classSupport__Group.html#a23265908fce0f131e03ba1ede7f42647',1,'Support_Group']]], - ['_24shardid',['$shardid',['../classTicket__Info.html#ac73283a0a8308fb7594543e4a049942c',1,'Ticket_Info']]], - ['_24sid',['$SID',['../classQuerycache.html#a69c31f890638fa4930097cf55ae27995',1,'Querycache']]], - ['_24sitebase',['$SITEBASE',['../drupal__module_2ryzommanage_2config_8php.html#a9eb41824afc2b8150c27648859f07357',1,'$SITEBASE(): config.php'],['../www_2config_8php.html#a9eb41824afc2b8150c27648859f07357',1,'$SITEBASE(): config.php']]], - ['_24status',['$status',['../classTicket.html#a58391ea75f2d29d5d708d7050b641c33',1,'Ticket']]], - ['_24support_5fgroup_5fimap_5fcryptkey',['$SUPPORT_GROUP_IMAP_CRYPTKEY',['../drupal__module_2ryzommanage_2config_8php.html#a3ed2ac4433023af3e95f8912f00125ea',1,'$SUPPORT_GROUP_IMAP_CRYPTKEY(): config.php'],['../www_2config_8php.html#a3ed2ac4433023af3e95f8912f00125ea',1,'$SUPPORT_GROUP_IMAP_CRYPTKEY(): config.php']]], - ['_24tag',['$tag',['../classSupport__Group.html#a81d5015d41ed8ec66e9db8cdc5db9555',1,'Support_Group']]], - ['_24tcategoryid',['$tCategoryId',['../classTicket__Category.html#a0111df4559c9f524272d94df0b7f9d6b',1,'Ticket_Category']]], - ['_24tcontentid',['$tContentId',['../classTicket__Content.html#a2249787a24edd706ae7a54609a601d6f',1,'Ticket_Content']]], - ['_24ticket',['$ticket',['../classAssigned.html#abf7832c7c53a3be2ca8a8fc305006bb0',1,'Assigned\$ticket()'],['../classForwarded.html#abf7832c7c53a3be2ca8a8fc305006bb0',1,'Forwarded\$ticket()'],['../classTicket__Info.html#abf7832c7c53a3be2ca8a8fc305006bb0',1,'Ticket_Info\$ticket()'],['../classTicket__Log.html#abf7832c7c53a3be2ca8a8fc305006bb0',1,'Ticket_Log\$ticket()'],['../classTicket__Reply.html#abf7832c7c53a3be2ca8a8fc305006bb0',1,'Ticket_Reply\$ticket()']]], - ['_24ticket_5fcategory',['$ticket_category',['../classTicket.html#a86e470072892575063c478122fb65184',1,'Ticket']]], - ['_24ticket_5flogging',['$TICKET_LOGGING',['../drupal__module_2ryzommanage_2config_8php.html#aa59491d29009336d89423cccd3adc5de',1,'$TICKET_LOGGING(): config.php'],['../www_2config_8php.html#aa59491d29009336d89423cccd3adc5de',1,'$TICKET_LOGGING(): config.php']]], - ['_24ticket_5fmailing_5fsupport',['$TICKET_MAILING_SUPPORT',['../drupal__module_2ryzommanage_2config_8php.html#a23c3d413e56a57bc04d69627a4ed2b14',1,'$TICKET_MAILING_SUPPORT(): config.php'],['../www_2config_8php.html#a23c3d413e56a57bc04d69627a4ed2b14',1,'$TICKET_MAILING_SUPPORT(): config.php']]], - ['_24tid',['$tId',['../classTicket.html#a3eda2fecc2433b6b6b3b957110e937ca',1,'Ticket']]], - ['_24time_5fformat',['$TIME_FORMAT',['../drupal__module_2ryzommanage_2config_8php.html#a613b2c043c06772e7119587b26eb9989',1,'$TIME_FORMAT(): config.php'],['../www_2config_8php.html#a613b2c043c06772e7119587b26eb9989',1,'$TIME_FORMAT(): config.php']]], - ['_24timestamp',['$timestamp',['../classTicket.html#a2b69de9676dd97c675cd4d9bcceb684c',1,'Ticket\$timestamp()'],['../classTicket__Log.html#a2b69de9676dd97c675cd4d9bcceb684c',1,'Ticket_Log\$timestamp()'],['../classTicket__Reply.html#a2b69de9676dd97c675cd4d9bcceb684c',1,'Ticket_Reply\$timestamp()']]], - ['_24tinfoid',['$tInfoId',['../classTicket__Info.html#a4c2ae13b7827d13b9629e3fc57335f8f',1,'Ticket_Info']]], - ['_24title',['$title',['../classTicket.html#ada57e7bb7c152edad18fe2f166188691',1,'Ticket']]], - ['_24tlogid',['$tLogId',['../classTicket__Log.html#a734657bd8aac85b5a33e03646c17eb65',1,'Ticket_Log']]], - ['_24tos_5furl',['$TOS_URL',['../drupal__module_2ryzommanage_2config_8php.html#aef688ce4c627fa2fbd8037fd2cceef78',1,'$TOS_URL(): config.php'],['../www_2config_8php.html#aef688ce4c627fa2fbd8037fd2cceef78',1,'$TOS_URL(): config.php']]], - ['_24treplyid',['$tReplyId',['../classTicket__Reply.html#a29f22c2783e510d4764a99a648a0cc36',1,'Ticket_Reply']]], - ['_24tuserid',['$tUserId',['../classTicket__User.html#a2f1828693b198682ae3e926e63a4c110',1,'Ticket_User']]], - ['_24type',['$type',['../classQuerycache.html#a9a4a6fba2208984cabb3afacadf33919',1,'Querycache']]], - ['_24uid',['$uId',['../classWebUsers.html#a8f11c60ae8f70a5059b97bc0ea9d0de5',1,'WebUsers']]], - ['_24user',['$user',['../classAssigned.html#a598ca4e71b15a1313ec95f0df1027ca5',1,'Assigned\$user()'],['../classIn__Support__Group.html#a598ca4e71b15a1313ec95f0df1027ca5',1,'In_Support_Group\$user()']]], - ['_24user_5fid',['$user_id',['../classTicket__Info.html#af0fcd925f00973e32f7214859dfb3c6b',1,'Ticket_Info']]], - ['_24user_5fposition',['$user_position',['../classTicket__Info.html#afc9fcd144a71e56898632daf43854aa7',1,'Ticket_Info']]], - ['_24view_5fposition',['$view_position',['../classTicket__Info.html#ae325cbe2a7e27757b90b12d595c4dfe9',1,'Ticket_Info']]], - ['_24webpath',['$WEBPATH',['../drupal__module_2ryzommanage_2config_8php.html#a562d30b98806af1e001a3ff855e8890a',1,'$WEBPATH(): config.php'],['../www_2config_8php.html#a562d30b98806af1e001a3ff855e8890a',1,'$WEBPATH(): config.php']]] -]; diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/sgroup__list_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/sgroup__list_8php.html deleted file mode 100644 index ec06aedcf..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/sgroup__list_8php.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/sgroup_list.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/sgroup_list.php File Reference
    -
    -
    - - - - -

    -Functions

     sgroup_list ()
     This function is beign used to load info that's needed for the sgroup_list page.
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    sgroup_list ()
    -
    -
    - -

    This function is beign used to load info that's needed for the sgroup_list page.

    -

    check if the person who wants to view this page is a mod/admin, if this is not the case, he will be redirected to an error page. It will return all suppport groups information. Also if the $_GET['delete'] var is set and the user is an admin, he will delete a specific entry.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/show__queue_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/show__queue_8php.html deleted file mode 100644 index 0ee887073..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/show__queue_8php.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_queue.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_queue.php File Reference
    -
    -
    - - - - -

    -Functions

     show_queue ()
     This function is beign used to load info that's needed for the show_queue page.
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    show_queue ()
    -
    -
    - -

    This function is beign used to load info that's needed for the show_queue page.

    -

    check if the person who wants to view this page is a mod/admin, if this is not the case, he will be redirected to an error page. if an action is set (this is done by $_GET['action']) it will try to execute it first, actions are: assign a ticket, unassign a ticket an create a queue. There are a few predefined queues which is the 'all tickets' queue, 'archive' queue, 'todo' queue, .. these are passed by $_GET['get']. if $_GET['get'] = create; then it's a custom made queue, this will call the createQueue function which builds the query that we will later use to get the tickets. The tickets fetched will be returned and used in the template. Now why use POST and GET params here and have a createQueue function twice? Well the first time someone creates a queue the POST variables will be used, however after going to the next page it will use the GET params.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/show__reply_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/show__reply_8php.html deleted file mode 100644 index 0be3d45f5..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/show__reply_8php.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_reply.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_reply.php File Reference
    -
    -
    - - - - -

    -Functions

     show_reply ()
     This function is beign used to load info that's needed for the show_reply page.
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    show_reply ()
    -
    -
    - -

    This function is beign used to load info that's needed for the show_reply page.

    -

    check if the person is allowed to see the reply, if not he'll be redirected to an error page. data regarding to the reply will be returned by this function that will be used by the template.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/show__sgroup_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/show__sgroup_8php.html deleted file mode 100644 index fdffe05d6..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/show__sgroup_8php.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_sgroup.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_sgroup.php File Reference
    -
    -
    - - - - -

    -Functions

     show_sgroup ()
     This function is beign used to load info that's needed for the show_sgroup page.
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    show_sgroup ()
    -
    -
    - -

    This function is beign used to load info that's needed for the show_sgroup page.

    -

    check if the person browsing this page is a mod/admin, if not he'll be redirected to an error page. if the $_GET['delete'] var is set and the user executing is an admin, an entry will be deleted out of the support group. A list of users that are member of the group will be returned, which can be used by the template.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/show__ticket_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/show__ticket_8php.html deleted file mode 100644 index 4d8746ec5..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/show__ticket_8php.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_ticket.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_ticket.php File Reference
    -
    -
    - - - - -

    -Functions

     show_ticket ()
     This function is beign used to load info that's needed for the show_ticket page.
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    show_ticket ()
    -
    -
    - -

    This function is beign used to load info that's needed for the show_ticket page.

    -

    check if the person browsing this page is a mod/admin or the ticket creator himself, if not he'll be redirected to an error page. if the $_GET['action'] var is set and the user executing is a mod/admin, it will try to execute the action. The actions here are: forwarding of a ticket, assigning a ticket and unassigning a ticket. This function returns a lot of information that will be used by the template to show the ticket. Mods/admins will be able to also see hidden replies to a ticket.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/show__ticket__info_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/show__ticket__info_8php.html deleted file mode 100644 index 91ee2707a..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/show__ticket__info_8php.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_ticket_info.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_ticket_info.php File Reference
    -
    -
    - - - - -

    -Functions

     show_ticket_info ()
     This function is beign used to load info that's needed for the show_ticket_info page.
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    show_ticket_info ()
    -
    -
    - -

    This function is beign used to load info that's needed for the show_ticket_info page.

    -

    check if the person browsing this page is a mod/admin or the ticket creator himself, if not he'll be redirected to an error page. not all tickets have this page related to it, only tickets created ingame will have additional information. The returned info will be used by the template to show the show_ticket_info page.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/show__ticket__log_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/show__ticket__log_8php.html deleted file mode 100644 index 603f3dbdc..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/show__ticket__log_8php.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_ticket_log.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_ticket_log.php File Reference
    -
    -
    - - - - -

    -Functions

     show_ticket_log ()
     This function is beign used to load info that's needed for the show_ticket_log page.
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    show_ticket_log ()
    -
    -
    - -

    This function is beign used to load info that's needed for the show_ticket_log page.

    -

    This page shows the logs related to a ticket: who created the ticket, who replied on it, who viewed it, assigned or forwarded it. Only mods/admins are able to browse the log though. The found information is returned so it can be used by the template.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/support__group_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/support__group_8php.html deleted file mode 100644 index d2692f073..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/support__group_8php.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/support_group.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/support_group.php File Reference
    -
    -
    - - - - -

    -Data Structures

    class  Support_Group
     groups moderators & admins together. More...
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/sync_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/sync_8php.html deleted file mode 100644 index b7b7907da..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/sync_8php.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/sync.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/sync.php File Reference
    -
    -
    - - - - -

    -Data Structures

    class  Sync
     handler for performing changes when shard is back online after being offline. More...
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/sync__cron_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/sync__cron_8php.html deleted file mode 100644 index ede9924a7..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/sync__cron_8php.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/cron/sync_cron.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/cron/sync_cron.php File Reference
    -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/syncing_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/syncing_8php.html deleted file mode 100644 index 5b4838a79..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/syncing_8php.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/syncing.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/syncing.php File Reference
    -
    -
    - - - - -

    -Functions

     syncing ()
     This function is beign used to load info that's needed for the syncing page.
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    syncing ()
    -
    -
    - -

    This function is beign used to load info that's needed for the syncing page.

    -

    this function is used for notifying admins that there are unsynced changes, a brief overview of the non syned changes will be shown. The entries are being loaded here so that they can be passed to the template itself. Only admins can browse this page, others will be redirected to an error page.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/tab_a.png b/code/ryzom/tools/server/ryzom_ams_docs/html/tab_a.png deleted file mode 100644 index 2d99ef23f..000000000 Binary files a/code/ryzom/tools/server/ryzom_ams_docs/html/tab_a.png and /dev/null differ diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/tab_b.png b/code/ryzom/tools/server/ryzom_ams_docs/html/tab_b.png deleted file mode 100644 index b2c3d2be3..000000000 Binary files a/code/ryzom/tools/server/ryzom_ams_docs/html/tab_b.png and /dev/null differ diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/tab_h.png b/code/ryzom/tools/server/ryzom_ams_docs/html/tab_h.png deleted file mode 100644 index c11f48f19..000000000 Binary files a/code/ryzom/tools/server/ryzom_ams_docs/html/tab_h.png and /dev/null differ diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/tab_s.png b/code/ryzom/tools/server/ryzom_ams_docs/html/tab_s.png deleted file mode 100644 index 978943ac8..000000000 Binary files a/code/ryzom/tools/server/ryzom_ams_docs/html/tab_s.png and /dev/null differ diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/tabs.css b/code/ryzom/tools/server/ryzom_ams_docs/html/tabs.css deleted file mode 100644 index 21920562a..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/tabs.css +++ /dev/null @@ -1,59 +0,0 @@ -.tabs, .tabs2, .tabs3 { - background-image: url('tab_b.png'); - width: 100%; - z-index: 101; - font-size: 13px; -} - -.tabs2 { - font-size: 10px; -} -.tabs3 { - font-size: 9px; -} - -.tablist { - margin: 0; - padding: 0; - display: table; -} - -.tablist li { - float: left; - display: table-cell; - background-image: url('tab_b.png'); - line-height: 36px; - list-style: none; -} - -.tablist a { - display: block; - padding: 0 20px; - font-weight: bold; - background-image:url('tab_s.png'); - background-repeat:no-repeat; - background-position:right; - color: #283A5D; - text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); - text-decoration: none; - outline: none; -} - -.tabs3 .tablist a { - padding: 0 10px; -} - -.tablist a:hover { - background-image: url('tab_h.png'); - background-repeat:repeat-x; - color: #fff; - text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); - text-decoration: none; -} - -.tablist li.current a { - background-image: url('tab_a.png'); - background-repeat:repeat-x; - color: #fff; - text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); -} diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/ticket_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/ticket_8php.html deleted file mode 100644 index 09e6d6329..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/ticket_8php.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket.php File Reference
    -
    -
    - - - - -

    -Data Structures

    class  Ticket
     class that handles most ticket related functions. More...
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/ticket__category_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/ticket__category_8php.html deleted file mode 100644 index e84fafcf0..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/ticket__category_8php.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_category.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_category.php File Reference
    -
    -
    - - - - -

    -Data Structures

    class  Ticket_Category
     Class related to the ticket categories. More...
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/ticket__content_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/ticket__content_8php.html deleted file mode 100644 index 69dbd3954..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/ticket__content_8php.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_content.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_content.php File Reference
    -
    -
    - - - - -

    -Data Structures

    class  Ticket_Content
     Class that handles the content of a reply. More...
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/ticket__info_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/ticket__info_8php.html deleted file mode 100644 index e8e1d079f..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/ticket__info_8php.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_info.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_info.php File Reference
    -
    -
    - - - - -

    -Data Structures

    class  Ticket_Info
     Class that handles additional info sent by ticket creation ingame. More...
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/ticket__log_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/ticket__log_8php.html deleted file mode 100644 index 645bb27d3..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/ticket__log_8php.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_log.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_log.php File Reference
    -
    -
    - - - - -

    -Data Structures

    class  Ticket_Log
     Class that handles the logging. More...
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/ticket__queue_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/ticket__queue_8php.html deleted file mode 100644 index 6b78f9c7a..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/ticket__queue_8php.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_queue.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_queue.php File Reference
    -
    -
    - - - - -

    -Data Structures

    class  Ticket_Queue
     Data class that holds a lot of queries that load specific tickets. More...
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/ticket__queue__handler_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/ticket__queue__handler_8php.html deleted file mode 100644 index fa7720f16..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/ticket__queue__handler_8php.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_queue_handler.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_queue_handler.php File Reference
    -
    -
    - - - - -

    -Data Structures

    class  Ticket_Queue_Handler
     returns tickets (queues) that are related in some way. More...
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/ticket__reply_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/ticket__reply_8php.html deleted file mode 100644 index 9594115b5..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/ticket__reply_8php.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_reply.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_reply.php File Reference
    -
    -
    - - - - -

    -Data Structures

    class  Ticket_Reply
     handles functions related to replies on tickets. More...
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/ticket__user_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/ticket__user_8php.html deleted file mode 100644 index e106212f4..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/ticket__user_8php.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_user.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_user.php File Reference
    -
    -
    - - - - -

    -Data Structures

    class  Ticket_User
     user entry point in the ticket system. More...
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/todo.html b/code/ryzom/tools/server/ryzom_ams_docs/html/todo.html deleted file mode 100644 index e630d4465..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/todo.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - -Ryzom Account Management System: Todo List - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - -
    -
    -
    -
    Todo List
    -
    -
    -
    -
    Global Helpers ()
    -
    for the drupal module it might be possible that drupal_mkdir needs to be used instead of mkdir, also this should be in the install.php instead.
    -
    Global Mail_Handler (&$structure)
    -
    take care of the HTML part of incoming emails.
    -
    Class Querycache
    -
    make sure that the querycache class is being used by the sync class and also for inserting the queries themselfs into it. Atm this class isn't used yet if I remember correctly
    -
    Global Ticket ($ticket_id, $newStatus, $newPriority, $author)
    -
    break this function up into a updateStatus (already exists) and updatePriority function and perhaps write a wrapper function for the combo.
    -
    Global Ticket_Log ($ticket_id)
    -
    only use one of the 2 comparable functions in the future and make the other depricated.
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/userlist_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/userlist_8php.html deleted file mode 100644 index 149a7973c..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/userlist_8php.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/userlist.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/userlist.php File Reference
    -
    -
    - - - - -

    -Functions

     userlist ()
     This function is beign used to load info that's needed for the userlist page.
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    userlist ()
    -
    -
    - -

    This function is beign used to load info that's needed for the userlist page.

    -

    this function will return all users by using he pagination class, so that it can be used in the template. Only Mods and Admins can browse this page though.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/users_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/users_8php.html deleted file mode 100644 index baefc8a11..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/users_8php.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/users.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/users.php File Reference
    -
    -
    - - - - -

    -Data Structures

    class  Users
     handles basic user registration & management functions (shard related). More...
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/www_2config_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/www_2config_8php.html deleted file mode 100644 index 2e598c248..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/www_2config_8php.html +++ /dev/null @@ -1,820 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/config.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/config.php File Reference
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    -Variables

     $cfg ['db']['web']['host'] = 'localhost'
     This file contains all variables needed by other php scripts.
     $cfg ['db']['web']['port'] = '3306'
     $cfg ['db']['web']['name'] = 'ryzom_ams'
     $cfg ['db']['web']['user'] = 'shard'
     $cfg ['db']['web']['pass'] = ''
     $cfg ['db']['lib']['host'] = 'localhost'
     $cfg ['db']['lib']['port'] = '3306'
     $cfg ['db']['lib']['name'] = 'ryzom_ams_lib'
     $cfg ['db']['lib']['user'] = 'shard'
     $cfg ['db']['lib']['pass'] = ''
     $cfg ['db']['shard']['host'] = 'localhost'
     $cfg ['db']['shard']['port'] = '3306'
     $cfg ['db']['shard']['name'] = 'nel'
     $cfg ['db']['shard']['user'] = 'shard'
     $cfg ['db']['shard']['pass'] = ''
     $cfg ['db']['ring']['host'] = 'localhost'
     $cfg ['db']['ring']['port'] = '3306'
     $cfg ['db']['ring']['name'] = 'ring_open'
     $cfg ['db']['ring']['user'] = 'shard'
     $cfg ['db']['ring']['pass'] = ''
     $cfg ['mail']['default_mailserver'] = '{imap.gmail.com:993/imap/ssl}INBOX'
     $cfg ['mail']['default_groupemail'] = 'amsryzom@gmail.com'
     $cfg ['mail']['default_groupname'] = 'Ryzomcore Support'
     $cfg ['mail']['default_username'] = 'amsryzom@gmail.com'
     $cfg ['mail']['default_password'] = 'lol123bol'
     $cfg ['mail']['host'] = "ryzomcore.com"
     $SUPPORT_GROUP_IMAP_CRYPTKEY = "azerty"
     $TICKET_MAILING_SUPPORT = true
     $MAIL_DIR = "/tmp/mail"
     $MAIL_LOG_PATH = "/tmp/mail/cron_mail.log"
     $TOS_URL = "http://createyourtos.com"
     $cfg ['crypt']['key'] = 'Sup3rS3cr3tStuff'
     $cfg ['crypt']['enc_method'] = 'AES-256-CBC'
     $cfg ['crypt']['hash_method'] = "SHA512"
     $ALLOW_UNKNOWN = true
     $CREATE_RING = true
     $AMS_LIB = dirname( dirname( __FILE__ ) ) . '/ams_lib'
     $AMS_TRANS = $AMS_LIB . '/translations'
     $AMS_CACHEDIR = $AMS_LIB . '/cache'
     $SITEBASE = dirname( __FILE__ ) . '/html/'
     $BASE_WEBPATH = 'http://localhost:40917/www/html'
     $IMAGELOC_WEBPATH = 'http://localhost:40917/ams_lib/img'
     $WEBPATH = $BASE_WEBPATH . '/index.php'
     $INGAME_WEBPATH = $BASE_WEBPATH . '/index.php'
     $CONFIG_PATH = dirname( __FILE__ )
     $DEFAULT_LANGUAGE = 'en'
     $TICKET_LOGGING = true
     $TIME_FORMAT = "m-d-Y H:i:s"
     $INGAME_LAYOUT = "basic"
     $FORCE_INGAME = false
    -

    Variable Documentation

    - -
    -
    - - - - -
    $ALLOW_UNKNOWN = true
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $AMS_CACHEDIR = $AMS_LIB . '/cache'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $AMS_LIB = dirname( dirname( __FILE__ ) ) . '/ams_lib'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $AMS_TRANS = $AMS_LIB . '/translations'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $BASE_WEBPATH = 'http://localhost:40917/www/html'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['web']['host'] = 'localhost'
    -
    -
    - -

    This file contains all variables needed by other php scripts.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['web']['port'] = '3306'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['web']['name'] = 'ryzom_ams'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['web']['user'] = 'shard'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['web']['pass'] = ''
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['lib']['host'] = 'localhost'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['lib']['port'] = '3306'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['lib']['name'] = 'ryzom_ams_lib'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['lib']['user'] = 'shard'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['lib']['pass'] = ''
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['shard']['host'] = 'localhost'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['shard']['port'] = '3306'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['shard']['name'] = 'nel'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['shard']['user'] = 'shard'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['shard']['pass'] = ''
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['ring']['host'] = 'localhost'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['ring']['port'] = '3306'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['ring']['name'] = 'ring_open'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['ring']['user'] = 'shard'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['db']['ring']['pass'] = ''
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['mail']['default_mailserver'] = '{imap.gmail.com:993/imap/ssl}INBOX'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['mail']['default_groupemail'] = 'amsryzom@gmail.com'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['mail']['default_groupname'] = 'Ryzomcore Support'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['mail']['default_username'] = 'amsryzom@gmail.com'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['mail']['default_password'] = 'lol123bol'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['mail']['host'] = "ryzomcore.com"
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['crypt']['key'] = 'Sup3rS3cr3tStuff'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['crypt']['enc_method'] = 'AES-256-CBC'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $cfg['crypt']['hash_method'] = "SHA512"
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $CONFIG_PATH = dirname( __FILE__ )
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $CREATE_RING = true
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $DEFAULT_LANGUAGE = 'en'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $FORCE_INGAME = false
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $IMAGELOC_WEBPATH = 'http://localhost:40917/ams_lib/img'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $INGAME_LAYOUT = "basic"
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $INGAME_WEBPATH = $BASE_WEBPATH . '/index.php'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $MAIL_DIR = "/tmp/mail"
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $MAIL_LOG_PATH = "/tmp/mail/cron_mail.log"
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $SITEBASE = dirname( __FILE__ ) . '/html/'
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $SUPPORT_GROUP_IMAP_CRYPTKEY = "azerty"
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $TICKET_LOGGING = true
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $TICKET_MAILING_SUPPORT = true
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $TIME_FORMAT = "m-d-Y H:i:s"
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $TOS_URL = "http://createyourtos.com"
    -
    -
    - -
    -
    - -
    -
    - - - - -
    $WEBPATH = $BASE_WEBPATH . '/index.php'
    -
    -
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/www_2html_2autoload_2webusers_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/www_2html_2autoload_2webusers_8php.html deleted file mode 100644 index 9bf55da85..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/www_2html_2autoload_2webusers_8php.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/autoload/webusers.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/autoload/webusers.php File Reference
    -
    -
    - - - - -

    -Data Structures

    class  WebUsers
     handles CMS/WWW related functions regarding user management & registration. More...
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/www_2html_2inc_2logout_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/www_2html_2inc_2logout_8php.html deleted file mode 100644 index d6c860de7..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/www_2html_2inc_2logout_8php.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/logout.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/logout.php File Reference
    -
    -
    - - - - -

    -Functions

     logout ()
     This function is beign used to load info that's needed for the logout page.
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    logout ()
    -
    -
    - -

    This function is beign used to load info that's needed for the logout page.

    -

    it will just unset & destroy the session

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/www_2html_2inc_2settings_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/www_2html_2inc_2settings_8php.html deleted file mode 100644 index d49c641ac..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/www_2html_2inc_2settings_8php.html +++ /dev/null @@ -1,155 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/settings.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/settings.php File Reference
    -
    -
    - - - - - -

    -Functions

     settings ()
     This function is beign used to load info that's needed for the settings page.
     getCountryArray ()
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    getCountryArray ()
    -
    -
    - -
    -
    - -
    -
    - - - - - - - -
    settings ()
    -
    -
    - -

    This function is beign used to load info that's needed for the settings page.

    -

    check if the person who wants to view this page is a mod/admin or the user to whom te settings belong himself, if this is not the case, he will be redirected to an error page. it will return a lot of information of that user, that's being used for loading the template.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/html/www_2html_2inc_2show__user_8php.html b/code/ryzom/tools/server/ryzom_ams_docs/html/www_2html_2inc_2show__user_8php.html deleted file mode 100644 index 48f54f06d..000000000 --- a/code/ryzom/tools/server/ryzom_ams_docs/html/www_2html_2inc_2show__user_8php.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - -Ryzom Account Management System: /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_user.php File Reference - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - -
    -
    Ryzom Account Management System -  1.0 -
    - -
    -
    - - - - - -
    -
    - -
    -
    /home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_user.php File Reference
    -
    -
    - - - - -

    -Functions

     show_user ()
     This function is beign used to load info that's needed for the show_user page.
    -

    Function Documentation

    - -
    -
    - - - - - - - -
    show_user ()
    -
    -
    - -

    This function is beign used to load info that's needed for the show_user page.

    -

    Users can only browse their own user page, while mods/admins can browse all user pages. The current settings of the user being browsed will be loaded, as also their created tickets and this info will be returned so it can be used by the template.

    -
    Author:
    Daan Janssens, mentored by Matthew Lagoe
    - -
    -
    -
    - - - - -
    - -
    - - - - - - - diff --git a/code/ryzom/tools/server/sql/ryzom_admin_default_data.sql b/code/ryzom/tools/server/sql/ryzom_admin_default_data.sql deleted file mode 100644 index f6fca36e6..000000000 --- a/code/ryzom/tools/server/sql/ryzom_admin_default_data.sql +++ /dev/null @@ -1,107 +0,0 @@ -# -------------------------------------------------------- -# Host: 94.23.202.75 -# Database: nel_tool -# Server version: 5.1.37-1ubuntu5.1 -# Server OS: debian-linux-gnu -# HeidiSQL version: 5.0.0.3272 -# Date/time: 2010-05-08 18:16:57 -# -------------------------------------------------------- -USE `nel_tool`; - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET NAMES utf8 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -# Dumping data for table nel_tool.neltool_annotations: 1 rows -/*!40000 ALTER TABLE `neltool_annotations` DISABLE KEYS */; -INSERT IGNORE INTO `neltool_annotations` (`annotation_id`, `annotation_domain_id`, `annotation_shard_id`, `annotation_data`, `annotation_user_name`, `annotation_date`) VALUES (12, NULL, 106, 'Welcome to the Shard Admin Website!', 'vl', 1272378352); -/*!40000 ALTER TABLE `neltool_annotations` ENABLE KEYS */; - -# Dumping data for table nel_tool.neltool_applications: 38 rows -/*!40000 ALTER TABLE `neltool_applications` DISABLE KEYS */; -INSERT IGNORE INTO `neltool_applications` (`application_id`, `application_name`, `application_uri`, `application_restriction`, `application_order`, `application_visible`, `application_icon`) VALUES (1, 'Main', 'index.php', '', 100, 1, 'imgs/icon_main.gif'), (2, 'Logout', 'index.php?mode=logout', '', 999999, 1, 'imgs/icon_logout.gif'), (3, 'Admin', 'tool_administration.php', 'tool_admin', 1500, 1, 'imgs/icon_admin.gif'), (4, 'Prefs', 'tool_preferences.php', 'tool_preferences', 1000, 1, 'imgs/icon_preferences.gif'), (5, 'Admin/Users', '', 'tool_admin_user', 1502, 0, ''), (6, 'Admin/Applications', '', 'tool_admin_application', 1501, 0, ''), (7, 'Admin/Domains', '', 'tool_admin_domain', 1504, 0, ''), (8, 'Admin/Shards', '', 'tool_admin_shard', 1505, 0, ''), (9, 'Admin/Groups', '', 'tool_admin_group', 1503, 0, ''), (10, 'Admin/Logs', '', 'tool_admin_logs', 1506, 0, ''), (11, 'Main/Start', '', 'tool_main_start', 101, 0, ''), (12, 'Main/Stop', '', 'tool_main_stop', 102, 0, ''), (13, 'Main/Restart', '', 'tool_main_restart', 103, 0, ''), (14, 'Main/Kill', '', 'tool_main_kill', 104, 0, ''), (15, 'Main/Abort', '', 'tool_main_abort', 105, 0, ''), (16, 'Main/Execute', '', 'tool_main_execute', 108, 0, ''), (18, 'Notes', 'tool_notes.php', 'tool_notes', 900, 1, 'imgs/icon_notes.gif'), (19, 'Player Locator', 'tool_player_locator.php', 'tool_player_locator', 200, 1, 'imgs/icon_player_locator.gif'), (20, 'Player Locator/Display Players', '', 'tool_player_locator_display_players', 201, 0, ''), (21, 'Player Locator/Locate', '', 'tool_player_locator_locate', 202, 0, ''), (22, 'Main/LockDomain', '', 'tool_main_lock_domain', 110, 0, ''), (23, 'Main/LockShard', '', 'tool_main_lock_shard', 111, 0, ''), (24, 'Main/WS', '', 'tool_main_ws', 112, 0, ''), (25, 'Main/ResetCounters', '', 'tool_main_reset_counters', 113, 0, ''), (26, 'Main/ServiceAutoStart', '', 'tool_main_service_autostart', 114, 0, ''), (27, 'Main/ShardAutoStart', '', 'tool_main_shard_autostart', 115, 0, ''), (28, 'Main/WS/Old', '', 'tool_main_ws_old', 112, 0, ''), (29, 'Graphs', 'tool_graphs.php', 'tool_graph', 500, 1, 'imgs/icon_graphs.gif'), (30, 'Notes/Global', '', 'tool_notes_global', 901, 0, ''), (31, 'Log Analyser', 'tool_log_analyser.php', 'tool_las', 400, 1, 'imgs/icon_log_analyser.gif'), (32, 'Guild Locator', 'tool_guild_locator.php', 'tool_guild_locator', 300, 1, 'imgs/icon_guild_locator.gif'), (33, 'Player Locator/UserID Check', '', 'tool_player_locator_userid_check', 203, 0, ''), (34, 'Player Locator/CSR Relocate', '', 'tool_player_locator_csr_relocate', 204, 0, ''), (35, 'Guild Locator/Guilds Update', '', 'tool_guild_locator_manage_guild', 301, 0, ''), (36, 'Guild Locator/Members Update', '', 'tool_guild_locator_manage_members', 302, 0, ''), (37, 'Entities', 'tool_event_entities.php', 'tool_event_entities', 350, 1, 'imgs/icon_entity.gif'), (38, 'Admin/Restarts', '', 'tool_admin_restart', 1507, 0, ''), (39, 'Main/EasyRestart', '', 'tool_main_easy_restart', 116, 0, ''); -/*!40000 ALTER TABLE `neltool_applications` ENABLE KEYS */; - -# Dumping data for table nel_tool.neltool_domains: 1 rows -/*!40000 ALTER TABLE `neltool_domains` DISABLE KEYS */; -INSERT IGNORE INTO `neltool_domains` (`domain_id`, `domain_name`, `domain_as_host`, `domain_as_port`, `domain_rrd_path`, `domain_las_admin_path`, `domain_las_local_path`, `domain_application`, `domain_sql_string`, `domain_hd_check`, `domain_mfs_web`, `domain_cs_sql_string`) VALUES (12, 'open', 'open', 46700, '/home/nevrax/code/ryzom/server/save_shard/rrd_graphs', '', '', 'ryzom_open', 'mysql://shard@localhost/ring_open', 0, '', 'mysql://shard@localhost/atrium_forums'); -/*!40000 ALTER TABLE `neltool_domains` ENABLE KEYS */; - -# Dumping data for table nel_tool.neltool_groups: 11 rows -/*!40000 ALTER TABLE `neltool_groups` DISABLE KEYS */; -INSERT IGNORE INTO `neltool_groups` (`group_id`, `group_name`, `group_level`, `group_default`, `group_active`, `group_default_domain_id`, `group_default_shard_id`) VALUES (1, 'AdminGroup', 0, 0, 1, 12, 106), (2, 'NevraxGroup', 0, 1, 1, NULL, NULL), (3, 'AdminDebugGroup', 10, 0, 1, 9, 56), (4, 'SupportSGMGroup', 0, 0, 1, NULL, NULL), (5, 'NevraxATSGroup', 0, 0, 1, NULL, NULL), (6, 'SupportGMGroup', 0, 0, 1, NULL, NULL), (7, 'SupportReadOnlyGroup', 0, 0, 1, NULL, NULL), (8, 'NevraxLevelDesigners', 0, 0, 1, NULL, NULL), (9, 'NevraxReadOnlyGroup', 0, 0, 1, 9, 56), (10, 'YubDevGroup', 0, 0, 1, 12, 106), (11, 'GuestGroup', 0, 0, 1, 12, 106); -/*!40000 ALTER TABLE `neltool_groups` ENABLE KEYS */; - -# Dumping data for table nel_tool.neltool_group_applications: 178 rows -/*!40000 ALTER TABLE `neltool_group_applications` DISABLE KEYS */; -INSERT IGNORE INTO `neltool_group_applications` (`group_application_id`, `group_application_group_id`, `group_application_application_id`) VALUES (879, 1, 10), (878, 1, 8), (877, 1, 7), (876, 1, 9), (875, 1, 5), (874, 1, 6), (873, 1, 3), (872, 1, 4), (871, 1, 30), (870, 1, 18), (869, 1, 29), (868, 1, 31), (867, 1, 37), (866, 1, 36), (865, 1, 35), (864, 1, 32), (863, 1, 34), (862, 1, 33), (861, 1, 21), (860, 1, 20), (859, 1, 19), (858, 1, 39), (857, 1, 27), (856, 1, 26), (843, 3, 10), (842, 3, 8), (841, 3, 7), (840, 3, 9), (839, 3, 5), (838, 3, 6), (837, 3, 3), (836, 3, 4), (835, 3, 30), (834, 3, 18), (833, 3, 29), (832, 3, 31), (831, 3, 37), (830, 3, 36), (829, 3, 35), (828, 3, 32), (827, 3, 34), (826, 3, 33), (825, 3, 21), (824, 3, 20), (823, 3, 19), (822, 3, 39), (821, 3, 27), (820, 3, 26), (597, 4, 36), (596, 4, 35), (595, 4, 32), (594, 4, 21), (593, 4, 20), (592, 4, 19), (591, 4, 24), (590, 4, 23), (589, 4, 14), (588, 4, 12), (632, 2, 18), (631, 2, 37), (630, 2, 32), (629, 2, 21), (628, 2, 20), (627, 2, 19), (626, 2, 24), (625, 2, 23), (624, 2, 22), (623, 2, 16), (622, 2, 15), (621, 2, 14), (620, 2, 13), (819, 3, 25), (855, 1, 25), (619, 2, 12), (818, 3, 28), (854, 1, 28), (817, 3, 24), (718, 5, 18), (717, 5, 37), (716, 5, 32), (715, 5, 21), (714, 5, 20), (713, 5, 19), (712, 5, 27), (711, 5, 26), (710, 5, 24), (709, 5, 23), (708, 5, 22), (707, 5, 16), (706, 5, 15), (705, 5, 14), (816, 3, 23), (609, 6, 35), (608, 6, 32), (607, 6, 21), (606, 6, 20), (605, 6, 19), (604, 6, 24), (603, 6, 23), (602, 6, 14), (601, 6, 12), (600, 6, 11), (815, 3, 22), (814, 3, 16), (853, 1, 24), (704, 5, 13), (703, 5, 12), (852, 1, 23), (587, 4, 11), (618, 2, 11), (702, 5, 11), (612, 7, 19), (851, 1, 22), (813, 3, 15), (812, 3, 14), (598, 4, 18), (599, 4, 4), (610, 6, 18), (611, 6, 4), (613, 7, 20), (614, 7, 21), (615, 7, 32), (616, 7, 35), (617, 7, 4), (633, 2, 4), (811, 3, 13), (810, 3, 12), (850, 1, 16), (849, 1, 15), (848, 1, 14), (847, 1, 13), (846, 1, 12), (719, 5, 4), (720, 8, 11), (721, 8, 12), (722, 8, 13), (723, 8, 14), (724, 8, 15), (725, 8, 16), (726, 8, 22), (727, 8, 23), (728, 8, 24), (729, 8, 25), (730, 8, 26), (731, 8, 27), (732, 8, 19), (733, 8, 20), (734, 8, 21), (735, 8, 37), (736, 8, 4), (737, 9, 29), (738, 9, 4), (809, 3, 11), (845, 1, 11), (844, 3, 38), (880, 1, 38), (909, 10, 18), (908, 10, 29), (907, 10, 37), (906, 10, 36), (905, 10, 35), (904, 10, 32), (903, 10, 34), (902, 10, 33), (901, 10, 21), (900, 10, 20), (899, 10, 19), (898, 10, 23), (897, 10, 13), (910, 10, 30), (965, 11, 29), (964, 11, 37), (963, 11, 32), (962, 11, 34), (961, 11, 33), (960, 11, 21), (959, 11, 20), (958, 11, 19); -/*!40000 ALTER TABLE `neltool_group_applications` ENABLE KEYS */; - -# Dumping data for table nel_tool.neltool_group_domains: 25 rows -/*!40000 ALTER TABLE `neltool_group_domains` DISABLE KEYS */; -INSERT IGNORE INTO `neltool_group_domains` (`group_domain_id`, `group_domain_group_id`, `group_domain_domain_id`) VALUES (79, 1, 9), (84, 3, 3), (78, 1, 8), (43, 2, 1), (20, 4, 4), (80, 1, 1), (77, 1, 3), (40, 5, 4), (21, 4, 1), (22, 6, 1), (42, 2, 4), (76, 1, 12), (83, 3, 12), (75, 1, 2), (41, 5, 8), (44, 2, 8), (82, 3, 2), (74, 1, 4), (73, 9, 9), (81, 3, 4), (85, 3, 8), (86, 3, 9), (87, 3, 1), (88, 10, 12), (89, 11, 12); -/*!40000 ALTER TABLE `neltool_group_domains` ENABLE KEYS */; - -# Dumping data for table nel_tool.neltool_group_shards: 154 rows -/*!40000 ALTER TABLE `neltool_group_shards` DISABLE KEYS */; -INSERT IGNORE INTO `neltool_group_shards` (`group_shard_id`, `group_shard_group_id`, `group_shard_shard_id`, `group_shard_domain_id`) VALUES (1513, 3, 43, 1), (1473, 1, 42, 1), (1472, 1, 2, 1), (1471, 1, 3, 1), (1470, 1, 1, 1), (1512, 3, 46, 1), (1511, 3, 45, 1), (1510, 3, 6, 1), (1509, 3, 5, 1), (1508, 3, 58, 9), (1507, 3, 102, 9), (1506, 3, 103, 9), (841, 2, 37, 8), (840, 2, 36, 8), (839, 2, 31, 8), (838, 2, 47, 8), (837, 2, 32, 8), (836, 2, 30, 8), (1469, 1, 44, 1), (1468, 1, 43, 1), (1467, 1, 46, 1), (1466, 1, 45, 1), (1465, 1, 6, 1), (1464, 1, 5, 1), (1463, 1, 58, 9), (1505, 3, 104, 9), (1504, 3, 57, 9), (1488, 3, 10, 2), (1487, 3, 14, 2), (1493, 3, 54, 3), (1486, 3, 8, 2), (1485, 3, 13, 2), (1503, 3, 56, 9), (1502, 3, 40, 8), (1501, 3, 37, 8), (1500, 3, 36, 8), (1499, 3, 31, 8), (1498, 3, 47, 8), (1497, 3, 32, 8), (1496, 3, 30, 8), (1462, 1, 102, 9), (1461, 1, 103, 9), (1492, 3, 53, 3), (1460, 1, 104, 9), (1459, 1, 57, 9), (1458, 1, 56, 9), (1457, 1, 40, 8), (903, 5, 37, 8), (902, 5, 36, 8), (901, 5, 31, 8), (900, 5, 47, 8), (899, 5, 32, 8), (898, 5, 30, 8), (897, 5, 39, 8), (1456, 1, 37, 8), (652, 4, 26, 4), (651, 4, 20, 4), (650, 4, 19, 4), (1491, 3, 15, 3), (1455, 1, 36, 8), (896, 5, 41, 8), (1490, 3, 106, 12), (1454, 1, 31, 8), (895, 5, 18, 4), (894, 5, 26, 4), (893, 5, 20, 4), (646, 4, 23, 4), (645, 4, 22, 4), (644, 4, 21, 4), (835, 2, 39, 8), (834, 2, 41, 8), (833, 2, 4, 1), (832, 2, 44, 1), (831, 2, 43, 1), (830, 2, 42, 1), (829, 2, 2, 1), (828, 2, 46, 1), (827, 2, 45, 1), (826, 2, 3, 1), (825, 2, 1, 1), (824, 2, 6, 1), (892, 5, 19, 4), (1495, 3, 39, 8), (1484, 3, 7, 2), (891, 5, 24, 4), (1489, 3, 107, 12), (1483, 3, 18, 4), (1482, 3, 26, 4), (1481, 3, 20, 4), (1480, 3, 19, 4), (1479, 3, 24, 4), (1453, 1, 47, 8), (1452, 1, 32, 8), (1474, 1, 4, 1), (887, 5, 23, 4), (886, 5, 22, 4), (1451, 1, 30, 8), (1450, 1, 39, 8), (1449, 1, 41, 8), (1448, 1, 54, 3), (1447, 1, 53, 3), (885, 5, 21, 4), (904, 5, 40, 8), (884, 5, 17, 4), (823, 2, 5, 1), (822, 2, 18, 4), (821, 2, 26, 4), (820, 2, 20, 4), (819, 2, 19, 4), (818, 2, 24, 4), (1446, 1, 15, 3), (1385, 9, 58, 9), (1445, 1, 106, 12), (1444, 1, 107, 12), (1443, 1, 10, 2), (1478, 3, 23, 4), (1477, 3, 22, 4), (1494, 3, 41, 8), (814, 2, 23, 4), (813, 2, 22, 4), (812, 2, 21, 4), (653, 4, 42, 1), (654, 4, 43, 1), (655, 4, 44, 1), (1384, 9, 102, 9), (842, 2, 40, 8), (1383, 9, 103, 9), (1382, 9, 104, 9), (811, 2, 17, 4), (1381, 9, 57, 9), (1442, 1, 14, 2), (1476, 3, 21, 4), (1441, 1, 8, 2), (1440, 1, 13, 2), (1380, 9, 56, 9), (1439, 1, 7, 2), (1438, 1, 18, 4), (1437, 1, 26, 4), (1436, 1, 20, 4), (1435, 1, 19, 4), (1434, 1, 24, 4), (1433, 1, 23, 4), (1432, 1, 22, 4), (1431, 1, 21, 4), (1430, 1, 17, 4), (1475, 3, 17, 4), (1514, 3, 44, 1), (1515, 3, 1, 1), (1516, 3, 3, 1), (1517, 3, 2, 1), (1518, 3, 42, 1), (1519, 3, 4, 1), (1520, 10, 106, 12), (1521, 11, 106, 12); -/*!40000 ALTER TABLE `neltool_group_shards` ENABLE KEYS */; - -# Dumping data for table nel_tool.neltool_locks: 0 rows -/*!40000 ALTER TABLE `neltool_locks` DISABLE KEYS */; -/*!40000 ALTER TABLE `neltool_locks` ENABLE KEYS */; - -# Dumping data for table nel_tool.neltool_notes: 8 rows -/*!40000 ALTER TABLE `neltool_notes` DISABLE KEYS */; -INSERT IGNORE INTO `neltool_notes` (`note_id`, `note_user_id`, `note_title`, `note_data`, `note_date`, `note_active`, `note_global`) VALUES (2, 27, 'Welcome', 'Welcome to the shard administration website!\r\n\r\nThis website is used to monitor and restart shards.\r\n\r\nIt also gives some player characters information.', 1272378065, 1, 1), (3, 27, 'Shard Start', '# At the same time : NS and TS\r\n[1 min] : all MS, you can boot them all at the same time\r\n[1 min] : IOS\r\n[3 mins] : GMPS\r\n[3 mins] : EGS\r\n[5 mins] : AI Fyros\r\n[1 min 30] : AI Zorai\r\n[1 min 30] : AI Matis\r\n[1 min 30] : AI TNP\r\n[1 min 30] : AI NPE\r\n[1 min 30] : AI Tryker\r\n[1 min 30] : All FS and SBS at the same time\r\n[30 secs] : WS (atm the WS starts in OPEN mode by default, so be fast before CSR checkage, fix for that inc soon)\r\n\r\nNOTE: you can check the uptime for those timers in the right column of the admin tool: UpTime\r\n', 1158751126, 1, 0), (5, 27, 'shutting supplementary', 'the writing wont change when lock the ws\r\n\r\nuntick previous boxes as you shut down\r\n\r\nwait 5 between the ws and the egs ie egs is 5 past rest is 10 past', 1153395380, 1, 0), (4, 27, 'Shard Stop', '1. Broadcast to warn players\r\n\r\n2. 10 mins before shutdown, lock the WS\r\n\r\n3. At the right time shut down WS\r\n\r\n4. Shut down EGS\r\nOnly the EGS. Wait 5 reals minutes. Goal is to give enough time to egs, in order to save all the info he has to, and letting him sending those message to all services who need it.\r\n\r\n5. Shut down the rest, et voilà, you're done.', 1153314198, 1, 0), (6, 27, 'Start (EGS to high?)', 'If [EGS] is to high on startup:\r\n\r\n[shut down egs]\r\n[5 mins]\r\n\r\n[IOS] & [GPMS] (shut down at same time)\r\n\r\nAfter the services are down follow "UP" process with timers again.\r\n\r\nIOS\r\n[3 mins]\r\nGPMS\r\n[3 mins]\r\nEGS\r\n[5 mins]\r\nbla bla...', 1153395097, 1, 0), (7, 27, 'opening if the egs is too high on reboot', '<kadael> here my note on admin about egs to high on startup\r\n<kadael> ---\r\n<kadael> If [EGS] is to high on startup:\r\n<kadael> [shut down egs]\r\n<kadael> [5 mins]\r\n<kadael> [IOS] & [GPMS] (at same time shut down )\r\n<kadael> after the services are down follow "UP" process with timers again.\r\n<kadael> IOS\r\n<kadael> [3 mins]\r\n<kadael> GPMS\r\n<kadael> [3 mins]\r\n<kadael> EGS\r\n<kadael> [5 mins]\r\n<kadael> bla bla...\r\n<kadael> ---', 1153395362, 1, 0), (10, 27, 'Ring points', 'Commande pour donner tout les points ring à tout le monde :\r\n\r\nDans le DSS d'un Shard Ring entrer : DefaultCharRingAccess f7:j7:l6:d7:p13:g9:a9', 1155722296, 1, 0), (9, 27, 'Start (EGS to high?)', 'If [EGS] is to high on startup: \r\n \r\n [shut down egs] \r\n [5 mins] \r\n \r\n [IOS] & [GPMS] (shut down at same time) \r\n \r\n After the services are down follow "UP" process with timers again. \r\n \r\n IOS \r\n [3 mins] \r\n GPMS \r\n [3 mins] \r\n EGS \r\n [5 mins] \r\n bla bla...', 1153929658, 1, 0); -/*!40000 ALTER TABLE `neltool_notes` ENABLE KEYS */; - -# Dumping data for table nel_tool.neltool_restart_groups: 4 rows -/*!40000 ALTER TABLE `neltool_restart_groups` DISABLE KEYS */; -INSERT IGNORE INTO `neltool_restart_groups` (`restart_group_id`, `restart_group_name`, `restart_group_list`, `restart_group_order`) VALUES (1, 'Low Level', 'rns,ts,ms', '1'), (3, 'Mid Level', 'ios,gpms,egs', '2'), (4, 'High Level', 'ais', '3'), (5, 'Front Level', 'fes,sbs,dss,rws', '4'); -/*!40000 ALTER TABLE `neltool_restart_groups` ENABLE KEYS */; - -# Dumping data for table nel_tool.neltool_restart_messages: 4 rows -/*!40000 ALTER TABLE `neltool_restart_messages` DISABLE KEYS */; -INSERT IGNORE INTO `neltool_restart_messages` (`restart_message_id`, `restart_message_name`, `restart_message_value`, `restart_message_lang`) VALUES (5, 'reboot', 'The shard is about to go down. Please find a safe location and log out.', 'en'), (4, 'reboot', 'Le serveur va redemarrer dans $minutes$ minutes. Merci de vous deconnecter en lieu sur.', 'fr'), (6, 'reboot', 'Der Server wird heruntergefahren. Findet eine sichere Stelle und logt aus.', 'de'), (10, 'reboot', 'Arret du serveur dans $minutes+1$ minutes', 'fr'); -/*!40000 ALTER TABLE `neltool_restart_messages` ENABLE KEYS */; - -# Dumping data for table nel_tool.neltool_restart_sequences: 0 rows -/*!40000 ALTER TABLE `neltool_restart_sequences` DISABLE KEYS */; -/*!40000 ALTER TABLE `neltool_restart_sequences` ENABLE KEYS */; - -# Dumping data for table nel_tool.neltool_shards: 1 rows -/*!40000 ALTER TABLE `neltool_shards` DISABLE KEYS */; -INSERT IGNORE INTO `neltool_shards` (`shard_id`, `shard_name`, `shard_as_id`, `shard_domain_id`, `shard_lang`, `shard_restart`) VALUES (106, 'Open', 'open', 12, 'en', 0); -/*!40000 ALTER TABLE `neltool_shards` ENABLE KEYS */; - -# Dumping data for table nel_tool.neltool_stats_hd_datas: 0 rows -/*!40000 ALTER TABLE `neltool_stats_hd_datas` DISABLE KEYS */; -/*!40000 ALTER TABLE `neltool_stats_hd_datas` ENABLE KEYS */; - -# Dumping data for table nel_tool.neltool_stats_hd_times: 0 rows -/*!40000 ALTER TABLE `neltool_stats_hd_times` DISABLE KEYS */; -/*!40000 ALTER TABLE `neltool_stats_hd_times` ENABLE KEYS */; - -# Dumping data for table nel_tool.neltool_users: 3 rows -/*!40000 ALTER TABLE `neltool_users` DISABLE KEYS */; -INSERT IGNORE INTO `neltool_users` (`user_id`, `user_name`, `user_password`, `user_group_id`, `user_created`, `user_active`, `user_logged_last`, `user_logged_count`, `user_menu_style`) VALUES (27, 'admin', '084e0343a0486ff05530df6c705c8bb4', 1, 1213886454, 1, 1273158945, 382, 2), (32, 'guest', '084e0343a0486ff05530df6c705c8bb4', 1, 1272379014, 1, 1273335407, 273, 2); -/*!40000 ALTER TABLE `neltool_users` ENABLE KEYS */; - -# Dumping data for table nel_tool.neltool_user_applications: 5 rows -/*!40000 ALTER TABLE `neltool_user_applications` DISABLE KEYS */; -INSERT IGNORE INTO `neltool_user_applications` (`user_application_id`, `user_application_user_id`, `user_application_application_id`) VALUES (8, 12, 33), (20, 6, 31), (19, 6, 34), (9, 12, 31), (21, 10, 34); -/*!40000 ALTER TABLE `neltool_user_applications` ENABLE KEYS */; - -# Dumping data for table nel_tool.neltool_user_domains: 11 rows -/*!40000 ALTER TABLE `neltool_user_domains` DISABLE KEYS */; -INSERT IGNORE INTO `neltool_user_domains` (`user_domain_id`, `user_domain_user_id`, `user_domain_domain_id`) VALUES (5, 6, 2), (9, 22, 1), (10, 23, 4), (4, 12, 3), (6, 6, 3), (11, 23, 2), (12, 23, 1), (13, 23, 8), (18, 15, 1), (17, 15, 2), (19, 31, 9); -/*!40000 ALTER TABLE `neltool_user_domains` ENABLE KEYS */; - -# Dumping data for table nel_tool.neltool_user_shards: 81 rows -/*!40000 ALTER TABLE `neltool_user_shards` DISABLE KEYS */; -INSERT IGNORE INTO `neltool_user_shards` (`user_shard_id`, `user_shard_user_id`, `user_shard_shard_id`, `user_shard_domain_id`) VALUES (1, 8, 1, 1), (2, 9, 2, 1), (68, 7, 3, 1), (143, 6, 4, 1), (142, 6, 2, 1), (141, 6, 45, 1), (140, 6, 3, 1), (90, 23, 26, 4), (89, 23, 20, 4), (13, 14, 1, 1), (14, 14, 3, 1), (15, 14, 2, 1), (139, 6, 1, 1), (74, 17, 2, 1), (73, 17, 45, 1), (72, 17, 3, 1), (71, 17, 1, 1), (70, 17, 18, 4), (88, 23, 19, 4), (87, 23, 24, 4), (83, 23, 23, 4), (82, 23, 22, 4), (81, 23, 21, 4), (34, 12, 15, 3), (36, 18, 2, 1), (138, 6, 7, 2), (80, 23, 17, 4), (79, 22, 45, 1), (78, 22, 3, 1), (77, 21, 45, 1), (76, 21, 3, 1), (75, 17, 4, 1), (69, 7, 45, 1), (146, 6, 54, 3), (91, 23, 18, 4), (92, 23, 7, 2), (93, 23, 13, 2), (94, 23, 8, 2), (95, 23, 14, 2), (145, 6, 53, 3), (97, 23, 10, 2), (144, 6, 15, 3), (99, 23, 5, 1), (100, 23, 6, 1), (101, 23, 1, 1), (102, 23, 3, 1), (103, 23, 45, 1), (104, 23, 46, 1), (105, 23, 2, 1), (106, 23, 42, 1), (107, 23, 43, 1), (108, 23, 44, 1), (109, 23, 4, 1), (110, 23, 41, 8), (111, 23, 39, 8), (112, 23, 30, 8), (113, 23, 32, 8), (114, 23, 47, 8), (115, 23, 31, 8), (116, 23, 36, 8), (117, 23, 37, 8), (118, 23, 40, 8), (156, 15, 45, 1), (155, 15, 3, 1), (154, 15, 1, 1), (153, 15, 6, 1), (152, 15, 5, 1), (151, 15, 10, 2), (150, 15, 14, 2), (149, 15, 8, 2), (148, 15, 13, 2), (147, 15, 7, 2), (157, 15, 46, 1), (158, 15, 2, 1), (159, 15, 42, 1), (160, 15, 43, 1), (161, 15, 44, 1), (162, 15, 4, 1), (163, 31, 57, 9), (164, 31, 104, 9), (165, 31, 103, 9); -/*!40000 ALTER TABLE `neltool_user_shards` ENABLE KEYS */; -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; diff --git a/code/ryzom/tools/server/sql/ryzom_default_data.sql b/code/ryzom/tools/server/sql/ryzom_default_data.sql deleted file mode 100644 index 3439e27f4..000000000 --- a/code/ryzom/tools/server/sql/ryzom_default_data.sql +++ /dev/null @@ -1,49 +0,0 @@ -# -------------------------------------------------------- -# Host: 94.23.202.75 -# Database: nel -# Server version: 5.1.37-1ubuntu5.1 -# Server OS: debian-linux-gnu -# HeidiSQL version: 5.0.0.3272 -# Date/time: 2010-05-08 15:31:21 -# -------------------------------------------------------- -USE `nel`; - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET NAMES utf8 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -# Dumping data for table nel.domain: 8 rows -/*!40000 ALTER TABLE `domain` DISABLE KEYS */; -INSERT IGNORE INTO `domain` (`domain_id`, `domain_name`, `status`, `patch_version`, `backup_patch_url`, `patch_urls`, `login_address`, `session_manager_address`, `ring_db_name`, `web_host`, `web_host_php`, `description`) VALUES (12, 'ryzom_open', 'ds_open', 610, 'http://open.ryzom.com:23001', NULL, 'open.ryzom.com:49998', 'open.ryzom.com:49999', 'ring_open', 'open.ryzom.com:30000', 'open.ryzom.com:40916', 'Open Domain'); -/*!40000 ALTER TABLE `domain` ENABLE KEYS */; - -# Dumping data for table nel.shard: 17 rows -/*!40000 ALTER TABLE `shard` DISABLE KEYS */; -INSERT IGNORE INTO `shard` (`ShardId`, `domain_id`, `WsAddr`, `NbPlayers`, `Name`, `Online`, `ClientApplication`, `Version`, `PatchURL`, `DynPatchURL`, `FixedSessionId`, `State`, `MOTD`, `prim`) VALUES (302, 12, 'open.ryzom.com', 0, 'Open Shard', 0, 'ryzom_open', '', '', '', 0, 'ds_dev', '', 30); -/*!40000 ALTER TABLE `shard` ENABLE KEYS */; -# -------------------------------------------------------- -# Host: 94.23.202.75 -# Database: ring_open -# Server version: 5.1.37-1ubuntu5.1 -# Server OS: debian-linux-gnu -# HeidiSQL version: 5.0.0.3272 -# Date/time: 2010-05-08 15:31:22 -# -------------------------------------------------------- -USE `ring_open`; - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET NAMES utf8 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -# Dumping data for table ring_open.sessions: 1 rows -/*!40000 ALTER TABLE `sessions` DISABLE KEYS */; -INSERT IGNORE INTO `sessions` (`session_id`, `session_type`, `title`, `owner`, `plan_date`, `start_date`, `description`, `orientation`, `level`, `rule_type`, `access_type`, `state`, `host_shard_id`, `subscription_slots`, `reserved_slots`, `free_slots`, `estimated_duration`, `final_duration`, `folder_id`, `lang`, `icone`, `anim_mode`, `race_filter`, `religion_filter`, `guild_filter`, `shard_filter`, `level_filter`, `subscription_closed`, `newcomer`) VALUES (302, 'st_mainland', 'open shard mainland', 0, '2005-09-21 12:41:33', '2005-08-31 00:00:00', '', 'so_other', 'sl_a', 'rt_strict', 'at_public', 'ss_planned', 0, 0, 0, 0, 'et_short', 0, 0, 'lang_en', '', 'am_dm', 'rf_fyros,rf_matis,rf_tryker,rf_zorai', 'rf_kami,rf_karavan,rf_neutral', 'gf_any_player', '', 'lf_a,lf_b,lf_c,lf_d,lf_e,lf_f', 0, 0); -/*!40000 ALTER TABLE `sessions` ENABLE KEYS */; - -# Dumping data for table ring_open.shard: 1 rows -/*!40000 ALTER TABLE `shard` DISABLE KEYS */; -INSERT IGNORE INTO `shard` (`shard_id`, `WSOnline`, `MOTD`, `OldState`, `RequiredState`) VALUES (302, 1, 'Shard up', 'ds_restricted', 'ds_open'); -/*!40000 ALTER TABLE `shard` ENABLE KEYS */; -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; diff --git a/code/ryzom/tools/server/sql/ryzom_tables.sql b/code/ryzom/tools/server/sql/ryzom_tables.sql deleted file mode 100644 index 158d359a4..000000000 --- a/code/ryzom/tools/server/sql/ryzom_tables.sql +++ /dev/null @@ -1,812 +0,0 @@ -# -------------------------------------------------------- -# Host: 94.23.202.75 -# Database: nel -# Server version: 5.1.37-1ubuntu5.1 -# Server OS: debian-linux-gnu -# HeidiSQL version: 5.0.0.3272 -# Date/time: 2010-05-08 09:14:27 -# -------------------------------------------------------- - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET NAMES utf8 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -# Dumping database structure for nel -CREATE DATABASE IF NOT EXISTS `nel` /*!40100 DEFAULT CHARACTER SET latin1 */; -USE `nel`; - - -# Dumping structure for table nel.domain -CREATE TABLE IF NOT EXISTS `domain` ( - `domain_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `domain_name` varchar(32) NOT NULL DEFAULT '', - `status` enum('ds_close','ds_dev','ds_restricted','ds_open') NOT NULL DEFAULT 'ds_dev', - `patch_version` int(10) unsigned NOT NULL DEFAULT '0', - `backup_patch_url` varchar(255) DEFAULT NULL, - `patch_urls` text, - `login_address` varchar(255) NOT NULL DEFAULT '', - `session_manager_address` varchar(255) NOT NULL DEFAULT '', - `ring_db_name` varchar(255) NOT NULL DEFAULT '', - `web_host` varchar(255) NOT NULL DEFAULT '', - `web_host_php` varchar(255) NOT NULL DEFAULT '', - `description` varchar(200) DEFAULT NULL, - PRIMARY KEY (`domain_id`), - UNIQUE KEY `name_idx` (`domain_name`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -# Data exporting was unselected. - - -# Dumping structure for table nel.permission -CREATE TABLE IF NOT EXISTS `permission` ( - `UId` int(10) unsigned NOT NULL DEFAULT '0', - `ClientApplication` char(64) NOT NULL DEFAULT 'ryzom', - `ShardId` int(10) NOT NULL DEFAULT '-1', - `AccessPrivilege` set('OPEN','DEV','RESTRICTED') NOT NULL DEFAULT 'OPEN', - `prim` int(10) unsigned NOT NULL AUTO_INCREMENT, - PRIMARY KEY (`prim`), - KEY `UIDIndex` (`UId`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -# Data exporting was unselected. - - -# Dumping structure for table nel.shard -CREATE TABLE IF NOT EXISTS `shard` ( - `ShardId` int(10) NOT NULL DEFAULT '0', - `domain_id` int(11) unsigned NOT NULL DEFAULT '0', - `WsAddr` varchar(64) DEFAULT NULL, - `NbPlayers` int(10) unsigned DEFAULT '0', - `Name` varchar(255) DEFAULT 'unknown shard', - `Online` tinyint(1) unsigned DEFAULT '0', - `ClientApplication` varchar(64) DEFAULT 'ryzom', - `Version` varchar(64) NOT NULL DEFAULT '', - `PatchURL` varchar(255) NOT NULL DEFAULT '', - `DynPatchURL` varchar(255) NOT NULL DEFAULT '', - `FixedSessionId` int(11) unsigned NOT NULL DEFAULT '0', - `State` enum('ds_close','ds_dev','ds_restricted','ds_open') NOT NULL DEFAULT 'ds_dev', - `MOTD` text NOT NULL, - `prim` int(10) unsigned NOT NULL AUTO_INCREMENT, - PRIMARY KEY (`prim`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='contains all shards information for login system'; - -# Data exporting was unselected. - - -# Dumping structure for table nel.user -CREATE TABLE IF NOT EXISTS `user` ( - `UId` int(10) NOT NULL AUTO_INCREMENT, - `Login` varchar(64) NOT NULL DEFAULT '', - `Password` varchar(13) DEFAULT NULL, - `ShardId` int(10) NOT NULL DEFAULT '-1', - `State` enum('Offline','Online') NOT NULL DEFAULT 'Offline', - `Privilege` varchar(255) NOT NULL DEFAULT '', - `GroupName` varchar(255) NOT NULL DEFAULT '', - `FirstName` varchar(255) NOT NULL DEFAULT '', - `LastName` varchar(255) NOT NULL DEFAULT '', - `Birthday` varchar(32) NOT NULL DEFAULT '', - `Gender` tinyint(1) unsigned NOT NULL DEFAULT '0', - `Country` char(2) NOT NULL DEFAULT '', - `Email` varchar(255) NOT NULL DEFAULT '', - `Address` varchar(255) NOT NULL DEFAULT '', - `City` varchar(100) NOT NULL DEFAULT '', - `PostalCode` varchar(10) NOT NULL DEFAULT '', - `USState` char(2) NOT NULL DEFAULT '', - `Chat` char(2) NOT NULL DEFAULT '0', - `BetaKeyId` int(10) unsigned NOT NULL DEFAULT '0', - `CachedCoupons` varchar(255) NOT NULL DEFAULT '', - `ProfileAccess` varchar(45) DEFAULT NULL, - `Level` int(2) NOT NULL DEFAULT '0', - `CurrentFunds` int(4) NOT NULL DEFAULT '0', - `IdBilling` varchar(255) NOT NULL DEFAULT '', - `Community` char(2) NOT NULL DEFAULT '--', - `Newsletter` tinyint(1) NOT NULL DEFAULT '1', - `Account` varchar(64) NOT NULL DEFAULT '', - `ChoiceSubLength` tinyint(2) NOT NULL DEFAULT '0', - `CurrentSubLength` varchar(255) NOT NULL DEFAULT '0', - `ValidIdBilling` int(4) NOT NULL DEFAULT '0', - `GMId` int(4) NOT NULL DEFAULT '0', - `ExtendedPrivilege` varchar(128) NOT NULL DEFAULT '', - `ToolsGroup` varchar(20) NOT NULL DEFAULT '', - `Unsubscribe` date NOT NULL DEFAULT '0000-00-00', - `SubDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `SubIp` varchar(20) NOT NULL DEFAULT '', - `SecurePassword` varchar(32) NOT NULL DEFAULT '', - `LastInvoiceEmailCheck` date NOT NULL DEFAULT '0000-00-00', - `FromSource` varchar(8) NOT NULL DEFAULT '', - `ValidMerchantCode` varchar(13) NOT NULL DEFAULT '', - `PBC` tinyint(1) NOT NULL DEFAULT '0', - `ApiKeySeed` varchar(8) DEFAULT NULL, - PRIMARY KEY (`UId`), - KEY `LoginIndex` (`Login`), - KEY `GroupIndex` (`GroupName`), - KEY `ToolsGroup` (`ToolsGroup`), - KEY `CurrentSubLength` (`CurrentSubLength`), - KEY `Community` (`Community`), - KEY `Email` (`Email`), - KEY `GMId` (`GMId`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='contains all users information for login system'; - -# Data exporting was unselected. -# -------------------------------------------------------- -# Host: 94.23.202.75 -# Database: nel_tool -# Server version: 5.1.37-1ubuntu5.1 -# Server OS: debian-linux-gnu -# HeidiSQL version: 5.0.0.3272 -# Date/time: 2010-05-08 09:14:28 -# -------------------------------------------------------- - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET NAMES utf8 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -# Dumping database structure for nel_tool -CREATE DATABASE IF NOT EXISTS `nel_tool` /*!40100 DEFAULT CHARACTER SET latin1 */; -USE `nel_tool`; - - -# Dumping structure for table nel_tool.neltool_annotations -CREATE TABLE IF NOT EXISTS `neltool_annotations` ( - `annotation_id` int(11) NOT NULL AUTO_INCREMENT, - `annotation_domain_id` int(11) DEFAULT NULL, - `annotation_shard_id` int(11) DEFAULT NULL, - `annotation_data` varchar(255) NOT NULL DEFAULT '', - `annotation_user_name` varchar(32) NOT NULL DEFAULT '', - `annotation_date` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`annotation_id`), - UNIQUE KEY `annotation_shard_id` (`annotation_shard_id`), - UNIQUE KEY `annotation_domain_id` (`annotation_domain_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -# Data exporting was unselected. - - -# Dumping structure for table nel_tool.neltool_applications -CREATE TABLE IF NOT EXISTS `neltool_applications` ( - `application_id` int(11) NOT NULL AUTO_INCREMENT, - `application_name` varchar(64) NOT NULL DEFAULT '', - `application_uri` varchar(255) NOT NULL DEFAULT '', - `application_restriction` varchar(64) NOT NULL DEFAULT '', - `application_order` int(11) NOT NULL DEFAULT '0', - `application_visible` int(11) NOT NULL DEFAULT '0', - `application_icon` varchar(128) NOT NULL DEFAULT '', - PRIMARY KEY (`application_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -# Data exporting was unselected. - - -# Dumping structure for table nel_tool.neltool_domains -CREATE TABLE IF NOT EXISTS `neltool_domains` ( - `domain_id` int(11) NOT NULL AUTO_INCREMENT, - `domain_name` varchar(128) NOT NULL DEFAULT '', - `domain_as_host` varchar(128) NOT NULL DEFAULT '', - `domain_as_port` int(11) NOT NULL DEFAULT '0', - `domain_rrd_path` varchar(255) NOT NULL DEFAULT '', - `domain_las_admin_path` varchar(255) NOT NULL DEFAULT '', - `domain_las_local_path` varchar(255) NOT NULL DEFAULT '', - `domain_application` varchar(128) NOT NULL DEFAULT '', - `domain_sql_string` varchar(128) NOT NULL DEFAULT '', - `domain_hd_check` int(11) NOT NULL DEFAULT '0', - `domain_mfs_web` text, - `domain_cs_sql_string` varchar(255) DEFAULT NULL, - PRIMARY KEY (`domain_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -# Data exporting was unselected. - - -# Dumping structure for table nel_tool.neltool_groups -CREATE TABLE IF NOT EXISTS `neltool_groups` ( - `group_id` int(11) NOT NULL AUTO_INCREMENT, - `group_name` varchar(32) NOT NULL DEFAULT 'NewGroup', - `group_level` int(11) NOT NULL DEFAULT '0', - `group_default` int(11) NOT NULL DEFAULT '0', - `group_active` int(11) NOT NULL DEFAULT '0', - `group_default_domain_id` tinyint(3) unsigned DEFAULT NULL, - `group_default_shard_id` tinyint(3) unsigned DEFAULT NULL, - PRIMARY KEY (`group_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -# Data exporting was unselected. - - -# Dumping structure for table nel_tool.neltool_group_applications -CREATE TABLE IF NOT EXISTS `neltool_group_applications` ( - `group_application_id` int(11) NOT NULL AUTO_INCREMENT, - `group_application_group_id` int(11) NOT NULL DEFAULT '0', - `group_application_application_id` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`group_application_id`), - KEY `group_application_group_id` (`group_application_group_id`), - KEY `group_application_application_id` (`group_application_application_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -# Data exporting was unselected. - - -# Dumping structure for table nel_tool.neltool_group_domains -CREATE TABLE IF NOT EXISTS `neltool_group_domains` ( - `group_domain_id` int(11) NOT NULL AUTO_INCREMENT, - `group_domain_group_id` int(11) NOT NULL DEFAULT '0', - `group_domain_domain_id` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`group_domain_id`), - KEY `group_domain_group_id` (`group_domain_group_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -# Data exporting was unselected. - - -# Dumping structure for table nel_tool.neltool_group_shards -CREATE TABLE IF NOT EXISTS `neltool_group_shards` ( - `group_shard_id` int(11) NOT NULL AUTO_INCREMENT, - `group_shard_group_id` int(11) NOT NULL DEFAULT '0', - `group_shard_shard_id` int(11) NOT NULL DEFAULT '0', - `group_shard_domain_id` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`group_shard_id`), - KEY `group_shard_group_id` (`group_shard_group_id`), - KEY `group_shard_domain_id` (`group_shard_domain_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -# Data exporting was unselected. - - -# Dumping structure for table nel_tool.neltool_locks -CREATE TABLE IF NOT EXISTS `neltool_locks` ( - `lock_id` int(11) NOT NULL AUTO_INCREMENT, - `lock_domain_id` int(11) DEFAULT NULL, - `lock_shard_id` int(11) DEFAULT NULL, - `lock_user_name` varchar(32) NOT NULL DEFAULT '', - `lock_date` int(11) NOT NULL DEFAULT '0', - `lock_update` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`lock_id`), - UNIQUE KEY `lock_shard_id` (`lock_shard_id`), - UNIQUE KEY `lock_domain_id` (`lock_domain_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -# Data exporting was unselected. - - -# Dumping structure for table nel_tool.neltool_logs -CREATE TABLE IF NOT EXISTS `neltool_logs` ( - `logs_id` int(11) NOT NULL AUTO_INCREMENT, - `logs_user_name` varchar(32) NOT NULL DEFAULT '0', - `logs_date` int(11) NOT NULL DEFAULT '0', - `logs_data` varchar(255) NOT NULL DEFAULT '', - PRIMARY KEY (`logs_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -# Data exporting was unselected. - - -# Dumping structure for table nel_tool.neltool_notes -CREATE TABLE IF NOT EXISTS `neltool_notes` ( - `note_id` int(11) NOT NULL AUTO_INCREMENT, - `note_user_id` int(11) NOT NULL DEFAULT '0', - `note_title` varchar(128) NOT NULL DEFAULT '', - `note_data` text NOT NULL, - `note_date` int(11) NOT NULL DEFAULT '0', - `note_active` int(11) NOT NULL DEFAULT '0', - `note_global` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`note_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -# Data exporting was unselected. - - -# Dumping structure for table nel_tool.neltool_restart_groups -CREATE TABLE IF NOT EXISTS `neltool_restart_groups` ( - `restart_group_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `restart_group_name` varchar(50) DEFAULT NULL, - `restart_group_list` varchar(50) DEFAULT NULL, - `restart_group_order` varchar(50) DEFAULT NULL, - PRIMARY KEY (`restart_group_id`), - UNIQUE KEY `restart_group_id` (`restart_group_id`), - KEY `restart_group_id_2` (`restart_group_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -# Data exporting was unselected. - - -# Dumping structure for table nel_tool.neltool_restart_messages -CREATE TABLE IF NOT EXISTS `neltool_restart_messages` ( - `restart_message_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `restart_message_name` varchar(20) DEFAULT NULL, - `restart_message_value` varchar(128) DEFAULT NULL, - `restart_message_lang` varchar(5) DEFAULT NULL, - PRIMARY KEY (`restart_message_id`), - UNIQUE KEY `restart_message_id` (`restart_message_id`), - KEY `restart_message_id_2` (`restart_message_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -# Data exporting was unselected. - - -# Dumping structure for table nel_tool.neltool_restart_sequences -CREATE TABLE IF NOT EXISTS `neltool_restart_sequences` ( - `restart_sequence_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `restart_sequence_domain_id` int(10) unsigned NOT NULL DEFAULT '0', - `restart_sequence_shard_id` int(10) unsigned NOT NULL DEFAULT '0', - `restart_sequence_user_name` varchar(50) DEFAULT NULL, - `restart_sequence_step` int(10) unsigned NOT NULL DEFAULT '0', - `restart_sequence_date_start` int(11) DEFAULT NULL, - `restart_sequence_date_end` int(11) DEFAULT NULL, - `restart_sequence_timer` int(11) unsigned DEFAULT '0', - PRIMARY KEY (`restart_sequence_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -# Data exporting was unselected. - - -# Dumping structure for table nel_tool.neltool_shards -CREATE TABLE IF NOT EXISTS `neltool_shards` ( - `shard_id` int(11) NOT NULL AUTO_INCREMENT, - `shard_name` varchar(128) NOT NULL DEFAULT '', - `shard_as_id` varchar(255) NOT NULL DEFAULT '0', - `shard_domain_id` int(11) NOT NULL DEFAULT '0', - `shard_lang` char(2) NOT NULL DEFAULT 'en', - `shard_restart` int(10) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`shard_id`), - KEY `shard_domain_id` (`shard_domain_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -# Data exporting was unselected. - - -# Dumping structure for table nel_tool.neltool_stats_hd_datas -CREATE TABLE IF NOT EXISTS `neltool_stats_hd_datas` ( - `hd_id` int(11) NOT NULL AUTO_INCREMENT, - `hd_domain_id` int(11) NOT NULL DEFAULT '0', - `hd_server` varchar(32) NOT NULL DEFAULT '', - `hd_device` varchar(64) NOT NULL DEFAULT '', - `hd_size` varchar(16) NOT NULL DEFAULT '', - `hd_used` varchar(16) NOT NULL DEFAULT '', - `hd_free` varchar(16) NOT NULL DEFAULT '', - `hd_percent` int(11) NOT NULL DEFAULT '0', - `hd_mount` varchar(128) NOT NULL DEFAULT '', - PRIMARY KEY (`hd_id`), - KEY `hd_domain_id` (`hd_domain_id`), - KEY `hd_server` (`hd_server`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -# Data exporting was unselected. - - -# Dumping structure for table nel_tool.neltool_stats_hd_times -CREATE TABLE IF NOT EXISTS `neltool_stats_hd_times` ( - `hd_domain_id` int(11) NOT NULL DEFAULT '0', - `hd_last_time` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`hd_domain_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -# Data exporting was unselected. - - -# Dumping structure for table nel_tool.neltool_users -CREATE TABLE IF NOT EXISTS `neltool_users` ( - `user_id` int(11) NOT NULL AUTO_INCREMENT, - `user_name` varchar(32) NOT NULL DEFAULT '', - `user_password` varchar(64) NOT NULL DEFAULT '', - `user_group_id` int(11) NOT NULL DEFAULT '0', - `user_created` int(11) NOT NULL DEFAULT '0', - `user_active` int(11) NOT NULL DEFAULT '0', - `user_logged_last` int(11) NOT NULL DEFAULT '0', - `user_logged_count` int(11) NOT NULL DEFAULT '0', - `user_menu_style` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`user_id`), - UNIQUE KEY `user_login` (`user_name`), - KEY `user_group_id` (`user_group_id`), - KEY `user_active` (`user_active`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -# Data exporting was unselected. - - -# Dumping structure for table nel_tool.neltool_user_applications -CREATE TABLE IF NOT EXISTS `neltool_user_applications` ( - `user_application_id` int(11) NOT NULL AUTO_INCREMENT, - `user_application_user_id` int(11) NOT NULL DEFAULT '0', - `user_application_application_id` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`user_application_id`), - KEY `user_application_user_id` (`user_application_user_id`), - KEY `user_application_application_id` (`user_application_application_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -# Data exporting was unselected. - - -# Dumping structure for table nel_tool.neltool_user_domains -CREATE TABLE IF NOT EXISTS `neltool_user_domains` ( - `user_domain_id` int(11) NOT NULL AUTO_INCREMENT, - `user_domain_user_id` int(11) NOT NULL DEFAULT '0', - `user_domain_domain_id` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`user_domain_id`), - KEY `user_domain_user_id` (`user_domain_user_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -# Data exporting was unselected. - - -# Dumping structure for table nel_tool.neltool_user_shards -CREATE TABLE IF NOT EXISTS `neltool_user_shards` ( - `user_shard_id` int(11) NOT NULL AUTO_INCREMENT, - `user_shard_user_id` int(11) NOT NULL DEFAULT '0', - `user_shard_shard_id` int(11) NOT NULL DEFAULT '0', - `user_shard_domain_id` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`user_shard_id`), - KEY `user_shard_user_id` (`user_shard_user_id`), - KEY `user_shard_domain_id` (`user_shard_domain_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -# Data exporting was unselected. -# -------------------------------------------------------- -# Host: 94.23.202.75 -# Database: ring_open -# Server version: 5.1.37-1ubuntu5.1 -# Server OS: debian-linux-gnu -# HeidiSQL version: 5.0.0.3272 -# Date/time: 2010-05-08 09:14:32 -# -------------------------------------------------------- - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET NAMES utf8 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -# Dumping database structure for ring_open -CREATE DATABASE IF NOT EXISTS `ring_open` /*!40100 DEFAULT CHARACTER SET latin1 */; -USE `ring_open`; - - -# Dumping structure for table ring_open.characters -CREATE TABLE IF NOT EXISTS `characters` ( - `char_id` int(10) unsigned NOT NULL DEFAULT '0', - `char_name` varchar(20) NOT NULL DEFAULT '', - `user_id` int(10) unsigned NOT NULL DEFAULT '0', - `guild_id` int(10) unsigned NOT NULL DEFAULT '0', - `best_combat_level` int(10) unsigned NOT NULL DEFAULT '0', - `home_mainland_session_id` int(10) unsigned NOT NULL DEFAULT '0', - `ring_access` varchar(63) NOT NULL DEFAULT '', - `race` enum('r_fyros','r_matis','r_tryker','r_zorai') NOT NULL DEFAULT 'r_fyros', - `civilisation` enum('c_neutral','c_fyros','c_fyros','c_matis','c_tryker','c_zorai') NOT NULL DEFAULT 'c_neutral', - `cult` enum('c_neutral','c_kami','c_karavan') NOT NULL DEFAULT 'c_neutral', - `current_session` int(11) unsigned NOT NULL DEFAULT '0', - `rrp_am` int(11) unsigned NOT NULL DEFAULT '0', - `rrp_masterless` int(11) unsigned NOT NULL DEFAULT '0', - `rrp_author` int(11) unsigned NOT NULL DEFAULT '0', - `newcomer` tinyint(1) NOT NULL DEFAULT '1', - `creation_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `last_played_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - PRIMARY KEY (`char_id`), - UNIQUE KEY `char_name_idx` (`char_name`,`home_mainland_session_id`), - KEY `user_id_idx` (`user_id`), - KEY `guild_idx` (`guild_id`), - KEY `guild_id_idx` (`guild_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -# Data exporting was unselected. - - -# Dumping structure for table ring_open.folder -CREATE TABLE IF NOT EXISTS `folder` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `owner` int(10) unsigned NOT NULL DEFAULT '0', - `title` varchar(40) NOT NULL DEFAULT '', - `comments` text NOT NULL, - PRIMARY KEY (`Id`), - KEY `owner_idx` (`owner`), - KEY `title_idx` (`title`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC; - -# Data exporting was unselected. - - -# Dumping structure for table ring_open.folder_access -CREATE TABLE IF NOT EXISTS `folder_access` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `folder_id` int(10) unsigned NOT NULL DEFAULT '0', - `user_id` int(10) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`Id`), - KEY `folder_id_idx` (`folder_id`), - KEY `user_idx` (`user_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED; - -# Data exporting was unselected. - - -# Dumping structure for table ring_open.guilds -CREATE TABLE IF NOT EXISTS `guilds` ( - `guild_id` int(10) unsigned NOT NULL DEFAULT '0', - `guild_name` varchar(50) NOT NULL DEFAULT '', - `shard_id` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`guild_id`), - KEY `shard_id_idx` (`shard_id`), - KEY `guild_name_idx` (`guild_name`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC; - -# Data exporting was unselected. - - -# Dumping structure for table ring_open.guild_invites -CREATE TABLE IF NOT EXISTS `guild_invites` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `session_id` int(10) unsigned NOT NULL DEFAULT '0', - `guild_id` int(10) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`Id`), - KEY `guild_id_idx` (`guild_id`), - KEY `session_id_idx` (`session_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED; - -# Data exporting was unselected. - - -# Dumping structure for table ring_open.journal_entry -CREATE TABLE IF NOT EXISTS `journal_entry` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `session_id` int(10) unsigned NOT NULL DEFAULT '0', - `author` int(10) unsigned NOT NULL DEFAULT '0', - `type` enum('jet_credits','jet_notes') NOT NULL DEFAULT 'jet_notes', - `text` text NOT NULL, - `time_stamp` datetime NOT NULL DEFAULT '2005-09-07 12:41:33', - PRIMARY KEY (`Id`), - KEY `session_id_idx` (`session_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC; - -# Data exporting was unselected. - - -# Dumping structure for table ring_open.known_users -CREATE TABLE IF NOT EXISTS `known_users` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `owner` int(10) unsigned NOT NULL DEFAULT '0', - `targer_user` int(10) unsigned NOT NULL DEFAULT '0', - `targer_character` int(10) unsigned NOT NULL DEFAULT '0', - `relation_type` enum('rt_friend','rt_banned','rt_friend_dm') NOT NULL DEFAULT 'rt_friend', - `comments` varchar(255) NOT NULL DEFAULT '', - PRIMARY KEY (`Id`), - KEY `user_index` (`owner`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC; - -# Data exporting was unselected. - - -# Dumping structure for table ring_open.mfs_erased_mail_series -CREATE TABLE IF NOT EXISTS `mfs_erased_mail_series` ( - `erased_char_id` int(11) unsigned NOT NULL DEFAULT '0', - `erased_char_name` varchar(32) NOT NULL DEFAULT '', - `erased_series` int(11) unsigned NOT NULL AUTO_INCREMENT, - `erase_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - PRIMARY KEY (`erased_series`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC; - -# Data exporting was unselected. - - -# Dumping structure for table ring_open.mfs_guild_thread -CREATE TABLE IF NOT EXISTS `mfs_guild_thread` ( - `thread_id` int(11) NOT NULL AUTO_INCREMENT, - `guild_id` int(11) unsigned NOT NULL DEFAULT '0', - `topic` varchar(255) NOT NULL DEFAULT '', - `author_name` varchar(32) NOT NULL DEFAULT '', - `last_post_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `post_count` int(11) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`thread_id`), - KEY `guild_index` (`guild_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC; - -# Data exporting was unselected. - - -# Dumping structure for table ring_open.mfs_guild_thread_message -CREATE TABLE IF NOT EXISTS `mfs_guild_thread_message` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `thread_id` int(11) unsigned NOT NULL DEFAULT '0', - `author_name` varchar(32) NOT NULL DEFAULT '', - `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `content` text NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC; - -# Data exporting was unselected. - - -# Dumping structure for table ring_open.mfs_mail -CREATE TABLE IF NOT EXISTS `mfs_mail` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `sender_name` varchar(32) NOT NULL DEFAULT '', - `subject` varchar(250) NOT NULL DEFAULT '', - `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `status` enum('ms_new','ms_read','ms_erased') NOT NULL DEFAULT 'ms_new', - `dest_char_id` int(11) unsigned NOT NULL DEFAULT '0', - `erase_series` int(11) unsigned NOT NULL DEFAULT '0', - `content` text NOT NULL, - PRIMARY KEY (`id`), - KEY `dest_index` (`dest_char_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC; - -# Data exporting was unselected. - - -# Dumping structure for table ring_open.outlands -CREATE TABLE IF NOT EXISTS `outlands` ( - `session_id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `island_name` text NOT NULL, - `billing_instance_id` int(11) unsigned NOT NULL DEFAULT '0', - `anim_session_id` int(11) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`session_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -# Data exporting was unselected. - - -# Dumping structure for table ring_open.player_rating -CREATE TABLE IF NOT EXISTS `player_rating` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `scenario_id` int(10) unsigned NOT NULL DEFAULT '0', - `session_id` int(10) unsigned NOT NULL DEFAULT '0', - `rate_fun` tinyint(3) unsigned NOT NULL DEFAULT '0', - `rate_difficulty` tinyint(3) unsigned NOT NULL DEFAULT '0', - `rate_accessibility` tinyint(3) unsigned NOT NULL DEFAULT '0', - `rate_originality` tinyint(3) unsigned NOT NULL DEFAULT '0', - `rate_direction` tinyint(3) unsigned NOT NULL DEFAULT '0', - `author` int(10) unsigned NOT NULL DEFAULT '0', - `rating` int(10) NOT NULL DEFAULT '0', - `comments` text NOT NULL, - `time_stamp` datetime NOT NULL DEFAULT '2005-09-07 12:41:33', - PRIMARY KEY (`Id`), - KEY `session_id_idx` (`scenario_id`), - KEY `author_idx` (`author`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC; - -# Data exporting was unselected. - - -# Dumping structure for table ring_open.ring_users -CREATE TABLE IF NOT EXISTS `ring_users` ( - `user_id` int(10) unsigned NOT NULL DEFAULT '0', - `user_name` varchar(20) NOT NULL DEFAULT '', - `user_type` enum('ut_character','ut_pioneer') NOT NULL DEFAULT 'ut_character', - `current_session` int(10) unsigned NOT NULL DEFAULT '0', - `current_activity` enum('ca_none','ca_play','ca_edit','ca_anim') NOT NULL DEFAULT 'ca_none', - `current_status` enum('cs_offline','cs_logged','cs_online') NOT NULL DEFAULT 'cs_offline', - `public_level` enum('pl_none','pl_public') NOT NULL DEFAULT 'pl_none', - `account_type` enum('at_normal','at_gold') NOT NULL DEFAULT 'at_normal', - `content_access_level` varchar(20) NOT NULL DEFAULT '', - `description` text NOT NULL, - `lang` enum('lang_en','lang_fr','lang_de') NOT NULL DEFAULT 'lang_en', - `cookie` varchar(30) NOT NULL DEFAULT '', - `current_domain_id` int(10) NOT NULL DEFAULT '-1', - `pioneer_char_id` int(11) unsigned NOT NULL DEFAULT '0', - `current_char` int(11) NOT NULL DEFAULT '0', - `add_privileges` varchar(64) NOT NULL DEFAULT '', - PRIMARY KEY (`user_id`), - UNIQUE KEY `user_name_idx` (`user_name`), - KEY `cookie_idx` (`cookie`), - KEY `current_session_idx` (`current_session`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC; - -# Data exporting was unselected. - - -# Dumping structure for table ring_open.scenario -CREATE TABLE IF NOT EXISTS `scenario` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `md5` varchar(64) NOT NULL DEFAULT '', - `title` varchar(32) NOT NULL DEFAULT '', - `description` text NOT NULL, - `author` varchar(32) NOT NULL DEFAULT '', - `rrp_total` int(11) unsigned NOT NULL DEFAULT '0', - `anim_mode` enum('am_dm','am_autonomous') NOT NULL DEFAULT 'am_dm', - `language` varchar(11) NOT NULL DEFAULT '', - `orientation` enum('so_newbie_training','so_story_telling','so_mistery','so_hack_slash','so_guild_training','so_other') NOT NULL DEFAULT 'so_other', - `level` enum('sl_a','sl_b','sl_c','sl_d','sl_e','sl_f') NOT NULL DEFAULT 'sl_a', - `allow_free_trial` tinyint(1) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC; - -# Data exporting was unselected. - - -# Dumping structure for table ring_open.scenario_desc -CREATE TABLE IF NOT EXISTS `scenario_desc` ( - `session_id` int(10) unsigned NOT NULL DEFAULT '0', - `parent_scenario` int(10) unsigned NOT NULL DEFAULT '0', - `description` text NOT NULL, - `relation_to_parent` enum('rtp_same','rtp_variant','rtp_different') NOT NULL DEFAULT 'rtp_same', - `title` varchar(40) NOT NULL DEFAULT '', - `num_player` int(10) unsigned NOT NULL DEFAULT '0', - `content_access_level` varchar(20) NOT NULL DEFAULT '', - PRIMARY KEY (`session_id`), - UNIQUE KEY `title_idx` (`title`), - KEY `parent_idx` (`parent_scenario`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC; - -# Data exporting was unselected. - - -# Dumping structure for table ring_open.sessions -CREATE TABLE IF NOT EXISTS `sessions` ( - `session_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `session_type` enum('st_edit','st_anim','st_outland','st_mainland') NOT NULL DEFAULT 'st_edit', - `title` varchar(40) NOT NULL DEFAULT '', - `owner` int(10) unsigned NOT NULL DEFAULT '0', - `plan_date` datetime NOT NULL DEFAULT '2005-09-21 12:41:33', - `start_date` datetime NOT NULL DEFAULT '2005-08-31 00:00:00', - `description` text NOT NULL, - `orientation` enum('so_newbie_training','so_story_telling','so_mistery','so_hack_slash','so_guild_training','so_other') NOT NULL DEFAULT 'so_other', - `level` enum('sl_a','sl_b','sl_c','sl_d','sl_e','sl_f') NOT NULL DEFAULT 'sl_a', - `rule_type` enum('rt_strict','rt_liberal') NOT NULL DEFAULT 'rt_strict', - `access_type` enum('at_public','at_private') NOT NULL DEFAULT 'at_private', - `state` enum('ss_planned','ss_open','ss_locked','ss_closed') NOT NULL DEFAULT 'ss_planned', - `host_shard_id` int(11) NOT NULL DEFAULT '0', - `subscription_slots` int(11) unsigned NOT NULL DEFAULT '0', - `reserved_slots` int(10) unsigned NOT NULL DEFAULT '0', - `free_slots` int(10) unsigned NOT NULL DEFAULT '0', - `estimated_duration` enum('et_short','et_medium','et_long') NOT NULL DEFAULT 'et_short', - `final_duration` int(10) unsigned NOT NULL DEFAULT '0', - `folder_id` int(10) unsigned NOT NULL DEFAULT '0', - `lang` varchar(20) NOT NULL DEFAULT '', - `icone` varchar(70) NOT NULL DEFAULT '', - `anim_mode` enum('am_dm','am_autonomous') NOT NULL DEFAULT 'am_dm', - `race_filter` set('rf_fyros','rf_matis','rf_tryker','rf_zorai') NOT NULL DEFAULT '', - `religion_filter` set('rf_kami','rf_karavan','rf_neutral') NOT NULL DEFAULT '', - `guild_filter` enum('gf_only_my_guild','gf_any_player') DEFAULT 'gf_only_my_guild', - `shard_filter` set('sf_shard00','sf_shard01','sf_shard02','sf_shard03','sf_shard04','sf_shard05','sf_shard06','sf_shard07','sf_shard08','sf_shard09','sf_shard10','sf_shard11','sf_shard12','sf_shard13','sf_shard14','sf_shard15','sf_shard16','sf_shard17','sf_shard18','sf_shard19','sf_shard20','sf_shard21','sf_shard22','sf_shard23','sf_shard24','sf_shard25','sf_shard26','sf_shard27','sf_shard28','sf_shard29','sf_shard30','sf_shard31') NOT NULL DEFAULT 'sf_shard00,sf_shard01,sf_shard02,sf_shard03,sf_shard04,sf_shard05,sf_shard06,sf_shard07,sf_shard08,sf_shard09,sf_shard10,sf_shard11,sf_shard12,sf_shard13,sf_shard14,sf_shard15,sf_shard16,sf_shard17,sf_shard18,sf_shard19,sf_shard20,sf_shard21,sf_shard22,sf_shard23,sf_shard24,sf_shard25,sf_shard26,sf_shard27,sf_shard28,sf_shard29,sf_shard30,sf_shard31', - `level_filter` set('lf_a','lf_b','lf_c','lf_d','lf_e','lf_f') NOT NULL DEFAULT 'lf_a,lf_b,lf_c,lf_d,lf_e,lf_f', - `subscription_closed` tinyint(1) NOT NULL DEFAULT '0', - `newcomer` tinyint(1) unsigned zerofill NOT NULL DEFAULT '0', - PRIMARY KEY (`session_id`), - KEY `owner_idx` (`owner`), - KEY `folder_idx` (`folder_id`), - KEY `state_type_idx` (`state`,`session_type`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC; - -# Data exporting was unselected. - - -# Dumping structure for table ring_open.session_log -CREATE TABLE IF NOT EXISTS `session_log` ( - `id` int(11) NOT NULL DEFAULT '0', - `scenario_id` int(11) unsigned NOT NULL DEFAULT '0', - `rrp_scored` int(11) unsigned NOT NULL DEFAULT '0', - `scenario_point_scored` int(11) unsigned NOT NULL DEFAULT '0', - `time_taken` int(11) unsigned NOT NULL DEFAULT '0', - `participants` text NOT NULL, - `launch_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `owner` varchar(32) NOT NULL DEFAULT '0', - `guild_name` varchar(50) DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC; - -# Data exporting was unselected. - - -# Dumping structure for table ring_open.session_participant -CREATE TABLE IF NOT EXISTS `session_participant` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `session_id` int(10) unsigned NOT NULL DEFAULT '0', - `char_id` int(10) unsigned NOT NULL DEFAULT '0', - `status` enum('sps_play_subscribed','sps_play_invited','sps_edit_invited','sps_anim_invited','sps_playing','sps_editing','sps_animating') NOT NULL DEFAULT 'sps_play_subscribed', - `kicked` tinyint(1) unsigned NOT NULL DEFAULT '0', - `session_rated` tinyint(1) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`Id`), - KEY `session_idx` (`session_id`), - KEY `user_idx` (`char_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED; - -# Data exporting was unselected. - - -# Dumping structure for table ring_open.shard -CREATE TABLE IF NOT EXISTS `shard` ( - `shard_id` int(10) NOT NULL DEFAULT '0', - `WSOnline` tinyint(1) NOT NULL DEFAULT '0', - `MOTD` text NOT NULL, - `OldState` enum('ds_close','ds_dev','ds_restricted','ds_open') NOT NULL DEFAULT 'ds_restricted', - `RequiredState` enum('ds_close','ds_dev','ds_restricted','ds_open') NOT NULL DEFAULT 'ds_dev', - PRIMARY KEY (`shard_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED; - -# Data exporting was unselected. -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; diff --git a/code/ryzom/tools/server/www/login/config.php b/code/ryzom/tools/server/www/login/config.php deleted file mode 100644 index 11deb410b..000000000 --- a/code/ryzom/tools/server/www/login/config.php +++ /dev/null @@ -1,27 +0,0 @@ - diff --git a/code/ryzom/tools/translation_tools/main.cpp b/code/ryzom/tools/translation_tools/main.cpp index 9eba8c8da..30054ffbd 100644 --- a/code/ryzom/tools/translation_tools/main.cpp +++ b/code/ryzom/tools/translation_tools/main.cpp @@ -95,16 +95,6 @@ const std::string historyDir("history/"); string diffVersion; -#ifndef NL_OS_WINDOWS -char* itoa(int val, char *buffer, int base){ - static char buf[32] = {0}; - int i = 30; - for(; val && i ; --i, val /= base) - buf[i] = "0123456789abcdef"[val % base]; - return &buf[i+1]; -} -#endif // NL_OS_WINDOWS - #ifdef NL_DEBUG # define LOG nldebug #else @@ -969,7 +959,6 @@ public: void onChanged(uint addIndex, uint refIndex, TPhraseDiffContext &context) { ucstring chg; - char temp[1024]; // check what is changed. if (context.Addition[addIndex].Parameters != context.Reference[refIndex].Parameters) chg += "// Parameter list changed." + nl; @@ -980,11 +969,11 @@ public: for (uint i=0; i tempV; tempV.push_back(context.Reference[refIndex]); ucstring tempT = preparePhraseFile(tempV, false); CI18N::removeCComment(tempT); - phrase.Comments = ucstring(temp) + nl + phrase.Comments; + phrase.Comments = ucstring("// DIFF CHANGED ") + toString(addIndex) + nl + phrase.Comments; phrase.Comments = phrase.Comments + ucstring("/* OLD VALUE : ["+nl) + tabLines(1, tempT) +nl + "] */" + nl; phrase.Comments = phrase.Comments + chg; @@ -2682,7 +2669,6 @@ void CMakePhraseDiff2::onRemove(uint addIndex, uint refIndex, TPhraseDiffContext void CMakePhraseDiff2::onChanged(uint addIndex, uint refIndex, TPhraseDiffContext &context) { ucstring chg; - char temp[1024]; // check what is changed. if (context.Addition[addIndex].Parameters != context.Reference[refIndex].Parameters) chg += "// Parameter list changed." + nl; @@ -2693,11 +2679,11 @@ void CMakePhraseDiff2::onChanged(uint addIndex, uint refIndex, TPhraseDiffContex for (uint i=0; i tempV; tempV.push_back(context.Reference[refIndex]); ucstring tempT = preparePhraseFile(tempV, false); CI18N::removeCComment(tempT); - phrase.Comments = ucstring(temp) + nl + phrase.Comments; + phrase.Comments = ucstring("// DIFF CHANGED ") + toString(addIndex) + nl + phrase.Comments; phrase.Comments = phrase.Comments + ucstring("/* OLD VALUE : ["+nl) + tabLines(1, tempT) +nl + "] */" + nl; phrase.Comments = phrase.Comments + chg; diff --git a/code/snowballs2/client/src/camera.cpp b/code/snowballs2/client/src/camera.cpp index 9d9a5f777..0b7971192 100644 --- a/code/snowballs2/client/src/camera.cpp +++ b/code/snowballs2/client/src/camera.cpp @@ -128,6 +128,7 @@ void initCamera() StereoHMD->setScale(3.0f); // snowballs is about 4 units per meter } StereoDisplay->setDriver(Driver); // move after driver creation, move stereodisplay before driver creation + StereoDisplay->attachToDisplay(); } } } diff --git a/code/snowballs2/client/src/commands.cpp b/code/snowballs2/client/src/commands.cpp index 41faeab1e..d1929ab49 100644 --- a/code/snowballs2/client/src/commands.cpp +++ b/code/snowballs2/client/src/commands.cpp @@ -296,7 +296,7 @@ void initCommands() CommandsMaterial.setBlend(true); #if SBCLIENT_DEV_PIXEL_PROGRAM - CommandsMaterial.getObjectPtr()->setShader(NL3D::CMaterial::PostProcessing); + CommandsMaterial.getObjectPtr()->setShader(NL3D::CMaterial::Program); a_NelLogo = Driver->createTextureFile("nel128.tga"); CommandsMaterial.setTexture(dynamic_cast(a_NelLogo)); static const char *program_arbfp1 = @@ -340,7 +340,24 @@ void initCommands() "mov oC0.xzw, c0.xyyx\n" "texld oC0.y, v0, s0\n"; NL3D::IDriver *d = dynamic_cast(Driver)->getDriver(); - if (d->supportPixelProgram(CPixelProgram::fp40)) + a_DevPixelProgram = new CPixelProgram(); + // arbfp1 + { + IProgram::CSource *source = new IProgram::CSource(); + source->Features.MaterialFlags = CProgramFeatures::TextureStages; + source->Profile = IProgram::arbfp1; + source->setSourcePtr(program_arbfp1); + a_DevPixelProgram->addSource(source); + } + // ps_2_0 + { + IProgram::CSource *source = new IProgram::CSource(); + source->Features.MaterialFlags = CProgramFeatures::TextureStages; + source->Profile = IProgram::ps_2_0; + source->setSourcePtr(program_ps_2_0); + a_DevPixelProgram->addSource(source); + } + /*if (d->supportPixelProgram(CPixelProgram::fp40)) { nldebug("fp40"); a_DevPixelProgram = new CPixelProgram(program_fp40); @@ -349,14 +366,14 @@ void initCommands() { nldebug("arbfp1"); a_DevPixelProgram = new CPixelProgram(program_arbfp1); - } + }*/ /*else if (d->supportPixelProgram(CPixelProgram::ps_3_0)) { nldebug("ps_3_0"); a_DevPixelProgram = new CPixelProgram(program_ps_3_0); // Textures do not seem to work with ps_3_0... }*/ - else if (d->supportPixelProgram(CPixelProgram::ps_2_0)) + /*else if (d->supportPixelProgram(CPixelProgram::ps_2_0)) { nldebug("ps_2_0"); a_DevPixelProgram = new CPixelProgram(program_ps_2_0); @@ -365,7 +382,7 @@ void initCommands() { nldebug("ps_1_1"); a_DevPixelProgram = new CPixelProgram(program_ps_1_1); - } + }*/ #endif } @@ -385,17 +402,6 @@ void updateCommands() float CommandsBoxHeight = ((float)(sint32)((CommandsNbLines + 1) * CommandsLineHeight * width)) / width; float CommandsBoxBorderX = ((float)(sint32)(SBCLIENT::CommandsBoxBorder * width)) / width; float CommandsBoxBorderY = ((float)(sint32)(SBCLIENT::CommandsBoxBorder * height)) / height; - if (StereoHMD) - { - float xshift, yshift; - StereoHMD->getInterface2DShift(0, xshift, yshift, 4.f); - // snap to pixels - xshift = ((float)(sint32)(xshift * width)) / width; - yshift = ((float)(sint32)(yshift * height)) / height; - // adjust - CommandsBoxX += xshift; - CommandsBoxY += yshift; - } // Display the background Driver->setMatrixMode2D11 (); diff --git a/code/snowballs2/client/src/compass.cpp b/code/snowballs2/client/src/compass.cpp index 27e0e27f1..1c36d1f6b 100644 --- a/code/snowballs2/client/src/compass.cpp +++ b/code/snowballs2/client/src/compass.cpp @@ -95,13 +95,6 @@ void updateCompass () { float x = CompassPosX; float y = CompassPosY; - if (StereoHMD) - { - float xshift, yshift; - StereoHMD->getInterface2DShift(0, xshift, yshift, 4.f); - x += xshift; - y += yshift; - } float radius = CompassRadius; // tri @@ -117,8 +110,7 @@ void updateCompass () quad.V2.set ( radius, radius, 0); quad.V3.set (-radius, radius, 0); - if (StereoHMD) Driver->setMatrixMode2D11(); - else Driver->setMatrixMode2D43(); + Driver->setMatrixMode2D43(); CMatrix mtx; @@ -161,7 +153,7 @@ void updateCompass () Driver->setModelMatrix (mtx); Driver->drawQuad (quad, CompassMaterial); - if (!StereoHMD) x *= 3.0/4.0f; + x *= 3.0/4.0f; // Print position TextContext->setHotSpot(UTextContext::MiddleTop); diff --git a/code/snowballs2/client/src/snowballs_client.cpp b/code/snowballs2/client/src/snowballs_client.cpp index b401d80bc..059960922 100644 --- a/code/snowballs2/client/src/snowballs_client.cpp +++ b/code/snowballs2/client/src/snowballs_client.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #if SBCLIENT_DEV_STEREO # include #endif /* #if SBCLIENT_DEV_STEREO */ @@ -153,6 +154,7 @@ static IStereoRender *_StereoRender = NULL; #endif /* #if SBCLIENT_DEV_STEREO */ static bool s_EnableBloom = false; +static CFXAA *s_FXAA = NULL; // // Prototypes @@ -185,6 +187,7 @@ void cbGraphicsDriver(CConfigFile::CVar &var); void cbSquareBloom(CConfigFile::CVar &var); void cbDensityBloom(CConfigFile::CVar &var); void cbEnableBloom(CConfigFile::CVar &var); +void cbEnableFXAA(CConfigFile::CVar &var); // // Functions @@ -324,6 +327,7 @@ void initCore() ConfigFile->getVar("ScreenFull").asInt()==0)); TextContext = Driver->createTextContext(CPath::lookup(ConfigFile->getVar("FontName").asString())); TextContext->setShaded(true); + TextContext->setShadeOutline(false); TextContext->setKeep800x600Ratio(false); // You can't call displayLoadingState() before init the loading state system displayLoadingState("Initialize Loading"); @@ -373,10 +377,11 @@ void initIngame() // initialize bloom effect CBloomEffect::instance().setDriver(Driver); CBloomEffect::instance().setScene(Scene); - CBloomEffect::instance().init(ConfigFile->getVar("OpenGL").asInt() == 1); + CBloomEffect::instance().init(); CConfiguration::setAndCallback("SquareBloom", cbSquareBloom); CConfiguration::setAndCallback("DensityBloom", cbDensityBloom); CConfiguration::setAndCallback("EnableBloom", cbEnableBloom); + CConfiguration::setAndCallback("EnableFXAA", cbEnableFXAA); // Init the landscape using the previously created UScene displayLoadingState("Initialize Landscape"); initLandscape(); @@ -740,7 +745,19 @@ void loopIngame() else { uint i = 0; - uint bloomStage = 0; + bool effectRender = false; + CTextureUser *effectRenderTarget = NULL; + bool haveEffects = Driver->getPolygonMode() == UDriver::Filled + && (s_EnableBloom || s_FXAA); + bool defaultRenderTarget = false; + if (haveEffects) + { + if (!StereoDisplay) + { + Driver->beginDefaultRenderTarget(); + defaultRenderTarget = true; + } + } while ((!StereoDisplay && i == 0) || (StereoDisplay && StereoDisplay->nextPass())) { ++i; @@ -762,13 +779,7 @@ void loopIngame() if (!StereoDisplay || StereoDisplay->wantClear()) { - - if (s_EnableBloom) - { - nlassert(bloomStage == 0); - CBloomEffect::instance().initBloom(); // start bloom effect (just before the first scene element render) - bloomStage = 1; - } + effectRender = haveEffects; // 01. Render Driver (background color) Driver->clearBuffers(CRGBA(0, 0, 127)); // clear all buffers, if you see this blue there's a problem with scene rendering @@ -788,13 +799,16 @@ void loopIngame() if (!StereoDisplay || StereoDisplay->wantInterface3D()) { - if (s_EnableBloom && bloomStage == 1) + if (effectRender) { - // End the actual bloom effect visible in the scene. if (StereoDisplay) Driver->setViewport(NL3D::CViewport()); - CBloomEffect::instance().endBloom(); + UCamera pCam = Scene->getCam(); + Driver->setMatrixMode2D11(); + if (s_FXAA) s_FXAA->applyEffect(); + if (s_EnableBloom) CBloomEffect::instance().applyBloom(); + Driver->setMatrixMode3D(pCam); if (StereoDisplay) Driver->setViewport(StereoDisplay->getCurrentViewport()); - bloomStage = 2; + effectRender = false; } // 06. Render Interface 3D (player names) @@ -803,15 +817,6 @@ void loopIngame() if (!StereoDisplay || StereoDisplay->wantInterface2D()) { - if (s_EnableBloom && bloomStage == 2) - { - // End bloom effect system after drawing the 3d interface (z buffer related). - if (StereoDisplay) Driver->setViewport(NL3D::CViewport()); - CBloomEffect::instance().endInterfacesDisplayBloom(); - if (StereoDisplay) Driver->setViewport(StereoDisplay->getCurrentViewport()); - bloomStage = 0; - } - // 07. Render Interface 2D (chatboxes etc, optionally does have 3d) updateCompass(); // Update the compass updateRadar(); // Update the radar @@ -833,6 +838,11 @@ void loopIngame() } // 09. Render Buffer + if (defaultRenderTarget) + { + // draw final result to backbuffer + Driver->endDefaultRenderTarget(Scene); + } Driver->swapBuffers(); } @@ -965,6 +975,22 @@ void cbEnableBloom(CConfigFile::CVar &var) s_EnableBloom = var.asBool(); } +void cbEnableFXAA(CConfigFile::CVar &var) +{ + bool enable = var.asBool(); + if (enable != (s_FXAA != NULL)) + { + if (enable) + { + s_FXAA = new CFXAA(Driver); + } + else + { + delete s_FXAA; + } + } +} + // // Loading state procedure // @@ -1238,6 +1264,7 @@ sint main(int argc, char **argv) { // use log.log if NEL_LOG_IN_FILE and SBCLIENT_USE_LOG_LOG defined as 1 createDebug(NULL, SBCLIENT_USE_LOG_LOG, false); + INelContext::getInstance().setWindowedApplication(true); #if SBCLIENT_USE_LOG // create snowballs_client.log diff --git a/code/snowballs2/server/frontend/src/main.cpp b/code/snowballs2/server/frontend/src/main.cpp index 7b3470cbe..38bcc18fc 100644 --- a/code/snowballs2/server/frontend/src/main.cpp +++ b/code/snowballs2/server/frontend/src/main.cpp @@ -229,7 +229,7 @@ void cbAddClient ( CMessage& msgin, TSockId from, CCallbackNetBase& clientcb ) if(from->appId() != 0) { - CPlayer *p = (CPlayer *)(uint)from->appId(); + CPlayer *p = (CPlayer *)(void *)from->appId(); if(id == p->id) p->State = CPlayer::ONLINE; } @@ -590,12 +590,12 @@ void onDisconnectClient ( TSockId from, void *arg ) { uint32 id; - uint64 i = from->appId(); + uintptr_t i = from->appId(); if(i == 0) return; - CPlayer *p = (CPlayer *)(uint)i; + CPlayer *p = (CPlayer *)(void *)i; id = p->id; nlinfo( "A client with unique Id %u has disconnected", id ); diff --git a/code/nel/tools/3d/object_viewer_qt/CMakeLists.txt b/code/studio/CMakeLists.txt similarity index 72% rename from code/nel/tools/3d/object_viewer_qt/CMakeLists.txt rename to code/studio/CMakeLists.txt index ff1128b9f..c10f2ea59 100644 --- a/code/nel/tools/3d/object_viewer_qt/CMakeLists.txt +++ b/code/studio/CMakeLists.txt @@ -10,15 +10,18 @@ IF(WIN32) SET(OVQT_PLUGIN_SPECS_DIR "plugins") SET(OVQT_PLUGIN_DIR "plugins") SET(OVQT_DATA_DIR ".") + SET(OVQT_IMP_DATA_DIR "${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 ".") + SET(OVQT_IMP_DATA_DIR "${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) + SET(OVQT_PLUGIN_SPECS_DIR ${NL_SHARE_PREFIX}/studio/plugins) + SET(OVQT_PLUGIN_DIR ${NL_LIB_PREFIX}/studio) + SET(OVQT_DATA_DIR ${NL_SHARE_PREFIX}/studio/data) + SET(OVQT_IMP_DATA_DIR "${CMAKE_INSTALL_PREFIX}/${OVQT_DATA_DIR}") CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/ovqt_config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/ovqt_config.h) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) @@ -27,7 +30,7 @@ ELSE(WIN32) ENDIF(WIN32) IF(UNIX AND WITH_STATIC) - MESSAGE(FATAL_ERROR "OVQT does not work with static NeL builds on Unix atm.") + MESSAGE(FATAL_ERROR "Studio does not work with static NeL builds on Unix atm.") ENDIF() ADD_SUBDIRECTORY(src) diff --git a/code/nel/tools/3d/object_viewer_qt/data/andbasr.ttf b/code/studio/data/andbasr.ttf similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/data/andbasr.ttf rename to code/studio/data/andbasr.ttf diff --git a/code/nel/tools/3d/object_viewer_qt/doc/html/cdirection_widget.png b/code/studio/doc/html/cdirection_widget.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/doc/html/cdirection_widget.png rename to code/studio/doc/html/cdirection_widget.png diff --git a/code/nel/tools/3d/object_viewer_qt/doc/html/cedit_color_widget.png b/code/studio/doc/html/cedit_color_widget.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/doc/html/cedit_color_widget.png rename to code/studio/doc/html/cedit_color_widget.png diff --git a/code/nel/tools/3d/object_viewer_qt/doc/html/cedit_range_float_widget.png b/code/studio/doc/html/cedit_range_float_widget.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/doc/html/cedit_range_float_widget.png rename to code/studio/doc/html/cedit_range_float_widget.png diff --git a/code/nel/tools/3d/object_viewer_qt/doc/html/cedit_range_int_widget.png b/code/studio/doc/html/cedit_range_int_widget.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/doc/html/cedit_range_int_widget.png rename to code/studio/doc/html/cedit_range_int_widget.png diff --git a/code/nel/tools/3d/object_viewer_qt/doc/html/gui_struct.png b/code/studio/doc/html/gui_struct.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/doc/html/gui_struct.png rename to code/studio/doc/html/gui_struct.png diff --git a/code/nel/tools/3d/object_viewer_qt/doc/html/object_viewer_qt_window.png b/code/studio/doc/html/object_viewer_qt_window.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/doc/html/object_viewer_qt_window.png rename to code/studio/doc/html/object_viewer_qt_window.png diff --git a/code/nel/tools/3d/object_viewer_qt/doc/make_ovqt_dox.bat b/code/studio/doc/make_ovqt_dox.bat similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/doc/make_ovqt_dox.bat rename to code/studio/doc/make_ovqt_dox.bat diff --git a/code/nel/tools/3d/object_viewer_qt/doc/make_ovqt_dox.sh b/code/studio/doc/make_ovqt_dox.sh similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/doc/make_ovqt_dox.sh rename to code/studio/doc/make_ovqt_dox.sh diff --git a/code/nel/tools/3d/object_viewer_qt/doc/ovqt.dox b/code/studio/doc/ovqt.dox similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/doc/ovqt.dox rename to code/studio/doc/ovqt.dox diff --git a/code/studio/ovqt_config.h.cmake b/code/studio/ovqt_config.h.cmake new file mode 100644 index 000000000..9d4907473 --- /dev/null +++ b/code/studio/ovqt_config.h.cmake @@ -0,0 +1,7 @@ +#ifndef OVQT_CONFIG_H +#define OVQT_CONFIG_H + +#define DATA_DIR "${NL_SHARE_ABSOLUTE_PREFIX}/studio" +#define PLUGINS_DIR "${NL_LIB_ABSOLUTE_PREFIX}/studio" + +#endif diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/CMakeLists.txt b/code/studio/src/3rdparty/CMakeLists.txt similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/CMakeLists.txt rename to code/studio/src/3rdparty/CMakeLists.txt diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/CMakeLists.txt b/code/studio/src/3rdparty/qtpropertybrowser/CMakeLists.txt similarity index 97% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/CMakeLists.txt rename to code/studio/src/3rdparty/qtpropertybrowser/CMakeLists.txt index f4ed13e0a..fa834dabf 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/CMakeLists.txt +++ b/code/studio/src/3rdparty/qtpropertybrowser/CMakeLists.txt @@ -96,3 +96,5 @@ ADD_DEFINITIONS(-DQT_SHARED) NL_DEFAULT_PROPS(qt_property_browser "3rdParty: Qt Property Browser 2.5") NL_ADD_RUNTIME_FLAGS(qt_property_browser) NL_ADD_LIB_SUFFIX(qt_property_browser) + +INSTALL(TARGETS qt_property_browser LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries) diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/LGPL_EXCEPTION.txt b/code/studio/src/3rdparty/qtpropertybrowser/LGPL_EXCEPTION.txt similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/LGPL_EXCEPTION.txt rename to code/studio/src/3rdparty/qtpropertybrowser/LGPL_EXCEPTION.txt diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/LICENSE.GPL3 b/code/studio/src/3rdparty/qtpropertybrowser/LICENSE.GPL3 similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/LICENSE.GPL3 rename to code/studio/src/3rdparty/qtpropertybrowser/LICENSE.GPL3 diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/LICENSE.LGPL b/code/studio/src/3rdparty/qtpropertybrowser/LICENSE.LGPL similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/LICENSE.LGPL rename to code/studio/src/3rdparty/qtpropertybrowser/LICENSE.LGPL diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtAbstractEditorFactoryBase b/code/studio/src/3rdparty/qtpropertybrowser/QtAbstractEditorFactoryBase similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtAbstractEditorFactoryBase rename to code/studio/src/3rdparty/qtpropertybrowser/QtAbstractEditorFactoryBase diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtAbstractPropertyBrowser b/code/studio/src/3rdparty/qtpropertybrowser/QtAbstractPropertyBrowser similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtAbstractPropertyBrowser rename to code/studio/src/3rdparty/qtpropertybrowser/QtAbstractPropertyBrowser diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtAbstractPropertyManager b/code/studio/src/3rdparty/qtpropertybrowser/QtAbstractPropertyManager similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtAbstractPropertyManager rename to code/studio/src/3rdparty/qtpropertybrowser/QtAbstractPropertyManager diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtBoolPropertyManager b/code/studio/src/3rdparty/qtpropertybrowser/QtBoolPropertyManager similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtBoolPropertyManager rename to code/studio/src/3rdparty/qtpropertybrowser/QtBoolPropertyManager diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtBrowserItem b/code/studio/src/3rdparty/qtpropertybrowser/QtBrowserItem similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtBrowserItem rename to code/studio/src/3rdparty/qtpropertybrowser/QtBrowserItem diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtButtonPropertyBrowser b/code/studio/src/3rdparty/qtpropertybrowser/QtButtonPropertyBrowser similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtButtonPropertyBrowser rename to code/studio/src/3rdparty/qtpropertybrowser/QtButtonPropertyBrowser diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtCharEditorFactory b/code/studio/src/3rdparty/qtpropertybrowser/QtCharEditorFactory similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtCharEditorFactory rename to code/studio/src/3rdparty/qtpropertybrowser/QtCharEditorFactory diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtCharPropertyManager b/code/studio/src/3rdparty/qtpropertybrowser/QtCharPropertyManager similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtCharPropertyManager rename to code/studio/src/3rdparty/qtpropertybrowser/QtCharPropertyManager diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtCheckBoxFactory b/code/studio/src/3rdparty/qtpropertybrowser/QtCheckBoxFactory similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtCheckBoxFactory rename to code/studio/src/3rdparty/qtpropertybrowser/QtCheckBoxFactory diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtColorEditorFactory b/code/studio/src/3rdparty/qtpropertybrowser/QtColorEditorFactory similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtColorEditorFactory rename to code/studio/src/3rdparty/qtpropertybrowser/QtColorEditorFactory diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtColorPropertyManager b/code/studio/src/3rdparty/qtpropertybrowser/QtColorPropertyManager similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtColorPropertyManager rename to code/studio/src/3rdparty/qtpropertybrowser/QtColorPropertyManager diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtCursorEditorFactory b/code/studio/src/3rdparty/qtpropertybrowser/QtCursorEditorFactory similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtCursorEditorFactory rename to code/studio/src/3rdparty/qtpropertybrowser/QtCursorEditorFactory diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtCursorPropertyManager b/code/studio/src/3rdparty/qtpropertybrowser/QtCursorPropertyManager similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtCursorPropertyManager rename to code/studio/src/3rdparty/qtpropertybrowser/QtCursorPropertyManager diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtDateEditFactory b/code/studio/src/3rdparty/qtpropertybrowser/QtDateEditFactory similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtDateEditFactory rename to code/studio/src/3rdparty/qtpropertybrowser/QtDateEditFactory diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtDatePropertyManager b/code/studio/src/3rdparty/qtpropertybrowser/QtDatePropertyManager similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtDatePropertyManager rename to code/studio/src/3rdparty/qtpropertybrowser/QtDatePropertyManager diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtDateTimeEditFactory b/code/studio/src/3rdparty/qtpropertybrowser/QtDateTimeEditFactory similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtDateTimeEditFactory rename to code/studio/src/3rdparty/qtpropertybrowser/QtDateTimeEditFactory diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtDateTimePropertyManager b/code/studio/src/3rdparty/qtpropertybrowser/QtDateTimePropertyManager similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtDateTimePropertyManager rename to code/studio/src/3rdparty/qtpropertybrowser/QtDateTimePropertyManager diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtDoublePropertyManager b/code/studio/src/3rdparty/qtpropertybrowser/QtDoublePropertyManager similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtDoublePropertyManager rename to code/studio/src/3rdparty/qtpropertybrowser/QtDoublePropertyManager diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtDoubleSpinBoxFactory b/code/studio/src/3rdparty/qtpropertybrowser/QtDoubleSpinBoxFactory similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtDoubleSpinBoxFactory rename to code/studio/src/3rdparty/qtpropertybrowser/QtDoubleSpinBoxFactory diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtEnumEditorFactory b/code/studio/src/3rdparty/qtpropertybrowser/QtEnumEditorFactory similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtEnumEditorFactory rename to code/studio/src/3rdparty/qtpropertybrowser/QtEnumEditorFactory diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtEnumPropertyManager b/code/studio/src/3rdparty/qtpropertybrowser/QtEnumPropertyManager similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtEnumPropertyManager rename to code/studio/src/3rdparty/qtpropertybrowser/QtEnumPropertyManager diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtFlagPropertyManager b/code/studio/src/3rdparty/qtpropertybrowser/QtFlagPropertyManager similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtFlagPropertyManager rename to code/studio/src/3rdparty/qtpropertybrowser/QtFlagPropertyManager diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtFontEditorFactory b/code/studio/src/3rdparty/qtpropertybrowser/QtFontEditorFactory similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtFontEditorFactory rename to code/studio/src/3rdparty/qtpropertybrowser/QtFontEditorFactory diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtFontPropertyManager b/code/studio/src/3rdparty/qtpropertybrowser/QtFontPropertyManager similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtFontPropertyManager rename to code/studio/src/3rdparty/qtpropertybrowser/QtFontPropertyManager diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtGroupBoxPropertyBrowser b/code/studio/src/3rdparty/qtpropertybrowser/QtGroupBoxPropertyBrowser similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtGroupBoxPropertyBrowser rename to code/studio/src/3rdparty/qtpropertybrowser/QtGroupBoxPropertyBrowser diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtGroupPropertyManager b/code/studio/src/3rdparty/qtpropertybrowser/QtGroupPropertyManager similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtGroupPropertyManager rename to code/studio/src/3rdparty/qtpropertybrowser/QtGroupPropertyManager diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtIntPropertyManager b/code/studio/src/3rdparty/qtpropertybrowser/QtIntPropertyManager similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtIntPropertyManager rename to code/studio/src/3rdparty/qtpropertybrowser/QtIntPropertyManager diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtKeySequenceEditorFactory b/code/studio/src/3rdparty/qtpropertybrowser/QtKeySequenceEditorFactory similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtKeySequenceEditorFactory rename to code/studio/src/3rdparty/qtpropertybrowser/QtKeySequenceEditorFactory diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtKeySequencePropertyManager b/code/studio/src/3rdparty/qtpropertybrowser/QtKeySequencePropertyManager similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtKeySequencePropertyManager rename to code/studio/src/3rdparty/qtpropertybrowser/QtKeySequencePropertyManager diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtLineEditFactory b/code/studio/src/3rdparty/qtpropertybrowser/QtLineEditFactory similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtLineEditFactory rename to code/studio/src/3rdparty/qtpropertybrowser/QtLineEditFactory diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtLocalePropertyManager b/code/studio/src/3rdparty/qtpropertybrowser/QtLocalePropertyManager similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtLocalePropertyManager rename to code/studio/src/3rdparty/qtpropertybrowser/QtLocalePropertyManager diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtPointFPropertyManager b/code/studio/src/3rdparty/qtpropertybrowser/QtPointFPropertyManager similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtPointFPropertyManager rename to code/studio/src/3rdparty/qtpropertybrowser/QtPointFPropertyManager diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtPointPropertyManager b/code/studio/src/3rdparty/qtpropertybrowser/QtPointPropertyManager similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtPointPropertyManager rename to code/studio/src/3rdparty/qtpropertybrowser/QtPointPropertyManager diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtProperty b/code/studio/src/3rdparty/qtpropertybrowser/QtProperty similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtProperty rename to code/studio/src/3rdparty/qtpropertybrowser/QtProperty diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtRectFPropertyManager b/code/studio/src/3rdparty/qtpropertybrowser/QtRectFPropertyManager similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtRectFPropertyManager rename to code/studio/src/3rdparty/qtpropertybrowser/QtRectFPropertyManager diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtRectPropertyManager b/code/studio/src/3rdparty/qtpropertybrowser/QtRectPropertyManager similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtRectPropertyManager rename to code/studio/src/3rdparty/qtpropertybrowser/QtRectPropertyManager diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtScrollBarFactory b/code/studio/src/3rdparty/qtpropertybrowser/QtScrollBarFactory similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtScrollBarFactory rename to code/studio/src/3rdparty/qtpropertybrowser/QtScrollBarFactory diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtSizeFPropertyManager b/code/studio/src/3rdparty/qtpropertybrowser/QtSizeFPropertyManager similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtSizeFPropertyManager rename to code/studio/src/3rdparty/qtpropertybrowser/QtSizeFPropertyManager diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtSizePolicyPropertyManager b/code/studio/src/3rdparty/qtpropertybrowser/QtSizePolicyPropertyManager similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtSizePolicyPropertyManager rename to code/studio/src/3rdparty/qtpropertybrowser/QtSizePolicyPropertyManager diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtSizePropertyManager b/code/studio/src/3rdparty/qtpropertybrowser/QtSizePropertyManager similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtSizePropertyManager rename to code/studio/src/3rdparty/qtpropertybrowser/QtSizePropertyManager diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtSliderFactory b/code/studio/src/3rdparty/qtpropertybrowser/QtSliderFactory similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtSliderFactory rename to code/studio/src/3rdparty/qtpropertybrowser/QtSliderFactory diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtSpinBoxFactory b/code/studio/src/3rdparty/qtpropertybrowser/QtSpinBoxFactory similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtSpinBoxFactory rename to code/studio/src/3rdparty/qtpropertybrowser/QtSpinBoxFactory diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtStringPropertyManager b/code/studio/src/3rdparty/qtpropertybrowser/QtStringPropertyManager similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtStringPropertyManager rename to code/studio/src/3rdparty/qtpropertybrowser/QtStringPropertyManager diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtTimeEditFactory b/code/studio/src/3rdparty/qtpropertybrowser/QtTimeEditFactory similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtTimeEditFactory rename to code/studio/src/3rdparty/qtpropertybrowser/QtTimeEditFactory diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtTimePropertyManager b/code/studio/src/3rdparty/qtpropertybrowser/QtTimePropertyManager similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtTimePropertyManager rename to code/studio/src/3rdparty/qtpropertybrowser/QtTimePropertyManager diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtTreePropertyBrowser b/code/studio/src/3rdparty/qtpropertybrowser/QtTreePropertyBrowser similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtTreePropertyBrowser rename to code/studio/src/3rdparty/qtpropertybrowser/QtTreePropertyBrowser diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtVariantEditorFactory b/code/studio/src/3rdparty/qtpropertybrowser/QtVariantEditorFactory similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtVariantEditorFactory rename to code/studio/src/3rdparty/qtpropertybrowser/QtVariantEditorFactory diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtVariantProperty b/code/studio/src/3rdparty/qtpropertybrowser/QtVariantProperty similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtVariantProperty rename to code/studio/src/3rdparty/qtpropertybrowser/QtVariantProperty diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtVariantPropertyManager b/code/studio/src/3rdparty/qtpropertybrowser/QtVariantPropertyManager similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/QtVariantPropertyManager rename to code/studio/src/3rdparty/qtpropertybrowser/QtVariantPropertyManager diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/README.TXT b/code/studio/src/3rdparty/qtpropertybrowser/README.TXT similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/README.TXT rename to code/studio/src/3rdparty/qtpropertybrowser/README.TXT diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-arrow.png b/code/studio/src/3rdparty/qtpropertybrowser/images/cursor-arrow.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-arrow.png rename to code/studio/src/3rdparty/qtpropertybrowser/images/cursor-arrow.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-busy.png b/code/studio/src/3rdparty/qtpropertybrowser/images/cursor-busy.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-busy.png rename to code/studio/src/3rdparty/qtpropertybrowser/images/cursor-busy.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-closedhand.png b/code/studio/src/3rdparty/qtpropertybrowser/images/cursor-closedhand.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-closedhand.png rename to code/studio/src/3rdparty/qtpropertybrowser/images/cursor-closedhand.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-cross.png b/code/studio/src/3rdparty/qtpropertybrowser/images/cursor-cross.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-cross.png rename to code/studio/src/3rdparty/qtpropertybrowser/images/cursor-cross.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-forbidden.png b/code/studio/src/3rdparty/qtpropertybrowser/images/cursor-forbidden.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-forbidden.png rename to code/studio/src/3rdparty/qtpropertybrowser/images/cursor-forbidden.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-hand.png b/code/studio/src/3rdparty/qtpropertybrowser/images/cursor-hand.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-hand.png rename to code/studio/src/3rdparty/qtpropertybrowser/images/cursor-hand.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-hsplit.png b/code/studio/src/3rdparty/qtpropertybrowser/images/cursor-hsplit.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-hsplit.png rename to code/studio/src/3rdparty/qtpropertybrowser/images/cursor-hsplit.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-ibeam.png b/code/studio/src/3rdparty/qtpropertybrowser/images/cursor-ibeam.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-ibeam.png rename to code/studio/src/3rdparty/qtpropertybrowser/images/cursor-ibeam.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-openhand.png b/code/studio/src/3rdparty/qtpropertybrowser/images/cursor-openhand.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-openhand.png rename to code/studio/src/3rdparty/qtpropertybrowser/images/cursor-openhand.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-sizeall.png b/code/studio/src/3rdparty/qtpropertybrowser/images/cursor-sizeall.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-sizeall.png rename to code/studio/src/3rdparty/qtpropertybrowser/images/cursor-sizeall.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-sizeb.png b/code/studio/src/3rdparty/qtpropertybrowser/images/cursor-sizeb.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-sizeb.png rename to code/studio/src/3rdparty/qtpropertybrowser/images/cursor-sizeb.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-sizef.png b/code/studio/src/3rdparty/qtpropertybrowser/images/cursor-sizef.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-sizef.png rename to code/studio/src/3rdparty/qtpropertybrowser/images/cursor-sizef.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-sizeh.png b/code/studio/src/3rdparty/qtpropertybrowser/images/cursor-sizeh.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-sizeh.png rename to code/studio/src/3rdparty/qtpropertybrowser/images/cursor-sizeh.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-sizev.png b/code/studio/src/3rdparty/qtpropertybrowser/images/cursor-sizev.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-sizev.png rename to code/studio/src/3rdparty/qtpropertybrowser/images/cursor-sizev.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-uparrow.png b/code/studio/src/3rdparty/qtpropertybrowser/images/cursor-uparrow.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-uparrow.png rename to code/studio/src/3rdparty/qtpropertybrowser/images/cursor-uparrow.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-vsplit.png b/code/studio/src/3rdparty/qtpropertybrowser/images/cursor-vsplit.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-vsplit.png rename to code/studio/src/3rdparty/qtpropertybrowser/images/cursor-vsplit.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-wait.png b/code/studio/src/3rdparty/qtpropertybrowser/images/cursor-wait.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-wait.png rename to code/studio/src/3rdparty/qtpropertybrowser/images/cursor-wait.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-whatsthis.png b/code/studio/src/3rdparty/qtpropertybrowser/images/cursor-whatsthis.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/cursor-whatsthis.png rename to code/studio/src/3rdparty/qtpropertybrowser/images/cursor-whatsthis.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/resetproperty.png b/code/studio/src/3rdparty/qtpropertybrowser/images/resetproperty.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/images/resetproperty.png rename to code/studio/src/3rdparty/qtpropertybrowser/images/resetproperty.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qtbuttonpropertybrowser.cpp b/code/studio/src/3rdparty/qtpropertybrowser/qtbuttonpropertybrowser.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qtbuttonpropertybrowser.cpp rename to code/studio/src/3rdparty/qtpropertybrowser/qtbuttonpropertybrowser.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qtbuttonpropertybrowser.h b/code/studio/src/3rdparty/qtpropertybrowser/qtbuttonpropertybrowser.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qtbuttonpropertybrowser.h rename to code/studio/src/3rdparty/qtpropertybrowser/qtbuttonpropertybrowser.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qteditorfactory.cpp b/code/studio/src/3rdparty/qtpropertybrowser/qteditorfactory.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qteditorfactory.cpp rename to code/studio/src/3rdparty/qtpropertybrowser/qteditorfactory.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qteditorfactory.h b/code/studio/src/3rdparty/qtpropertybrowser/qteditorfactory.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qteditorfactory.h rename to code/studio/src/3rdparty/qtpropertybrowser/qteditorfactory.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qtgroupboxpropertybrowser.cpp b/code/studio/src/3rdparty/qtpropertybrowser/qtgroupboxpropertybrowser.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qtgroupboxpropertybrowser.cpp rename to code/studio/src/3rdparty/qtpropertybrowser/qtgroupboxpropertybrowser.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qtgroupboxpropertybrowser.h b/code/studio/src/3rdparty/qtpropertybrowser/qtgroupboxpropertybrowser.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qtgroupboxpropertybrowser.h rename to code/studio/src/3rdparty/qtpropertybrowser/qtgroupboxpropertybrowser.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qtpropertybrowser.cpp b/code/studio/src/3rdparty/qtpropertybrowser/qtpropertybrowser.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qtpropertybrowser.cpp rename to code/studio/src/3rdparty/qtpropertybrowser/qtpropertybrowser.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qtpropertybrowser.h b/code/studio/src/3rdparty/qtpropertybrowser/qtpropertybrowser.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qtpropertybrowser.h rename to code/studio/src/3rdparty/qtpropertybrowser/qtpropertybrowser.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qtpropertybrowser.pri b/code/studio/src/3rdparty/qtpropertybrowser/qtpropertybrowser.pri similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qtpropertybrowser.pri rename to code/studio/src/3rdparty/qtpropertybrowser/qtpropertybrowser.pri diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qtpropertybrowser.qrc b/code/studio/src/3rdparty/qtpropertybrowser/qtpropertybrowser.qrc similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qtpropertybrowser.qrc rename to code/studio/src/3rdparty/qtpropertybrowser/qtpropertybrowser.qrc diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qtpropertybrowserutils.cpp b/code/studio/src/3rdparty/qtpropertybrowser/qtpropertybrowserutils.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qtpropertybrowserutils.cpp rename to code/studio/src/3rdparty/qtpropertybrowser/qtpropertybrowserutils.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qtpropertybrowserutils_p.h b/code/studio/src/3rdparty/qtpropertybrowser/qtpropertybrowserutils_p.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qtpropertybrowserutils_p.h rename to code/studio/src/3rdparty/qtpropertybrowser/qtpropertybrowserutils_p.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qtpropertymanager.cpp b/code/studio/src/3rdparty/qtpropertybrowser/qtpropertymanager.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qtpropertymanager.cpp rename to code/studio/src/3rdparty/qtpropertybrowser/qtpropertymanager.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qtpropertymanager.h b/code/studio/src/3rdparty/qtpropertybrowser/qtpropertymanager.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qtpropertymanager.h rename to code/studio/src/3rdparty/qtpropertybrowser/qtpropertymanager.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qttreepropertybrowser.cpp b/code/studio/src/3rdparty/qtpropertybrowser/qttreepropertybrowser.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qttreepropertybrowser.cpp rename to code/studio/src/3rdparty/qtpropertybrowser/qttreepropertybrowser.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qttreepropertybrowser.h b/code/studio/src/3rdparty/qtpropertybrowser/qttreepropertybrowser.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qttreepropertybrowser.h rename to code/studio/src/3rdparty/qtpropertybrowser/qttreepropertybrowser.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qtvariantproperty.cpp b/code/studio/src/3rdparty/qtpropertybrowser/qtvariantproperty.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qtvariantproperty.cpp rename to code/studio/src/3rdparty/qtpropertybrowser/qtvariantproperty.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qtvariantproperty.h b/code/studio/src/3rdparty/qtpropertybrowser/qtvariantproperty.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/3rdparty/qtpropertybrowser/qtvariantproperty.h rename to code/studio/src/3rdparty/qtpropertybrowser/qtvariantproperty.h diff --git a/code/studio/src/CMakeLists.txt b/code/studio/src/CMakeLists.txt new file mode 100644 index 000000000..510f0f93b --- /dev/null +++ b/code/studio/src/CMakeLists.txt @@ -0,0 +1,60 @@ +ADD_SUBDIRECTORY(3rdparty) + +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${LIBXML2_INCLUDE_DIR} ${NEL_INCLUDE_DIR} ${QT_INCLUDES}) +INCLUDE( ${QT_USE_FILE} ) + +CONFIGURE_FILE(translations/translations.qrc ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc COPYONLY) + +FILE(GLOB STUDIO_SRC extension_system/*.h + extension_system/*.cpp + *.h *.cpp) + +SET(STUDIO_HDR extension_system/iplugin_manager.h + extension_system/plugin_manager.h + startup_settings_dlg.h + splash_screen.h + pm_watcher.h ) + +SET(STUDIO_RCS studio.qrc ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc) + +SET(STUDIO_TS translations/object_viewer_qt_en.ts + translations/object_viewer_qt_fr.ts + translations/object_viewer_qt_de.ts + translations/object_viewer_qt_ru.ts) + +SET(STUDIO_PLUGIN_UIS startup_settings_dlg.ui ) + +SET(QT_USE_QTGUI TRUE) +SET(QT_USE_QTOPENGL TRUE) + +IF(WIN32) + SET(STUDIO_RC studio.rc) +ENDIF(WIN32) + +QT4_ADD_TRANSLATION(STUDIO_QM ${STUDIO_TS}) +QT4_ADD_RESOURCES( STUDIO_RC_SRCS ${STUDIO_RCS}) +QT4_WRAP_CPP( STUDIO_MOC_SRCS ${STUDIO_HDR} ) +QT4_WRAP_UI( STUDIO_PLUGIN_UI_HDRS ${STUDIO_PLUGIN_UIS}) + +SOURCE_GROUP(QtResources FILES ${STUDIO_RCS} ${STUDIO_PLUGIN_UIS} ) +SOURCE_GROUP(QtGeneratedMocQrcSrc FILES ${STUDIO_MOC_SRCS} ${STUDIO_RC_SRCS}) + +ADD_EXECUTABLE(studio WIN32 MACOSX_BUNDLE + ${STUDIO_SRC} + ${STUDIO_MOC_SRCS} + ${STUDIO_RC_SRCS} + ${STUDIO_RC} + ${STUDIO_PLUGIN_UIS} ) + +TARGET_LINK_LIBRARIES(studio + nelmisc + ${QT_LIBRARIES} + ${QT_QTMAIN_LIBRARY}) + +ADD_DEFINITIONS(-DQT_NO_KEYWORDS ${LIBXML2_DEFINITIONS} ${QT_DEFINITIONS}) +NL_DEFAULT_PROPS(studio "Tools: Studio") +NL_ADD_RUNTIME_FLAGS(studio) + +ADD_SUBDIRECTORY(plugins) + +INSTALL(TARGETS studio RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT runtime BUNDLE DESTINATION /Applications) diff --git a/code/nel/tools/3d/object_viewer_qt/src/description.h b/code/studio/src/description.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/description.h rename to code/studio/src/description.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin.h b/code/studio/src/extension_system/iplugin.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin.h rename to code/studio/src/extension_system/iplugin.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_manager.h b/code/studio/src/extension_system/iplugin_manager.h similarity index 90% rename from code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_manager.h rename to code/studio/src/extension_system/iplugin_manager.h index e38748e77..f60f45890 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_manager.h +++ b/code/studio/src/extension_system/iplugin_manager.h @@ -55,6 +55,9 @@ public: virtual void setPluginPaths(const QStringList &paths) = 0; virtual QList plugins() const = 0; + virtual bool loadPlugin( const QString &plugin ) = 0; + virtual bool unloadPlugin( ExtensionSystem::IPluginSpec *plugin ) = 0; + // Settings virtual void setSettings(QSettings *settings) = 0; virtual QSettings *settings() const = 0; @@ -133,6 +136,16 @@ Q_SIGNALS: /// Signal that the list of available plugins has changed. void pluginsChanged(); + + void pluginCount( int count ); + + void pluginLoading( const char *plugin ); + void pluginInitializing( const char *plugin ); + void pluginStarting( const char *plugin ); + + void pluginsLoaded(); + void pluginsInitialized(); + void pluginsStarted(); }; }; // namespace ExtensionSystem diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_spec.h b/code/studio/src/extension_system/iplugin_spec.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_spec.h rename to code/studio/src/extension_system/iplugin_spec.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp b/code/studio/src/extension_system/plugin_manager.cpp similarity index 70% rename from code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp rename to code/studio/src/extension_system/plugin_manager.cpp index 9b9da508b..37cd85237 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp +++ b/code/studio/src/extension_system/plugin_manager.cpp @@ -92,21 +92,144 @@ void PluginManager::loadPlugins() setPluginState(spec, State::Resolved); QList queue = loadQueue(); + Q_EMIT pluginCount( queue.count() ); Q_FOREACH (PluginSpec *spec, queue) setPluginState(spec, State::Loaded); + + Q_EMIT pluginsLoaded(); Q_FOREACH (PluginSpec *spec, queue) setPluginState(spec, State::Initialized); + + Q_EMIT pluginsInitialized(); QListIterator it(queue); it.toBack(); while (it.hasPrevious()) setPluginState(it.previous(), State::Running); + + Q_EMIT pluginsStarted(); Q_EMIT pluginsChanged(); } +bool PluginManager::loadPluginSpec( const QString &plugin ) +{ + nlinfo( "Loading plugin spec %s", plugin.toUtf8().data() ); + + PluginSpec *spec = new PluginSpec; + spec->m_pluginManager = this; + if( !spec->setSpecFileName( plugin ) ) + { + nlinfo( "Error loading plugin spec %s", plugin.toUtf8().data() ); + return false; + } + + m_pluginSpecs.append( spec ); + m_ipluginSpecs.append( spec ); + + return true; +} + +bool PluginManager::loadPlugin( const QString &plugin ) +{ + if( !loadPluginSpec( plugin ) ) + return false; + + ExtensionSystem::PluginSpec *spec = m_pluginSpecs.last(); + + if( !spec->resolveDependencies( m_pluginSpecs ) ) + { + nlinfo( "Error resolving dependencies for plugin spec %s", plugin.toUtf8().data() ); + return false; + } + + if( !spec->loadLibrary() ) + { + nlinfo( "Error loading plugin %s", spec->fileName().toUtf8().data() ); + return false; + } + + if( !spec->initializePlugin() ) + { + nlinfo( "Error initializing plugin %s", spec->fileName().toUtf8().data() ); + spec->kill(); + return false; + } + + if( !spec->initializeExtensions() ) + { + nlinfo( "Error starting plugin %s", spec->fileName().toUtf8().data() ); + spec->stop(); + spec->kill(); + return false; + } + + nlinfo( "Loaded plugin %s ( %s )", spec->name().data(), spec->fileName().toUtf8().data() ); + + Q_EMIT pluginsChanged(); + + return true; +} + +bool PluginManager::unloadPlugin( ExtensionSystem::IPluginSpec *plugin ) +{ + ExtensionSystem::PluginSpec *spec = static_cast< ExtensionSystem::PluginSpec* >( plugin ); + + // Let's see if anything depends on this one + QListIterator< ExtensionSystem::PluginSpec* > itr( m_pluginSpecs ); + while( itr.hasNext() ) + { + ExtensionSystem::PluginSpec *sp = itr.next(); + QList< ExtensionSystem::PluginSpec* > l = sp->dependencySpecs(); + if( l.contains( spec ) ) + return false; + } + + // Stop, delete then remove plugin + spec->stop(); + spec->kill(); + removePlugin( plugin ); + + return true; +} + +void PluginManager::removePlugin( ExtensionSystem::IPluginSpec *plugin ) +{ + QList< ExtensionSystem::IPluginSpec* >::iterator itr1; + QList< ExtensionSystem::PluginSpec* >::iterator itr2; + + QList< ExtensionSystem::IPluginSpec* >::iterator i1 = m_ipluginSpecs.begin(); + while( i1 != m_ipluginSpecs.end() ) + { + if( *i1 == plugin ) + { + itr1 = i1; + break; + } + i1++; + } + + QList< ExtensionSystem::PluginSpec* >::iterator i2 = m_pluginSpecs.begin(); + while( i2 != m_pluginSpecs.end() ) + { + if( *i2 == static_cast< ExtensionSystem::PluginSpec* >( plugin ) ) + { + itr2 = i2; + break; + } + i2++; + } + + m_ipluginSpecs.erase( itr1 ); + m_pluginSpecs.erase( itr2 ); + delete plugin; + + Q_EMIT pluginsChanged(); + +} + QStringList PluginManager::getPluginPaths() const { return m_pluginPaths; @@ -183,7 +306,7 @@ void PluginManager::readPluginPaths() while (!searchPaths.isEmpty()) { const QDir dir(searchPaths.takeFirst()); - const QFileInfoList files = dir.entryInfoList(QStringList() << QString("ovqt_plugin_*.%1").arg(m_extension), QDir::Files); + const QFileInfoList files = dir.entryInfoList(QStringList() << QString("studio_plugin_*.%1").arg(m_extension), QDir::Files); Q_FOREACH (const QFileInfo &file, files) pluginsList << file.absoluteFilePath(); const QFileInfoList dirs = dir.entryInfoList(QDir::Dirs|QDir::NoDotAndDotDot); @@ -193,11 +316,7 @@ void PluginManager::readPluginPaths() Q_FOREACH (const QString &pluginFile, pluginsList) { - PluginSpec *spec = new PluginSpec; - spec->m_pluginManager = this; - spec->setSpecFileName(pluginFile); - m_pluginSpecs.append(spec); - m_ipluginSpecs.append(spec); + loadPluginSpec( pluginFile.toUtf8().data() ); } Q_EMIT pluginsChanged(); @@ -218,6 +337,7 @@ void PluginManager::setPluginState(PluginSpec *spec, int destState) spec->resolveDependencies(m_pluginSpecs); return; case State::Running: + Q_EMIT pluginStarting( spec->name().toUtf8().data() ); spec->initializeExtensions(); return; case State::Deleted: @@ -239,9 +359,11 @@ void PluginManager::setPluginState(PluginSpec *spec, int destState) switch (destState) { case State::Loaded: + Q_EMIT pluginLoading( spec->name().toUtf8().data() ); spec->loadLibrary(); return; case State::Initialized: + Q_EMIT pluginInitializing( spec->name().toUtf8().data() ); spec->initializePlugin(); break; case State::Stopped: diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.h b/code/studio/src/extension_system/plugin_manager.h similarity index 91% rename from code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.h rename to code/studio/src/extension_system/plugin_manager.h index 9ab1ae135..ca31e1552 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.h +++ b/code/studio/src/extension_system/plugin_manager.h @@ -51,6 +51,10 @@ public: virtual QList plugins() const; QList loadQueue(); + bool loadPlugin( const QString &plugin ); + bool unloadPlugin( ExtensionSystem::IPluginSpec *plugin ); + + // Settings virtual void setSettings(QSettings *settings); virtual QSettings *settings() const; @@ -58,6 +62,8 @@ public: void writeSettings(); private: + bool loadPluginSpec( const QString &plugin ); + void removePlugin( ExtensionSystem::IPluginSpec *plugin ); void setPluginState(PluginSpec *spec, int destState); void readPluginPaths(); bool loadQueue(PluginSpec *spec, QList &queue, QList &circularityCheckQueue); diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.cpp b/code/studio/src/extension_system/plugin_spec.cpp similarity index 95% rename from code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.cpp rename to code/studio/src/extension_system/plugin_spec.cpp index 89f8046bb..97a08ea64 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.cpp +++ b/code/studio/src/extension_system/plugin_spec.cpp @@ -84,6 +84,13 @@ PluginSpec::PluginSpec() #else # error "You must define the lib suffix for your platform" #endif + loader = NULL; +} + +PluginSpec::~PluginSpec() +{ + delete loader; + loader = NULL; } QString PluginSpec::name() const @@ -292,6 +299,8 @@ bool PluginSpec::isEnabled() const bool PluginSpec::loadLibrary() { + nlassert( loader == NULL ); + if (m_hasError) return false; if (m_state != State::Resolved) @@ -301,14 +310,16 @@ bool PluginSpec::loadLibrary() return reportError(QCoreApplication::translate("PluginSpec", "Loading the library failed because state != Resolved")); } - QPluginLoader loader(m_filePath); - if (!loader.load()) - return reportError(loader.errorString()); + loader = new QPluginLoader( m_filePath ); + if (!loader->load()) + return reportError(loader->errorString()); - IPlugin *pluginObject = qobject_cast(loader.instance()); + IPlugin *pluginObject = qobject_cast(loader->instance()); if (!pluginObject) { - loader.unload(); + loader->unload(); + delete loader; + loader = NULL; return reportError(QCoreApplication::translate("PluginSpec", "Plugin is not valid (does not derive from IPlugin)")); } @@ -412,8 +423,17 @@ void PluginSpec::kill() { if (!m_plugin) return; - delete m_plugin; - m_plugin = 0; + + bool b = loader->unload(); + if( !b ) + { + nlinfo( "Plugin %s couldn't be unloaded.", this->m_name.toAscii().data() ); + } + + //delete m_plugin; + m_plugin = NULL; + delete loader; + loader = NULL; m_state = State::Deleted; } diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.h b/code/studio/src/extension_system/plugin_spec.h similarity index 97% rename from code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.h rename to code/studio/src/extension_system/plugin_spec.h index 0ce74d004..d2abe1ef8 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.h +++ b/code/studio/src/extension_system/plugin_spec.h @@ -25,12 +25,15 @@ #include #include +class QPluginLoader; + namespace ExtensionSystem { class PluginSpec: public IPluginSpec { public: + ~PluginSpec(); virtual QString name() const; virtual QString version() const; virtual QString vendor() const; @@ -54,7 +57,7 @@ public: private: PluginSpec(); - + bool setFileName(const QString &fileName); bool setSpecFileName(const QString &specFileName); bool readSpec(); @@ -96,6 +99,8 @@ private: IPluginManager *m_pluginManager; QList m_dependencySpecs; + QPluginLoader *loader; + friend class PluginManager; }; diff --git a/code/studio/src/images/studio_splash.png b/code/studio/src/images/studio_splash.png new file mode 100644 index 000000000..06f0504b9 Binary files /dev/null and b/code/studio/src/images/studio_splash.png differ diff --git a/code/nel/tools/3d/object_viewer_qt/src/main.cpp b/code/studio/src/main.cpp similarity index 85% rename from code/nel/tools/3d/object_viewer_qt/src/main.cpp rename to code/studio/src/main.cpp index d0407ccfd..e126e258a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/main.cpp +++ b/code/studio/src/main.cpp @@ -37,15 +37,19 @@ #include #include #include -#include +//#include #include #include +#include "startup_settings_dlg.h" +#include "splash_screen.h" +#include "pm_watcher.h" + #ifdef HAVE_OVQT_CONFIG_H #include "ovqt_config.h" #endif -static const char *appNameC = "ObjectViewerQt"; +static const char *appNameC = "RyzomCoreStudio"; // nel_qt log file name #define NLQT_LOG_FILE "nel_qt.log" @@ -104,6 +108,7 @@ static inline QString msgCoreLoadFailure(const QString &why) return QCoreApplication::translate("Application", "Failed to load Core plugin: %1").arg(why); } + #ifdef NL_OS_WINDOWS int __stdcall WinMain(void *hInstance, void *hPrevInstance, void *lpCmdLine, int nShowCmd) #else // NL_OS_WINDOWS @@ -115,6 +120,7 @@ int main(int argc, char **argv) { // use log.log if NEL_LOG_IN_FILE and NLQT_USE_LOG_LOG defined as 1 NLMISC::createDebug(NULL, NLQT_USE_LOG_LOG, false); + NLMISC::INelContext::getInstance().setWindowedApplication(true); #if NLQT_USE_LOG // create NLQT_LOG_FILE // filedisplayer only deletes the 001 etc @@ -138,14 +144,29 @@ int main(int argc, char **argv) #else // NL_OS_WINDOWS QApplication app(argc, argv); #endif // NL_OS_WINDOWS - QSplashScreen *splash = new QSplashScreen(); - splash->setPixmap(QPixmap(":/images/nel_ide_load.png")); + + SplashScreen *splash = new SplashScreen(); + splash->setPixmap(QPixmap(":/images/studio_splash.png")); + splash->setProgressBarEnabled( true ); + splash->setText( "Starting up..." ); + splash->setProgress( 0 ); splash->show(); QSettings::setDefaultFormat(QSettings::IniFormat); QSettings *settings = new QSettings(QSettings::IniFormat, QSettings::UserScope, QLatin1String("RyzomCore"), QLatin1String(appNameC)); + bool firstRun = settings->value( "FirstRun", true ).toBool(); + if( firstRun ) + { + settings->setValue( "FirstRun", false ); + + StartupSettingsDlg sd; + sd.setSettings( settings ); + sd.load(); + sd.exec(); + } + QTranslator translator; QTranslator qtTranslator; QString locale = settings->value("Language", QLocale::system().name()).toString(); @@ -155,6 +176,9 @@ int main(int argc, char **argv) app.installTranslator(&translator); app.installTranslator(&qtTranslator); + splash->setText( "Loading plugins..." ); + splash->setProgress( 20 ); + #if defined(NL_OS_MAC) QDir::setCurrent(qApp->applicationDirPath() + QString("/../Resources")); NLMISC::CLibrary::addLibPath((qApp->applicationDirPath() + QString("/../PlugIns/nel")).toUtf8().constData()); @@ -164,14 +188,21 @@ int main(int argc, char **argv) pluginManager.setSettings(settings); QStringList pluginPaths; #if defined(NL_OS_MAC) - pluginPaths << settings->value("PluginPath", qApp->applicationDirPath() + QString("/../PlugIns/ovqt")).toString(); + pluginPaths << settings->value("PluginPath", qApp->applicationDirPath() + QString("/../PlugIns/studio")).toString(); #else pluginPaths << settings->value("PluginPath", QString("%1/plugins").arg(DATA_DIR)).toString(); #endif pluginManager.setPluginPaths(pluginPaths); + + PluginManagerWatcher watcher; + watcher.setPluginManager( &pluginManager ); + watcher.setSplashScreen( splash ); + watcher.connect(); + pluginManager.loadPlugins(); + watcher.disconnect(); splash->hide(); ExtensionSystem::IPluginSpec *corePlugin = pluginManager.pluginByName("Core"); @@ -180,7 +211,7 @@ int main(int argc, char **argv) { QDir absolutePluginPaths(pluginPaths.join(QLatin1String(","))); QString absolutePaths = absolutePluginPaths.absolutePath(); - const QString reason = QCoreApplication::translate("Application", "Could not find ovqt_plugin_core in %1").arg(absolutePaths); + const QString reason = QCoreApplication::translate("Application", "Could not find studio_plugin_core in %1").arg(absolutePaths); displayError(msgCoreLoadFailure(reason)); QString newPath = QFileDialog::getExistingDirectory(0, QCoreApplication::translate("Application", "Change the plugins path"), QDir::homePath()); @@ -205,7 +236,7 @@ int main(int argc, char **argv) errors.append(spec->fileName() + " : " + spec->errorString()); if (!errors.isEmpty()) - QMessageBox::warning(0, QCoreApplication::translate("Application", "Object Viewer Qt - Plugin loader messages"), + QMessageBox::warning(0, QCoreApplication::translate("Application", "Studio - Plugin loader messages"), errors.join(QString::fromLatin1("\n\n"))); int result = app.exec(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/CMakeLists.txt b/code/studio/src/plugins/CMakeLists.txt similarity index 95% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/CMakeLists.txt rename to code/studio/src/plugins/CMakeLists.txt index 3e99bdc43..5916be455 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/CMakeLists.txt +++ b/code/studio/src/plugins/CMakeLists.txt @@ -13,6 +13,7 @@ IF(WITH_GUI) ENDIF(WITH_GUI) ADD_SUBDIRECTORY(translation_manager) +ADD_SUBDIRECTORY(tile_editor) ADD_SUBDIRECTORY(bnp_manager) # Note: Temporarily disabled until development continues. #ADD_SUBDIRECTORY(zone_painter) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/CMakeLists.txt b/code/studio/src/plugins/bnp_manager/CMakeLists.txt similarity index 67% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/CMakeLists.txt rename to code/studio/src/plugins/bnp_manager/CMakeLists.txt index 2991da073..406a927b8 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/CMakeLists.txt +++ b/code/studio/src/plugins/bnp_manager/CMakeLists.txt @@ -34,16 +34,16 @@ SOURCE_GROUP(QtGeneratedMocSrc FILES ${OVQT_PLUG_BNP_MANAGER_MOC_SRC}) SOURCE_GROUP("BNP Manager Plugin" FILES ${SRC}) SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) -ADD_LIBRARY(ovqt_plugin_bnp_manager MODULE ${SRC} ${OVQT_PLUG_BNP_MANAGER_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUGIN_BNP_MANAGER_RC_SRCS} ${OVQT_PLUG_BNP_MANAGER_UI_HDRS}) +ADD_LIBRARY(studio_plugin_bnp_manager MODULE ${SRC} ${OVQT_PLUG_BNP_MANAGER_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUGIN_BNP_MANAGER_RC_SRCS} ${OVQT_PLUG_BNP_MANAGER_UI_HDRS}) -TARGET_LINK_LIBRARIES(ovqt_plugin_bnp_manager ovqt_plugin_core nelmisc nelgeorges ${QT_LIBRARIES}) +TARGET_LINK_LIBRARIES(studio_plugin_bnp_manager studio_plugin_core nelmisc nelgeorges ${QT_LIBRARIES}) -NL_DEFAULT_PROPS(ovqt_plugin_bnp_manager "NeL, Tools, 3D: Object Viewer Qt Plugin: BNP Manager") -NL_ADD_RUNTIME_FLAGS(ovqt_plugin_bnp_manager) -NL_ADD_LIB_SUFFIX(ovqt_plugin_bnp_manager) +NL_DEFAULT_PROPS(studio_plugin_bnp_manager "Tools: Studio Plugin: BNP Manager") +NL_ADD_RUNTIME_FLAGS(studio_plugin_bnp_manager) +NL_ADD_LIB_SUFFIX(studio_plugin_bnp_manager) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) -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) +INSTALL(TARGETS studio_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}/studio_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_dirtree_dialog.cpp b/code/studio/src/plugins/bnp_manager/bnp_dirtree_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_dirtree_dialog.cpp rename to code/studio/src/plugins/bnp_manager/bnp_dirtree_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_dirtree_dialog.h b/code/studio/src/plugins/bnp_manager/bnp_dirtree_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_dirtree_dialog.h rename to code/studio/src/plugins/bnp_manager/bnp_dirtree_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_dirtree_form.ui b/code/studio/src/plugins/bnp_manager/bnp_dirtree_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_dirtree_form.ui rename to code/studio/src/plugins/bnp_manager/bnp_dirtree_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_file.cpp b/code/studio/src/plugins/bnp_manager/bnp_file.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_file.cpp rename to code/studio/src/plugins/bnp_manager/bnp_file.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_file.h b/code/studio/src/plugins/bnp_manager/bnp_file.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_file.h rename to code/studio/src/plugins/bnp_manager/bnp_file.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_filelist_dialog.cpp b/code/studio/src/plugins/bnp_manager/bnp_filelist_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_filelist_dialog.cpp rename to code/studio/src/plugins/bnp_manager/bnp_filelist_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_filelist_dialog.h b/code/studio/src/plugins/bnp_manager/bnp_filelist_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_filelist_dialog.h rename to code/studio/src/plugins/bnp_manager/bnp_filelist_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_filelist_dialog.ui b/code/studio/src/plugins/bnp_manager/bnp_filelist_dialog.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_filelist_dialog.ui rename to code/studio/src/plugins/bnp_manager/bnp_filelist_dialog.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_filesystem_model.cpp b/code/studio/src/plugins/bnp_manager/bnp_filesystem_model.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_filesystem_model.cpp rename to code/studio/src/plugins/bnp_manager/bnp_filesystem_model.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_filesystem_model.h b/code/studio/src/plugins/bnp_manager/bnp_filesystem_model.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_filesystem_model.h rename to code/studio/src/plugins/bnp_manager/bnp_filesystem_model.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_manager.qrc b/code/studio/src/plugins/bnp_manager/bnp_manager.qrc similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_manager.qrc rename to code/studio/src/plugins/bnp_manager/bnp_manager.qrc diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_manager_constants.h b/code/studio/src/plugins/bnp_manager/bnp_manager_constants.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_manager_constants.h rename to code/studio/src/plugins/bnp_manager/bnp_manager_constants.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_manager_plugin.cpp b/code/studio/src/plugins/bnp_manager/bnp_manager_plugin.cpp similarity index 98% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_manager_plugin.cpp rename to code/studio/src/plugins/bnp_manager/bnp_manager_plugin.cpp index e4bf7f594..509dd2997 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_manager_plugin.cpp +++ b/code/studio/src/plugins/bnp_manager/bnp_manager_plugin.cpp @@ -44,6 +44,9 @@ namespace BNPManager } qDeleteAll(m_autoReleaseObjects); m_autoReleaseObjects.clear(); + + delete m_libContext; + m_libContext = NULL; } bool BNPManagerPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_manager_plugin.h b/code/studio/src/plugins/bnp_manager/bnp_manager_plugin.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_manager_plugin.h rename to code/studio/src/plugins/bnp_manager/bnp_manager_plugin.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_manager_window.cpp b/code/studio/src/plugins/bnp_manager/bnp_manager_window.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_manager_window.cpp rename to code/studio/src/plugins/bnp_manager/bnp_manager_window.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_manager_window.h b/code/studio/src/plugins/bnp_manager/bnp_manager_window.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_manager_window.h rename to code/studio/src/plugins/bnp_manager/bnp_manager_window.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_manager_window.ui b/code/studio/src/plugins/bnp_manager/bnp_manager_window.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_manager_window.ui rename to code/studio/src/plugins/bnp_manager/bnp_manager_window.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_proxy_model.cpp b/code/studio/src/plugins/bnp_manager/bnp_proxy_model.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_proxy_model.cpp rename to code/studio/src/plugins/bnp_manager/bnp_proxy_model.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_proxy_model.h b/code/studio/src/plugins/bnp_manager/bnp_proxy_model.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/bnp_proxy_model.h rename to code/studio/src/plugins/bnp_manager/bnp_proxy_model.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/images/ic_nel_add_item.png b/code/studio/src/plugins/bnp_manager/images/ic_nel_add_item.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/images/ic_nel_add_item.png rename to code/studio/src/plugins/bnp_manager/images/ic_nel_add_item.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/images/ic_nel_bnp_make.png b/code/studio/src/plugins/bnp_manager/images/ic_nel_bnp_make.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/images/ic_nel_bnp_make.png rename to code/studio/src/plugins/bnp_manager/images/ic_nel_bnp_make.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/images/ic_nel_delete_item.png b/code/studio/src/plugins/bnp_manager/images/ic_nel_delete_item.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/images/ic_nel_delete_item.png rename to code/studio/src/plugins/bnp_manager/images/ic_nel_delete_item.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/images/ic_nel_export.png b/code/studio/src/plugins/bnp_manager/images/ic_nel_export.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/images/ic_nel_export.png rename to code/studio/src/plugins/bnp_manager/images/ic_nel_export.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/images/ic_nel_new.png b/code/studio/src/plugins/bnp_manager/images/ic_nel_new.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/images/ic_nel_new.png rename to code/studio/src/plugins/bnp_manager/images/ic_nel_new.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/images/ic_nel_reset_all.png b/code/studio/src/plugins/bnp_manager/images/ic_nel_reset_all.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/images/ic_nel_reset_all.png rename to code/studio/src/plugins/bnp_manager/images/ic_nel_reset_all.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/ovqt_plugin_bnp_manager.xml b/code/studio/src/plugins/bnp_manager/studio_plugin_bnp_manager.xml similarity index 76% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/ovqt_plugin_bnp_manager.xml rename to code/studio/src/plugins/bnp_manager/studio_plugin_bnp_manager.xml index a368a123c..591611504 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/bnp_manager/ovqt_plugin_bnp_manager.xml +++ b/code/studio/src/plugins/bnp_manager/studio_plugin_bnp_manager.xml @@ -1,5 +1,5 @@ - ovqt_plugin_bnp_manager + studio_plugin_bnp_manager BNPManager 0.1 Krolock diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/CMakeLists.txt b/code/studio/src/plugins/core/CMakeLists.txt similarity index 54% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/CMakeLists.txt rename to code/studio/src/plugins/core/CMakeLists.txt index 5a20ba46c..db99b807c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/CMakeLists.txt +++ b/code/studio/src/plugins/core/CMakeLists.txt @@ -4,6 +4,11 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ${QT_INCLUDES}) FILE(GLOB SRC *.cpp *.h) +SET( SRC ${SRC} + ${CMAKE_CURRENT_SOURCE_DIR}/Nel3DWidget/nel3d_widget.h + ${CMAKE_CURRENT_SOURCE_DIR}/Nel3DWidget/nel3d_widget.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) @@ -22,6 +27,7 @@ SET(OVQT_CORE_PLUGIN_HDR search_paths_settings_page.h general_settings_page.h plugin_view_dialog.h + ${CMAKE_CURRENT_SOURCE_DIR}/Nel3DWidget/nel3d_widget.h ) SET(OVQT_CORE_PLUGIN_UIS settings_dialog.ui @@ -32,6 +38,10 @@ SET(OVQT_CORE_PLUGIN_UIS settings_dialog.ui SET(OVQT_CORE_PLUGIN_RCS core.qrc) +IF(NOT WIN32) +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/core_config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/core_config.h) +ENDIF(NOT WIN32) + SET(QT_USE_QTGUI TRUE) SET(QT_USE_QTOPENGL TRUE) @@ -45,29 +55,29 @@ SOURCE_GROUP(QtGeneratedMocSrc FILES ${OVQT_CORE_PLUGIN_MOC_SRC}) SOURCE_GROUP("Core Plugin" FILES ${SRC}) SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) -ADD_LIBRARY(ovqt_plugin_core SHARED ${SRC} ${OVQT_CORE_PLUGIN_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_CORE_PLUGIN_RC_SRCS} ${OVQT_CORE_PLUGIN_UI_HDRS}) +ADD_LIBRARY(studio_plugin_core SHARED ${SRC} ${OVQT_CORE_PLUGIN_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_CORE_PLUGIN_RC_SRCS} ${OVQT_CORE_PLUGIN_UI_HDRS}) -TARGET_LINK_LIBRARIES(ovqt_plugin_core nelmisc ${QT_LIBRARIES}) +TARGET_LINK_LIBRARIES(studio_plugin_core nelmisc nel3d ${QT_LIBRARIES}) -NL_DEFAULT_PROPS(ovqt_plugin_core "NeL, Tools, 3D: Object Viewer Qt Plugin: Core") -NL_ADD_RUNTIME_FLAGS(ovqt_plugin_core) -NL_ADD_LIB_SUFFIX(ovqt_plugin_core) +NL_DEFAULT_PROPS(studio_plugin_core "Tools: Studio Plugin: Core") +NL_ADD_RUNTIME_FLAGS(studio_plugin_core) +NL_ADD_LIB_SUFFIX(studio_plugin_core) ADD_DEFINITIONS(-DCORE_LIBRARY ${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) IF(WIN32) IF(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_core LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_core LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) ELSE(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_core LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_core LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) ENDIF(WITH_INSTALL_LIBRARIES) ELSE(WIN32) IF(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_core LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_core LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) ELSE(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_core LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_core LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} 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) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/studio_plugin_core.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) diff --git a/code/studio/src/plugins/core/Nel3DWidget/nel3d_widget.cpp b/code/studio/src/plugins/core/Nel3DWidget/nel3d_widget.cpp new file mode 100644 index 000000000..bc83b5d78 --- /dev/null +++ b/code/studio/src/plugins/core/Nel3DWidget/nel3d_widget.cpp @@ -0,0 +1,177 @@ +// Ryzom Core MMORPG framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "nel3d_widget.h" +#include "nel/3d/u_driver.h" +#include "nel/3d/text_context.h" +#include "nel/3d/driver_user.h" +#include "nel/misc/rgba.h" +#include "nel/misc/path.h" + +#ifdef NL_OS_WINDOWS +#include +#endif + +#include + +Nel3DWidget::Nel3DWidget( QWidget *parent ) : +NEL3DWIDGET( parent ) +{ + driver = NULL; + textContext = NULL; + + // Need to set this attribute with a NULL paintengine returned to Qt + // so that we can render the widget normally ourselves, without the image + // disappearing when a widget is resized or shown on top of us + setAttribute( Qt::WA_PaintOnScreen, true ); + setAttribute( Qt::WA_OpaquePaintEvent, true ); + setAttribute( Qt::WA_NoSystemBackground, true ); +} + +Nel3DWidget::~Nel3DWidget() +{ + if( driver != NULL ) + { + if( textContext != NULL ) + { + driver->deleteTextContext( textContext ); + textContext = NULL; + } + + driver->release(); + delete driver; + driver = NULL; + } +} + +void Nel3DWidget::init() +{ + nlassert( driver == NULL ); + + driver = NL3D::UDriver::createDriver( 0, false, 0 ); + driver->setDisplay( winId(), NL3D::UDriver::CMode( width(), height(), 32, true ) ); +} + +void Nel3DWidget::createTextContext( std::string fontFile ) +{ + if( driver == NULL ) + return; + + std::string font; + + try + { + font = NLMISC::CPath::lookup( fontFile ); + } + catch( ... ) + { + nlinfo( "Font %s cannot be found, cannot create textcontext!", fontFile.c_str() ); + exit( EXIT_FAILURE ); + } + + if( textContext != NULL ) + { + driver->deleteTextContext( textContext ); + textContext = NULL; + } + + textContext = driver->createTextContext( font ); +} + +void Nel3DWidget::clear() +{ + if( driver == NULL ) + return; + driver->clearBuffers( NLMISC::CRGBA::Black ); + driver->swapBuffers(); +} + +void Nel3DWidget::showEvent( QShowEvent *evnt ) +{ + QWidget::showEvent( evnt ); + + if( driver != NULL ) + driver->activate(); +} + +void Nel3DWidget::resizeEvent( QResizeEvent *evnt ) +{ + QWidget::resizeEvent( evnt ); + + Q_EMIT( evnt->size().width(), evnt->size().height() ); +} + +#if defined ( NL_OS_WINDOWS ) + +typedef bool ( *winProc )( NL3D::IDriver *driver, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ); + +bool Nel3DWidget::winEvent( MSG *message, long *result ) +{ + if( driver != NULL ) + { + NL3D::IDriver *iDriver = dynamic_cast< NL3D::CDriverUser* >( driver )->getDriver(); + if( iDriver != NULL ) + { + winProc proc = (winProc)iDriver->getWindowProc(); + return proc( iDriver, message->hwnd, message->message, message->wParam, message->lParam ); + } + } + + return false; +} + +#elif defined( NL_OS_MAC ) + +typedef bool ( *cocoaProc )( NL3D::IDriver *, const void *e ); + +bool Nel3DWidget::macEvent( EventHandlerCallRef caller, EventRef event ) +{ + if( caller ) + nlerror( "You are using QtCarbon! Only QtCocoa supported, please upgrade Qt" ); + + if( driver != NULL ) + { + NL3D::IDriver *iDriver = dynamic_cast< NL3D::CDriverUser* >( driver )->getDriver(); + if( iDriver != NULL ) + { + cocoaProc proc = ( cocoaProc )iDriver->getWindowProc(); + return proc( iDriver, event ); + } + } + + return false; +} + +#elif defined( NL_OS_UNIX ) + +typedef bool ( *x11Proc )( NL3D::IDriver *drv, XEvent *e ); + +bool Nel3DWidget::x11Event( XEvent *event ) +{ + if( driver != NULL ) + { + NL3D::IDriver *iDriver = dynamic_cast< NL3D::CDriverUser* >( driver )->getDriver(); + if( driver != NULL ) + { + x11Proc proc = ( x11Proc )iDriver->getWindowProc(); + return proc( iDriver, event ); + } + } + + return false; +} +#endif + diff --git a/code/studio/src/plugins/core/Nel3DWidget/nel3d_widget.h b/code/studio/src/plugins/core/Nel3DWidget/nel3d_widget.h new file mode 100644 index 000000000..254001b25 --- /dev/null +++ b/code/studio/src/plugins/core/Nel3DWidget/nel3d_widget.h @@ -0,0 +1,91 @@ +// Ryzom Core MMORPG framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + + +#ifndef NEL3D_WIDGET_H +#define NEL3D_WIDGET_H + +#include "nel/misc/types_nl.h" +#include + +#ifdef NEL3DWIDGET +#undef NEL3DWIDGET +#endif + +#ifdef NL_OS_WINDOWS +#include +#define NEL3DWIDGET QWidget +#else +#include +#define NEL3DWIDGET QGLWidget +#endif + + +#include "../core_global.h" + +namespace NL3D +{ + class UDriver; + class UTextContext; +} + +/// Nel 3D interface to Qt +class CORE_EXPORT Nel3DWidget : public NEL3DWIDGET +{ + Q_OBJECT +public: + Nel3DWidget( QWidget *parent = NULL ); + virtual ~Nel3DWidget(); + + void init(); + void createTextContext( std::string fontFile ); + + NL3D::UDriver* getDriver() const{ return driver; } + NL3D::UTextContext* getTextContext() const{ return textContext; } + + + // Need to return NULL paintengine to Qt so that we can + // render the widget normally ourselves, without the image + // disappearing when a widget is resized or shown on top of us + QPaintEngine* paintEngine() const{ return NULL; } + +Q_SIGNALS: + void resize( int width, int height ); + +public Q_SLOTS: + void clear(); + +protected: + + void showEvent( QShowEvent *evnt ); + void resizeEvent( QResizeEvent *evnt ); + +#if defined(NL_OS_WINDOWS) + bool winEvent( MSG *message, long *result ); +#elif defined(NL_OS_MAC) + bool macEvent( EventHandlerCallRef caller, EventRef event ); +#elif defined(NL_OS_UNIX) + bool x11Event( XEvent *event ); +#endif + +private: + NL3D::UDriver *driver; + NL3D::UTextContext *textContext; + +}; + +#endif + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/context_manager.cpp b/code/studio/src/plugins/core/context_manager.cpp similarity index 94% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/context_manager.cpp rename to code/studio/src/plugins/core/context_manager.cpp index 8355b5cb8..203738faf 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/context_manager.cpp +++ b/code/studio/src/plugins/core/context_manager.cpp @@ -36,13 +36,11 @@ struct ContextManagerPrivate 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) + m_tabWidget(tabWidget) { } @@ -135,8 +133,8 @@ void ContextManager::removeContextObject(IContext *context) const int index = indexOf(context->id()); QWidget *widget = d->m_tabWidget->widget(index); - d->m_tabWidget->removeTab(index); d->m_contexts.remove(index); + d->m_tabWidget->removeTab(index); delete widget; } @@ -145,11 +143,9 @@ 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); + context->onActivated(); + + Q_EMIT currentContextChanged(context); } } @@ -164,4 +160,4 @@ int ContextManager::indexOf(const QString &id) const return -1; } -} /* namespace Core */ \ No newline at end of file +} /* namespace Core */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/context_manager.h b/code/studio/src/plugins/core/context_manager.h similarity index 92% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/context_manager.h rename to code/studio/src/plugins/core/context_manager.h index 8151648e7..9b0a62c7e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/context_manager.h +++ b/code/studio/src/plugins/core/context_manager.h @@ -51,8 +51,7 @@ public: void unregisterUndoStack(QUndoStack *stack); Q_SIGNALS: - // the default argument '=0' is important for connects without the oldContext argument. - void currentContextChanged(Core::IContext *context, Core::IContext *oldContext = 0); + void currentContextChanged(Core::IContext *context); public Q_SLOTS: void activateContext(const QString &id); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.cpp b/code/studio/src/plugins/core/core.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.cpp rename to code/studio/src/plugins/core/core.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.h b/code/studio/src/plugins/core/core.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.h rename to code/studio/src/plugins/core/core.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.qrc b/code/studio/src/plugins/core/core.qrc similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.qrc rename to code/studio/src/plugins/core/core.qrc diff --git a/code/studio/src/plugins/core/core_config.h.cmake b/code/studio/src/plugins/core/core_config.h.cmake new file mode 100644 index 000000000..1aab54c12 --- /dev/null +++ b/code/studio/src/plugins/core/core_config.h.cmake @@ -0,0 +1,7 @@ +#ifndef CORE_CONFIG_H +#define CORE_CONFIG_H + +#define STUDIO_DATA_DIR "${OVQT_IMP_DATA_DIR}" + +#endif + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_constants.h b/code/studio/src/plugins/core/core_constants.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_constants.h rename to code/studio/src/plugins/core/core_constants.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_global.h b/code/studio/src/plugins/core/core_global.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_global.h rename to code/studio/src/plugins/core/core_global.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.cpp b/code/studio/src/plugins/core/core_plugin.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.cpp rename to code/studio/src/plugins/core/core_plugin.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.h b/code/studio/src/plugins/core/core_plugin.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.h rename to code/studio/src/plugins/core/core_plugin.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.cpp b/code/studio/src/plugins/core/general_settings_page.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.cpp rename to code/studio/src/plugins/core/general_settings_page.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.h b/code/studio/src/plugins/core/general_settings_page.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.h rename to code/studio/src/plugins/core/general_settings_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.ui b/code/studio/src/plugins/core/general_settings_page.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.ui rename to code/studio/src/plugins/core/general_settings_page.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_add_item.png b/code/studio/src/plugins/core/icons/ic_nel_add_item.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_add_item.png rename to code/studio/src/plugins/core/icons/ic_nel_add_item.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_crash.png b/code/studio/src/plugins/core/icons/ic_nel_crash.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_crash.png rename to code/studio/src/plugins/core/icons/ic_nel_crash.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_delete_item.png b/code/studio/src/plugins/core/icons/ic_nel_delete_item.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_delete_item.png rename to code/studio/src/plugins/core/icons/ic_nel_delete_item.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_down_item.png b/code/studio/src/plugins/core/icons/ic_nel_down_item.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_down_item.png rename to code/studio/src/plugins/core/icons/ic_nel_down_item.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_generic_settings.png b/code/studio/src/plugins/core/icons/ic_nel_generic_settings.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_generic_settings.png rename to code/studio/src/plugins/core/icons/ic_nel_generic_settings.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_new.png b/code/studio/src/plugins/core/icons/ic_nel_new.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_new.png rename to code/studio/src/plugins/core/icons/ic_nel_new.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_open.png b/code/studio/src/plugins/core/icons/ic_nel_open.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_open.png rename to code/studio/src/plugins/core/icons/ic_nel_open.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_path_settings.png b/code/studio/src/plugins/core/icons/ic_nel_path_settings.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_path_settings.png rename to code/studio/src/plugins/core/icons/ic_nel_path_settings.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_pill.png b/code/studio/src/plugins/core/icons/ic_nel_pill.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_pill.png rename to code/studio/src/plugins/core/icons/ic_nel_pill.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_redo.png b/code/studio/src/plugins/core/icons/ic_nel_redo.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_redo.png rename to code/studio/src/plugins/core/icons/ic_nel_redo.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_reset_all.png b/code/studio/src/plugins/core/icons/ic_nel_reset_all.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_reset_all.png rename to code/studio/src/plugins/core/icons/ic_nel_reset_all.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_save.png b/code/studio/src/plugins/core/icons/ic_nel_save.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_save.png rename to code/studio/src/plugins/core/icons/ic_nel_save.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_save_as.png b/code/studio/src/plugins/core/icons/ic_nel_save_as.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_save_as.png rename to code/studio/src/plugins/core/icons/ic_nel_save_as.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_undo.png b/code/studio/src/plugins/core/icons/ic_nel_undo.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_undo.png rename to code/studio/src/plugins/core/icons/ic_nel_undo.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_up_item.png b/code/studio/src/plugins/core/icons/ic_nel_up_item.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_up_item.png rename to code/studio/src/plugins/core/icons/ic_nel_up_item.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icontext.h b/code/studio/src/plugins/core/icontext.h similarity index 98% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/icontext.h rename to code/studio/src/plugins/core/icontext.h index d2cbb412c..616e0db14 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icontext.h +++ b/code/studio/src/plugins/core/icontext.h @@ -69,6 +69,8 @@ public: virtual void newDocument(){} virtual void close(){} + + virtual void onActivated(){} }; } // namespace Core diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icore.h b/code/studio/src/plugins/core/icore.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/icore.h rename to code/studio/src/plugins/core/icore.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icore_listener.h b/code/studio/src/plugins/core/icore_listener.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/icore_listener.h rename to code/studio/src/plugins/core/icore_listener.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/images/nel.png b/code/studio/src/plugins/core/images/nel.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/images/nel.png rename to code/studio/src/plugins/core/images/nel.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/images/preferences.png b/code/studio/src/plugins/core/images/preferences.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/images/preferences.png rename to code/studio/src/plugins/core/images/preferences.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/ioptions_page.h b/code/studio/src/plugins/core/ioptions_page.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/ioptions_page.h rename to code/studio/src/plugins/core/ioptions_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp b/code/studio/src/plugins/core/main_window.cpp similarity index 97% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp rename to code/studio/src/plugins/core/main_window.cpp index a90e67bc0..c181376e8 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp +++ b/code/studio/src/plugins/core/main_window.cpp @@ -46,13 +46,13 @@ MainWindow::MainWindow(ExtensionSystem::IPluginManager *pluginManager, QWidget * m_undoGroup(0), m_settings(0) { - QCoreApplication::setApplicationName(QLatin1String("ObjectViewerQt")); + QCoreApplication::setApplicationName(QLatin1String("Studio")); QCoreApplication::setApplicationVersion(QLatin1String(Core::Constants::OVQT_VERSION_LONG)); QCoreApplication::setOrganizationName(QLatin1String("RyzomCore")); setObjectName(Constants::MAIN_WINDOW); setWindowIcon(QIcon(Constants::ICON_PILL)); - setWindowTitle(tr("Object Viewer Qt")); + setWindowTitle(tr("Ryzom Core Studio")); m_pluginManager = pluginManager; m_settings = m_pluginManager->settings(); @@ -108,8 +108,14 @@ void MainWindow::extensionsInitialized() readSettings(); connect(m_contextManager, SIGNAL(currentContextChanged(Core::IContext *)), this, SLOT(updateContext(Core::IContext *))); - if (m_contextManager->currentContext() != NULL) - updateContext(m_contextManager->currentContext()); + + Core::IContext *context = m_contextManager->currentContext(); + if (context != NULL) + { + updateContext(context); + context->onActivated(); + } + show(); } @@ -232,8 +238,8 @@ bool MainWindow::showOptionsDialog(const QString &group, void MainWindow::about() { - QMessageBox::about(this, tr("About Object Viewer Qt"), - tr("

    Object Viewer Qt

    " + QMessageBox::about(this, tr("About Ryzom Core Studio"), + tr("

    Ryzom Core Studio

    " "

    Ryzom Core team

    Compiled on %1 %2").arg(__DATE__).arg(__TIME__)); } @@ -438,9 +444,6 @@ void MainWindow::createMenus() m_toolsMenu = m_menuBar->addMenu(tr("&Tools")); menuManager()->registerMenu(m_toolsMenu, Constants::M_TOOLS); - m_sheetMenu = m_toolsMenu->addMenu(tr("&Sheet")); - menuManager()->registerMenu(m_sheetMenu, Constants::M_SHEET); - // m_toolsMenu->addSeparator(); m_toolsMenu->addAction(m_settingsAction); @@ -452,6 +455,9 @@ void MainWindow::createMenus() m_helpMenu->addAction(m_aboutAction); m_helpMenu->addAction(m_aboutQtAction); m_helpMenu->addAction(m_pluginViewAction); + + m_sheetMenu = m_menuBar->addMenu(tr("&Sheet")); + menuManager()->registerMenu(m_sheetMenu, Constants::M_SHEET); } void MainWindow::createStatusBar() diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h b/code/studio/src/plugins/core/main_window.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h rename to code/studio/src/plugins/core/main_window.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/menu_manager.cpp b/code/studio/src/plugins/core/menu_manager.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/menu_manager.cpp rename to code/studio/src/plugins/core/menu_manager.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/menu_manager.h b/code/studio/src/plugins/core/menu_manager.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/menu_manager.h rename to code/studio/src/plugins/core/menu_manager.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/plugin_view_dialog.cpp b/code/studio/src/plugins/core/plugin_view_dialog.cpp similarity index 67% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/plugin_view_dialog.cpp rename to code/studio/src/plugins/core/plugin_view_dialog.cpp index 175902d39..cccc98509 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/plugin_view_dialog.cpp +++ b/code/studio/src/plugins/core/plugin_view_dialog.cpp @@ -25,6 +25,8 @@ #include #include #include +#include +#include // Project includes #include "../../extension_system/iplugin_spec.h" @@ -43,6 +45,10 @@ PluginView::PluginView(ExtensionSystem::IPluginManager *pluginManager, QWidget * connect(m_pluginManager, SIGNAL(pluginsChanged()), this, SLOT(updateList())); connect(this, SIGNAL(accepted()), this, SLOT(updateSettings())); + connect( m_ui.pluginTreeWidget, SIGNAL( itemClicked( QTreeWidgetItem*, int ) ), this, SLOT( onItemClicked() ) ); + connect( m_ui.unloadButton, SIGNAL( clicked( bool ) ), this, SLOT( onUnloadClicked() ) ); + connect( m_ui.loadButton, SIGNAL( clicked( bool ) ), this, SLOT( onLoadClicked() ) ); + // WhiteList is list of plugins which can not disable. m_whiteList << Constants::OVQT_CORE_PLUGIN; updateList(); @@ -59,6 +65,7 @@ void PluginView::updateList() static QIcon notLoadedIcon = QApplication::style()->standardIcon(QStyle::SP_DialogResetButton); m_specToItem.clear(); + m_itemToSpec.clear(); QList items; Q_FOREACH (ExtensionSystem::IPluginSpec *spec, m_pluginManager->plugins()) @@ -81,6 +88,7 @@ void PluginView::updateList() items.append(item); m_specToItem.insert(spec, item); + m_itemToSpec.insert(item, spec); } m_ui.pluginTreeWidget->clear(); @@ -105,4 +113,60 @@ void PluginView::updateSettings() } } -} /* namespace Core */ \ No newline at end of file +void PluginView::onItemClicked() +{ + m_ui.unloadButton->setEnabled( true ); +} + +void PluginView::onUnloadClicked() +{ + QTreeWidgetItem *item = m_ui.pluginTreeWidget->currentItem(); + if( item == NULL ) + { + QMessageBox::warning( this, + tr( "Plugin unload" ), + tr( "No plugin selected!" ) ); + return; + } + + QMap< QTreeWidgetItem*, ExtensionSystem::IPluginSpec* >::const_iterator itr + = m_itemToSpec.find( item ); + if( itr == m_itemToSpec.end() ) + return; + + bool success = m_pluginManager->unloadPlugin( itr.value() ); + if( !success ) + { + QMessageBox::warning( this, + tr( "Plugin unload" ), + tr( "Failed to unload plugin." ) ); + } +} + +void PluginView::onLoadClicked() +{ + QString f = QFileDialog::getOpenFileName( this, + tr( "Loading a plugin" ), + ".", + "Plugin specifications ( *.xml )" ); + + if( f.isEmpty() ) + { + return; + } + + QApplication::setOverrideCursor( Qt::WaitCursor ); + bool success = m_pluginManager->loadPlugin( f ); + QApplication::setOverrideCursor( Qt::ArrowCursor ); + + if( !success ) + { + QMessageBox::warning( this, + tr( "Loading plugin" ), + tr( "Error loading plugin!" ) ); + } +} + + +} /* namespace Core */ + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/plugin_view_dialog.h b/code/studio/src/plugins/core/plugin_view_dialog.h similarity index 91% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/plugin_view_dialog.h rename to code/studio/src/plugins/core/plugin_view_dialog.h index aae16749d..e7c1123c1 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/plugin_view_dialog.h +++ b/code/studio/src/plugins/core/plugin_view_dialog.h @@ -44,10 +44,15 @@ private Q_SLOTS: void updateList(); void updateSettings(); + void onItemClicked(); + void onUnloadClicked(); + void onLoadClicked(); + private: const int m_checkStateColumn; QMap m_specToItem; + QMap m_itemToSpec; QStringList m_whiteList; ExtensionSystem::IPluginManager *m_pluginManager; Ui::PluginView m_ui; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/plugin_view_dialog.ui b/code/studio/src/plugins/core/plugin_view_dialog.ui similarity index 85% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/plugin_view_dialog.ui rename to code/studio/src/plugins/core/plugin_view_dialog.ui index 9d7d395be..45c4695e8 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/plugin_view_dialog.ui +++ b/code/studio/src/plugins/core/plugin_view_dialog.ui @@ -17,7 +17,7 @@ true - + true @@ -79,7 +79,34 @@ + + + + false + + + All objects list + + + + + + false + + + Unload plugin + + + + + + + Load plugin + + + + Qt::Horizontal @@ -92,27 +119,17 @@ - + Close - - - - false - - - All objects list - - - - + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/qtwin.cpp b/code/studio/src/plugins/core/qtwin.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/qtwin.cpp rename to code/studio/src/plugins/core/qtwin.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/qtwin.h b/code/studio/src/plugins/core/qtwin.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/qtwin.h rename to code/studio/src/plugins/core/qtwin.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp b/code/studio/src/plugins/core/search_paths_settings_page.cpp similarity index 96% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp rename to code/studio/src/plugins/core/search_paths_settings_page.cpp index e76d6c796..516d3d3f3 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp +++ b/code/studio/src/plugins/core/search_paths_settings_page.cpp @@ -28,6 +28,10 @@ #include #include +#if !defined NL_OS_WINDOWS +#include "core_config.h" +#endif + namespace Core { @@ -118,6 +122,10 @@ void SearchPathsSettingsPage::applySearchPaths() for (int i = 1; i < remapExt.size(); i += 2) NLMISC::CPath::remapExtension(remapExt.at(i - 1).toUtf8().constData(), remapExt.at(i).toUtf8().constData(), true); +#if !defined NL_OS_WINDOWS + NLMISC::CPath::addSearchPath(std::string(STUDIO_DATA_DIR), false, false); +#endif + Q_FOREACH(QString path, paths) { NLMISC::CPath::addSearchPath(path.toUtf8().constData(), m_recurse, false); @@ -216,4 +224,4 @@ void SearchPathsSettingsPage::checkEnabledButton() m_ui.downToolButton->setEnabled(bEnabled); } -} /* namespace Core */ \ No newline at end of file +} /* namespace Core */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.h b/code/studio/src/plugins/core/search_paths_settings_page.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.h rename to code/studio/src/plugins/core/search_paths_settings_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.ui b/code/studio/src/plugins/core/search_paths_settings_page.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.ui rename to code/studio/src/plugins/core/search_paths_settings_page.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/settings_dialog.cpp b/code/studio/src/plugins/core/settings_dialog.cpp similarity index 96% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/settings_dialog.cpp rename to code/studio/src/plugins/core/settings_dialog.cpp index 4b7bbac3a..b1027212c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/settings_dialog.cpp +++ b/code/studio/src/plugins/core/settings_dialog.cpp @@ -17,7 +17,7 @@ // along with this program. If not, see . // Project includes -#include "settings_dialog.h" +#include "../core/settings_dialog.h" #include "ioptions_page.h" // Qt includes @@ -145,11 +145,17 @@ void SettingsDialog::pageSelected() void SettingsDialog::accept() { m_applied = true; + + setCursor( Qt::WaitCursor ); + Q_FOREACH(IOptionsPage *page, m_pages) { page->apply(); page->finish(); } + + setCursor( Qt::ArrowCursor ); + done(QDialog::Accepted); } @@ -162,8 +168,13 @@ void SettingsDialog::reject() void SettingsDialog::apply() { + setCursor( Qt::WaitCursor ); + Q_FOREACH(IOptionsPage *page, m_pages) page->apply(); + + setCursor( Qt::ArrowCursor ); + m_applied = true; } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/settings_dialog.h b/code/studio/src/plugins/core/settings_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/settings_dialog.h rename to code/studio/src/plugins/core/settings_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/settings_dialog.ui b/code/studio/src/plugins/core/settings_dialog.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/settings_dialog.ui rename to code/studio/src/plugins/core/settings_dialog.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/ovqt_plugin_core.xml b/code/studio/src/plugins/core/studio_plugin_core.xml similarity index 67% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/ovqt_plugin_core.xml rename to code/studio/src/plugins/core/studio_plugin_core.xml index 2f5d6e9a8..335ed8845 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/ovqt_plugin_core.xml +++ b/code/studio/src/plugins/core/studio_plugin_core.xml @@ -1,5 +1,5 @@ - ovqt_plugin_core + studio_plugin_core Core 0.8 Ryzom Core diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/CMakeLists.txt b/code/studio/src/plugins/disp_sheet_id/CMakeLists.txt similarity index 51% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/CMakeLists.txt rename to code/studio/src/plugins/disp_sheet_id/CMakeLists.txt index 7e5c0e409..bce24b667 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/CMakeLists.txt +++ b/code/studio/src/plugins/disp_sheet_id/CMakeLists.txt @@ -26,34 +26,34 @@ SOURCE_GROUP(QtGeneratedMocSrc FILES ${OVQT_DISP_SHEET_ID_PLUGIN_MOC_SRC}) SOURCE_GROUP("Display sheet id Plugin" FILES ${SRC}) SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) -ADD_LIBRARY(ovqt_plugin_disp_sheet_id MODULE ${SRC} ${OVQT_DISP_SHEET_ID_PLUGIN_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_DISP_SHEET_ID_PLUGIN_UI_HDRS}) +ADD_LIBRARY(studio_plugin_disp_sheet_id MODULE ${SRC} ${OVQT_DISP_SHEET_ID_PLUGIN_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_DISP_SHEET_ID_PLUGIN_UI_HDRS}) -TARGET_LINK_LIBRARIES(ovqt_plugin_disp_sheet_id ovqt_plugin_core nelmisc ${QT_LIBRARIES}) +TARGET_LINK_LIBRARIES(studio_plugin_disp_sheet_id studio_plugin_core nelmisc ${QT_LIBRARIES}) IF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(ovqt_plugin_disp_sheet_id ${CMAKE_THREAD_LIBS_INIT}) + TARGET_LINK_LIBRARIES(studio_plugin_disp_sheet_id ${CMAKE_THREAD_LIBS_INIT}) ENDIF(WITH_STLPORT) -NL_DEFAULT_PROPS(ovqt_plugin_disp_sheet_id "NeL, Tools, 3D: Object Viewer Qt Plugin: Display sheet id") -NL_ADD_RUNTIME_FLAGS(ovqt_plugin_disp_sheet_id) -NL_ADD_LIB_SUFFIX(ovqt_plugin_disp_sheet_id) +NL_DEFAULT_PROPS(studio_plugin_disp_sheet_id "Tools: Studio Plugin: Display sheet id") +NL_ADD_RUNTIME_FLAGS(studio_plugin_disp_sheet_id) +NL_ADD_LIB_SUFFIX(studio_plugin_disp_sheet_id) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) IF(WIN32) IF(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_disp_sheet_id LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_disp_sheet_id LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) ELSE(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_disp_sheet_id LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_disp_sheet_id LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) ENDIF(WITH_INSTALL_LIBRARIES) ELSE(WIN32) IF(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_disp_sheet_id LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_disp_sheet_id LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) ELSE(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_disp_sheet_id LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_disp_sheet_id LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) ENDIF(WITH_INSTALL_LIBRARIES) ENDIF(WIN32) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_disp_sheet_id.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/studio_plugin_disp_sheet_id.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/disp_sheet_id_plugin.cpp b/code/studio/src/plugins/disp_sheet_id/disp_sheet_id_plugin.cpp similarity index 88% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/disp_sheet_id_plugin.cpp rename to code/studio/src/plugins/disp_sheet_id/disp_sheet_id_plugin.cpp index 62d2f0430..46a8ee6bd 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/disp_sheet_id_plugin.cpp +++ b/code/studio/src/plugins/disp_sheet_id/disp_sheet_id_plugin.cpp @@ -34,6 +34,21 @@ using namespace SheetIdViewPlugin; +DispSheetIdPlugin::DispSheetIdPlugin() +{ +} + +DispSheetIdPlugin::~DispSheetIdPlugin() +{ + Core::MenuManager *menuManager = Core::ICore::instance()->menuManager(); + QAction *a = menuManager->action( "SheetIdView" ); + menuManager->unregisterAction( "SheetIdView" ); + delete a; + + delete m_LibContext; + m_LibContext = NULL; +} + bool DispSheetIdPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) { Q_UNUSED(errorString); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/disp_sheet_id_plugin.h b/code/studio/src/plugins/disp_sheet_id/disp_sheet_id_plugin.h similarity index 97% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/disp_sheet_id_plugin.h rename to code/studio/src/plugins/disp_sheet_id/disp_sheet_id_plugin.h index 8eaf3ead9..7506b84cc 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/disp_sheet_id_plugin.h +++ b/code/studio/src/plugins/disp_sheet_id/disp_sheet_id_plugin.h @@ -37,6 +37,9 @@ class DispSheetIdPlugin : public QObject, public ExtensionSystem::IPlugin Q_INTERFACES(ExtensionSystem::IPlugin) public: + DispSheetIdPlugin(); + ~DispSheetIdPlugin(); + bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString); void extensionsInitialized(); void setNelContext(NLMISC::INelContext *nelContext); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/sheet_id_view.cpp b/code/studio/src/plugins/disp_sheet_id/sheet_id_view.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/sheet_id_view.cpp rename to code/studio/src/plugins/disp_sheet_id/sheet_id_view.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/sheet_id_view.h b/code/studio/src/plugins/disp_sheet_id/sheet_id_view.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/sheet_id_view.h rename to code/studio/src/plugins/disp_sheet_id/sheet_id_view.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/sheet_id_view.ui b/code/studio/src/plugins/disp_sheet_id/sheet_id_view.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/sheet_id_view.ui rename to code/studio/src/plugins/disp_sheet_id/sheet_id_view.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/ovqt_plugin_disp_sheet_id.xml b/code/studio/src/plugins/disp_sheet_id/studio_plugin_disp_sheet_id.xml similarity index 76% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/ovqt_plugin_disp_sheet_id.xml rename to code/studio/src/plugins/disp_sheet_id/studio_plugin_disp_sheet_id.xml index 173ce4479..4ac055b1a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/disp_sheet_id/ovqt_plugin_disp_sheet_id.xml +++ b/code/studio/src/plugins/disp_sheet_id/studio_plugin_disp_sheet_id.xml @@ -1,5 +1,5 @@ - ovqt_plugin_disp_sheet_id + studio_plugin_disp_sheet_id DisplaySheetId 1.0 pemeon diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/CMakeLists.txt b/code/studio/src/plugins/example/CMakeLists.txt similarity index 54% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/example/CMakeLists.txt rename to code/studio/src/plugins/example/CMakeLists.txt index 27e8698df..fd4008fc4 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/CMakeLists.txt +++ b/code/studio/src/plugins/example/CMakeLists.txt @@ -28,29 +28,29 @@ SOURCE_GROUP(QtGeneratedMocSrc FILES ${OVQT_PLUG_EXAMPLE_MOC_SRC}) SOURCE_GROUP("Example Plugin" FILES ${SRC}) SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) -ADD_LIBRARY(ovqt_plugin_example MODULE ${SRC} ${OVQT_PLUG_EXAMPLE_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUG_EXAMPLE_UI_HDRS}) +ADD_LIBRARY(studio_plugin_example MODULE ${SRC} ${OVQT_PLUG_EXAMPLE_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUG_EXAMPLE_UI_HDRS}) -TARGET_LINK_LIBRARIES(ovqt_plugin_example ovqt_plugin_core nelmisc nel3d ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY}) +TARGET_LINK_LIBRARIES(studio_plugin_example studio_plugin_core nelmisc nel3d ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY}) -NL_DEFAULT_PROPS(ovqt_plugin_example "NeL, Tools, 3D: Object Viewer Qt Plugin: Example") -NL_ADD_RUNTIME_FLAGS(ovqt_plugin_example) -NL_ADD_LIB_SUFFIX(ovqt_plugin_example) +NL_DEFAULT_PROPS(studio_plugin_example "Tools: Studio Plugin: Example") +NL_ADD_RUNTIME_FLAGS(studio_plugin_example) +NL_ADD_LIB_SUFFIX(studio_plugin_example) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) IF(WIN32) IF(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_example LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_example LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) ELSE(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_example LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_example LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) ENDIF(WITH_INSTALL_LIBRARIES) ELSE(WIN32) IF(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_example LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_example LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) ELSE(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_example LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_example LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) ENDIF(WITH_INSTALL_LIBRARIES) ENDIF(WIN32) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_example.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/studio_plugin_example.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_plugin.cpp b/code/studio/src/plugins/example/example_plugin.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_plugin.cpp rename to code/studio/src/plugins/example/example_plugin.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_plugin.h b/code/studio/src/plugins/example/example_plugin.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_plugin.h rename to code/studio/src/plugins/example/example_plugin.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.cpp b/code/studio/src/plugins/example/example_settings_page.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.cpp rename to code/studio/src/plugins/example/example_settings_page.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.h b/code/studio/src/plugins/example/example_settings_page.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.h rename to code/studio/src/plugins/example/example_settings_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.ui b/code/studio/src/plugins/example/example_settings_page.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.ui rename to code/studio/src/plugins/example/example_settings_page.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.cpp b/code/studio/src/plugins/example/qnel_widget.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.cpp rename to code/studio/src/plugins/example/qnel_widget.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.h b/code/studio/src/plugins/example/qnel_widget.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.h rename to code/studio/src/plugins/example/qnel_widget.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.cpp b/code/studio/src/plugins/example/simple_viewer.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.cpp rename to code/studio/src/plugins/example/simple_viewer.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.h b/code/studio/src/plugins/example/simple_viewer.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.h rename to code/studio/src/plugins/example/simple_viewer.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/ovqt_plugin_example.xml b/code/studio/src/plugins/example/studio_plugin_example.xml similarity index 78% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/example/ovqt_plugin_example.xml rename to code/studio/src/plugins/example/studio_plugin_example.xml index ae6664d52..434e37907 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/ovqt_plugin_example.xml +++ b/code/studio/src/plugins/example/studio_plugin_example.xml @@ -1,5 +1,5 @@ - ovqt_plugin_example + studio_plugin_example ExamplePlugin 0.2 dnk-88 diff --git a/code/studio/src/plugins/georges_editor/CMakeLists.txt b/code/studio/src/plugins/georges_editor/CMakeLists.txt new file mode 100644 index 000000000..bf7e6e0c9 --- /dev/null +++ b/code/studio/src/plugins/georges_editor/CMakeLists.txt @@ -0,0 +1,81 @@ +INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${LIBXML2_INCLUDE_DIR} + ${QT_INCLUDES} + ${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/qtpropertybrowser) + +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 + ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin_spec.h) + +SET(OVQT_PLUG_GEORGES_EDITOR_HDR georges_editor_plugin.h + georges_editor_form.h + georges_dirtree_dialog.h + georges_filesystem_model.h + georges_treeview_dialog.h + expandable_headerview.h + browser_ctrl.h + browser_ctrl_pvt.h + dfn_browser_ctrl.h + georges_dfn_dialog.h + filepath_property_manager.h + typ_browser_ctrl.h + georges_typ_dialog.h + georges_dock_widget.h + ) + +SET(OVQT_PLUG_GEORGES_EDITOR_UIS georges_editor_form.ui + georges_dirtree_form.ui + georges_treeview_form.ui + georges_dfn_dialog.ui + georges_typ_dialog.ui + ) + +SET(OVQT_PLUGIN_GEORGES_EDITOR_RCS georges_editor.qrc) + +SET(QT_USE_QTGUI TRUE) +SET(QT_USE_QTOPENGL TRUE) + +QT4_ADD_RESOURCES(OVQT_PLUGIN_GEORGES_EDITOR_RC_SRCS ${OVQT_PLUGIN_GEORGES_EDITOR_RCS}) +QT4_WRAP_CPP(OVQT_PLUG_GEORGES_EDITOR_MOC_SRC ${OVQT_PLUG_GEORGES_EDITOR_HDR}) +QT4_WRAP_UI( OVQT_PLUG_GEORGES_EDITOR_UI_HDRS ${OVQT_PLUG_GEORGES_EDITOR_UIS} ) + +SOURCE_GROUP(QtResources FILES ${OVQT_PLUG_GEORGES_EDITOR_UIS} ${OVQT_PLUGIN_GEORGES_EDITOR_RCS}) +SOURCE_GROUP(QtGeneratedUiHdr FILES ${OVQT_PLUG_GEORGES_EDITOR_UI_HDRS}) +SOURCE_GROUP(QtGeneratedMocSrc FILES ${OVQT_PLUG_GEORGES_EDITOR_MOC_SRC}) +SOURCE_GROUP("Georges Editor Plugin" FILES ${SRC}) +SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) + +ADD_LIBRARY(studio_plugin_georges_editor MODULE ${SRC} ${OVQT_PLUG_GEORGES_EDITOR_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUG_GEORGES_EDITOR_UI_HDRS} ${OVQT_PLUGIN_GEORGES_EDITOR_RC_SRCS}) + +TARGET_LINK_LIBRARIES(studio_plugin_georges_editor studio_plugin_core nelmisc nelgeorges qt_property_browser ${QT_LIBRARIES}) + +NL_DEFAULT_PROPS(studio_plugin_georges_editor "Tools: Studio Plugin: Georges Editor") +NL_ADD_RUNTIME_FLAGS(studio_plugin_georges_editor) +NL_ADD_LIB_SUFFIX(studio_plugin_georges_editor) + +ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) + + +IF(WITH_PCH) + ADD_NATIVE_PRECOMPILED_HEADER(studio_plugin_georges_editor ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) +ENDIF(WITH_PCH) + +IF(WIN32) + IF(WITH_INSTALL_LIBRARIES) + INSTALL(TARGETS studio_plugin_georges_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) + ELSE(WITH_INSTALL_LIBRARIES) + INSTALL(TARGETS studio_plugin_georges_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) + ENDIF(WITH_INSTALL_LIBRARIES) +ELSE(WIN32) + IF(WITH_INSTALL_LIBRARIES) + INSTALL(TARGETS studio_plugin_georges_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) + ELSE(WITH_INSTALL_LIBRARIES) + INSTALL(TARGETS studio_plugin_georges_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) + ENDIF(WITH_INSTALL_LIBRARIES) +ENDIF(WIN32) + +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/studio_plugin_georges_editor.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) + diff --git a/code/studio/src/plugins/georges_editor/actions.cpp b/code/studio/src/plugins/georges_editor/actions.cpp new file mode 100644 index 000000000..08196f79b --- /dev/null +++ b/code/studio/src/plugins/georges_editor/actions.cpp @@ -0,0 +1,103 @@ +// 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 . + +// Project includes +#include "actions.h" +#include "formitem.h" +#include "georgesform_model.h" + +// Qt includes + + +// NeL includes +#include +#include +#include +#include +#include +#include +#include + +namespace GeorgesQt +{ + + CUndoFormArrayRenameCommand::CUndoFormArrayRenameCommand(CGeorgesFormModel *model, CFormItem *item, const QVariant &value, QUndoCommand *parent) + : QUndoCommand("Rename Form Array Member", parent), m_model(model), m_item(item) + { + m_newValue = value.toString(); + } + + void CUndoFormArrayRenameCommand::redo() + { + update(true); + } + + void CUndoFormArrayRenameCommand::undo() + { + update(false); + } + + void CUndoFormArrayRenameCommand::update(bool redo) + { + // Get the parent node + const NLGEORGES::CFormDfn *parentDfn; + uint indexDfn; + const NLGEORGES::CFormDfn *nodeDfn; + const NLGEORGES::CType *nodeType; + NLGEORGES::CFormElm *node; + NLGEORGES::UFormDfn::TEntryType type; + bool isArray; + bool vdfnArray; + NLGEORGES::CForm *form=static_cast(m_item->form()); + NLGEORGES::CFormElm *elm = static_cast(&form->Elements); + + nlverify ( elm->getNodeByName (m_item->formName().c_str (), &parentDfn, indexDfn, &nodeDfn, &nodeType, &node, type, isArray, vdfnArray, true, NLGEORGES_FIRST_ROUND) ); + if (node) + { + std::string tmpName; + node->getFormName(tmpName); + + NLGEORGES::CFormElmArray* array = static_cast (node->getParent ()); + + // In the redo stage save the old value, just in case. + if(redo) + { + // If the name of the element is empty then give it a nice default. + if(array->Elements[m_item->structId()].Name.empty()) + { + m_oldValue.append("#"); + m_oldValue.append(QString("%1").arg(m_item->structId())); + } + else + { + m_oldValue = QString(array->Elements[m_item->structId()].Name.c_str()); + } + } + + QString value; + if(redo) + value = m_newValue; + else + value = m_oldValue; + + + array->Elements[m_item->structId()].Name = value.toAscii().data(); + m_item->setName(value.toAscii().data()); + + m_model->emitDataChanged(m_model->index(m_item->row(), 0, m_item)); + } + } +} \ No newline at end of file diff --git a/code/studio/src/plugins/georges_editor/actions.h b/code/studio/src/plugins/georges_editor/actions.h new file mode 100644 index 000000000..861eaef8e --- /dev/null +++ b/code/studio/src/plugins/georges_editor/actions.h @@ -0,0 +1,48 @@ +// 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 ACTIONS_H +#define ACTIONS_H + +#include +#include + +namespace GeorgesQt +{ + class CFormItem; + class CGeorgesFormModel; + + class CUndoFormArrayRenameCommand : public QUndoCommand + { + public: + CUndoFormArrayRenameCommand(CGeorgesFormModel *model, CFormItem *item, const QVariant &value, QUndoCommand *parent = 0); + ~CUndoFormArrayRenameCommand() {} + + void redo(); + void undo(); + + void update(bool redo); + + protected: + CFormItem *m_item; + CGeorgesFormModel *m_model; + + QString m_newValue; + QString m_oldValue; + }; +} + +#endif // ACTIONS_H \ No newline at end of file diff --git a/code/studio/src/plugins/georges_editor/browser_ctrl.cpp b/code/studio/src/plugins/georges_editor/browser_ctrl.cpp new file mode 100644 index 000000000..ad947edcf --- /dev/null +++ b/code/studio/src/plugins/georges_editor/browser_ctrl.cpp @@ -0,0 +1,114 @@ +// Ryzom Core Studio - Georges Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 "browser_ctrl.h" +#include "3rdparty/qtpropertybrowser/qttreepropertybrowser.h" +#include "3rdparty/qtpropertybrowser/qtvariantproperty.h" +#include "filepath_property_manager.h" +#include + +#include "nel/georges/form.h" + +#include "formitem.h" + +#include "browser_ctrl_pvt.h" + +BrowserCtrl::BrowserCtrl( QtTreePropertyBrowser *browser ) : +QObject( browser ) +{ + m_pvt = new BrowserCtrlPvt(); + m_pvt->setBrowser( browser ); + + connect( m_pvt, SIGNAL( arrayResized( const QString&, int ) ), this, SLOT( onArrayResized( const QString&, int ) ) ); + connect( m_pvt, SIGNAL( modified() ), this, SLOT( onModified() ) ); + connect( m_pvt, SIGNAL( valueChanged( const QString&, const QString& ) ), this, SLOT( onValueChanged( const QString&, const QString& ) ) ); + connect( m_pvt, SIGNAL( vstructChanged( const QString& ) ), this, SLOT( onVStructChanged( const QString& ) ) ); +} + +BrowserCtrl::~BrowserCtrl() +{ + delete m_pvt; + m_pvt = NULL; +} + +void BrowserCtrl::clicked( const QModelIndex &idx ) +{ + disableMgrConnections(); + m_pvt->clear(); + + GeorgesQt::CFormItem *item = static_cast< GeorgesQt::CFormItem* >( idx.internalPointer() ); + + m_pvt->setupNode( item ); + + enableMgrConnections(); + +} + +void BrowserCtrl::onValueChanged( QtProperty *p, const QVariant &value ) +{ + m_pvt->onValueChanged( p, value ); +} + +void BrowserCtrl::onValueChanged( const QString &key, const QString &value ) +{ + Q_EMIT valueChanged( key, value ); +} + +void BrowserCtrl::onFileValueChanged( QtProperty *p, const QString &value ) +{ + m_pvt->onFileValueChanged( p, value ); +} + +void BrowserCtrl::onArrayResized( const QString &name, int size ) +{ + Q_EMIT arrayResized( name, size ); +} + +void BrowserCtrl::onModified() +{ + Q_EMIT modified(); +} + +void BrowserCtrl::onVStructChanged( const QString &name ) +{ + Q_EMIT vstructChanged( name ); +} + +void BrowserCtrl::enableMgrConnections() +{ + QtVariantPropertyManager *mgr = m_pvt->manager(); + FileManager *fileMgr = m_pvt->fileManager(); + + connect( mgr, SIGNAL( valueChanged( QtProperty*, const QVariant & ) ), + this, SLOT( onValueChanged( QtProperty*, const QVariant & ) ) ); + connect( fileMgr, SIGNAL( valueChanged( QtProperty*, const QString & ) ), + this, SLOT( onFileValueChanged( QtProperty*, const QString & ) ) ); +} + +void BrowserCtrl::disableMgrConnections() +{ + QtVariantPropertyManager *mgr = m_pvt->manager(); + FileManager *fileMgr = m_pvt->fileManager(); + + disconnect( mgr, SIGNAL( valueChanged( QtProperty*, const QVariant & ) ), + this, SLOT( onValueChanged( QtProperty*, const QVariant & ) ) ); + disconnect( fileMgr, SIGNAL( valueChanged( QtProperty*, const QString & ) ), + this, SLOT( onFileValueChanged( QtProperty*, const QString & ) ) ); +} + diff --git a/code/studio/src/plugins/georges_editor/browser_ctrl.h b/code/studio/src/plugins/georges_editor/browser_ctrl.h new file mode 100644 index 000000000..a70b57356 --- /dev/null +++ b/code/studio/src/plugins/georges_editor/browser_ctrl.h @@ -0,0 +1,70 @@ +// Ryzom Core Studio - Georges Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 BROWSER_CTRL_H +#define BROWSER_CTRL_H + +#include + +namespace NLGEORGES +{ + class UForm; +} + +class QtTreePropertyBrowser; +class QModelIndex; +class QVariant; +class QtProperty; + +class BrowserCtrlPvt; + +class BrowserCtrl : public QObject +{ + Q_OBJECT +public: + BrowserCtrl( QtTreePropertyBrowser *browser ); + ~BrowserCtrl(); + void setForm( NLGEORGES::UForm *form ){ m_form = form; } + +public Q_SLOTS: + void clicked( const QModelIndex &idx ); + +Q_SIGNALS: + void arrayResized( const QString &name, int size ); + void modified(); + void valueChanged( const QString &key, const QString &value ); + void vstructChanged( const QString &name ); + +private Q_SLOTS: + void onValueChanged( QtProperty *p, const QVariant &value ); + void onValueChanged( const QString &key, const QString &value ); + void onFileValueChanged( QtProperty *p, const QString &value ); + void onArrayResized( const QString &name, int size ); + void onModified(); + void onVStructChanged( const QString &name ); + +private: + void enableMgrConnections(); + void disableMgrConnections(); + + + BrowserCtrlPvt *m_pvt; + NLGEORGES::UForm *m_form; +}; + +#endif diff --git a/code/studio/src/plugins/georges_editor/browser_ctrl_pvt.cpp b/code/studio/src/plugins/georges_editor/browser_ctrl_pvt.cpp new file mode 100644 index 000000000..dbeb8fecf --- /dev/null +++ b/code/studio/src/plugins/georges_editor/browser_ctrl_pvt.cpp @@ -0,0 +1,596 @@ +// Ryzom Core Studio - Georges Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 "browser_ctrl_pvt.h" +#include "3rdparty/qtpropertybrowser/qttreepropertybrowser.h" +#include "3rdparty/qtpropertybrowser/qtvariantproperty.h" +#include +#include "formitem.h" + +#include "nel/georges/form.h" + +#include "filepath_property_manager.h" +namespace +{ + const unsigned int FILEBROWSER = 9000000; + + QVariant::Type getValueType( const NLGEORGES::UType *typ ) + { + QVariant::Type t = QVariant::String; + + bool file = false; + + NLGEORGES::UType::TType ttyp = NLGEORGES::UType::String; + if( typ != NULL ) + { + ttyp = typ->getType(); + + const NLGEORGES::CType *ctyp = static_cast< const NLGEORGES::CType* >( typ ); + if(ctyp->UIType == NLGEORGES::CType::FileBrowser ) + { + file = true; + } + } + + if( file ) + return QVariant::Type( FILEBROWSER ); + + switch( ttyp ) + { + case NLGEORGES::UType::UnsignedInt: t = QVariant::UInt; break; + case NLGEORGES::UType::SignedInt: t = QVariant::Int; break; + case NLGEORGES::UType::Double: t = QVariant::Double; break; + case NLGEORGES::UType::Color: t = QVariant::Color; break; + case NLGEORGES::UType::String: t = QVariant::String; break; + } + + return t; + } + + QVariant::Type getValueTypeFromDfn( NLGEORGES::CFormElmStruct *st, int idx ) + { + NLGEORGES::CFormDfn *cdfn = st->FormDfn; + NLGEORGES::CFormDfn::CEntry entry = cdfn->getEntry( idx ); + return getValueType( entry.getTypePtr() ); + } + + + QVariant::Type getValueTypeFromDfn( NLGEORGES::CFormElmAtom *atom ) + { + QVariant::Type t = QVariant::String; + + NLGEORGES::CFormElm *cparent = static_cast< NLGEORGES::CFormElm* >( atom->getParent() ); + + if( cparent->isArray() ) + { + NLGEORGES::CFormElmStruct *aparent = static_cast< NLGEORGES::CFormElmStruct* >( cparent->getParent() ); + NLGEORGES::CFormDfn *cdfn = static_cast< NLGEORGES::CFormDfn* >( aparent->getStructDfn() ); + + int idx = -1; + for( idx = 0; idx < aparent->Elements.size(); idx++ ) + { + if( aparent->Elements[ idx ].Element == cparent ) + break; + } + + NLGEORGES::CFormDfn::CEntry entry = cdfn->getEntry( idx ); + return getValueType( entry.getTypePtr() ); + } + else + if( cparent->isStruct() ) + { + NLGEORGES::CFormElmStruct *sparent = static_cast< NLGEORGES::CFormElmStruct* >( cparent ); + NLGEORGES::CFormDfn *cdfn = static_cast< NLGEORGES::CFormDfn* >( cparent->getStructDfn() ); + + int idx = -1; + for( idx = 0; idx < sparent->Elements.size(); idx++ ) + { + if( sparent->Elements[ idx ].Element == atom ) + break; + } + + NLGEORGES::CFormDfn::CEntry entry = cdfn->getEntry( idx ); + return getValueType( entry.getTypePtr() ); + } + + return t; + } + + NLGEORGES::UFormElm* getGeorgesNode( GeorgesQt::CFormItem *item ) + { + NLGEORGES::UFormElm *n = NULL; + item->form()->getRootNode().getNodeByName( &n, item->formName().c_str() ); + return n; + } + + // Get the data from a string, and pack it into a QVariant properly + // Needed for some special values, like color + // which are represented differently in Nel and Qt + QVariant stringToVariant( const QString &value, QVariant::Type type ) + { + QVariant v; + + if( type == QVariant::Color ) + { + QStringList l = value.split( ',' ); + if( l.size() != 3 ) + v = ""; + else + { + QColor c; + c.setRed( l[ 0 ].toInt() ); + c.setGreen( l[ 1 ].toInt() ); + c.setBlue( l[ 2 ].toInt() ); + v = c; + } + + } + else + v = value; + + return v; + } + + // The inverse function of stringToVariant + // Unpacks the data from a QVariant properly + QString variantToString( const QVariant &value ) + { + QString v; + + if( value.type() == QVariant::Color ) + { + QColor c = value.value< QColor >(); + v += QString::number( c.red() ); + v += ','; + v += QString::number( c.green() ); + v += ','; + v += QString::number( c.blue() ); + } + else + v = value.toString(); + + return v; + } + +} + + +BrowserCtrlPvt::BrowserCtrlPvt( QObject *parent ) : +QObject( parent ) +{ + mgr = new QtVariantPropertyManager(); + factory = new QtVariantEditorFactory(); + m_fileMgr = new FileManager( this ); + m_fileFactory = new FileEditFactory( this ); + m_rootNode = NULL; +} + +BrowserCtrlPvt::~BrowserCtrlPvt() +{ + delete mgr; + mgr = NULL; + delete factory; + factory = NULL; + m_fileMgr = NULL; + m_fileFactory = NULL; + m_browser = NULL; +} + +NLGEORGES::UFormElm* BrowserCtrlPvt::getNode( const QString &name ) +{ + NLGEORGES::UFormElm *node = NULL; + m_rootNode->getNodeByName( &node, name.toUtf8().constData(), NULL, true ); + + return node; +} + +NLGEORGES::UFormElm* BrowserCtrlPvt::getCurrentNode() +{ + return getNode( m_currentNode.name ); +} + +void BrowserCtrlPvt::setupAtom( NLGEORGES::CFormElmStruct *st, int idx ) +{ + NLGEORGES::CFormElmStruct::CFormElmStructElm &elm = st->Elements[ idx ]; + if( ( elm.Element != NULL ) && !elm.Element->isAtom() ) + return; + + if( elm.Element == NULL ) + { + NLGEORGES::CFormDfn::CEntry &entry = st->FormDfn->getEntry( idx ); + if( entry.getArrayFlag() ) + return; + + if( entry.getType() == NLGEORGES::UFormDfn::EntryVirtualDfn ) + return; + } + + QString key = elm.Name.c_str(); + QString value = ""; + QVariant::Type t = QVariant::String; + + // If the atom exists, get the value from it + // Otherwise just get the type so we can set up the proper editor + if( elm.Element != NULL ) + { + // Check if there's a type, if not get it from the Dfn + const NLGEORGES::CType *type = elm.Element->getType(); + if( type != NULL ) + t = getValueType( elm.Element->getType() ); + else + t = getValueTypeFromDfn( st, idx ); + + std::string formName; + elm.Element->getFormName( formName, NULL ); + + std::string v; + m_rootNode->getValueByName( v, formName.c_str(), NLGEORGES::UFormElm::NoEval, NULL, 0 ); + value = stringToVariant( v.c_str(), t ).toString(); + } + else + { + t = getValueTypeFromDfn( st, idx ); + } + + if( t == QVariant::Type( FILEBROWSER ) ) + addFileProperty( key, value ); + else + addVariantProperty( t, key, value ); +} + +void BrowserCtrlPvt::setupStruct( NLGEORGES::UFormElm *node ) +{ + NLGEORGES::CFormElmStruct *st = static_cast< NLGEORGES::CFormElmStruct* >( node ); + + for( int i = 0; i < st->Elements.size(); i++ ) + { + setupAtom( st, i ); + } +} + +void BrowserCtrlPvt::setupStruct( GeorgesQt::CFormItem *node ) +{ + NLGEORGES::UFormElm *n = getGeorgesNode( node ); + if( n == NULL ) + return; + + setupStruct( n ); +} + +void BrowserCtrlPvt::setupVStruct( GeorgesQt::CFormItem *node ) +{ + NLGEORGES::UFormElm *n = getGeorgesNode( node ); + + QtProperty *p = NULL; + p = addFileProperty( "Dfn filename", "" ); + + if( n != NULL ) + { + NLGEORGES::CFormElmVirtualStruct *vs = static_cast< NLGEORGES::CFormElmVirtualStruct* >( n ); + m_fileMgr->setValue( p, vs->DfnFilename.c_str() ); + setupStruct( n ); + } +} + +void BrowserCtrlPvt::setupArray( GeorgesQt::CFormItem *node ) +{ + NLGEORGES::UFormElm *n = getGeorgesNode( node ); + uint size = 0; + + if( n != NULL ) + { + NLGEORGES::CFormElmArray *arr = static_cast< NLGEORGES::CFormElmArray* >( n ); + arr->getArraySize( size ); + } + + QString key = QObject::tr( "Array size" ); + QtVariantProperty *p = addVariantProperty( QVariant::Int, key, size ); +} + +void BrowserCtrlPvt::setupAtom( GeorgesQt::CFormItem *node ) +{ + NLGEORGES::UFormElm *n = getGeorgesNode( node ); + + if( n == NULL ) + return; + + NLGEORGES::CFormElmAtom *atom = static_cast< NLGEORGES::CFormElmAtom* >( n ); + std::string v; + atom->getValue( v ); + + const NLGEORGES::CType *t = atom->getType(); + QVariant::Type tt = QVariant::String; + if( t != NULL ) + { + tt = getValueType( t ); + } + else + { + tt = getValueTypeFromDfn( atom ); + } + + if( tt == QVariant::Type( FILEBROWSER ) ) + addFileProperty( "value", v.c_str() ); + else + addVariantProperty( tt, "value", v.c_str() ); +} + +void BrowserCtrlPvt::setupNode( GeorgesQt::CFormItem *node ) +{ + m_currentNode.clear(); + m_currentNode.name = node->formName().c_str(); + m_currentNode.type = node->type(); + + m_rootNode = dynamic_cast< NLGEORGES::CFormElm* >( &(node->form()->getRootNode()) ); + + if( node->isArray() ) + setupArray( node ); + else + if( node->isStruct() ) + setupStruct( node ); + else + if( node->isVStruct() ) + setupVStruct( node ); + else + if( node->isAtom() ) + setupAtom( node ); + + m_browser->setFactoryForManager( mgr, factory ); + m_browser->setFactoryForManager( m_fileMgr, m_fileFactory ); +} + +void BrowserCtrlPvt::clear() +{ + m_browser->clear(); + m_currentNode.clear(); +} + + +void BrowserCtrlPvt::onStructValueChanged( QtProperty *p, const QVariant &value ) +{ + std::string k = p->propertyName().toUtf8().constData(); + std::string v; + v = variantToString( value ).toUtf8().constData(); + + NLGEORGES::UFormElm *node = getCurrentNode(); + + bool created = false; + node->setValueByName( v.c_str(), k.c_str(), &created ); + + QString key = m_currentNode.name + "." + p->propertyName(); + + Q_EMIT modified(); + Q_EMIT valueChanged( key, value.toString() ); +} + +void BrowserCtrlPvt::onVStructValueChanged( QtProperty *p, const QVariant &value ) +{ + if( p->propertyName() != "Dfn filename" ) + { + onStructValueChanged( p, value ); + return; + } + + NLGEORGES::CFormElmVirtualStruct *vs = static_cast< NLGEORGES::CFormElmVirtualStruct* >( getCurrentNode() ); + if( vs == NULL ) + { + const NLGEORGES::CFormDfn *parentDfn; + const NLGEORGES::CFormDfn *nodeDfn; + uint indexDfn; + const NLGEORGES::CType *type; + NLGEORGES::UFormDfn::TEntryType entryType; + NLGEORGES::CFormElm *node; + bool created; + bool isArray; + + m_rootNode->createNodeByName( m_currentNode.name.toUtf8().constData(), &parentDfn, indexDfn, &nodeDfn, &type, &node, entryType, isArray, created ); + + if( !created ) + return; + + vs = static_cast< NLGEORGES::CFormElmVirtualStruct* >( node ); + } + + vs->DfnFilename = value.toString().toUtf8().constData(); + + QString key = m_currentNode.name + "." + p->propertyName(); + + Q_EMIT modified(); + Q_EMIT valueChanged( key, value.toString() ); + Q_EMIT vstructChanged( m_currentNode.name ); +} + +void BrowserCtrlPvt::createArray() +{ + const NLGEORGES::CFormDfn *parentDfn; + const NLGEORGES::CFormDfn *nodeDfn; + uint indexDfn; + const NLGEORGES::CType *type; + NLGEORGES::UFormDfn::TEntryType entryType; + NLGEORGES::CFormElm *node; + bool created; + bool isArray; + + m_rootNode->createNodeByName( m_currentNode.name.toUtf8().constData(), &parentDfn, indexDfn, &nodeDfn, &type, &node, entryType, isArray, created ); + + if( !created ) + return; + + NLGEORGES::CFormElmArray *arr = dynamic_cast< NLGEORGES::CFormElmArray* >( node ); + QString idx = "[0]"; + arr->createNodeByName( idx.toUtf8().constData(), &parentDfn, indexDfn, &nodeDfn, &type, &node, entryType, isArray, created ); + + std::string formName; + arr->getFormName( formName, NULL ); + + Q_EMIT arrayResized( formName.c_str(), 1 ); + Q_EMIT modified(); + +} + +void BrowserCtrlPvt::onArrayValueChanged( QtProperty *p, const QVariant &value ) +{ + // Newsize checks hacked in, because setting unsigned value type in QVariant crashes the property browser! + int newSize = value.toInt(); + if( newSize < 0 ) + return; + + + NLGEORGES::UFormElm *node = getCurrentNode(); + + if( node == NULL ) + { + if( newSize != 1 ) + return; + createArray(); + return; + } + + NLGEORGES::CFormElmArray *arr = static_cast< NLGEORGES::CFormElmArray* >( node ); + std::string formName; + arr->getFormName( formName, NULL ); + + int oldSize = arr->Elements.size(); + + if( newSize == oldSize ) + return; + + if( newSize < oldSize ) + { + for( int i = newSize; i < oldSize; i++ ) + { + delete arr->Elements[ i ].Element; + } + + arr->Elements.resize( newSize ); + } + else + { + arr->Elements.resize( newSize ); + + + const NLGEORGES::CFormDfn *parentDfn; + const NLGEORGES::CFormDfn *nodeDfn; + uint indexDfn; + const NLGEORGES::CType *type; + NLGEORGES::UFormDfn::TEntryType entryType; + NLGEORGES::CFormElm *node; + bool created; + bool isArray; + + QString idx; + + for( int i = oldSize; i < newSize; i++ ) + { + idx.clear(); + idx += "["; + idx += QString::number( i ); + idx += "]"; + + bool b; + b = arr->createNodeByName( idx.toUtf8().constData(), &parentDfn, indexDfn, &nodeDfn, &type, &node, entryType, isArray, created ); + } + } + + QString name = formName.c_str(); + Q_EMIT arrayResized( name, newSize ); + Q_EMIT modified(); +} + +void BrowserCtrlPvt::onAtomValueChanged( QtProperty *p, const QVariant &value ) +{ + NLGEORGES::CFormElmAtom *atom = static_cast< NLGEORGES::CFormElmAtom* >( getCurrentNode() ); + atom->setValue( value.toString().toUtf8() ); + + Q_EMIT modified(); + Q_EMIT valueChanged( m_currentNode.name, value.toString() ); +} + +void BrowserCtrlPvt::onValueChanged( QtProperty *p, const QVariant &value ) +{ + if( m_currentNode.type == GeorgesQt::CFormItem::TYPE_VSTRUCT ) + onVStructValueChanged( p, value ); + else + if( m_currentNode.type == GeorgesQt::CFormItem::TYPE_STRUCT ) + onStructValueChanged( p, value ); + else + if( m_currentNode.type == GeorgesQt::CFormItem::TYPE_ARRAY ) + onArrayValueChanged( p, value ); + else + if( m_currentNode.type == GeorgesQt::CFormItem::TYPE_ATOM ) + onAtomValueChanged( p, value ); +} + +void BrowserCtrlPvt::onFileValueChanged( QtProperty *p, const QString &value ) +{ + QString v = value; + QFileInfo info( value ); + if( !info.exists() ) + return; + + v = info.fileName(); + blockSignals( true ); + m_fileMgr->setValue( p, v ); + blockSignals( false ); + + if( m_currentNode.type == GeorgesQt::CFormItem::TYPE_VSTRUCT ) + onVStructValueChanged( p, v ); + else + if( m_currentNode.type == GeorgesQt::CFormItem::TYPE_STRUCT ) + onStructValueChanged( p, v ); + else + if( m_currentNode.type == GeorgesQt::CFormItem::TYPE_ATOM ) + onAtomValueChanged( p, v ); +} + +QtVariantProperty* BrowserCtrlPvt::addVariantProperty( QVariant::Type type, const QString &key, const QVariant &value ) +{ + QtVariantProperty *p = mgr->addProperty( type, key ); + + // Remove the color sub-properties, so they don't get triggered on value change + if( type == QVariant::Color ) + { + QList< QtProperty* > sp = p->subProperties(); + QListIterator< QtProperty* > itr( sp ); + while( itr.hasNext() ) + { + QtProperty *prop = itr.next(); + p->removeSubProperty( prop ); + delete prop; + } + sp.clear(); + } + + p->setValue( value ); + m_browser->addProperty( p ); + + return p; +} + +QtProperty* BrowserCtrlPvt::addFileProperty( const QString &key, const QString &value ) +{ + QtProperty *p = m_fileMgr->addProperty( key ); + + m_fileMgr->setValue( p, value ); + m_browser->addProperty( p ); + + return p; +} + + + diff --git a/code/studio/src/plugins/georges_editor/browser_ctrl_pvt.h b/code/studio/src/plugins/georges_editor/browser_ctrl_pvt.h new file mode 100644 index 000000000..2f9785411 --- /dev/null +++ b/code/studio/src/plugins/georges_editor/browser_ctrl_pvt.h @@ -0,0 +1,120 @@ +// Ryzom Core Studio - Georges Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 BROWSER_CTRL_PVT_H +#define BROWSER_CTRL_PVT_H + +#include + +namespace NLGEORGES +{ + class CFormElm; + class UFormElm; + class CFormElmStruct; +} + +namespace GeorgesQt +{ + class CFormItem; +} + +class QtVariantPropertyManager; +class QtVariantEditorFactory; +class QtTreePropertyBrowser; +class QVariant; +class QtProperty; +class QtVariantProperty; + +class FileManager; +class FileEditFactory; + +class BrowserCtrlPvt : public QObject +{ + Q_OBJECT +public: + BrowserCtrlPvt( QObject *parent = NULL ); + ~BrowserCtrlPvt(); + + void clear(); + void setupNode( GeorgesQt::CFormItem *node ); + void onValueChanged( QtProperty *p, const QVariant &value ); + void onFileValueChanged( QtProperty *p, const QString &value ); + + QtVariantPropertyManager* manager() const{ return mgr; } + FileManager* fileManager() const{ return m_fileMgr; } + void setRootNode( NLGEORGES::CFormElm *root ){ m_rootNode = root; } + void setBrowser( QtTreePropertyBrowser *browser ){ m_browser = browser; } + +Q_SIGNALS: + void arrayResized( const QString &name, int size ); + void modified(); + void valueChanged( const QString &key, const QString &value ); + void vstructChanged( const QString &name ); + +private: + NLGEORGES::UFormElm* getNode( const QString &name ); + NLGEORGES::UFormElm* getCurrentNode(); + + void setupStruct( NLGEORGES::UFormElm *node ); + void setupAtom( NLGEORGES::CFormElmStruct *st, int idx ); + + void setupStruct( GeorgesQt::CFormItem *node ); + void setupVStruct( GeorgesQt::CFormItem *node ); + void setupArray( GeorgesQt::CFormItem *node ); + void setupAtom( GeorgesQt::CFormItem *node ); + + void onStructValueChanged( QtProperty *p, const QVariant &value ); + void onVStructValueChanged( QtProperty *p, const QVariant &value ); + void onArrayValueChanged( QtProperty *p, const QVariant &value ); + void onAtomValueChanged( QtProperty *p, const QVariant &value ); + void createArray(); + + QtVariantProperty* addVariantProperty( QVariant::Type type, const QString &key, const QVariant &value ); + QtProperty *addFileProperty( const QString &key, const QString &value ); + + QtVariantPropertyManager *mgr; + QtVariantEditorFactory *factory; + QtTreePropertyBrowser *m_browser; + + FileManager *m_fileMgr; + FileEditFactory *m_fileFactory; + + QString m_currentNodeName; + NLGEORGES::CFormElm *m_rootNode; + + struct CurrentNode + { + CurrentNode() + { + clear(); + } + + void clear() + { + type = -1; + name = ""; + } + + QString name; + int type; + }; + + CurrentNode m_currentNode; +}; + +#endif diff --git a/code/studio/src/plugins/georges_editor/dfn_browser_ctrl.cpp b/code/studio/src/plugins/georges_editor/dfn_browser_ctrl.cpp new file mode 100644 index 000000000..c406b549a --- /dev/null +++ b/code/studio/src/plugins/georges_editor/dfn_browser_ctrl.cpp @@ -0,0 +1,281 @@ +// Ryzom Core Studio - Georges Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 "dfn_browser_ctrl.h" +#include "3rdparty/qtpropertybrowser/qttreepropertybrowser.h" +#include "3rdparty/qtpropertybrowser/qtvariantproperty.h" +#include "3rdparty/qtpropertybrowser/qteditorfactory.h" +#include "3rdparty/qtpropertybrowser/qtpropertymanager.h" + +#include "filepath_property_manager.h" + +#include "nel/georges/form_dfn.h" + +#include + +namespace +{ + enum EntryEnum + { + ENTRY_TYPE, + ENTRY_DFN, + ENTRY_VIRTUAL_DFN, + ENTRY_TYPE_ARRAY, + ENTRY_DFN_ARRAY + }; + + QString enumToString( int value ) + { + QString s; + + switch( value ) + { + case ENTRY_TYPE: s = "type"; break; + case ENTRY_DFN: s = "dfn"; break; + case ENTRY_VIRTUAL_DFN: s = "virtual dfn"; break; + case ENTRY_TYPE_ARRAY: s = "type array"; break; + case ENTRY_DFN_ARRAY: s = "dfn array"; break; + } + + return s; + } + + NLGEORGES::UFormDfn::TEntryType enumToEntry( int value ) + { + NLGEORGES::UFormDfn::TEntryType entry = NLGEORGES::UFormDfn::EntryType; + + switch( value ) + { + case ENTRY_TYPE: entry = NLGEORGES::UFormDfn::EntryType; break; + case ENTRY_DFN: entry = NLGEORGES::UFormDfn::EntryDfn; break; + case ENTRY_VIRTUAL_DFN: entry = NLGEORGES::UFormDfn::EntryVirtualDfn; break; + case ENTRY_TYPE_ARRAY: entry = NLGEORGES::UFormDfn::EntryType; break; + case ENTRY_DFN_ARRAY: entry = NLGEORGES::UFormDfn::EntryDfn; break; + } + + return entry; + } + + bool enumToArray( int value ) + { + bool isArray = false; + + switch( value ) + { + case ENTRY_TYPE_ARRAY: + case ENTRY_DFN_ARRAY: + isArray = true; + break; + } + + return isArray; + } + + int entryToEnum( const NLGEORGES::UFormDfn::TEntryType &type, bool isArray ) + { + int id = 0; + + switch( type ) + { + case NLGEORGES::UFormDfn::EntryType: + + if( isArray ) + id = ENTRY_TYPE_ARRAY; + else + id = ENTRY_TYPE; + + break; + + case NLGEORGES::UFormDfn::EntryDfn: + if( isArray ) + id = ENTRY_DFN_ARRAY; + else + id = ENTRY_DFN; + + break; + + case NLGEORGES::UFormDfn::EntryVirtualDfn: + id = ENTRY_VIRTUAL_DFN; + break; + } + + return id; + } + +} + + +DFNBrowserCtrl::DFNBrowserCtrl( QObject *parent ) : +QObject( parent ) +{ + m_browser = NULL; + m_dfn = NULL; + m_manager = new QtVariantPropertyManager(); + m_factory = new QtVariantEditorFactory(); + m_enumMgr = new QtEnumPropertyManager(); + m_enumFactory = new QtEnumEditorFactory(); + m_fileMgr = new FileManager(); + m_fileFactory = new FileEditFactory(); + + m_idx = -1; +} + +DFNBrowserCtrl::~DFNBrowserCtrl() +{ + m_browser = NULL; + m_dfn = NULL; + + delete m_manager; + m_manager = NULL; + delete m_factory; + m_factory = NULL; + delete m_enumMgr; + m_enumMgr = NULL; + delete m_enumFactory; + m_enumFactory = NULL; + delete m_fileMgr; + m_fileMgr = NULL; + delete m_fileFactory; + m_fileFactory = NULL; +} + +void DFNBrowserCtrl::onElementSelected( int idx ) +{ + NLGEORGES::CFormDfn::CEntry &entry = m_dfn->getEntry( idx ); + m_idx = idx; + + disconnectManagers(); + + m_browser->clear(); + m_browser->setFactoryForManager( m_manager, m_factory ); + m_browser->setFactoryForManager( m_enumMgr, m_enumFactory ); + m_browser->setFactoryForManager( m_fileMgr, m_fileFactory ); + + QtVariantProperty *p = NULL; + QtProperty *prop = NULL; + + p = m_manager->addProperty( QVariant::String, "name" ); + p->setValue( entry.getName().c_str() ); + m_browser->addProperty( p ); + + + NLGEORGES::UFormDfn::TEntryType et = entry.getType(); + bool isArray = entry.getArrayFlag(); + + QStringList options; + options.push_back( "Type" ); + options.push_back( "DFN" ); + options.push_back( "Virtual DFN" ); + options.push_back( "Type Array" ); + options.push_back( "DFN Array" ); + + int enumId = entryToEnum( et, isArray ); + + prop = m_enumMgr->addProperty( "type" ); + m_enumMgr->setEnumNames( prop, options ); + m_enumMgr->setValue( prop, enumId ); + m_browser->addProperty( prop ); + + + prop = m_fileMgr->addProperty( "value" ); + m_fileMgr->setValue( prop, entry.getFilename().c_str() ); + m_browser->addProperty( prop ); + + p = m_manager->addProperty( QVariant::String, "default" ); + p->setValue( entry.getDefault().c_str() ); + m_browser->addProperty( p ); + + p = m_manager->addProperty( QVariant::String, "extension" ); + p->setValue( entry.getFilenameExt().c_str() ); + m_browser->addProperty( p ); + + connectManagers(); +} + +void DFNBrowserCtrl::onVariantValueChanged( QtProperty *p, const QVariant &v ) +{ + NLGEORGES::CFormDfn::CEntry &entry = m_dfn->getEntry( m_idx ); + + QString key = p->propertyName(); + std::string value = v.toString().toUtf8().constData(); + + if( key == "name" ) + { + entry.setName( value.c_str() ); + } + else + if( key == "default" ) + { + entry.setDefault( value.c_str() ); + } + else + if( key == "extension" ) + { + entry.setFilenameExt( value.c_str() ); + } + else + return; + + Q_EMIT valueChanged( key, v.toString() ); +} + +void DFNBrowserCtrl::onEnumValueChanged( QtProperty *p, int v ) +{ + NLGEORGES::UFormDfn::TEntryType tentry = enumToEntry( v ); + bool isArray = enumToArray( v ); + + NLGEORGES::CFormDfn::CEntry &entry = m_dfn->getEntry( m_idx ); + entry.setArrayFlag( isArray ); + entry.setType( tentry ); + + QString value = enumToString( v ); + Q_EMIT valueChanged( p->propertyName(), value ); +} + +void DFNBrowserCtrl::onFileValueChanged( QtProperty *p, const QString &v ) +{ + NLGEORGES::CFormDfn::CEntry &entry = m_dfn->getEntry( m_idx ); + QFileInfo info( v ); + if( !info.exists() ) + return; + + entry.setFilename( info.fileName().toUtf8().constData() ); + + blockSignals( true ); + m_fileMgr->setValue( p, info.fileName() ); + blockSignals( false ); + + Q_EMIT valueChanged( p->propertyName(), v ); +} + +void DFNBrowserCtrl::connectManagers() +{ + connect( m_manager, SIGNAL( valueChanged( QtProperty*, const QVariant& ) ), this, SLOT( onVariantValueChanged( QtProperty*, const QVariant& ) ) ); + connect( m_enumMgr, SIGNAL( valueChanged( QtProperty*, int ) ), this, SLOT( onEnumValueChanged( QtProperty*, int ) ) ); + connect( m_fileMgr, SIGNAL( valueChanged( QtProperty*, const QString& ) ), this, SLOT( onFileValueChanged( QtProperty*, const QString& ) ) ); +} + +void DFNBrowserCtrl::disconnectManagers() +{ + disconnect( m_manager, SIGNAL( valueChanged( QtProperty*, const QVariant& ) ), this, SLOT( onVariantValueChanged( QtProperty*, const QVariant& ) ) ); + disconnect( m_enumMgr, SIGNAL( valueChanged( QtProperty*, int ) ), this, SLOT( onEnumValueChanged( QtProperty*, int ) ) ); + disconnect( m_fileMgr, SIGNAL( valueChanged( QtProperty*, const QString& ) ), this, SLOT( onFileValueChanged( QtProperty*, const QString& ) ) ); +} + + + diff --git a/code/studio/src/plugins/georges_editor/dfn_browser_ctrl.h b/code/studio/src/plugins/georges_editor/dfn_browser_ctrl.h new file mode 100644 index 000000000..71988bcc1 --- /dev/null +++ b/code/studio/src/plugins/georges_editor/dfn_browser_ctrl.h @@ -0,0 +1,80 @@ +// Ryzom Core Studio - Georges Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 DFN_BROWSER_CTRL +#define DFN_BROWSER_CTRL + +#include + +namespace NLGEORGES +{ + class CFormDfn; +} + +class QtVariantPropertyManager; +class QtVariantEditorFactory; +class QtTreePropertyBrowser; +class QVariant; +class QtProperty; + +class QtEnumPropertyManager; +class QtEnumEditorFactory; +class FileManager; +class FileEditFactory; + +class DFNBrowserCtrl : public QObject +{ + Q_OBJECT +public: + DFNBrowserCtrl( QObject *parent = NULL ); + ~DFNBrowserCtrl(); + + void setBrowser( QtTreePropertyBrowser *browser ){ m_browser = browser; } + void setDFN( NLGEORGES::CFormDfn *dfn ){ m_dfn = dfn; } + + void onElementSelected( int idx ); + +Q_SIGNALS: + void valueChanged( const QString &key, const QString &value ); + +private Q_SLOTS: + void onFileValueChanged( QtProperty *p, const QString &v ); + void onVariantValueChanged( QtProperty *p, const QVariant &v ); + void onEnumValueChanged( QtProperty *p, int v ); + +private: + void connectManagers(); + void disconnectManagers(); + + QtTreePropertyBrowser *m_browser; + NLGEORGES::CFormDfn *m_dfn; + + QtVariantPropertyManager *m_manager; + QtVariantEditorFactory *m_factory; + + QtEnumPropertyManager *m_enumMgr; + QtEnumEditorFactory *m_enumFactory; + + FileManager *m_fileMgr; + FileEditFactory *m_fileFactory; + + int m_idx; +}; + +#endif + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/expandable_headerview.cpp b/code/studio/src/plugins/georges_editor/expandable_headerview.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/expandable_headerview.cpp rename to code/studio/src/plugins/georges_editor/expandable_headerview.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/expandable_headerview.h b/code/studio/src/plugins/georges_editor/expandable_headerview.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/expandable_headerview.h rename to code/studio/src/plugins/georges_editor/expandable_headerview.h diff --git a/code/studio/src/plugins/georges_editor/filepath_property_manager.cpp b/code/studio/src/plugins/georges_editor/filepath_property_manager.cpp new file mode 100644 index 000000000..7d5ab8177 --- /dev/null +++ b/code/studio/src/plugins/georges_editor/filepath_property_manager.cpp @@ -0,0 +1,320 @@ +// Ryzom Core Studio - Georges Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 "filepath_property_manager.h" + +#include +#include +#include +#include +#include + + +///////////////////////////////////////////////////////////////////// Manager //////////////////////////////////////////////////////////////////// + + +class FileManagerPvt +{ +public: + QMap< const QtProperty*, QString > values; +}; + +FileManager::FileManager( QObject *parent ) : +QtAbstractPropertyManager( parent ) +{ + m_pvt = new FileManagerPvt(); +} + +FileManager::~FileManager() +{ + delete m_pvt; + m_pvt = NULL; +} + +QString FileManager::value( const QtProperty *p ) const +{ + QMap< const QtProperty*, QString >::const_iterator itr = m_pvt->values.find( p ); + if( itr == m_pvt->values.end() ) + return ""; + else + return itr.value(); +} + +void FileManager::setValue( QtProperty *p, const QString &v ) +{ + if( !m_pvt->values.contains( p ) ) + return; + + if( m_pvt->values[ p ] == v ) + return; + + m_pvt->values[ p ] = v; + + Q_EMIT propertyChanged( p ); + Q_EMIT valueChanged( p, v ); +} + +bool FileManager::hasValue( const QtProperty *p ) const +{ + if( m_pvt->values.contains( p ) ) + return true; + else + return false; +} + +QString FileManager::valueText( const QtProperty *p ) const +{ + return value( p ); +} + +void FileManager::initializeProperty( QtProperty *p ) +{ + if( m_pvt->values.contains( p ) ) + return; + + m_pvt->values[ p ] = ""; +} + +void FileManager::uninitializeProperty( QtProperty *p ) +{ + m_pvt->values.remove( p ); +} + +///////////////////////////////////////////////////////////////// Factory /////////////////////////////////////////////////////////////////////////////// + +class FileEditFactoryPvt +{ +public: + QMap< QtProperty*, QList< FileEdit* > > createdEditors; + QMap< FileEdit*, QtProperty* > editorToProperty; + + void addEditor( QtProperty *p, FileEdit *editor ) + { + editorToProperty[ editor ] = p; + + QMap< QtProperty*, QList< FileEdit* > >::iterator itr = createdEditors.find( p ); + if( itr == createdEditors.end() ) + { + QList< FileEdit* > l; + l.push_back( editor ); + createdEditors[ p ] = l; + } + else + { + QList< FileEdit* > &l = itr.value(); + l.push_back( editor ); + } + } + + void removeEditor( QObject *o ) + { + // Find in editorToProperty + QMap< FileEdit*, QtProperty* >::iterator itr = editorToProperty.begin(); + while( itr != editorToProperty.end() ) + { + if( itr.key() == o ) + break; + ++itr; + } + + // Store the property, and remove the editor from editorToProperty + QtProperty *p = NULL; + if( itr != editorToProperty.end() ) + { + p = itr.value(); + editorToProperty.erase( itr ); + } + + // Find the property in createdEditors + QMap< QtProperty*, QList< FileEdit* > >::iterator mitr = createdEditors.find( p ); + QList< FileEdit* > &l = mitr.value(); + + // Find the editor in the list + QList< FileEdit* >::iterator litr = l.begin(); + while( litr != l.end() ) + { + if( o == *litr ) + break; + litr++; + } + + // Remove the editor and remove the list too if it's empty + if( litr != l.end() ) + l.erase( litr ); + + if( l.isEmpty() ) + createdEditors.erase( mitr ); + } +}; + + +FileEditFactory::FileEditFactory( QObject *parent ) : +QtAbstractEditorFactory( parent ) +{ + m_pvt = new FileEditFactoryPvt(); +} + +FileEditFactory::~FileEditFactory() +{ + delete m_pvt; + m_pvt = NULL; +} + +void FileEditFactory::connectPropertyManager( FileManager *manager ) +{ + connect( manager, SIGNAL( valueChanged( QtProperty*, const QString& ) ), + this, SLOT( onPropertyChanged( QtProperty*, const QString& ) ) ); +} + +void FileEditFactory::disconnectPropertyManager( FileManager *manager ) +{ + disconnect( manager, SIGNAL( valueChanged( QtProperty*, const QString& ) ), + this, SLOT( onPropertyChanged( QtProperty*, const QString& ) ) ); +} + +QWidget* FileEditFactory::createEditor( FileManager *manager, QtProperty *p, QWidget *parent ) +{ + FileEdit *editor = new FileEdit( parent ); + editor->setValue( p->valueText() ); + + connect( editor, SIGNAL( valueChanged( const QString& ) ), this, SLOT( onSetValue( const QString& ) ) ); + connect( editor, SIGNAL( destroyed( QObject* ) ), this, SLOT( onEditorDestroyed( QObject* ) ) ); + + m_pvt->addEditor( p, editor ); + + return editor; +} + +void FileEditFactory::onPropertyChanged( QtProperty *p, const QString &v ) +{ + QMap< QtProperty*, QList< FileEdit* > >::iterator itr = m_pvt->createdEditors.find( p ); + if( itr == m_pvt->createdEditors.end() ) + return; + + QList< FileEdit* > &l = itr.value(); + QList< FileEdit* >::iterator litr = l.begin(); + while( litr != l.end() ) + { + FileEdit *editor = *litr; + editor->blockSignals( true ); + editor->setValue( v ); + editor->blockSignals( false ); + + ++litr; + } +} + +void FileEditFactory::onSetValue( const QString& v ) +{ + QObject *s = sender(); + FileEdit *editor = qobject_cast< FileEdit* >( s ); + if( editor == NULL ) + return; + + QMap< FileEdit*, QtProperty* >::iterator itr = m_pvt->editorToProperty.find( editor ); + if( itr == m_pvt->editorToProperty.end() ) + return; + + QtProperty *p = *itr; + FileManager *manager = qobject_cast< FileManager* >( p->propertyManager() ); + if( manager == NULL ) + return; + + blockSignals( true ); + manager->setValue( p, v ); + blockSignals( false ); +} + +void FileEditFactory::onEditorDestroyed( QObject *editor ) +{ + m_pvt->removeEditor( editor ); +} + + +//////////////////////////////////////////////////////////////// Editor ///////////////////////////////////////////////////////////////////////////////// + + +class FileEditPvt +{ +public: + QLineEdit *lineEdit; + QToolButton *toolButton; +}; + + + +FileEdit::FileEdit( QWidget *parent ) : +QWidget( parent ) +{ + m_pvt = new FileEditPvt(); + + setupUI(); + setupConnections(); +} + +FileEdit::~FileEdit() +{ + delete m_pvt; + m_pvt = NULL; + + Q_EMIT destroyed( this ); +} + +void FileEdit::setValue( const QString &value ) +{ + m_pvt->lineEdit->setText( value ); +} + +void FileEdit::onButtonClicked() +{ + QString file = QFileDialog::getOpenFileName( this, + tr( "" ), + tr( "" ) ); + if( file.isEmpty() ) + return; + + if( m_pvt->lineEdit->text() == file ) + return; + + m_pvt->lineEdit->setText( file ); + + Q_EMIT valueChanged( file ); +} + +void FileEdit::setupUI() +{ + m_pvt->lineEdit = new QLineEdit( this ); + m_pvt->toolButton = new QToolButton( this ); + m_pvt->toolButton->setText( "..." ); + + QHBoxLayout *layout = new QHBoxLayout( this ); + layout->setContentsMargins( 0, 0, 0, 0 ); + layout->setSpacing( 0 ); + layout->addWidget( m_pvt->lineEdit ); + layout->addWidget( m_pvt->toolButton ); + setLayout( layout ); + + setFocusProxy( m_pvt->lineEdit ); + setSizePolicy( QSizePolicy::Ignored, QSizePolicy::Fixed ); +} + +void FileEdit::setupConnections() +{ + connect( m_pvt->toolButton, SIGNAL( clicked( bool ) ), this, SLOT( onButtonClicked() ) ); +} + diff --git a/code/studio/src/plugins/georges_editor/filepath_property_manager.h b/code/studio/src/plugins/georges_editor/filepath_property_manager.h new file mode 100644 index 000000000..b365f46cb --- /dev/null +++ b/code/studio/src/plugins/georges_editor/filepath_property_manager.h @@ -0,0 +1,116 @@ +// Ryzom Core Studio - Georges Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 FILEPATH_PROPERTY_MANAGER +#define FILEPATH_PROPERTY_MANAGER + +#define QT_QTPROPERTYBROWSER_IMPORT + +#include +#include <3rdparty/qtpropertybrowser/qtpropertymanager.h> + +/////////////////////////////////////////////////////////////////////// Manager ///////////////////////////////////////////////////////////////// + +class FileManagerPvt; + +class FileManager : public QtAbstractPropertyManager +{ + Q_OBJECT +public: + FileManager( QObject *parent = NULL ); + ~FileManager(); + + QString value( const QtProperty *p ) const; + +public Q_SLOTS: + void setValue( QtProperty *p, const QString &v ); + +Q_SIGNALS: + void valueChanged( QtProperty *p, const QString &v ); + +protected: + bool hasValue( const QtProperty *p ) const; + QString valueText( const QtProperty *p ) const; + void initializeProperty( QtProperty *p ); + void uninitializeProperty( QtProperty *p ); + +private: + FileManagerPvt *m_pvt; + + Q_DISABLE_COPY( FileManager ); +}; + + + +//////////////////////////////////////////////////////// Factory /////////////////////////////////////////////////////////////////// + +class FileEditFactoryPvt; + +class FileEditFactory : public QtAbstractEditorFactory< FileManager > +{ + Q_OBJECT +public: + FileEditFactory( QObject *parent = NULL ); + ~FileEditFactory(); + +protected: + void connectPropertyManager( FileManager *manager ); + void disconnectPropertyManager( FileManager *manager ); + QWidget* createEditor( FileManager *manager, QtProperty *p, QWidget *parent ); + +private Q_SLOTS: + void onPropertyChanged( QtProperty *p, const QString &value ); + void onSetValue( const QString &value ); + void onEditorDestroyed( QObject *editor ); + +private: + FileEditFactoryPvt *m_pvt; + + Q_DISABLE_COPY( FileEditFactory ); +}; + + +//////////////////////////////////////////////////////// Editor //////////////////////////////////////////////////////////////////// + +class FileEditPvt; + +class FileEdit : public QWidget +{ + Q_OBJECT +public: + FileEdit( QWidget *parent = NULL ); + ~FileEdit(); + + void setValue( const QString &value ); + +Q_SIGNALS: + void valueChanged( const QString &value ); + void destroyed( QObject *editor ); + +private Q_SLOTS: + void onButtonClicked(); + +private: + void setupUI(); + void setupConnections(); + FileEditPvt *m_pvt; + + Q_DISABLE_COPY( FileEdit ); +}; + +#endif diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formdelegate.cpp b/code/studio/src/plugins/georges_editor/formdelegate.cpp similarity index 99% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formdelegate.cpp rename to code/studio/src/plugins/georges_editor/formdelegate.cpp index 91f62c24b..f2a2ba6c3 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formdelegate.cpp +++ b/code/studio/src/plugins/georges_editor/formdelegate.cpp @@ -38,6 +38,8 @@ #include "georgesform_proxy_model.h" #include "formitem.h" +#if 0 + namespace GeorgesQt { @@ -277,3 +279,5 @@ namespace GeorgesQt editor->setGeometry(r); } } /* namespace GeorgesQt */ + +#endif // 0 \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formdelegate.h b/code/studio/src/plugins/georges_editor/formdelegate.h similarity index 98% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formdelegate.h rename to code/studio/src/plugins/georges_editor/formdelegate.h index b6885833e..42b10ef3d 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/formdelegate.h +++ b/code/studio/src/plugins/georges_editor/formdelegate.h @@ -19,6 +19,8 @@ #include +#if 0 + namespace GeorgesQt { @@ -38,4 +40,6 @@ namespace GeorgesQt }; } +#endif // 0 + #endif // FORMDELEGATE_H diff --git a/code/studio/src/plugins/georges_editor/formitem.cpp b/code/studio/src/plugins/georges_editor/formitem.cpp new file mode 100644 index 000000000..939ec4cf4 --- /dev/null +++ b/code/studio/src/plugins/georges_editor/formitem.cpp @@ -0,0 +1,264 @@ +// 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 . + +// Project includes +#include "formitem.h" +#include "actions.h" +#include "georges_editor_form.h" + +// Qt includes +#include + +// NeL includes +#include +#include +#include +#include + +using namespace NLGEORGES; + +namespace GeorgesQt +{ + CFormItem::CFormItem() + { + parentItem = NULL; + formElm = NULL; + m_form = NULL; + _StructId = 0; + _Slot = 0; + _Type = Null; + _TType = TYPE_ATOM; + } + + CFormItem::~CFormItem() + { + clearChildren(); + } + + void CFormItem::appendChild(CFormItem *item) + { + childItems.append(item); + } + + CFormItem *CFormItem::child(int row) + { + return childItems.value(row); + } + + int CFormItem::childCount() const + { + return childItems.count(); + } + + int CFormItem::columnCount() const + { + //nlinfo("columnCount %d",itemData.count()); + //return itemData.count(); + return 1; + } + + QVariant CFormItem::data(int column) const + { + //return itemData.value(column); + return QVariant(_Name.c_str()); + } + + CFormItem *CFormItem::parent() + { + return parentItem; + } + + int CFormItem::row() const + { + if (parentItem) + return parentItem->childItems.indexOf(const_cast(this)); + + return 0; + } + + bool CFormItem::setData(int column, const QVariant &value) + { + nlwarning("This should not be called anymore."); + return false; + } + + bool CFormItem::isEditable(int column) + { + // Ensure only valid types can be edited. + if(_Type == Null) + return false; + + // Make sure only the first column (name) can be editted. + if (column != 0) + return false; + + if(isArrayMember()) + return true; + + return false; + } + + bool CFormItem::isArray() + { + if( _TType == TYPE_ARRAY ) + return true; + else + return false; + } + + bool CFormItem::isArrayMember() + { + if( parentItem == NULL ) + return false; + + return parentItem->isArray(); + } + + bool CFormItem::isStruct() + { + if( _TType == TYPE_STRUCT ) + return true; + else + return false; + } + + bool CFormItem::isVStruct() + { + if( _TType == TYPE_VSTRUCT ) + return true; + else + return false; + } + + bool CFormItem::isAtom() + { + if( _TType == TYPE_ATOM ) + return true; + else + return false; + } + + QIcon CFormItem::getItemImage(CFormItem *rootItem) + { + if(_Type == CFormItem::Null) + { + return QIcon(":/images/root.ico"); + } + else if(_Type == CFormItem::Form) + { + // If the parent is the root item then this is the content. + if(parentItem == rootItem) + return QIcon(":/images/root.ico"); + + // If it wasn't a root node then lets check the node type. + const NLGEORGES::CFormDfn *parentDfn; + uint indexDfn; + const NLGEORGES::CFormDfn *nodeDfn; + const NLGEORGES::CType *nodeType; + NLGEORGES::CFormElm *node; + NLGEORGES::UFormDfn::TEntryType type; + bool array; + bool parentVDfnArray; + NLGEORGES::CForm *form = static_cast(m_form); + NLGEORGES::CFormElm *elm = static_cast(&form->getRootNode()); + nlverify ( elm->getNodeByName (_FormName.c_str(), &parentDfn, indexDfn, &nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND) ); + + if(array) + { + return QIcon(":/images/array.ico"); + } + else + { + if(type == NLGEORGES::UFormDfn::EntryType) + { + if(parentDfn) + { + // Not sure what the hell to do with this. Gets filename from parent dfn? + } + return QIcon(":/images/zfee51.ico"); + } + else if(type == NLGEORGES::UFormDfn::EntryDfn) + { + if(parentDfn) + { + // Not sure what the hell to do with this. Gets filename from parent dfn? + } + return QIcon(":/images/struct.ico"); + } + else if(type == NLGEORGES::UFormDfn::EntryVirtualDfn) + { + if(node) + { + // Not sure what the hell to do with this. Gets filename from parent dfn? + std::string dfnName; + NLMISC::safe_cast(node)->getDfnName(dfnName); + // return dfnName.c_str() ? + } + return QIcon(":/images/vstruct.ico"); + } + } + //return QIcon(":/images/struct.ico"); + } + return QIcon(); + } + + CFormItem* CFormItem::findItem( const QString &formName ) + { + CFormItem *item = NULL; + + if( _FormName.c_str() == formName ) + return this; + + for( int i = 0; i < childItems.count(); i++ ) + { + item = childItems[ i ]->findItem( formName ); + if( item != NULL ) + return item; + } + + return item; + } + + void CFormItem::clearChildren() + { + qDeleteAll( childItems ); + childItems.clear(); + } + + void CFormItem::removeChild( int idx ) + { + CFormItem *item = childItems[ idx ]; + childItems.removeAt( idx ); + delete item; + } + + CFormItem *CFormItem::add (TSub type, const char *name, uint structId, const char *formName, uint slot, NLGEORGES::UForm *formPtr, TType itemType ) + { + CFormItem *newNode = new CFormItem(); + newNode->_Type = type; + newNode->_Name = name; + newNode->parentItem = this; + newNode->_StructId = structId; + newNode->_FormName = formName; + newNode->_Slot = slot; + newNode->m_form = formPtr; + newNode->_TType = itemType; + + appendChild(newNode); + return newNode; + } + +} diff --git a/code/studio/src/plugins/georges_editor/formitem.h b/code/studio/src/plugins/georges_editor/formitem.h new file mode 100644 index 000000000..a0aabfc10 --- /dev/null +++ b/code/studio/src/plugins/georges_editor/formitem.h @@ -0,0 +1,118 @@ +// 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 FORMITEM_H +#define FORMITEM_H + +// NeL includes +#include +#include + +// Qt includes +#include +#include + +namespace GeorgesQt +{ + + class CFormItem + { + public: + // What is the sub object ? + enum TSub + { + Null, // Nothing in this node (root ?) + Header, // Header node + Type, // This node is a type + Dfn, // This node is a dfn + Form, // This node is a form + }; + + enum TType + { + TYPE_ARRAY, + TYPE_STRUCT, + TYPE_VSTRUCT, + TYPE_ATOM + }; + + CFormItem(); + ~CFormItem(); + + void appendChild(CFormItem *child); + + CFormItem *add (TSub type, const char *name, uint structId, const char *formName, uint slot, NLGEORGES::UForm *formPtr, TType itemType ); + + CFormItem *child(int row); + int childCount() const; + int columnCount() const; + QVariant data(int column) const; + int row() const; + CFormItem *parent(); + bool setData(int column, const QVariant &value); + + TSub nodeType() { return _Type; } + std::string formName() { return _FormName; } + + std::string name() { return _Name; } + void setName(std::string name) { _Name = name; } + + uint structId() { return _StructId; } + + NLGEORGES::UForm *form() { return m_form; } + + bool isEditable(int column); + bool isArray(); + bool isArrayMember(); + bool isStruct(); + bool isVStruct(); + bool isAtom(); + + TType type() const{ return _TType; } + + QIcon getItemImage(CFormItem *rootItem); + + CFormItem* findItem( const QString &formName ); + + void clearChildren(); + + void removeChild( int idx ); + + bool rootItem() const{ + if( parentItem == NULL ) + return true; + else + return false; + } + + private: + QList childItems; + QList itemData; + CFormItem *parentItem; + NLGEORGES::UFormElm* formElm; + NLGEORGES::UForm *m_form; + + uint _StructId; + std::string _Name; + std::string _FormName; + TSub _Type; + uint _Slot; + TType _TType; + + }; // CFormItem + +} +#endif // FORMITEM_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges.cpp b/code/studio/src/plugins/georges_editor/georges.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges.cpp rename to code/studio/src/plugins/georges_editor/georges.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges.h b/code/studio/src/plugins/georges_editor/georges.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges.h rename to code/studio/src/plugins/georges_editor/georges.h diff --git a/code/studio/src/plugins/georges_editor/georges_dfn_dialog.cpp b/code/studio/src/plugins/georges_editor/georges_dfn_dialog.cpp new file mode 100644 index 000000000..c7244273e --- /dev/null +++ b/code/studio/src/plugins/georges_editor/georges_dfn_dialog.cpp @@ -0,0 +1,233 @@ +// Ryzom Core Studio - Georges Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 "georges_dfn_dialog.h" +#include +#include + +#include "georges.h" +#include "dfn_browser_ctrl.h" + +#include "nel/misc/file.h" +#include "nel/misc/o_xml.h" +#include "nel/misc/path.h" + +class GeorgesDFNDialogPvt +{ +public: + GeorgesDFNDialogPvt() + { + dfn = NULL; + ctrl = new DFNBrowserCtrl(); + } + + ~GeorgesDFNDialogPvt() + { + delete ctrl; + ctrl = NULL; + delete dfn; + dfn = NULL; + } + + NLGEORGES::CFormDfn *dfn; + DFNBrowserCtrl *ctrl; +}; + +GeorgesDFNDialog::GeorgesDFNDialog( QWidget *parent ) : +GeorgesDockWidget( parent ) +{ + m_ui.setupUi( this ); + + m_pvt = new GeorgesDFNDialogPvt(); + m_pvt->ctrl->setBrowser( m_ui.browser ); + + setupConnections(); +} + +GeorgesDFNDialog::~GeorgesDFNDialog() +{ + delete m_pvt; + m_pvt = NULL; +} + +bool GeorgesDFNDialog::load( const QString &fileName ) +{ + GeorgesQt::CGeorges georges; + NLGEORGES::UFormDfn *udfn = georges.loadFormDfn( fileName.toUtf8().constData() ); + if( udfn == NULL ) + return false; + + QFileInfo info( fileName ); + setWindowTitle( info.fileName() ); + + NLGEORGES::CFormDfn *cdfn = static_cast< NLGEORGES::CFormDfn* >( udfn ); + m_pvt->dfn = cdfn; + + loadDfn(); + + m_fileName = fileName; + + connect(m_ui.commentsEdit, SIGNAL(textChanged()), this, SLOT(onCommentsEdited())); + + return true; +} + +void GeorgesDFNDialog::write() +{ + setModified( false ); + setWindowTitle( windowTitle().remove( "*" ) ); + + m_pvt->dfn->Header.Log = m_ui.logEdit->toPlainText().toUtf8().constData(); + m_pvt->dfn->Header.Comments = m_ui.commentsEdit->toPlainText().toUtf8().constData(); + + NLMISC::COFile file; + if( !file.open( m_fileName.toUtf8().constData(), false, true, false ) ) + return; + + NLMISC::COXml xml; + xml.init( &file ); + + m_pvt->dfn->write( xml.getDocument(), m_fileName.toUtf8().constData() ); + + xml.flush(); + file.close(); +} + +void GeorgesDFNDialog::newDocument( const QString &fileName ) +{ + m_fileName = fileName; + QFileInfo info( fileName ); + setWindowTitle( info.fileName() + "*" ); + setModified( true ); + + m_pvt->dfn = new NLGEORGES::CFormDfn(); + + loadDfn(); + + log( "Created" ); +} + +void GeorgesDFNDialog::onAddClicked() +{ + QString name = QInputDialog::getText( this, + tr( "New element" ), + tr( "Enter name of the new element" ) ); + + QList< QListWidgetItem* > list = m_ui.list->findItems( name, Qt::MatchFixedString ); + if( !list.isEmpty() ) + { + QMessageBox::information( this, + tr( "Item already exists" ), + tr( "That item already exists!" ) ); + return; + } + + m_ui.list->addItem( name ); + m_pvt->dfn->addEntry( name.toUtf8().constData() ); + + log( "Added " + name ); + + onModified(); +} + +void GeorgesDFNDialog::onRemoveClicked() +{ + int row = m_ui.list->currentRow(); + if( row < 0 ) + return; + + log( "Removed " + m_ui.list->currentItem()->text() ); + + QListWidgetItem *item = m_ui.list->takeItem( row ); + delete item; + + m_pvt->dfn->removeEntry( row ); + + onModified(); +} + +void GeorgesDFNDialog::onCurrentRowChanged( int row ) +{ + if( row < 0 ) + return; + + m_pvt->ctrl->onElementSelected( row ); +} + +void GeorgesDFNDialog::onValueChanged( const QString &key, const QString &value ) +{ + onModified(); + + log( m_ui.list->currentItem()->text() + "." + key + " = " + value ); + + if( key == "name" ) + { + m_ui.list->currentItem()->setText( value ); + } +} + +void GeorgesDFNDialog::onCommentsEdited() +{ + onModified(); +} + +void GeorgesDFNDialog::loadDfn() +{ + m_pvt->ctrl->setDFN( m_pvt->dfn ); + + uint c = m_pvt->dfn->getNumEntry(); + for( uint i = 0; i < c; i++ ) + { + NLGEORGES::CFormDfn::CEntry &entry = m_pvt->dfn->getEntry( i ); + m_ui.list->addItem( entry.getName().c_str() ); + } + + if( c > 0 ) + { + m_ui.list->setCurrentRow( 0 ); + } + + m_ui.commentsEdit->setPlainText( m_pvt->dfn->getComment().c_str() ); + m_ui.logEdit->setPlainText( m_pvt->dfn->Header.Log.c_str() ); +} + +void GeorgesDFNDialog::onModified() +{ + if( !isModified() ) + { + setModified( true ); + setWindowTitle( windowTitle() + "*" ); + + Q_EMIT modified(); + } +} + +void GeorgesDFNDialog::log( const QString &msg ) +{ + QString logMsg = buildLogMsg( msg ); + m_ui.logEdit->appendPlainText( logMsg ); +} + +void GeorgesDFNDialog::setupConnections() +{ + connect( m_ui.addButton, SIGNAL( clicked( bool ) ), this, SLOT( onAddClicked() ) ); + connect( m_ui.removeButton, SIGNAL( clicked( bool ) ), this, SLOT( onRemoveClicked() ) ); + connect( m_ui.list, SIGNAL( currentRowChanged( int ) ), this, SLOT( onCurrentRowChanged( int ) ) ); + connect( m_pvt->ctrl, SIGNAL( valueChanged( const QString&, const QString& ) ), this, SLOT( onValueChanged( const QString&, const QString& ) ) ); +} + diff --git a/code/studio/src/plugins/georges_editor/georges_dfn_dialog.h b/code/studio/src/plugins/georges_editor/georges_dfn_dialog.h new file mode 100644 index 000000000..edb67144c --- /dev/null +++ b/code/studio/src/plugins/georges_editor/georges_dfn_dialog.h @@ -0,0 +1,60 @@ +// Ryzom Core Studio - Georges Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 GEORGES_DFN_DIALOG +#define GEORGES_DFN_DIALOG + +#include "georges_dock_widget.h" +#include "ui_georges_dfn_dialog.h" + +class GeorgesDFNDialogPvt; + +class GeorgesDFNDialog : public GeorgesDockWidget +{ + Q_OBJECT +public: + GeorgesDFNDialog( QWidget *parent = NULL ); + ~GeorgesDFNDialog(); + + bool load( const QString &fileName ); + void write(); + void newDocument( const QString &fileName ); + +Q_SIGNALS: + void modified(); + +private Q_SLOTS: + void onAddClicked(); + void onRemoveClicked(); + void onCurrentRowChanged( int row ); + + void onValueChanged( const QString& key, const QString &value ); + void onCommentsEdited(); + +private: + void loadDfn(); + void onModified(); + void log( const QString &msg ); + void setupConnections(); + + Ui::GeorgesDFNDialog m_ui; + GeorgesDFNDialogPvt *m_pvt; +}; + +#endif + diff --git a/code/studio/src/plugins/georges_editor/georges_dfn_dialog.ui b/code/studio/src/plugins/georges_editor/georges_dfn_dialog.ui new file mode 100644 index 000000000..70b5bd265 --- /dev/null +++ b/code/studio/src/plugins/georges_editor/georges_dfn_dialog.ui @@ -0,0 +1,136 @@ + + + GeorgesDFNDialog + + + + 0 + 0 + 693 + 559 + + + + + + + + + + + QTabWidget::West + + + QTabWidget::Rounded + + + 0 + + + false + + + false + + + + + + + Dfn + + + + + + Qt::Horizontal + + + + + + + + + + 0 + 0 + + + + Add + + + + + + + + 0 + 0 + + + + Remove + + + + + + + Qt::Horizontal + + + + 466 + 20 + + + + + + + + + Comments + + + + + + Qt::TextEditorInteraction + + + + + + + + Log + + + + + + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + + + + + + QtTreePropertyBrowser + QWidget +

    qttreepropertybrowser.h
    + 1 + + + + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_dialog.cpp b/code/studio/src/plugins/georges_editor/georges_dirtree_dialog.cpp similarity index 97% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_dialog.cpp rename to code/studio/src/plugins/georges_editor/georges_dirtree_dialog.cpp index 0a467aac5..c1853233c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_dialog.cpp +++ b/code/studio/src/plugins/georges_editor/georges_dirtree_dialog.cpp @@ -74,7 +74,7 @@ void CGeorgesDirTreeDialog::fileSelected(QModelIndex index) { if (index.isValid() && !m_dirModel->isDir(index)) { - Q_EMIT selectedForm(m_dirModel->fileName(index)); + Q_EMIT fileSelected(m_dirModel->fileName(index)); } } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_dialog.h b/code/studio/src/plugins/georges_editor/georges_dirtree_dialog.h similarity index 97% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_dialog.h rename to code/studio/src/plugins/georges_editor/georges_dirtree_dialog.h index 3654783f3..0a8fc682b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_dialog.h +++ b/code/studio/src/plugins/georges_editor/georges_dirtree_dialog.h @@ -49,7 +49,7 @@ private: QString m_ldPath; Q_SIGNALS: - void selectedForm(const QString); + void fileSelected(const QString&); private Q_SLOTS: void fileSelected(QModelIndex index); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_form.ui b/code/studio/src/plugins/georges_editor/georges_dirtree_form.ui similarity index 94% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_form.ui rename to code/studio/src/plugins/georges_editor/georges_dirtree_form.ui index e14857e89..64f8cc57c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_form.ui +++ b/code/studio/src/plugins/georges_editor/georges_dirtree_form.ui @@ -77,7 +77,7 @@ - + diff --git a/code/studio/src/plugins/georges_editor/georges_dock_widget.cpp b/code/studio/src/plugins/georges_editor/georges_dock_widget.cpp new file mode 100644 index 000000000..e031fbc8f --- /dev/null +++ b/code/studio/src/plugins/georges_editor/georges_dock_widget.cpp @@ -0,0 +1,86 @@ +// Ryzom Core Studio - Georges Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 "georges_dock_widget.h" +#include + +GeorgesDockWidget::GeorgesDockWidget( QWidget *parent ) : +QDockWidget( parent ) +{ + m_modified = false; + m_undoStack = NULL; +} + +GeorgesDockWidget::~GeorgesDockWidget() +{ +} + +void GeorgesDockWidget::closeEvent( QCloseEvent *e ) +{ + if( isModified() ) + { + QString title = windowTitle(); + title.remove( '*' ); + + int reply = QMessageBox::question( this, + tr( "Closing dialog" ), + title + tr( " has been modified.\nWould you like to save the changes?" ), + QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel ); + + if( reply == QMessageBox::Cancel ) + { + e->ignore(); + return; + } + + if( reply == QMessageBox::Yes ) + write(); + } + + Q_EMIT closing( this ); +} + +QString GeorgesDockWidget::buildLogMsg( const QString &msg ) +{ + QString user = getenv( "USER" ); + if( user.isEmpty() ) + user = getenv( "USERNAME" ); + if( user.isEmpty() ) + user = "anonymous"; + + QTime time = QTime::currentTime(); + QDate date = QDate::currentDate(); + + QString dateString = date.toString( "ddd MMM dd" ); + QString timeString = time.toString( "HH:mm:ss" ); + + QString logMsg; + logMsg += dateString; + logMsg += ' '; + logMsg += timeString; + logMsg += ' '; + logMsg += QString::number( date.year() ); + logMsg += ' '; + logMsg += "("; + logMsg += user; + logMsg += ")"; + logMsg += ' '; + logMsg += msg; + + return logMsg; +} diff --git a/code/studio/src/plugins/georges_editor/georges_dock_widget.h b/code/studio/src/plugins/georges_editor/georges_dock_widget.h new file mode 100644 index 000000000..d7f80dff1 --- /dev/null +++ b/code/studio/src/plugins/georges_editor/georges_dock_widget.h @@ -0,0 +1,58 @@ +// Ryzom Core Studio - Georges Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 GEORGES_DOCK_WIDGET +#define GEORGES_DOCK_WIDGET + +#include + +class QUndoStack; + +class GeorgesDockWidget : public QDockWidget +{ + Q_OBJECT +public: + GeorgesDockWidget( QWidget *parent = NULL ); + ~GeorgesDockWidget(); + + void setUndoStack( QUndoStack *stack ){ m_undoStack = stack; } + + bool isModified() const{ return m_modified; } + void setModified( bool b ){ m_modified = b; } + + QString fileName() const{ return m_fileName; } + + virtual bool load( const QString &fileName ) = 0; + virtual void write() = 0; + +protected: + void closeEvent( QCloseEvent *e ); + +Q_SIGNALS: + void closing( GeorgesDockWidget *d ); + +protected: + QString buildLogMsg( const QString &msg ); + virtual void log( const QString &msg ) = 0; + + QString m_fileName; + bool m_modified; + QUndoStack *m_undoStack; +}; + +#endif diff --git a/code/studio/src/plugins/georges_editor/georges_editor.qrc b/code/studio/src/plugins/georges_editor/georges_editor.qrc new file mode 100644 index 000000000..8d71d1438 --- /dev/null +++ b/code/studio/src/plugins/georges_editor/georges_editor.qrc @@ -0,0 +1,12 @@ + + + images/array.ico + images/header.ico + images/hold.ico + images/root.ico + images/struct.ico + images/vstruct.ico + images/zfee51.ico + images/ic_nel_georges_editor.png + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_constants.h b/code/studio/src/plugins/georges_editor/georges_editor_constants.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_constants.h rename to code/studio/src/plugins/georges_editor/georges_editor_constants.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.cpp b/code/studio/src/plugins/georges_editor/georges_editor_form.cpp similarity index 55% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.cpp rename to code/studio/src/plugins/georges_editor/georges_editor_form.cpp index 6c46d4964..4f4b814ec 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.cpp +++ b/code/studio/src/plugins/georges_editor/georges_editor_form.cpp @@ -20,6 +20,8 @@ #include "georges_editor_constants.h" #include "georges_dirtree_dialog.h" #include "georges_treeview_dialog.h" +#include "georges_dfn_dialog.h" +#include "georges_typ_dialog.h" #include "../core/icore.h" #include "../core/menu_manager.h" @@ -27,6 +29,7 @@ // NeL includes #include +#include // Qt includes #include @@ -36,6 +39,7 @@ namespace GeorgesQt { + QUndoStack *GeorgesEditorForm::UndoStack = NULL; GeorgesEditorForm::GeorgesEditorForm(QWidget *parent) : QMainWindow(parent), @@ -62,16 +66,25 @@ namespace GeorgesQt m_mainDock->setDockNestingEnabled(true); layout->addWidget(m_mainDock); - m_undoStack = new QUndoStack(this); + UndoStack = new QUndoStack(this); Core::MenuManager *menuManager = Core::ICore::instance()->menuManager(); m_openAction = menuManager->action(Core::Constants::OPEN); - m_newAction = new QAction(tr("&New..."), this); - m_newAction->setIcon(QIcon(Core::Constants::ICON_NEW)); - m_newAction->setShortcut(QKeySequence::New); - m_newAction->setStatusTip(tr("Create a new file")); - connect(m_newAction, SIGNAL(triggered()), this, SLOT(newFile())); + m_newTypAction = new QAction(tr("New Type"), this ); + m_newTypAction->setIcon(QIcon(Core::Constants::ICON_NEW)); + m_newTypAction->setStatusTip(tr("Create a new type file")); + connect( m_newTypAction, SIGNAL(triggered()), this, SLOT(newTyp())); + + m_newDfnAction = new QAction(tr("New DFN"), this ); + m_newDfnAction->setIcon(QIcon(Core::Constants::ICON_NEW)); + m_newDfnAction->setStatusTip(tr("Create a new definition file")); + connect( m_newDfnAction, SIGNAL(triggered()), this, SLOT(newDfn())); + + m_newFormAction = new QAction(tr("New Form"), this ); + m_newFormAction->setIcon(QIcon(Core::Constants::ICON_NEW)); + m_newFormAction->setStatusTip(tr("Create a new form file")); + connect( m_newFormAction, SIGNAL(triggered()), this, SLOT(newForm())); m_saveAction = new QAction(tr("&Save..."), this); m_saveAction->setIcon(QIcon(Core::Constants::ICON_SAVE)); @@ -80,8 +93,10 @@ namespace GeorgesQt connect(m_saveAction, SIGNAL(triggered()), this, SLOT(save())); m_fileToolBar = addToolBar(tr("&File")); + m_fileToolBar->addAction(m_newTypAction); + m_fileToolBar->addAction(m_newDfnAction); + m_fileToolBar->addAction(m_newFormAction); m_fileToolBar->addAction(m_openAction); - m_fileToolBar->addAction(m_newAction); m_fileToolBar->addAction(m_saveAction); m_saveAction->setEnabled(false); @@ -102,8 +117,8 @@ namespace GeorgesQt connect(Core::ICore::instance(), SIGNAL(changeSettings()), this, SLOT(settingsChanged())); - connect(m_georgesDirTreeDialog, SIGNAL(selectedForm(const QString)), - this, SLOT(loadFile(const QString))); + connect(m_georgesDirTreeDialog, SIGNAL(fileSelected(const QString&)), + this, SLOT(loadFile(const QString&))); connect(qApp, SIGNAL(focusChanged(QWidget*, QWidget*)), this, SLOT(focusChanged(QWidget*, QWidget*))); } @@ -115,7 +130,7 @@ namespace GeorgesQt QUndoStack *GeorgesEditorForm::undoStack() const { - return m_undoStack; + return UndoStack; } void GeorgesEditorForm::open() @@ -125,26 +140,83 @@ namespace GeorgesQt loadFile(fileName); } - void GeorgesEditorForm::newFile() + void GeorgesEditorForm::newTyp() { - // Assume it is a form, for now. We'll have to retrieve the DFN we'll be using as a base. - QString fileName = QFileDialog::getOpenFileName(this, tr("Select Base Form Definition"), m_lastSheetDir, "Form Definition (*.dfn)"); - if(!fileName.isNull()) - { - // Use the file loader to create the new form. - loadFile(fileName, true); + QString fileName = QFileDialog::getSaveFileName( this, + tr( "New Type" ), + "", + "Type files (*.typ)" ); + if( fileName.isEmpty() ) + return; + + + GeorgesTypDialog *d = new GeorgesTypDialog(); + d->newDocument( fileName ); + addGeorgesWidget( d ); + setModified(); + } - // Save the folder we just opened for future dialogs. - QFileInfo pathInfo( fileName ); - m_lastSheetDir = pathInfo.absolutePath(); - } + void GeorgesEditorForm::newDfn() + { + QString fileName = QFileDialog::getSaveFileName( this, + tr( "New Definition" ), + "", + "Definition files (*.dfn)" ); + if( fileName.isEmpty() ) + return; + + GeorgesDFNDialog *d = new GeorgesDFNDialog(); + d->newDocument( fileName ); + addGeorgesWidget( d ); + setModified(); + } + + void GeorgesEditorForm::newForm() + { + QString dfnFileName = QFileDialog::getOpenFileName( this, + tr( "New Form" ), + "", + "Definition files (*.dfn)" ); + if( dfnFileName.isEmpty() ) + return; + + QFileInfo dfnInfo( dfnFileName ); + QString baseName = dfnInfo.baseName(); + QString filter; + filter += baseName; + filter += " files (*."; + filter += baseName; + filter += ")"; + + QString fileName = QFileDialog::getSaveFileName( this, + tr( "New Form" ), + "", + filter ); + if( fileName.isEmpty() ) + return; + + CGeorgesTreeViewDialog *d = new CGeorgesTreeViewDialog(); + if( !d->newDocument( fileName, dfnFileName ) ) + { + QMessageBox::information( this, + tr( "Failed to create new form" ), + tr( "Failed to create new form!" ) ); + return; + } + + addGeorgesWidget( d ); + setModified(); } void GeorgesEditorForm::save() { m_lastActiveDock->write(); - m_saveAction->setEnabled(false); + + m_saveAction->setEnabled(false); + QAction *saveAction = Core::ICore::instance()->menuManager()->action( Core::Constants::SAVE ); + if( saveAction != NULL ) + saveAction->setEnabled(false); } void GeorgesEditorForm::readSettings() @@ -174,6 +246,29 @@ namespace GeorgesQt settings->sync(); } + void GeorgesEditorForm::addGeorgesWidget( GeorgesDockWidget *w ) + { + w->setUndoStack(UndoStack); + m_lastActiveDock = w; + m_dockedWidgets.append(w); + + connect( w, SIGNAL( closing( GeorgesDockWidget* ) ), this, SLOT( dialogClosing( GeorgesDockWidget* ) ) ); + connect(m_dockedWidgets.last(), SIGNAL(visibilityChanged(bool)), m_dockedWidgets.last(), SLOT(checkVisibility(bool))); + + // If there is more than one form open - tabify the new form. If this is the first form open add it to the dock. + if(m_dockedWidgets.size() > 1) + { + m_mainDock->tabifyDockWidget(m_dockedWidgets.at(m_dockedWidgets.size() - 2), m_dockedWidgets.last()); + } + else + { + m_mainDock->addDockWidget(Qt::RightDockWidgetArea, m_dockedWidgets.last()); + } + + QCoreApplication::processEvents(); + w->raise(); + } + void GeorgesEditorForm::settingsChanged() { QSettings *settings = Core::ICore::instance()->settings(); @@ -189,21 +284,25 @@ namespace GeorgesQt } } - void GeorgesEditorForm::loadFile(const QString fileName) - { - loadFile(fileName, false); - } - - void GeorgesEditorForm::loadFile(const QString fileName, bool loadFromDfn) + void GeorgesEditorForm::loadFile(const QString &fileName) { - QFileInfo info(fileName); + std::string path = NLMISC::CPath::lookup( fileName.toUtf8().constData(), false ); + if( path.empty() ) + { + QMessageBox::information( this, + tr( "Failed to load file..." ), + tr( "Failed to load file '%1': File doesn't exist!" ).arg( fileName ) ); + return; + } + + QFileInfo info( path.c_str() ); // Check to see if the form is already loaded, if it is just raise it. if (m_dockedWidgets.size()) { - Q_FOREACH(CGeorgesTreeViewDialog *wgt, m_dockedWidgets) + Q_FOREACH(GeorgesDockWidget *wgt, m_dockedWidgets) { - if (info.fileName() == wgt->loadedForm) + if ( QString( path.c_str() ) == wgt->fileName()) { wgt->raise(); return; @@ -211,69 +310,58 @@ namespace GeorgesQt } } - CGeorgesTreeViewDialog *dock = new CGeorgesTreeViewDialog(m_mainDock); - dock->setUndoStack(m_undoStack); - m_lastActiveDock = dock; - m_dockedWidgets.append(dock); - - connect(m_dockedWidgets.last(), SIGNAL(closing()), this, SLOT(closingTreeView())); - connect(m_dockedWidgets.last(), SIGNAL(visibilityChanged(bool)), m_dockedWidgets.last(), SLOT(checkVisibility(bool))); + GeorgesDockWidget *w = NULL; - // If there is more than one form open - tabify the new form. If this is the first form open add it to the dock. - if(m_dockedWidgets.size() > 1) - { - m_mainDock->tabifyDockWidget(m_dockedWidgets.at(m_dockedWidgets.size() - 2), m_dockedWidgets.last()); + if( info.suffix() == "dfn" ) + { + w = loadDfnDialog( path.c_str() ); } - else - { - m_mainDock->addDockWidget(Qt::RightDockWidgetArea, m_dockedWidgets.last()); - } - - // Retrieve the form and load the form. - NLGEORGES::CForm *form; - if(loadFromDfn) - { - // Get the form by DFN name. - form = m_dockedWidgets.last()->getFormByDfnName(info.fileName()); - } - else - { - form = m_dockedWidgets.last()->getFormByName(info.fileName()); - } - - if (form) + else + if( info.suffix() == "typ" ) { - m_dockedWidgets.last()->setForm(form); - m_dockedWidgets.last()->loadFormIntoDialog(form); - QApplication::processEvents(); - connect(m_dockedWidgets.last(), SIGNAL(modified()), - this, SLOT(setModified())); - m_dockedWidgets.last()->raise(); - connect(m_dockedWidgets.last(), SIGNAL(changeFile(QString)), - m_georgesDirTreeDialog, SLOT(changeFile(QString))); + w = loadTypDialog( path.c_str() ); } else { - nlwarning("Failed to load form: %s", info.fileName().toUtf8().constData()); - m_dockedWidgets.last()->close(); + w = loadFormDialog( path.c_str() ); } + + if( w == NULL ) + { + QMessageBox::information( this, + tr( "Failed to load file..." ), + tr( "Failed to load file '%1': Not a typ, dfn, or form file!" ).arg( info.fileName() ) ); + return; + } + + addGeorgesWidget( w ); } - void GeorgesEditorForm::closingTreeView() + void GeorgesEditorForm::dialogClosing( GeorgesDockWidget *d ) { - //qDebug() << "closingTreeView"; - m_dockedWidgets.removeAll(qobject_cast(sender())); - if (qobject_cast(sender()) == m_lastActiveDock) - m_lastActiveDock = 0; + m_dockedWidgets.removeAll( d ); + + if( m_dockedWidgets.size() == 0 ) + m_lastActiveDock = NULL; + else + m_lastActiveDock = m_dockedWidgets.last(); + + delete d; } void GeorgesEditorForm::setModified () { qDebug() << "setModified"; + bool saveEnabled = false; if (m_lastActiveDock) - m_saveAction->setEnabled(m_lastActiveDock->isModified()); + saveEnabled = m_lastActiveDock->isModified(); else - m_saveAction->setEnabled(false); + saveEnabled = false; + + m_saveAction->setEnabled( saveEnabled ); + + QAction *saveAction = Core::ICore::instance()->menuManager()->action( Core::Constants::SAVE ); + saveAction->setEnabled( saveEnabled ); } void GeorgesEditorForm::focusChanged ( QWidget * old, QWidget * now ) @@ -304,4 +392,49 @@ namespace GeorgesQt } } } + + GeorgesDockWidget* GeorgesEditorForm::loadTypDialog( const QString &fileName ) + { + GeorgesTypDialog *d = new GeorgesTypDialog(); + if( !d->load( fileName ) ) + { + delete d; + return NULL; + } + + connect( d, SIGNAL( modified() ), this, SLOT( setModified() ) ); + + return d; + } + + GeorgesDockWidget* GeorgesEditorForm::loadDfnDialog( const QString &fileName ) + { + GeorgesDFNDialog *d = new GeorgesDFNDialog(); + bool b = d->load( fileName ); + if( !b ) + { + delete d; + return NULL; + } + + connect( d, SIGNAL( modified() ), this, SLOT( setModified() ) ); + + return d; + } + + GeorgesDockWidget* GeorgesEditorForm::loadFormDialog( const QString &fileName ) + { + CGeorgesTreeViewDialog *d = new CGeorgesTreeViewDialog(); + if( !d->load( fileName ) ) + { + delete d; + return NULL; + } + + connect(d, SIGNAL(modified()), this, SLOT(setModified())); + connect(d, SIGNAL(changeFile(QString)), m_georgesDirTreeDialog, SLOT(changeFile(QString))); + + return d; + } + } /* namespace GeorgesQt */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.h b/code/studio/src/plugins/georges_editor/georges_editor_form.h similarity index 77% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.h rename to code/studio/src/plugins/georges_editor/georges_editor_form.h index 77fdd1ec8..031d6e0fc 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.h +++ b/code/studio/src/plugins/georges_editor/georges_editor_form.h @@ -23,6 +23,8 @@ // Qt includes #include +class GeorgesDockWidget; + namespace GeorgesQt { @@ -38,14 +40,19 @@ public: QUndoStack *undoStack() const; + static QUndoStack *UndoStack; + public Q_SLOTS: void open(); - void loadFile(const QString fileName); - void loadFile(const QString fileName, bool loadFromDfn); - void newFile(); + void loadFile(const QString &fileName); + + void newTyp(); + void newDfn(); + void newForm(); + void save(); void settingsChanged(); - void closingTreeView(); + void dialogClosing( GeorgesDockWidget *d ); void setModified(); void focusChanged(QWidget *old, QWidget *now); @@ -54,13 +61,20 @@ private: void readSettings(); void writeSettings(); - QUndoStack *m_undoStack; + void addGeorgesWidget( GeorgesDockWidget *w ); + + GeorgesDockWidget* loadTypDialog(const QString &fileName); + GeorgesDockWidget* loadDfnDialog(const QString &fileName); + GeorgesDockWidget* loadFormDialog(const QString &fileName); + Ui::GeorgesEditorForm m_ui; CGeorgesDirTreeDialog *m_georgesDirTreeDialog; QToolBar *m_fileToolBar; QAction *m_openAction; - QAction *m_newAction; + QAction *m_newTypAction; + QAction *m_newDfnAction; + QAction *m_newFormAction; QAction *m_saveAction; QString m_leveldesignPath; @@ -68,10 +82,10 @@ private: QMainWindow *m_mainDock; /// Contains a list of all of the open forms. - QList m_dockedWidgets; + QList m_dockedWidgets; /// Contains a pointer to the last known focal change for active documents. - CGeorgesTreeViewDialog *m_lastActiveDock; + GeorgesDockWidget *m_lastActiveDock; /// Contains a record of the last directory a sheet file dialog was opened for. QString m_lastSheetDir; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.ui b/code/studio/src/plugins/georges_editor/georges_editor_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.ui rename to code/studio/src/plugins/georges_editor/georges_editor_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.cpp b/code/studio/src/plugins/georges_editor/georges_editor_plugin.cpp similarity index 94% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.cpp rename to code/studio/src/plugins/georges_editor/georges_editor_plugin.cpp index 075ac41b2..e0b29af2f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.cpp +++ b/code/studio/src/plugins/georges_editor/georges_editor_plugin.cpp @@ -39,6 +39,9 @@ GeorgesEditorPlugin::~GeorgesEditorPlugin() } qDeleteAll(m_autoReleaseObjects); m_autoReleaseObjects.clear(); + + delete m_libContext; + m_libContext = NULL; } bool GeorgesEditorPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) @@ -91,6 +94,11 @@ void GeorgesEditorContext::open() m_georgesEditorForm->open(); } +void GeorgesEditorContext::save() +{ + m_georgesEditorForm->save(); +} + QWidget *GeorgesEditorContext::widget() { return m_georgesEditorForm; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.h b/code/studio/src/plugins/georges_editor/georges_editor_plugin.h similarity index 99% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.h rename to code/studio/src/plugins/georges_editor/georges_editor_plugin.h index e21d8c57a..931e83ddf 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.h +++ b/code/studio/src/plugins/georges_editor/georges_editor_plugin.h @@ -86,6 +86,8 @@ public: virtual void open(); + void save(); + virtual QUndoStack *undoStack(); virtual QWidget *widget(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_filesystem_model.cpp b/code/studio/src/plugins/georges_editor/georges_filesystem_model.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_filesystem_model.cpp rename to code/studio/src/plugins/georges_editor/georges_filesystem_model.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_filesystem_model.h b/code/studio/src/plugins/georges_editor/georges_filesystem_model.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_filesystem_model.h rename to code/studio/src/plugins/georges_editor/georges_filesystem_model.h diff --git a/code/studio/src/plugins/georges_editor/georges_treeview_dialog.cpp b/code/studio/src/plugins/georges_editor/georges_treeview_dialog.cpp new file mode 100644 index 000000000..ab5f03924 --- /dev/null +++ b/code/studio/src/plugins/georges_editor/georges_treeview_dialog.cpp @@ -0,0 +1,755 @@ +// 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 "georges_treeview_dialog.h" + +// Qt includes +#include +#include +#include +#include +#include + +// NeL includes +#include +#include +#include +#include +#include +#include +#include + +// OVQT Includes +#include "../core/icore.h" +#include "../core/core_constants.h" + +// Project includes +#include "georges.h" +#include "georgesform_model.h" +#include "georgesform_proxy_model.h" +#include "formitem.h" +#include "formdelegate.h" +#include "expandable_headerview.h" +#include "browser_ctrl.h" + +using namespace NLMISC; +using namespace NLGEORGES; + +namespace GeorgesQt +{ + + CGeorgesTreeViewDialog::CGeorgesTreeViewDialog(QWidget *parent /*= 0*/) + : GeorgesDockWidget(parent), + m_header(0) + { + m_georges = new CGeorges; + + loadedForm = ""; + // Set the default sheet dir dir to the level design path. + m_lastSheetDir = "."; + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Core::Constants::DATA_PATH_SECTION); + m_lastSheetDir = settings->value(Core::Constants::LEVELDESIGN_PATH, "l:/leveldesign").toString(); + settings->endGroup(); + + m_ui.setupUi(this); + m_header = new ExpandableHeaderView(Qt::Horizontal, m_ui.treeView); + m_ui.treeView->setHeader(m_header); + m_ui.treeView->header()->setResizeMode(QHeaderView::ResizeToContents); + m_ui.treeView->header()->setStretchLastSection(true); + + m_form = 0; + m_model = NULL; + + m_ui.treeView->setContextMenuPolicy(Qt::CustomContextMenu); + + m_browserCtrl = new BrowserCtrl( m_ui.propertiesBrowser ); + + connect(m_ui.treeView, SIGNAL(customContextMenuRequested(const QPoint&)), + this, SLOT(showContextMenu(const QPoint&))); + connect(m_ui.treeView, SIGNAL(doubleClicked (QModelIndex)), + this, SLOT(doubleClicked (QModelIndex))); + connect(m_ui.treeView, SIGNAL(clicked(const QModelIndex&)), + m_browserCtrl, SLOT(clicked(const QModelIndex&))); + connect(m_header, SIGNAL(headerClicked(int)), + this, SLOT(headerClicked(int))); + connect(m_browserCtrl, SIGNAL(arrayResized(const QString&,int)), this, SLOT(onArrayResized(const QString&,int))); + + connect(m_browserCtrl, SIGNAL(modified()), this, SLOT(modifiedFile())); + connect(m_browserCtrl, SIGNAL(valueChanged(const QString&,const QString&)), this, SLOT(onValueChanged(const QString&,const QString&))); + connect(m_browserCtrl, SIGNAL(vstructChanged(const QString&)), this, SLOT( onVStructChanged(const QString&))); + } + + CGeorgesTreeViewDialog::~CGeorgesTreeViewDialog() + { + m_browserCtrl = NULL; + m_model = NULL; + + delete m_form; + qDebug() << "DTOR"; + } + + void CGeorgesTreeViewDialog::headerClicked(int section) + { + if (section == 0) + { + if (*(m_header->expanded())) + m_ui.treeView->expandAll(); + else + m_ui.treeView->collapseAll(); + } + } + + void CGeorgesTreeViewDialog::setForm(const CForm *form) + { + m_form = (UForm*)form; + m_browserCtrl->setForm( (UForm*)form ); + } + + NLGEORGES::CForm* CGeorgesTreeViewDialog::getFormByName(const QString formName) + { + return (NLGEORGES::CForm *)m_georges->loadForm(formName.toAscii().data()); + //else + //{ + // CForm *form = 0; + // // Load the DFN + // std::string extStr = NLMISC::CFile::getExtension( formName.toAscii().data() ); + // QString dfnName = QString("%1.dfn").arg(extStr.c_str()); + // UFormDfn *formdfn; + // if (NLMISC::CPath::exists(dfnName.toAscii().data())) + // { + // formdfn = _georges->loadFormDfn (dfnName.toAscii().data()); + // if (!formdfn) + // { + // nlwarning("Failed to load dfn: %s", dfnName.toAscii().data()); + // return 0; + // } + // } + // else + // { + // nlwarning("Cannot find dfn: %s", dfnName.toAscii().data()); + // return 0; + // } + + // form = new CForm; + + // // Build the root element + // ((CFormElmStruct*)&form->getRootNode())->build((CFormDfn*)formdfn); + + // uint i; + // for (i=0; iHeldElements[i]))->build ((CFormDfn*)formdfn); + // } + // return form; + //} + return 0; + } + + NLGEORGES::CForm* CGeorgesTreeViewDialog::getFormByDfnName(const QString dfnName) + { + // Create a new form object. + NLGEORGES::CForm *form = new NLGEORGES::CForm(); + m_form = form; + + // Retrieve a copy of the root definition. + NLGEORGES::CFormDfn *formDfn = dynamic_cast(m_georges->loadFormDfn(dfnName.toAscii().data())); + + // Next we'll use the root node to build a new form. + NLGEORGES::CFormElmStruct *fes = dynamic_cast(getRootNode(0)); + fes->build(formDfn); + + // And then initialize the held elements; + for(uint i = 0; i(getRootNode(i+1)); + fes->build(formDfn); + } + + return form; + } + + NLGEORGES::CFormElm *CGeorgesTreeViewDialog::getRootNode(uint slot) + { + NLGEORGES::CForm *form = getFormPtr(); + + if(slot == 0) + { + const NLGEORGES::UFormElm &formElm = form->getRootNode(); + return (NLGEORGES::CFormElm *)&formElm; + } + + // Make sure the slot value is valid and then return the corresponding element. + nlassert(slot < NLGEORGES::CForm::HeldElementCount+1); + return getFormPtr()->HeldElements[slot-1]; + } + + NLGEORGES::CForm *CGeorgesTreeViewDialog::getFormPtr() + { + return dynamic_cast(m_form); + } + + void CGeorgesTreeViewDialog::loadFormIntoDialog(CForm *form) + { + + if(form) + m_form = form; + else + return; + + m_ui.logEdit->setPlainText( form->Header.Log.c_str() ); + m_ui.logEdit->setReadOnly( true ); + + UFormElm *root = 0; + root = &m_form->getRootNode(); + + // Extract the parent forms into the list of parents in the dialog. + QStringList parents; + uint cnt = form->getParentCount(); + for (uint i = 0; i < cnt /*form->getParentCount()*/; i++) + { + UForm *u = m_form->getParentForm(i); + parents << u->getFilename().c_str(); + } + + // Exact the comment box for the dialog. + QString comments; + comments = m_form->getComment().c_str(); + + if (!comments.isEmpty()) + { + m_ui.treeViewTabWidget->setTabEnabled (1,true); + m_ui.commentEdit->setPlainText(comments); + } + + QStringList strList; + std::set dependencies; + m_form->getDependencies(dependencies); + + QMap< QString, QStringList> deps; + Q_FOREACH(std::string str, dependencies) + { + QString file = str.c_str(); + if (str == m_form->getFilename()) continue; + deps[file.remove(0,file.indexOf(".")+1)] << str.c_str(); + } + nlinfo("typ's %d",deps["typ"].count()); + nlinfo("dfn's %d",deps["dfn"].count()); + + //nlwarning(strList.join(";").toAscii().data()); + if (root) + { + loadedForm = m_form->getFilename().c_str(); + m_fileName = m_form->getFilename().c_str(); + + CGeorgesFormModel *model = new CGeorgesFormModel(m_form,deps,comments,parents,m_header->expanded()); + m_ui.treeView->setModel(model); + m_ui.treeView->expandAll(); + + connect(model, SIGNAL(dataChanged(const QModelIndex, const QModelIndex)), + this, SLOT(modifiedFile())); + + m_model = model; + } + } + + void CGeorgesTreeViewDialog::addParentForm(QString parentFormNm) + { + // Try to load the form + NLGEORGES::UForm *uParentForm = m_georges->loadForm(parentFormNm.toAscii().data()); + NLGEORGES::CForm *parentForm = dynamic_cast(uParentForm); + NLGEORGES::CForm *mainForm = static_cast(m_form); + + CGeorgesFormModel *model = dynamic_cast(m_ui.treeView->model()); + + if(parentForm) + { + if (mainForm != parentForm) + { + // Check it is the same dfn + if (parentForm->Elements.FormDfn == mainForm->Elements.FormDfn) + { + // This is the parent form selector + if(!mainForm->insertParent(mainForm->getParentCount(),parentFormNm.toAscii().data(), parentForm)) + nlwarning("Failed to add parent form: %s", parentFormNm.toAscii().data()); + else + { + nlinfo("Successfullyadded parent form: %s", parentFormNm.toAscii().data()); + model->addParentForm(parentFormNm); + } + } + } + } + } + + void CGeorgesTreeViewDialog::modifiedFile( ) + { + if (!isModified()) + { + setModified( true ); + setWindowTitle(windowTitle() + "*"); + } + Q_EMIT modified(); + } + + bool CGeorgesTreeViewDialog::load( const QString &fileName ) + { + + // Retrieve the form and load the form. + NLGEORGES::CForm *form = getFormByName(fileName); + + if( form == NULL ) + return false; + + setForm(form); + loadFormIntoDialog(form); + QApplication::processEvents(); + + m_fileName = fileName; + + QFileInfo info( fileName ); + setWindowTitle( info.fileName() ); + + connect(m_ui.commentEdit, SIGNAL(textChanged()), this, SLOT(onCommentsEdited())); + + return true; + } + + void CGeorgesTreeViewDialog::write( ) + { + NLGEORGES::CForm *form = static_cast< NLGEORGES::CForm* >( m_form ); + form->Header.Log = m_ui.logEdit->toPlainText().toUtf8().constData(); + form->Header.Comments = m_ui.commentEdit->toPlainText().toUtf8().constData(); + + NLMISC::COFile file; + std::string s = m_fileName.toUtf8().constData(); + if(file.open (s)) + { + try + { + // if (loadedForm.contains(".typ")) + // { + // //nlassert (Type != NULL); + + // //// Write the file + // //// Modified ? + // //if (IsModified ()) + // //{ + // // Type->Header.MinorVersion++; + // // flushValueChange (); + // //} + // //Type->write (xmlStream.getDocument (), theApp.Georges4CVS); + // //modify (NULL, NULL, false); + // //flushValueChange (); + // //UpdateAllViews (NULL); + // //return TRUE; + // } + // else if (loadedForm.contains(".dfn")) + // { + // //nlassert (Dfn != NULL); + + // //// Write the file + // //if (IsModified ()) + // //{ + // // Dfn->Header.MinorVersion++; + // // flushValueChange (); + // //} + // //Dfn->write (xmlStream.getDocument (), lpszPathName, theApp.Georges4CVS); + // //modify (NULL, NULL, false); + // //UpdateAllViews (NULL); + // //return TRUE; + // } + // else + // { + nlassert (m_form != NULL); + + // Write the file + // /*if (IsModified ()) + // { + // ((CForm*)(UForm*)Form)->Header.MinorVersion++; + // }*/ + // //((CForm*)(UForm*)Form)->write (xmlStream.getDocument (), lpszPathName, theApp.Georges4CVS); + m_form->write(file); + setWindowTitle(windowTitle().remove("*")); + setModified( false ); + // //if (strcmp (xmlStream.getErrorString (), "") != 0) + // //{ + // // char message[512]; + // // smprintf (message, 512, "Error while saving file: %s", xmlStream.getErrorString ()); + // //theApp.outputError (message); + // //} + // //modify (NULL, NULL, false); + // //flushValueChange (); + // //UpdateAllViews (NULL); + + // // Get the left view + // //CView* pView = getLeftView (); + // } + } + catch (Exception &e) + { + nlerror("Error while loading file: %s", e.what()); + } + } + else + { + nlerror("Can't open the file %s for writing.", s.c_str()); + } + } + + bool CGeorgesTreeViewDialog::newDocument( const QString &fileName, const QString &dfn ) + { + NLGEORGES::CForm *form = getFormByDfnName(dfn); + + if( form == NULL ) + return false; + + setForm(form); + loadFormIntoDialog(form); + QApplication::processEvents(); + + m_fileName = fileName; + + QFileInfo info( fileName ); + setWindowTitle( info.fileName() + "*" ); + setModified( true ); + + log( "Created" ); + + return true; + } + + void CGeorgesTreeViewDialog::doubleClicked ( const QModelIndex & index ) + { + //CGeorgesFormModel *model = + // dynamic_cast((m_ui.treeView->model()); + + //CFormItem *item = model->getItem(index); + + //if (item->parent() && item->parent()->data(0) == "parents") + //{ + // Q_EMIT changeFile(CPath::lookup(item->data(0).toString().toAscii().data(),false).c_str()); + //} + + //// col containing additional stuff like icons + //if (index.column() == 2) + //{ + // QModelIndex in2 = m->index(in.row(),in.column()-1,in.parent()); + // CFormItem *item = m->getItem(in2); + // QString value = item->data(1).toString(); + + // QString path = CPath::lookup(value.toAscii().data(),false).c_str(); + + // if(value.contains(".tga") || value.contains(".png")) + // { + // QString file = QFileDialog::getOpenFileName( + // this, + // "Select a new image", + // path, + // "Images (*.png *.tga)" + // ); + // if (file.isNull()) + // return; + // QFileInfo info = QFileInfo(file); + + // // TODO? + // // right way would be another delegate but im too lazy :) + // // so for now i just call it directly + // m->setData(in2, info.fileName()); + // return; + // } + // else + // { + // if (path.contains(".shape") || path.contains(".ps")) + // { + // if (Modules::objViewInt()) + // { + // Modules::objViewInt()->resetScene(); + // //Modules::config().configRemapExtensions(); + // Modules::objViewInt()->loadMesh(path.toAscii().data(),""); + // } + // return; + // } + // } + + // // open eg parent files + // if (!path.isEmpty()) + // Q_EMIT changeFile(path); + + //} + } + + void CGeorgesTreeViewDialog::onArrayResized( const QString &name, int size ) + { + QModelIndex current = m_ui.treeView->currentIndex(); + QModelIndex parent = current.parent(); + int r = current.row(); + int c = current.column(); + + m_model->arrayResized( name, size ); + m_ui.treeView->reset(); + m_ui.treeView->expandAll(); + + QModelIndex idx = m_model->index( r, c, parent ); + if( !idx.isValid() ) + return; + m_ui.treeView->setCurrentIndex( idx ); + + log( name + " resized = " + QString::number( size ) ); + + modifiedFile(); + } + + void CGeorgesTreeViewDialog::onAppendArray() + { + QModelIndex idx = m_ui.treeView->currentIndex(); + + CFormItem *item = reinterpret_cast< CFormItem* >( idx.internalPointer() ); + QString formName = item->formName().c_str(); + int size = item->childCount(); + + m_model->appendArray( idx ); + + m_ui.treeView->reset(); + m_ui.treeView->expandAll(); + + m_ui.treeView->setCurrentIndex( idx ); + m_browserCtrl->clicked( idx ); + + log( formName + " resized = " + QString::number( size + 1 ) ); + + modifiedFile(); + } + + void CGeorgesTreeViewDialog::onDeleteArrayEntry() + { + QModelIndex current = m_ui.treeView->currentIndex(); + QModelIndex parent = current.parent(); + + CFormItem *item = reinterpret_cast< CFormItem* >( current.internalPointer() ); + QString formName = item->formName().c_str(); + + m_model->deleteArrayEntry( current ); + + m_ui.treeView->expandAll(); + m_ui.treeView->setCurrentIndex( parent ); + m_browserCtrl->clicked( parent ); + + log( "deleted " + formName ); + + modifiedFile(); + } + + void CGeorgesTreeViewDialog::onValueChanged( const QString &key, const QString &value ) + { + log( key + " = " + value ); + } + + void CGeorgesTreeViewDialog::onRenameArrayEntry() + { + QModelIndex idx = m_ui.treeView->currentIndex(); + + CFormItem *item = static_cast< CFormItem* >( idx.internalPointer() ); + + QString newName = QInputDialog::getText( this, + tr( "Rename" ), + tr( "Enter new name" ), + QLineEdit::Normal, + item->name().c_str() ); + + m_model->renameArrayEntry( idx, newName ); + + QString formName = item->formName().c_str(); + + log( formName + " renamed = " + newName ); + + modifiedFile(); + } + + void CGeorgesTreeViewDialog::onVStructChanged( const QString &name ) + { + QModelIndex idx = m_ui.treeView->currentIndex(); + QModelIndex parent = idx.parent(); + int row = idx.row(); + + m_model->changeVStructDfn( idx ); + + idx = m_model->index( row, 0, parent ); + + m_ui.treeView->expandAll(); + m_ui.treeView->setCurrentIndex( idx ); + m_browserCtrl->clicked( idx ); + } + + void CGeorgesTreeViewDialog::onCommentsEdited() + { + modifiedFile(); + } + + void CGeorgesTreeViewDialog::checkVisibility(bool visible) { + // this prevents invisible docks from getting tab focus + qDebug() << "checkVisibility" << visible; + setEnabled(visible); + //if (visible) + Q_EMIT modified(); + } + + void CGeorgesTreeViewDialog::filterRows() + { + //CGeorgesFormProxyModel * mp = dynamic_cast(m_ui.treeView->model()); + //CGeorgesFormModel *m = dynamic_cast(mp->sourceModel()); + //if (m) { + // m->setShowParents(m_ui.checkBoxParent->isChecked()); + // m->setShowDefaults(m_ui.checkBoxDefaults->isChecked()); + //} + } + + void CGeorgesTreeViewDialog::showContextMenu(const QPoint &pos) + { + QMenu contextMenu; + QMenu *structContext = NULL; + QPoint globalPos = this->mapToGlobal(pos); + + // Fisrt we're going to see if we've right clicked on a new item and select it. + const QModelIndex &index = this->m_ui.treeView->currentIndex(); + + if(!index.isValid()) + return; + + CGeorgesFormModel *m = dynamic_cast(m_ui.treeView->model()); + + if(m) + { + CFormItem *item = m->getItem(index); + + // Right click on the "parents" item + // if (item->data(0) == "parents") + // contextMenu.addAction("Add parent..."); + // // Right click on a parent item + // else if(item->parent() && item->parent()->data(0) == "parents") + // { + // contextMenu.addAction("Add parent..."); + // contextMenu.addAction("Remove parent"); + // } + if(item->isArray()) + { + QAction *appendAction = contextMenu.addAction("Append array entry..."); + connect( appendAction, SIGNAL( triggered( bool ) ), this, SLOT( onAppendArray() ) ); + } + else if(item->isArrayMember()) + { + QAction *deleteAction = contextMenu.addAction("Delete array entry..."); + connect( deleteAction, SIGNAL( triggered( bool ) ), this, SLOT( onDeleteArrayEntry() ) ); + + QAction *renameAction = contextMenu.addAction("Rename"); + connect( renameAction, SIGNAL( triggered( bool ) ), this, SLOT( onRenameArrayEntry() ) ); + //contextMenu.addAction("Insert after array entry..."); + } + // else if(item->getFormElm()->isStruct()) + // { + // QMenu *structContext = new QMenu("Add struct element...", this); + // contextMenu.addMenu(structContext); + + // NLGEORGES::UFormDfn *defn = item->getFormElm()->getStructDfn(); + // if(defn) + // { + // for(uint defnNum=0; defnNum < defn->getNumEntry(); defnNum++) + // { + // std::string entryName; + // std::string dummy; + // UFormElm::TWhereIsValue *whereV = new UFormElm::TWhereIsValue; + // bool result = defn->getEntryName(defnNum, entryName); + // bool result2 = item->getFormElm()->getValueByName(dummy, entryName.c_str(), NLGEORGES::UFormElm::Eval, whereV); + + // + // if(result2 && *whereV != UFormElm::ValueForm) + // { + // structContext->addAction(entryName.c_str()); + // } + // delete whereV; + // } + // } + // } + // else if(item->getFormElm()->isAtom() && item->valueFrom() == NLGEORGES::UFormElm::ValueForm) + // contextMenu.addAction("Revert to parent/default..."); + + contextMenu.exec(QCursor::pos()); + /* + if(selectedItem) + { + // if(selectedItem->text() == "Add parent...") + // { + // // Get the file extension of the form so we can build a dialog pattern. + // QString file = m_form->getFilename().c_str(); + // file = file.remove(0,file.indexOf(".")+1); + // QString filePattern = "Parent Sheets (*."+file+")"; + // + // nlinfo("parent defn name '%s'", file.toAscii().data()); + // QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Select parent sheets..."), m_lastSheetDir, filePattern); + // if(!fileNames.isEmpty()) + // { + // Q_FOREACH(QString fileToParent, fileNames) + // { + // // Get just the filename. Georges doesn't want the path. + // QFileInfo pathInfo( fileToParent ); + // QString tmpFileName( pathInfo.fileName() ); + + // nlinfo("requesting to add parent form '%s'", tmpFileName.toAscii().data()); + // + // // Call to add the form and load it into the Georges form. + // addParentForm(tmpFileName); + + // // Save the file lookup path for future dialog boxes. + // m_lastSheetDir = pathInfo.absolutePath(); + // } + // } + // m_ui.treeView->expandAll(); + // } + // else if(selectedItem->text() == "Remove parent") + // { + // NLGEORGES::CForm *form = static_cast(m_form); + // QString parentFileName = item->data(0).toString(); + + // for(uint num = 0; num < form->getParentCount(); num++) + // { + // QString curParentName = form->getParent(num)->getFilename().c_str(); + // if(parentFileName == curParentName) + // { + // form->removeParent(num); + // m->removeParentForm(parentFileName); + // break; + // } + // } + + // m_ui.treeView->expandAll(); + // } + + } // if selected context menu item is valid. + */ + } // if 'm' model valid. + + //if(structContext) + // delete structContext; + } + + void CGeorgesTreeViewDialog::log( const QString &msg ) + { + QString logMsg = buildLogMsg( msg ); + + m_ui.logEdit->appendPlainText( logMsg ); + } + +} /* namespace GeorgesQt */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_treeview_dialog.h b/code/studio/src/plugins/georges_editor/georges_treeview_dialog.h similarity index 70% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_treeview_dialog.h rename to code/studio/src/plugins/georges_editor/georges_treeview_dialog.h index e34ab572b..37ae55c20 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_treeview_dialog.h +++ b/code/studio/src/plugins/georges_editor/georges_treeview_dialog.h @@ -18,6 +18,7 @@ #define GEORGES_TREEVIEWER_DIALOG_H #include "ui_georges_treeview_form.h" +#include "georges_dock_widget.h" #include "expandable_headerview.h" // Qt includes @@ -32,6 +33,8 @@ // Project includes +class BrowserCtrl; + namespace NLGEORGES { class UForm; @@ -45,8 +48,9 @@ namespace GeorgesQt { class CGeorges; + class CGeorgesFormModel; - class CGeorgesTreeViewDialog: public QDockWidget + class CGeorgesTreeViewDialog: public GeorgesDockWidget { Q_OBJECT @@ -54,39 +58,28 @@ namespace GeorgesQt CGeorgesTreeViewDialog(QWidget *parent = 0); ~CGeorgesTreeViewDialog(); - bool isModified() {return m_modified;} - void setModified(bool m) {m_modified = m;} - - NLGEORGES::CForm* getFormByName(const QString formName); - NLGEORGES::CForm* getFormByDfnName(const QString dfnName); + NLGEORGES::CForm* getFormByName(const QString formName); + NLGEORGES::CForm* getFormByDfnName(const QString dfnName); - /// Retrieves the root element based on the slot (document or held elements.) - NLGEORGES::CFormElm *getRootNode(uint slot); + /// Retrieves the root element based on the slot (document or held elements.) + NLGEORGES::CFormElm *getRootNode(uint slot); - /// Returns the form as a CForm pointer. - NLGEORGES::CForm *getFormPtr(); + /// Returns the form as a CForm pointer. + NLGEORGES::CForm *getFormPtr(); void addParentForm(QString parentFormNm); + bool load( const QString &fileName ); void write ( ); + bool newDocument( const QString &fileName, const QString &dfn ); QTabWidget* tabWidget() { return m_ui.treeViewTabWidget; } - void setUndoStack(QUndoStack *stack) { - m_undoStack = stack; - } - - - QString loadedForm; - protected: - void closeEvent(QCloseEvent *event); - Q_SIGNALS: void changeFile(QString); void modified(); - void closing(); public Q_SLOTS: void setForm(const CForm*); @@ -100,18 +93,27 @@ namespace GeorgesQt void filterRows(); void headerClicked(int); + void onArrayResized( const QString &name, int size ); + void onAppendArray(); + void onDeleteArrayEntry(); + void onValueChanged( const QString &key, const QString &value ); + void onVStructChanged( const QString &name ); + void onRenameArrayEntry(); + void onCommentsEdited(); + private: + void log( const QString &msg ); + Ui::CGeorgesTreeViewDialog m_ui; ExpandableHeaderView *m_header; UForm *m_form; CGeorges *m_georges; - QUndoStack *m_undoStack; - /// Contains a record of the last directory a sheet file dialog was opened for. QString m_lastSheetDir; - bool m_modified; + BrowserCtrl *m_browserCtrl; + CGeorgesFormModel *m_model; }; /* CGeorgesTreeViewDialog */ diff --git a/code/studio/src/plugins/georges_editor/georges_treeview_form.ui b/code/studio/src/plugins/georges_editor/georges_treeview_form.ui new file mode 100644 index 000000000..43d50e103 --- /dev/null +++ b/code/studio/src/plugins/georges_editor/georges_treeview_form.ui @@ -0,0 +1,138 @@ + + + CGeorgesTreeViewDialog + + + + 0 + 0 + 564 + 525 + + + + + 0 + 0 + + + + + 280 + 242 + + + + Qt::NoFocus + + + + + + + + 0 + 0 + + + + + + + + 0 + 0 + + + + QTabWidget::West + + + 0 + + + + Form + + + + + + Qt::Horizontal + + + + + 0 + 0 + + + + + 0 + 0 + + + + QAbstractItemView::NoEditTriggers + + + true + + + + + + 0 + 0 + + + + + + + + + + Comment + + + + + + false + + + + + + + + Log + + + + + + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + + + + + + QtTreePropertyBrowser + QWidget +
    qttreepropertybrowser.h
    + 1 +
    +
    + + +
    diff --git a/code/studio/src/plugins/georges_editor/georges_typ_dialog.cpp b/code/studio/src/plugins/georges_editor/georges_typ_dialog.cpp new file mode 100644 index 000000000..ab4cc0472 --- /dev/null +++ b/code/studio/src/plugins/georges_editor/georges_typ_dialog.cpp @@ -0,0 +1,275 @@ +// Ryzom Core Studio - Georges Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 "georges_typ_dialog.h" +#include "georges.h" +#include "typ_browser_ctrl.h" + +#include +#include + +#include "nel/misc/file.h" +#include "nel/misc/o_xml.h" +#include "nel/misc/path.h" + +class GeorgesTypDialogPvt +{ +public: + GeorgesTypDialogPvt() + { + typ = NULL; + ctrl = new TypBrowserCtrl(); + } + + ~GeorgesTypDialogPvt() + { + delete typ; + typ = NULL; + delete ctrl; + ctrl = NULL; + } + + + NLGEORGES::CType *typ; + TypBrowserCtrl *ctrl; +}; + +GeorgesTypDialog::GeorgesTypDialog( QWidget *parent ) : +GeorgesDockWidget( parent ) +{ + m_ui.setupUi( this ); + m_pvt = new GeorgesTypDialogPvt(); + m_pvt->ctrl->setBrowser( m_ui.browser ); + + setupConnections(); +} + +GeorgesTypDialog::~GeorgesTypDialog() +{ + delete m_pvt; + m_pvt = NULL; +} + + +bool GeorgesTypDialog::load( const QString &fileName ) +{ + GeorgesQt::CGeorges georges; + NLGEORGES::UType *utyp = georges.loadFormType( fileName.toUtf8().constData() ); + if( utyp == NULL ) + return false; + + m_pvt->typ = dynamic_cast< NLGEORGES::CType* >( utyp ); + + loadTyp(); + + m_fileName = fileName; + + QFileInfo info( fileName ); + setWindowTitle( info.fileName() ); + + connect( m_ui.commentEdit, SIGNAL( textChanged() ), this, SLOT( onCommentsEdited() ) ); + + return true; +} + + +void GeorgesTypDialog::write() +{ + NLMISC::COFile file; + if( !file.open( m_fileName.toUtf8().constData(), false, true, false ) ) + return; + + NLMISC::COXml xml; + xml.init( &file ); + + m_pvt->typ->Header.Log = m_ui.logEdit->toPlainText().toUtf8().constData(); + m_pvt->typ->Header.Comments = m_ui.commentEdit->toPlainText().toUtf8().constData(); + m_pvt->typ->write( xml.getDocument() ); + + xml.flush(); + file.close(); + + setModified( false ); + setWindowTitle( windowTitle().remove( "*" ) ); +} + +void GeorgesTypDialog::newDocument( const QString &fileName ) +{ + m_pvt->typ = new NLGEORGES::CType(); + m_fileName = fileName; + + QFileInfo info( fileName ); + setWindowTitle( info.fileName() + "*" ); + setModified( true ); + + loadTyp(); + + log( "Created" ); +} + +void GeorgesTypDialog::onAddClicked() +{ + QString label = QInputDialog::getText( this, + tr( "Adding new definition" ), + tr( "Please specify the label" ) ); + if( label.isEmpty() ) + return; + + QList< QTreeWidgetItem* > l = m_ui.tree->findItems( label, Qt::MatchExactly, 0 ); + if( !l.isEmpty() ) + { + QMessageBox::information( this, + tr( "Failed to add item" ), + tr( "You can't add an item with the same label more than once!" ) ); + return; + } + + QTreeWidgetItem *item = new QTreeWidgetItem(); + item->setFlags( Qt::ItemIsEditable | Qt::ItemIsEnabled ); + item->setText( 0, label ); + item->setText( 1, "" ); + m_ui.tree->addTopLevelItem( item ); + + NLGEORGES::CType::CDefinition def; + def.Label = label.toUtf8().constData(); + def.Value = ""; + m_pvt->typ->Definitions.push_back( def ); + + log( "Added definition " + label ); + + onModified(); +} + +void GeorgesTypDialog::onRemoveClicked() +{ + QTreeWidgetItem *item = m_ui.tree->currentItem(); + if( item == NULL ) + return; + + int i = 0; + for( i = 0; i < m_ui.tree->topLevelItemCount(); i++ ) + { + if( item == m_ui.tree->topLevelItem( i ) ) + break; + } + + QString definition = item->text( 0 ); + + m_ui.tree->takeTopLevelItem( i ); + delete item; + + std::vector< NLGEORGES::CType::CDefinition >::iterator itr = m_pvt->typ->Definitions.begin() + i; + m_pvt->typ->Definitions.erase( itr ); + + log( "Removed definition" + definition ); + + onModified(); +} + +void GeorgesTypDialog::onItemChanged( QTreeWidgetItem *item, int column ) +{ + int i = 0; + for( i = 0; i < m_ui.tree->topLevelItemCount(); i++ ) + { + if( item == m_ui.tree->topLevelItem( i ) ) + break; + } + + NLGEORGES::CType::CDefinition &def = m_pvt->typ->Definitions[ i ]; + + QString logMsg; + logMsg = "Changed definition" + QString( def.Label.c_str() ); + + if( i == 0 ) + { + logMsg += ".label = "; + logMsg += item->text( 0 ); + def.Label = item->text( 0 ).toUtf8().constData(); + } + else + { + logMsg += ".value = "; + logMsg += item->text( 1 ); + def.Value = item->text( 1 ).toUtf8().constData(); + } + + log( logMsg ); + + onModified(); +} + +void GeorgesTypDialog::onModified() +{ + if( isModified() ) + return; + + setModified( true ); + setWindowTitle( windowTitle() + "*" ); + + Q_EMIT modified(); +} + +void GeorgesTypDialog::onModified( const QString &k, const QString &v ) +{ + log( "Changed " + k + " = " + v ); + onModified(); +} + +void GeorgesTypDialog::onCommentsEdited() +{ + onModified(); +} + +void GeorgesTypDialog::setupConnections() +{ + connect( m_ui.addButton, SIGNAL( clicked( bool ) ), this, SLOT( onAddClicked() ) ); + connect( m_ui.removeButton, SIGNAL( clicked( bool ) ), this, SLOT( onRemoveClicked() ) ); + + connect( m_ui.tree, SIGNAL( itemChanged( QTreeWidgetItem*, int ) ), this, SLOT( onItemChanged( QTreeWidgetItem*, int ) ) ); + connect( m_pvt->ctrl, SIGNAL( modified( const QString&, const QString& ) ), this, SLOT( onModified( const QString&, const QString& ) ) ); +} + +void GeorgesTypDialog::log( const QString &msg ) +{ + QString logMsg = buildLogMsg( msg ); + m_ui.logEdit->appendPlainText( logMsg ); +} + +void GeorgesTypDialog::loadTyp() +{ + m_ui.logEdit->setPlainText( m_pvt->typ->Header.Log.c_str() ); + m_ui.commentEdit->setPlainText( m_pvt->typ->Header.Comments.c_str() ); + + std::vector< NLGEORGES::CType::CDefinition >::iterator itr = m_pvt->typ->Definitions.begin(); + while( itr != m_pvt->typ->Definitions.end() ) + { + NLGEORGES::CType::CDefinition &def = *itr; + + QTreeWidgetItem *item = new QTreeWidgetItem(); + item->setFlags( Qt::ItemIsEditable | Qt::ItemIsEnabled ); + item->setText( 0, def.Label.c_str() ); + item->setText( 1, def.Value.c_str() ); + m_ui.tree->addTopLevelItem( item ); + + ++itr; + } + + m_pvt->ctrl->setTyp( m_pvt->typ ); + m_pvt->ctrl->load(); +} + diff --git a/code/studio/src/plugins/georges_editor/georges_typ_dialog.h b/code/studio/src/plugins/georges_editor/georges_typ_dialog.h new file mode 100644 index 000000000..5a6c09e61 --- /dev/null +++ b/code/studio/src/plugins/georges_editor/georges_typ_dialog.h @@ -0,0 +1,61 @@ +// Ryzom Core Studio - Georges Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 GEORGES_TYP_DIALOG +#define GEORGES_TYP_DIALOG + +#include "georges_dock_widget.h" +#include "ui_georges_typ_dialog.h" + +class GeorgesTypDialogPvt; + +class GeorgesTypDialog : public GeorgesDockWidget +{ + Q_OBJECT +public: + GeorgesTypDialog( QWidget *parent = NULL ); + ~GeorgesTypDialog(); + + bool load( const QString &fileName ); + void write(); + void newDocument( const QString &fileName ); + +Q_SIGNALS: + void modified(); + +private Q_SLOTS: + void onAddClicked(); + void onRemoveClicked(); + + void onItemChanged( QTreeWidgetItem *item, int column ); + void onModified(); + void onModified( const QString &k, const QString &v ); + void onCommentsEdited(); + +private: + void setupConnections(); + void log( const QString &msg ); + void loadTyp(); + + Ui::GeorgesTypDialog m_ui; + GeorgesTypDialogPvt *m_pvt; +}; + + +#endif + diff --git a/code/studio/src/plugins/georges_editor/georges_typ_dialog.ui b/code/studio/src/plugins/georges_editor/georges_typ_dialog.ui new file mode 100644 index 000000000..8978fa13b --- /dev/null +++ b/code/studio/src/plugins/georges_editor/georges_typ_dialog.ui @@ -0,0 +1,144 @@ + + + GeorgesTypDialog + + + + 0 + 0 + 682 + 425 + + + + + + + + + + + QTabWidget::West + + + 0 + + + + Type + + + + + + Qt::Horizontal + + + + + 0 + 0 + + + + + + + + + + Label + + + + + Value + + + + + + + + + 0 + 0 + + + + Add + + + + + + + + 0 + 0 + + + + Remove + + + + + + + Qt::Horizontal + + + + 15 + 20 + + + + + + + + + + + + + Comment + + + + + + + + + + Log + + + + + + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + + + + + + QtTreePropertyBrowser + QWidget +
    qttreepropertybrowser.h
    + 1 +
    +
    + + +
    diff --git a/code/studio/src/plugins/georges_editor/georgesform_model.cpp b/code/studio/src/plugins/georges_editor/georgesform_model.cpp new file mode 100644 index 000000000..2579a09f5 --- /dev/null +++ b/code/studio/src/plugins/georges_editor/georgesform_model.cpp @@ -0,0 +1,829 @@ +// 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 "georgesform_model.h" + +// System Includes +#include + +// NeL includes +#include +#include +#include +#include +#include +#include +#include +#include + +// Qt includes +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// project includes +#include "formitem.h" +#include "georges_editor_form.h" +#include "actions.h" + +#include "georges.h" + +using namespace NLGEORGES; + +namespace GeorgesQt +{ + + CGeorgesFormModel::CGeorgesFormModel(UForm *form, QMap< QString, QStringList> deps, + QString comment, QStringList parents, bool *expanded, QObject *parent) : QAbstractItemModel(parent) + { + m_form = form; + m_rootData << "Value" << "Data" << "Extra";// << "Type"; + m_rootItem = new CFormItem(); + m_dependencies = deps; + m_comments = comment; + m_parents = parents; + m_parentRows = new QList; + m_expanded = expanded; + + setupModelData(); + } + + CGeorgesFormModel::~CGeorgesFormModel() + { + delete m_rootItem; + } + + /******************************************************************************/ + + QVariant CGeorgesFormModel::data(const QModelIndex &p_index, int p_role) const + { + if (!p_index.isValid()) + return QVariant(); + + switch (p_role) + { + case Qt::DisplayRole: + { + return getItem(p_index)->data(p_index.column()); + } + case Qt::DecorationRole: + { + // Based on the _Type return a QIcon from resources. + CFormItem *item = getItem(p_index); + return item->getItemImage(m_rootItem); + } + default: + return QVariant(); + } + } + + /******************************************************************************/ + + CFormItem *CGeorgesFormModel::getItem(const QModelIndex &index) const + { + if (index.isValid()) + { + CFormItem *item = static_cast(index.internalPointer()); + if (item) + return item; + } + return m_rootItem; + } + + /******************************************************************************/ + + bool CGeorgesFormModel::setData(const QModelIndex &index, const QVariant &value, int role) + { + + if (role != Qt::EditRole) + return false; + + CFormItem *item = getItem(index); + + if(!item->isEditable(index.column())) + return false; + + GeorgesEditorForm::UndoStack->push(new CUndoFormArrayRenameCommand(this,item,value)); + + Q_EMIT dataChanged(index, index); + + //setupModelData(); + return true; + } + + /******************************************************************************/ + + Qt::ItemFlags CGeorgesFormModel::flags(const QModelIndex& index) const { + + if (!index.isValid()) + return 0; + + Qt::ItemFlags returnValue = Qt::ItemIsSelectable | Qt::ItemIsEnabled; + + CFormItem *item = getItem(index); + + if(item->isEditable(index.column())) + { + returnValue |= Qt::ItemIsEditable; + } + + return returnValue; + + } + + /******************************************************************************/ + + QVariant CGeorgesFormModel::headerData(int section, + Qt::Orientation orientation, int role) const + { + if (orientation == Qt::Horizontal) + { + if (role == Qt::DisplayRole) + return m_rootItem->data(section); + if (role == Qt::TextAlignmentRole) + return Qt::AlignLeft; + if (section == 0 && role == Qt::DecorationRole) + { + // transparent pixmap as we paint it ourself with tree brach + // if we extend the HeaderView::paintSection for the CE_HeaderLabel + // we could drop this + QPixmap pixmap = QPixmap( + QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize), + QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize)); + // Create new picture for transparent + QPixmap transparent(pixmap.size()); + + // Do transparency + transparent.fill(Qt::transparent); + QPainter p(&transparent); + p.setCompositionMode(QPainter::CompositionMode_Source); + p.drawPixmap(0, 0, pixmap); + p.setCompositionMode(QPainter::CompositionMode_DestinationIn); + // Set transparency level to 150 (possible values are 0-255) + // The alpha channel of a color specifies the transparency effect, + // 0 represents a fully transparent color, while 255 represents + // a fully opaque color. + p.fillRect(transparent.rect(), QColor(0, 0, 0, 0)); + p.end(); + + // Set original picture's reference to new transparent one + pixmap = transparent; + return pixmap; + } + } + return QVariant(); + } + + /******************************************************************************/ + + QModelIndex CGeorgesFormModel::index(int row, int column, const QModelIndex &parent) + const + { + if (!hasIndex(row, column, parent)) + return QModelIndex(); + + CFormItem *parentItem; + + if (!parent.isValid()) + parentItem = m_rootItem; + else + parentItem = static_cast(parent.internalPointer()); + + CFormItem *childItem = parentItem->child(row); + if (childItem) + return createIndex(row, column, childItem); + else + return QModelIndex(); + } + + QModelIndex CGeorgesFormModel::index(int row, int column, CFormItem *item) const + { + if(item == m_rootItem) + return QModelIndex(); + + return createIndex(row, 0, item); + } + + /******************************************************************************/ + + QModelIndex CGeorgesFormModel::parent(const QModelIndex &index) const + { + if (!index.isValid()) + return QModelIndex(); + + CFormItem *childItem = static_cast(index.internalPointer()); + CFormItem *parentItem = childItem->parent(); + + if (parentItem == m_rootItem) + return QModelIndex(); + + return createIndex(parentItem->row(), 0, parentItem); + } + + /******************************************************************************/ + + int CGeorgesFormModel::rowCount(const QModelIndex &parent) const { + + CFormItem *parentItem; + if (parent.column() > 0) + return 0; + + if (!parent.isValid()) + parentItem = m_rootItem; + else + parentItem = static_cast(parent.internalPointer()); + + return parentItem->childCount(); + + } + + /******************************************************************************/ + + int CGeorgesFormModel::columnCount(const QModelIndex &parent) const { + + if (parent.isValid()) + return static_cast(parent.internalPointer())->columnCount(); + else + return m_rootItem->columnCount(); + + } + + /******************************************************************************/ + + void CGeorgesFormModel::loadFormData(UFormElm *root, CFormItem *parent) { + return; + } + + CFormItem *CGeorgesFormModel::addStruct (CFormItem *parent, + NLGEORGES::CFormElmStruct *_struct, + NLGEORGES::CFormDfn *parentDfn, + const char *name, + uint structId, + const char *formName, + uint slot, + bool isVirtual) +{ + // The form pointer + NLGEORGES::CForm *formPtr = static_cast(m_form); + + // Add the new node + CFormItem::TType ttype; + if( isVirtual ) + ttype = CFormItem::TYPE_VSTRUCT; + else + ttype = CFormItem::TYPE_STRUCT; + + CFormItem *newNode = parent->add(CFormItem::Form, name, structId, formName, slot, m_form, ttype ); + + // Can be NULL in virtual DFN + if (parentDfn) + { + // Get the parents + std::vector arrayDfn; + arrayDfn.reserve (parentDfn->countParentDfn ()); + parentDfn->getParentDfn (arrayDfn); + + // For each child + uint elm=0; + for (uint dfn=0; dfngetNumEntry (); i++) + { + // Get the entry ref + NLGEORGES::CFormDfn::CEntry &entry = arrayDfn[dfn]->getEntry (i); + + // Form entry name + std::string entryName = (std::string (formName)+"."+entry.getName ()); + + // Is a struct ? + if ( (entry.getType () == NLGEORGES::UFormDfn::EntryDfn) || (entry.getType () == NLGEORGES::UFormDfn::EntryVirtualDfn) ) + { + // Is an array of struct ? + if (entry.getArrayFlag ()) + { + // Get it from the form + CFormElmArray *nextArray = NULL; + if (_struct && _struct->Elements[elm].Element) + nextArray = NLMISC::safe_cast (_struct->Elements[elm].Element); + + // Else, get it from the parent if we are not a virtual DFN (don't inheritate) + + // todo array of virtual struct + if (!nextArray && (entry.getType () != NLGEORGES::UFormDfn::EntryVirtualDfn) ) + { + // For each parent form + for (uint parent=0; parentgetParentCount (); parent++) + { + // Get the node by name + NLGEORGES::UFormElm *uNode; + if (formPtr->getParent (parent)->getRootNode ().getNodeByName (&uNode, entryName.c_str(), NULL, false) && uNode) + { + nextArray = NLMISC::safe_cast (uNode); + } + } + } + + // Add the new struct + addArray (newNode, nextArray, entry.getDfnPtr (), entry.getName().c_str(), elm, entryName.c_str (), slot); + } + else + { + // Add it + NLGEORGES::CFormElmStruct *nextForm = NULL; + + // Get it from the form + if (_struct && _struct->Elements[elm].Element) + nextForm = NLMISC::safe_cast (_struct->Elements[elm].Element); + + // Else, get it from the parent + if (!nextForm) + { + // For each parent form + for (uint parent=0; parentgetParentCount (); parent++) + { + // Get the node by name + NLGEORGES::UFormElm *uNode; + if (formPtr->getParent (parent)->getRootNode ().getNodeByName (&uNode, entryName.c_str(), NULL, false) && uNode) + { + nextForm = NLMISC::safe_cast (uNode); + } + } + } + + // Virtual Dfn pointer + NLGEORGES::CFormElmVirtualStruct *vStruct = ((entry.getType () == NLGEORGES::UFormDfn::EntryVirtualDfn) && nextForm) ? + NLMISC::safe_cast (nextForm) : NULL; + + NLGEORGES::CFormDfn *tmpDfn = vStruct ? + ((NLGEORGES::CFormDfn*)vStruct->FormDfn) : entry.getDfnPtr(); + // Add the new struct + if( entry.getType() == NLGEORGES::UFormDfn::EntryVirtualDfn ) + addStruct (newNode, nextForm, tmpDfn, entry.getName().c_str(), elm, entryName.c_str(), slot, true); + else + addStruct (newNode, nextForm, tmpDfn, entry.getName().c_str(), elm, entryName.c_str(), slot); + } + } + // Array of type ? + else if ( entry.getArrayFlag () ) + { + NLGEORGES::CFormElmArray *nextArray = NULL; + + // Get it from the form + if (_struct && _struct->Elements[elm].Element) + nextArray = NLMISC::safe_cast (_struct->Elements[elm].Element); + + // Else, get it from the parent + if (!nextArray) + { + // For each parent form + for (uint parent=0; parentgetParentCount (); parent++) + { + // Get the node by name + NLGEORGES::UFormElm *uNode; + if (formPtr->getParent (parent)->getRootNode ().getNodeByName (&uNode, entryName.c_str(), NULL, false) && uNode) + { + nextArray = NLMISC::safe_cast (uNode); + } + } + } + + // Add the new array + addArray ( newNode, nextArray, NULL, entry.getName().c_str(), elm, entryName.c_str(), slot ); + } + + // Next element + elm++; + } + } + } + + return newNode; +} + +// *************************************************************************** + +CFormItem *CGeorgesFormModel::addArray(CFormItem *parent, + NLGEORGES::CFormElmArray *array, + NLGEORGES::CFormDfn *rootDfn, + const char *name, + uint structId, + const char *formName, + uint slot) +{ + // Add the new node + CFormItem *newNode = parent->add (CFormItem::Form, name, structId, formName, slot, m_form, CFormItem::TYPE_ARRAY ); + + // The array exist + if (array) + { + // For each array element + for (uint elm=0; elmElements.size(); elm++) + { + // The form name + char formArrayElmName[512]; + NLMISC::smprintf (formArrayElmName, 512, "%s[%d]", formName, elm); + + // The name + char formArrayName[512]; + if (array->Elements[elm].Name.empty ()) + { + NLMISC::smprintf (formArrayName, 512, "#%d", elm); + } + else + { + NLMISC::smprintf (formArrayName, 512, "%s", array->Elements[elm].Name.c_str()); + } + + // Is a struct + if (rootDfn) + { + // Get struct ptr + NLGEORGES::CFormElmStruct *elmPtr = array->Elements[elm].Element ? static_cast(array->Elements[elm].Element) : NULL; + addStruct (newNode, elmPtr, rootDfn, formArrayName, elm, formArrayElmName, slot); + } + else + { + NLGEORGES::CFormElmArray *elmPtr = array->Elements[elm].Element ? static_cast(array->Elements[elm].Element) : NULL; + addAtom( newNode, elmPtr, rootDfn, formArrayName, elm, formArrayElmName ); + } + } + } + + return newNode; +} + + +CFormItem *CGeorgesFormModel::addAtom(CFormItem *parent, NLGEORGES::CFormElm *elm, NLGEORGES::CFormDfn *dfn, const char *name, uint id, const char *formName) +{ + CFormItem *item = parent->add( CFormItem::Form, name, id, formName, 0, m_form, CFormItem::TYPE_ATOM ); + + return item; +} + + +CFormItem *CGeorgesFormModel::addItem(CFormItem *parent, NLGEORGES::CFormElm *elm, NLGEORGES::CFormDfn *dfn, const char *name, uint id, const char *formName) +{ + CFormItem *item = NULL; + + if( elm->isAtom() ) + item = addAtom(parent, elm, dfn, name, id, formName ); + else + if( elm->isStruct() || elm->isVirtualStruct() ) + { + NLGEORGES::CFormElmStruct *st = static_cast< NLGEORGES::CFormElmStruct* >( elm ); + if( st->isVirtualStruct() ) + item = addStruct(parent, st, st->FormDfn, name, id, formName, 0, true); + else + item = addStruct(parent, st, st->FormDfn, name, id, formName, 0, false); + } + else + if( elm->isArray() ) + { + NLGEORGES::CFormElmArray *arr = static_cast< NLGEORGES::CFormElmArray* >( elm ); + item = addArray(parent, arr, arr->FormDfn, name, id, formName, 0 ); + } + + return item; +} + +void CGeorgesFormModel::arrayResized( const QString &name, int size ) +{ + CFormItem *item = m_rootItem->findItem( name ); + if( item == NULL ) + return; + + NLGEORGES::UFormElm *elm = NULL; + + item->form()->getRootNode().getNodeByName( &elm, name.toUtf8().constData() ); + + if( elm == NULL ) + return; + + NLGEORGES::CFormElmArray *celm = dynamic_cast< NLGEORGES::CFormElmArray* >( elm ); + if( celm == NULL ) + return; + + item->clearChildren(); + + for( int i = 0; i < celm->Elements.size(); i++ ) + { + NLGEORGES::CFormElmArray::CElement &e = celm->Elements[ i ]; + + QString formName = name; + formName += '['; + formName += QString::number( i ); + formName += ']'; + + QString n; + if( e.Name.empty() ) + n = "#" + QString::number( i ); + else + n = e.Name.c_str(); + + NLGEORGES::UFormDfn *udfn = e.Element->getStructDfn(); + NLGEORGES::CFormDfn *cdfn = static_cast< NLGEORGES::CFormDfn* >( udfn ); + addItem( item, e.Element, cdfn, n.toUtf8().constData(), i, formName.toUtf8().constData() ); + } + + if( celm->Elements.size() == 0 ) + { + NLGEORGES::CFormElmStruct *ps = dynamic_cast< NLGEORGES::CFormElmStruct* >( celm->getParent() ); + if( ps != NULL ) + { + const NLGEORGES::CFormDfn *parentDfn; + const NLGEORGES::CFormDfn *nodeDfn; + uint indexDfn; + const NLGEORGES::CType *nodeType; + NLGEORGES::CFormElm *node; + NLGEORGES::CFormDfn::TEntryType type; + bool isArray; + + ps->deleteNodeByName( item->name().c_str(), &parentDfn, indexDfn, &nodeDfn, &nodeType, &node, type, isArray ); + } + } +} + +void CGeorgesFormModel::appendArray( QModelIndex idx ) +{ + if( !idx.isValid() ) + return; + + CFormItem *item = reinterpret_cast< CFormItem* >( idx.internalPointer() ); + NLGEORGES::UFormElm *elm = NULL; + + item->form()->getRootNode().getNodeByName( &elm, item->formName().c_str() ); + + const NLGEORGES::CFormDfn *parentDfn; + const NLGEORGES::CFormDfn *nodeDfn; + uint indexDfn; + const NLGEORGES::CType *type; + NLGEORGES::UFormDfn::TEntryType entryType; + NLGEORGES::CFormElm *node; + bool created; + bool isArray; + + if( elm == NULL ) + { + NLGEORGES::UFormElm *uroot = &item->form()->getRootNode(); + NLGEORGES::CFormElm *croot = static_cast< NLGEORGES::CFormElm* >( uroot ); + + croot->createNodeByName( item->formName().c_str(), &parentDfn, indexDfn, &nodeDfn, &type, &node, entryType, isArray, created ); + + if( !created ) + return; + + elm = node; + } + + NLGEORGES::CFormElmArray *celm = dynamic_cast< NLGEORGES::CFormElmArray* >( elm ); + if( celm == NULL ) + return; + + unsigned long s = celm->Elements.size(); + std::string nodeIdx = "["; + nodeIdx += QString::number( s ).toUtf8().constData(); + nodeIdx += "]"; + + celm->createNodeByName( nodeIdx.c_str(), &parentDfn, indexDfn, &nodeDfn, &type, &node, entryType, isArray, created ); + if( !created ) + return; + + std::string name = "#"; + name += QString::number( s ).toUtf8().constData(); + + std::string formName; + node->getFormName( formName ); + + NLGEORGES::CFormDfn *cdfn = const_cast< NLGEORGES::CFormDfn* >( nodeDfn ); + addItem( item, node, cdfn, name.c_str(), s, formName.c_str() ); + +} + +void CGeorgesFormModel::deleteArrayEntry( QModelIndex idx ) +{ + CFormItem *item = reinterpret_cast< CFormItem* >( idx.internalPointer() ); + NLGEORGES::UFormElm &uroot = item->form()->getRootNode(); + NLGEORGES::CFormElm *root = static_cast< NLGEORGES::CFormElm* >( &item->form()->getRootNode() ); + NLGEORGES::UFormElm *unode; + uroot.getNodeByName( &unode, item->formName().c_str() ); + NLGEORGES::CFormElm *cnode = static_cast< NLGEORGES::CFormElm* >( unode ); + NLGEORGES::CFormElmArray *arr = static_cast< NLGEORGES::CFormElmArray* >( cnode->getParent() ); + + NLGEORGES::CFormElm *elm = arr->Elements[ idx.row() ].Element; + + Q_EMIT beginResetModel(); + + std::vector< NLGEORGES::CFormElmArray::CElement >::iterator itr = arr->Elements.begin() + idx.row(); + arr->Elements.erase( itr ); + + delete elm; + + item = item->parent(); + item->clearChildren(); + + NLGEORGES::CFormElmArray *celm = arr; + + for( int i = 0; i < celm->Elements.size(); i++ ) + { + NLGEORGES::CFormElmArray::CElement &e = celm->Elements[ i ]; + + QString formName = item->formName().c_str(); + formName += '['; + formName += QString::number( i ); + formName += ']'; + + QString n; + if( e.Name.empty() ) + n = "#" + QString::number( i ); + else + n = e.Name.c_str(); + + NLGEORGES::UFormDfn *udfn = e.Element->getStructDfn(); + NLGEORGES::CFormDfn *cdfn = static_cast< NLGEORGES::CFormDfn* >( udfn ); + addItem( item, e.Element, cdfn, n.toUtf8().constData(), i, formName.toUtf8().constData() ); + } + + Q_EMIT endResetModel(); +} + +void CGeorgesFormModel::renameArrayEntry( QModelIndex idx, const QString &name ) +{ + CFormItem *item = static_cast< CFormItem* >( idx.internalPointer() ); + + NLGEORGES::UFormElm *elm; + + item->form()->getRootNode().getNodeByName( &elm, item->formName().c_str() ); + + NLGEORGES::CFormElm *celm = dynamic_cast< NLGEORGES::CFormElm* >( elm ); + if( celm == NULL ) + return; + + NLGEORGES::UFormElm *uparent = celm->getParent(); + NLGEORGES::CFormElmArray *cparent = dynamic_cast< NLGEORGES::CFormElmArray* >( uparent ); + if( cparent == NULL ) + return; + + int i = 0; + for( i = 0; i < cparent->Elements.size(); i++ ) + { + if( cparent->Elements[ i ].Element == celm ) + break; + } + + cparent->Elements[ i ].Name = name.toUtf8().constData(); + item->setName( name.toUtf8().constData() ); +} + +void CGeorgesFormModel::changeVStructDfn( QModelIndex idx ) +{ + CFormItem *item = static_cast< CFormItem* >( idx.internalPointer() ); + + QString vstruct = item->formName().c_str(); + + NLGEORGES::UFormElm *uelm = NULL; + m_form->getRootNode().getNodeByName( &uelm, vstruct.toUtf8().constData() ); + + if( uelm == NULL ) + return; + + NLGEORGES::CFormElmVirtualStruct *vs = static_cast< NLGEORGES::CFormElmVirtualStruct* >( uelm ); + + CGeorges g; + NLGEORGES::UFormDfn *udfn = g.loadFormDfn( vs->DfnFilename ); + if( udfn == NULL ) + return; + + NLGEORGES::CFormDfn *cdfn = static_cast< NLGEORGES::CFormDfn* >( udfn ); + vs->build( cdfn ); + + + beginResetModel(); + + CFormItem *parent = item->parent(); + int row = idx.row(); + QString name = item->name().c_str(); + QString formName = item->formName().c_str(); + parent->removeChild( row ); + + addItem( parent, vs, cdfn, name.toUtf8().constData(), row, formName.toUtf8().constData() ); + + endResetModel(); +} + + /******************************************************************************/ + + void CGeorgesFormModel::loadFormHeader() + { + + /* if (m_parents.size()) + { + CFormItem *fi_pars = new CFormItem(m_rootElm, QList() << "parents" << "" << "", m_rootItem); + m_rootItem->appendChild(fi_pars); + + Q_FOREACH(QString str, m_parents) + { + fi_pars->appendChild(new CFormItem(m_rootElm, QList() << str << "" << "", fi_pars)); + } + }*/ + + /*QStringList dfns = _dependencies["dfn"]; + QStringList typs = _dependencies["typ"]; + + _dependencies.remove("dfn"); + _dependencies.remove("typ"); + + CFormItem *fi_dep = new CFormItem(_rootElm, QList() << "dependencies", _rootItem); + _rootItem->appendChild(fi_dep); + + if (!dfns.isEmpty()) { + CFormItem *fi_dfn = new CFormItem(_rootElm, QList() << "dfn", fi_dep); + fi_dep->appendChild(fi_dfn); + foreach(QString str, dfns) { + fi_dfn->appendChild(new CFormItem(_rootElm, QList() << str, fi_dfn)); + } + } + if (!typs.isEmpty()) { + CFormItem *fi_typ = new CFormItem(_rootElm, QList() << "typ", fi_dep); + fi_dep->appendChild(fi_typ); + foreach(QString str, typs) { + fi_typ->appendChild(new CFormItem(_rootElm, QList() << str, fi_typ)); + } + } + if (!_dependencies.isEmpty()) { + CFormItem *fi_other = new CFormItem(_rootElm, QList() << "other", fi_dep); + fi_dep->appendChild(fi_other); + foreach(QStringList list, _dependencies) { + foreach(QString str, list) { + fi_other->appendChild(new CFormItem(_rootElm, QList() << str, fi_other)); + } + } + }*/ + } + + /******************************************************************************/ + + void CGeorgesFormModel::setupModelData() + { + m_rootElm = &((NLGEORGES::CForm*)m_form)->Elements; + NLGEORGES::CFormElmStruct *rootstruct = &((NLGEORGES::CForm*)m_form)->Elements; + //loadFormHeader(); + addStruct(m_rootItem, rootstruct, rootstruct->FormDfn, "Content", 0xffffffff, "", 0); + //loadFormData(m_rootElm, m_rootItem); + } + + /******************************************************************************/ + + void CGeorgesFormModel::setShowParents( bool show ) { + m_showParents = show; + Q_EMIT layoutAboutToBeChanged(); + Q_EMIT layoutChanged(); + } + void CGeorgesFormModel::setShowDefaults( bool show ) + { + m_showDefaults = show; + Q_EMIT layoutAboutToBeChanged(); + Q_EMIT layoutChanged(); + } + + void CGeorgesFormModel::addParentForm(QString parentForm) + { + beginResetModel(); + m_parents.push_back(parentForm); + delete m_rootItem; + m_rootItem = new CFormItem(); + setupModelData(); + endResetModel(); + } + + void CGeorgesFormModel::removeParentForm(QString parentForm) + { + beginResetModel(); + m_parents.removeOne(parentForm); + + delete m_rootItem; + m_rootItem = new CFormItem(); + setupModelData(); + endResetModel(); + } +} /* namespace GeorgesQt */ + +/* end of file */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_model.h b/code/studio/src/plugins/georges_editor/georgesform_model.h similarity index 65% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_model.h rename to code/studio/src/plugins/georges_editor/georgesform_model.h index 710598236..7d6bac3f3 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_model.h +++ b/code/studio/src/plugins/georges_editor/georgesform_model.h @@ -27,6 +27,10 @@ namespace NLGEORGES { class UFormElm; + class UForm; + class CFormElmStruct; + class CFormDfn; + class CFormElmArray; } namespace GeorgesQt @@ -36,9 +40,8 @@ namespace GeorgesQt class CGeorgesFormModel : public QAbstractItemModel { - public: - CGeorgesFormModel(NLGEORGES::UFormElm *root, QMap< QString, QStringList> deps, + CGeorgesFormModel(NLGEORGES::UForm *form, QMap< QString, QStringList> deps, QString comment, QStringList parents, bool* expanded, QObject *parent = 0); ~CGeorgesFormModel(); @@ -47,6 +50,7 @@ namespace GeorgesQt Qt::ItemFlags flags(const QModelIndex &index) const; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; + QModelIndex index(int row, int column, CFormItem *item) const; QModelIndex parent(const QModelIndex &index) const; int rowCount(const QModelIndex &parent = QModelIndex()) const; int columnCount(const QModelIndex &parent = QModelIndex()) const; @@ -58,15 +62,37 @@ namespace GeorgesQt void setShowDefaults( bool show ); void addParentForm(QString parentForm); void removeParentForm(QString parentForm); - NLGEORGES::UFormElm *getRootForm() { return m_rootElm; } + NLGEORGES::UFormElm *getRootForm() { return m_rootElm; } + + CFormItem *addStruct (CFormItem *parent, NLGEORGES::CFormElmStruct *_struct, NLGEORGES::CFormDfn *parentDfn, + const char *name, uint structId, const char *formName, uint slot, bool isVirtual = false ); + + CFormItem *addArray(CFormItem *parent, NLGEORGES::CFormElmArray *array, NLGEORGES::CFormDfn *rootDfn, + const char *name, uint structId, const char *formName, uint slot); + + CFormItem *addAtom(CFormItem *parent, NLGEORGES::CFormElm *elm, NLGEORGES::CFormDfn *dfn, const char *name, uint id, const char *formName); + + CFormItem *addItem(CFormItem *parent, NLGEORGES::CFormElm *elm, NLGEORGES::CFormDfn *dfn, const char *name, uint id, const char *formName); + + void emitDataChanged(const QModelIndex &index) + { + Q_EMIT dataChanged(index, index); + } + + void arrayResized( const QString &name, int size ); + void appendArray( QModelIndex idx ); + void deleteArrayEntry( QModelIndex idx ); + void renameArrayEntry( QModelIndex idx, const QString &name ); + void changeVStructDfn( QModelIndex idx ); private: void setupModelData(); void loadFormData(NLGEORGES::UFormElm *rootElm, CFormItem *parent); void loadFormHeader(); + NLGEORGES::UForm* m_form; CFormItem* m_rootItem; - NLGEORGES::UFormElm* m_rootElm; + NLGEORGES::UFormElm* m_rootElm; QList m_rootData; QMap< QString, QStringList> m_dependencies; QString m_comments; @@ -82,3 +108,5 @@ namespace GeorgesQt } /* namespace GeorgesQt */ #endif // GEORGESFORM_MODEL_H + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_proxy_model.cpp b/code/studio/src/plugins/georges_editor/georgesform_proxy_model.cpp similarity index 98% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_proxy_model.cpp rename to code/studio/src/plugins/georges_editor/georgesform_proxy_model.cpp index 2792699b0..81179f61c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_proxy_model.cpp +++ b/code/studio/src/plugins/georges_editor/georgesform_proxy_model.cpp @@ -14,15 +14,17 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -#include "stdpch.h" -#include "georgesform_proxy_model.h" -#include "formitem.h" -#include "georgesform_model.h" - // NeL includes #include #include +// project includes +#include "formitem.h" +#include "georgesform_proxy_model.h" +#include "georgesform_model.h" + +#if 0 + namespace GeorgesQt { @@ -78,4 +80,5 @@ namespace GeorgesQt } } /* namespace GeorgesQt */ +#endif // 0 /* end of file */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_proxy_model.h b/code/studio/src/plugins/georges_editor/georgesform_proxy_model.h similarity index 98% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_proxy_model.h rename to code/studio/src/plugins/georges_editor/georgesform_proxy_model.h index cfe7fcca6..f4c968f80 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georgesform_proxy_model.h +++ b/code/studio/src/plugins/georges_editor/georgesform_proxy_model.h @@ -20,6 +20,7 @@ // Qt includes #include +#if 0 namespace GeorgesQt { @@ -41,5 +42,5 @@ namespace GeorgesQt };/* class CGeorgesFormProxyModel */ } /* namespace GeorgesQt */ - +#endif // 0 #endif // GEORGESFORM_PROXY_MODEL_H diff --git a/code/studio/src/plugins/georges_editor/images/array.ico b/code/studio/src/plugins/georges_editor/images/array.ico new file mode 100644 index 000000000..923bec0bd Binary files /dev/null and b/code/studio/src/plugins/georges_editor/images/array.ico differ diff --git a/code/studio/src/plugins/georges_editor/images/header.ico b/code/studio/src/plugins/georges_editor/images/header.ico new file mode 100644 index 000000000..5ebb3632a Binary files /dev/null and b/code/studio/src/plugins/georges_editor/images/header.ico differ diff --git a/code/studio/src/plugins/georges_editor/images/hold.ico b/code/studio/src/plugins/georges_editor/images/hold.ico new file mode 100644 index 000000000..4b7f115f1 Binary files /dev/null and b/code/studio/src/plugins/georges_editor/images/hold.ico differ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/images/ic_nel_georges_editor.png b/code/studio/src/plugins/georges_editor/images/ic_nel_georges_editor.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/images/ic_nel_georges_editor.png rename to code/studio/src/plugins/georges_editor/images/ic_nel_georges_editor.png diff --git a/code/studio/src/plugins/georges_editor/images/root.ico b/code/studio/src/plugins/georges_editor/images/root.ico new file mode 100644 index 000000000..3fa430766 Binary files /dev/null and b/code/studio/src/plugins/georges_editor/images/root.ico differ diff --git a/code/studio/src/plugins/georges_editor/images/struct.ico b/code/studio/src/plugins/georges_editor/images/struct.ico new file mode 100644 index 000000000..7e2244dc3 Binary files /dev/null and b/code/studio/src/plugins/georges_editor/images/struct.ico differ diff --git a/code/studio/src/plugins/georges_editor/images/vstruct.ico b/code/studio/src/plugins/georges_editor/images/vstruct.ico new file mode 100644 index 000000000..a184d8a37 Binary files /dev/null and b/code/studio/src/plugins/georges_editor/images/vstruct.ico differ diff --git a/code/studio/src/plugins/georges_editor/images/zfee51.ico b/code/studio/src/plugins/georges_editor/images/zfee51.ico new file mode 100644 index 000000000..ad6bbb756 Binary files /dev/null and b/code/studio/src/plugins/georges_editor/images/zfee51.ico differ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/stdpch.cpp b/code/studio/src/plugins/georges_editor/stdpch.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/stdpch.cpp rename to code/studio/src/plugins/georges_editor/stdpch.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/stdpch.h b/code/studio/src/plugins/georges_editor/stdpch.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/stdpch.h rename to code/studio/src/plugins/georges_editor/stdpch.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/ovqt_plugin_georges_editor.xml b/code/studio/src/plugins/georges_editor/studio_plugin_georges_editor.xml similarity index 77% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/ovqt_plugin_georges_editor.xml rename to code/studio/src/plugins/georges_editor/studio_plugin_georges_editor.xml index a1972dded..700373bf3 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/ovqt_plugin_georges_editor.xml +++ b/code/studio/src/plugins/georges_editor/studio_plugin_georges_editor.xml @@ -1,5 +1,5 @@ - ovqt_plugin_georges_editor + studio_plugin_georges_editor GeorgesEditor 0.4 aquiles diff --git a/code/studio/src/plugins/georges_editor/typ_browser_ctrl.cpp b/code/studio/src/plugins/georges_editor/typ_browser_ctrl.cpp new file mode 100644 index 000000000..5c234100d --- /dev/null +++ b/code/studio/src/plugins/georges_editor/typ_browser_ctrl.cpp @@ -0,0 +1,198 @@ +// Ryzom Core Studio - Georges Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 "typ_browser_ctrl.h" + +#include "3rdparty/qtpropertybrowser/qttreepropertybrowser.h" +#include "3rdparty/qtpropertybrowser/qtvariantproperty.h" +#include "3rdparty/qtpropertybrowser/qtpropertymanager.h" +#include "3rdparty/qtpropertybrowser/qteditorfactory.h" + +#include "nel/georges/type.h" + +namespace +{ + QString typeToString( int v ) + { + QString s; + + switch( v ) + { + case NLGEORGES::UType::UnsignedInt: s = "UnsignedInt"; break; + case NLGEORGES::UType::SignedInt: s = "SignedInt"; break; + case NLGEORGES::UType::Double: s = "Double"; break; + case NLGEORGES::UType::String: s = "String"; break; + case NLGEORGES::UType::Color: s = "Color"; break; + } + + return s; + } + + QString uitypeToString( int v ) + { + QString s; + + switch( v ) + { + case NLGEORGES::CType::Edit: s = "Edit"; break; + case NLGEORGES::CType::EditSpin: s = "EditSpin"; break; + case NLGEORGES::CType::NonEditableCombo: s = "NonEditableCombo"; break; + case NLGEORGES::CType::FileBrowser: s = "FileBrowser"; break; + case NLGEORGES::CType::BigEdit: s = "BigEdit"; break; + case NLGEORGES::CType::ColorEdit: s = "ColorEdit"; break; + case NLGEORGES::CType::IconWidget: s = "IconWidget"; break; + } + + return s; + } +} + +TypBrowserCtrl::TypBrowserCtrl( QObject *parent ) : +QObject( parent ) +{ + m_typ = NULL; + + m_variantMgr = new QtVariantPropertyManager( this ); + m_variantFactory = new QtVariantEditorFactory( this ); + m_enumMgr = new QtEnumPropertyManager( this ); + m_enumFactory = new QtEnumEditorFactory( this ); +} + +TypBrowserCtrl::~TypBrowserCtrl() +{ + m_typ = NULL; + m_variantMgr = NULL; + m_variantFactory = NULL; + m_enumMgr = NULL; + m_enumFactory = NULL; +} + +void TypBrowserCtrl::load() +{ + m_browser->clear(); + m_browser->setFactoryForManager( m_variantMgr, m_variantFactory ); + m_browser->setFactoryForManager( m_enumMgr, m_enumFactory ); + + m_typ->Type; + m_typ->UIType; + + QtProperty *p = NULL; + + p = m_enumMgr->addProperty( "type" ); + QStringList l; + l.push_back( "UnsignedInt" ); + l.push_back( "SignedInt" ); + l.push_back( "Double" ); + l.push_back( "String" ); + l.push_back( "Color" ); + m_enumMgr->setEnumNames( p, l ); + m_enumMgr->setValue( p, m_typ->Type ); + m_browser->addProperty( p ); + + p = m_enumMgr->addProperty( "uitype" ); + l.clear(); + l.push_back( "Edit" ); + l.push_back( "EditSpin" ); + l.push_back( "NonEditableCombo" ); + l.push_back( "FileBrowser" ); + l.push_back( "BigEdit" ); + l.push_back( "ColorEdit" ); + l.push_back( "IconWidget" ); + m_enumMgr->setEnumNames( p, l ); + m_enumMgr->setValue( p, m_typ->UIType ); + m_browser->addProperty( p ); + + + QtVariantProperty *vp = NULL; + + vp = m_variantMgr->addProperty( QVariant::String, "default" ); + vp->setValue( m_typ->Default.c_str() ); + m_browser->addProperty( vp ); + + vp = m_variantMgr->addProperty( QVariant::String, "min" ); + vp->setValue( m_typ->Min.c_str() ); + m_browser->addProperty( vp ); + + vp = m_variantMgr->addProperty( QVariant::String, "max" ); + vp->setValue( m_typ->Max.c_str() ); + m_browser->addProperty( vp ); + + vp = m_variantMgr->addProperty( QVariant::String, "increment" ); + vp->setValue( m_typ->Increment.c_str() ); + m_browser->addProperty( vp ); + + enableMgrConnections(); +} + +void TypBrowserCtrl::onVariantValueChanged( QtProperty *p, const QVariant &v ) +{ + QString n = p->propertyName(); + if( n == "default" ) + { + m_typ->Default = v.toString().toUtf8().constData(); + } + else + if( n == "min" ) + { + m_typ->Min = v.toString().toUtf8().constData(); + } + else + if( n == "max" ) + { + m_typ->Max = v.toString().toUtf8().constData(); + } + else + if( n == "increment" ) + { + m_typ->Increment = v.toString().toUtf8().constData(); + } + else + return; + + Q_EMIT modified( n, v.toString().toUtf8().constData() ); +} + +void TypBrowserCtrl::onEnumValueChanged( QtProperty *p, int v ) +{ + QString n = p->propertyName(); + QString value; + + if( n == "type" ) + { + m_typ->Type = NLGEORGES::UType::TType( v ); + value = typeToString( v ); + } + else + if( n == "uitype" ) + { + m_typ->UIType = NLGEORGES::CType::TUI( v ); + value = uitypeToString( v ); + } + else + return; + + Q_EMIT modified( n, value ); +} + +void TypBrowserCtrl::enableMgrConnections() +{ + connect( m_variantMgr, SIGNAL( valueChanged( QtProperty*, const QVariant& ) ), this, SLOT( onVariantValueChanged( QtProperty*, const QVariant& ) ) ); + connect( m_enumMgr, SIGNAL( valueChanged( QtProperty*, int ) ), this, SLOT( onEnumValueChanged( QtProperty*, int ) ) ); +} + + diff --git a/code/studio/src/plugins/georges_editor/typ_browser_ctrl.h b/code/studio/src/plugins/georges_editor/typ_browser_ctrl.h new file mode 100644 index 000000000..58718f5aa --- /dev/null +++ b/code/studio/src/plugins/georges_editor/typ_browser_ctrl.h @@ -0,0 +1,69 @@ +// Ryzom Core Studio - Georges Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 TYP_BROWSER_CTRL +#define TYP_BROWSER_CTRL + +#include + +class QtVariantPropertyManager; +class QtVariantEditorFactory; +class QtTreePropertyBrowser; +class QtEnumPropertyManager; +class QtEnumEditorFactory; +class QVariant; +class QtProperty; + +namespace NLGEORGES +{ + class CType; +} + +class TypBrowserCtrl : public QObject +{ + Q_OBJECT +public: + TypBrowserCtrl( QObject *parent = NULL ); + ~TypBrowserCtrl(); + + void load(); + + void setTyp( NLGEORGES::CType *typ ){ m_typ = typ; } + void setBrowser( QtTreePropertyBrowser *browser ){ m_browser = browser; } + +Q_SIGNALS: + void modified( const QString &k, const QString &v ); + +private Q_SLOTS: + void onVariantValueChanged( QtProperty *p, const QVariant &v ); + void onEnumValueChanged( QtProperty *p, int v ); + +private: + void enableMgrConnections(); + + NLGEORGES::CType *m_typ; + QtTreePropertyBrowser *m_browser; + + QtVariantPropertyManager *m_variantMgr; + QtVariantEditorFactory *m_variantFactory; + QtEnumPropertyManager *m_enumMgr; + QtEnumEditorFactory *m_enumFactory; + +}; + +#endif diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/CMakeLists.txt b/code/studio/src/plugins/gui_editor/CMakeLists.txt similarity index 57% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/CMakeLists.txt rename to code/studio/src/plugins/gui_editor/CMakeLists.txt index fd1283db8..f2f5bfcb1 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/CMakeLists.txt +++ b/code/studio/src/plugins/gui_editor/CMakeLists.txt @@ -4,6 +4,8 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${QT_INCLUDES} ${LUA_INCLUDE_DIR}) +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/gui_editor_config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/gui_editor_config.h) + FILE(GLOB SRC *.cpp *.h) SET(OVQT_EXT_SYS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin.h @@ -24,13 +26,19 @@ SET(OVQT_PLUGIN_GUI_EDITOR_HDR action_editor.h property_browser_ctrl.h project_window.h - nel3d_widget.h - nelgui_widget.h + nelgui_ctrl.h new_property_widget.h new_widget_widget.h add_widget_widget.h editor_selection_watcher.h editor_message_processor.h + action_list.h + texture_chooser.h + action_property_manager.h + texture_property_manager.h + expression_editor.h + expr_link_dlg.h + new_gui_dlg.h ) SET(OVQT_PLUGIN_GUI_EDITOR_UIS @@ -46,6 +54,11 @@ SET(OVQT_PLUGIN_GUI_EDITOR_UIS new_property_widget.ui new_widget_widget.ui add_widget_widget.ui + action_list.ui + texture_chooser.ui + expression_editor.ui + expr_link_dlg.ui + new_gui_dlg.ui ) SET(QT_USE_QTGUI TRUE) @@ -61,7 +74,7 @@ SOURCE_GROUP(QtGeneratedMocQrcSrc FILES ${OVQT_PLUGIN_GUI_EDITOR_MOC_SRC} OVQT_P SOURCE_GROUP("GUI Editor Plugin" FILES ${SRC}) SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) -ADD_LIBRARY(ovqt_plugin_gui_editor MODULE ${SRC} +ADD_LIBRARY(studio_plugin_gui_editor MODULE ${SRC} ${OVQT_PLUGIN_GUI_EDITOR_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUGIN_GUI_EDITOR_UI_HDRS} @@ -69,8 +82,8 @@ ADD_LIBRARY(ovqt_plugin_gui_editor MODULE ${SRC} ) TARGET_LINK_LIBRARIES( - ovqt_plugin_gui_editor - ovqt_plugin_core + studio_plugin_gui_editor + studio_plugin_core nelmisc nel3d nelgui @@ -80,24 +93,32 @@ TARGET_LINK_LIBRARIES( qt_property_browser ) -NL_DEFAULT_PROPS(ovqt_plugin_gui_editor "NeL, Tools, 3D: Object Viewer Qt Plugin: GUI Editor") -NL_ADD_RUNTIME_FLAGS(ovqt_plugin_gui_editor) -NL_ADD_LIB_SUFFIX(ovqt_plugin_gui_editor) +NL_DEFAULT_PROPS(studio_plugin_gui_editor "Tools: Studio Plugin: GUI Editor") +NL_ADD_RUNTIME_FLAGS(studio_plugin_gui_editor) +NL_ADD_LIB_SUFFIX(studio_plugin_gui_editor) ADD_DEFINITIONS(-DGUI_EDITOR_LIBRARY ${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) IF(WIN32) IF(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_gui_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_gui_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) ELSE(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_gui_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_gui_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) ENDIF(WITH_INSTALL_LIBRARIES) ELSE(WIN32) IF(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_gui_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_gui_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) ELSE(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_gui_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_gui_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) ENDIF(WITH_INSTALL_LIBRARIES) ENDIF(WIN32) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_gui_editor.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/studio_plugin_gui_editor.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) + +FILE(GLOB widgets "${CMAKE_CURRENT_SOURCE_DIR}/widgets/*.xml") +FILE(GLOB expressions "${CMAKE_CURRENT_SOURCE_DIR}/expressions/*.xml") + +INSTALL(FILES ${widgets} DESTINATION "${OVQT_DATA_DIR}/widgets" COMPONENT tools3d) +INSTALL(FILES ${expressions} DESTINATION "${OVQT_DATA_DIR}/expressions" COMPONENT tools3d) + +INSTALL(DIRECTORY fonts/ DESTINATION ${OVQT_DATA_DIR} COMPONENT data) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/action_editor.cpp b/code/studio/src/plugins/gui_editor/action_editor.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/action_editor.cpp rename to code/studio/src/plugins/gui_editor/action_editor.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/action_editor.h b/code/studio/src/plugins/gui_editor/action_editor.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/action_editor.h rename to code/studio/src/plugins/gui_editor/action_editor.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/action_editor.ui b/code/studio/src/plugins/gui_editor/action_editor.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/action_editor.ui rename to code/studio/src/plugins/gui_editor/action_editor.ui diff --git a/code/studio/src/plugins/gui_editor/action_list.cpp b/code/studio/src/plugins/gui_editor/action_list.cpp new file mode 100644 index 000000000..4cc30aecb --- /dev/null +++ b/code/studio/src/plugins/gui_editor/action_list.cpp @@ -0,0 +1,49 @@ +#include "action_list.h" +#include "nel/gui/action_handler.h" +#include +#include + +ActionList::ActionList( QDialog *parent ) : +QDialog( parent ) +{ + setupUi( this ); +} + +ActionList::~ActionList() +{ +} + +void ActionList::load() +{ + actionList->clear(); + + NLGUI::CAHManager *am = NLGUI::CAHManager::getInstance(); + std::vector< std::string > handlers; + am->getActionHandlers( handlers ); + + std::vector< std::string >::const_iterator itr = handlers.begin(); + while( itr != handlers.end() ) + { + actionList->addItem( itr->c_str() ); + ++itr; + } +} + +void ActionList::accept() +{ + QListWidgetItem *item = actionList->currentItem(); + if( item == NULL ) + return; + + selectedAction = item->text(); + + QDialog::accept(); +} + +void ActionList::reject() +{ + selectedAction = ""; + + QDialog::reject(); +} + diff --git a/code/studio/src/plugins/gui_editor/action_list.h b/code/studio/src/plugins/gui_editor/action_list.h new file mode 100644 index 000000000..f61e0d239 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/action_list.h @@ -0,0 +1,29 @@ +#ifndef ACTION_LIST_H +#define ACTION_LIST_H + + +#include "ui_action_list.h" +#include + + +class ActionList : public QDialog, public Ui::ActionListDialog +{ + Q_OBJECT + +public: + ActionList( QDialog *parent = NULL ); + ~ActionList(); + void load(); + + QString getSelectedAction(){ return selectedAction; } + + +public Q_SLOTS: + void accept(); + void reject(); + +private: + QString selectedAction; +}; + +#endif diff --git a/code/studio/src/plugins/gui_editor/action_list.ui b/code/studio/src/plugins/gui_editor/action_list.ui new file mode 100644 index 000000000..ba147cfc2 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/action_list.ui @@ -0,0 +1,94 @@ + + + ActionListDialog + + + + 0 + 0 + 359 + 258 + + + + Action List + + + + + + + + + 6 + + + 0 + + + + + Qt::Horizontal + + + + 131 + 31 + + + + + + + + OK + + + + + + + Cancel + + + + + + + + + + + okButton + clicked() + ActionListDialog + accept() + + + 278 + 253 + + + 96 + 254 + + + + + cancelButton + clicked() + ActionListDialog + reject() + + + 369 + 253 + + + 179 + 282 + + + + + diff --git a/code/studio/src/plugins/gui_editor/action_property_manager.cpp b/code/studio/src/plugins/gui_editor/action_property_manager.cpp new file mode 100644 index 000000000..9e7690a56 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/action_property_manager.cpp @@ -0,0 +1,333 @@ +// Ryzom Core Studio GUI Editor plugin +// 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 "action_property_manager.h" +#include "action_list.h" +#include +#include +#include +#include +#include + + +////////////////////////////////////////////////////////////////// Manager /////////////////////////////////////////////////////////////////////////// + + +struct ActionPropertyManagerPrivate +{ + QMap< const QtProperty*, QString > values; +}; + +ActionPropertyManager::ActionPropertyManager( QObject *parent ) : +QtAbstractPropertyManager( parent ) +{ + d_ptr = new ActionPropertyManagerPrivate(); +} + +ActionPropertyManager::~ActionPropertyManager() +{ + delete d_ptr; + d_ptr = NULL; +} + +QString ActionPropertyManager::value( const QtProperty *p ) const +{ + return valueText( p ); +} + +void ActionPropertyManager::setValue( QtProperty *p, const QString &value ) +{ + if( !d_ptr->values.contains( p ) ) + return; + + if( d_ptr->values[ p ] == value ) + return; + + d_ptr->values[ p ] = value; + + Q_EMIT propertyChanged( p ); + Q_EMIT valueChanged( p, value ); +} + +bool ActionPropertyManager::hasValue( const QtProperty *p ) const +{ + return d_ptr->values.contains( p ); +} + +QString ActionPropertyManager::valueText( const QtProperty *p ) const +{ + if( !d_ptr->values.contains( p ) ) + return ""; + + return d_ptr->values[ p ]; +} + +void ActionPropertyManager::initializeProperty( QtProperty *p ) +{ + if( d_ptr->values.contains( p ) ) + return; + + d_ptr->values[ p ] = ""; +} + +void ActionPropertyManager::uninitializeProperty( QtProperty *p ) +{ + d_ptr->values.remove( p ); +} + + + +//////////////////////////////////////////////////////////////////// Factory /////////////////////////////////////////////////////////////////////// + + + +struct ActionEditorFactoryPrivate +{ + QMap< QtProperty*, QList< ActionPropertyEditor* > > createdEditors; + QMap< ActionPropertyEditor*, QtProperty* > editorToProperty; + + ~ActionEditorFactoryPrivate() + { + createdEditors.clear(); + + QMap< ActionPropertyEditor*, QtProperty* >::iterator itr = editorToProperty.begin(); + while( itr != editorToProperty.end() ) + { + delete itr.key(); + ++itr; + } + editorToProperty.clear(); + } + + void addEditor( QtProperty *p, ActionPropertyEditor *editor ) + { + QMap< QtProperty*, QList< ActionPropertyEditor* > >::iterator itr = createdEditors.find( p ); + + if( itr != createdEditors.end() ) + { + itr->push_back( editor ); + } + else + { + QList< ActionPropertyEditor* > l; + l.push_back( editor ); + createdEditors.insert( p, l ); + } + + editorToProperty.insert( editor, p ); + } + + void removeEditor( QObject *o ) + { + // Remove from editorToProperty first + QMap< ActionPropertyEditor*, QtProperty* >::iterator itr1 = editorToProperty.begin(); + while( itr1 != editorToProperty.end() ) + { + if( itr1.key() == o ) + break; + + ++itr1; + } + if( itr1 != editorToProperty.end() ) + editorToProperty.erase( itr1 ); + + // Then from createdEditors + QMap< QtProperty*, QList< ActionPropertyEditor* > >::iterator itr2 = createdEditors.begin(); + while( itr2 != createdEditors.end() ) + { + QList< ActionPropertyEditor* > &l = *itr2; + QList< ActionPropertyEditor* >::iterator itr = l.begin(); + while( itr != l.end() ) + { + if( *itr == o ) + { + QList< ActionPropertyEditor* >::iterator d = itr; + ++itr; + l.erase( d ); + continue; + } + + ++itr; + } + + ++itr2; + } + } + +}; + +ActionEditorFactory::ActionEditorFactory( QObject *parent ) : +QtAbstractEditorFactory( parent ) +{ + d_ptr = new ActionEditorFactoryPrivate(); +} + +ActionEditorFactory::~ActionEditorFactory() +{ + delete d_ptr; + d_ptr = NULL; +} + +void ActionEditorFactory::connectPropertyManager( ActionPropertyManager *manager ) +{ + connect( manager, SIGNAL( valueChanged( QtProperty*, const QString& ) ), this, SLOT( onPropertyChanged( QtProperty*, const QString& ) ) ); +} + +void ActionEditorFactory::disconnectPropertyManager( ActionPropertyManager *manager ) +{ + disconnect( manager, SIGNAL( valueChanged( QtProperty*, const QString& ) ), this, SLOT( onPropertyChanged( QtProperty*, const QString& ) ) ); +} + +QWidget* ActionEditorFactory::createEditor( ActionPropertyManager *manager, QtProperty *p, QWidget *parent ) +{ + ActionPropertyEditor *editor = new ActionPropertyEditor( parent ); + editor->setValue( manager->value( p ) ); + + connect( editor, SIGNAL( valueChanged( const QString& ) ), this, SLOT( onSetValue( const QString& ) ) ); + connect( editor, SIGNAL( destroyed( QObject* ) ), this, SLOT( onEditorDestroyed( QObject* ) ) ); + + d_ptr->addEditor( p, editor ); + + return editor; +} + +void ActionEditorFactory::onPropertyChanged( QtProperty *p, const QString &value ) +{ + QMap< QtProperty*, QList< ActionPropertyEditor* > >::iterator itr = d_ptr->createdEditors.find( p ); + if( itr == d_ptr->createdEditors.end() ) + return; + + QList< ActionPropertyEditor* > &l = *itr; + QList< ActionPropertyEditor* >::iterator i = l.begin(); + while( i != l.end() ) + { + ActionPropertyEditor *editor = *i; + + editor->blockSignals( true ); + editor->setValue( value ); + editor->blockSignals( false ); + + ++i; + } +} + +void ActionEditorFactory::onSetValue( const QString &value ) +{ + QObject *s = sender(); + ActionPropertyEditor *editor = qobject_cast< ActionPropertyEditor* >( s ); + if( editor == NULL ) + return; + + QMap< ActionPropertyEditor*, QtProperty* >::iterator itr = d_ptr->editorToProperty.find( editor ); + if( itr == d_ptr->editorToProperty.end() ) + return; + + QtProperty *p = *itr; + + ActionPropertyManager *manager = qobject_cast< ActionPropertyManager* >( p->propertyManager() ); + if( manager == NULL ) + return; + + blockSignals( true ); + manager->setValue( p, value ); + blockSignals( false ); +} + +void ActionEditorFactory::onEditorDestroyed( QObject *editor ) +{ + d_ptr->removeEditor( editor ); +} + + + +//////////////////////////////////////////////////////////////////////// Editor ////////////////////////////////////////////////////////////////// + + + +ActionPropertyEditor::ActionPropertyEditor( QWidget *parent ) : +QWidget( parent ) +{ + setupUi(); + setupConnections(); +} + +ActionPropertyEditor::~ActionPropertyEditor() +{ +} + +void ActionPropertyEditor::setValue( const QString &value ) +{ + if( lineEdit->text() == value ) + return; + + disableConnections(); + lineEdit->setText( value ); + setupConnections(); +} + +void ActionPropertyEditor::showEvent( QShowEvent *e ) +{ + QWidget::showEvent( e ); +} + +void ActionPropertyEditor::onToolButtonClicked() +{ + ActionList d; + d.load(); + + int result = d.exec(); + if( QDialog::Accepted != result ) + return; + + lineEdit->setText( d.getSelectedAction() ); +} + +void ActionPropertyEditor::onTextChanged( const QString &text ) +{ + Q_EMIT valueChanged( text ); +} + +void ActionPropertyEditor::setupConnections() +{ + connect( toolButton, SIGNAL( clicked( bool ) ), this, SLOT( onToolButtonClicked() ) ); + connect( lineEdit, SIGNAL( textChanged( const QString& ) ), this, SLOT( onTextChanged( const QString& ) ) ); +} + +void ActionPropertyEditor::disableConnections() +{ + disconnect( toolButton, SIGNAL( clicked( bool ) ), this, SLOT( onToolButtonClicked() ) ); + disconnect( lineEdit, SIGNAL( textChanged( const QString& ) ), this, SLOT( onTextChanged( const QString& ) ) ); +} + +void ActionPropertyEditor::setupUi() +{ + lineEdit = new QLineEdit(); + toolButton = new QToolButton(); + toolButton->setText( "..." ); + + QHBoxLayout *lt = new QHBoxLayout( this ); + lt->setContentsMargins( 0, 0, 0, 0 ); + lt->setSpacing( 0 ); + lt->addWidget( lineEdit ); + lt->addWidget( toolButton ); + + setFocusProxy( lineEdit ); + setSizePolicy( QSizePolicy::Ignored, QSizePolicy::Fixed ); + +} + + diff --git a/code/studio/src/plugins/gui_editor/action_property_manager.h b/code/studio/src/plugins/gui_editor/action_property_manager.h new file mode 100644 index 000000000..06cd714d7 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/action_property_manager.h @@ -0,0 +1,125 @@ +// Ryzom Core Studio GUI Editor plugin +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + + +#ifndef ACTION_PROPERTY_MANAGER +#define ACTION_PROPERTY_MANAGER + +#define QT_QTPROPERTYBROWSER_IMPORT + +#include "3rdparty/qtpropertybrowser/qtpropertybrowser.h" +#include + +/////////////////////////////////////////////////////// Manager /////////////////////////////////////////////////////////////////////////// + +struct ActionPropertyManagerPrivate; + +class ActionPropertyManager : public QtAbstractPropertyManager +{ + Q_OBJECT + +public: + ActionPropertyManager( QObject *parent = NULL ); + ~ActionPropertyManager(); + + QString value( const QtProperty *p ) const; + +public Q_SLOTS: + void setValue( QtProperty *p, const QString &value ); + +Q_SIGNALS: + void valueChanged( QtProperty *p, const QString &value ); + +protected: + bool hasValue( const QtProperty *p ) const; + QString valueText( const QtProperty *p ) const; + void initializeProperty( QtProperty *p ); + void uninitializeProperty( QtProperty *p ); + +private: + ActionPropertyManagerPrivate *d_ptr; + + Q_DISABLE_COPY( ActionPropertyManager ); +}; + + +////////////////////////////////////////////////////////////////// Factory ///////////////////////////////////////////////////////////////////////// + +struct ActionEditorFactoryPrivate; + +class ActionEditorFactory : public QtAbstractEditorFactory< ActionPropertyManager > +{ + Q_OBJECT + +public: + ActionEditorFactory( QObject *parent = NULL ); + ~ActionEditorFactory(); + +protected: + void connectPropertyManager( ActionPropertyManager *manager ); + void disconnectPropertyManager( ActionPropertyManager *manager ); + + QWidget* createEditor( ActionPropertyManager *manager, QtProperty *p, QWidget *parent ); + +private Q_SLOTS: + void onPropertyChanged( QtProperty *p, const QString &value ); + void onSetValue( const QString &value ); + void onEditorDestroyed( QObject *editor ); + +private: + ActionEditorFactoryPrivate *d_ptr; + + Q_DISABLE_COPY( ActionEditorFactory ); +}; + + +///////////////////////////////////////////////////////////////// Editor /////////////////////////////////////////////////////////////////////////// + +class QLineEdit; +class QToolButton; + +class ActionPropertyEditor : public QWidget +{ + Q_OBJECT +public: + ActionPropertyEditor( QWidget *parent = NULL ); + ~ActionPropertyEditor(); + +public Q_SLOTS: + void setValue( const QString &value ); + +protected: + void showEvent( QShowEvent *e ); + +private Q_SLOTS: + void onToolButtonClicked(); + void onTextChanged( const QString &text ); + +Q_SIGNALS: + void valueChanged( const QString &value ); + +private: + void setupUi(); + void setupConnections(); + void disableConnections(); + + + QLineEdit *lineEdit; + QToolButton *toolButton; +}; + +#endif + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/add_widget_widget.cpp b/code/studio/src/plugins/gui_editor/add_widget_widget.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/add_widget_widget.cpp rename to code/studio/src/plugins/gui_editor/add_widget_widget.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/add_widget_widget.h b/code/studio/src/plugins/gui_editor/add_widget_widget.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/add_widget_widget.h rename to code/studio/src/plugins/gui_editor/add_widget_widget.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/add_widget_widget.ui b/code/studio/src/plugins/gui_editor/add_widget_widget.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/add_widget_widget.ui rename to code/studio/src/plugins/gui_editor/add_widget_widget.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/editor_message_processor.cpp b/code/studio/src/plugins/gui_editor/editor_message_processor.cpp similarity index 71% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/editor_message_processor.cpp rename to code/studio/src/plugins/gui_editor/editor_message_processor.cpp index 691dbdead..ef99c87fc 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/editor_message_processor.cpp +++ b/code/studio/src/plugins/gui_editor/editor_message_processor.cpp @@ -25,35 +25,40 @@ namespace GUIEditor { void CEditorMessageProcessor::onDelete() { - std::string selection = CWidgetManager::getInstance()->getCurrentEditorSelection(); + std::vector< std::string > selection; + + CWidgetManager::getInstance()->getEditorSelection( selection ); if( selection.empty() ) return; QMessageBox::StandardButton r = QMessageBox::question( NULL, tr( "Deleting widget" ), - tr( "Are you sure you want to delete %1?" ).arg( selection.c_str() ), + tr( "Are you sure you want to delete these?" ), QMessageBox::Yes | QMessageBox::No ); if( r != QMessageBox::Yes ) return; - CInterfaceElement *e = - CWidgetManager::getInstance()->getElementFromId( selection ); - if( e == NULL ) - return; + for( int i = 0; i < selection.size(); i++ ) + { + CInterfaceElement *e = CWidgetManager::getInstance()->getElementFromId( selection[ i ] ); + if( e == NULL ) + continue; - CInterfaceElement *p = e->getParent(); - if( p == NULL ) - return; - - CInterfaceGroup *g = dynamic_cast< CInterfaceGroup* >( p ); - if( g == NULL ) - return; + CInterfaceElement *p = e->getParent(); + if( p == NULL ) + continue; + + CInterfaceGroup *g = dynamic_cast< CInterfaceGroup* >( p ); + if( g == NULL ) + continue; + + g->delElement( e ); - if( g->delElement( e ) ) - { - CWidgetManager::getInstance()->setCurrentEditorSelection( "" ); } + + + CWidgetManager::getInstance()->clearEditorSelection(); } void CEditorMessageProcessor::onAdd( const QString &parentGroup, const QString &widgetType, const QString &name ) @@ -130,5 +135,32 @@ namespace GUIEditor e->setActive( false ); e->setActive( true ); } + + void CEditorMessageProcessor::onSetGroupSelection( bool b ) + { + CWidgetManager::getInstance()->setGroupSelection( b ); + } + + void CEditorMessageProcessor::onGroup() + { + CWidgetManager::getInstance()->groupSelection(); + } + + void CEditorMessageProcessor::onUngroup() + { + bool ok = CWidgetManager::getInstance()->unGroupSelection(); + + if( !ok ) + { + QMessageBox::critical( NULL, + tr( "Ungrouping widgets" ), + tr( "Couldn't ungroup widgets." ) ); + } + } + + void CEditorMessageProcessor::onSetMultiSelection( bool b ) + { + CWidgetManager::getInstance()->setMultiSelection( b ); + } } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/editor_message_processor.h b/code/studio/src/plugins/gui_editor/editor_message_processor.h similarity index 92% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/editor_message_processor.h rename to code/studio/src/plugins/gui_editor/editor_message_processor.h index 5c19a03c2..ee55fcda7 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/editor_message_processor.h +++ b/code/studio/src/plugins/gui_editor/editor_message_processor.h @@ -38,6 +38,10 @@ namespace GUIEditor public Q_SLOTS: void onDelete(); void onAdd( const QString &parentGroup, const QString &widgetType, const QString &name ); + void onSetGroupSelection( bool b ); + void onGroup(); + void onUngroup(); + void onSetMultiSelection( bool b ); private: CWidgetInfoTree *tree; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/editor_selection_watcher.cpp b/code/studio/src/plugins/gui_editor/editor_selection_watcher.cpp similarity index 87% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/editor_selection_watcher.cpp rename to code/studio/src/plugins/gui_editor/editor_selection_watcher.cpp index ee3a079ad..7647c8abb 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/editor_selection_watcher.cpp +++ b/code/studio/src/plugins/gui_editor/editor_selection_watcher.cpp @@ -18,9 +18,9 @@ namespace GUIEditor { - void CEditorSelectionWatcher::selectionChanged( std::string &newSelection ) + void CEditorSelectionWatcher::selectionChanged() { - Q_EMIT sgnSelectionChanged( newSelection ); + Q_EMIT sgnSelectionChanged(); } } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/editor_selection_watcher.h b/code/studio/src/plugins/gui_editor/editor_selection_watcher.h similarity index 91% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/editor_selection_watcher.h rename to code/studio/src/plugins/gui_editor/editor_selection_watcher.h index 61218c0cd..2eab68310 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/editor_selection_watcher.h +++ b/code/studio/src/plugins/gui_editor/editor_selection_watcher.h @@ -27,10 +27,10 @@ namespace GUIEditor public: CEditorSelectionWatcher() : QObject( NULL ){} - void selectionChanged( std::string &newSelection ); + void selectionChanged(); Q_SIGNALS: - void sgnSelectionChanged( std::string &id ); + void sgnSelectionChanged(); }; } diff --git a/code/studio/src/plugins/gui_editor/expr_link_dlg.cpp b/code/studio/src/plugins/gui_editor/expr_link_dlg.cpp new file mode 100644 index 000000000..e8d01af85 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expr_link_dlg.cpp @@ -0,0 +1,124 @@ +// Ryzom Core Studio - GUI Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 "expr_link_dlg.h" +#include + +ExprLinkDlg::ExprLinkDlg( QWidget *parent ) : +QDialog( parent ) +{ + m_ui.setupUi( this ); + + connect( m_ui.okButton, SIGNAL( clicked( bool ) ), this, SLOT( onOKClicked() ) ); + connect( m_ui.cancelButton, SIGNAL( clicked( bool ) ), this, SLOT( onCancelClicked() ) ); +} + +ExprLinkDlg::~ExprLinkDlg() +{ +} + +void ExprLinkDlg::load( const QList< SlotInfo > &a, const QList< SlotInfo > &b, const QString &aname, const QString &bname ) +{ + QListIterator< SlotInfo > itra( a ); + QListIterator< SlotInfo > itrb( b ); + + while( itra.hasNext() ) + { + const SlotInfo &info = itra.next(); + + QListWidgetItem *item = new QListWidgetItem(); + item->setText( info.name ); + item->setData( Qt::UserRole, info.slot ); + + m_ui.list1->addItem( item ); + } + + while( itrb.hasNext() ) + { + const SlotInfo &info = itrb.next(); + + QListWidgetItem *item = new QListWidgetItem(); + item->setText( info.name ); + item->setData( Qt::UserRole, info.slot ); + + m_ui.list2->addItem( item ); + } + + m_ui.groupBox1->setTitle( aname ); + m_ui.groupBox2->setTitle( bname ); +} + +int ExprLinkDlg::getSlotA() const +{ + QListWidgetItem *item = m_ui.list1->currentItem(); + if( item == NULL ) + return -1; + + int slot = item->data( Qt::UserRole ).toInt(); + return slot; +} + +int ExprLinkDlg::getSlotB() const +{ + QListWidgetItem *item = m_ui.list2->currentItem(); + if( item == NULL ) + return -1; + + int slot = item->data( Qt::UserRole ).toInt(); + return slot; +} + +void ExprLinkDlg::onOKClicked() +{ + int slotA = getSlotA(); + int slotB = getSlotB(); + + if( ( slotA == -1 ) || ( slotB == -1 ) ) + { + QMessageBox::information( this, + tr( "No slots selected" ), + tr( "You need to select a slot on both sides." ) ); + return; + } + + if( ( slotA == 0 ) && ( slotB == 0 ) ) + { + QMessageBox::information( this, + tr( "Wrong slots selected" ), + tr( "You can only select the 'Out' slot on one of the sides." ) ); + return; + } + + if( ( slotA != 0 ) && ( slotB != 0 ) ) + { + QMessageBox::information( this, + tr( "Wrong slots selected" ), + tr( "One of the slots selected must be the 'Out' slot!" ) ); + return; + } + + accept(); +} + +void ExprLinkDlg::onCancelClicked() +{ + reject(); +} + + diff --git a/code/studio/src/plugins/gui_editor/expr_link_dlg.h b/code/studio/src/plugins/gui_editor/expr_link_dlg.h new file mode 100644 index 000000000..3f3ba97c0 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expr_link_dlg.h @@ -0,0 +1,49 @@ +// Ryzom Core Studio - GUI Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 EXPR_LINK_DLG +#define EXPR_LINK_DLG + +#include +#include +#include "ui_expr_link_dlg.h" +#include "expr_slot_info.h" + +class ExprLinkDlg : public QDialog +{ + Q_OBJECT +public: + ExprLinkDlg( QWidget *parent = NULL ); + ~ExprLinkDlg(); + + void load( const QList< SlotInfo > &a, const QList< SlotInfo > &b, const QString &aname, const QString &bname ); + + int getSlotA() const; + int getSlotB() const; + +private Q_SLOTS: + void onOKClicked(); + void onCancelClicked(); + +private: + Ui::ExprLinkDialog m_ui; +}; + +#endif + diff --git a/code/studio/src/plugins/gui_editor/expr_link_dlg.ui b/code/studio/src/plugins/gui_editor/expr_link_dlg.ui new file mode 100644 index 000000000..d6fdf9d7d --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expr_link_dlg.ui @@ -0,0 +1,76 @@ + + + ExprLinkDialog + + + + 0 + 0 + 641 + 334 + + + + Linking nodes + + + + + + + + GroupBox + + + + + + + + + + + + GroupBox + + + + + + + + + + + + + + Qt::Horizontal + + + + 398 + 20 + + + + + + + + Ok + + + + + + + Cancel + + + + + + + + diff --git a/code/studio/src/plugins/gui_editor/expr_slot_info.h b/code/studio/src/plugins/gui_editor/expr_slot_info.h new file mode 100644 index 000000000..470edf68d --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expr_slot_info.h @@ -0,0 +1,32 @@ +// Ryzom Core Studio - GUI Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 EXPR_SLOT_INFO +#define EXPR_SLOT_INFO + +#include + +struct SlotInfo +{ + QString name; + int slot; +}; + +#endif + diff --git a/code/studio/src/plugins/gui_editor/expression_editor.cpp b/code/studio/src/plugins/gui_editor/expression_editor.cpp new file mode 100644 index 000000000..858c63c9c --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expression_editor.cpp @@ -0,0 +1,380 @@ +// Ryzom Core Studio - GUI Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 "expression_editor.h" +#include +#include +#include +#include + +#include "expression_node.h" +#include "expression_link.h" +#include "expr_link_dlg.h" +#include "expression_store.h" +#include "expression_info.h" + +#include +#include + +class ExpressionEditorPvt +{ +public: + + ExpressionEditorPvt() + { + m_root = NULL; + } + + ExpressionStore store; + ExpressionNode *m_root; +}; + +ExpressionEditor::ExpressionEditor( QWidget *parent ) : +QMainWindow( parent ) +{ + m_ui.setupUi( this ); + + m_pvt = new ExpressionEditorPvt(); + + m_selectionCount = 0; + + m_scene = new QGraphicsScene( this ); + m_ui.view->setScene( m_scene ); + + connect( m_scene, SIGNAL( selectionChanged() ), this, SLOT( onSelectionChanged() ) ); + connect( m_ui.tree, SIGNAL( itemDoubleClicked( QTreeWidgetItem*, int ) ), this, SLOT( onItemDblClicked( QTreeWidgetItem* ) ) ); + + m_nodeCount = 0; +} + +ExpressionEditor::~ExpressionEditor() +{ + delete m_pvt; + m_pvt = NULL; + m_scene = NULL; +} + +void ExpressionEditor::load() +{ + m_pvt->store.load(); + + QList< const ExpressionInfo* > l; + m_pvt->store.getExpressions( l ); + + QListIterator< const ExpressionInfo* > itr( l ); + while( itr.hasNext() ) + { + addExpression( itr.next() ); + } + + l.clear(); +} + +void ExpressionEditor::contextMenuEvent( QContextMenuEvent *e ) +{ + QMenu menu; + QAction *a = NULL; + + if( m_selectionCount > 0 ) + { + a = menu.addAction( "Remove" ); + connect( a, SIGNAL( triggered() ), this, SLOT( onDeleteSelection() ) ); + + if( m_selectionCount == 1 ) + { + QList< QGraphicsItem* > l = m_scene->selectedItems(); + ExpressionNode *node = dynamic_cast< ExpressionNode* >( l[ 0 ] ); + if( node != NULL ) + { + if( node->variable() ) + { + a = menu.addAction( "Change slot count" ); + connect( a, SIGNAL( triggered() ), this, SLOT( onChangeSlotCount() ) ); + } + else + if( node->isValue() ) + { + a = menu.addAction( "Change value" ); + connect( a, SIGNAL( triggered() ), this, SLOT( onChangeValue() ) ); + } + + a = menu.addAction( "Set as root" ); + connect( a, SIGNAL( triggered() ), this, SLOT( onSetRoot() ) ); + } + } + else + if( m_selectionCount == 2 ) + { + a = menu.addAction( "Link" ); + connect( a, SIGNAL( triggered() ), this, SLOT( onLinkItems() ) ); + } + + a = menu.addAction( "Unlink" ); + connect( a, SIGNAL( triggered() ), this, SLOT( onUnLinkItems() ) ); + } + else + { + a = menu.addAction( "Build expression" ); + connect( a, SIGNAL( triggered() ), this, SLOT( onBuildExpression() ) ); + + a = menu.addAction( "Save" ); + connect( a, SIGNAL( triggered() ), this, SLOT( onSave() ) ); + + a = menu.addAction( "Clear" ); + connect( a, SIGNAL( triggered() ), this, SLOT( onClear() ) ); + } + + menu.exec( e->globalPos() ); +} + +void ExpressionEditor::closeEvent( QCloseEvent *e ) +{ + QMainWindow::closeEvent( e ); + + Q_EMIT closing(); +} + +void ExpressionEditor::onDeleteSelection() +{ + QList< QGraphicsItem* > l = m_scene->selectedItems(); + QListIterator< QGraphicsItem* > itr( l ); + while( itr.hasNext() ) + { + QGraphicsItem *item = itr.next(); + + ExpressionNode *node = dynamic_cast< ExpressionNode* >( item ); + if( node != NULL ) + { + ExpressionLink *link = NULL; + + int c = node->slotCount(); + for( int i = 0; i < c; i++ ) + { + link = node->link( i ); + if( link != NULL ) + { + link->unlink(); + m_scene->removeItem( link ); + delete link; + } + } + } + + if( item == m_pvt->m_root ) + m_pvt->m_root = NULL; + + m_scene->removeItem( item ); + delete item; + } +} + +void ExpressionEditor::onSelectionChanged() +{ + QList< QGraphicsItem* > l = m_scene->selectedItems(); + m_selectionCount = l.count(); +} + +void ExpressionEditor::onLinkItems() +{ + QList< QGraphicsItem* > l = m_scene->selectedItems(); + ExpressionNode *from = static_cast< ExpressionNode* >( l[ 0 ] ); + ExpressionNode *to = static_cast< ExpressionNode* >( l[ 1 ] ); + + QList< SlotInfo > froml; + QList< SlotInfo > tol; + + from->getSlots( froml ); + to->getSlots( tol ); + + // If there are no free slots, or both "Out" slots are taken we can't link + if( froml.isEmpty() || tol.isEmpty() || ( !from->slotEmpty( 0 ) && !to->slotEmpty( 0 ) ) ) + { + QMessageBox::information( this, + tr( "Failed to link nodes" ), + tr( "Unfortunately those nodes are full." ) ); + return; + } + + ExprLinkDlg d; + d.load( froml, tol, from->name(), to->name() ); + int result = d.exec(); + if( result == QDialog::Rejected ) + return; + + int slotA = d.getSlotA(); + int slotB = d.getSlotB(); + + ExpressionLink *link = new ExpressionLink(); + link->link( from, to, slotA, slotB ); + + m_scene->addItem( link ); +} + +void ExpressionEditor::onUnLinkItems() +{ + QList< QGraphicsItem* > l = m_scene->selectedItems(); + + for( int i = 0; i < l.count(); i++ ) + { + ExpressionNode *node = dynamic_cast< ExpressionNode* >( l[ i ] ); + if( node == NULL ) + continue; + + node->clearLinks(); + } +} + +void ExpressionEditor::onItemDblClicked( QTreeWidgetItem *item ) +{ + QString name = item->text( 0 ); + + const ExpressionInfo *info = m_pvt->store.getInfo( name ); + + QString n = name; + n += " #"; + n += QString::number( m_nodeCount ); + m_nodeCount++; + + ExpressionNode *node = new ExpressionNode( n, info->slotNames.count() ); + node->setSlotNames( info->slotNames ); + node->setVariable( info->variable ); + node->setIsValue( info->value ); + if( node->isValue() ) + { + node->setValue( "Value" ); + } + m_scene->addItem( node ); +} + +void ExpressionEditor::onChangeSlotCount() +{ + QList< QGraphicsItem* > l = m_scene->selectedItems(); + ExpressionNode *node = static_cast< ExpressionNode* >( l[ 0 ] ); + int oldc = node->slotCount(); + + int c = QInputDialog::getInt( this, + tr( "Change slot count" ), + tr( "Enter new slot count" ), + oldc, + 1, + 26 ); + + if( oldc == c ) + return; + + node->changeSlotCount( c ); +} + +void ExpressionEditor::onChangeValue() +{ + QList< QGraphicsItem* > l = m_scene->selectedItems(); + ExpressionNode *node = static_cast< ExpressionNode* >( l[ 0 ] ); + + QString oldValue = node->getValue(); + + QString newValue = QInputDialog::getText( this, + tr( "Change value" ), + tr( "Enter new value" ), + QLineEdit::Normal, + oldValue ); + + if( newValue.isEmpty() ) + return; + if( newValue == oldValue ) + return; + + node->setValue( newValue ); +} + +void ExpressionEditor::onSetRoot() +{ + QList< QGraphicsItem* > l = m_scene->selectedItems(); + ExpressionNode *node = static_cast< ExpressionNode* >( l[ 0 ] ); + + if( m_pvt->m_root != NULL ) + m_pvt->m_root->setRoot( false ); + + m_pvt->m_root = node; + node->setRoot( true ); +} + +void ExpressionEditor::onBuildExpression() +{ + if( m_pvt->m_root == NULL ) + { + QMessageBox::information( this, + tr( "Building expression" ), + tr( "Failed to build expression: You must set a root node." ) ); + return; + } + + QString result = m_pvt->m_root->build(); + QMessageBox::information( this, + tr( "Building expression" ), + tr( "The result is\n" ) + result ); +} + +void ExpressionEditor::onSave() +{ + if( m_pvt->m_root != NULL ) + { + m_result = m_pvt->m_root->build(); + } + + close(); +} + +void ExpressionEditor::onClear() +{ + m_scene->clear(); + m_pvt->m_root = NULL; + m_nodeCount = 0; + m_selectionCount = 0; + m_result = ""; +} + + +void ExpressionEditor::addExpression( const ExpressionInfo *info ) +{ + QTreeWidgetItem *item = findTopLevelItem( info->category ); + if( item == NULL ) + { + item = new QTreeWidgetItem(); + item->setText( 0, info->category ); + m_ui.tree->addTopLevelItem( item ); + } + + QTreeWidgetItem *citem = new QTreeWidgetItem(); + citem->setText( 0, info->name ); + item->addChild( citem ); +} + +QTreeWidgetItem* ExpressionEditor::findTopLevelItem( const QString &text ) +{ + int c = m_ui.tree->topLevelItemCount(); + for( int i = 0; i < c; i++ ) + { + QTreeWidgetItem *item = m_ui.tree->topLevelItem( i ); + if( item->text( 0 ) == text ) + return item; + } + + return NULL; +} + diff --git a/code/studio/src/plugins/gui_editor/expression_editor.h b/code/studio/src/plugins/gui_editor/expression_editor.h new file mode 100644 index 000000000..92cc959bd --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expression_editor.h @@ -0,0 +1,75 @@ +// Ryzom Core Studio - GUI Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 EXPRESSION_EDITOR +#define EXPRESSION_EDITOR + +#include "ui_expression_editor.h" + +class QGraphicsScene; +class QGraphicsItem; +class ExpressionEditorPvt; +class ExpressionInfo; + +class ExpressionEditor : public QMainWindow +{ + Q_OBJECT +public: + ExpressionEditor( QWidget *parent = NULL ); + ~ExpressionEditor(); + + void load(); + QString result() const{ return m_result; } + +Q_SIGNALS: + void closing(); + +protected: + void contextMenuEvent( QContextMenuEvent *e ); + void closeEvent( QCloseEvent *e ); + +private Q_SLOTS: + void onDeleteSelection(); + void onSelectionChanged(); + void onLinkItems(); + void onUnLinkItems(); + void onItemDblClicked( QTreeWidgetItem *item ); + void onChangeSlotCount(); + void onChangeValue(); + void onSetRoot(); + void onBuildExpression(); + void onSave(); + void onClear(); + +private: + void addExpression( const ExpressionInfo *info ); + QTreeWidgetItem* findTopLevelItem( const QString &text ); + + Ui::ExpressionEditor m_ui; + QGraphicsScene *m_scene; + + int m_selectionCount; + int m_nodeCount; + + ExpressionEditorPvt *m_pvt; + QString m_result; +}; + +#endif + diff --git a/code/studio/src/plugins/gui_editor/expression_editor.ui b/code/studio/src/plugins/gui_editor/expression_editor.ui new file mode 100644 index 000000000..fa21420a2 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expression_editor.ui @@ -0,0 +1,58 @@ + + + ExpressionEditor + + + Qt::ApplicationModal + + + + 0 + 0 + 800 + 600 + + + + Expression Editor + + + + + + + + + + + + 0 + 0 + 800 + 21 + + + + + + + 1 + + + + + + + + Expressions + + + + + + + + + + + diff --git a/code/studio/src/plugins/gui_editor/expression_info.h b/code/studio/src/plugins/gui_editor/expression_info.h new file mode 100644 index 000000000..86218b6af --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expression_info.h @@ -0,0 +1,41 @@ +// Ryzom Core Studio - GUI Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 EXPRESSION_INFO +#define EXPRESSION_INFO + +#include +#include + +struct ExpressionInfo +{ + QString name; + bool value; + QString category; + bool variable; + QStringList slotNames; + + ExpressionInfo() + { + value = false; + variable = false; + } +}; + +#endif + diff --git a/code/studio/src/plugins/gui_editor/expression_link.cpp b/code/studio/src/plugins/gui_editor/expression_link.cpp new file mode 100644 index 000000000..54c7734b0 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expression_link.cpp @@ -0,0 +1,78 @@ +// Ryzom Core Studio - GUI Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 "expression_link.h" +#include "expression_node.h" +#include +#include + +ExpressionLink::ExpressionLink( QGraphicsItem *parent ) : +QGraphicsLineItem( parent ) +{ + m_from = NULL; + m_to = NULL; +} + +ExpressionLink::~ExpressionLink() +{ + unlink(); +} + +void ExpressionLink::link( ExpressionNode *from, ExpressionNode *to, int fromSlot, int toSlot ) +{ + m_from = from; + m_to = to; + m_from->setLink( this, fromSlot ); + m_to->setLink( this, toSlot ); + + m_fromSlot = fromSlot; + m_toSlot = toSlot; + + nodeMoved(); +} + +void ExpressionLink::unlink() +{ + if( m_from == NULL ) + return; + + m_from->setLink( NULL, m_fromSlot ); + m_to->setLink( NULL, m_toSlot ); + + m_from = NULL; + m_to = NULL; + + delete this; +} + +void ExpressionLink::nodeMoved() +{ + setLine( QLineF( m_from->slotPos( m_fromSlot ), m_to->slotPos( m_toSlot ) ) ); +} + +void ExpressionLink::paint( QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget ) +{ + QPen p; + p.setColor( Qt::black ); + p.setWidth( 5 ); + setPen( p ); + + QGraphicsLineItem::paint( painter, option, widget ); +} + + diff --git a/code/studio/src/plugins/gui_editor/expression_link.h b/code/studio/src/plugins/gui_editor/expression_link.h new file mode 100644 index 000000000..a0e699451 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expression_link.h @@ -0,0 +1,51 @@ +// Ryzom Core Studio - GUI Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 EXPRESSION_LINK +#define EXPRESSION_LINK + +#include + +class ExpressionNode; + +class ExpressionLink : public QGraphicsLineItem +{ +public: + ExpressionLink( QGraphicsItem *parent = NULL ); + ~ExpressionLink(); + + void link( ExpressionNode *from, ExpressionNode *to, int fromSlot, int toSlot ); + void unlink(); + + void nodeMoved(); + + void paint( QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget ); + + ExpressionNode* from() const{ return m_from; } + ExpressionNode* to() const{ return m_to; } + +private: + ExpressionNode *m_from; + ExpressionNode *m_to; + + int m_fromSlot; + int m_toSlot; +}; + +#endif + diff --git a/code/studio/src/plugins/gui_editor/expression_loader.cpp b/code/studio/src/plugins/gui_editor/expression_loader.cpp new file mode 100644 index 000000000..07db432e0 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expression_loader.cpp @@ -0,0 +1,220 @@ +// Ryzom Core Studio - GUI Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 "expression_loader.h" +#include "expression_info.h" + +#include +#include + +class ExpressionLoaderPvt +{ +public: + + bool parseName() + { + QString text = reader.readElementText( QXmlStreamReader::ErrorOnUnexpectedElement ); + if( reader.hasError() ) + return false; + + m_info->name = text; + + return true; + } + + bool parseValue() + { + QString text = reader.readElementText( QXmlStreamReader::ErrorOnUnexpectedElement ); + if( reader.hasError() ) + return false; + + if( text.toLower() == "true" ) + m_info->value = true; + else + m_info->value = false; + + return true; + } + + bool parseCategory() + { + QString text = reader.readElementText( QXmlStreamReader::ErrorOnUnexpectedElement ); + if( reader.hasError() ) + return false; + + m_info->category = text; + + return true; + } + + bool parseVariable() + { + QString text = reader.readElementText( QXmlStreamReader::ErrorOnUnexpectedElement ); + if( reader.hasError() ) + return false; + + if( text.toLower() == "true" ) + m_info->variable = true; + else + m_info->variable = false; + + return true; + } + + bool parseSlot() + { + QString text = reader.readElementText( QXmlStreamReader::ErrorOnUnexpectedElement ); + if( reader.hasError() ) + return false; + + m_info->slotNames.push_back( text ); + + return true; + } + + bool parseSlots() + { + bool error = false; + + while( !reader.atEnd() ) + { + reader.readNext(); + + if( reader.isStartElement() ) + { + QString name = reader.name().toString(); + if( name == "slot" ) + error = !parseSlot(); + } + else + if( reader.isEndElement() ) + { + if( reader.name() == "slots" ) + break; + } + } + + if( reader.atEnd() ) + return false; + + return true; + } + + bool load( QFile *f ) + { + reader.clear(); + reader.setDevice( f ); + + bool error = false; + + // start of document + reader.readNext(); + if( reader.atEnd() ) + return false; + + // root node + reader.readNext(); + if( reader.atEnd() ) + return false; + + if( reader.isStartElement() ) + { + // Not an expression file? + if( reader.name() != "expression" ) + return false; + } + + while( !reader.atEnd() ) + { + reader.readNext(); + + if( reader.isStartElement() ) + { + QString name = reader.name().toString(); + + if( name == "name" ) + error = !parseName(); + else + if( name == "value" ) + error = !parseValue(); + else + if( name == "category" ) + error = !parseCategory(); + else + if( name == "variable" ) + error = !parseVariable(); + else + if( name == "slots" ) + error = !parseSlots(); + } + + if( error ) + break; + } + + if( error || reader.hasError() ) + { + return false; + } + + return true; + } + + void setInfo( ExpressionInfo *info ){ m_info = info; } + +private: + QXmlStreamReader reader; + ExpressionInfo *m_info; +}; + +ExpressionLoader::ExpressionLoader() +{ + m_pvt = new ExpressionLoaderPvt; +} + +ExpressionLoader::~ExpressionLoader() +{ + delete m_pvt; + m_pvt = NULL; +} + +ExpressionInfo* ExpressionLoader::load( const QString &filename ) +{ + ExpressionInfo *info = NULL; + bool ok = false; + + QFile f( filename ); + if( !f.open( QIODevice::ReadOnly | QIODevice::Text ) ) + return NULL; + + info = new ExpressionInfo(); + m_pvt->setInfo( info ); + ok = m_pvt->load( &f ); + + f.close(); + + if( !ok ) + { + delete info; + info = NULL; + } + + return info; +} + + diff --git a/code/studio/src/plugins/gui_editor/expression_loader.h b/code/studio/src/plugins/gui_editor/expression_loader.h new file mode 100644 index 000000000..f315fcdcd --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expression_loader.h @@ -0,0 +1,39 @@ +// Ryzom Core Studio - GUI Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 EXPRESSION_LOADER +#define EXPRESSION_LOADER + +struct ExpressionInfo; +class QString; +class ExpressionLoaderPvt; + +class ExpressionLoader +{ +public: + ExpressionLoader(); + ~ExpressionLoader(); + + ExpressionInfo* load( const QString &filename ); + +private: + ExpressionLoaderPvt *m_pvt; +}; + +#endif + diff --git a/code/studio/src/plugins/gui_editor/expression_node.cpp b/code/studio/src/plugins/gui_editor/expression_node.cpp new file mode 100644 index 000000000..80ef571e2 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expression_node.cpp @@ -0,0 +1,417 @@ +// Ryzom Core Studio - GUI Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 "expression_node.h" +#include "expression_link.h" +#include +#include + +struct NodeSlotInfo +{ + // top-left + QPoint tl; + + // text top-left + QPoint ttl; + + // The text displayed + QString text; + + // text width + qreal tw; + + // text height + qreal th; + + // width-height of the box + qreal wh; +}; + +class NodeSlot +{ +public: + NodeSlot( const NodeSlotInfo &info ) + { + m_info = info; + } + + ~NodeSlot() + { + } + + QPointF pos() const{ + QPointF p; + p.setX( m_info.tl.x() + m_info.wh / 2.0 ); + p.setY( m_info.tl.y() + m_info.wh / 2.0 ); + + return p; + } + + void paint( QPainter *painter ) + { + QBrush boxBrush; + QPen p; + + boxBrush.setColor( Qt::black ); + boxBrush.setStyle( Qt::SolidPattern ); + p.setColor( Qt::black ); + painter->setPen( p ); + + QRectF box; + QRectF tbox; + + box.setTopLeft( m_info.tl ); + box.setHeight( m_info.wh ); + box.setWidth( m_info.wh ); + + painter->fillRect( box, boxBrush ); + + tbox.setTopLeft( m_info.ttl ); + tbox.setHeight( m_info.th ); + tbox.setWidth( m_info.tw ); + + painter->drawText( tbox, Qt::AlignRight, m_info.text ); + } + + QString text() const{ return m_info.text; } + void setText( const QString &text ){ m_info.text = text; } + +private: + NodeSlotInfo m_info; +}; + + + +ExpressionNode::ExpressionNode( const QString &name, int slotCount, QGraphicsItem *parent ) : +QGraphicsItem( parent ) +{ + setFlags( QGraphicsItem::ItemIsSelectable | QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemSendsScenePositionChanges ); + + m_w = 100; + m_h = 100; + m_hh = 20.0; + + m_variable = false; + m_isValue = false; + m_isRoot = false; + + m_name = name; + + if( slotCount > 3 ) + m_h = m_h + 20.0 * ( slotCount - 3 ); + + createSlots( slotCount ); +} + +ExpressionNode::~ExpressionNode() +{ + clearLinks(); + clearSlots(); +} + +QRectF ExpressionNode::boundingRect() const +{ + return QRectF( 0, 0, m_w, m_h ); +} + +void ExpressionNode::paint( QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget ) +{ + QBrush br; + QBrush boxBrush; + QPen p; + QColor c; + + QRectF rect = boundingRect(); + QRectF header = rect; + header.setHeight( m_hh ); + + // Draw filled rectangle, header + if( !m_isRoot ) + { + c.setRed( 44 ); + c.setGreen( 169 ); + c.setBlue( 232 ); + } + else + { + c.setRed( 255 ); + c.setGreen( 0 ); + c.setBlue( 0 ); + } + br.setColor( c ); + br.setStyle( Qt::SolidPattern ); + p.setColor( c ); + painter->setPen( p ); + painter->fillRect( header, br ); + + // Draw header text + p.setColor( Qt::black ); + painter->setPen( p ); + painter->drawText( header, Qt::AlignCenter, m_name ); + + // Draw value if applicable + if( m_isValue ) + { + QRectF vbox; + vbox.setTopLeft( QPoint( 0.0, 20.0 ) ); + vbox.setWidth( header.width() ); + vbox.setHeight( header.height() ); + QPen vpen; + vpen.setColor( Qt::red ); + painter->setPen( vpen ); + painter->drawText( vbox, Qt::AlignCenter, m_value ); + painter->setPen( p ); + } + + if( option->state & QStyle::State_Selected ) + { + p.setStyle( Qt::DotLine ); + p.setColor( Qt::red ); + } + + // Draw outline of the entire thing + header + painter->setPen( p ); + painter->drawRect( rect ); + painter->drawRect( header ); + + paintSlots( painter ); +} + + +QPointF ExpressionNode::slotPos( int slot ) const +{ + const NodeSlot *s = m_slots[ slot ]; + QPointF sp = s->pos(); + QPointF mp = pos(); + + mp += sp; + return mp; +} + +void ExpressionNode::changeSlotCount( int count ) +{ + clearSlots(); + clearLinks(); + m_links.clear(); + + if( count <= 3 ) + m_h = 100.0; + else + m_h = 100.0 + 20.0 * ( count - 3 ); + + createSlots( count ); + + update(); +} + +void ExpressionNode::clearSlots() +{ + qDeleteAll( m_slots ); + m_slots.clear(); +} + +bool ExpressionNode::slotEmpty( int slot ) const +{ + if( m_links[ 0 ] == NULL ) + return true; + else + return false; +} + +void ExpressionNode::getSlots( QList< SlotInfo > &l ) +{ + SlotInfo info; + + for( int i = 0; i < m_slots.count(); i++ ) + { + if( m_links[ i ] != NULL ) + continue; + + info.name = m_slots[ i ]->text(); + info.slot = i; + l.push_back( info ); + } +} + +void ExpressionNode::setLink( ExpressionLink *link, int slot ) +{ + m_links[ slot ] = link; +} + +ExpressionLink* ExpressionNode::link( int slot ) const +{ + return m_links[ slot ]; +} + +void ExpressionNode::setSlotNames( const QList< QString > &l ) +{ + int c = l.count(); + for( int i = 0; i < c; i++ ) + { + // "Out" slot is at position 0, so set the names with an offset of 1 + m_slots[ i + 1 ]->setText( l[ i ] ); + } +} + +void ExpressionNode::setValue( const QString &value ) +{ + m_value = value; + + int c = m_value.count(); + if( c < 15 ) + m_w = 100.0; + else + m_w = m_w + ( 100.0 / 15.0 ) * ( c - 15.0 ); + + update(); +} + +void ExpressionNode::setRoot( bool b ) +{ + m_isRoot = b; + update(); +} + +QString ExpressionNode::build() const +{ + QString result; + + if( isValue() ) + return m_value; + + QStringList l = m_name.split( ' ' ); + result = l[ 0 ]; + + int c = m_links.count(); + if( c == 1 ) + { + result += "()"; + return result; + } + + result += "( "; + + for( int i = 1; i < c; i++ ) + { + ExpressionLink *link = m_links[ i ]; + if( link == NULL ) + continue; + + ExpressionNode *node = NULL; + + if( link->from() == this ) + node = link->to(); + else + node = link->from(); + + result += node->build(); + + if( i != ( c - 1 ) ) + result += ", "; + } + + result += " )"; + return result; +} + +QVariant ExpressionNode::itemChange( GraphicsItemChange change, const QVariant &value ) +{ + if( change == ItemScenePositionHasChanged ) + { + onNodeMove(); + } + + return QGraphicsItem::itemChange( change, value ); +} + +void ExpressionNode::onNodeMove() +{ + for( int i = 0; i < m_links.count(); i++ ) + { + ExpressionLink *link = m_links[ i ]; + if( link == NULL ) + continue; + + link->nodeMoved(); + } +} + +void ExpressionNode::createSlots( int count) +{ + // Out nodes + m_links.push_back( NULL ); + + for( int i = 0; i < count; i++ ) + m_links.push_back( NULL ); + + // First create the "Out" slot + NodeSlotInfo info; + info.tw = 25.0; + info.th = 12.0; + info.wh = 10.0; + + qreal x = 0.0; + qreal y = m_h * 0.5; + qreal tx = info.wh; + qreal ty = m_h * 0.5 - 2; + + info.tl = QPoint( x, y ); + info.ttl = QPoint( tx, ty ); + info.text = "Out"; + + m_slots.push_back( new NodeSlot( info ) ); + + // Then the rest of them + for( int i = 0; i < count; i++ ) + { + x = m_w - info.wh; + y = 30 + i * 20.0; + tx = x - 5 - info.tw; + ty = y - 2; + + info.tl = QPoint( x, y ); + info.ttl = QPoint( tx, ty ); + info.text = QString( 'A' + i ); + + m_slots.push_back( new NodeSlot( info ) ); + } +} + +void ExpressionNode::paintSlots( QPainter *painter ) +{ + for( int i = 0; i < m_slots.count(); i++ ) + { + NodeSlot *slot = m_slots[ i ]; + slot->paint( painter ); + } +} + + +void ExpressionNode::clearLinks() +{ + for( int i = 0; i < m_links.count(); i++ ) + { + ExpressionLink *link = m_links[ i ]; + if( link == NULL ) + continue; + + link->unlink(); + } +} + diff --git a/code/studio/src/plugins/gui_editor/expression_node.h b/code/studio/src/plugins/gui_editor/expression_node.h new file mode 100644 index 000000000..1e0290344 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expression_node.h @@ -0,0 +1,95 @@ +// Ryzom Core Studio - GUI Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 EXPRESSION_NODE +#define EXPRESSION_NODE + +#include +#include +#include "expr_slot_info.h" + +class ExpressionLink; +class NodeSlot; + +class ExpressionNode : public QGraphicsItem +{ +public: + ExpressionNode( const QString &name, int slotCount = 3, QGraphicsItem *parent = NULL ); + ~ExpressionNode(); + + QRectF boundingRect() const; + void paint( QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget ); + + void setLink( ExpressionLink *link, int slot ); + ExpressionLink* link( int slot ) const; + + QPointF slotPos( int slot ) const; + + int slotCount() const{ return m_slots.count(); } + void changeSlotCount( int count ); + void clearSlots(); + + bool slotEmpty( int slot ) const; + + void getSlots( QList< SlotInfo > &l ); + + void clearLinks(); + + QString name() const{ return m_name; } + + void setSlotNames( const QList< QString > &l ); + + void setVariable( bool b ){ m_variable = b; } + bool variable() const{ return m_variable; } + + void setValue( const QString &value ); + QString getValue() const{ return m_value; } + + bool isValue() const{ return m_isValue; } + void setIsValue( bool b ){ m_isValue = b; } + void setRoot( bool b ); + + QString build() const; + +protected: + QVariant itemChange( GraphicsItemChange change, const QVariant &value ); + +private: + void onNodeMove(); + void createSlots( int count = 3 ); + void paintSlots( QPainter *painter ); + + qreal m_w; // node width + qreal m_h; // node height + qreal m_hh; // header height + + QList< NodeSlot* > m_slots; + QList< ExpressionLink* > m_links; + + QString m_name; + + bool m_variable; + + QString m_value; + bool m_isValue; + bool m_isRoot; +}; + +#endif + diff --git a/code/studio/src/plugins/gui_editor/expression_store.cpp b/code/studio/src/plugins/gui_editor/expression_store.cpp new file mode 100644 index 000000000..0016374d3 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expression_store.cpp @@ -0,0 +1,106 @@ +// Ryzom Core Studio - GUI Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 "expression_store.h" +#include "expression_info.h" +#include "expression_loader.h" +#include +#include +#include "gui_editor_config.h" + +class ExpressionStorePvt +{ +public: + + ~ExpressionStorePvt() + { + qDeleteAll( expressions ); + expressions.clear(); + } + + + QMap< QString, ExpressionInfo* > expressions; +}; + +ExpressionStore::ExpressionStore() +{ + m_pvt = new ExpressionStorePvt(); +} + +ExpressionStore::~ExpressionStore() +{ + delete m_pvt; + m_pvt = NULL; +} + + +bool ExpressionStore::load() +{ + QDir d( EXPRESSIONS_DIR ); + if( !d.exists() ) + return false; + + QFileInfoList l = d.entryInfoList(); + QListIterator< QFileInfo > itr( l ); + if( !itr.hasNext() ) + return false; + + ExpressionLoader loader; + + while( itr.hasNext() ) + { + const QFileInfo &info = itr.next(); + if( !info.isFile() ) + continue; + + if( info.suffix() != "xml" ) + continue; + + ExpressionInfo *expr = loader.load( info.absoluteFilePath() ); + if( expr == NULL ) + continue; + + m_pvt->expressions[ expr->name ] = expr; + } + + return false; +} + +void ExpressionStore::getExpressions( QList< const ExpressionInfo* > &l ) const +{ + l.clear(); + + QMap< QString, ExpressionInfo* >::const_iterator itr = m_pvt->expressions.constBegin(); + while( itr != m_pvt->expressions.constEnd() ) + { + l.push_back( itr.value() ); + ++itr; + } +} + +const ExpressionInfo* ExpressionStore::getInfo( const QString &name ) +{ + QMap< QString, ExpressionInfo* >::const_iterator itr = m_pvt->expressions.find( name ); + if( itr == m_pvt->expressions.end() ) + return NULL; + else + return itr.value(); +} + + + diff --git a/code/studio/src/plugins/gui_editor/expression_store.h b/code/studio/src/plugins/gui_editor/expression_store.h new file mode 100644 index 000000000..9c29fa0f6 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expression_store.h @@ -0,0 +1,46 @@ +// Ryzom Core Studio - GUI Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 EXPRESSION_STORE +#define EXPRESSION_STORE + +#include +#include +#include "expression_info.h" + +//struct ExpressionInfo; +class ExpressionStorePvt; + +class ExpressionStore +{ +public: + ExpressionStore(); + ~ExpressionStore(); + + bool load(); + + void getExpressions( QList< const ExpressionInfo* > &l ) const; + + const ExpressionInfo* getInfo( const QString &name ); + +private: + ExpressionStorePvt *m_pvt; +}; + +#endif + diff --git a/code/studio/src/plugins/gui_editor/expressions/abs.xml b/code/studio/src/plugins/gui_editor/expressions/abs.xml new file mode 100644 index 000000000..5a5fe2c70 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/abs.xml @@ -0,0 +1,8 @@ + +Mathematical +abs +false + +A + + diff --git a/code/studio/src/plugins/gui_editor/expressions/add.xml b/code/studio/src/plugins/gui_editor/expressions/add.xml new file mode 100644 index 000000000..62cec88af --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/add.xml @@ -0,0 +1,9 @@ + +Mathematical +add +true + +A +B + + diff --git a/code/studio/src/plugins/gui_editor/expressions/and.xml b/code/studio/src/plugins/gui_editor/expressions/and.xml new file mode 100644 index 000000000..cc8c05c6e --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/and.xml @@ -0,0 +1,9 @@ + +Logical +and +true + +A +B + + diff --git a/code/studio/src/plugins/gui_editor/expressions/band.xml b/code/studio/src/plugins/gui_editor/expressions/band.xml new file mode 100644 index 000000000..1ce1534ec --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/band.xml @@ -0,0 +1,9 @@ + +Bits +band +true + +A +B + + diff --git a/code/studio/src/plugins/gui_editor/expressions/bnot.xml b/code/studio/src/plugins/gui_editor/expressions/bnot.xml new file mode 100644 index 000000000..bde93f6e7 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/bnot.xml @@ -0,0 +1,8 @@ + +Bits +bnot +false + +A + + diff --git a/code/studio/src/plugins/gui_editor/expressions/bor.xml b/code/studio/src/plugins/gui_editor/expressions/bor.xml new file mode 100644 index 000000000..906678bc2 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/bor.xml @@ -0,0 +1,9 @@ + +Bits +bor +true + +A +B + + diff --git a/code/studio/src/plugins/gui_editor/expressions/bxor.xml b/code/studio/src/plugins/gui_editor/expressions/bxor.xml new file mode 100644 index 000000000..2bfedb167 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/bxor.xml @@ -0,0 +1,9 @@ + +Bits +bxor +false + +A +B + + diff --git a/code/studio/src/plugins/gui_editor/expressions/dbcount.xml b/code/studio/src/plugins/gui_editor/expressions/dbcount.xml new file mode 100644 index 000000000..df8e0aac6 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/dbcount.xml @@ -0,0 +1,8 @@ + +Database +dbcount +false + +A + + diff --git a/code/studio/src/plugins/gui_editor/expressions/depends.xml b/code/studio/src/plugins/gui_editor/expressions/depends.xml new file mode 100644 index 000000000..225d48dd6 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/depends.xml @@ -0,0 +1,8 @@ + +Logical +depends +false + +A + + diff --git a/code/studio/src/plugins/gui_editor/expressions/div.xml b/code/studio/src/plugins/gui_editor/expressions/div.xml new file mode 100644 index 000000000..aba3faffc --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/div.xml @@ -0,0 +1,9 @@ + +Mathematical +div +false + +A +B + + diff --git a/code/studio/src/plugins/gui_editor/expressions/eq.xml b/code/studio/src/plugins/gui_editor/expressions/eq.xml new file mode 100644 index 000000000..77b7041cc --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/eq.xml @@ -0,0 +1,9 @@ + +Logical +eq +true + +A +B + + diff --git a/code/studio/src/plugins/gui_editor/expressions/extSign11To64.xml b/code/studio/src/plugins/gui_editor/expressions/extSign11To64.xml new file mode 100644 index 000000000..e227fc8cb --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/extSign11To64.xml @@ -0,0 +1,8 @@ + +Bits +extSign11To64 +false + +A + + diff --git a/code/studio/src/plugins/gui_editor/expressions/extSign8To64.xml b/code/studio/src/plugins/gui_editor/expressions/extSign8To64.xml new file mode 100644 index 000000000..f029c15fc --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/extSign8To64.xml @@ -0,0 +1,8 @@ + +Bits +extSign8To64 +false + +A + + diff --git a/code/studio/src/plugins/gui_editor/expressions/getAlpha.xml b/code/studio/src/plugins/gui_editor/expressions/getAlpha.xml new file mode 100644 index 000000000..acdc5e322 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/getAlpha.xml @@ -0,0 +1,8 @@ + +Color +getAlpha +false + +Color + + diff --git a/code/studio/src/plugins/gui_editor/expressions/getBlue.xml b/code/studio/src/plugins/gui_editor/expressions/getBlue.xml new file mode 100644 index 000000000..be35a6c17 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/getBlue.xml @@ -0,0 +1,8 @@ + +Color +getBlue +false + +Color + + diff --git a/code/studio/src/plugins/gui_editor/expressions/getGreen.xml b/code/studio/src/plugins/gui_editor/expressions/getGreen.xml new file mode 100644 index 000000000..da8e16bc4 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/getGreen.xml @@ -0,0 +1,8 @@ + +Color +getGreen +false + +Color + + diff --git a/code/studio/src/plugins/gui_editor/expressions/getRed.xml b/code/studio/src/plugins/gui_editor/expressions/getRed.xml new file mode 100644 index 000000000..3a918857b --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/getRed.xml @@ -0,0 +1,8 @@ + +Color +getRed +false + +Color + + diff --git a/code/studio/src/plugins/gui_editor/expressions/getbit.xml b/code/studio/src/plugins/gui_editor/expressions/getbit.xml new file mode 100644 index 000000000..6cc08e10b --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/getbit.xml @@ -0,0 +1,9 @@ + +Bits +getbit +false + +Integer +Bit + + diff --git a/code/studio/src/plugins/gui_editor/expressions/getprop.xml b/code/studio/src/plugins/gui_editor/expressions/getprop.xml new file mode 100644 index 000000000..1098635aa --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/getprop.xml @@ -0,0 +1,8 @@ + +Database +getprop +false + +property + + diff --git a/code/studio/src/plugins/gui_editor/expressions/identity.xml b/code/studio/src/plugins/gui_editor/expressions/identity.xml new file mode 100644 index 000000000..cd36facd6 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/identity.xml @@ -0,0 +1,8 @@ + +Mathematical +identity +false + +A + + diff --git a/code/studio/src/plugins/gui_editor/expressions/ifthenelse.xml b/code/studio/src/plugins/gui_editor/expressions/ifthenelse.xml new file mode 100644 index 000000000..248a68332 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/ifthenelse.xml @@ -0,0 +1,10 @@ + +Logical +ifthenelse +false + +if +then +else + + diff --git a/code/studio/src/plugins/gui_editor/expressions/ilinear.xml b/code/studio/src/plugins/gui_editor/expressions/ilinear.xml new file mode 100644 index 000000000..9284b4e82 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/ilinear.xml @@ -0,0 +1,10 @@ + +Mathematical +ilinear +false + +Interpolant +Start +End + + diff --git a/code/studio/src/plugins/gui_editor/expressions/int.xml b/code/studio/src/plugins/gui_editor/expressions/int.xml new file mode 100644 index 000000000..117225b6b --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/int.xml @@ -0,0 +1,8 @@ + +Mathematical +int +false + +A + + diff --git a/code/studio/src/plugins/gui_editor/expressions/intToColor.xml b/code/studio/src/plugins/gui_editor/expressions/intToColor.xml new file mode 100644 index 000000000..2993365d7 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/intToColor.xml @@ -0,0 +1,8 @@ + +Color +intToColor +false + +Integer + + diff --git a/code/studio/src/plugins/gui_editor/expressions/isFinalVersion.xml b/code/studio/src/plugins/gui_editor/expressions/isFinalVersion.xml new file mode 100644 index 000000000..3c9ddc64c --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/isFinalVersion.xml @@ -0,0 +1,5 @@ + +Nel +isFinalVersion +false + diff --git a/code/studio/src/plugins/gui_editor/expressions/localize.xml b/code/studio/src/plugins/gui_editor/expressions/localize.xml new file mode 100644 index 000000000..f8d3f0f4e --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/localize.xml @@ -0,0 +1,8 @@ + +Localization +localize +false + +String + + diff --git a/code/studio/src/plugins/gui_editor/expressions/makeRGB.xml b/code/studio/src/plugins/gui_editor/expressions/makeRGB.xml new file mode 100644 index 000000000..a2cb2d352 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/makeRGB.xml @@ -0,0 +1,11 @@ + +Color +makeRGB +false + +R +G +B +A + + diff --git a/code/studio/src/plugins/gui_editor/expressions/max.xml b/code/studio/src/plugins/gui_editor/expressions/max.xml new file mode 100644 index 000000000..6592aecd7 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/max.xml @@ -0,0 +1,9 @@ + +Mathematical +max +true + +A +B + + diff --git a/code/studio/src/plugins/gui_editor/expressions/min.xml b/code/studio/src/plugins/gui_editor/expressions/min.xml new file mode 100644 index 000000000..753955ed9 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/min.xml @@ -0,0 +1,9 @@ + +Mathematical +min +true + +A +B + + diff --git a/code/studio/src/plugins/gui_editor/expressions/mod.xml b/code/studio/src/plugins/gui_editor/expressions/mod.xml new file mode 100644 index 000000000..d306f3371 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/mod.xml @@ -0,0 +1,9 @@ + +Mathematical +mod +false + +A +B + + diff --git a/code/studio/src/plugins/gui_editor/expressions/mul.xml b/code/studio/src/plugins/gui_editor/expressions/mul.xml new file mode 100644 index 000000000..54d03b025 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/mul.xml @@ -0,0 +1,9 @@ + +Mathematical +mul +true + +A +B + + diff --git a/code/studio/src/plugins/gui_editor/expressions/ne.xml b/code/studio/src/plugins/gui_editor/expressions/ne.xml new file mode 100644 index 000000000..31d62af02 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/ne.xml @@ -0,0 +1,9 @@ + +Logical +ne +true + +A +B + + diff --git a/code/studio/src/plugins/gui_editor/expressions/not.xml b/code/studio/src/plugins/gui_editor/expressions/not.xml new file mode 100644 index 000000000..872b9b7a4 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/not.xml @@ -0,0 +1,8 @@ + +Logical +not +false + +A + + diff --git a/code/studio/src/plugins/gui_editor/expressions/oldvalue.xml b/code/studio/src/plugins/gui_editor/expressions/oldvalue.xml new file mode 100644 index 000000000..299706c79 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/oldvalue.xml @@ -0,0 +1,8 @@ + +Database +oldvalue +false + +property + + diff --git a/code/studio/src/plugins/gui_editor/expressions/or.xml b/code/studio/src/plugins/gui_editor/expressions/or.xml new file mode 100644 index 000000000..2d977267c --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/or.xml @@ -0,0 +1,9 @@ + +Logical +or +true + +A +B + + diff --git a/code/studio/src/plugins/gui_editor/expressions/rand.xml b/code/studio/src/plugins/gui_editor/expressions/rand.xml new file mode 100644 index 000000000..b284dc241 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/rand.xml @@ -0,0 +1,5 @@ + +Mathematical +rand +false + diff --git a/code/studio/src/plugins/gui_editor/expressions/sal.xml b/code/studio/src/plugins/gui_editor/expressions/sal.xml new file mode 100644 index 000000000..3190f4420 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/sal.xml @@ -0,0 +1,9 @@ + +Bits +sal +false + +A +B + + diff --git a/code/studio/src/plugins/gui_editor/expressions/sar.xml b/code/studio/src/plugins/gui_editor/expressions/sar.xml new file mode 100644 index 000000000..75fcd57d7 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/sar.xml @@ -0,0 +1,9 @@ + +Bits +sar +false + +A +B + + diff --git a/code/studio/src/plugins/gui_editor/expressions/secondsToTimeString.xml b/code/studio/src/plugins/gui_editor/expressions/secondsToTimeString.xml new file mode 100644 index 000000000..fda7dd1c8 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/secondsToTimeString.xml @@ -0,0 +1,8 @@ + +Time +secondsToTimeString +false + +A + + diff --git a/code/studio/src/plugins/gui_editor/expressions/secondsToTimeStringShort.xml b/code/studio/src/plugins/gui_editor/expressions/secondsToTimeStringShort.xml new file mode 100644 index 000000000..042cf06de --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/secondsToTimeStringShort.xml @@ -0,0 +1,8 @@ + +Time +secondsToTimeStringShort +false + +A + + diff --git a/code/studio/src/plugins/gui_editor/expressions/shl.xml b/code/studio/src/plugins/gui_editor/expressions/shl.xml new file mode 100644 index 000000000..653a142a6 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/shl.xml @@ -0,0 +1,9 @@ + +Bits +shl +false + +A +B + + diff --git a/code/studio/src/plugins/gui_editor/expressions/shr.xml b/code/studio/src/plugins/gui_editor/expressions/shr.xml new file mode 100644 index 000000000..435816f6e --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/shr.xml @@ -0,0 +1,9 @@ + +Bits +shr +false + +A +B + + diff --git a/code/studio/src/plugins/gui_editor/expressions/str.xml b/code/studio/src/plugins/gui_editor/expressions/str.xml new file mode 100644 index 000000000..c98ae89eb --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/str.xml @@ -0,0 +1,9 @@ + +String +str +true + +A +B + + diff --git a/code/studio/src/plugins/gui_editor/expressions/sub.xml b/code/studio/src/plugins/gui_editor/expressions/sub.xml new file mode 100644 index 000000000..5f35c2895 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/sub.xml @@ -0,0 +1,9 @@ + +Mathematical +sub +false + +A +B + + diff --git a/code/studio/src/plugins/gui_editor/expressions/switch.xml b/code/studio/src/plugins/gui_editor/expressions/switch.xml new file mode 100644 index 000000000..19f94f9d3 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/switch.xml @@ -0,0 +1,10 @@ + +Logical +switch +true + +A +B +C + + diff --git a/code/studio/src/plugins/gui_editor/expressions/value.xml b/code/studio/src/plugins/gui_editor/expressions/value.xml new file mode 100644 index 000000000..9bd57fc95 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/expressions/value.xml @@ -0,0 +1,6 @@ + +Value +value +true +false + diff --git a/code/studio/src/plugins/gui_editor/fonts/ryzom.ttf b/code/studio/src/plugins/gui_editor/fonts/ryzom.ttf new file mode 100644 index 000000000..c1b19d870 Binary files /dev/null and b/code/studio/src/plugins/gui_editor/fonts/ryzom.ttf differ diff --git a/code/studio/src/plugins/gui_editor/gui_editor_config.h.cmake b/code/studio/src/plugins/gui_editor/gui_editor_config.h.cmake new file mode 100644 index 000000000..0e36dcb79 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/gui_editor_config.h.cmake @@ -0,0 +1,8 @@ +#ifndef GUI_EDITOR_CONFIG_H +#define GUI_EDITOR_CONFIG_H + +#define WIDGETS_DIR "${OVQT_IMP_DATA_DIR}/widgets" +#define EXPRESSIONS_DIR "${OVQT_IMP_DATA_DIR}/expressions" + +#endif + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_constants.h b/code/studio/src/plugins/gui_editor/gui_editor_constants.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_constants.h rename to code/studio/src/plugins/gui_editor/gui_editor_constants.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_context.cpp b/code/studio/src/plugins/gui_editor/gui_editor_context.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_context.cpp rename to code/studio/src/plugins/gui_editor/gui_editor_context.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_context.h b/code/studio/src/plugins/gui_editor/gui_editor_context.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_context.h rename to code/studio/src/plugins/gui_editor/gui_editor_context.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_core_listener.cpp b/code/studio/src/plugins/gui_editor/gui_editor_core_listener.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_core_listener.cpp rename to code/studio/src/plugins/gui_editor/gui_editor_core_listener.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_core_listener.h b/code/studio/src/plugins/gui_editor/gui_editor_core_listener.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_core_listener.h rename to code/studio/src/plugins/gui_editor/gui_editor_core_listener.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_global.h b/code/studio/src/plugins/gui_editor/gui_editor_global.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_global.h rename to code/studio/src/plugins/gui_editor/gui_editor_global.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_plugin.cpp b/code/studio/src/plugins/gui_editor/gui_editor_plugin.cpp similarity index 96% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_plugin.cpp rename to code/studio/src/plugins/gui_editor/gui_editor_plugin.cpp index d0fea4df3..d5f2403f1 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_plugin.cpp +++ b/code/studio/src/plugins/gui_editor/gui_editor_plugin.cpp @@ -37,6 +37,9 @@ namespace GUIEditor qDeleteAll(m_autoReleaseObjects); m_autoReleaseObjects.clear(); + + delete m_libContext; + m_libContext = NULL; } bool GUIEditorPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_plugin.h b/code/studio/src/plugins/gui_editor/gui_editor_plugin.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_plugin.h rename to code/studio/src/plugins/gui_editor/gui_editor_plugin.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_window.cpp b/code/studio/src/plugins/gui_editor/gui_editor_window.cpp similarity index 67% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_window.cpp rename to code/studio/src/plugins/gui_editor/gui_editor_window.cpp index 341338d8d..002002abd 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_window.cpp +++ b/code/studio/src/plugins/gui_editor/gui_editor_window.cpp @@ -40,10 +40,11 @@ #include "project_file_parser.h" #include "project_file_serializer.h" #include "project_window.h" -#include "nelgui_widget.h" +#include "nelgui_ctrl.h" #include "editor_selection_watcher.h" #include "editor_message_processor.h" #include "add_widget_widget.h" +#include "new_gui_dlg.h" namespace GUIEditor { @@ -55,6 +56,7 @@ namespace GUIEditor GUIEditorWindow::GUIEditorWindow(QWidget *parent) : QMainWindow(parent) { + menu = NULL; m_ui.setupUi(this); messageProcessor = new CEditorMessageProcessor; m_undoStack = new QUndoStack(this); @@ -64,8 +66,8 @@ namespace GUIEditor projectWindow = new ProjectWindow; addWidgetWidget = new AddWidgetWidget; connect( projectWindow, SIGNAL( projectFilesChanged() ), this, SLOT( onProjectFilesChanged() ) ); - viewPort = new NelGUIWidget; - setCentralWidget( viewPort ); + GUICtrl = new NelGUICtrl(); + setCentralWidget( GUICtrl->getViewPort() ); widgetInfoTree = new CWidgetInfoTree; @@ -96,9 +98,9 @@ namespace GUIEditor dock->setWidget( propBrowser ); addDockWidget( Qt::RightDockWidgetArea, dock ); - viewPort->init(); + GUICtrl->init(); - connect( viewPort, SIGNAL( guiLoadComplete() ), this, SLOT( onGUILoaded() ) ); + connect( GUICtrl, SIGNAL( guiLoadComplete() ), this, SLOT( onGUILoaded() ) ); connect( widgetProps, SIGNAL( treeChanged() ), this, SLOT( onTreeChanged() ) ); connect( addWidgetWidget, @@ -112,6 +114,8 @@ namespace GUIEditor { writeSettings(); + removeMenus(); + delete messageProcessor; messageProcessor = NULL; @@ -127,8 +131,8 @@ namespace GUIEditor delete projectWindow; projectWindow = NULL; - delete viewPort; - viewPort = NULL; + delete GUICtrl; + GUICtrl = NULL; delete addWidgetWidget; addWidgetWidget = NULL; @@ -178,7 +182,9 @@ namespace GUIEditor currentProject = projectFiles.projectName.c_str(); currentProjectFile = fileName; projectWindow->setupFiles( projectFiles ); - if( viewPort->parse( projectFiles ) ) + GUICtrl->setWorkDir( _lastDir ); + + if( GUICtrl->parse( projectFiles ) ) { hierarchyView->buildHierarchy( projectFiles.masterGroup ); } @@ -194,13 +200,64 @@ namespace GUIEditor void GUIEditorWindow::newDocument() { - } + NewGUIDlg d; + int result = d.exec(); + + if( result == QDialog::Rejected ) + return; - void GUIEditorWindow::save() - { - if( currentProject.isEmpty() ) + close(); + + std::string proj = d.getProjectName().toUtf8().constData(); + std::string wnd = d.getWindowName().toUtf8().constData(); + std::string mg = std::string( "ui:" ) + proj; + std::string dir = d.getProjectDirectory().toUtf8().constData(); + _lastDir = dir.c_str(); + std::string uiFile = "ui_" + proj + ".xml"; + + QList< QString > mapList; + d.getMapList( mapList ); + + bool b = GUICtrl->createNewGUI( proj, wnd ); + if( !b ) + { + QMessageBox::information( this, + tr( "Creating new GUI project" ), + tr( "Failed to create new GUI project :(" ) ); + reset(); + return; + } + + hierarchyView->buildHierarchy( mg ); + + projectFiles.projectName = proj; + projectFiles.masterGroup = mg; + projectFiles.activeGroup = std::string( "ui:" ) + proj + ":" + wnd; + projectFiles.version = SProjectFiles::NEW; + projectFiles.guiFiles.push_back( uiFile ); + + for( int i = 0; i < mapList.size(); i++ ) + { + projectFiles.mapFiles.push_back( mapList[ i ].toUtf8().constData() ); + } + + b = GUICtrl->loadMapFiles( projectFiles.mapFiles ); + if( !b ) + { + QMessageBox::information( this, + tr( "Creating new GUI project" ), + tr( "Failed to create new GUI project: Couldn't load map files. " ) ); + reset(); return; + } + + projectWindow->setupFiles( projectFiles ); + + currentProject = proj.c_str(); + currentProjectFile = std::string( dir + "/" + proj + ".xml" ).c_str(); + + // Save the project file CProjectFileSerializer serializer; serializer.setFile( currentProjectFile.toUtf8().constData() ); if( !serializer.serialize( projectFiles ) ) @@ -211,33 +268,26 @@ namespace GUIEditor return; } - // Can't save old projects any further, since the widgets are in multiple files in them - // using templates, styles and whatnot. There's no way to restore the original XML structure - // after it's loaded - if( projectParser.getProjectVersion() == OLD ) + // Save the GUI file + WidgetSerializer widgetSerializer; + widgetSerializer.setFile( dir + "/" + uiFile ); + widgetSerializer.setActiveGroup( projectFiles.activeGroup ); + if( !widgetSerializer.serialize( projectFiles.masterGroup ) ) + { + QMessageBox::critical( this, + tr( "Failed to save project" ), + tr( "There was an error while trying to save the project." ) ); return; + } } - void GUIEditorWindow::saveAs() + void GUIEditorWindow::save() { if( currentProject.isEmpty() ) return; - QString dir = - QFileDialog::getExistingDirectory( this, tr( "Save project as..." ) ); - - if( dir.isEmpty() ) - return; - - projectFiles.guiFiles.clear(); - projectFiles.guiFiles.push_back( "ui_" + projectFiles.projectName + ".xml" ); - projectFiles.version = NEW; - - QString newFile = - dir + "/" + projectFiles.projectName.c_str() + ".xml"; - CProjectFileSerializer serializer; - serializer.setFile( newFile.toUtf8().constData() ); + serializer.setFile( currentProjectFile.toUtf8().constData() ); if( !serializer.serialize( projectFiles ) ) { QMessageBox::critical( this, @@ -246,11 +296,18 @@ namespace GUIEditor return; } - std::string guiFile = - std::string( dir.toUtf8().constData() ) + "/" + "ui_" + projectFiles.projectName + ".xml"; + // Can't save old projects any further, since the widgets are in multiple files in them + // using templates, styles and whatnot. There's no way to restore the original XML structure + // after it's loaded + if( projectFiles.version == SProjectFiles::OLD ) + return; + + std::string f = _lastDir.toUtf8().constData(); + f += "/"; + f += projectFiles.guiFiles[ 0 ]; WidgetSerializer widgetSerializer; - widgetSerializer.setFile( guiFile ); + widgetSerializer.setFile( f ); widgetSerializer.setActiveGroup( projectFiles.activeGroup ); if( !widgetSerializer.serialize( projectFiles.masterGroup ) ) { @@ -259,11 +316,48 @@ namespace GUIEditor tr( "There was an error while trying to save the project." ) ); return; } + } - QMessageBox::information( this, - tr( "Save successful" ), - tr( "Project saved successfully!" ) ); + void GUIEditorWindow::saveAs() + { + if( currentProject.isEmpty() ) + return; + + QString dir = + QFileDialog::getExistingDirectory( this, tr( "Save project as..." ) ); + + if( dir.isEmpty() ) + return; + _lastDir = dir; + + if( projectFiles.version == SProjectFiles::OLD ) + { + projectFiles.guiFiles.clear(); + projectFiles.guiFiles.push_back( "ui_" + projectFiles.projectName + ".xml" ); + projectFiles.version = SProjectFiles::NEW; + + } + + currentProjectFile = _lastDir; + currentProjectFile += "/"; + currentProjectFile += projectFiles.projectName.c_str(); + currentProjectFile += ".xml"; + + save(); + } + void GUIEditorWindow::reset() + { + projectFiles.clearAll(); + projectWindow->clear(); + hierarchyView->clearHierarchy(); + GUICtrl->reset(); + browserCtrl.clear(); + linkList->clear(); + procList->clear(); + currentProject = ""; + currentProjectFile = ""; + projectParser.clear(); } bool GUIEditorWindow::close() @@ -279,20 +373,11 @@ namespace GUIEditor return false; - CEditorSelectionWatcher *w = viewPort->getWatcher(); - disconnect( w, SIGNAL( sgnSelectionChanged( std::string& ) ), hierarchyView, SLOT( onSelectionChanged( std::string& ) ) ); - disconnect( w, SIGNAL( sgnSelectionChanged( std::string& ) ), &browserCtrl, SLOT( onSelectionChanged( std::string& ) ) ); + CEditorSelectionWatcher *w = GUICtrl->getWatcher(); + disconnect( w, SIGNAL( sgnSelectionChanged() ), hierarchyView, SLOT( onSelectionChanged() ) ); + disconnect( w, SIGNAL( sgnSelectionChanged() ), &browserCtrl, SLOT( onSelectionChanged() ) ); - projectFiles.clearAll(); - projectWindow->clear(); - hierarchyView->clearHierarchy(); - viewPort->reset(); - browserCtrl.clear(); - linkList->clear(); - procList->clear(); - currentProject = ""; - currentProjectFile = ""; - projectParser.clear(); + reset(); return true; } @@ -302,7 +387,7 @@ namespace GUIEditor setCursor( Qt::WaitCursor ); projectWindow->updateFiles( projectFiles ); - if( !viewPort->parse( projectFiles ) ) + if( !GUICtrl->parse( projectFiles ) ) { QMessageBox::critical( this, tr( "Error parsing GUI XML files" ), @@ -318,9 +403,9 @@ namespace GUIEditor procList->onGUILoaded(); linkList->onGUILoaded(); - CEditorSelectionWatcher *w = viewPort->getWatcher(); - connect( w, SIGNAL( sgnSelectionChanged( std::string& ) ), hierarchyView, SLOT( onSelectionChanged( std::string& ) ) ); - connect( w, SIGNAL( sgnSelectionChanged( std::string& ) ), &browserCtrl, SLOT( onSelectionChanged( std::string& ) ) ); + CEditorSelectionWatcher *w = GUICtrl->getWatcher(); + connect( w, SIGNAL( sgnSelectionChanged() ), hierarchyView, SLOT( onSelectionChanged() ) ); + connect( w, SIGNAL( sgnSelectionChanged() ), &browserCtrl, SLOT( onSelectionChanged() ) ); } void GUIEditorWindow::onAddWidgetClicked() @@ -337,17 +422,30 @@ namespace GUIEditor addWidgetWidget->setupWidgetInfo( widgetInfoTree ); } + + void GUIEditorWindow::hideEvent( QHideEvent *evnt ) + { + QWidget::hideEvent( evnt ); + GUICtrl->hide(); + } + + void GUIEditorWindow::showEvent( QShowEvent *evnt ) + { + QWidget::showEvent( evnt ); + GUICtrl->show(); + } + void GUIEditorWindow::createMenus() { Core::MenuManager *mm = Core::ICore::instance()->menuManager(); - //QAction *newAction = mm->action( Core::Constants::NEW ); + QAction *newAction = mm->action( Core::Constants::NEW ); QAction *saveAction = mm->action( Core::Constants::SAVE ); QAction *saveAsAction = mm->action( Core::Constants::SAVE_AS ); QAction *closeAction = mm->action( Core::Constants::CLOSE ); QAction *delAction = mm->action( Core::Constants::DEL ); - //if( newAction != NULL ) - // newAction->setEnabled( true ); + if( newAction != NULL ) + newAction->setEnabled( true ); if( saveAction != NULL ) saveAction->setEnabled( true ); if( saveAsAction != NULL ) @@ -360,11 +458,9 @@ namespace GUIEditor connect( delAction, SIGNAL( triggered( bool ) ), messageProcessor, SLOT( onDelete() ) ); } - QMenu *menu = mm->menu( Core::Constants::M_TOOLS ); - if( menu != NULL ) + QMenu *m = mm->menuBar()->addMenu( "GUI Editor" ); + if( m != NULL ) { - QMenu *m = menu->addMenu( "GUI Editor" ); - QAction *a = new QAction( "Widget Properties", this ); connect( a, SIGNAL( triggered( bool ) ), widgetProps, SLOT( show() ) ); m->addAction( a ); @@ -384,8 +480,40 @@ namespace GUIEditor a = new QAction( "Add Widget", this ); connect( a, SIGNAL( triggered( bool ) ), this, SLOT( onAddWidgetClicked() ) ); m->addAction( a ); + + a = new QAction( "Group", this ); + connect( a, SIGNAL( triggered() ), messageProcessor, SLOT( onGroup() ) ); + m->addAction( a ); + + a = new QAction( "Ungroup", this ); + connect( a, SIGNAL( triggered() ), messageProcessor, SLOT( onUngroup() ) ); + m->addAction( a ); + + + // ---------------------------------------------------------------------------------- + m->addSeparator(); + + a = new QAction( "Select groups", this ); + a->setCheckable( true ); + a->setChecked( false ); + connect( a, SIGNAL( triggered( bool ) ), messageProcessor, SLOT( onSetGroupSelection( bool ) ) ); + m->addAction( a ); + + a = new QAction( "Multiselect", this ); + a->setCheckable( true ); + a->setChecked( false ); + connect( a, SIGNAL( triggered( bool ) ), messageProcessor, SLOT( onSetMultiSelection( bool ) ) ); + m->addAction( a ); + + menu = m; } } + + void GUIEditorWindow::removeMenus() + { + delete menu; + menu = NULL; + } void GUIEditorWindow::readSettings() { diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_window.h b/code/studio/src/plugins/gui_editor/gui_editor_window.h similarity index 91% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_window.h rename to code/studio/src/plugins/gui_editor/gui_editor_window.h index e1a8b8b2d..4a0a919a4 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_window.h +++ b/code/studio/src/plugins/gui_editor/gui_editor_window.h @@ -25,6 +25,7 @@ #include "property_browser_ctrl.h" class QtTreePropertyBrowser; +class QMenu; namespace GUIEditor { @@ -34,7 +35,7 @@ namespace GUIEditor class LinkList; class ProcList; class ProjectWindow; - class NelGUIWidget; + class NelGUICtrl; class CWidgetInfoTree; class CEditorMessageProcessor; class AddWidgetWidget; @@ -64,8 +65,14 @@ private Q_SLOTS: void onAddWidgetClicked(); void onTreeChanged(); +protected: + void hideEvent( QHideEvent *evnt ); + void showEvent( QShowEvent *evnt ); + private: + void reset(); void createMenus(); + void removeMenus(); void readSettings(); @@ -80,7 +87,7 @@ private: LinkList *linkList; ProcList *procList; ProjectWindow *projectWindow; - NelGUIWidget *viewPort; + NelGUICtrl *GUICtrl; CWidgetInfoTree *widgetInfoTree; CEditorMessageProcessor *messageProcessor; AddWidgetWidget *addWidgetWidget; @@ -88,6 +95,8 @@ private: CPropBrowserCtrl browserCtrl; QString currentProject; QString currentProjectFile; + + QMenu *menu; }; } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_window.ui b/code/studio/src/plugins/gui_editor/gui_editor_window.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_window.ui rename to code/studio/src/plugins/gui_editor/gui_editor_window.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/link_editor.cpp b/code/studio/src/plugins/gui_editor/link_editor.cpp similarity index 72% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/link_editor.cpp rename to code/studio/src/plugins/gui_editor/link_editor.cpp index c57a6cd09..3cb49f37a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/link_editor.cpp +++ b/code/studio/src/plugins/gui_editor/link_editor.cpp @@ -18,20 +18,49 @@ #include "link_editor.h" #include "nel/gui/interface_group.h" #include "nel/gui/widget_manager.h" +#include "expression_editor.h" +#include namespace GUIEditor { + class LinkEditorPvt + { + public: + + LinkEditorPvt() + { + ee = new ExpressionEditor(); + ee->load(); + } + + ~LinkEditorPvt() + { + delete ee; + ee = NULL; + } + + ExpressionEditor *ee; + }; + + LinkEditor::LinkEditor( QWidget *parent ) : QWidget( parent ) { setupUi( this ); setup(); + + m_pvt = new LinkEditorPvt(); + connect( okButton, SIGNAL( clicked( bool ) ), this, SLOT( onOKButtonClicked() ) ); connect( cancelButton, SIGNAL( clicked( bool ) ), this, SLOT( hide() ) ); + connect( expressionEdit, SIGNAL( customContextMenuRequested( const QPoint& ) ), this, SLOT( onTextEditContextMenu( const QPoint& ) ) ); + connect( m_pvt->ee, SIGNAL( closing() ), this, SLOT( onEEClosing() ) ); } LinkEditor::~LinkEditor() { + delete m_pvt; + m_pvt = NULL; } void LinkEditor::setup() @@ -89,4 +118,23 @@ namespace GUIEditor hide(); } + + void LinkEditor::onTextEditContextMenu( const QPoint &pos ) + { + QMenu *menu = expressionEdit->createStandardContextMenu(); + QAction *a = menu->addAction( "Expression Editor" ); + connect( a, SIGNAL( triggered() ), this, SLOT( onEE() ) ); + + menu->exec( mapToGlobal( pos ) ); + } + + void LinkEditor::onEE() + { + m_pvt->ee->show(); + } + + void LinkEditor::onEEClosing() + { + expressionEdit->setPlainText( m_pvt->ee->result() ); + } } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/link_editor.h b/code/studio/src/plugins/gui_editor/link_editor.h similarity index 90% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/link_editor.h rename to code/studio/src/plugins/gui_editor/link_editor.h index b70019d20..f5617982e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/link_editor.h +++ b/code/studio/src/plugins/gui_editor/link_editor.h @@ -23,6 +23,8 @@ namespace GUIEditor { + class LinkEditorPvt; + class LinkEditor : public QWidget, public Ui::LinkEditor { Q_OBJECT @@ -35,12 +37,16 @@ namespace GUIEditor Q_SIGNALS: void okClicked(); - + private Q_SLOTS: void onOKButtonClicked(); + void onTextEditContextMenu( const QPoint &pos ); + void onEE(); + void onEEClosing(); private: uint32 currentLinkId; + LinkEditorPvt *m_pvt; }; } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/link_editor.ui b/code/studio/src/plugins/gui_editor/link_editor.ui similarity index 93% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/link_editor.ui rename to code/studio/src/plugins/gui_editor/link_editor.ui index 13a6e7d7e..657b0eabc 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/link_editor.ui +++ b/code/studio/src/plugins/gui_editor/link_editor.ui @@ -26,6 +26,9 @@ + + Qt::CustomContextMenu + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/link_list.cpp b/code/studio/src/plugins/gui_editor/link_list.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/link_list.cpp rename to code/studio/src/plugins/gui_editor/link_list.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/link_list.h b/code/studio/src/plugins/gui_editor/link_list.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/link_list.h rename to code/studio/src/plugins/gui_editor/link_list.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/link_list.ui b/code/studio/src/plugins/gui_editor/link_list.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/link_list.ui rename to code/studio/src/plugins/gui_editor/link_list.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/nelgui_widget.cpp b/code/studio/src/plugins/gui_editor/nelgui_ctrl.cpp similarity index 60% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/nelgui_widget.cpp rename to code/studio/src/plugins/gui_editor/nelgui_ctrl.cpp index d86d31269..4852b227f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/nelgui_widget.cpp +++ b/code/studio/src/plugins/gui_editor/nelgui_ctrl.cpp @@ -15,13 +15,14 @@ // along with this program. If not, see . -#include "nelgui_widget.h" +#include "nelgui_ctrl.h" #include "nel/misc/path.h" #include "nel/gui/view_renderer.h" #include "nel/gui/interface_group.h" #include "nel/gui/widget_manager.h" #include "nel/gui/action_handler.h" #include "nel/gui/lua_manager.h" +#include "nel/gui/event_listener.h" #include "nel/misc/path.h" #include "nel/misc/i18n.h" #include @@ -29,19 +30,24 @@ #include #include "editor_selection_watcher.h" +#include "../core/Nel3DWidget/nel3d_widget.h" + namespace GUIEditor { std::set< std::string > hwCursors; - NelGUIWidget::NelGUIWidget( QWidget *parent ) : - Nel3DWidget( parent ) + NelGUICtrl::NelGUICtrl( QObject *parent ) : + QObject( parent ) { timerID = 0; guiLoaded = false; watcher = NULL; + w = new Nel3DWidget(); + eventListener = new NLGUI::CEventListener(); + listening = false; } - NelGUIWidget::~NelGUIWidget() + NelGUICtrl::~NelGUICtrl() { guiLoaded = false; if( timerID != 0 ) @@ -49,25 +55,27 @@ namespace GUIEditor NLGUI::CViewRenderer::release(); NLMISC::CI18N::setNoResolution( false ); - + + delete w; + w = NULL; } - void NelGUIWidget::init() + void NelGUICtrl::init() { NLMISC::CI18N::setNoResolution( true ); NLMISC::CPath::remapExtension( "dds", "tga", true ); NLMISC::CPath::remapExtension( "dds", "png", true ); NLMISC::CPath::remapExtension( "png", "tga", true ); - Nel3DWidget::init(); - createTextContext( "Ryzom.ttf" ); + w->init(); + w->createTextContext( "Ryzom.ttf" ); NLGUI::CAHManager::setEditorMode( true ); NLGUI::CLuaManager::setEditorMode( true ); NLGUI::CInterfaceElement::setEditorMode( true ); - NLGUI::CViewRenderer::setDriver( getDriver() ); - NLGUI::CViewRenderer::setTextContext( getTextContext() ); + NLGUI::CViewRenderer::setDriver( w->getDriver() ); + NLGUI::CViewRenderer::setTextContext( w->getTextContext() ); NLGUI::CViewRenderer::hwCursors = &hwCursors; NLGUI::CViewRenderer::getInstance()->init(); @@ -76,15 +84,35 @@ namespace GUIEditor watcher = new CEditorSelectionWatcher(); } - bool NelGUIWidget::parse( SProjectFiles &files ) + bool NelGUICtrl::parse( SProjectFiles &files ) { reset(); IParser *parser = CWidgetManager::getInstance()->getParser(); - std::vector< std::string >::iterator itr; - for( itr = files.mapFiles.begin(); itr != files.mapFiles.end(); ++itr ) + if( !loadMapFiles( files.mapFiles ) ) + return false; + + if( !parser->parseInterface( files.guiFiles, false ) ) + return false; + + CWidgetManager::getInstance()->updateAllLocalisedElements(); + CWidgetManager::getInstance()->activateMasterGroup( files.masterGroup, true ); + + CInterfaceElement *e = CWidgetManager::getInstance()->getElementFromId( files.activeGroup ); + if( e != NULL ) + e->setActive( true ); + + onGUILoaded(); + + return true; + } + + bool NelGUICtrl::loadMapFiles( const std::vector< std::string > &v ) + { + std::vector< std::string >::const_iterator itr; + for( itr = v.begin(); itr != v.end(); ++itr ) { - std::string &file = *itr; + const std::string &file = *itr; std::string::size_type i = file.find_last_of( '.' ); std::string mapFile = file.substr( 0, i ); mapFile.append( ".txt" ); @@ -96,26 +124,32 @@ namespace GUIEditor } } - if( !parser->parseInterface( files.guiFiles, false ) ) + return true; + } + + bool NelGUICtrl::createNewGUI( const std::string &project, const std::string &window ) + { + reset(); + bool ok = CWidgetManager::getInstance()->createNewGUI( project, window ); + if( !ok ) return false; + std::string mg = std::string( "ui:" ) + project; + std::string ag = mg + ":" + window; + CWidgetManager::getInstance()->updateAllLocalisedElements(); - CWidgetManager::getInstance()->activateMasterGroup( files.masterGroup, true ); + CWidgetManager::getInstance()->activateMasterGroup( mg, true ); - CInterfaceElement *e = CWidgetManager::getInstance()->getElementFromId( files.activeGroup ); + CInterfaceElement *e = CWidgetManager::getInstance()->getElementFromId( ag ); if( e != NULL ) e->setActive( true ); - timerID = startTimer( 200 ); - guiLoaded = true; - Q_EMIT guiLoadComplete(); - - CWidgetManager::getInstance()->registerSelectionWatcher( watcher ); + onGUILoaded(); return true; } - void NelGUIWidget::reset() + void NelGUICtrl::reset() { guiLoaded = false; if( timerID != 0 ) @@ -125,45 +159,78 @@ namespace GUIEditor CWidgetManager::getInstance()->reset(); CWidgetManager::getInstance()->getParser()->removeAll(); CViewRenderer::getInstance()->reset(); - clear(); + w->clear(); } - void NelGUIWidget::draw() + void NelGUICtrl::draw() { - getDriver()->clearBuffers( NLMISC::CRGBA::Black ); + w->getDriver()->clearBuffers( NLMISC::CRGBA::Black ); CWidgetManager::getInstance()->checkCoords(); CWidgetManager::getInstance()->drawViews( 0 ); - getDriver()->swapBuffers(); - } - - void NelGUIWidget::paintEvent( QPaintEvent *evnt ) - { - if( !guiLoaded ) - clear(); + w->getDriver()->swapBuffers(); } - void NelGUIWidget::timerEvent( QTimerEvent *evnt ) + void NelGUICtrl::timerEvent( QTimerEvent *evnt ) { if( evnt->timerId() == timerID ) { if( guiLoaded ) { - getDriver()->EventServer.pump(); + w->getDriver()->EventServer.pump(); draw(); } + else + { + w->clear(); + } } } - void NelGUIWidget::showEvent( QShowEvent *evnt ) + void NelGUICtrl::onGUILoaded() + { + timerID = startTimer( 25 ); + guiLoaded = true; + Q_EMIT guiLoadComplete(); + + CWidgetManager::getInstance()->registerSelectionWatcher( watcher ); + } + + void NelGUICtrl::show() { if( timerID == 0 ) timerID = startTimer( 200 ); + + if( !listening ) + { + eventListener->addToServer( &w->getDriver()->EventServer ); + listening = true; + } } - void NelGUIWidget::hideEvent( QHideEvent *evnt ) + void NelGUICtrl::hide() { if( timerID != 0 ) + { killTimer( timerID ); + timerID = 0; + } + + if( listening ) + { + eventListener->removeFromServer(); + listening = false; + } + } + + void NelGUICtrl::setWorkDir( const QString &dir ) + { + IParser *parser = CWidgetManager::getInstance()->getParser(); + parser->setWorkDir( std::string( dir.toUtf8().constData() ) ); + } + + QWidget* NelGUICtrl::getViewPort() + { + return w; } } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/nelgui_widget.h b/code/studio/src/plugins/gui_editor/nelgui_ctrl.h similarity index 68% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/nelgui_widget.h rename to code/studio/src/plugins/gui_editor/nelgui_ctrl.h index 34c510507..d54c78c7a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/nelgui_widget.h +++ b/code/studio/src/plugins/gui_editor/nelgui_ctrl.h @@ -18,41 +18,62 @@ #ifndef NELGUI_WIDGET_H #define NELGUI_WIDGET_H -#include "nel3d_widget.h" +#include #include "project_files.h" +class QWidget; +class Nel3DWidget; + +namespace NLGUI +{ + class CEventListener; +} + namespace GUIEditor { class CEditorSelectionWatcher; - /// Qt viewport for the Nel GUI library - class NelGUIWidget : public Nel3DWidget + /// Qt viewport controller for the Nel GUI library + class NelGUICtrl : public QObject { Q_OBJECT public: - NelGUIWidget( QWidget *parent = NULL ); - ~NelGUIWidget(); + NelGUICtrl( QObject *parent = NULL ); + ~NelGUICtrl(); void init(); bool parse( SProjectFiles &files ); + bool loadMapFiles( const std::vector< std::string > &v ); + bool createNewGUI( const std::string &project, const std::string &window ); void draw(); void reset(); CEditorSelectionWatcher* getWatcher(){ return watcher; } + QWidget* getViewPort(); + + void show(); + void hide(); + + void setWorkDir( const QString &dir ); + Q_SIGNALS: void guiLoadComplete(); protected: - void paintEvent( QPaintEvent *evnt ); void timerEvent( QTimerEvent *evnt ); - void showEvent( QShowEvent *evnt ); - void hideEvent( QHideEvent *evnt ); - private: + void onGUILoaded(); + int timerID; bool guiLoaded; CEditorSelectionWatcher *watcher; + + NLGUI::CEventListener *eventListener; + + Nel3DWidget *w; + + bool listening; }; } diff --git a/code/studio/src/plugins/gui_editor/new_gui_dlg.cpp b/code/studio/src/plugins/gui_editor/new_gui_dlg.cpp new file mode 100644 index 000000000..43faabf79 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/new_gui_dlg.cpp @@ -0,0 +1,138 @@ +// Ryzom Core Studio - GUI Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 "new_gui_dlg.h" +#include +#include + +NewGUIDlg::NewGUIDlg( QWidget *parent ) : +QDialog( parent ) +{ + m_ui.setupUi( this ); + + // Login texture map - temporaty measure until we add default textures for widgets to use + m_ui.mapList->addItem( "texture_interfaces_v3_login.tga" ); + + connect( m_ui.okButton, SIGNAL( clicked( bool ) ), this, SLOT( onOKClicked() ) ); + connect( m_ui.cancelButton, SIGNAL( clicked( bool ) ), this, SLOT( onCancelClicked() ) ); + connect( m_ui.projectDirTB, SIGNAL( clicked( bool ) ), this, SLOT( onProjectDirTBClicked() ) ); + connect( m_ui.addButton, SIGNAL( clicked( bool ) ), this, SLOT( onAddClicked() ) ); + connect( m_ui.removeButton, SIGNAL( clicked( bool ) ), this, SLOT( onRemoveClicked() ) ); + +} + +NewGUIDlg::~NewGUIDlg() +{ +} + +QString NewGUIDlg::getProjectName() const +{ + return m_ui.projectEdit->text(); +} + +QString NewGUIDlg::getWindowName() const +{ + return m_ui.windowEdit->text(); +} + +QString NewGUIDlg::getProjectDirectory() const +{ + return m_ui.projectDirEdit->text(); +} + +void NewGUIDlg::getMapList( QList< QString > &l ) +{ + l.clear(); + + for( int i = 0; i < m_ui.mapList->count(); i++ ) + { + l.push_back( m_ui.mapList->item( i )->text() ); + } +} + +void NewGUIDlg::onOKClicked() +{ + if( m_ui.projectEdit->text().isEmpty() ) + { + QMessageBox::information( this, + tr( "New project" ), + tr( "You must specify a project name!" ) ); + return; + } + + if( m_ui.windowEdit->text().isEmpty() ) + { + QMessageBox::information( this, + tr( "New project" ), + tr( "You must specify a window name!" ) ); + return; + } + + if( m_ui.projectDirEdit->text().isEmpty() ) + { + QMessageBox::information( this, + tr( "New project" ), + tr( "You must specify a project directory!" ) ); + return; + } + + accept(); +} + +void NewGUIDlg::onCancelClicked() +{ + reject(); +} + +void NewGUIDlg::onProjectDirTBClicked() +{ + QString dir = QFileDialog::getExistingDirectory( this, + tr( "Specify project directory" ), + "." ); + if( dir.isEmpty() ) + return; + + m_ui.projectDirEdit->setText( dir ); +} + +void NewGUIDlg::onAddClicked() +{ + if( m_ui.mapEdit->text().isEmpty() ) + return; + + QList< QListWidgetItem* > l = m_ui.mapList->findItems( m_ui.mapEdit->text(), Qt::MatchContains ); + if( !l.isEmpty() ) + { + return; + } + + m_ui.mapList->addItem( m_ui.mapEdit->text() ); + m_ui.mapEdit->clear(); +} + +void NewGUIDlg::onRemoveClicked() +{ + QListWidgetItem *item = m_ui.mapList->currentItem(); + if( item == NULL ) + return; + + delete item; +} + + + diff --git a/code/studio/src/plugins/gui_editor/new_gui_dlg.h b/code/studio/src/plugins/gui_editor/new_gui_dlg.h new file mode 100644 index 000000000..0d878461c --- /dev/null +++ b/code/studio/src/plugins/gui_editor/new_gui_dlg.h @@ -0,0 +1,50 @@ +// Ryzom Core Studio - GUI Editor Plugin +// +// Copyright (C) 2014 Laszlo Kis-Adam +// Copyright (C) 2010 Ryzom Core +// +// 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 NEW_GUI_DLG_H +#define NEW_GUI_DLG_H + +#include "ui_new_gui_dlg.h" +#include + +class NewGUIDlg : public QDialog +{ + Q_OBJECT + +public: + NewGUIDlg( QWidget *parent = NULL ); + ~NewGUIDlg(); + + QString getProjectName() const; + QString getWindowName() const; + QString getProjectDirectory() const; + void getMapList( QList< QString > &l ); + +private Q_SLOTS: + void onOKClicked(); + void onCancelClicked(); + void onProjectDirTBClicked(); + void onAddClicked(); + void onRemoveClicked(); + +private: + Ui::NewGUIDialog m_ui; +}; + +#endif + diff --git a/code/studio/src/plugins/gui_editor/new_gui_dlg.ui b/code/studio/src/plugins/gui_editor/new_gui_dlg.ui new file mode 100644 index 000000000..bf22e8c6b --- /dev/null +++ b/code/studio/src/plugins/gui_editor/new_gui_dlg.ui @@ -0,0 +1,130 @@ + + + NewGUIDialog + + + + 0 + 0 + 399 + 354 + + + + New GUI + + + + + + Project name + + + + + + + + + + Window name + + + + + + + + + + Project directory + + + + + + + + + + ... + + + + + + + Map files + + + + + + Add + + + + + + + + + + Remove + + + + + + + + + + + + + Qt::Horizontal + + + + 107 + 20 + + + + + + + + + + + 0 + 0 + + + + OK + + + + + + + + 0 + 0 + + + + Cancel + + + + + + + + + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/new_property_widget.cpp b/code/studio/src/plugins/gui_editor/new_property_widget.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/new_property_widget.cpp rename to code/studio/src/plugins/gui_editor/new_property_widget.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/new_property_widget.h b/code/studio/src/plugins/gui_editor/new_property_widget.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/new_property_widget.h rename to code/studio/src/plugins/gui_editor/new_property_widget.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/new_property_widget.ui b/code/studio/src/plugins/gui_editor/new_property_widget.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/new_property_widget.ui rename to code/studio/src/plugins/gui_editor/new_property_widget.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/new_widget_widget.cpp b/code/studio/src/plugins/gui_editor/new_widget_widget.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/new_widget_widget.cpp rename to code/studio/src/plugins/gui_editor/new_widget_widget.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/new_widget_widget.h b/code/studio/src/plugins/gui_editor/new_widget_widget.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/new_widget_widget.h rename to code/studio/src/plugins/gui_editor/new_widget_widget.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/new_widget_widget.ui b/code/studio/src/plugins/gui_editor/new_widget_widget.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/new_widget_widget.ui rename to code/studio/src/plugins/gui_editor/new_widget_widget.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/proc_editor.cpp b/code/studio/src/plugins/gui_editor/proc_editor.cpp similarity index 96% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/proc_editor.cpp rename to code/studio/src/plugins/gui_editor/proc_editor.cpp index c36b16f64..e96a1cce1 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/proc_editor.cpp +++ b/code/studio/src/plugins/gui_editor/proc_editor.cpp @@ -17,6 +17,7 @@ #include "proc_editor.h" #include "action_editor.h" +#include "action_list.h" #include #include #include "nel/gui/interface_group.h" @@ -35,10 +36,15 @@ namespace GUIEditor connect( removeButton, SIGNAL( clicked( bool ) ), this, SLOT( onRemoveButtonClicked() ) ); connect( upButton, SIGNAL( clicked( bool ) ), this, SLOT( onUpButtonClicked() ) ); connect( downButton, SIGNAL( clicked( bool ) ), this, SLOT( onDownButtonClicked() ) ); + + alist = new ActionList(); } ProcEditor::~ProcEditor() { + delete alist; + alist = NULL; + delete actionEditor; actionEditor = NULL; } @@ -84,17 +90,13 @@ namespace GUIEditor void ProcEditor::onAddButtonClicked() { - bool ok; - QString name = - QInputDialog::getText( this, - tr( "Adding new Action" ), - tr( "Please specify the name of the new action handler" ), - QLineEdit::Normal, - QString(), - &ok ); - - if( ok ) + alist->load(); + int result = alist->exec(); + + if( result == QDialog::Accepted ) { + QString name = alist->getSelectedAction(); + CProcedure *proc = CWidgetManager::getInstance()->getParser()->getProc( currentProc.toUtf8().constData() ); if( proc != NULL ) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/proc_editor.h b/code/studio/src/plugins/gui_editor/proc_editor.h similarity index 97% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/proc_editor.h rename to code/studio/src/plugins/gui_editor/proc_editor.h index 90579daa4..8debfef02 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/proc_editor.h +++ b/code/studio/src/plugins/gui_editor/proc_editor.h @@ -20,6 +20,8 @@ #include "ui_proc_editor.h" +class ActionList; + namespace GUIEditor { class ActionEditor; @@ -46,6 +48,8 @@ namespace GUIEditor ActionEditor *actionEditor; QString currentProc; + + ActionList *alist; }; } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/proc_editor.ui b/code/studio/src/plugins/gui_editor/proc_editor.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/proc_editor.ui rename to code/studio/src/plugins/gui_editor/proc_editor.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/proc_list.cpp b/code/studio/src/plugins/gui_editor/proc_list.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/proc_list.cpp rename to code/studio/src/plugins/gui_editor/proc_list.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/proc_list.h b/code/studio/src/plugins/gui_editor/proc_list.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/proc_list.h rename to code/studio/src/plugins/gui_editor/proc_list.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/proc_list.ui b/code/studio/src/plugins/gui_editor/proc_list.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/proc_list.ui rename to code/studio/src/plugins/gui_editor/proc_list.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/project_file_parser.cpp b/code/studio/src/plugins/gui_editor/project_file_parser.cpp similarity index 96% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/project_file_parser.cpp rename to code/studio/src/plugins/gui_editor/project_file_parser.cpp index 7213b332a..856b3c164 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/project_file_parser.cpp +++ b/code/studio/src/plugins/gui_editor/project_file_parser.cpp @@ -16,6 +16,7 @@ #include "project_file_parser.h" +#include "nel/misc/debug.h" namespace GUIEditor { @@ -57,12 +58,13 @@ namespace GUIEditor projectFiles.projectName = files.projectName; projectFiles.masterGroup = files.masterGroup; projectFiles.activeGroup = files.activeGroup; + projectFiles.version = files.version; } unsigned long CProjectFileParser::getProjectVersion() const { if( !loaded ) - return OLD; + return SProjectFiles::OLD; return files.version; } @@ -70,7 +72,7 @@ namespace GUIEditor void CProjectFileParser::clear() { files.projectName = ""; - files.version = OLD; + files.version = SProjectFiles::OLD; files.activeGroup = ""; files.guiFiles.clear(); files.mapFiles.clear(); @@ -208,7 +210,9 @@ namespace GUIEditor reader.readNext(); } if( files.mapFiles.empty() ) - return false; + { + nlinfo( "No map file(s) specified in project file." ); + } return true; } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/project_file_parser.h b/code/studio/src/plugins/gui_editor/project_file_parser.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/project_file_parser.h rename to code/studio/src/plugins/gui_editor/project_file_parser.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/project_file_serializer.cpp b/code/studio/src/plugins/gui_editor/project_file_serializer.cpp similarity index 97% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/project_file_serializer.cpp rename to code/studio/src/plugins/gui_editor/project_file_serializer.cpp index 4eb442d3f..0b34f511b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/project_file_serializer.cpp +++ b/code/studio/src/plugins/gui_editor/project_file_serializer.cpp @@ -25,7 +25,7 @@ namespace GUIEditor if( fileName.empty() ) return false; - if( project.version >= MAX_PROJECTFILE_VERSION ) + if( project.version >= SProjectFiles::MAX_PROJECTFILE_VERSION ) return false; out.open( fileName.c_str() ); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/project_file_serializer.h b/code/studio/src/plugins/gui_editor/project_file_serializer.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/project_file_serializer.h rename to code/studio/src/plugins/gui_editor/project_file_serializer.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/project_files.h b/code/studio/src/plugins/gui_editor/project_files.h similarity index 94% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/project_files.h rename to code/studio/src/plugins/gui_editor/project_files.h index 4ae58493b..786bd22e4 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/project_files.h +++ b/code/studio/src/plugins/gui_editor/project_files.h @@ -23,16 +23,17 @@ namespace GUIEditor { - enum ProjectVersion - { - OLD = 0, - NEW = 1, - MAX_PROJECTFILE_VERSION - }; - struct SProjectFiles { public: + + enum ProjectVersion + { + OLD = 0, + NEW = 1, + MAX_PROJECTFILE_VERSION + }; + std::string projectName; unsigned long version; std::string masterGroup; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/project_files/login.xml b/code/studio/src/plugins/gui_editor/project_files/login.xml similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/project_files/login.xml rename to code/studio/src/plugins/gui_editor/project_files/login.xml diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/project_window.cpp b/code/studio/src/plugins/gui_editor/project_window.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/project_window.cpp rename to code/studio/src/plugins/gui_editor/project_window.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/project_window.h b/code/studio/src/plugins/gui_editor/project_window.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/project_window.h rename to code/studio/src/plugins/gui_editor/project_window.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/project_window.ui b/code/studio/src/plugins/gui_editor/project_window.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/project_window.ui rename to code/studio/src/plugins/gui_editor/project_window.ui diff --git a/code/studio/src/plugins/gui_editor/property_browser_ctrl.cpp b/code/studio/src/plugins/gui_editor/property_browser_ctrl.cpp new file mode 100644 index 000000000..6db5423a3 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/property_browser_ctrl.cpp @@ -0,0 +1,973 @@ +// Object Viewer Qt GUI Editor plugin +// 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 "property_browser_ctrl.h" +#include "../../3rdparty/qtpropertybrowser/QtVariantPropertyManager" +#include "../../3rdparty/qtpropertybrowser/QtEnumPropertyManager" +#include "../../3rdparty/qtpropertybrowser/QtTreePropertyBrowser" +#include "../../3rdparty/qtpropertybrowser/QtEnumEditorFactory" +#include "nel/gui/interface_group.h" +#include "nel/gui/widget_manager.h" +#include +#include "widget_info_tree.h" +#include + +#include "action_property_manager.h" +#include "texture_property_manager.h" + +namespace +{ + class NelBMAlign + { + public: + + enum NELBMAlign + { + LB = 0, + RB = 1, + LT = 2, + RT = 3 + }; + + static int fromString( const std::string &s ) + { + int r = -1; + + if( s == "LB" ) + r = 0; + else + if( s == "RB" ) + r = 1; + else + if( s == "LT" ) + r = 2; + else + if( s == "RT" ) + r = 3; + + return r; + } + + static std::string toString( int value ) + { + std::string s; + + switch( value ) + { + case LB: s = "LB"; break; + case RB: s = "RB"; break; + case LT: s = "LT"; break; + case RT: s = "RT"; break; + } + + return s; + } + }; + + class NelTTParent + { + public: + + enum NELTTParent + { + TTPARENT_MOUSE = 0, + TTPARENT_CONTROL = 1, + TTPARENT_WINDOW = 2, + TTPARENT_SPECIAL_WINDOW = 3 + }; + + static int fromString( const std::string &s ) + { + int r = -1; + + if( s == "mouse" ) + r = TTPARENT_MOUSE; + else + if( s == "control" ) + r = TTPARENT_CONTROL; + else + if( s == "window" ) + r = TTPARENT_WINDOW; + else + if( s == "special" ) + r = TTPARENT_SPECIAL_WINDOW; + + return r; + } + + static std::string toString( int value ) + { + std::string s; + + switch( value ) + { + case TTPARENT_MOUSE: s = "mouse"; break; + case TTPARENT_CONTROL: s = "control"; break; + case TTPARENT_WINDOW: s = "window"; break; + case TTPARENT_SPECIAL_WINDOW: s = "special"; break; + } + + return s; + } + }; + + class NelPosRef + { + public: + + enum NELPosRef + { + POSREF_BL = 0, + POSREF_BM = 1, + POSREF_BR = 2, + POSREF_ML = 3, + POSREF_MM = 4, + POSREF_MR = 5, + POSREF_TL = 6, + POSREF_TM = 7, + POSREF_TR = 8 + }; + + static int fromString( const std::string &s ) + { + int r = -1; + + if( s == "BL" ) + r = POSREF_BL; + else + if( s == "BM" ) + r = POSREF_BM; + else + if( s == "BR" ) + r = POSREF_BR; + else + if( s == "ML" ) + r = POSREF_ML; + else + if( s == "MM" ) + r = POSREF_MM; + else + if( s == "MR" ) + r = POSREF_MR; + else + if( s == "TL" ) + r = POSREF_TL; + else + if( s == "TM" ) + r = POSREF_TM; + else + if( s == "TR" ) + r = POSREF_TR; + + return r; + } + + static std::string toString( int value ) + { + std::string v; + + switch( value ) + { + case POSREF_BL: v = "BL"; break; + case POSREF_BM: v = "BM"; break; + case POSREF_BR: v = "BR"; break; + case POSREF_ML: v = "ML"; break; + case POSREF_MM: v = "MM"; break; + case POSREF_MR: v = "MR"; break; + case POSREF_TL: v = "TL"; break; + case POSREF_TM: v = "TM"; break; + case POSREF_TR: v = "TR"; break; + } + + return v; + } + }; + + + class NelPosRefTT + { + public: + + enum NELPosRef + { + TTPOSREF_BL = 0, + TTPOSREF_BM = 1, + TTPOSREF_BR = 2, + TTPOSREF_ML = 3, + TTPOSREF_MM = 4, + TTPOSREF_MR = 5, + TTPOSREF_TL = 6, + TTPOSREF_TM = 7, + TTPOSREF_TR = 8, + TTPOSREF_AUTO = 9 + }; + + static int fromString( const std::string &s ) + { + int r = -1; + + if( s == "BL" ) + r = TTPOSREF_BL; + else + if( s == "BM" ) + r = TTPOSREF_BM; + else + if( s == "BR" ) + r = TTPOSREF_BR; + else + if( s == "ML" ) + r = TTPOSREF_ML; + else + if( s == "MM" ) + r = TTPOSREF_MM; + else + if( s == "MR" ) + r = TTPOSREF_MR; + else + if( s == "TL" ) + r = TTPOSREF_TL; + else + if( s == "TM" ) + r = TTPOSREF_TM; + else + if( s == "TR" ) + r = TTPOSREF_TR; + else + r = TTPOSREF_AUTO; + + return r; + } + + static std::string toString( int value ) + { + std::string v; + + switch( value ) + { + case TTPOSREF_BL: v = "BL"; break; + case TTPOSREF_BM: v = "BM"; break; + case TTPOSREF_BR: v = "BR"; break; + case TTPOSREF_ML: v = "ML"; break; + case TTPOSREF_MM: v = "MM"; break; + case TTPOSREF_MR: v = "MR"; break; + case TTPOSREF_TL: v = "TL"; break; + case TTPOSREF_TM: v = "TM"; break; + case TTPOSREF_TR: v = "TR"; break; + case TTPOSREF_AUTO: v = "auto"; break; + } + + return v; + } + }; + + + class NelButtonType + { + public: + + enum NELButtonTypes + { + BUTTON_TYPE_PUSH = 0, + BUTTON_TYPE_TOGGLE = 1, + BUTTON_TYPE_RADIO = 2 + }; + + static int fromString( const std::string &s ) + { + int r = -1; + + if( s == "push_button" ) + r = BUTTON_TYPE_PUSH; + else + if( s == "toggle_button" ) + r = BUTTON_TYPE_TOGGLE; + else + if( s == "radio_button" ) + r = BUTTON_TYPE_RADIO; + + return r; + } + + static std::string toString( int value ) + { + std::string v; + + switch( value ) + { + case BUTTON_TYPE_PUSH: v = "push_button"; break; + case BUTTON_TYPE_TOGGLE: v = "toggle_button"; break; + case BUTTON_TYPE_RADIO: v = "radio_button"; break; + } + + return v; + } + + }; + + class NelTxtJustification + { + public: + + enum NELTxtJustification + { + TEXT_CLIPWORD, + TEXT_DONTCLIPWORD, + TEXT_JUSTIFIED + }; + + static int fromString( const std::string &s ) + { + int r = -1; + + if( s == "clip_word" ) + r = TEXT_CLIPWORD; + else + if( s == "dont_clip_word" ) + r = TEXT_DONTCLIPWORD; + else + if( s == "justified" ) + r = TEXT_JUSTIFIED; + + return r; + } + + static std::string toString( int value ) + { + std::string v; + + switch( value ) + { + case TEXT_CLIPWORD: v = "clip_word"; break; + case TEXT_DONTCLIPWORD: v = "dont_clip_word"; break; + case TEXT_JUSTIFIED: v = "justified"; break; + } + + return v; + } + + }; + +} + +namespace GUIEditor +{ + + CPropBrowserCtrl::CPropBrowserCtrl() + { + browser = NULL; + propertyMgr = new QtVariantPropertyManager; + enumMgr = new QtEnumPropertyManager; + actionMgr = new ActionPropertyManager; + textureMgr = new TexturePropertyManager; + + variantFactory = new QtVariantEditorFactory; + enumFactory = new QtEnumEditorFactory; + actionFactory = new ActionEditorFactory; + textureFactory = new TextureEditorFactory; + + ttPairs[ "tooltip_posref" ] = "tooltip_parent_posref"; + ttPairs[ "tooltip_parent_posref" ] = "tooltip_posref"; + ttPairs[ "tooltip_posref_alt" ] = "tooltip_parent_posref_alt"; + ttPairs[ "tooltip_parent_posref_alt" ] = "tooltip_posref_alt"; + + } + + CPropBrowserCtrl::~CPropBrowserCtrl() + { + delete textureMgr; + textureMgr = NULL; + delete actionMgr; + actionMgr = NULL; + delete enumMgr; + enumMgr = NULL; + delete propertyMgr; + propertyMgr = NULL; + + delete textureFactory; + textureFactory = NULL; + delete actionFactory; + actionFactory = NULL; + delete variantFactory; + variantFactory = NULL; + delete enumFactory; + enumFactory = NULL; + + browser = NULL; + } + + void CPropBrowserCtrl::setBrowser( QtTreePropertyBrowser *b ) + { + browser = b; + } + + void CPropBrowserCtrl::setupWidgetInfo( CWidgetInfoTree *tree ) + { + widgetInfo.clear(); + + std::vector< std::string > names; + tree->getNames( names ); + + std::vector< std::string >::const_iterator itr; + for( itr = names.begin(); itr != names.end(); ++itr ) + { + CWidgetInfoTreeNode *node = tree->findNodeByName( *itr ); + const SWidgetInfo &w = node->getInfo(); + widgetInfo[ w.GUIName ] = w; + } + } + + void CPropBrowserCtrl::clear() + { + disablePropertyWatchers(); + browser->clear(); + } + + void CPropBrowserCtrl::onSelectionChanged() + { + if( browser == NULL ) + return; + + disablePropertyWatchers(); + browser->clear(); + + std::vector< std::string > selection; + CWidgetManager::getInstance()->getEditorSelection( selection ); + + if( selection.size() != 1 ) + return; + + CInterfaceElement *e = CWidgetManager::getInstance()->getElementFromId( selection[ 0 ] ); + if( e == NULL ) + { + enablePropertyWatchers(); + return; + } + + currentElement = selection[ 0 ]; + + std::string n = e->getClassName(); + + setupProperties( n, e ); + + + // Need to set these up every time, otherwise the editors won't work + // probably the clear() method clears them too... + browser->setFactoryForManager( propertyMgr, variantFactory ); + browser->setFactoryForManager( enumMgr, enumFactory ); + browser->setFactoryForManager( actionMgr, actionFactory ); + browser->setFactoryForManager( textureMgr, textureFactory ); + + enablePropertyWatchers(); + } + + void CPropBrowserCtrl::onPropertyChanged( QtProperty *prop, const QVariant &v ) + { + QString propName = prop->propertyName(); + QString propValue = prop->valueText(); + + // for some reason booleans cannot be extracted from a QtProperty :( + if( propValue.isEmpty() ) + { + QtVariantProperty *p = propertyMgr->variantProperty( prop ); + if( p != NULL ) + propValue = p->value().toString(); + } + + if( v.type() == QVariant::Color ) + { + QColor c = v.value< QColor >(); + QString val = "%1 %2 %3 %4"; + val = val.arg( c.red() ).arg( c.green() ).arg( c.blue() ).arg( c.alpha() ); + propValue = val; + } + + CInterfaceElement *e = CWidgetManager::getInstance()->getElementFromId( currentElement ); + if( e == NULL ) + return; + e->setProperty( propName.toUtf8().constData(), propValue.toUtf8().constData() ); + + CInterfaceGroup *g = e->getParent(); + if( g != NULL ) + g->updateCoords(); + + + // Make sure the changes are applied + bool active = e->getActive(); + e->setActive( !active ); + e->setActive( active ); + } + + void CPropBrowserCtrl::onEnumPropertyChanged( QtProperty *prop, int value ) + { + QString propName = prop->propertyName(); + std::string n = propName.toUtf8().constData(); + + // Try to find the type for this property + std::map< std::string, std::string >::const_iterator itr = + nameToType.find( n ); + // Not found :( + if( itr == nameToType.end() ) + return; + std::string type = itr->second; + + CInterfaceElement *e = CWidgetManager::getInstance()->getElementFromId( currentElement ); + if( e == NULL ) + return; + + if( type == "button_type" ) + { + std::string v; + v = NelButtonType::toString( value ); + if( v.empty() ) + return; + + e->setProperty( propName.toUtf8().constData(), v ); + } + else + if( type == "text_justification" ) + { + std::string v; + v = NelTxtJustification::toString( value ); + if( v.empty() ) + return; + + e->setProperty( propName.toUtf8().constData(), v ); + } + else + if( type == "posref" ) + { + std::string v = NelPosRef::toString( value ); + if( v.empty() ) + return; + + e->setProperty( propName.toUtf8().constData(), v ); + } + else + if( type == "posreftt" ) + { + std::string v = NelPosRefTT::toString( value ); + if( v.empty() ) + return; + + e->setProperty( propName.toUtf8().constData(), v ); + + // When auto is set as posref for a tooltip, it's pair MUST be auto as well + // When we set anything other than auto, the pair MUST not be auto either + // Only need to set the widget here, since the actual property is changed in the GUI library automatically + { + // Find the pair + std::map< std::string, std::string >::const_iterator ttItr = + ttPairs.find( n ); + + // Found! + if( ttItr != ttPairs.end() ) + { + + // Find the QtProperty that belongs to the pair + std::map< std::string, QtProperty* >::const_iterator pItr = + ttPosRefProps.find( ttItr->second ); + + // Found! + if( pItr != ttPosRefProps.end() ) + { + disablePropertyWatchers(); + + if( value == NelPosRefTT::TTPOSREF_AUTO ) + enumMgr->setValue( pItr->second, NelPosRefTT::TTPOSREF_AUTO ); + else + { + int v = NelPosRefTT::fromString( pItr->second->valueText().toUtf8().constData() ); + if( v == NelPosRefTT::TTPOSREF_AUTO ) + { + enumMgr->setValue( pItr->second, value ); + } + } + + enablePropertyWatchers(); + } + } + } + } + else + if( type == "tooltip_parent" ) + { + std::string v = NelTTParent::toString( value ); + if( v.empty() ) + return; + + e->setProperty( propName.toUtf8().constData(), v ); + } + else + if( type == "bitmap_align" ) + { + std::string v = NelBMAlign::toString( value ); + if( v.empty() ) + return; + + e->setProperty( propName.toUtf8().constData(), v ); + } + + + CInterfaceGroup *g = e->getParent(); + if( g != NULL ) + g->updateCoords(); + + } + + + void CPropBrowserCtrl::onActionPropertyChanged( QtProperty *p, const QString &v ) + { + QString propName = p->propertyName(); + + CInterfaceElement *e = CWidgetManager::getInstance()->getElementFromId( currentElement ); + if( e == NULL ) + return; + + e->setProperty( propName.toUtf8().constData(), v.toUtf8().constData() ); + + CInterfaceGroup *g = e->getParent(); + if( g != NULL ) + g->updateCoords(); + } + + void CPropBrowserCtrl::onTexturePropertyChanged( QtProperty *p, const QString &v ) + { + QString propName = p->propertyName(); + + CInterfaceElement *e = CWidgetManager::getInstance()->getElementFromId( currentElement ); + if( e == NULL ) + return; + + e->setProperty( propName.toUtf8().constData(), v.toUtf8().constData() ); + + CInterfaceGroup *g = e->getParent(); + if( g != NULL ) + g->updateCoords(); + } + + void CPropBrowserCtrl::enablePropertyWatchers() + { + connect( propertyMgr, SIGNAL( valueChanged( QtProperty*, const QVariant& ) ), + this, SLOT( onPropertyChanged( QtProperty*, const QVariant& ) ) ); + connect( enumMgr, SIGNAL( valueChanged( QtProperty*, int ) ), + this, SLOT( onEnumPropertyChanged( QtProperty*, int ) ) ); + + connect( actionMgr, SIGNAL( valueChanged( QtProperty*, const QString& ) ), + this, SLOT( onActionPropertyChanged( QtProperty*, const QString& ) ) ); + connect( textureMgr, SIGNAL( valueChanged( QtProperty*, const QString& ) ), + this, SLOT( onTexturePropertyChanged( QtProperty*, const QString& ) ) ); + } + + void CPropBrowserCtrl::disablePropertyWatchers() + { + disconnect( propertyMgr, SIGNAL( valueChanged( QtProperty*, const QVariant& ) ), + this, SLOT( onPropertyChanged( QtProperty*, const QVariant& ) ) ); + disconnect( enumMgr, SIGNAL( valueChanged( QtProperty*, int ) ), + this, SLOT( onEnumPropertyChanged( QtProperty*, int ) ) ); + + disconnect( actionMgr, SIGNAL( valueChanged( QtProperty*, const QString& ) ), + this, SLOT( onActionPropertyChanged( QtProperty*, const QString& ) ) ); + disconnect( textureMgr, SIGNAL( valueChanged( QtProperty*, const QString& ) ), + this, SLOT( onTexturePropertyChanged( QtProperty*, const QString& ) ) ); + } + + void CPropBrowserCtrl::setupProperties( const std::string &type, const CInterfaceElement *element ) + { + std::map< std::string, SWidgetInfo >::iterator itr = widgetInfo.find( type ); + if( itr == widgetInfo.end() ) + return; + SWidgetInfo &w = itr->second; + + nameToType.clear(); + ttPosRefProps.clear(); + + std::vector< SPropEntry >::const_iterator pItr; + for( pItr = w.props.begin(); pItr != w.props.end(); ++pItr ) + { + const SPropEntry &prop = *pItr; + nameToType[ prop.propName ] = prop.propType; + setupProperty( prop, element ); + } + } + + void CPropBrowserCtrl::setupProperty( const SPropEntry &prop, const CInterfaceElement *element ) + { + QtVariantProperty *p = NULL; + QVariant v; + + if( prop.propType == "texture" ) + { + std::string j = element->getProperty( prop.propName ); + + QtProperty *pp = textureMgr->addProperty( prop.propName.c_str() ); + if( pp == NULL ) + return; + + textureMgr->setValue( pp, j.c_str() ); + browser->addProperty( pp ); + } + else + if( prop.propType == "action" ) + { + std::string j = element->getProperty( prop.propName ); + + QtProperty *pp = actionMgr->addProperty( prop.propName.c_str() ); + if( pp == NULL ) + return; + + actionMgr->setValue( pp, j.c_str() ); + browser->addProperty( pp ); + } + else + if( prop.propType == "bitmap_align" ) + { + std::string j = element->getProperty( prop.propName ); + + if( j.empty() ) + return; + + int e = -1; + e = NelBMAlign::fromString( j ); + if( e == -1 ) + return; + + QtProperty *pp = enumMgr->addProperty( prop.propName.c_str() ); + if( pp == NULL ) + return; + + QStringList enums; + enums.push_back( "LB" ); + enums.push_back( "RB" ); + enums.push_back( "LT" ); + enums.push_back( "RT" ); + + enumMgr->setEnumNames( pp, enums ); + enumMgr->setValue( pp, e ); + browser->addProperty( pp ); + } + else + if( prop.propType == "tooltip_parent" ) + { + std::string j = element->getProperty( prop.propName ); + + if( j.empty() ) + return; + + int e = -1; + e = NelTTParent::fromString( j ); + if( e == -1 ) + return; + + QtProperty *pp = enumMgr->addProperty( prop.propName.c_str() ); + if( pp == NULL ) + return; + + QStringList enums; + enums.push_back( "mouse" ); + enums.push_back( "control" ); + enums.push_back( "window" ); + enums.push_back( "special window" ); + + enumMgr->setEnumNames( pp, enums ); + enumMgr->setValue( pp, e ); + browser->addProperty( pp ); + + } + else + if( prop.propType == "button_type" ) + { + std::string btype = element->getProperty( prop.propName ); + if( btype.empty() ) + return; + + int e = -1; + e = NelButtonType::fromString( btype ); + if( e == -1 ) + return; + + QtProperty *pp = enumMgr->addProperty( prop.propName.c_str() ); + if( pp == NULL ) + return; + + QStringList enums; + enums.push_back( "push_button" ); + enums.push_back( "toggle_button" ); + enums.push_back( "radio_button" ); + + enumMgr->setEnumNames( pp, enums ); + enumMgr->setValue( pp, e ); + browser->addProperty( pp ); + return; + } + else + if( prop.propType == "text_justification" ) + { + std::string j = element->getProperty( prop.propName ); + if( j.empty() ) + return; + + int e = -1; + e = NelTxtJustification::fromString( j ); + if( e == -1 ) + return; + + QtProperty *pp = enumMgr->addProperty( prop.propName.c_str() ); + if( pp == NULL ) + return; + + QStringList enums; + enums.push_back( "clip_word" ); + enums.push_back( "dont_clip_word" ); + enums.push_back( "justified" ); + + enumMgr->setEnumNames( pp, enums ); + enumMgr->setValue( pp, e ); + browser->addProperty( pp ); + + return; + } + else + if( prop.propType == "posref" ) + { + std::string j = element->getProperty( prop.propName ); + if( j.empty() ) + return; + + int e = -1; + e = NelPosRef::fromString( j ); + if( e == -1 ) + return; + + QtProperty *pp = enumMgr->addProperty( prop.propName.c_str() ); + if( pp == NULL ) + return; + + QStringList enums; + enums.push_back( "BL" ); + enums.push_back( "BM" ); + enums.push_back( "BR" ); + enums.push_back( "ML" ); + enums.push_back( "MM" ); + enums.push_back( "MR" ); + enums.push_back( "TL" ); + enums.push_back( "TM" ); + enums.push_back( "TR" ); + + enumMgr->setEnumNames( pp, enums ); + enumMgr->setValue( pp, e ); + browser->addProperty( pp ); + + return; + } + else + if( prop.propType == "posreftt" ) + { + std::string j = element->getProperty( prop.propName ); + if( j.empty() ) + return; + + int e = -1; + e = NelPosRefTT::fromString( j ); + if( e == -1 ) + return; + + QtProperty *pp = enumMgr->addProperty( prop.propName.c_str() ); + if( pp == NULL ) + return; + + QStringList enums; + enums.push_back( "BL" ); + enums.push_back( "BM" ); + enums.push_back( "BR" ); + enums.push_back( "ML" ); + enums.push_back( "MM" ); + enums.push_back( "MR" ); + enums.push_back( "TL" ); + enums.push_back( "TM" ); + enums.push_back( "TR" ); + enums.push_back( "auto" ); + + enumMgr->setEnumNames( pp, enums ); + enumMgr->setValue( pp, e ); + browser->addProperty( pp ); + + ttPosRefProps[ prop.propName ] = pp; + + return; + } + else + if( prop.propType == "string" ) + { + p = propertyMgr->addProperty( QVariant::String, prop.propName.c_str() ); + v = element->getProperty( prop.propName ).c_str(); + } + else + if( prop.propType == "bool" ) + { + p = propertyMgr->addProperty( QVariant::Bool, prop.propName.c_str() ); + bool value = false; + NLMISC::fromString( element->getProperty( prop.propName ), value ); + v = value; + } + else + if( prop.propType == "int" ) + { + p = propertyMgr->addProperty( QVariant::Int, prop.propName.c_str() ); + sint32 value = 0; + NLMISC::fromString( element->getProperty( prop.propName ), value ); + v = value; + } + else + if( prop.propType == "color" ) + { + p = propertyMgr->addProperty( QVariant::Color, prop.propName.c_str() ); + + std::string s = element->getProperty( prop.propName ); + // Parse string into a QColor + QString qs = s.c_str(); + QStringList l = qs.split( " " ); + int r = l[ 0 ].toInt(); + int g = l[ 1 ].toInt(); + int b = l[ 2 ].toInt(); + int a = l[ 3 ].toInt(); + + QColor value; + value.setRed( r ); + value.setGreen( g ); + value.setBlue( b ); + value.setAlpha( a ); + v = value; + + + // Remove the subproperties + QList< QtProperty* > pl = p->subProperties(); + QListIterator< QtProperty* > itr( pl ); + while( itr.hasNext() ) + { + delete itr.next(); + } + pl.clear(); + + } + + if( p == NULL ) + return; + + p->setValue( v ); + browser->addProperty( p ); + } +} diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/property_browser_ctrl.h b/code/studio/src/plugins/gui_editor/property_browser_ctrl.h similarity index 64% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/property_browser_ctrl.h rename to code/studio/src/plugins/gui_editor/property_browser_ctrl.h index 4c5ebce63..3d72d92ba 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/property_browser_ctrl.h +++ b/code/studio/src/plugins/gui_editor/property_browser_ctrl.h @@ -25,7 +25,16 @@ class QtTreePropertyBrowser; class QtVariantPropertyManager; +class QtEnumPropertyManager; +class QtVariantEditorFactory; +class QtEnumEditorFactory; class QtProperty; +class QVariant; + +class ActionPropertyManager; +class ActionEditorFactory; +class TexturePropertyManager; +class TextureEditorFactory; namespace NLGUI { @@ -50,19 +59,37 @@ namespace GUIEditor void clear(); public Q_SLOTS: - void onSelectionChanged( std::string &id ); + void onSelectionChanged(); private Q_SLOTS: - void onPropertyChanged( QtProperty *prop ); + void onPropertyChanged( QtProperty *prop, const QVariant &v ); + void onEnumPropertyChanged( QtProperty *prop, int value ); + void onActionPropertyChanged( QtProperty *p, const QString &v ); + void onTexturePropertyChanged( QtProperty *p, const QString &v ); private: + void enablePropertyWatchers(); + void disablePropertyWatchers(); + void setupProperties( const std::string &type, const NLGUI::CInterfaceElement *element ); void setupProperty( const SPropEntry &prop, const NLGUI::CInterfaceElement *element ); QtTreePropertyBrowser *browser; QtVariantPropertyManager *propertyMgr; + QtEnumPropertyManager *enumMgr; + ActionPropertyManager *actionMgr; + TexturePropertyManager *textureMgr; + + QtVariantEditorFactory *variantFactory; + QtEnumEditorFactory *enumFactory; + ActionEditorFactory *actionFactory; + TextureEditorFactory *textureFactory; + std::string currentElement; std::map< std::string, SWidgetInfo > widgetInfo; + std::map< std::string, std::string > nameToType; + std::map< std::string, QtProperty * > ttPosRefProps; // Tooltip posref properties + std::map< std::string, std::string > ttPairs; }; } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/ovqt_plugin_gui_editor.xml b/code/studio/src/plugins/gui_editor/studio_plugin_gui_editor.xml similarity index 77% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/ovqt_plugin_gui_editor.xml rename to code/studio/src/plugins/gui_editor/studio_plugin_gui_editor.xml index 3703509bb..9ba1452e9 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/ovqt_plugin_gui_editor.xml +++ b/code/studio/src/plugins/gui_editor/studio_plugin_gui_editor.xml @@ -1,5 +1,5 @@ - ovqt_plugin_gui_editor + studio_plugin_gui_editor GUI Editor 0.0.1 Ryzom Core diff --git a/code/studio/src/plugins/gui_editor/texture_chooser.cpp b/code/studio/src/plugins/gui_editor/texture_chooser.cpp new file mode 100644 index 000000000..3f988d4f3 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/texture_chooser.cpp @@ -0,0 +1,201 @@ +// Ryzom Core Studio GUI Editor plugin +// 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 "texture_chooser.h" +#include "nel/misc/path.h" +#include "nel/misc/bitmap.h" +#include "nel/misc/file.h" +#include +#include +#include +#include +#include + +#include "nel/gui/view_renderer.h" + +struct TextureChooserPrivate +{ + QListWidget *fileTextures; + QListWidget *atlasTextures; + + TextureChooserPrivate() + { + fileTextures = new QListWidget(); + atlasTextures = new QListWidget(); + } +}; + +TextureChooser::TextureChooser( QDialog *parent ) : +QDialog( parent ) +{ + setupUi( this ); + + d_ptr = new TextureChooserPrivate; + this->tabWidget->clear(); + this->tabWidget->addTab( d_ptr->fileTextures, tr( "File textures" ) ); + this->tabWidget->addTab( d_ptr->atlasTextures, tr( "Atlas texture" ) ); + + setupConnections(); +} + +TextureChooser::~TextureChooser() +{ + delete d_ptr; + d_ptr = NULL; +} + + +void TextureChooser::load() +{ + // Load the file textures + d_ptr->fileTextures->clear(); + + std::vector< std::string > textures; + //NLMISC::CPath::getFileList( "tga", textures ); + NLMISC::CPath::getFileListByPath( "dds", "interfaces", textures ); + NLMISC::CPath::getFileListByPath( "dds", "gamedev", textures ); + + std::sort( textures.begin(), textures.end() ); + + std::vector< std::string >::const_iterator itr = textures.begin(); + while( itr != textures.end() ) + { + d_ptr->fileTextures->addItem( itr->c_str() ); + ++itr; + } + + // Now load the atlas textures + d_ptr->atlasTextures->clear(); + textures.clear(); + + NLGUI::CViewRenderer::getInstance()->getTextureNames( textures ); + itr = textures.begin(); + while( itr != textures.end() ) + { + d_ptr->atlasTextures->addItem( itr->c_str() ); + ++itr; + } + + // set the file textures row after the atlas, because they are shown first + d_ptr->atlasTextures->setCurrentRow( 0 ); + d_ptr->fileTextures->setCurrentRow( 0 ); +} + +void TextureChooser::accept() +{ + QListWidgetItem *item = d_ptr->fileTextures->currentItem(); + if( item == NULL ) + return; + + selection = item->text(); + QDialog::accept(); +} + +void TextureChooser::reject() +{ + selection = ""; + + QDialog::reject(); +} + +void TextureChooser::onFileTxtRowChanged( int row ) +{ + if( row < 0 ) + return; + + QListWidgetItem *item = d_ptr->fileTextures->item( row ); + QString fn = item->text(); + + std::string rfn = fn.toUtf8().constData(); + rfn = NLMISC::CPath::lookup( rfn ); + + NLMISC::CIFile f; + bool b = f.open( rfn ); + if( !b ) + { + return; + } + + NLMISC::CBitmap bm; + uint8 depth = bm.load( f ); + f.close(); + b = bm.convertToType( NLMISC::CBitmap::RGBA ); + if( !b ) + { + return; + } + + setPreviewImage( bm ); +} + +void TextureChooser::onAtlasTxtRowChanged( int row ) +{ + if( row < 0 ) + return; + + QListWidgetItem *item = d_ptr->atlasTextures->item( row ); + QString fn = item->text(); + + std::string rfn = fn.toUtf8().constData(); + + NLMISC::CBitmap bm; + + bool b = NLGUI::CViewRenderer::getInstance()->getTexture( bm, rfn ); + if( !b ) + return; + + setPreviewImage( bm ); +} + + +void TextureChooser::setupConnections() +{ + connect( d_ptr->fileTextures, SIGNAL( currentRowChanged( int ) ), this, SLOT( onFileTxtRowChanged( int ) ) ); + connect( d_ptr->atlasTextures, SIGNAL( currentRowChanged( int ) ), this, SLOT( onAtlasTxtRowChanged( int ) ) ); +} + +void TextureChooser::setPreviewImage( NLMISC::CBitmap &bm ) +{ + // should be depth, but CBitmap always uses 32 bit to store the image + uint32 size = bm.getSize() * ( 32 / 8 ); + uint8 *data = new uint8[ size ]; + bm.getData( data ); + + /// Convert from ABGR to ARGB + { + int i = 0; + while( i < size ) + { + uint8 t = 0; + + /// ABGR + t = data[ i ]; + data[ i ] = data[ i + 2 ]; + data[ i + 2 ] = t; + + i += 4; + } + } + + QImage img( data, bm.getWidth(), bm.getHeight(), QImage::Format_ARGB32 ); + label->setPixmap( QPixmap::fromImage( img ) ); + + delete data; + data = NULL; +} + + + diff --git a/code/studio/src/plugins/gui_editor/texture_chooser.h b/code/studio/src/plugins/gui_editor/texture_chooser.h new file mode 100644 index 000000000..160b31481 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/texture_chooser.h @@ -0,0 +1,58 @@ +// Ryzom Core Studio GUI Editor plugin +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef TEXTURE_CHOOSER_H +#define TEXTURE_CHOOSER_H + +#include "ui_texture_chooser.h" + +namespace NLMISC +{ + class CBitmap; +} + +struct TextureChooserPrivate; + +class TextureChooser : public QDialog, public Ui::TextureChooser +{ + Q_OBJECT + +public: + TextureChooser( QDialog *parent = NULL ); + ~TextureChooser(); + + void load(); + QString getSelection(){ return selection; } + +public Q_SLOTS: + void accept(); + void reject(); + +private Q_SLOTS: + void onFileTxtRowChanged( int row ); + void onAtlasTxtRowChanged( int row ); + +private: + void setupConnections(); + void setPreviewImage( NLMISC::CBitmap &bm ); + + QString selection; + + TextureChooserPrivate *d_ptr; +}; + +#endif + diff --git a/code/studio/src/plugins/gui_editor/texture_chooser.ui b/code/studio/src/plugins/gui_editor/texture_chooser.ui new file mode 100644 index 000000000..a0837ee83 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/texture_chooser.ui @@ -0,0 +1,122 @@ + + + TextureChooser + + + Qt::ApplicationModal + + + + 0 + 0 + 686 + 300 + + + + Texture Chooser + + + + + + + tab + + + + + + + + + 0 + 0 + + + + + 351 + 231 + + + + + + + + + + + 6 + + + 0 + + + + + Qt::Horizontal + + + + 131 + 31 + + + + + + + + OK + + + + + + + Cancel + + + + + + + + + + + okButton + clicked() + TextureChooser + accept() + + + 278 + 253 + + + 96 + 254 + + + + + cancelButton + clicked() + TextureChooser + reject() + + + 369 + 253 + + + 179 + 282 + + + + + diff --git a/code/studio/src/plugins/gui_editor/texture_property_manager.cpp b/code/studio/src/plugins/gui_editor/texture_property_manager.cpp new file mode 100644 index 000000000..6b40abc7f --- /dev/null +++ b/code/studio/src/plugins/gui_editor/texture_property_manager.cpp @@ -0,0 +1,333 @@ +// Ryzom Core Studio GUI Editor plugin +// 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 "texture_property_manager.h" +#include "texture_chooser.h" +#include +#include +#include +#include +#include + + +////////////////////////////////////////////////////////////////// Manager /////////////////////////////////////////////////////////////////////////// + + +struct TexturePropertyManagerPrivate +{ + QMap< const QtProperty*, QString > values; +}; + +TexturePropertyManager::TexturePropertyManager( QObject *parent ) : +QtAbstractPropertyManager( parent ) +{ + d_ptr = new TexturePropertyManagerPrivate(); +} + +TexturePropertyManager::~TexturePropertyManager() +{ + delete d_ptr; + d_ptr = NULL; +} + +QString TexturePropertyManager::value( const QtProperty *p ) const +{ + return valueText( p ); +} + +void TexturePropertyManager::setValue( QtProperty *p, const QString &value ) +{ + if( !d_ptr->values.contains( p ) ) + return; + + if( d_ptr->values[ p ] == value ) + return; + + d_ptr->values[ p ] = value; + + Q_EMIT propertyChanged( p ); + Q_EMIT valueChanged( p, value ); +} + +bool TexturePropertyManager::hasValue( const QtProperty *p ) const +{ + return d_ptr->values.contains( p ); +} + +QString TexturePropertyManager::valueText( const QtProperty *p ) const +{ + if( !d_ptr->values.contains( p ) ) + return ""; + + return d_ptr->values[ p ]; +} + +void TexturePropertyManager::initializeProperty( QtProperty *p ) +{ + if( d_ptr->values.contains( p ) ) + return; + + d_ptr->values[ p ] = ""; +} + +void TexturePropertyManager::uninitializeProperty( QtProperty *p ) +{ + d_ptr->values.remove( p ); +} + + + +//////////////////////////////////////////////////////////////////// Factory /////////////////////////////////////////////////////////////////////// + + + +struct TextureEditorFactoryPrivate +{ + QMap< QtProperty*, QList< TexturePropertyEditor* > > createdEditors; + QMap< TexturePropertyEditor*, QtProperty* > editorToProperty; + + ~TextureEditorFactoryPrivate() + { + createdEditors.clear(); + + QMap< TexturePropertyEditor*, QtProperty* >::iterator itr = editorToProperty.begin(); + while( itr != editorToProperty.end() ) + { + delete itr.key(); + ++itr; + } + editorToProperty.clear(); + } + + void addEditor( QtProperty *p, TexturePropertyEditor *editor ) + { + QMap< QtProperty*, QList< TexturePropertyEditor* > >::iterator itr = createdEditors.find( p ); + + if( itr != createdEditors.end() ) + { + itr->push_back( editor ); + } + else + { + QList< TexturePropertyEditor* > l; + l.push_back( editor ); + createdEditors.insert( p, l ); + } + + editorToProperty.insert( editor, p ); + } + + void removeEditor( QObject *o ) + { + // Remove from editorToProperty first + QMap< TexturePropertyEditor*, QtProperty* >::iterator itr1 = editorToProperty.begin(); + while( itr1 != editorToProperty.end() ) + { + if( itr1.key() == o ) + break; + + ++itr1; + } + if( itr1 != editorToProperty.end() ) + editorToProperty.erase( itr1 ); + + // Then from createdEditors + QMap< QtProperty*, QList< TexturePropertyEditor* > >::iterator itr2 = createdEditors.begin(); + while( itr2 != createdEditors.end() ) + { + QList< TexturePropertyEditor* > &l = *itr2; + QList< TexturePropertyEditor* >::iterator itr = l.begin(); + while( itr != l.end() ) + { + if( *itr == o ) + { + QList< TexturePropertyEditor* >::iterator d = itr; + ++itr; + l.erase( d ); + continue; + } + + ++itr; + } + + ++itr2; + } + } + +}; + +TextureEditorFactory::TextureEditorFactory( QObject *parent ) : +QtAbstractEditorFactory( parent ) +{ + d_ptr = new TextureEditorFactoryPrivate(); +} + +TextureEditorFactory::~TextureEditorFactory() +{ + delete d_ptr; + d_ptr = NULL; +} + +void TextureEditorFactory::connectPropertyManager( TexturePropertyManager *manager ) +{ + connect( manager, SIGNAL( valueChanged( QtProperty*, const QString& ) ), this, SLOT( onPropertyChanged( QtProperty*, const QString& ) ) ); +} + +void TextureEditorFactory::disconnectPropertyManager( TexturePropertyManager *manager ) +{ + disconnect( manager, SIGNAL( valueChanged( QtProperty*, const QString& ) ), this, SLOT( onPropertyChanged( QtProperty*, const QString& ) ) ); +} + +QWidget* TextureEditorFactory::createEditor( TexturePropertyManager *manager, QtProperty *p, QWidget *parent ) +{ + TexturePropertyEditor *editor = new TexturePropertyEditor( parent ); + editor->setValue( manager->value( p ) ); + + connect( editor, SIGNAL( valueChanged( const QString& ) ), this, SLOT( onSetValue( const QString& ) ) ); + connect( editor, SIGNAL( destroyed( QObject* ) ), this, SLOT( onEditorDestroyed( QObject* ) ) ); + + d_ptr->addEditor( p, editor ); + + return editor; +} + +void TextureEditorFactory::onPropertyChanged( QtProperty *p, const QString &value ) +{ + QMap< QtProperty*, QList< TexturePropertyEditor* > >::iterator itr = d_ptr->createdEditors.find( p ); + if( itr == d_ptr->createdEditors.end() ) + return; + + QList< TexturePropertyEditor* > &l = *itr; + QList< TexturePropertyEditor* >::iterator i = l.begin(); + while( i != l.end() ) + { + TexturePropertyEditor *editor = *i; + + editor->blockSignals( true ); + editor->setValue( value ); + editor->blockSignals( false ); + + ++i; + } +} + +void TextureEditorFactory::onSetValue( const QString &value ) +{ + QObject *s = sender(); + TexturePropertyEditor *editor = qobject_cast< TexturePropertyEditor* >( s ); + if( editor == NULL ) + return; + + QMap< TexturePropertyEditor*, QtProperty* >::iterator itr = d_ptr->editorToProperty.find( editor ); + if( itr == d_ptr->editorToProperty.end() ) + return; + + QtProperty *p = *itr; + + TexturePropertyManager *manager = qobject_cast< TexturePropertyManager* >( p->propertyManager() ); + if( manager == NULL ) + return; + + blockSignals( true ); + manager->setValue( p, value ); + blockSignals( false ); +} + +void TextureEditorFactory::onEditorDestroyed( QObject *editor ) +{ + d_ptr->removeEditor( editor ); +} + + + +//////////////////////////////////////////////////////////////////////// Editor ////////////////////////////////////////////////////////////////// + + + +TexturePropertyEditor::TexturePropertyEditor( QWidget *parent ) : +QWidget( parent ) +{ + setupUi(); + setupConnections(); +} + +TexturePropertyEditor::~TexturePropertyEditor() +{ +} + +void TexturePropertyEditor::setValue( const QString &value ) +{ + if( lineEdit->text() == value ) + return; + + disableConnections(); + lineEdit->setText( value ); + setupConnections(); +} + +void TexturePropertyEditor::showEvent( QShowEvent *e ) +{ + QWidget::showEvent( e ); +} + +void TexturePropertyEditor::onToolButtonClicked() +{ + TextureChooser d; + d.load(); + + int result = d.exec(); + if( QDialog::Accepted != result ) + return; + + lineEdit->setText( d.getSelection() ); +} + +void TexturePropertyEditor::onTextChanged( const QString &text ) +{ + Q_EMIT valueChanged( text ); +} + +void TexturePropertyEditor::setupConnections() +{ + connect( toolButton, SIGNAL( clicked( bool ) ), this, SLOT( onToolButtonClicked() ) ); + connect( lineEdit, SIGNAL( textChanged( const QString& ) ), this, SLOT( onTextChanged( const QString& ) ) ); +} + +void TexturePropertyEditor::disableConnections() +{ + disconnect( toolButton, SIGNAL( clicked( bool ) ), this, SLOT( onToolButtonClicked() ) ); + disconnect( lineEdit, SIGNAL( textChanged( const QString& ) ), this, SLOT( onTextChanged( const QString& ) ) ); +} + +void TexturePropertyEditor::setupUi() +{ + lineEdit = new QLineEdit(); + toolButton = new QToolButton(); + toolButton->setText( "..." ); + + QHBoxLayout *lt = new QHBoxLayout( this ); + lt->setContentsMargins( 0, 0, 0, 0 ); + lt->setSpacing( 0 ); + lt->addWidget( lineEdit ); + lt->addWidget( toolButton ); + + setFocusProxy( lineEdit ); + setSizePolicy( QSizePolicy::Ignored, QSizePolicy::Fixed ); + +} + + diff --git a/code/studio/src/plugins/gui_editor/texture_property_manager.h b/code/studio/src/plugins/gui_editor/texture_property_manager.h new file mode 100644 index 000000000..9b686ea04 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/texture_property_manager.h @@ -0,0 +1,125 @@ +// Ryzom Core Studio GUI Editor plugin +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + + +#ifndef TEXTURE_PROPERTY_MANAGER +#define TEXTURE_PROPERTY_MANAGER + +#define QT_QTPROPERTYBROWSER_IMPORT + +#include "3rdparty/qtpropertybrowser/qtpropertybrowser.h" +#include + +/////////////////////////////////////////////////////// Manager /////////////////////////////////////////////////////////////////////////// + +struct TexturePropertyManagerPrivate; + +class TexturePropertyManager : public QtAbstractPropertyManager +{ + Q_OBJECT + +public: + TexturePropertyManager( QObject *parent = NULL ); + ~TexturePropertyManager(); + + QString value( const QtProperty *p ) const; + +public Q_SLOTS: + void setValue( QtProperty *p, const QString &value ); + +Q_SIGNALS: + void valueChanged( QtProperty *p, const QString &value ); + +protected: + bool hasValue( const QtProperty *p ) const; + QString valueText( const QtProperty *p ) const; + void initializeProperty( QtProperty *p ); + void uninitializeProperty( QtProperty *p ); + +private: + TexturePropertyManagerPrivate *d_ptr; + + Q_DISABLE_COPY( TexturePropertyManager ); +}; + + +////////////////////////////////////////////////////////////////// Factory ///////////////////////////////////////////////////////////////////////// + +struct TextureEditorFactoryPrivate; + +class TextureEditorFactory : public QtAbstractEditorFactory< TexturePropertyManager > +{ + Q_OBJECT + +public: + TextureEditorFactory( QObject *parent = NULL ); + ~TextureEditorFactory(); + +protected: + void connectPropertyManager( TexturePropertyManager *manager ); + void disconnectPropertyManager( TexturePropertyManager *manager ); + + QWidget* createEditor( TexturePropertyManager *manager, QtProperty *p, QWidget *parent ); + +private Q_SLOTS: + void onPropertyChanged( QtProperty *p, const QString &value ); + void onSetValue( const QString &value ); + void onEditorDestroyed( QObject *editor ); + +private: + TextureEditorFactoryPrivate *d_ptr; + + Q_DISABLE_COPY( TextureEditorFactory ); +}; + + +///////////////////////////////////////////////////////////////// Editor /////////////////////////////////////////////////////////////////////////// + +class QLineEdit; +class QToolButton; + +class TexturePropertyEditor : public QWidget +{ + Q_OBJECT +public: + TexturePropertyEditor( QWidget *parent = NULL ); + ~TexturePropertyEditor(); + +public Q_SLOTS: + void setValue( const QString &value ); + +protected: + void showEvent( QShowEvent *e ); + +private Q_SLOTS: + void onToolButtonClicked(); + void onTextChanged( const QString &text ); + +Q_SIGNALS: + void valueChanged( const QString &value ); + +private: + void setupUi(); + void setupConnections(); + void disableConnections(); + + + QLineEdit *lineEdit; + QToolButton *toolButton; +}; + +#endif + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_hierarchy.cpp b/code/studio/src/plugins/gui_editor/widget_hierarchy.cpp similarity index 74% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_hierarchy.cpp rename to code/studio/src/plugins/gui_editor/widget_hierarchy.cpp index 24208f4a3..17e7f6e57 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_hierarchy.cpp +++ b/code/studio/src/plugins/gui_editor/widget_hierarchy.cpp @@ -18,7 +18,6 @@ #include "widget_hierarchy.h" #include "nel/gui/interface_group.h" #include "nel/gui/widget_manager.h" -#include "nel/gui/widget_addition_watcher.h" namespace { @@ -76,18 +75,24 @@ namespace GUIEditor::WidgetHierarchy *h; }; - class CWidgetAdditionWatcher : public IWidgetAdditionWatcher + class CWidgetWatcher : public CWidgetManager::IWidgetWatcher { public: - CWidgetAdditionWatcher(){ h = NULL; } - ~CWidgetAdditionWatcher(){} + CWidgetWatcher(){ h = NULL; } + ~CWidgetWatcher(){} - void widgetAdded( const std::string &name ) + void onWidgetAdded( const std::string &name ) { if( h != NULL ) h->onWidgetAdded( name ); } - + + void onWidgetMoved( const std::string &oldid, const std::string &newid ) + { + if( h != NULL ) + h->onWidgetMoved( oldid, newid ); + } + void setWidgetHierarchy( GUIEditor::WidgetHierarchy *h ){ this->h = h; } private: @@ -95,7 +100,7 @@ namespace }; CWidgetDeletionWatcher deletionWatcher; - CWidgetAdditionWatcher additionWatcher; + CWidgetWatcher widgetwatcher; } namespace GUIEditor @@ -107,7 +112,7 @@ namespace GUIEditor connect( widgetHT, SIGNAL( itemDoubleClicked( QTreeWidgetItem*, int ) ), this, SLOT( onItemDblClicked( QTreeWidgetItem* ) ) ); deletionWatcher.setWidgetHierarchy( this ); - additionWatcher.setWidgetHierarchy( this ); + widgetwatcher.setWidgetHierarchy( this ); } WidgetHierarchy::~WidgetHierarchy() @@ -117,7 +122,7 @@ namespace GUIEditor void WidgetHierarchy::clearHierarchy() { CInterfaceElement::unregisterDeletionWatcher( &deletionWatcher ); - CWidgetManager::getInstance()->unregisterAdditionWatcher( &additionWatcher ); + CWidgetManager::getInstance()->unregisterWidgetWatcher( &widgetwatcher ); widgetHT->clear(); widgetHierarchyMap.clear(); } @@ -126,7 +131,7 @@ namespace GUIEditor { clearHierarchy(); CInterfaceElement::registerDeletionWatcher( &deletionWatcher ); - CWidgetManager::getInstance()->registerAdditionWatcher( &additionWatcher ); + CWidgetManager::getInstance()->registerWidgetWatcher( &widgetwatcher ); CInterfaceGroup *mg = CWidgetManager::getInstance()->getMasterGroupFromId( masterGroup ); if( mg != NULL ) @@ -161,6 +166,9 @@ namespace GUIEditor std::vector< CCtrlBase* >::const_iterator citr; for( citr = controls.begin(); citr != controls.end(); ++citr ) { + if( !(*citr)->isEditorSelectable() ) + continue; + QTreeWidgetItem *subItem = new QTreeWidgetItem( item ); subItem->setText( 0, makeNodeName( (*citr)->getId() ).c_str() ); widgetHierarchyMap[ (*citr)->getId() ] = subItem; @@ -171,12 +179,36 @@ namespace GUIEditor std::vector< CViewBase* >::const_iterator vitr; for( vitr = views.begin(); vitr != views.end(); ++vitr ) { + if( !(*vitr)->isEditorSelectable() ) + continue; + QTreeWidgetItem *subItem = new QTreeWidgetItem( item ); subItem->setText( 0, makeNodeName( (*vitr)->getId() ).c_str() ); widgetHierarchyMap[ (*vitr)->getId() ] = subItem; } } + QTreeWidgetItem* WidgetHierarchy::findItem( const std::string &id ) + { + std::map< std::string, QTreeWidgetItem* >::iterator itr + = widgetHierarchyMap.find( id ); + if( itr == widgetHierarchyMap.end() ) + return NULL; + else + return itr->second; + } + + QTreeWidgetItem* WidgetHierarchy::findParent( const std::string &id ) + { + // Get the parent's name + std::string::size_type p = id.find_last_of( ':' ); + if( p == std::string::npos ) + return NULL; + std::string parentId = id.substr( 0, p ); + + return findItem( parentId ); + } + void WidgetHierarchy::onWidgetDeleted( const std::string &id ) { std::map< std::string, QTreeWidgetItem* >::iterator itr @@ -231,16 +263,62 @@ namespace GUIEditor widgetHierarchyMap[ id ] = item; } + void WidgetHierarchy::onWidgetMoved( const std::string &oldid, const std::string &newid ) + { + QTreeWidgetItem *newParent = NULL; + QTreeWidgetItem *item = NULL; + QString id; + + newParent = findParent( newid ); + item = findItem( oldid ); + + if( ( newParent == NULL ) || ( item == NULL ) ) + return; + + // Remove item from old parent + QTreeWidgetItem *p = item->parent(); + if( p != NULL ) + p->setExpanded( false ); + p->removeChild( item ); + + // Remove reference to old item + widgetHierarchyMap.erase( oldid ); + + // Add item to new parent + newParent->addChild( item ); + + // Add reference to new item + widgetHierarchyMap[ newid ] = item; + + selectItem( item ); + } + + void WidgetHierarchy::selectItem( QTreeWidgetItem *item ) + { + widgetHT->collapseAll(); + + QTreeWidgetItem *currItem = item; + while( currItem != NULL ) + { + currItem->setExpanded( true ); + currItem = currItem->parent(); + } + + widgetHT->setCurrentItem( item ); + item->setSelected( true ); + } + void WidgetHierarchy::getCurrentGroup( QString &g ) { - std::string s = CWidgetManager::getInstance()->getCurrentEditorSelection(); - if( s.empty() ) + std::vector< std::string > selection; + CWidgetManager::getInstance()->getEditorSelection( selection ); + if( selection.size() != 1 ) { g = ""; return; } - NLGUI::CInterfaceElement *e = CWidgetManager::getInstance()->getElementFromId( s ); + NLGUI::CInterfaceElement *e = CWidgetManager::getInstance()->getElementFromId( selection[ 0 ] ); if( e == NULL ) { g = ""; @@ -271,8 +349,16 @@ namespace GUIEditor currentSelection.clear(); } - void WidgetHierarchy::onSelectionChanged( std::string &newSelection ) + void WidgetHierarchy::onSelectionChanged() { + std::vector< std::string > selection; + CWidgetManager::getInstance()->getEditorSelection( selection ); + + if( selection.size() != 1 ) + return; + + std::string newSelection = selection[ 0 ]; + if( newSelection == currentSelection ) return; @@ -288,18 +374,11 @@ namespace GUIEditor if( widgetHT->currentItem() != NULL ) widgetHT->currentItem()->setSelected( false ); - // expand the tree items, so that we can see the selected item - QTreeWidgetItem *item = itr->second; - QTreeWidgetItem *currItem = item; - while( currItem != NULL ) - { - currItem->setExpanded( true ); - currItem = currItem->parent(); - } + widgetHT->collapseAll(); // select the current item - item->setSelected( true ); - widgetHT->setCurrentItem( item ); + QTreeWidgetItem *item = itr->second; + selectItem( item ); currentSelection = newSelection; } @@ -307,9 +386,11 @@ namespace GUIEditor { if( item->parent() == NULL ) return; + + selectItem( item ); std::string n = item->text( 0 ).toUtf8().constData(); currentSelection = makeFullName( item, n ); - CWidgetManager::getInstance()->setCurrentEditorSelection( currentSelection ); + CWidgetManager::getInstance()->selectWidget( currentSelection ); } } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_hierarchy.h b/code/studio/src/plugins/gui_editor/widget_hierarchy.h similarity index 87% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_hierarchy.h rename to code/studio/src/plugins/gui_editor/widget_hierarchy.h index 4641c8ce8..cdfc9a741 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_hierarchy.h +++ b/code/studio/src/plugins/gui_editor/widget_hierarchy.h @@ -44,15 +44,19 @@ namespace GUIEditor void onWidgetDeleted( const std::string &id ); void onWidgetAdded( const std::string &id ); + void onWidgetMoved( const std::string &oldid, const std::string &newid ); void getCurrentGroup( QString &g ); private: void buildHierarchy( QTreeWidgetItem *parent, NLGUI::CInterfaceGroup *group ); + QTreeWidgetItem* findItem( const std::string &id ); + QTreeWidgetItem* findParent( const std::string &id ); + void selectItem( QTreeWidgetItem *item ); public Q_SLOTS: void onGUILoaded(); - void onSelectionChanged( std::string &newSelection ); + void onSelectionChanged(); private Q_SLOTS: void onItemDblClicked( QTreeWidgetItem *item ); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_hierarchy.ui b/code/studio/src/plugins/gui_editor/widget_hierarchy.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_hierarchy.ui rename to code/studio/src/plugins/gui_editor/widget_hierarchy.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_info.h b/code/studio/src/plugins/gui_editor/widget_info.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_info.h rename to code/studio/src/plugins/gui_editor/widget_info.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_info_serializer.cpp b/code/studio/src/plugins/gui_editor/widget_info_serializer.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_info_serializer.cpp rename to code/studio/src/plugins/gui_editor/widget_info_serializer.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_info_serializer.h b/code/studio/src/plugins/gui_editor/widget_info_serializer.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_info_serializer.h rename to code/studio/src/plugins/gui_editor/widget_info_serializer.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_info_tree.h b/code/studio/src/plugins/gui_editor/widget_info_tree.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_info_tree.h rename to code/studio/src/plugins/gui_editor/widget_info_tree.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_info_tree_node.h b/code/studio/src/plugins/gui_editor/widget_info_tree_node.h similarity index 97% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_info_tree_node.h rename to code/studio/src/plugins/gui_editor/widget_info_tree_node.h index 0de9e6977..8aefe6f0f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_info_tree_node.h +++ b/code/studio/src/plugins/gui_editor/widget_info_tree_node.h @@ -75,6 +75,10 @@ namespace GUIEditor // copy the properties to the child, since they inherit them for( std::vector< SPropEntry >::const_iterator itr = this->info.props.begin(); itr != this->info.props.end(); ++itr ) { + // Don't add property if already exists, since it's an override. + if( node->hasProperty( itr->propName ) ) + continue; + node->addProperty( *itr ); } } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_info_tree_visitor.h b/code/studio/src/plugins/gui_editor/widget_info_tree_visitor.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_info_tree_visitor.h rename to code/studio/src/plugins/gui_editor/widget_info_tree_visitor.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_properties.cpp b/code/studio/src/plugins/gui_editor/widget_properties.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_properties.cpp rename to code/studio/src/plugins/gui_editor/widget_properties.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_properties.h b/code/studio/src/plugins/gui_editor/widget_properties.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_properties.h rename to code/studio/src/plugins/gui_editor/widget_properties.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_properties.ui b/code/studio/src/plugins/gui_editor/widget_properties.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_properties.ui rename to code/studio/src/plugins/gui_editor/widget_properties.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_properties_parser.cpp b/code/studio/src/plugins/gui_editor/widget_properties_parser.cpp similarity index 97% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_properties_parser.cpp rename to code/studio/src/plugins/gui_editor/widget_properties_parser.cpp index e0f346fc9..fd74dcae4 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_properties_parser.cpp +++ b/code/studio/src/plugins/gui_editor/widget_properties_parser.cpp @@ -20,6 +20,7 @@ #include #include "nel/misc/debug.h" #include "widget_info_tree.h" +#include "gui_editor_config.h" using namespace NLMISC; @@ -36,7 +37,7 @@ namespace GUIEditor void CWidgetPropParser::parseGUIWidgets() { - QDir d( "widgets" ); + QDir d( WIDGETS_DIR ); if( !d.exists() ) { nlwarning( "GUI widgets directory doesn't exist!" ); @@ -55,7 +56,7 @@ namespace GUIEditor QStringListIterator itr( files ); while( itr.hasNext() ) - parseGUIWidget( "widgets/" + itr.next() ); + parseGUIWidget( QString( WIDGETS_DIR ) + QString( "/" ) + itr.next() ); buildWidgetInfoTree(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_properties_parser.h b/code/studio/src/plugins/gui_editor/widget_properties_parser.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_properties_parser.h rename to code/studio/src/plugins/gui_editor/widget_properties_parser.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_serializer.cpp b/code/studio/src/plugins/gui_editor/widget_serializer.cpp similarity index 98% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_serializer.cpp rename to code/studio/src/plugins/gui_editor/widget_serializer.cpp index fd4e7cfbe..8006a6b50 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_serializer.cpp +++ b/code/studio/src/plugins/gui_editor/widget_serializer.cpp @@ -93,8 +93,6 @@ namespace GUIEditor return false; } - ag->setActive( false ); - if( mg->serializeSubGroups( root ) == NULL ) { ag->setActive( true ); @@ -103,8 +101,6 @@ namespace GUIEditor return false; } - ag->setActive( true ); - if( !mg->serializeLinks( root ) ) { xmlFreeNode( root ); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_serializer.h b/code/studio/src/plugins/gui_editor/widget_serializer.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_serializer.h rename to code/studio/src/plugins/gui_editor/widget_serializer.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/CtrlBase.xml b/code/studio/src/plugins/gui_editor/widgets/CtrlBase.xml similarity index 74% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/CtrlBase.xml rename to code/studio/src/plugins/gui_editor/widgets/CtrlBase.xml index 5c334dea5..8ac372bdb 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/CtrlBase.xml +++ b/code/studio/src/plugins/gui_editor/widgets/CtrlBase.xml @@ -30,24 +30,34 @@
    tooltip_parent - string + tooltip_parent tooltip_special_parent string - +
    tooltip_posref - string + posreftt auto - +
    + + tooltip_parent_posref + posreftt + auto + tooltip_posref_alt - string + posreftt auto - +
    + + tooltip_parent_posref_alt + posreftt + auto + instant_help bool diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/CtrlBaseButton.xml b/code/studio/src/plugins/gui_editor/widgets/CtrlBaseButton.xml similarity index 91% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/CtrlBaseButton.xml rename to code/studio/src/plugins/gui_editor/widgets/CtrlBaseButton.xml index 42e2bdef1..33f9f3a3f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/CtrlBaseButton.xml +++ b/code/studio/src/plugins/gui_editor/widgets/CtrlBaseButton.xml @@ -10,8 +10,8 @@ button_type - string - push_button + button_type + toggle_button pushed @@ -30,17 +30,17 @@ color - string + color 255 255 255 255 col_pushed - string + color 255 255 255 255 col_over - string + color 255 255 255 255 @@ -60,7 +60,7 @@ onover - string + action @@ -70,7 +70,7 @@ onclick_l - string + action @@ -80,7 +80,7 @@ ondblclick_l - string + action @@ -90,7 +90,7 @@ onclick_r - string + action @@ -100,7 +100,7 @@ onlongclick_l - string + action @@ -110,7 +110,7 @@ onclock_tick - string + action diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/CtrlButton.xml b/code/studio/src/plugins/gui_editor/widgets/CtrlButton.xml similarity index 74% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/CtrlButton.xml rename to code/studio/src/plugins/gui_editor/widgets/CtrlButton.xml index fb2514e7c..2454f7035 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/CtrlButton.xml +++ b/code/studio/src/plugins/gui_editor/widgets/CtrlButton.xml @@ -2,7 +2,7 @@
    CtrlButton CCtrlButton - button + button CtrlBaseButton false @@ -11,18 +11,18 @@ tx_normal - string - log_but_r.tga + texture + tp_quit.tga tx_pushed - string - log_but_r.tga + texture + tp_quit.tga tx_over - string - log_but_over_r.tga + texture + tp_quit.tga scale diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/CtrlColPick.xml b/code/studio/src/plugins/gui_editor/widgets/CtrlColPick.xml similarity index 96% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/CtrlColPick.xml rename to code/studio/src/plugins/gui_editor/widgets/CtrlColPick.xml index 6ac05fbcc..7ab3e2f48 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/CtrlColPick.xml +++ b/code/studio/src/plugins/gui_editor/widgets/CtrlColPick.xml @@ -2,7 +2,7 @@
    CtrlColPick CCtrlColPick - colpick + colpick CtrlBase false diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/CtrlScroll.xml b/code/studio/src/plugins/gui_editor/widgets/CtrlScroll.xml similarity index 98% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/CtrlScroll.xml rename to code/studio/src/plugins/gui_editor/widgets/CtrlScroll.xml index a5c8dae1e..9f5fcfc60 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/CtrlScroll.xml +++ b/code/studio/src/plugins/gui_editor/widgets/CtrlScroll.xml @@ -2,7 +2,7 @@
    CtrlScroll CCtrlScroll - scroll + scroll CtrlBase false diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/CtrlTabButton.xml b/code/studio/src/plugins/gui_editor/widgets/CtrlTabButton.xml similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/CtrlTabButton.xml rename to code/studio/src/plugins/gui_editor/widgets/CtrlTabButton.xml diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/CtrlTextButton.xml b/code/studio/src/plugins/gui_editor/widgets/CtrlTextButton.xml similarity index 88% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/CtrlTextButton.xml rename to code/studio/src/plugins/gui_editor/widgets/CtrlTextButton.xml index cacc45ccb..6afd06cdf 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/CtrlTextButton.xml +++ b/code/studio/src/plugins/gui_editor/widgets/CtrlTextButton.xml @@ -2,7 +2,7 @@
    CtrlTextButton CCtrlTextButton - text_button + text_button CtrlBaseButton false @@ -27,12 +27,12 @@ hardtext string - text + push me wmargin int - 20 + 0 wmin @@ -53,40 +53,45 @@ text_underlined bool false - - + + text_posref - string - MM MM - + posref + MM + + + text_parent_posref + posref + MM + text_color_normal - string + color 255 255 255 255 text_color_pushed - string + color 255 255 255 255 text_color_over - string + color 255 255 255 255 text_shadow_color_normal - string + color 0 0 0 255 text_shadow_color_pushed - string + color 0 0 0 255 text_shadow_color_over - string + color 0 0 0 255 @@ -116,7 +121,7 @@ color - string + color 255 255 255 255 @@ -136,7 +141,7 @@ shadow_color - string + color 0 0 0 255 @@ -146,13 +151,13 @@ justification - string + text_justification dont_clip_word line_maxw int - 200 + 100 multi_line_space diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBGroupSelectNumber.xml b/code/studio/src/plugins/gui_editor/widgets/DBGroupSelectNumber.xml similarity index 95% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBGroupSelectNumber.xml rename to code/studio/src/plugins/gui_editor/widgets/DBGroupSelectNumber.xml index 63be51b5e..7d78fc6b9 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBGroupSelectNumber.xml +++ b/code/studio/src/plugins/gui_editor/widgets/DBGroupSelectNumber.xml @@ -2,7 +2,7 @@
    DBGroupSelectNumber CDBGroupSelectNumber - select_number + select_number InterfaceGroup false diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBViewBar.xml b/code/studio/src/plugins/gui_editor/widgets/DBViewBar.xml similarity index 94% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBViewBar.xml rename to code/studio/src/plugins/gui_editor/widgets/DBViewBar.xml index c7f2e488c..878f9b563 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBViewBar.xml +++ b/code/studio/src/plugins/gui_editor/widgets/DBViewBar.xml @@ -2,7 +2,7 @@
    DBViewBar CDBViewBar - bar + bar ViewBitmap false @@ -26,7 +26,7 @@ color_negative - string + color 0 0 0 0 diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBViewBar3.xml b/code/studio/src/plugins/gui_editor/widgets/DBViewBar3.xml similarity index 89% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBViewBar3.xml rename to code/studio/src/plugins/gui_editor/widgets/DBViewBar3.xml index 9b12a637a..db635eb27 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBViewBar3.xml +++ b/code/studio/src/plugins/gui_editor/widgets/DBViewBar3.xml @@ -2,7 +2,7 @@
    DBViewBar3 CDBViewBar3 - bar3 + bar3 ViewBitmap false @@ -41,32 +41,32 @@ color1 - string + color 255 255 255 255 color2 - string + color 255 255 255 255 color3 - string + color 255 255 255 255 color1_negative - string + color 0 0 0 0 color2_negative - string + color 0 0 0 0 color3_negative - string + color 0 0 0 0 diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBViewDigit.xml b/code/studio/src/plugins/gui_editor/widgets/DBViewDigit.xml similarity index 88% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBViewDigit.xml rename to code/studio/src/plugins/gui_editor/widgets/DBViewDigit.xml index 8a2a28831..1a659fd91 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBViewDigit.xml +++ b/code/studio/src/plugins/gui_editor/widgets/DBViewDigit.xml @@ -2,7 +2,7 @@
    DBViewDigit CDBViewDigit - digit + digit CtrlBase false @@ -12,7 +12,7 @@ value string - 0 + numdigit @@ -26,7 +26,7 @@ color - string + color 255 255 255 255 diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBViewNumber.xml b/code/studio/src/plugins/gui_editor/widgets/DBViewNumber.xml similarity index 89% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBViewNumber.xml rename to code/studio/src/plugins/gui_editor/widgets/DBViewNumber.xml index 95a43025e..99cc153ce 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBViewNumber.xml +++ b/code/studio/src/plugins/gui_editor/widgets/DBViewNumber.xml @@ -2,17 +2,22 @@
    DBViewNumber CDBViewNumber - text_number + text_number ViewText false
    + + hardtext + string + 0 + value string - 0 + positive diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBViewQuantity.xml b/code/studio/src/plugins/gui_editor/widgets/DBViewQuantity.xml similarity index 79% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBViewQuantity.xml rename to code/studio/src/plugins/gui_editor/widgets/DBViewQuantity.xml index 1b812bccf..c11c1a4cc 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBViewQuantity.xml +++ b/code/studio/src/plugins/gui_editor/widgets/DBViewQuantity.xml @@ -2,7 +2,7 @@
    DBViewQuantity CDBViewQuantity - text_quantity + text_quantity ViewText false @@ -12,17 +12,17 @@ value string - 0 + valuemax string - 100 + emptytext string - empty text + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupCell.xml b/code/studio/src/plugins/gui_editor/widgets/GroupCell.xml similarity index 98% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupCell.xml rename to code/studio/src/plugins/gui_editor/widgets/GroupCell.xml index 8f8592771..ad0ae6e02 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupCell.xml +++ b/code/studio/src/plugins/gui_editor/widgets/GroupCell.xml @@ -30,7 +30,7 @@ bgcolor - string + color 0 0 0 0 diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupContainer.xml b/code/studio/src/plugins/gui_editor/widgets/GroupContainer.xml similarity index 95% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupContainer.xml rename to code/studio/src/plugins/gui_editor/widgets/GroupContainer.xml index bdbf9931a..a3c9aade7 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupContainer.xml +++ b/code/studio/src/plugins/gui_editor/widgets/GroupContainer.xml @@ -2,7 +2,7 @@
    GroupContainer CGroupContainer - container + container InterfaceGroup false @@ -46,7 +46,7 @@ header_color - string + color 255 255 255 255 @@ -111,7 +111,7 @@ on_open - string + action @@ -121,7 +121,7 @@ on_close - string + action @@ -131,7 +131,7 @@ on_close_button - string + action @@ -141,7 +141,7 @@ on_move - string + action @@ -151,7 +151,7 @@ on_deactive_check - string + action @@ -161,7 +161,7 @@ on_resize - string + action @@ -171,7 +171,7 @@ on_alpha_settings_changed - string + action @@ -181,7 +181,7 @@ on_begin_move - string + action diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupEditBox.xml b/code/studio/src/plugins/gui_editor/widgets/GroupEditBox.xml similarity index 98% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupEditBox.xml rename to code/studio/src/plugins/gui_editor/widgets/GroupEditBox.xml index 603af6c04..578262a20 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupEditBox.xml +++ b/code/studio/src/plugins/gui_editor/widgets/GroupEditBox.xml @@ -2,7 +2,7 @@
    GroupEditBox CGroupEditBox - edit_box + edit_box InterfaceGroup false diff --git a/code/studio/src/plugins/gui_editor/widgets/GroupEditBoxDecor.xml b/code/studio/src/plugins/gui_editor/widgets/GroupEditBoxDecor.xml new file mode 100644 index 000000000..67865e707 --- /dev/null +++ b/code/studio/src/plugins/gui_editor/widgets/GroupEditBoxDecor.xml @@ -0,0 +1,68 @@ + +
    + GroupEditBoxDecor + CGroupEditBoxDecor + edit_box_decor + GroupEditBox + + false + +
    + + + w + int + 150 + + + h + int + 25 + + + tx_tl + texture + log_eb_tl.tga + + + tx_tm + texture + log_eb_t.tga + + + tx_tr + texture + log_eb_tr.tga + + + tx_bl + texture + log_eb_bl.tga + + + tx_bm + texture + log_eb_b.tga + + + tx_br + texture + log_eb_br.tga + + + tx_l + texture + log_eb_l.tga + + + tx_r + texture + log_eb_r.tga + + + tx_bg + texture + log_eb_m.tga + + +
    diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupFrame.xml b/code/studio/src/plugins/gui_editor/widgets/GroupFrame.xml similarity index 95% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupFrame.xml rename to code/studio/src/plugins/gui_editor/widgets/GroupFrame.xml index f414e67e7..c7ac89fa2 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupFrame.xml +++ b/code/studio/src/plugins/gui_editor/widgets/GroupFrame.xml @@ -15,7 +15,7 @@ color - string + color 255 255 255 255 diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupHTML.xml b/code/studio/src/plugins/gui_editor/widgets/GroupHTML.xml similarity index 95% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupHTML.xml rename to code/studio/src/plugins/gui_editor/widgets/GroupHTML.xml index b76fe4cd4..894580734 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupHTML.xml +++ b/code/studio/src/plugins/gui_editor/widgets/GroupHTML.xml @@ -2,7 +2,7 @@
    GroupHTML CGroupHTML - html + html GroupScrollText false @@ -21,47 +21,47 @@ background_color - string + color 0 0 0 255 error_color - string + color 255 0 0 255 link_color - string + color 0 0 255 255 h1_color - string + color 255 255 255 255 h2_color - string + color 255 255 255 255 h3_color - string + color 255 255 255 255 h4_color - string + color 255 255 255 255 h5_color - string + color 255 255 255 255 h6_color - string + color 255 255 255 255 diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupHeader.xml b/code/studio/src/plugins/gui_editor/widgets/GroupHeader.xml similarity index 91% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupHeader.xml rename to code/studio/src/plugins/gui_editor/widgets/GroupHeader.xml index bcb517c66..91dd73e36 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupHeader.xml +++ b/code/studio/src/plugins/gui_editor/widgets/GroupHeader.xml @@ -2,7 +2,7 @@
    GroupHeader CGroupHeader - header + header GroupList false diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupList.xml b/code/studio/src/plugins/gui_editor/widgets/GroupList.xml similarity index 95% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupList.xml rename to code/studio/src/plugins/gui_editor/widgets/GroupList.xml index 1858cd5b3..569aa8d9d 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupList.xml +++ b/code/studio/src/plugins/gui_editor/widgets/GroupList.xml @@ -2,7 +2,7 @@
    GroupList CGroupList - list + list InterfaceGroup false @@ -41,7 +41,7 @@ col_over - string + color 255 255 255 32 diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupMenu.xml b/code/studio/src/plugins/gui_editor/widgets/GroupMenu.xml similarity index 88% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupMenu.xml rename to code/studio/src/plugins/gui_editor/widgets/GroupMenu.xml index 4739f0352..3bd0c5506 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupMenu.xml +++ b/code/studio/src/plugins/gui_editor/widgets/GroupMenu.xml @@ -2,7 +2,7 @@
    GroupMenu CGroupMenu - menu + menu GroupModal false @@ -16,7 +16,7 @@ color - string + color 255 255 255 255 @@ -26,32 +26,32 @@ shadow_color - string + color 0 0 0 255 color_over - string + color 255 255 255 255 shadow_color_over - string + color 0 0 0 255 highlight_over - string + color 128 0 0 255 color_grayed - string + color 128 128 128 255 shadow_color_grayed - string + color 0 0 0 255 diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupModal.xml b/code/studio/src/plugins/gui_editor/widgets/GroupModal.xml similarity index 98% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupModal.xml rename to code/studio/src/plugins/gui_editor/widgets/GroupModal.xml index afc5005c8..33bd6fd08 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupModal.xml +++ b/code/studio/src/plugins/gui_editor/widgets/GroupModal.xml @@ -2,7 +2,7 @@
    GroupModal CGroupModal - modal + modal GroupFrame false diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupParagraph.xml b/code/studio/src/plugins/gui_editor/widgets/GroupParagraph.xml similarity index 97% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupParagraph.xml rename to code/studio/src/plugins/gui_editor/widgets/GroupParagraph.xml index f05806757..e561e8c5f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupParagraph.xml +++ b/code/studio/src/plugins/gui_editor/widgets/GroupParagraph.xml @@ -30,7 +30,7 @@ col_over - string + color 255 255 255 32 diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupScrollText.xml b/code/studio/src/plugins/gui_editor/widgets/GroupScrollText.xml similarity index 91% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupScrollText.xml rename to code/studio/src/plugins/gui_editor/widgets/GroupScrollText.xml index 8cefb8df2..53092a456 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupScrollText.xml +++ b/code/studio/src/plugins/gui_editor/widgets/GroupScrollText.xml @@ -2,7 +2,7 @@
    GroupScrollText CGroupScrollText - scroll_text + scroll_text InterfaceGroup false diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupTab.xml b/code/studio/src/plugins/gui_editor/widgets/GroupTab.xml similarity index 95% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupTab.xml rename to code/studio/src/plugins/gui_editor/widgets/GroupTab.xml index 69db79466..e2e1a8bf1 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupTab.xml +++ b/code/studio/src/plugins/gui_editor/widgets/GroupTab.xml @@ -2,7 +2,7 @@
    GroupTab CGroupTab - tab + tab InterfaceGroup false diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupTable.xml b/code/studio/src/plugins/gui_editor/widgets/GroupTable.xml similarity index 94% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupTable.xml rename to code/studio/src/plugins/gui_editor/widgets/GroupTable.xml index 9c2240adc..dfbc4e2a8 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupTable.xml +++ b/code/studio/src/plugins/gui_editor/widgets/GroupTable.xml @@ -2,7 +2,7 @@
    GroupTable CGroupTable - table + table InterfaceGroup false @@ -26,7 +26,7 @@ bgcolor - string + color 0 0 0 255 diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupTree.xml b/code/studio/src/plugins/gui_editor/widgets/GroupTree.xml similarity index 95% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupTree.xml rename to code/studio/src/plugins/gui_editor/widgets/GroupTree.xml index 6bd10ad9f..b20c74733 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupTree.xml +++ b/code/studio/src/plugins/gui_editor/widgets/GroupTree.xml @@ -2,7 +2,7 @@
    GroupTree CGroupTree - tree + tree InterfaceGroup false @@ -11,17 +11,17 @@ col_over - string + color 255 255 255 128 col_select - string + color 255 128 128 128 col_over_back - string + color 64 64 64 255 diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/InterfaceElement.xml b/code/studio/src/plugins/gui_editor/widgets/InterfaceElement.xml similarity index 88% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/InterfaceElement.xml rename to code/studio/src/plugins/gui_editor/widgets/InterfaceElement.xml index 856480dc7..b16de9ed0 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/InterfaceElement.xml +++ b/code/studio/src/plugins/gui_editor/widgets/InterfaceElement.xml @@ -36,12 +36,17 @@ h int 0 - + posref - string - BL BL - + posref + BL + + + parentposref + posref + BL + sizeref string diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/InterfaceGroup.xml b/code/studio/src/plugins/gui_editor/widgets/InterfaceGroup.xml similarity index 94% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/InterfaceGroup.xml rename to code/studio/src/plugins/gui_editor/widgets/InterfaceGroup.xml index c9a8c1546..50f7c3e83 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/InterfaceGroup.xml +++ b/code/studio/src/plugins/gui_editor/widgets/InterfaceGroup.xml @@ -2,7 +2,7 @@
    InterfaceGroup CInterfaceGroup - interface_group + interface_group CtrlBase false @@ -41,7 +41,7 @@ on_active - string + action @@ -51,7 +51,7 @@ on_deactive - string + action @@ -81,7 +81,7 @@ group_onclick_r - string + action @@ -91,7 +91,7 @@ group_onclick_l - string + action @@ -101,7 +101,7 @@ on_enter - string + action handler diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/InterfaceGroupWheel.xml b/code/studio/src/plugins/gui_editor/widgets/InterfaceGroupWheel.xml similarity index 88% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/InterfaceGroupWheel.xml rename to code/studio/src/plugins/gui_editor/widgets/InterfaceGroupWheel.xml index 51590ee33..6a35671cd 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/InterfaceGroupWheel.xml +++ b/code/studio/src/plugins/gui_editor/widgets/InterfaceGroupWheel.xml @@ -2,7 +2,7 @@
    InterfaceGroupWheel CInterfaceGroupWheel - group_wheel + group_wheel InterfaceGroup false @@ -11,7 +11,7 @@ on_wheel_up - string + action @@ -21,7 +21,7 @@ on_wheel_down - string + action diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/RootGroup.xml b/code/studio/src/plugins/gui_editor/widgets/RootGroup.xml similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/RootGroup.xml rename to code/studio/src/plugins/gui_editor/widgets/RootGroup.xml diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewBitmap.xml b/code/studio/src/plugins/gui_editor/widgets/ViewBitmap.xml similarity index 91% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewBitmap.xml rename to code/studio/src/plugins/gui_editor/widgets/ViewBitmap.xml index 8b931f78b..1c22d67cd 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewBitmap.xml +++ b/code/studio/src/plugins/gui_editor/widgets/ViewBitmap.xml @@ -2,7 +2,7 @@
    ViewBitmap CViewBitmap - bitmap + bitmap CtrlBase false @@ -11,7 +11,7 @@ color - string + color 255 255 255 255 @@ -36,8 +36,8 @@ texture - string - + texture + log_kami.tga scale @@ -61,7 +61,7 @@ align - string + bitmap_align diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewBitmapCombo.xml b/code/studio/src/plugins/gui_editor/widgets/ViewBitmapCombo.xml similarity index 87% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewBitmapCombo.xml rename to code/studio/src/plugins/gui_editor/widgets/ViewBitmapCombo.xml index 190143be5..461f69c55 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewBitmapCombo.xml +++ b/code/studio/src/plugins/gui_editor/widgets/ViewBitmapCombo.xml @@ -2,7 +2,7 @@
    ViewBitmapCombo CViewBitmapCombo - bitmap_combo + bitmap_combo CtrlBase false @@ -26,17 +26,17 @@ col_normal - string + color col_over - string + color col_pushed - string + color diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewText.xml b/code/studio/src/plugins/gui_editor/widgets/ViewText.xml similarity index 94% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewText.xml rename to code/studio/src/plugins/gui_editor/widgets/ViewText.xml index 9490a1eee..4862517aa 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewText.xml +++ b/code/studio/src/plugins/gui_editor/widgets/ViewText.xml @@ -2,7 +2,7 @@
    ViewText CViewText - text + text InterfaceElement false @@ -11,7 +11,7 @@ color - string + color 255 255 255 255 @@ -31,7 +31,7 @@ shadow_color - string + color 0 0 0 255 @@ -41,7 +41,7 @@ justification - string + text_justification dont_clip_word @@ -102,7 +102,7 @@ hardtext string - some text + Some text hardtext_format diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewTextFormated.xml b/code/studio/src/plugins/gui_editor/widgets/ViewTextFormated.xml similarity index 90% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewTextFormated.xml rename to code/studio/src/plugins/gui_editor/widgets/ViewTextFormated.xml index c5749ca9c..36aa68102 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewTextFormated.xml +++ b/code/studio/src/plugins/gui_editor/widgets/ViewTextFormated.xml @@ -2,7 +2,7 @@
    ViewTextFormated CViewTextFormated - text_formated + text_formated ViewText false diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewTextID.xml b/code/studio/src/plugins/gui_editor/widgets/ViewTextID.xml similarity index 94% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewTextID.xml rename to code/studio/src/plugins/gui_editor/widgets/ViewTextID.xml index b3edc86ab..43ac442c0 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewTextID.xml +++ b/code/studio/src/plugins/gui_editor/widgets/ViewTextID.xml @@ -2,7 +2,7 @@
    ViewTextID CViewTextID - text_id + text_id ViewText false diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewTextIDFormated.xml b/code/studio/src/plugins/gui_editor/widgets/ViewTextIDFormated.xml similarity index 90% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewTextIDFormated.xml rename to code/studio/src/plugins/gui_editor/widgets/ViewTextIDFormated.xml index 3ac6c7962..32b08f156 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewTextIDFormated.xml +++ b/code/studio/src/plugins/gui_editor/widgets/ViewTextIDFormated.xml @@ -2,7 +2,7 @@
    ViewTextIDFormated CViewTextIDFormated - text_id_formated + text_id_formated ViewTextID false diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/CMakeLists.txt b/code/studio/src/plugins/landscape_editor/CMakeLists.txt similarity index 63% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/CMakeLists.txt rename to code/studio/src/plugins/landscape_editor/CMakeLists.txt index 129f672c5..448d86a48 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/CMakeLists.txt +++ b/code/studio/src/plugins/landscape_editor/CMakeLists.txt @@ -41,17 +41,17 @@ SOURCE_GROUP(QtGeneratedMocQrcSrc FILES ${OVQT_PLUGIN_LANDSCAPE_EDITOR_MOC_SRC} SOURCE_GROUP("Landscape Editor Plugin" FILES ${SRC}) SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) -ADD_LIBRARY(ovqt_plugin_landscape_editor SHARED ${SRC} +ADD_LIBRARY(studio_plugin_landscape_editor SHARED ${SRC} ${OVQT_PLUGIN_LANDSCAPE_EDITOR_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUGIN_LANDSCAPE_EDITOR_UI_HDRS} ${OVQT_PLUGIN_LANDSCAPE_EDITOR_RC_SRCS}) -TARGET_LINK_LIBRARIES(ovqt_plugin_landscape_editor ovqt_plugin_core nelmisc nel3d nelgeorges nelligo ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY}) +TARGET_LINK_LIBRARIES(studio_plugin_landscape_editor studio_plugin_core nelmisc nel3d nelgeorges nelligo ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY}) -NL_DEFAULT_PROPS(ovqt_plugin_landscape_editor "NeL, Tools, 3D: Object Viewer Qt Plugin: Landscape Editor") -NL_ADD_RUNTIME_FLAGS(ovqt_plugin_landscape_editor) -NL_ADD_LIB_SUFFIX(ovqt_plugin_landscape_editor) +NL_DEFAULT_PROPS(studio_plugin_landscape_editor "Tools: Studio Plugin: Landscape Editor") +NL_ADD_RUNTIME_FLAGS(studio_plugin_landscape_editor) +NL_ADD_LIB_SUFFIX(studio_plugin_landscape_editor) ADD_DEFINITIONS(-DLANDSCAPE_EDITOR_LIBRARY ${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) @@ -59,16 +59,16 @@ ADD_DEFINITIONS(-DLANDSCAPE_EDITOR_LIBRARY ${LIBXML2_DEFINITIONS} -DQT_PLUGIN -D IF(WIN32) IF(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_landscape_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_landscape_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) ELSE(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_landscape_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_landscape_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) ENDIF(WITH_INSTALL_LIBRARIES) ELSE(WIN32) IF(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_landscape_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_landscape_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) ELSE(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_landscape_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_landscape_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) ENDIF(WITH_INSTALL_LIBRARIES) ENDIF(WIN32) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_landscape_editor.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/studio_plugin_landscape_editor.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/builder_zone.cpp b/code/studio/src/plugins/landscape_editor/builder_zone.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/builder_zone.cpp rename to code/studio/src/plugins/landscape_editor/builder_zone.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/builder_zone.h b/code/studio/src/plugins/landscape_editor/builder_zone.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/builder_zone.h rename to code/studio/src/plugins/landscape_editor/builder_zone.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/builder_zone_base.cpp b/code/studio/src/plugins/landscape_editor/builder_zone_base.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/builder_zone_base.cpp rename to code/studio/src/plugins/landscape_editor/builder_zone_base.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/builder_zone_base.h b/code/studio/src/plugins/landscape_editor/builder_zone_base.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/builder_zone_base.h rename to code/studio/src/plugins/landscape_editor/builder_zone_base.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/builder_zone_region.cpp b/code/studio/src/plugins/landscape_editor/builder_zone_region.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/builder_zone_region.cpp rename to code/studio/src/plugins/landscape_editor/builder_zone_region.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/builder_zone_region.h b/code/studio/src/plugins/landscape_editor/builder_zone_region.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/builder_zone_region.h rename to code/studio/src/plugins/landscape_editor/builder_zone_region.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_grid.png b/code/studio/src/plugins/landscape_editor/icons/ic_grid.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_grid.png rename to code/studio/src/plugins/landscape_editor/icons/ic_grid.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_landscape_item.png b/code/studio/src/plugins/landscape_editor/icons/ic_nel_landscape_item.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_landscape_item.png rename to code/studio/src/plugins/landscape_editor/icons/ic_nel_landscape_item.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_landscape_settings.png b/code/studio/src/plugins/landscape_editor/icons/ic_nel_landscape_settings.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_landscape_settings.png rename to code/studio/src/plugins/landscape_editor/icons/ic_nel_landscape_settings.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_transition_land.png b/code/studio/src/plugins/landscape_editor/icons/ic_nel_transition_land.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_transition_land.png rename to code/studio/src/plugins/landscape_editor/icons/ic_nel_transition_land.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_world_editor.png b/code/studio/src/plugins/landscape_editor/icons/ic_nel_world_editor.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_world_editor.png rename to code/studio/src/plugins/landscape_editor/icons/ic_nel_world_editor.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_zone.png b/code/studio/src/plugins/landscape_editor/icons/ic_nel_zone.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_zone.png rename to code/studio/src/plugins/landscape_editor/icons/ic_nel_zone.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_zonel.png b/code/studio/src/plugins/landscape_editor/icons/ic_nel_zonel.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_zonel.png rename to code/studio/src/plugins/landscape_editor/icons/ic_nel_zonel.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_zones.png b/code/studio/src/plugins/landscape_editor/icons/ic_nel_zones.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_zones.png rename to code/studio/src/plugins/landscape_editor/icons/ic_nel_zones.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_snapshot.png b/code/studio/src/plugins/landscape_editor/icons/ic_snapshot.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_snapshot.png rename to code/studio/src/plugins/landscape_editor/icons/ic_snapshot.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_actions.cpp b/code/studio/src/plugins/landscape_editor/landscape_actions.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_actions.cpp rename to code/studio/src/plugins/landscape_editor/landscape_actions.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_actions.h b/code/studio/src/plugins/landscape_editor/landscape_actions.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_actions.h rename to code/studio/src/plugins/landscape_editor/landscape_actions.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor.qrc b/code/studio/src/plugins/landscape_editor/landscape_editor.qrc similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor.qrc rename to code/studio/src/plugins/landscape_editor/landscape_editor.qrc diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_constants.h b/code/studio/src/plugins/landscape_editor/landscape_editor_constants.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_constants.h rename to code/studio/src/plugins/landscape_editor/landscape_editor_constants.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_global.h b/code/studio/src/plugins/landscape_editor/landscape_editor_global.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_global.h rename to code/studio/src/plugins/landscape_editor/landscape_editor_global.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_plugin.cpp b/code/studio/src/plugins/landscape_editor/landscape_editor_plugin.cpp similarity index 98% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_plugin.cpp rename to code/studio/src/plugins/landscape_editor/landscape_editor_plugin.cpp index 73a6f5b25..f97aff691 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_plugin.cpp +++ b/code/studio/src/plugins/landscape_editor/landscape_editor_plugin.cpp @@ -39,6 +39,9 @@ LandscapeEditorPlugin::~LandscapeEditorPlugin() } qDeleteAll(m_autoReleaseObjects); m_autoReleaseObjects.clear(); + + delete m_libContext; + m_libContext = NULL; } bool LandscapeEditorPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_plugin.h b/code/studio/src/plugins/landscape_editor/landscape_editor_plugin.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_plugin.h rename to code/studio/src/plugins/landscape_editor/landscape_editor_plugin.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.cpp b/code/studio/src/plugins/landscape_editor/landscape_editor_window.cpp similarity index 99% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.cpp rename to code/studio/src/plugins/landscape_editor/landscape_editor_window.cpp index bbc996b94..aeca41906 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.cpp +++ b/code/studio/src/plugins/landscape_editor/landscape_editor_window.cpp @@ -104,6 +104,10 @@ LandscapeEditorWindow::~LandscapeEditorWindow() { writeSettings(); delete m_zoneBuilder; + + Core::ICore::instance()->mainWindow()->statusBar()->removeWidget( m_statusInfo ); + delete m_statusInfo; + m_statusInfo = NULL; } QUndoStack *LandscapeEditorWindow::undoStack() const diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.h b/code/studio/src/plugins/landscape_editor/landscape_editor_window.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.h rename to code/studio/src/plugins/landscape_editor/landscape_editor_window.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.ui b/code/studio/src/plugins/landscape_editor/landscape_editor_window.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.ui rename to code/studio/src/plugins/landscape_editor/landscape_editor_window.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_scene.cpp b/code/studio/src/plugins/landscape_editor/landscape_scene.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_scene.cpp rename to code/studio/src/plugins/landscape_editor/landscape_scene.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_scene.h b/code/studio/src/plugins/landscape_editor/landscape_scene.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_scene.h rename to code/studio/src/plugins/landscape_editor/landscape_scene.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_scene_base.cpp b/code/studio/src/plugins/landscape_editor/landscape_scene_base.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_scene_base.cpp rename to code/studio/src/plugins/landscape_editor/landscape_scene_base.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_scene_base.h b/code/studio/src/plugins/landscape_editor/landscape_scene_base.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_scene_base.h rename to code/studio/src/plugins/landscape_editor/landscape_scene_base.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_view.cpp b/code/studio/src/plugins/landscape_editor/landscape_view.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_view.cpp rename to code/studio/src/plugins/landscape_editor/landscape_view.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_view.h b/code/studio/src/plugins/landscape_editor/landscape_view.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_view.h rename to code/studio/src/plugins/landscape_editor/landscape_view.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/list_zones_model.cpp b/code/studio/src/plugins/landscape_editor/list_zones_model.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/list_zones_model.cpp rename to code/studio/src/plugins/landscape_editor/list_zones_model.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/list_zones_model.h b/code/studio/src/plugins/landscape_editor/list_zones_model.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/list_zones_model.h rename to code/studio/src/plugins/landscape_editor/list_zones_model.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/list_zones_widget.cpp b/code/studio/src/plugins/landscape_editor/list_zones_widget.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/list_zones_widget.cpp rename to code/studio/src/plugins/landscape_editor/list_zones_widget.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/list_zones_widget.h b/code/studio/src/plugins/landscape_editor/list_zones_widget.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/list_zones_widget.h rename to code/studio/src/plugins/landscape_editor/list_zones_widget.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/list_zones_widget.ui b/code/studio/src/plugins/landscape_editor/list_zones_widget.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/list_zones_widget.ui rename to code/studio/src/plugins/landscape_editor/list_zones_widget.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/pixmap_database.cpp b/code/studio/src/plugins/landscape_editor/pixmap_database.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/pixmap_database.cpp rename to code/studio/src/plugins/landscape_editor/pixmap_database.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/pixmap_database.h b/code/studio/src/plugins/landscape_editor/pixmap_database.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/pixmap_database.h rename to code/studio/src/plugins/landscape_editor/pixmap_database.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/project_settings_dialog.cpp b/code/studio/src/plugins/landscape_editor/project_settings_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/project_settings_dialog.cpp rename to code/studio/src/plugins/landscape_editor/project_settings_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/project_settings_dialog.h b/code/studio/src/plugins/landscape_editor/project_settings_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/project_settings_dialog.h rename to code/studio/src/plugins/landscape_editor/project_settings_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/project_settings_dialog.ui b/code/studio/src/plugins/landscape_editor/project_settings_dialog.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/project_settings_dialog.ui rename to code/studio/src/plugins/landscape_editor/project_settings_dialog.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/shapshot_dialog.ui b/code/studio/src/plugins/landscape_editor/shapshot_dialog.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/shapshot_dialog.ui rename to code/studio/src/plugins/landscape_editor/shapshot_dialog.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/snapshot_dialog.cpp b/code/studio/src/plugins/landscape_editor/snapshot_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/snapshot_dialog.cpp rename to code/studio/src/plugins/landscape_editor/snapshot_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/snapshot_dialog.h b/code/studio/src/plugins/landscape_editor/snapshot_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/snapshot_dialog.h rename to code/studio/src/plugins/landscape_editor/snapshot_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/ovqt_plugin_landscape_editor.xml b/code/studio/src/plugins/landscape_editor/studio_plugin_landscape_editor.xml similarity index 77% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/ovqt_plugin_landscape_editor.xml rename to code/studio/src/plugins/landscape_editor/studio_plugin_landscape_editor.xml index a0d32a22a..53dac537b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/ovqt_plugin_landscape_editor.xml +++ b/code/studio/src/plugins/landscape_editor/studio_plugin_landscape_editor.xml @@ -1,5 +1,5 @@ - ovqt_plugin_landscape_editor + studio_plugin_landscape_editor LandscapeEditor 0.8 GSoC2011_dnk-88 diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/zone_region_editor.cpp b/code/studio/src/plugins/landscape_editor/zone_region_editor.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/zone_region_editor.cpp rename to code/studio/src/plugins/landscape_editor/zone_region_editor.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/zone_region_editor.h b/code/studio/src/plugins/landscape_editor/zone_region_editor.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/zone_region_editor.h rename to code/studio/src/plugins/landscape_editor/zone_region_editor.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/CMakeLists.txt b/code/studio/src/plugins/log/CMakeLists.txt similarity index 55% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/log/CMakeLists.txt rename to code/studio/src/plugins/log/CMakeLists.txt index 4cee3da24..7a27f370a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/CMakeLists.txt +++ b/code/studio/src/plugins/log/CMakeLists.txt @@ -26,30 +26,30 @@ SOURCE_GROUP(QtGeneratedMocSrc FILES ${OVQT_PLUG_LOG_MOC_SRC}) SOURCE_GROUP("Log Plugin" FILES ${SRC}) SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) -ADD_LIBRARY(ovqt_plugin_log MODULE ${SRC} ${OVQT_PLUG_LOG_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUG_LOG_UI_HDRS}) +ADD_LIBRARY(studio_plugin_log MODULE ${SRC} ${OVQT_PLUG_LOG_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUG_LOG_UI_HDRS}) -TARGET_LINK_LIBRARIES(ovqt_plugin_log ovqt_plugin_core nelmisc ${QT_LIBRARIES}) +TARGET_LINK_LIBRARIES(studio_plugin_log studio_plugin_core nelmisc ${QT_LIBRARIES}) -NL_DEFAULT_PROPS(ovqt_plugin_log "NeL, Tools, 3D: Object Viewer Qt Plugin: Log") -NL_ADD_RUNTIME_FLAGS(ovqt_plugin_log) -NL_ADD_LIB_SUFFIX(ovqt_plugin_log) +NL_DEFAULT_PROPS(studio_plugin_log "Tools: Studio Plugin: Log") +NL_ADD_RUNTIME_FLAGS(studio_plugin_log) +NL_ADD_LIB_SUFFIX(studio_plugin_log) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) IF(WIN32) IF(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_log LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_log LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) ELSE(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_log LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_log LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) ENDIF(WITH_INSTALL_LIBRARIES) ELSE(WIN32) IF(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_log LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_log LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) ELSE(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_log LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_log LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) ENDIF(WITH_INSTALL_LIBRARIES) ENDIF(WIN32) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_log.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/studio_plugin_log.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_form.ui b/code/studio/src/plugins/log/log_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_form.ui rename to code/studio/src/plugins/log/log_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.cpp b/code/studio/src/plugins/log/log_plugin.cpp similarity index 95% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.cpp rename to code/studio/src/plugins/log/log_plugin.cpp index 0f86ab90c..11da182a0 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.cpp +++ b/code/studio/src/plugins/log/log_plugin.cpp @@ -45,6 +45,7 @@ namespace Plugin CLogPlugin::CLogPlugin(QWidget *parent): QDockWidget(parent) { m_ui.setupUi(this); + logMenu = NULL; } CLogPlugin::~CLogPlugin() @@ -62,6 +63,12 @@ namespace Plugin NLMISC::AssertLog->removeDisplayer(m_displayer); NLMISC::InfoLog->removeDisplayer(m_displayer); delete m_displayer; + + delete logMenu; + logMenu = NULL; + + delete m_libContext; + m_libContext = NULL; } bool CLogPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) @@ -79,13 +86,15 @@ namespace Plugin Core::ICore *core = Core::ICore::instance(); Core::MenuManager *menuManager = core->menuManager(); - QMenu *viewMenu = menuManager->menu(Core::Constants::M_VIEW); QMainWindow *wnd = Core::ICore::instance()->mainWindow(); wnd->addDockWidget(Qt::RightDockWidgetArea, this); hide(); - viewMenu->addAction(this->toggleViewAction()); + logMenu = menuManager->menuBar()->addMenu( "Log" ); + QAction *a = toggleViewAction(); + a->setText( tr( "View log" ) ); + logMenu->addAction( a ); } void CLogPlugin::setNelContext(NLMISC::INelContext *nelContext) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.h b/code/studio/src/plugins/log/log_plugin.h similarity index 99% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.h rename to code/studio/src/plugins/log/log_plugin.h index 2221195a8..9e4f64419 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.h +++ b/code/studio/src/plugins/log/log_plugin.h @@ -85,6 +85,8 @@ namespace Plugin NLQT::CQtDisplayer *m_displayer; + QMenu *logMenu; + }; } // namespace Plugin diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_settings_page.cpp b/code/studio/src/plugins/log/log_settings_page.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_settings_page.cpp rename to code/studio/src/plugins/log/log_settings_page.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_settings_page.h b/code/studio/src/plugins/log/log_settings_page.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_settings_page.h rename to code/studio/src/plugins/log/log_settings_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_settings_page.ui b/code/studio/src/plugins/log/log_settings_page.ui similarity index 94% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_settings_page.ui rename to code/studio/src/plugins/log/log_settings_page.ui index 92faef8b6..09ead5c17 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_settings_page.ui +++ b/code/studio/src/plugins/log/log_settings_page.ui @@ -89,7 +89,7 @@ - + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/qt_displayer.cpp b/code/studio/src/plugins/log/qt_displayer.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/log/qt_displayer.cpp rename to code/studio/src/plugins/log/qt_displayer.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/qt_displayer.h b/code/studio/src/plugins/log/qt_displayer.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/log/qt_displayer.h rename to code/studio/src/plugins/log/qt_displayer.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/ovqt_plugin_log.xml b/code/studio/src/plugins/log/studio_plugin_log.xml similarity index 80% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/log/ovqt_plugin_log.xml rename to code/studio/src/plugins/log/studio_plugin_log.xml index 90b1b1e27..48d97bd87 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/ovqt_plugin_log.xml +++ b/code/studio/src/plugins/log/studio_plugin_log.xml @@ -1,5 +1,5 @@ - ovqt_plugin_log + studio_plugin_log LogPlugin 1.1 aquiles diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/CMakeLists.txt b/code/studio/src/plugins/mission_compiler/CMakeLists.txt similarity index 59% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/CMakeLists.txt rename to code/studio/src/plugins/mission_compiler/CMakeLists.txt index 1dcbebfa8..cbf35b9c7 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/CMakeLists.txt +++ b/code/studio/src/plugins/mission_compiler/CMakeLists.txt @@ -36,13 +36,13 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ryzom/tools/leveldesign/mission_compiler # Game Share Library INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common/src) -ADD_LIBRARY(ovqt_plugin_mission_compiler MODULE ${SRC} ${OVQT_PLUG_MISSION_COMPILER_MOC_SRC} ${OVQT_PLUG_MISSION_COMPILER_RC_SRCS} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUG_MISSION_COMPILER_UI_HDRS}) +ADD_LIBRARY(studio_plugin_mission_compiler MODULE ${SRC} ${OVQT_PLUG_MISSION_COMPILER_MOC_SRC} ${OVQT_PLUG_MISSION_COMPILER_RC_SRCS} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUG_MISSION_COMPILER_UI_HDRS}) -TARGET_LINK_LIBRARIES(ovqt_plugin_mission_compiler ovqt_plugin_core nelmisc nelligo ryzom_mission_compiler_lib ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY}) +TARGET_LINK_LIBRARIES(studio_plugin_mission_compiler studio_plugin_core nelmisc nelligo ryzom_mission_compiler_lib ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY}) -NL_DEFAULT_PROPS(ovqt_plugin_mission_compiler "NeL, Tools, 3D: Object Viewer Qt Plugin: Mission Compiler") -NL_ADD_RUNTIME_FLAGS(ovqt_plugin_mission_compiler) -NL_ADD_LIB_SUFFIX(ovqt_plugin_mission_compiler) +NL_DEFAULT_PROPS(studio_plugin_mission_compiler "Tools: Studio Plugin: Mission Compiler") +NL_ADD_RUNTIME_FLAGS(studio_plugin_mission_compiler) +NL_ADD_LIB_SUFFIX(studio_plugin_mission_compiler) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) @@ -50,17 +50,17 @@ ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS} IF(WIN32) IF(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_mission_compiler LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_mission_compiler LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) ELSE(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_mission_compiler LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_mission_compiler LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) ENDIF(WITH_INSTALL_LIBRARIES) ELSE(WIN32) IF(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_mission_compiler LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_mission_compiler LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) ELSE(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_mission_compiler LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_mission_compiler LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) ENDIF(WITH_INSTALL_LIBRARIES) ENDIF(WIN32) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_mission_compiler.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/studio_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/images/arrow-left-2.png b/code/studio/src/plugins/mission_compiler/images/arrow-left-2.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/arrow-left-2.png rename to code/studio/src/plugins/mission_compiler/images/arrow-left-2.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/arrow-left-double-2.png b/code/studio/src/plugins/mission_compiler/images/arrow-left-double-2.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/arrow-left-double-2.png rename to code/studio/src/plugins/mission_compiler/images/arrow-left-double-2.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/arrow-right-2.png b/code/studio/src/plugins/mission_compiler/images/arrow-right-2.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/arrow-right-2.png rename to code/studio/src/plugins/mission_compiler/images/arrow-right-2.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/arrow-right-double-2.png b/code/studio/src/plugins/mission_compiler/images/arrow-right-double-2.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/arrow-right-double-2.png rename to code/studio/src/plugins/mission_compiler/images/arrow-right-double-2.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/document-export-4.png b/code/studio/src/plugins/mission_compiler/images/document-export-4.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/document-export-4.png rename to code/studio/src/plugins/mission_compiler/images/document-export-4.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/ic_nel_add_item.png b/code/studio/src/plugins/mission_compiler/images/ic_nel_add_item.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/ic_nel_add_item.png rename to code/studio/src/plugins/mission_compiler/images/ic_nel_add_item.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/ic_nel_delete_item.png b/code/studio/src/plugins/mission_compiler/images/ic_nel_delete_item.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/ic_nel_delete_item.png rename to code/studio/src/plugins/mission_compiler/images/ic_nel_delete_item.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/ic_nel_down_item.png b/code/studio/src/plugins/mission_compiler/images/ic_nel_down_item.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/ic_nel_down_item.png rename to code/studio/src/plugins/mission_compiler/images/ic_nel_down_item.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/ic_nel_generic_settings.png b/code/studio/src/plugins/mission_compiler/images/ic_nel_generic_settings.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/ic_nel_generic_settings.png rename to code/studio/src/plugins/mission_compiler/images/ic_nel_generic_settings.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/ic_nel_reset_all.png b/code/studio/src/plugins/mission_compiler/images/ic_nel_reset_all.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/ic_nel_reset_all.png rename to code/studio/src/plugins/mission_compiler/images/ic_nel_reset_all.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/ic_nel_up_item.png b/code/studio/src/plugins/mission_compiler/images/ic_nel_up_item.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/ic_nel_up_item.png rename to code/studio/src/plugins/mission_compiler/images/ic_nel_up_item.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/news-subscribe-2.png b/code/studio/src/plugins/mission_compiler/images/news-subscribe-2.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/news-subscribe-2.png rename to code/studio/src/plugins/mission_compiler/images/news-subscribe-2.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/run-build-2.png b/code/studio/src/plugins/mission_compiler/images/run-build-2.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/run-build-2.png rename to code/studio/src/plugins/mission_compiler/images/run-build-2.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler.qrc b/code/studio/src/plugins/mission_compiler/mission_compiler.qrc similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler.qrc rename to code/studio/src/plugins/mission_compiler/mission_compiler.qrc diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp b/code/studio/src/plugins/mission_compiler/mission_compiler_main_window.cpp similarity index 97% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp rename to code/studio/src/plugins/mission_compiler/mission_compiler_main_window.cpp index e01f5f617..efadd3949 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp +++ b/code/studio/src/plugins/mission_compiler/mission_compiler_main_window.cpp @@ -90,7 +90,14 @@ MissionCompilerMainWindow::MissionCompilerMainWindow(QWidget *parent) : NLLIGO::Register(); // TODO try/catch exception. Crashes if path invalid. - m_ligoConfig.readPrimitiveClass(NLMISC::CPath::lookup("world_editor_classes.xml").c_str(), false); + try{ + m_ligoConfig.readPrimitiveClass(NLMISC::CPath::lookup("world_editor_classes.xml").c_str(), false); + } + catch( NLMISC::Exception &e ) + { + nlinfo( "Exception occured during Mission Compiler LIGO startup: %s", e.what() ); + } + NLLIGO::CPrimitiveContext::instance().CurrentLigoConfig = &m_ligoConfig; } @@ -477,6 +484,11 @@ void MissionCompilerMainWindow::saveConfig() { settings->sync(); } +void MissionCompilerMainWindow::onActivated() +{ + NLLIGO::CPrimitiveContext::instance().CurrentLigoConfig = &m_ligoConfig; +} + void MissionCompilerMainWindow::handleChangedSettings() { QStringList servers; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.h b/code/studio/src/plugins/mission_compiler/mission_compiler_main_window.h similarity index 98% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.h rename to code/studio/src/plugins/mission_compiler/mission_compiler_main_window.h index dc19db1c6..3d59e206a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.h +++ b/code/studio/src/plugins/mission_compiler/mission_compiler_main_window.h @@ -31,6 +31,8 @@ public: void saveConfig(); QUndoStack *getUndoStack() { return m_undoStack; } + void onActivated(); + typedef std::map TMissionContainer; public Q_SLOTS: diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.ui b/code/studio/src/plugins/mission_compiler/mission_compiler_main_window.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.ui rename to code/studio/src/plugins/mission_compiler/mission_compiler_main_window.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.cpp b/code/studio/src/plugins/mission_compiler/mission_compiler_plugin.cpp similarity index 95% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.cpp rename to code/studio/src/plugins/mission_compiler/mission_compiler_plugin.cpp index 98b188fd3..46e51f36d 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.cpp +++ b/code/studio/src/plugins/mission_compiler/mission_compiler_plugin.cpp @@ -30,6 +30,9 @@ MissionCompilerPlugin::~MissionCompilerPlugin() } qDeleteAll(m_autoReleaseObjects); m_autoReleaseObjects.clear(); + + delete m_LibContext; + m_LibContext = NULL; } bool MissionCompilerPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.h b/code/studio/src/plugins/mission_compiler/mission_compiler_plugin.h similarity index 95% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.h rename to code/studio/src/plugins/mission_compiler/mission_compiler_plugin.h index 2ad92b40f..cc2cac47c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.h +++ b/code/studio/src/plugins/mission_compiler/mission_compiler_plugin.h @@ -83,6 +83,12 @@ public: virtual void open() {} + void onActivated() + { + m_missionCompilerMainWindow->onActivated(); + } + + MissionCompilerMainWindow *m_missionCompilerMainWindow; }; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin_constants.h b/code/studio/src/plugins/mission_compiler/mission_compiler_plugin_constants.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin_constants.h rename to code/studio/src/plugins/mission_compiler/mission_compiler_plugin_constants.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.cpp b/code/studio/src/plugins/mission_compiler/mission_compiler_settings_page.cpp similarity index 97% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.cpp rename to code/studio/src/plugins/mission_compiler/mission_compiler_settings_page.cpp index ad115cffd..28dc4f9ce 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.cpp +++ b/code/studio/src/plugins/mission_compiler/mission_compiler_settings_page.cpp @@ -191,7 +191,9 @@ void MissionCompilerSettingsPage::writeSettings() { for(int column = 0; column < m_ui.serversTableWidget->columnCount(); column++) { - items << m_ui.serversTableWidget->item(row, column)->text(); + QTableWidgetItem *item = m_ui.serversTableWidget->item(row, column); + if( item != NULL ) + items << item->text(); } } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.h b/code/studio/src/plugins/mission_compiler/mission_compiler_settings_page.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.h rename to code/studio/src/plugins/mission_compiler/mission_compiler_settings_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.ui b/code/studio/src/plugins/mission_compiler/mission_compiler_settings_page.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.ui rename to code/studio/src/plugins/mission_compiler/mission_compiler_settings_page.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/server_entry_dialog.cpp b/code/studio/src/plugins/mission_compiler/server_entry_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/server_entry_dialog.cpp rename to code/studio/src/plugins/mission_compiler/server_entry_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/server_entry_dialog.h b/code/studio/src/plugins/mission_compiler/server_entry_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/server_entry_dialog.h rename to code/studio/src/plugins/mission_compiler/server_entry_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/server_entry_dialog.ui b/code/studio/src/plugins/mission_compiler/server_entry_dialog.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/server_entry_dialog.ui rename to code/studio/src/plugins/mission_compiler/server_entry_dialog.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/ovqt_plugin_mission_compiler.xml b/code/studio/src/plugins/mission_compiler/studio_plugin_mission_compiler.xml similarity index 76% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/ovqt_plugin_mission_compiler.xml rename to code/studio/src/plugins/mission_compiler/studio_plugin_mission_compiler.xml index 072707e07..85bdca66f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/ovqt_plugin_mission_compiler.xml +++ b/code/studio/src/plugins/mission_compiler/studio_plugin_mission_compiler.xml @@ -1,5 +1,5 @@ - ovqt_plugin_mission_compiler + studio_plugin_mission_compiler MissionCompiler 0.1 Ryzom Core diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/validation_file.cpp b/code/studio/src/plugins/mission_compiler/validation_file.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/validation_file.cpp rename to code/studio/src/plugins/mission_compiler/validation_file.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/validation_file.h b/code/studio/src/plugins/mission_compiler/validation_file.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/validation_file.h rename to code/studio/src/plugins/mission_compiler/validation_file.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/CMakeLists.txt b/code/studio/src/plugins/object_viewer/CMakeLists.txt similarity index 85% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/CMakeLists.txt rename to code/studio/src/plugins/object_viewer/CMakeLists.txt index b550e8ea0..3a4ce9c65 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/CMakeLists.txt +++ b/code/studio/src/plugins/object_viewer/CMakeLists.txt @@ -165,7 +165,7 @@ 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} +ADD_LIBRARY(studio_plugin_object_viewer MODULE ${SRC} ${OVQT_SCENE_SRC} ${OVQT_PS_SRC} ${OVQT_VEGETABLE_SRC} @@ -175,8 +175,8 @@ ADD_LIBRARY(ovqt_plugin_object_viewer MODULE ${SRC} ${OBJECT_VIEWER_PLUGIN_UI_HDRS} ${OBJECT_VIEWER_PLUGIN_RC_SRCS}) -TARGET_LINK_LIBRARIES(ovqt_plugin_object_viewer - ovqt_plugin_core +TARGET_LINK_LIBRARIES(studio_plugin_object_viewer + studio_plugin_core nelmisc nel3d nelsound @@ -185,32 +185,32 @@ TARGET_LINK_LIBRARIES(ovqt_plugin_object_viewer ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY}) -NL_DEFAULT_PROPS(ovqt_plugin_object_viewer "NeL, Tools, 3D: Object Viewer Qt Plugin: Object Viewer") +NL_DEFAULT_PROPS(studio_plugin_object_viewer "Tools: Studio Plugin: Object Viewer") -NL_ADD_RUNTIME_FLAGS(ovqt_plugin_object_viewer) -NL_ADD_LIB_SUFFIX(ovqt_plugin_object_viewer) +NL_ADD_RUNTIME_FLAGS(studio_plugin_object_viewer) +NL_ADD_LIB_SUFFIX(studio_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) + ADD_NATIVE_PRECOMPILED_HEADER(studio_plugin_object_viewer ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) ENDIF(WITH_PCH) IF(WIN32) IF(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_object_viewer LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_object_viewer LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) ELSE(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_object_viewer LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_object_viewer LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) ENDIF(WITH_INSTALL_LIBRARIES) ELSE(WIN32) IF(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_object_viewer LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_object_viewer LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) ELSE(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_object_viewer LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_object_viewer LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) ENDIF(WITH_INSTALL_LIBRARIES) ENDIF(WIN32) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_object_viewer.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/studio_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/graphics_settings_page.cpp b/code/studio/src/plugins/object_viewer/graphics_settings_page.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.cpp rename to code/studio/src/plugins/object_viewer/graphics_settings_page.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.h b/code/studio/src/plugins/object_viewer/graphics_settings_page.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.h rename to code/studio/src/plugins/object_viewer/graphics_settings_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.ui b/code/studio/src/plugins/object_viewer/graphics_settings_page.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.ui rename to code/studio/src/plugins/object_viewer/graphics_settings_page.ui diff --git a/code/studio/src/plugins/object_viewer/graphics_viewport.cpp b/code/studio/src/plugins/object_viewer/graphics_viewport.cpp new file mode 100644 index 000000000..0cec0be10 --- /dev/null +++ b/code/studio/src/plugins/object_viewer/graphics_viewport.cpp @@ -0,0 +1,129 @@ +/* + Object Viewer Qt + Copyright (C) 2010 Dzmitry Kamiahin + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +*/ + +#include "stdpch.h" +#include "graphics_viewport.h" +#include "../core/Nel3DWidget/nel3d_widget.h" + +// STL includes + +// Qt includes +#include +#include +#include +#include + +// NeL includes +#include + +#include +#include + +#include +#include + +// Project includes +#include "modules.h" + +using namespace std; +using namespace NL3D; + +namespace NLQT +{ + +CGraphicsViewport::CGraphicsViewport(QObject *parent) + : QObject(parent) +{ + w = new Nel3DWidget(); + connect( w, SIGNAL( resize( int, int ) ), this, SLOT( onResize( int, int ) ) ); +} + +CGraphicsViewport::~CGraphicsViewport() +{ + disconnect( w, SIGNAL( resize( int, int ) ), this, SLOT( onResize( int, int ) ) ); + delete w; + w = NULL; +} + +void CGraphicsViewport::init() +{ + //H_AUTO2 + nldebug("CGraphicsViewport::init"); + + w->init(); + Modules::objView().init( w->getDriver() ); + Modules::psEdit().init(); + Modules::veget().init(); + + w->setMouseTracking(true); + w->setFocusPolicy(Qt::StrongFocus); +} + +void CGraphicsViewport::release() +{ + //H_AUTO2 + nldebug("CGraphicsViewport::release"); + + Modules::veget().release(); + Modules::psEdit().release(); + Modules::objView().release(); +} + + +QAction *CGraphicsViewport::createSaveScreenshotAction(QObject *parent) +{ + QAction *action = new QAction(parent); + connect(action, SIGNAL(triggered()), this, SLOT(saveScreenshot())); + return action; +} + +QAction *CGraphicsViewport::createSetBackgroundColor(QObject *parent) +{ + QAction *action = new QAction(parent); + connect(action, SIGNAL(triggered()), this, SLOT(setBackgroundColor())); + return action; +} + +QWidget* CGraphicsViewport::widget() +{ + return w; +} + +void CGraphicsViewport::saveScreenshot() +{ + Modules::objView().saveScreenshot("screenshot", false, true, false); +} + +void CGraphicsViewport::setBackgroundColor() +{ + QColor color = QColorDialog::getColor(QColor(Modules::objView().getBackgroundColor().R, + Modules::objView().getBackgroundColor().G, + Modules::objView().getBackgroundColor().B)); + if (color.isValid()) + Modules::objView().setBackgroundColor(NLMISC::CRGBA(color.red(), color.green(), color.blue())); +} + +void CGraphicsViewport::onResize( int width, int height ) +{ + if (Modules::objView().getDriver()) + Modules::objView().setSizeViewport( width, height ); +} + +} /* namespace NLQT */ + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_viewport.h b/code/studio/src/plugins/object_viewer/graphics_viewport.h similarity index 67% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_viewport.h rename to code/studio/src/plugins/object_viewer/graphics_viewport.h index 0c01fa1ad..a11081ffd 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_viewport.h +++ b/code/studio/src/plugins/object_viewer/graphics_viewport.h @@ -26,23 +26,14 @@ // STL includes // Qt includes -#include -#include +#include // NeL includes // Project includes - -/* TODO every platform should use QWidget */ -#if defined(NL_OS_WINDOWS) -typedef QWidget QNLWidget; -#elif defined(NL_OS_MAC) -typedef QWidget QNLWidget; -#elif defined(NL_OS_UNIX) -typedef QGLWidget QNLWidget; -#endif // NL_OS_UNIX - +class QWidget; class QAction; +class Nel3DWidget; namespace NLQT { @@ -51,47 +42,37 @@ namespace NLQT @class CGraphicsViewport @brief Responsible for interaction between Qt and NeL. Initializes CObjectViewer, CParticleEditor and CVegetableEditor subsystem. */ -class CGraphicsViewport : public QNLWidget, public NLMISC::IEventEmitter +class CGraphicsViewport : public QObject, public NLMISC::IEventEmitter { Q_OBJECT public: - CGraphicsViewport(QWidget *parent); + CGraphicsViewport(QObject *parent); virtual ~CGraphicsViewport(); - virtual QPaintEngine *paintEngine() const - { - return NULL; - } - void init(); void release(); QAction *createSaveScreenshotAction(QObject *parent); QAction *createSetBackgroundColor(QObject *parent); + QWidget* widget(); + private Q_SLOTS: void saveScreenshot(); void setBackgroundColor(); void submitEvents(NLMISC::CEventServer &server, bool allWindows) { } - void emulateMouseRawMode(bool) { } -protected: - virtual void resizeEvent(QResizeEvent *resizeEvent); - -#if defined(NL_OS_WINDOWS) - virtual bool winEvent(MSG *message, long *result); -#elif defined(NL_OS_MAC) - virtual bool macEvent(EventHandlerCallRef caller, EventRef event); -#elif defined(NL_OS_UNIX) - virtual bool x11Event(XEvent *event); -#endif + void onResize( int width, int height ); private: CGraphicsViewport(const CGraphicsViewport &); CGraphicsViewport &operator=(const CGraphicsViewport &); + + Nel3DWidget *w; + }; /* class CGraphicsViewport */ } /* namespace NLQT */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_add_item.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_add_item.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_add_item.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_add_item.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_anim.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_anim.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_anim.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_anim.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_animset.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_animset.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_animset.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_animset.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_append_item.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_append_item.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_append_item.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_append_item.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_bgcolor.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_bgcolor.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_bgcolor.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_bgcolor.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_camera_3dedit.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_camera_3dedit.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_camera_3dedit.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_camera_3dedit.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_camera_add.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_camera_add.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_camera_add.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_camera_add.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_camera_del.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_camera_del.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_camera_del.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_camera_del.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_camera_fps.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_camera_fps.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_camera_fps.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_camera_fps.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_daynight.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_daynight.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_daynight.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_daynight.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_delete_item.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_delete_item.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_delete_item.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_delete_item.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_down_item.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_down_item.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_down_item.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_down_item.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_framedelay.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_framedelay.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_framedelay.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_framedelay.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_insert_item.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_insert_item.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_insert_item.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_insert_item.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_mixer.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_mixer.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_mixer.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_mixer.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_mrm_mesh.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_mrm_mesh.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_mrm_mesh.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_mrm_mesh.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_new.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_new.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_new.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_new.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_open.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_open.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_open.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_open.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_particle_system.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_particle_system.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_particle_system.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_particle_system.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_particle_system_close.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_particle_system_close.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_particle_system_close.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_particle_system_close.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_particles.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_particles.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_particles.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_particles.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_pill.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_pill.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_pill.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_pill.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_reset_all.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_reset_all.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_reset_all.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_reset_all.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_reset_camera.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_reset_camera.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_reset_camera.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_reset_camera.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_save.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_save.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_save.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_save.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_save_as.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_save_as.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_save_as.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_save_as.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_skelscale.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_skelscale.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_skelscale.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_skelscale.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_sound.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_sound.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_sound.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_sound.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_up_item.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_up_item.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_up_item.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_up_item.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_veget.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_veget.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_veget.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_veget.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_vegetset.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_vegetset.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_vegetset.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_vegetset.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_water.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_water.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_water.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_water.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_wind.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_wind.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_wind.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_wind.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_workspace_item.png b/code/studio/src/plugins/object_viewer/icons/ic_nel_workspace_item.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/ic_nel_workspace_item.png rename to code/studio/src/plugins/object_viewer/icons/ic_nel_workspace_item.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/particles_system_24/ic_nel_collision_zone_item_24.png b/code/studio/src/plugins/object_viewer/icons/particles_system_24/ic_nel_collision_zone_item_24.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/particles_system_24/ic_nel_collision_zone_item_24.png rename to code/studio/src/plugins/object_viewer/icons/particles_system_24/ic_nel_collision_zone_item_24.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/particles_system_24/ic_nel_emitter_item_24.png b/code/studio/src/plugins/object_viewer/icons/particles_system_24/ic_nel_emitter_item_24.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/particles_system_24/ic_nel_emitter_item_24.png rename to code/studio/src/plugins/object_viewer/icons/particles_system_24/ic_nel_emitter_item_24.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/particles_system_24/ic_nel_force_item_24.png b/code/studio/src/plugins/object_viewer/icons/particles_system_24/ic_nel_force_item_24.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/particles_system_24/ic_nel_force_item_24.png rename to code/studio/src/plugins/object_viewer/icons/particles_system_24/ic_nel_force_item_24.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/particles_system_24/ic_nel_instance_item_24.png b/code/studio/src/plugins/object_viewer/icons/particles_system_24/ic_nel_instance_item_24.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/particles_system_24/ic_nel_instance_item_24.png rename to code/studio/src/plugins/object_viewer/icons/particles_system_24/ic_nel_instance_item_24.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/particles_system_24/ic_nel_light_item_24.png b/code/studio/src/plugins/object_viewer/icons/particles_system_24/ic_nel_light_item_24.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/particles_system_24/ic_nel_light_item_24.png rename to code/studio/src/plugins/object_viewer/icons/particles_system_24/ic_nel_light_item_24.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/particles_system_24/ic_nel_located_item_24.png b/code/studio/src/plugins/object_viewer/icons/particles_system_24/ic_nel_located_item_24.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/particles_system_24/ic_nel_located_item_24.png rename to code/studio/src/plugins/object_viewer/icons/particles_system_24/ic_nel_located_item_24.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/particles_system_24/ic_nel_particle_item_24.png b/code/studio/src/plugins/object_viewer/icons/particles_system_24/ic_nel_particle_item_24.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/particles_system_24/ic_nel_particle_item_24.png rename to code/studio/src/plugins/object_viewer/icons/particles_system_24/ic_nel_particle_item_24.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/particles_system_24/ic_nel_particle_system_24.png b/code/studio/src/plugins/object_viewer/icons/particles_system_24/ic_nel_particle_system_24.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/particles_system_24/ic_nel_particle_system_24.png rename to code/studio/src/plugins/object_viewer/icons/particles_system_24/ic_nel_particle_system_24.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/particles_system_24/ic_nel_particle_system_close_24.png b/code/studio/src/plugins/object_viewer/icons/particles_system_24/ic_nel_particle_system_close_24.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/particles_system_24/ic_nel_particle_system_close_24.png rename to code/studio/src/plugins/object_viewer/icons/particles_system_24/ic_nel_particle_system_close_24.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/particles_system_24/ic_nel_sound_item_24.png b/code/studio/src/plugins/object_viewer/icons/particles_system_24/ic_nel_sound_item_24.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/particles_system_24/ic_nel_sound_item_24.png rename to code/studio/src/plugins/object_viewer/icons/particles_system_24/ic_nel_sound_item_24.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/particles_system_24/ic_nel_workspace_item_24.png b/code/studio/src/plugins/object_viewer/icons/particles_system_24/ic_nel_workspace_item_24.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/icons/particles_system_24/ic_nel_workspace_item_24.png rename to code/studio/src/plugins/object_viewer/icons/particles_system_24/ic_nel_workspace_item_24.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/dqynight.png b/code/studio/src/plugins/object_viewer/images/dqynight.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/dqynight.png rename to code/studio/src/plugins/object_viewer/images/dqynight.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/ico_mrm_mesh.png b/code/studio/src/plugins/object_viewer/images/ico_mrm_mesh.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/ico_mrm_mesh.png rename to code/studio/src/plugins/object_viewer/images/ico_mrm_mesh.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/mixer.png b/code/studio/src/plugins/object_viewer/images/mixer.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/mixer.png rename to code/studio/src/plugins/object_viewer/images/mixer.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/nel.png b/code/studio/src/plugins/object_viewer/images/nel.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/nel.png rename to code/studio/src/plugins/object_viewer/images/nel.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/pause.png b/code/studio/src/plugins/object_viewer/images/pause.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/pause.png rename to code/studio/src/plugins/object_viewer/images/pause.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/play.png b/code/studio/src/plugins/object_viewer/images/play.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/play.png rename to code/studio/src/plugins/object_viewer/images/play.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/polymode.png b/code/studio/src/plugins/object_viewer/images/polymode.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/polymode.png rename to code/studio/src/plugins/object_viewer/images/polymode.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/pqrticles.png b/code/studio/src/plugins/object_viewer/images/pqrticles.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/pqrticles.png rename to code/studio/src/plugins/object_viewer/images/pqrticles.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/refresh.png b/code/studio/src/plugins/object_viewer/images/refresh.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/refresh.png rename to code/studio/src/plugins/object_viewer/images/refresh.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/rmfill.png b/code/studio/src/plugins/object_viewer/images/rmfill.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/rmfill.png rename to code/studio/src/plugins/object_viewer/images/rmfill.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/rmline.png b/code/studio/src/plugins/object_viewer/images/rmline.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/rmline.png rename to code/studio/src/plugins/object_viewer/images/rmline.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/rmpoints.png b/code/studio/src/plugins/object_viewer/images/rmpoints.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/rmpoints.png rename to code/studio/src/plugins/object_viewer/images/rmpoints.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/seek-backward.png b/code/studio/src/plugins/object_viewer/images/seek-backward.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/seek-backward.png rename to code/studio/src/plugins/object_viewer/images/seek-backward.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/seek-forward.png b/code/studio/src/plugins/object_viewer/images/seek-forward.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/seek-forward.png rename to code/studio/src/plugins/object_viewer/images/seek-forward.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/skip-backward.png b/code/studio/src/plugins/object_viewer/images/skip-backward.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/skip-backward.png rename to code/studio/src/plugins/object_viewer/images/skip-backward.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/skip-forward.png b/code/studio/src/plugins/object_viewer/images/skip-forward.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/skip-forward.png rename to code/studio/src/plugins/object_viewer/images/skip-forward.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/sound.png b/code/studio/src/plugins/object_viewer/images/sound.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/sound.png rename to code/studio/src/plugins/object_viewer/images/sound.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/stop.png b/code/studio/src/plugins/object_viewer/images/stop.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/stop.png rename to code/studio/src/plugins/object_viewer/images/stop.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/water.png b/code/studio/src/plugins/object_viewer/images/water.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/water.png rename to code/studio/src/plugins/object_viewer/images/water.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/wind.png b/code/studio/src/plugins/object_viewer/images/wind.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/images/wind.png rename to code/studio/src/plugins/object_viewer/images/wind.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.cpp b/code/studio/src/plugins/object_viewer/main_window.cpp similarity index 91% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.cpp rename to code/studio/src/plugins/object_viewer/main_window.cpp index 2d45f0fb3..dc0c221cc 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.cpp +++ b/code/studio/src/plugins/object_viewer/main_window.cpp @@ -66,17 +66,18 @@ CMainWindow::CMainWindow(QWidget *parent) _isGraphicsInitialized(false), _isGraphicsEnabled(false), _isSoundInitialized(false), - _isSoundEnabled(true), + _isSoundEnabled(false), // MTR workaround for sheet id nonsense _GraphicsViewport(NULL), _lastDir("."), _mouseMode(NL3D::U3dMouseListener::edit3d) { + menu = NULL; nldebug("CMainWindow::CMainWindow:"); setObjectName("CMainWindow"); // create NeL viewport _GraphicsViewport = new CGraphicsViewport(this); - setCentralWidget(_GraphicsViewport); + setCentralWidget(_GraphicsViewport->widget()); setDockNestingEnabled(true); @@ -116,7 +117,7 @@ CMainWindow::CMainWindow(QWidget *parent) _statusBarTimer = new QTimer(this); connect(_statusBarTimer, SIGNAL(timeout()), this, SLOT(updateStatusBar())); - _statusInfo = new QLabel(this); + _statusInfo = new QLabel(); _statusInfo->hide(); Core::ICore::instance()->mainWindow()->statusBar()->addPermanentWidget(_statusInfo); } @@ -134,6 +135,14 @@ CMainWindow::~CMainWindow() settings->endGroup(); settings->sync(); + removeMenus(); + + // If the status info widget isn't removed it miraclously crashes the application on shutdown... + // Somehow it's deleted while being owned by the status bar, then the status bar also tries to delete is... + Core::ICore::instance()->mainWindow()->statusBar()->removeWidget( _statusInfo ); + delete _statusInfo; + _statusInfo = NULL; + delete _AnimationDialog; delete _AnimationSetDialog; delete _SlotManagerDialog; @@ -270,55 +279,51 @@ void CMainWindow::createMenus() menuManager->registerAction(_reloadTexturesAction, "ObjectViewer.View.ReloadTextures"); menuManager->registerAction(_saveScreenshotAction, "ObjectViewer.View.SaveScreenshot"); - // add actions in view menu - QMenu *viewMenu = menuManager->menu(Core::Constants::M_VIEW); - viewMenu->addAction(_setBackColorAction); - viewMenu->addAction(_SetupFog->toggleViewAction()); - viewMenu->addAction(_resetSceneAction); - viewMenu->addAction(_reloadTexturesAction); - viewMenu->addAction(_saveScreenshotAction); - - // add actions in tools menu - QMenu *toolsMenu = menuManager->menu(Core::Constants::M_TOOLS); - QAction *settingsAction = menuManager->action(Core::Constants::SETTINGS); - QMenu *ovMenu = new QMenu("Object Viewer", this); + QMenu *ovMenu = menuManager->menuBar()->addMenu( "Object Viewer" ); menuManager->registerMenu(ovMenu, "ObjectViewerQt.ObjectViewer"); - toolsMenu->insertMenu(settingsAction, ovMenu); - ovMenu->insertAction(settingsAction ,_AnimationDialog->toggleViewAction()); + ovMenu->addAction(_setBackColorAction); + ovMenu->addAction(_SetupFog->toggleViewAction()); + ovMenu->addAction(_resetSceneAction); + ovMenu->addAction(_reloadTexturesAction); + ovMenu->addAction(_saveScreenshotAction); + + ovMenu->addSeparator(); + + ovMenu->addAction(_AnimationDialog->toggleViewAction() ); _AnimationDialog->toggleViewAction()->setIcon(QIcon(Constants::ICON_ANIM)); - ovMenu->insertAction(settingsAction ,_AnimationSetDialog->toggleViewAction()); + ovMenu->addAction(_AnimationSetDialog->toggleViewAction()); _AnimationSetDialog->toggleViewAction()->setIcon(QIcon(Constants::ICON_ANIMSET)); - ovMenu->insertAction(settingsAction ,_SlotManagerDialog->toggleViewAction()); + ovMenu->addAction(_SlotManagerDialog->toggleViewAction()); _SlotManagerDialog->toggleViewAction()->setIcon(QIcon(Constants::ICON_MIXER)); - ovMenu->insertAction(settingsAction ,_ParticleControlDialog->toggleViewAction()); + ovMenu->addAction(_ParticleControlDialog->toggleViewAction()); _ParticleControlDialog->toggleViewAction()->setIcon(QIcon(":/images/pqrticles.png")); - ovMenu->insertAction(settingsAction ,_DayNightDialog->toggleViewAction()); + ovMenu->addAction(_DayNightDialog->toggleViewAction()); _DayNightDialog->toggleViewAction()->setIcon(QIcon(Constants::ICON_DAYNIGHT)); - ovMenu->insertAction(settingsAction ,_WaterPoolDialog->toggleViewAction()); + ovMenu->addAction(_WaterPoolDialog->toggleViewAction()); _WaterPoolDialog->toggleViewAction()->setIcon(QIcon(Constants::ICON_WATER)); _WaterPoolDialog->toggleViewAction()->setEnabled(false); - ovMenu->insertAction(settingsAction ,_VegetableDialog->toggleViewAction()); + ovMenu->addAction(_VegetableDialog->toggleViewAction()); _VegetableDialog->toggleViewAction()->setIcon(QIcon(Constants::ICON_VEGET)); - ovMenu->insertAction(settingsAction ,_GlobalWindDialog->toggleViewAction()); + ovMenu->addAction(_GlobalWindDialog->toggleViewAction()); _GlobalWindDialog->toggleViewAction()->setIcon(QIcon(Constants::ICON_WIND)); - ovMenu->insertAction(settingsAction ,_SkeletonScaleDialog->toggleViewAction()); + ovMenu->addAction(_SkeletonScaleDialog->toggleViewAction()); _SkeletonScaleDialog->toggleViewAction()->setIcon(QIcon(Constants::ICON_SKELSCALE)); - ovMenu->insertAction(settingsAction ,_TuneTimerDialog->toggleViewAction()); + ovMenu->addAction(_TuneTimerDialog->toggleViewAction()); _TuneTimerDialog->toggleViewAction()->setIcon(QIcon(Constants::ICON_FRAMEDELAY)); - ovMenu->insertAction(settingsAction ,_SunColorDialog->toggleViewAction()); + ovMenu->addAction(_SunColorDialog->toggleViewAction()); - ovMenu->insertAction(settingsAction ,_TuneMRMDialog->toggleViewAction()); + ovMenu->addAction(_TuneMRMDialog->toggleViewAction()); _TuneMRMDialog->toggleViewAction()->setIcon(QIcon(Constants::ICON_MRM_MESH)); connect(_ParticleControlDialog->toggleViewAction(), SIGNAL(triggered(bool)), @@ -327,7 +332,14 @@ void CMainWindow::createMenus() connect(_ParticleControlDialog->toggleViewAction(), SIGNAL(triggered(bool)), _ParticleWorkspaceDialog->_PropertyDialog, SLOT(setVisible(bool))); - toolsMenu->insertSeparator(settingsAction); + menu = ovMenu; + +} + +void CMainWindow::removeMenus() +{ + delete menu; + menu = NULL; } void CMainWindow::createToolBars() diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.h b/code/studio/src/plugins/object_viewer/main_window.h similarity index 98% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.h rename to code/studio/src/plugins/object_viewer/main_window.h index 5a392c191..dff4d9b4b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.h +++ b/code/studio/src/plugins/object_viewer/main_window.h @@ -95,6 +95,7 @@ protected: private: void createActions(); void createMenus(); + void removeMenus(); void createToolBars(); void createDialogs(); @@ -144,6 +145,8 @@ private: uint _numTri; float _texMem; sint _mouseMode; + + QMenu *menu; };/* class CMainWindow */ } /* namespace NLQT */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/modules.cpp b/code/studio/src/plugins/object_viewer/modules.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/modules.cpp rename to code/studio/src/plugins/object_viewer/modules.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/modules.h b/code/studio/src/plugins/object_viewer/modules.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/modules.h rename to code/studio/src/plugins/object_viewer/modules.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer.cpp b/code/studio/src/plugins/object_viewer/object_viewer.cpp similarity index 94% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer.cpp rename to code/studio/src/plugins/object_viewer/object_viewer.cpp index 48c679455..240a0d9e9 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer.cpp +++ b/code/studio/src/plugins/object_viewer/object_viewer.cpp @@ -70,20 +70,16 @@ CObjectViewer::~CObjectViewer() saveConfig(); } -void CObjectViewer::init(nlWindow wnd, uint16 w, uint16 h) +void CObjectViewer::init( NL3D::UDriver *driver ) { //H_AUTO2 nldebug("CObjectViewert::init"); // create the driver nlassert(!_Driver); - - _Driver = NL3D::UDriver::createDriver(0, _Direct3D, 0); + _Driver = driver; nlassert(_Driver); - // initialize the window with config file values - _Driver->setDisplay(wnd, NL3D::UDriver::CMode(w, h, 32)); - // Create a scene _Scene = _Driver->createScene(false); _Scene->setPolygonBalancingMode(NL3D::UScene::PolygonBalancingClamp); @@ -119,17 +115,17 @@ void CObjectViewer::init(nlWindow wnd, uint16 w, uint16 h) // create the text context nlassert(!_TextContext); - _TextContext = _Driver->createTextContext(_FontName); + _TextContext = _Driver->createTextContext(NLMISC::CPath::lookup(_FontName)); nlassert(_TextContext); NL3D::CBloomEffect::instance().setDriver(_Driver); NL3D::CBloomEffect::instance().setScene(_Scene); - NL3D::CBloomEffect::instance().init(!_Direct3D); + NL3D::CBloomEffect::instance().init(); NL3D::CBloomEffect::instance().setDensityBloom(uint8(_BloomDensity)); NL3D::CBloomEffect::instance().setSquareBloom(_BloomSquare); - NL3D::CDriverUser *driver = dynamic_cast(Modules::objView().getDriver()); - _IDriver = driver->getDriver(); + NL3D::CDriverUser *udriver = dynamic_cast(Modules::objView().getDriver()); + _IDriver = udriver->getDriver(); NL3D::CSceneUser *scene = dynamic_cast(Modules::objView().getScene()); _CScene = &scene->getScene(); @@ -158,11 +154,8 @@ void CObjectViewer::release() // delete the light delete _Light; - // release driver - nlassert(_Driver); - _Driver->release(); - delete _Driver; _Driver = 0; + _IDriver = NULL; } void CObjectViewer::updateInput() @@ -179,7 +172,7 @@ void CObjectViewer::renderDriver() // Render the scene. if((NL3D::CBloomEffect::instance().getDriver() != 0) && (_BloomEffect)) { - NL3D::CBloomEffect::instance().initBloom(); + NL3D::CBloomEffect::instance().init(); } _Driver->clearBuffers(_BackgroundColor); } @@ -191,8 +184,7 @@ void CObjectViewer::renderScene() if((NL3D::CBloomEffect::instance().getDriver() != 0) && (_BloomEffect)) { - NL3D::CBloomEffect::instance().endBloom(); - NL3D::CBloomEffect::instance().endInterfacesDisplayBloom(); + NL3D::CBloomEffect::instance().applyBloom(); } } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer.h b/code/studio/src/plugins/object_viewer/object_viewer.h similarity index 99% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer.h rename to code/studio/src/plugins/object_viewer/object_viewer.h index 5e978d7e0..e8cc7304e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer.h +++ b/code/studio/src/plugins/object_viewer/object_viewer.h @@ -78,7 +78,7 @@ public: /// @param wnd - handle window. /// @param w - width window. /// @param h - height window. - void init(nlWindow wnd, uint16 w, uint16 h); + void init( NL3D::UDriver *driver ); /// Release class. void release(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer.qrc b/code/studio/src/plugins/object_viewer/object_viewer.qrc similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer.qrc rename to code/studio/src/plugins/object_viewer/object_viewer.qrc diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_constants.h b/code/studio/src/plugins/object_viewer/object_viewer_constants.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_constants.h rename to code/studio/src/plugins/object_viewer/object_viewer_constants.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_plugin.cpp b/code/studio/src/plugins/object_viewer/object_viewer_plugin.cpp similarity index 93% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_plugin.cpp rename to code/studio/src/plugins/object_viewer/object_viewer_plugin.cpp index 34fc0f1b4..a4c948140 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_plugin.cpp +++ b/code/studio/src/plugins/object_viewer/object_viewer_plugin.cpp @@ -8,6 +8,7 @@ // NeL includes #include "nel/misc/debug.h" +#include "nel/3d/init_3d.h" // Qt includes #include @@ -23,12 +24,17 @@ ObjectViewerPlugin::~ObjectViewerPlugin() qDeleteAll(_autoReleaseObjects); _autoReleaseObjects.clear(); Modules::release(); + + delete _LibContext; + _LibContext = NULL; } bool ObjectViewerPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) { Q_UNUSED(errorString); _plugMan = pluginManager; + + NL3D::init3d(); Modules::init(); addAutoReleasedObject(new CObjectViewerContext()); addAutoReleasedObject(new GraphicsSettingsPage()); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_plugin.h b/code/studio/src/plugins/object_viewer/object_viewer_plugin.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_plugin.h rename to code/studio/src/plugins/object_viewer/object_viewer_plugin.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/attrib_form.ui b/code/studio/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/particle_system/attrib_form.ui rename to code/studio/src/plugins/object_viewer/particle_system/attrib_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/attrib_widget.cpp b/code/studio/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/particle_system/attrib_widget.cpp rename to code/studio/src/plugins/object_viewer/particle_system/attrib_widget.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/attrib_widget.h b/code/studio/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/particle_system/attrib_widget.h rename to code/studio/src/plugins/object_viewer/particle_system/attrib_widget.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/auto_lod_dialog.cpp b/code/studio/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/particle_system/auto_lod_dialog.cpp rename to code/studio/src/plugins/object_viewer/particle_system/auto_lod_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/auto_lod_dialog.h b/code/studio/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/particle_system/auto_lod_dialog.h rename to code/studio/src/plugins/object_viewer/particle_system/auto_lod_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/auto_lod_form.ui b/code/studio/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/particle_system/auto_lod_form.ui rename to code/studio/src/plugins/object_viewer/particle_system/auto_lod_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/basic_edit_form.ui b/code/studio/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/particle_system/basic_edit_form.ui rename to code/studio/src/plugins/object_viewer/particle_system/basic_edit_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/basic_edit_widget.cpp b/code/studio/src/plugins/object_viewer/particle_system/basic_edit_widget.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/basic_edit_widget.cpp rename to code/studio/src/plugins/object_viewer/particle_system/basic_edit_widget.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/basic_edit_widget.h b/code/studio/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/particle_system/basic_edit_widget.h rename to code/studio/src/plugins/object_viewer/particle_system/basic_edit_widget.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/bin_op_dialog.cpp b/code/studio/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/particle_system/bin_op_dialog.cpp rename to code/studio/src/plugins/object_viewer/particle_system/bin_op_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/bin_op_dialog.h b/code/studio/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/particle_system/bin_op_dialog.h rename to code/studio/src/plugins/object_viewer/particle_system/bin_op_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/constraint_mesh_form.ui b/code/studio/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/particle_system/constraint_mesh_form.ui rename to code/studio/src/plugins/object_viewer/particle_system/constraint_mesh_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/constraint_mesh_widget.cpp b/code/studio/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/particle_system/constraint_mesh_widget.cpp rename to code/studio/src/plugins/object_viewer/particle_system/constraint_mesh_widget.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/constraint_mesh_widget.h b/code/studio/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/particle_system/constraint_mesh_widget.h rename to code/studio/src/plugins/object_viewer/particle_system/constraint_mesh_widget.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/curve_dialog.cpp b/code/studio/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/particle_system/curve_dialog.cpp rename to code/studio/src/plugins/object_viewer/particle_system/curve_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/curve_dialog.h b/code/studio/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/particle_system/curve_dialog.h rename to code/studio/src/plugins/object_viewer/particle_system/curve_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/curve_form.ui b/code/studio/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/particle_system/curve_form.ui rename to code/studio/src/plugins/object_viewer/particle_system/curve_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/direction_form.ui b/code/studio/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/particle_system/direction_form.ui rename to code/studio/src/plugins/object_viewer/particle_system/direction_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/direction_widget.cpp b/code/studio/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/particle_system/direction_widget.cpp rename to code/studio/src/plugins/object_viewer/particle_system/direction_widget.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/direction_widget.h b/code/studio/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/particle_system/direction_widget.h rename to code/studio/src/plugins/object_viewer/particle_system/direction_widget.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/dup_ps.cpp b/code/studio/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/particle_system/dup_ps.cpp rename to code/studio/src/plugins/object_viewer/particle_system/dup_ps.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/dup_ps.h b/code/studio/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/particle_system/dup_ps.h rename to code/studio/src/plugins/object_viewer/particle_system/dup_ps.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/emitter_form.ui b/code/studio/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/particle_system/emitter_form.ui rename to code/studio/src/plugins/object_viewer/particle_system/emitter_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/emitter_page.cpp b/code/studio/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/particle_system/emitter_page.cpp rename to code/studio/src/plugins/object_viewer/particle_system/emitter_page.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/emitter_page.h b/code/studio/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/particle_system/emitter_page.h rename to code/studio/src/plugins/object_viewer/particle_system/emitter_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/follow_path_dialog.cpp b/code/studio/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/particle_system/follow_path_dialog.cpp rename to code/studio/src/plugins/object_viewer/particle_system/follow_path_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/follow_path_dialog.h b/code/studio/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/particle_system/follow_path_dialog.h rename to code/studio/src/plugins/object_viewer/particle_system/follow_path_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/located_bindable_form.ui b/code/studio/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/particle_system/located_bindable_form.ui rename to code/studio/src/plugins/object_viewer/particle_system/located_bindable_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/located_bindable_page.cpp b/code/studio/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/particle_system/located_bindable_page.cpp rename to code/studio/src/plugins/object_viewer/particle_system/located_bindable_page.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/located_bindable_page.h b/code/studio/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/particle_system/located_bindable_page.h rename to code/studio/src/plugins/object_viewer/particle_system/located_bindable_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/located_form.ui b/code/studio/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/particle_system/located_form.ui rename to code/studio/src/plugins/object_viewer/particle_system/located_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/located_page.cpp b/code/studio/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/particle_system/located_page.cpp rename to code/studio/src/plugins/object_viewer/particle_system/located_page.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/located_page.h b/code/studio/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/particle_system/located_page.h rename to code/studio/src/plugins/object_viewer/particle_system/located_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/mesh_form.ui b/code/studio/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/particle_system/mesh_form.ui rename to code/studio/src/plugins/object_viewer/particle_system/mesh_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/mesh_widget.cpp b/code/studio/src/plugins/object_viewer/particle_system/mesh_widget.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/mesh_widget.cpp rename to code/studio/src/plugins/object_viewer/particle_system/mesh_widget.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/mesh_widget.h b/code/studio/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/particle_system/mesh_widget.h rename to code/studio/src/plugins/object_viewer/particle_system/mesh_widget.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/morph_mesh_dialog.cpp b/code/studio/src/plugins/object_viewer/particle_system/morph_mesh_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/morph_mesh_dialog.cpp rename to code/studio/src/plugins/object_viewer/particle_system/morph_mesh_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/morph_mesh_dialog.h b/code/studio/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/particle_system/morph_mesh_dialog.h rename to code/studio/src/plugins/object_viewer/particle_system/morph_mesh_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/morph_mesh_form.ui b/code/studio/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/particle_system/morph_mesh_form.ui rename to code/studio/src/plugins/object_viewer/particle_system/morph_mesh_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/multi_tex_dialog.cpp b/code/studio/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/particle_system/multi_tex_dialog.cpp rename to code/studio/src/plugins/object_viewer/particle_system/multi_tex_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/multi_tex_dialog.h b/code/studio/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/particle_system/multi_tex_dialog.h rename to code/studio/src/plugins/object_viewer/particle_system/multi_tex_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/multi_tex_form.ui b/code/studio/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/particle_system/multi_tex_form.ui rename to code/studio/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_system/particle_control_dialog.cpp b/code/studio/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_system/particle_control_dialog.cpp rename to code/studio/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_system/particle_control_dialog.h b/code/studio/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_system/particle_control_dialog.h rename to code/studio/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_system/particle_control_form.ui b/code/studio/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_system/particle_control_form.ui rename to code/studio/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_system/particle_editor.cpp b/code/studio/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_system/particle_editor.cpp rename to code/studio/src/plugins/object_viewer/particle_system/particle_editor.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_editor.h b/code/studio/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_system/particle_editor.h rename to code/studio/src/plugins/object_viewer/particle_system/particle_editor.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_force_form.ui b/code/studio/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_system/particle_force_form.ui rename to code/studio/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_system/particle_force_page.cpp b/code/studio/src/plugins/object_viewer/particle_system/particle_force_page.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_force_page.cpp rename to code/studio/src/plugins/object_viewer/particle_system/particle_force_page.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_force_page.h b/code/studio/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_system/particle_force_page.h rename to code/studio/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_system/particle_light_form.ui b/code/studio/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_system/particle_light_form.ui rename to code/studio/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_system/particle_light_page.cpp b/code/studio/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_system/particle_light_page.cpp rename to code/studio/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_system/particle_light_page.h b/code/studio/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_system/particle_light_page.h rename to code/studio/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_system/particle_link_skeleton_dialog.cpp b/code/studio/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_system/particle_link_skeleton_dialog.cpp rename to code/studio/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_system/particle_link_skeleton_dialog.h b/code/studio/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_system/particle_link_skeleton_dialog.h rename to code/studio/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_system/particle_link_skeleton_form.ui b/code/studio/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_system/particle_link_skeleton_form.ui rename to code/studio/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_system/particle_node.cpp b/code/studio/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_system/particle_node.cpp rename to code/studio/src/plugins/object_viewer/particle_system/particle_node.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_node.h b/code/studio/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_system/particle_node.h rename to code/studio/src/plugins/object_viewer/particle_system/particle_node.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_property_dialog.cpp b/code/studio/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_system/particle_property_dialog.cpp rename to code/studio/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_system/particle_property_dialog.h b/code/studio/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_system/particle_property_dialog.h rename to code/studio/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_system/particle_sound_form.ui b/code/studio/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_system/particle_sound_form.ui rename to code/studio/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_system/particle_sound_page.cpp b/code/studio/src/plugins/object_viewer/particle_system/particle_sound_page.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_sound_page.cpp rename to code/studio/src/plugins/object_viewer/particle_system/particle_sound_page.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_sound_page.h b/code/studio/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_system/particle_sound_page.h rename to code/studio/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/particle_system_form.ui b/code/studio/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/particle_system_form.ui rename to code/studio/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/particle_system_page.cpp b/code/studio/src/plugins/object_viewer/particle_system/particle_system_page.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_system_page.cpp rename to code/studio/src/plugins/object_viewer/particle_system/particle_system_page.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_system_page.h b/code/studio/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/particle_system_page.h rename to code/studio/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_system/particle_texture_anim_form.ui b/code/studio/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_system/particle_texture_anim_form.ui rename to code/studio/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_system/particle_texture_anim_widget.cpp b/code/studio/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_system/particle_texture_anim_widget.cpp rename to code/studio/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_system/particle_texture_anim_widget.h b/code/studio/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_system/particle_texture_anim_widget.h rename to code/studio/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_system/particle_texture_form.ui b/code/studio/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_system/particle_texture_form.ui rename to code/studio/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_system/particle_texture_widget.cpp b/code/studio/src/plugins/object_viewer/particle_system/particle_texture_widget.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_texture_widget.cpp rename to code/studio/src/plugins/object_viewer/particle_system/particle_texture_widget.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_texture_widget.h b/code/studio/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_system/particle_texture_widget.h rename to code/studio/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_system/particle_tree_model.cpp b/code/studio/src/plugins/object_viewer/particle_system/particle_tree_model.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_tree_model.cpp rename to code/studio/src/plugins/object_viewer/particle_system/particle_tree_model.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_tree_model.h b/code/studio/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_system/particle_tree_model.h rename to code/studio/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_system/particle_workspace_dialog.cpp b/code/studio/src/plugins/object_viewer/particle_system/particle_workspace_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_workspace_dialog.cpp rename to code/studio/src/plugins/object_viewer/particle_system/particle_workspace_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_workspace_dialog.h b/code/studio/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_system/particle_workspace_dialog.h rename to code/studio/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_system/particle_workspace_form.ui b/code/studio/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_system/particle_workspace_form.ui rename to code/studio/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_system/particle_workspace_page.cpp b/code/studio/src/plugins/object_viewer/particle_system/particle_workspace_page.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_workspace_page.cpp rename to code/studio/src/plugins/object_viewer/particle_system/particle_workspace_page.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/particle_workspace_page.h b/code/studio/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_system/particle_workspace_page.h rename to code/studio/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_system/particle_zone_form.ui b/code/studio/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_system/particle_zone_form.ui rename to code/studio/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_system/particle_zone_page.cpp b/code/studio/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_system/particle_zone_page.cpp rename to code/studio/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_system/particle_zone_page.h b/code/studio/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_system/particle_zone_page.h rename to code/studio/src/plugins/object_viewer/particle_system/particle_zone_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/ps_initial_pos.cpp b/code/studio/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/particle_system/ps_initial_pos.cpp rename to code/studio/src/plugins/object_viewer/particle_system/ps_initial_pos.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/ps_initial_pos.h b/code/studio/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/particle_system/ps_initial_pos.h rename to code/studio/src/plugins/object_viewer/particle_system/ps_initial_pos.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/ps_mover_form.ui b/code/studio/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/particle_system/ps_mover_form.ui rename to code/studio/src/plugins/object_viewer/particle_system/ps_mover_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/ps_mover_page.cpp b/code/studio/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/particle_system/ps_mover_page.cpp rename to code/studio/src/plugins/object_viewer/particle_system/ps_mover_page.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/ps_mover_page.h b/code/studio/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/particle_system/ps_mover_page.h rename to code/studio/src/plugins/object_viewer/particle_system/ps_mover_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/ps_wrapper.h b/code/studio/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/particle_system/ps_wrapper.h rename to code/studio/src/plugins/object_viewer/particle_system/ps_wrapper.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/scheme_bank_dialog.cpp b/code/studio/src/plugins/object_viewer/particle_system/scheme_bank_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/scheme_bank_dialog.cpp rename to code/studio/src/plugins/object_viewer/particle_system/scheme_bank_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/scheme_bank_dialog.h b/code/studio/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/particle_system/scheme_bank_dialog.h rename to code/studio/src/plugins/object_viewer/particle_system/scheme_bank_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/scheme_bank_form.ui b/code/studio/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/particle_system/scheme_bank_form.ui rename to code/studio/src/plugins/object_viewer/particle_system/scheme_bank_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/scheme_manager.cpp b/code/studio/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/particle_system/scheme_manager.cpp rename to code/studio/src/plugins/object_viewer/particle_system/scheme_manager.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/scheme_manager.h b/code/studio/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/particle_system/scheme_manager.h rename to code/studio/src/plugins/object_viewer/particle_system/scheme_manager.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/spinner_dialog.cpp b/code/studio/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/particle_system/spinner_dialog.cpp rename to code/studio/src/plugins/object_viewer/particle_system/spinner_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/spinner_dialog.h b/code/studio/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/particle_system/spinner_dialog.h rename to code/studio/src/plugins/object_viewer/particle_system/spinner_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/tail_form.ui b/code/studio/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/particle_system/tail_form.ui rename to code/studio/src/plugins/object_viewer/particle_system/tail_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/tail_particle_widget.cpp b/code/studio/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/particle_system/tail_particle_widget.cpp rename to code/studio/src/plugins/object_viewer/particle_system/tail_particle_widget.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/tail_particle_widget.h b/code/studio/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/particle_system/tail_particle_widget.h rename to code/studio/src/plugins/object_viewer/particle_system/tail_particle_widget.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/value_blender_dialog.cpp b/code/studio/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/particle_system/value_blender_dialog.cpp rename to code/studio/src/plugins/object_viewer/particle_system/value_blender_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/value_blender_dialog.h b/code/studio/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/particle_system/value_blender_dialog.h rename to code/studio/src/plugins/object_viewer/particle_system/value_blender_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/value_from_emitter_dialog.cpp b/code/studio/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/particle_system/value_from_emitter_dialog.cpp rename to code/studio/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/particle_system/value_from_emitter_dialog.h b/code/studio/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/particle_system/value_from_emitter_dialog.h rename to code/studio/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/particle_system/value_gradient_dialog.cpp b/code/studio/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/particle_system/value_gradient_dialog.cpp rename to code/studio/src/plugins/object_viewer/particle_system/value_gradient_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/value_gradient_dialog.h b/code/studio/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/particle_system/value_gradient_dialog.h rename to code/studio/src/plugins/object_viewer/particle_system/value_gradient_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/value_gradient_form.ui b/code/studio/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/particle_system/value_gradient_form.ui rename to code/studio/src/plugins/object_viewer/particle_system/value_gradient_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system/workspace_form.ui b/code/studio/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/particle_system/workspace_form.ui rename to code/studio/src/plugins/object_viewer/particle_system/workspace_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/animation_dialog.cpp b/code/studio/src/plugins/object_viewer/scene/animation_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/animation_dialog.cpp rename to code/studio/src/plugins/object_viewer/scene/animation_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/animation_dialog.h b/code/studio/src/plugins/object_viewer/scene/animation_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/animation_dialog.h rename to code/studio/src/plugins/object_viewer/scene/animation_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/animation_form.ui b/code/studio/src/plugins/object_viewer/scene/animation_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/animation_form.ui rename to code/studio/src/plugins/object_viewer/scene/animation_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/animation_set_dialog.cpp b/code/studio/src/plugins/object_viewer/scene/animation_set_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/animation_set_dialog.cpp rename to code/studio/src/plugins/object_viewer/scene/animation_set_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/animation_set_dialog.h b/code/studio/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/scene/animation_set_dialog.h rename to code/studio/src/plugins/object_viewer/scene/animation_set_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/animation_set_form.ui b/code/studio/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/scene/animation_set_form.ui rename to code/studio/src/plugins/object_viewer/scene/animation_set_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/camera_control.cpp b/code/studio/src/plugins/object_viewer/scene/camera_control.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/camera_control.cpp rename to code/studio/src/plugins/object_viewer/scene/camera_control.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/camera_control.h b/code/studio/src/plugins/object_viewer/scene/camera_control.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/camera_control.h rename to code/studio/src/plugins/object_viewer/scene/camera_control.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/day_night_dialog.cpp b/code/studio/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/scene/day_night_dialog.cpp rename to code/studio/src/plugins/object_viewer/scene/day_night_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/day_night_dialog.h b/code/studio/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/scene/day_night_dialog.h rename to code/studio/src/plugins/object_viewer/scene/day_night_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/day_night_form.ui b/code/studio/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/scene/day_night_form.ui rename to code/studio/src/plugins/object_viewer/scene/day_night_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/entity.cpp b/code/studio/src/plugins/object_viewer/scene/entity.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/entity.cpp rename to code/studio/src/plugins/object_viewer/scene/entity.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/entity.h b/code/studio/src/plugins/object_viewer/scene/entity.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/entity.h rename to code/studio/src/plugins/object_viewer/scene/entity.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/global_wind_dialog.cpp b/code/studio/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/scene/global_wind_dialog.cpp rename to code/studio/src/plugins/object_viewer/scene/global_wind_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/global_wind_dialog.h b/code/studio/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/scene/global_wind_dialog.h rename to code/studio/src/plugins/object_viewer/scene/global_wind_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/global_wind_form.ui b/code/studio/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/scene/global_wind_form.ui rename to code/studio/src/plugins/object_viewer/scene/global_wind_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/setup_fog_dialog.cpp b/code/studio/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/scene/setup_fog_dialog.cpp rename to code/studio/src/plugins/object_viewer/scene/setup_fog_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/setup_fog_dialog.h b/code/studio/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/scene/setup_fog_dialog.h rename to code/studio/src/plugins/object_viewer/scene/setup_fog_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/setup_fog_form.ui b/code/studio/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/scene/setup_fog_form.ui rename to code/studio/src/plugins/object_viewer/scene/setup_fog_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/skeleton_scale_dialog.cpp b/code/studio/src/plugins/object_viewer/scene/skeleton_scale_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/skeleton_scale_dialog.cpp rename to code/studio/src/plugins/object_viewer/scene/skeleton_scale_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/skeleton_scale_dialog.h b/code/studio/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/scene/skeleton_scale_dialog.h rename to code/studio/src/plugins/object_viewer/scene/skeleton_scale_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/skeleton_scale_form.ui b/code/studio/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/scene/skeleton_scale_form.ui rename to code/studio/src/plugins/object_viewer/scene/skeleton_scale_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/skeleton_tree_model.cpp b/code/studio/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/scene/skeleton_tree_model.cpp rename to code/studio/src/plugins/object_viewer/scene/skeleton_tree_model.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/skeleton_tree_model.h b/code/studio/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/scene/skeleton_tree_model.h rename to code/studio/src/plugins/object_viewer/scene/skeleton_tree_model.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/slot_form.ui b/code/studio/src/plugins/object_viewer/scene/slot_form.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/slot_form.ui rename to code/studio/src/plugins/object_viewer/scene/slot_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/slot_manager_dialog.cpp b/code/studio/src/plugins/object_viewer/scene/slot_manager_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/slot_manager_dialog.cpp rename to code/studio/src/plugins/object_viewer/scene/slot_manager_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/slot_manager_dialog.h b/code/studio/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/scene/slot_manager_dialog.h rename to code/studio/src/plugins/object_viewer/scene/slot_manager_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/sun_color_dialog.cpp b/code/studio/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/scene/sun_color_dialog.cpp rename to code/studio/src/plugins/object_viewer/scene/sun_color_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/sun_color_dialog.h b/code/studio/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/scene/sun_color_dialog.h rename to code/studio/src/plugins/object_viewer/scene/sun_color_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/sun_color_form.ui b/code/studio/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/scene/sun_color_form.ui rename to code/studio/src/plugins/object_viewer/scene/sun_color_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/tune_mrm_dialog.cpp b/code/studio/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/scene/tune_mrm_dialog.cpp rename to code/studio/src/plugins/object_viewer/scene/tune_mrm_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/tune_mrm_dialog.h b/code/studio/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/scene/tune_mrm_dialog.h rename to code/studio/src/plugins/object_viewer/scene/tune_mrm_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/tune_mrm_form.ui b/code/studio/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/scene/tune_mrm_form.ui rename to code/studio/src/plugins/object_viewer/scene/tune_mrm_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/tune_timer_dialog.cpp b/code/studio/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/scene/tune_timer_dialog.cpp rename to code/studio/src/plugins/object_viewer/scene/tune_timer_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/tune_timer_dialog.h b/code/studio/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/scene/tune_timer_dialog.h rename to code/studio/src/plugins/object_viewer/scene/tune_timer_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/tune_timer_form.ui b/code/studio/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/scene/tune_timer_form.ui rename to code/studio/src/plugins/object_viewer/scene/tune_timer_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/water_pool_dialog.cpp b/code/studio/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/scene/water_pool_dialog.cpp rename to code/studio/src/plugins/object_viewer/scene/water_pool_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/water_pool_dialog.h b/code/studio/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/scene/water_pool_dialog.h rename to code/studio/src/plugins/object_viewer/scene/water_pool_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scene/water_pool_form.ui b/code/studio/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/scene/water_pool_form.ui rename to code/studio/src/plugins/object_viewer/scene/water_pool_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.cpp b/code/studio/src/plugins/object_viewer/sound_settings_page.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.cpp rename to code/studio/src/plugins/object_viewer/sound_settings_page.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.h b/code/studio/src/plugins/object_viewer/sound_settings_page.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.h rename to code/studio/src/plugins/object_viewer/sound_settings_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.ui b/code/studio/src/plugins/object_viewer/sound_settings_page.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.ui rename to code/studio/src/plugins/object_viewer/sound_settings_page.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_system.cpp b/code/studio/src/plugins/object_viewer/sound_system.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_system.cpp rename to code/studio/src/plugins/object_viewer/sound_system.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_system.h b/code/studio/src/plugins/object_viewer/sound_system.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_system.h rename to code/studio/src/plugins/object_viewer/sound_system.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/stdpch.cpp b/code/studio/src/plugins/object_viewer/stdpch.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/stdpch.cpp rename to code/studio/src/plugins/object_viewer/stdpch.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/stdpch.h b/code/studio/src/plugins/object_viewer/stdpch.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/stdpch.h rename to code/studio/src/plugins/object_viewer/stdpch.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/ovqt_plugin_object_viewer.xml b/code/studio/src/plugins/object_viewer/studio_plugin_object_viewer.xml similarity index 76% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/ovqt_plugin_object_viewer.xml rename to code/studio/src/plugins/object_viewer/studio_plugin_object_viewer.xml index 6033c3985..c5ae8c081 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/ovqt_plugin_object_viewer.xml +++ b/code/studio/src/plugins/object_viewer/studio_plugin_object_viewer.xml @@ -1,5 +1,5 @@ - ovqt_plugin_object_viewer + studio_plugin_object_viewer ObjectViewer 0.8 Ryzom Core diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_appearance_page.cpp b/code/studio/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/vegetable_appearance_page.cpp rename to code/studio/src/plugins/object_viewer/vegetable/vegetable_appearance_page.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_appearance_page.h b/code/studio/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/vegetable_appearance_page.h rename to code/studio/src/plugins/object_viewer/vegetable/vegetable_appearance_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_apperance_form.ui b/code/studio/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/vegetable_apperance_form.ui rename to code/studio/src/plugins/object_viewer/vegetable/vegetable_apperance_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_density_form.ui b/code/studio/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/vegetable_density_form.ui rename to code/studio/src/plugins/object_viewer/vegetable/vegetable_density_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_density_page.cpp b/code/studio/src/plugins/object_viewer/vegetable/vegetable_density_page.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_density_page.cpp rename to code/studio/src/plugins/object_viewer/vegetable/vegetable_density_page.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_density_page.h b/code/studio/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/vegetable_density_page.h rename to code/studio/src/plugins/object_viewer/vegetable/vegetable_density_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_dialog.cpp b/code/studio/src/plugins/object_viewer/vegetable/vegetable_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_dialog.cpp rename to code/studio/src/plugins/object_viewer/vegetable/vegetable_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_dialog.h b/code/studio/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/vegetable_dialog.h rename to code/studio/src/plugins/object_viewer/vegetable/vegetable_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_dialog_form.ui b/code/studio/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/vegetable_dialog_form.ui rename to code/studio/src/plugins/object_viewer/vegetable/vegetable_dialog_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_editor.cpp b/code/studio/src/plugins/object_viewer/vegetable/vegetable_editor.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_editor.cpp rename to code/studio/src/plugins/object_viewer/vegetable/vegetable_editor.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_editor.h b/code/studio/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/vegetable_editor.h rename to code/studio/src/plugins/object_viewer/vegetable/vegetable_editor.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_landscape_form.ui b/code/studio/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/vegetable_landscape_form.ui rename to code/studio/src/plugins/object_viewer/vegetable/vegetable_landscape_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_landscape_page.cpp b/code/studio/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/vegetable_landscape_page.cpp rename to code/studio/src/plugins/object_viewer/vegetable/vegetable_landscape_page.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_landscape_page.h b/code/studio/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/vegetable_landscape_page.h rename to code/studio/src/plugins/object_viewer/vegetable/vegetable_landscape_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_node.cpp b/code/studio/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/vegetable_node.cpp rename to code/studio/src/plugins/object_viewer/vegetable/vegetable_node.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_node.h b/code/studio/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/vegetable_node.h rename to code/studio/src/plugins/object_viewer/vegetable/vegetable_node.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_noise_value_form.ui b/code/studio/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/vegetable_noise_value_form.ui rename to code/studio/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/vegetable_noise_value_widget.cpp b/code/studio/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/vegetable_noise_value_widget.cpp rename to code/studio/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/vegetable_noise_value_widget.h b/code/studio/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/vegetable_noise_value_widget.h rename to code/studio/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/vegetable_rotate_form.ui b/code/studio/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/vegetable_rotate_form.ui rename to code/studio/src/plugins/object_viewer/vegetable/vegetable_rotate_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_rotate_page.cpp b/code/studio/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/vegetable_rotate_page.cpp rename to code/studio/src/plugins/object_viewer/vegetable/vegetable_rotate_page.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_rotate_page.h b/code/studio/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/vegetable_rotate_page.h rename to code/studio/src/plugins/object_viewer/vegetable/vegetable_rotate_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_scale_form.ui b/code/studio/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/vegetable_scale_form.ui rename to code/studio/src/plugins/object_viewer/vegetable/vegetable_scale_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_scale_page.cpp b/code/studio/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/vegetable_scale_page.cpp rename to code/studio/src/plugins/object_viewer/vegetable/vegetable_scale_page.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable/vegetable_scale_page.h b/code/studio/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/vegetable_scale_page.h rename to code/studio/src/plugins/object_viewer/vegetable/vegetable_scale_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.cpp b/code/studio/src/plugins/object_viewer/vegetable_settings_page.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.cpp rename to code/studio/src/plugins/object_viewer/vegetable_settings_page.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.h b/code/studio/src/plugins/object_viewer/vegetable_settings_page.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.h rename to code/studio/src/plugins/object_viewer/vegetable_settings_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.ui b/code/studio/src/plugins/object_viewer/vegetable_settings_page.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.ui rename to code/studio/src/plugins/object_viewer/vegetable_settings_page.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/widgets/color_edit_form.ui b/code/studio/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/widgets/color_edit_form.ui rename to code/studio/src/plugins/object_viewer/widgets/color_edit_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/widgets/color_edit_widget.cpp b/code/studio/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/widgets/color_edit_widget.cpp rename to code/studio/src/plugins/object_viewer/widgets/color_edit_widget.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/widgets/color_edit_widget.h b/code/studio/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/widgets/color_edit_widget.h rename to code/studio/src/plugins/object_viewer/widgets/color_edit_widget.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/widgets/edit_range_float_form.ui b/code/studio/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/widgets/edit_range_float_form.ui rename to code/studio/src/plugins/object_viewer/widgets/edit_range_float_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/widgets/edit_range_uint_form.ui b/code/studio/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/widgets/edit_range_uint_form.ui rename to code/studio/src/plugins/object_viewer/widgets/edit_range_uint_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/widgets/edit_range_widget.cpp b/code/studio/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/widgets/edit_range_widget.cpp rename to code/studio/src/plugins/object_viewer/widgets/edit_range_widget.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/widgets/edit_range_widget.h b/code/studio/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/widgets/edit_range_widget.h rename to code/studio/src/plugins/object_viewer/widgets/edit_range_widget.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/widgets/hoverpoints.cpp b/code/studio/src/plugins/object_viewer/widgets/hoverpoints.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/widgets/hoverpoints.cpp rename to code/studio/src/plugins/object_viewer/widgets/hoverpoints.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/widgets/hoverpoints.h b/code/studio/src/plugins/object_viewer/widgets/hoverpoints.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/widgets/hoverpoints.h rename to code/studio/src/plugins/object_viewer/widgets/hoverpoints.h diff --git a/code/studio/src/plugins/ovqt_sheet_builder/CMakeLists.txt b/code/studio/src/plugins/ovqt_sheet_builder/CMakeLists.txt new file mode 100644 index 000000000..a543421c5 --- /dev/null +++ b/code/studio/src/plugins/ovqt_sheet_builder/CMakeLists.txt @@ -0,0 +1,48 @@ +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(OVQT_PLUG_SHEET_BUILDER_HDR sheetbuilderconfgdialog.h sheetbuilderdialog.h ovqt_sheet_builder.h) + +SET(QT_USE_QTGUI TRUE) +SET(QT_USE_QTOPENGL TRUE) + +QT4_WRAP_CPP(OVQT_PLUG_SHEET_BUILDER_MOC_SRC ${OVQT_PLUG_SHEET_BUILDER_HDR}) + +SOURCE_GROUP(QtGeneratedMocSrc FILES ${OVQT_PLUG_SHEET_BUILDER_MOC_SRC}) +SOURCE_GROUP("Sheet builder Plugin" FILES ${SRC}) +SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) + +ADD_LIBRARY(studio_plugin_sheet_builder MODULE ${SRC} ${OVQT_PLUG_SHEET_BUILDER_MOC_SRC} ${OVQT_EXT_SYS_SRC}) + +TARGET_LINK_LIBRARIES(studio_plugin_sheet_builder studio_plugin_core nelmisc ${QT_LIBRARIES}) + +NL_DEFAULT_PROPS(studio_plugin_sheet_builder "Tools: Studio Plugin: Sheet builder") +NL_ADD_RUNTIME_FLAGS(studio_plugin_sheet_builder) +NL_ADD_LIB_SUFFIX(studio_plugin_sheet_builder) + +ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) + + +IF(WIN32) + IF(WITH_INSTALL_LIBRARIES) + INSTALL(TARGETS studio_plugin_sheet_builder LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) + ELSE(WITH_INSTALL_LIBRARIES) + INSTALL(TARGETS studio_plugin_sheet_builder LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) + ENDIF(WITH_INSTALL_LIBRARIES) +ELSE(WIN32) + IF(WITH_INSTALL_LIBRARIES) + INSTALL(TARGETS studio_plugin_sheet_builder LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) + ELSE(WITH_INSTALL_LIBRARIES) + INSTALL(TARGETS studio_plugin_sheet_builder LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) + ENDIF(WITH_INSTALL_LIBRARIES) +ENDIF(WIN32) + +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/studio_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/ovqt_sheet_builder.cpp b/code/studio/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.cpp similarity index 88% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.cpp rename to code/studio/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.cpp index 4fd7dfb11..21358ec6f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.cpp +++ b/code/studio/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.cpp @@ -35,6 +35,21 @@ using namespace Plugin; +SheetBuilderPlugin::SheetBuilderPlugin() +{ +} + +SheetBuilderPlugin::~SheetBuilderPlugin() +{ + Core::MenuManager *menuManager = Core::ICore::instance()->menuManager(); + QAction *a = menuManager->action( "SheetBuilder" ); + menuManager->unregisterAction( "SheetBuilder" ); + delete a; + + delete m_LibContext; + m_LibContext = NULL; +} + bool SheetBuilderPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) { Q_UNUSED(errorString); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.h b/code/studio/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.h similarity index 97% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.h rename to code/studio/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.h index 504d0914d..21e2855c1 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.h +++ b/code/studio/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.h @@ -36,6 +36,8 @@ class SheetBuilderPlugin : public QObject, public ExtensionSystem::IPlugin Q_OBJECT Q_INTERFACES(ExtensionSystem::IPlugin) public: + SheetBuilderPlugin(); + ~SheetBuilderPlugin(); bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString); void extensionsInitialized(); void setNelContext(NLMISC::INelContext *nelContext); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.pro b/code/studio/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.pro similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.pro rename to code/studio/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.pro diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/sheetbuilder.h b/code/studio/src/plugins/ovqt_sheet_builder/sheetbuilder.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/sheetbuilder.h rename to code/studio/src/plugins/ovqt_sheet_builder/sheetbuilder.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/sheetbuilderconfgdialog.cpp b/code/studio/src/plugins/ovqt_sheet_builder/sheetbuilderconfgdialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/sheetbuilderconfgdialog.cpp rename to code/studio/src/plugins/ovqt_sheet_builder/sheetbuilderconfgdialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/sheetbuilderconfgdialog.h b/code/studio/src/plugins/ovqt_sheet_builder/sheetbuilderconfgdialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/sheetbuilderconfgdialog.h rename to code/studio/src/plugins/ovqt_sheet_builder/sheetbuilderconfgdialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/sheetbuilderdialog.cpp b/code/studio/src/plugins/ovqt_sheet_builder/sheetbuilderdialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/sheetbuilderdialog.cpp rename to code/studio/src/plugins/ovqt_sheet_builder/sheetbuilderdialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/sheetbuilderdialog.h b/code/studio/src/plugins/ovqt_sheet_builder/sheetbuilderdialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/sheetbuilderdialog.h rename to code/studio/src/plugins/ovqt_sheet_builder/sheetbuilderdialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/ovqt_plugin_sheet_builder.xml b/code/studio/src/plugins/ovqt_sheet_builder/studio_plugin_sheet_builder.xml similarity index 76% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/ovqt_plugin_sheet_builder.xml rename to code/studio/src/plugins/ovqt_sheet_builder/studio_plugin_sheet_builder.xml index 01dbefa8a..4f1f3210d 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/ovqt_plugin_sheet_builder.xml +++ b/code/studio/src/plugins/ovqt_sheet_builder/studio_plugin_sheet_builder.xml @@ -1,5 +1,5 @@ - ovqt_plugin_sheet_builder + studio_plugin_sheet_builder SheetBuilder 1.0 kharvd diff --git a/code/studio/src/plugins/tile_editor/CMakeLists.txt b/code/studio/src/plugins/tile_editor/CMakeLists.txt new file mode 100644 index 000000000..bfb9f3440 --- /dev/null +++ b/code/studio/src/plugins/tile_editor/CMakeLists.txt @@ -0,0 +1,63 @@ +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(OVQT_TILE_EDITOR_PLUGIN_HDR + tile_model.h + tile_editor_main_window.h + tile_editor_plugin.h + land_edit_dialog.h) + +SET(OVQT_TILE_EDITOR_PLUGIN_UIS + tile_editor_main_window.ui + land_edit_dialog.ui) + +SET(OVQT_PLUG_TILE_EDITOR_RCS tile_editor.qrc) + +SET(QT_USE_QTGUI TRUE) +SET(QT_USE_QTOPENGL TRUE) + +QT4_WRAP_CPP(OVQT_TILE_EDITOR_PLUGIN_MOC_SRC ${OVQT_TILE_EDITOR_PLUGIN_HDR}) +QT4_ADD_RESOURCES( OVQT_PLUG_TILE_EDITOR_RC_SRCS ${OVQT_PLUG_TILE_EDITOR_RCS}) +QT4_WRAP_UI(OVQT_TILE_EDITOR_PLUGIN_UI_HDRS ${OVQT_TILE_EDITOR_PLUGIN_UIS}) + +SOURCE_GROUP(QtGeneratedUiHdr FILES ${OVQT_TILE_EDITOR_PLUGIN_UI_HDRS}) +SOURCE_GROUP(QtGeneratedMocSrc FILES ${OVQT_TILE_EDITOR_PLUGIN_MOC_SRC} ${OVQT_PLUG_TILE_EDITOR_RC_SRCS}) +SOURCE_GROUP("Tile Editor Plugin" FILES ${SRC}) +SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) + +ADD_LIBRARY(studio_plugin_tile_editor MODULE ${SRC} ${OVQT_TILE_EDITOR_PLUGIN_MOC_SRC} ${OVQT_PLUG_TILE_EDITOR_RC_SRCS} ${OVQT_EXT_SYS_SRC} ${OVQT_TILE_EDITOR_PLUGIN_UI_HDRS}) + +TARGET_LINK_LIBRARIES(studio_plugin_tile_editor studio_plugin_core nelmisc ${QT_LIBRARIES}) + +IF(WITH_STLPORT) + TARGET_LINK_LIBRARIES(studio_plugin_tile_editor ${CMAKE_THREAD_LIBS_INIT}) +ENDIF(WITH_STLPORT) + +NL_DEFAULT_PROPS(studio_plugin_tile_editor "Tools: Studio Plugin: Tile Editor") +NL_ADD_RUNTIME_FLAGS(studio_plugin_tile_editor) +NL_ADD_LIB_SUFFIX(studio_plugin_tile_editor) + +ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) + +IF(WIN32) + IF(WITH_INSTALL_LIBRARIES) + INSTALL(TARGETS studio_plugin_tile_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) + ELSE(WITH_INSTALL_LIBRARIES) + INSTALL(TARGETS studio_plugin_tile_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) + ENDIF(WITH_INSTALL_LIBRARIES) +ELSE(WIN32) + IF(WITH_INSTALL_LIBRARIES) + INSTALL(TARGETS studio_plugin_tile_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) + ELSE(WITH_INSTALL_LIBRARIES) + INSTALL(TARGETS studio_plugin_tile_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) + ENDIF(WITH_INSTALL_LIBRARIES) +ENDIF(WIN32) + +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/studio_plugin_tile_editor.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) diff --git a/code/studio/src/plugins/tile_editor/images/add_tile.png b/code/studio/src/plugins/tile_editor/images/add_tile.png new file mode 100644 index 000000000..a9de8f51d Binary files /dev/null and b/code/studio/src/plugins/tile_editor/images/add_tile.png differ diff --git a/code/studio/src/plugins/tile_editor/images/delete_image.png b/code/studio/src/plugins/tile_editor/images/delete_image.png new file mode 100644 index 000000000..1bc3b4e84 Binary files /dev/null and b/code/studio/src/plugins/tile_editor/images/delete_image.png differ diff --git a/code/studio/src/plugins/tile_editor/images/delete_tile.png b/code/studio/src/plugins/tile_editor/images/delete_tile.png new file mode 100644 index 000000000..613c6a5f8 Binary files /dev/null and b/code/studio/src/plugins/tile_editor/images/delete_tile.png differ diff --git a/code/studio/src/plugins/tile_editor/images/down.png b/code/studio/src/plugins/tile_editor/images/down.png new file mode 100644 index 000000000..b0033cf64 Binary files /dev/null and b/code/studio/src/plugins/tile_editor/images/down.png differ diff --git a/code/studio/src/plugins/tile_editor/images/empty_image.png b/code/studio/src/plugins/tile_editor/images/empty_image.png new file mode 100644 index 000000000..9a2e358ab Binary files /dev/null and b/code/studio/src/plugins/tile_editor/images/empty_image.png differ diff --git a/code/studio/src/plugins/tile_editor/images/ic_nel_add_item.png b/code/studio/src/plugins/tile_editor/images/ic_nel_add_item.png new file mode 100644 index 000000000..bde338f78 Binary files /dev/null and b/code/studio/src/plugins/tile_editor/images/ic_nel_add_item.png differ diff --git a/code/studio/src/plugins/tile_editor/images/ic_nel_delete_item.png b/code/studio/src/plugins/tile_editor/images/ic_nel_delete_item.png new file mode 100644 index 000000000..a5a1787d5 Binary files /dev/null and b/code/studio/src/plugins/tile_editor/images/ic_nel_delete_item.png differ diff --git a/code/studio/src/plugins/tile_editor/images/ic_nel_new.png b/code/studio/src/plugins/tile_editor/images/ic_nel_new.png new file mode 100644 index 000000000..d45dcb467 Binary files /dev/null and b/code/studio/src/plugins/tile_editor/images/ic_nel_new.png differ diff --git a/code/studio/src/plugins/tile_editor/images/ic_nel_open.png b/code/studio/src/plugins/tile_editor/images/ic_nel_open.png new file mode 100644 index 000000000..c4992affd Binary files /dev/null and b/code/studio/src/plugins/tile_editor/images/ic_nel_open.png differ diff --git a/code/studio/src/plugins/tile_editor/images/ic_nel_save.png b/code/studio/src/plugins/tile_editor/images/ic_nel_save.png new file mode 100644 index 000000000..7f7d35e9a Binary files /dev/null and b/code/studio/src/plugins/tile_editor/images/ic_nel_save.png differ diff --git a/code/studio/src/plugins/tile_editor/images/ic_nel_save_as.png b/code/studio/src/plugins/tile_editor/images/ic_nel_save_as.png new file mode 100644 index 000000000..1558632b9 Binary files /dev/null and b/code/studio/src/plugins/tile_editor/images/ic_nel_save_as.png differ diff --git a/code/studio/src/plugins/tile_editor/images/left.png b/code/studio/src/plugins/tile_editor/images/left.png new file mode 100644 index 000000000..9c94db1aa Binary files /dev/null and b/code/studio/src/plugins/tile_editor/images/left.png differ diff --git a/code/studio/src/plugins/tile_editor/images/nel.png b/code/studio/src/plugins/tile_editor/images/nel.png new file mode 100644 index 000000000..d2139bb25 Binary files /dev/null and b/code/studio/src/plugins/tile_editor/images/nel.png differ diff --git a/code/studio/src/plugins/tile_editor/images/replace_image.png b/code/studio/src/plugins/tile_editor/images/replace_image.png new file mode 100644 index 000000000..94d9b76c8 Binary files /dev/null and b/code/studio/src/plugins/tile_editor/images/replace_image.png differ diff --git a/code/studio/src/plugins/tile_editor/images/reset.png b/code/studio/src/plugins/tile_editor/images/reset.png new file mode 100644 index 000000000..6693e842c Binary files /dev/null and b/code/studio/src/plugins/tile_editor/images/reset.png differ diff --git a/code/studio/src/plugins/tile_editor/images/right.png b/code/studio/src/plugins/tile_editor/images/right.png new file mode 100644 index 000000000..eb51b8385 Binary files /dev/null and b/code/studio/src/plugins/tile_editor/images/right.png differ diff --git a/code/studio/src/plugins/tile_editor/images/rotation0.png b/code/studio/src/plugins/tile_editor/images/rotation0.png new file mode 100644 index 000000000..7434c4959 Binary files /dev/null and b/code/studio/src/plugins/tile_editor/images/rotation0.png differ diff --git a/code/studio/src/plugins/tile_editor/images/rotation180.png b/code/studio/src/plugins/tile_editor/images/rotation180.png new file mode 100644 index 000000000..7ce524883 Binary files /dev/null and b/code/studio/src/plugins/tile_editor/images/rotation180.png differ diff --git a/code/studio/src/plugins/tile_editor/images/rotation270.png b/code/studio/src/plugins/tile_editor/images/rotation270.png new file mode 100644 index 000000000..32b47a97c Binary files /dev/null and b/code/studio/src/plugins/tile_editor/images/rotation270.png differ diff --git a/code/studio/src/plugins/tile_editor/images/rotation90.png b/code/studio/src/plugins/tile_editor/images/rotation90.png new file mode 100644 index 000000000..2eb11b322 Binary files /dev/null and b/code/studio/src/plugins/tile_editor/images/rotation90.png differ diff --git a/code/studio/src/plugins/tile_editor/images/up.png b/code/studio/src/plugins/tile_editor/images/up.png new file mode 100644 index 000000000..e5145d052 Binary files /dev/null and b/code/studio/src/plugins/tile_editor/images/up.png differ diff --git a/code/studio/src/plugins/tile_editor/land_edit_dialog.cpp b/code/studio/src/plugins/tile_editor/land_edit_dialog.cpp new file mode 100644 index 000000000..025e55730 --- /dev/null +++ b/code/studio/src/plugins/tile_editor/land_edit_dialog.cpp @@ -0,0 +1,105 @@ +// Ryzom Core Studio - Tile Editor plugin +// 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 "land_edit_dialog.h" + +LandEditDialog::LandEditDialog( QWidget *parent ) : +QDialog( parent ) +{ + setupUi( this ); + setupConnections(); +} + +LandEditDialog::~LandEditDialog() +{ +} + +void LandEditDialog::getSelectedTileSets( QStringList &l ) const +{ + int c = tilesetLV->count(); + for( int i = 0; i < c; i++ ) + { + l.push_back( tilesetLV->item( i )->text() ); + } +} + +void LandEditDialog::setSelectedTileSets( QStringList &l ) +{ + tilesetLV->clear(); + + QStringListIterator itr( l ); + while( itr.hasNext() ) + { + tilesetLV->addItem( itr.next() ); + } +} + +void LandEditDialog::setTileSets( const QStringList &l ) +{ + tilesetCB->clear(); + + QStringListIterator itr( l ); + while( itr.hasNext() ) + { + tilesetCB->addItem( itr.next() ); + } +} + +void LandEditDialog::setupConnections() +{ + connect( okButton, SIGNAL( clicked( bool ) ), this, SLOT( onOkClicked() ) ); + connect( cancelButton, SIGNAL( clicked( bool ) ), this, SLOT( onCancelClicked() ) ); + connect( addButton, SIGNAL( clicked( bool ) ), this, SLOT( onAddClicked() ) ); + connect( removeButton, SIGNAL( clicked( bool ) ), this, SLOT( onRemoveClicked() ) ); +} + +void LandEditDialog::onOkClicked() +{ + accept(); +} + +void LandEditDialog::onCancelClicked() +{ + reject(); +} + +void LandEditDialog::onAddClicked() +{ + if( tilesetCB->currentIndex() < 0 ) + return; + + QString text = tilesetCB->currentText(); + + int c = tilesetLV->count(); + for( int i = 0; i < c; i++ ) + { + if( text == tilesetLV->item( i )->text() ) + return; + } + + tilesetLV->addItem( text ); +} + +void LandEditDialog::onRemoveClicked() +{ + if( tilesetLV->currentItem() == NULL ) + return; + + QListWidgetItem *item = tilesetLV->currentItem(); + delete item; +} + diff --git a/code/studio/src/plugins/tile_editor/land_edit_dialog.h b/code/studio/src/plugins/tile_editor/land_edit_dialog.h new file mode 100644 index 000000000..3873c6df5 --- /dev/null +++ b/code/studio/src/plugins/tile_editor/land_edit_dialog.h @@ -0,0 +1,51 @@ +// Ryzom Core Studio - Tile Editor plugin +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + + +#ifndef LAND_EDIT_DLG_H +#define LAND_EDIT_DLG_H + + +#include "ui_land_edit_dialog.h" +#include + +class LandEditDialog : public QDialog, public Ui::LandEditDialog +{ + Q_OBJECT +public: + LandEditDialog( QWidget *parent = NULL ); + ~LandEditDialog(); + + void getSelectedTileSets( QStringList &l ) const; + void setSelectedTileSets( QStringList &l ); + + void setTileSets( const QStringList &l ); + +private: + void setupConnections(); + + +private Q_SLOTS: + void onOkClicked(); + void onCancelClicked(); + void onAddClicked(); + void onRemoveClicked(); + +}; + + +#endif + diff --git a/code/studio/src/plugins/tile_editor/land_edit_dialog.ui b/code/studio/src/plugins/tile_editor/land_edit_dialog.ui new file mode 100644 index 000000000..7eb707528 --- /dev/null +++ b/code/studio/src/plugins/tile_editor/land_edit_dialog.ui @@ -0,0 +1,99 @@ + + + LandEditDialog + + + Qt::WindowModal + + + + 0 + 0 + 402 + 311 + + + + Editing land + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Add + + + + + + + + 0 + 0 + + + + Remove + + + + + + + + 0 + 0 + + + + OK + + + + + + + + 0 + 0 + + + + Cancel + + + + + + + + + + diff --git a/code/studio/src/plugins/tile_editor/studio_plugin_tile_editor.xml b/code/studio/src/plugins/tile_editor/studio_plugin_tile_editor.xml new file mode 100644 index 000000000..0e5727896 --- /dev/null +++ b/code/studio/src/plugins/tile_editor/studio_plugin_tile_editor.xml @@ -0,0 +1,10 @@ + + studio_plugin_tile_editor + TileEditor + 1.0 + Ryzom Core + Tile bank editing plugin. + + + + \ No newline at end of file diff --git a/code/studio/src/plugins/tile_editor/tile_bank.cpp b/code/studio/src/plugins/tile_editor/tile_bank.cpp new file mode 100644 index 000000000..8e3578eeb --- /dev/null +++ b/code/studio/src/plugins/tile_editor/tile_bank.cpp @@ -0,0 +1,642 @@ +// Ryzom Core Studio - Tile Editor plugin +// 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 "tile_bank.h" +#include "nel/3d/tile_bank.h" + +#include + +namespace{ + + bool pixmapToCBGRA( QPixmap &pixmap, std::vector< NLMISC::CBGRA >& pixels ) + { + QImage img = pixmap.toImage(); + if( img.format() != QImage::Format_ARGB32 ) + img = img.convertToFormat( QImage::Format_ARGB32 ); + + if( img.format() != QImage::Format_ARGB32 ) + return false; + + int c = img.width() * img.height(); + + const unsigned char *data = img.bits(); + const unsigned int *idata = reinterpret_cast< const unsigned int* >( data ); + + NLMISC::CBGRA bgra; + pixels.clear(); + + int i = 0; + while( i < c ) + { + bgra.A = ( idata[ i ] & 0xFF000000 ) >> 24; + bgra.R = ( idata[ i ] & 0x00FF0000 ) >> 16; + bgra.G = ( idata[ i ] & 0x0000FF00 ) >> 8; + bgra.B = ( idata[ i ] & 0x000000FF ); + pixels.push_back( bgra ); + + i++; + } + + return true; + } + + + NL3D::CTile::TBitmap channelToTBitmap( TileConstants::TTileChannel channel ) + { + return NL3D::CTile::TBitmap( int( channel ) ); + } + + +} + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + +class TileBankPvt +{ +public: + + bool checkSize( TileConstants::TNodeTileType type, TileConstants::TTileChannel channel, int w, int h ) + { + int width = -1; + + switch( type ) + { + case TileConstants::Tile128: + width = 128; + break; + + case TileConstants::Tile256: + width = 256; + break; + + case TileConstants::TileTransition: + { + if( channel == TileConstants::TileAlpha ) + width = 64; + else + width = 128; + + } + break; + + case TileConstants::TileDisplacement: + width = 32; + break; + } + + if( width == w ) + return true; + + return false; + } + + NL3D::CTileSet::TError checkTile( NL3D::CTileSet *set, int tile, TileConstants::TNodeTileType type, NL3D::CTileBorder &border, NL3D::CTile::TBitmap bitmap, QString &msg ) + { + NL3D::CTileSet::TError error; + + if( bitmap == NL3D::CTile::additive ) + return NL3D::CTileSet::ok; + + if( type == TileConstants::TileDisplacement ) + return NL3D::CTileSet::ok; + + int component; + int pixel; + int idx; + + switch( type ) + { + case TileConstants::Tile128: + error = set->checkTile128( bitmap, border, pixel, component ); + break; + + case TileConstants::Tile256: + error = set->checkTile256( bitmap, border, pixel, component ); + break; + + case TileConstants::TileTransition: + { + if( bitmap != NL3D::CTile::alpha ) + error = set->checkTile128( bitmap, border, pixel, component ); + else + error = set->checkTileTransition( NL3D::CTileSet::TTransition( tile ), bitmap, border, idx, pixel, component ); + + break; + } + } + + if( ( error != NL3D::CTileSet::ok ) && ( error != NL3D::CTileSet::addFirstA128128 ) ) + { + static const char* comp[]={"Red", "Green", "Blue", "Alpha", ""}; + + msg = NL3D::CTileSet::getErrorMessage( error ); + msg += "\n"; + msg += " pixel %1 component %2"; + msg = msg.arg( pixel ); + msg = msg.arg( comp[ component ] ); + } + + return error; + } + + void setTile( NL3D::CTileSet *set, int tile, int rotation, const QString &name, NL3D::CTile::TBitmap bm, TileConstants::TNodeTileType type, NL3D::CTileBorder &border ) + { + switch( type ) + { + case TileConstants::Tile128: + set->setTile128( tile, name.toUtf8().constData(), bm, m_bank ); + break; + + case TileConstants::Tile256: + set->setTile256( tile, name.toUtf8().constData(), bm, m_bank ); + break; + + case TileConstants::TileTransition: + if( bm != NL3D::CTile::alpha ) + set->setTileTransition( NL3D::CTileSet::TTransition( tile ), name.toUtf8().constData(), bm, m_bank, border ); + else + set->setTileTransitionAlpha( NL3D::CTileSet::TTransition( tile ), name.toUtf8().constData(), m_bank, border, rotation ); + break; + + case TileConstants::TileDisplacement: + set->setDisplacement( NL3D::CTileSet::TDisplacement( tile ), name.toUtf8().constData(), m_bank ); + break; + } + + } + + void buildBorder( QPixmap &pm, NL3D::CTileBorder &border ) + { + std::vector< NLMISC::CBGRA > pixels; + pixmapToCBGRA( pm, pixels ); + border.set( pm.width(), pm.height(), pixels ); + } + + NL3D::CTileBank m_bank; +}; + + + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +TileBank::TileBank() +{ + m_pvt = new TileBankPvt(); + resetError(); + m_rotation = 0; +} + +TileBank::~TileBank() +{ + delete m_pvt; +} + +void TileBank::addTileSet( const QString &name ) +{ + m_pvt->m_bank.addTileSet( name.toUtf8().constData() ); + NL3D::CTileSet *set = m_pvt->m_bank.getTileSet( 0 ); +} + +void TileBank::removeTileSet( int idx ) +{ + NL3D::CTileSet *set = m_pvt->m_bank.getTileSet( idx ); + if( set == NULL ) + return; + + int c = m_pvt->m_bank.getLandCount(); + for( int i = 0; i < c; i++ ) + { + NL3D::CTileLand *land = m_pvt->m_bank.getLand( i ); + land->removeTileSet( set->getName() ); + } + + m_pvt->m_bank.removeTileSet( idx ); +} + +void TileBank::renameTileSet( int idx, const QString &newName ) +{ + NL3D::CTileSet *set = m_pvt->m_bank.getTileSet( idx ); + if( set == NULL ) + return; + + std::string oldName = set->getName(); + set->setName( newName.toUtf8().constData() ); + + int c = m_pvt->m_bank.getLandCount(); + for( int i = 0; i < c; i++ ) + { + NL3D::CTileLand *land = m_pvt->m_bank.getLand( i ); + land->removeTileSet( oldName ); + land->addTileSet( newName.toUtf8().constData() ); + } + +} + +void TileBank::getTileSets( QStringList &l ) +{ + int c = m_pvt->m_bank.getTileSetCount(); + for( int i = 0; i < c; i++ ) + { + NL3D::CTileSet *set = m_pvt->m_bank.getTileSet( i ); + l.push_back( set->getName().c_str() ); + } +} + +void TileBank::addLand( const QString &name ) +{ + m_pvt->m_bank.addLand( name.toUtf8().constData() ); +} + +void TileBank::removeLand( int idx ) +{ + m_pvt->m_bank.removeLand( idx ); +} + +void TileBank::getLands( QStringList &l ) +{ + l.clear(); + + int c = m_pvt->m_bank.getLandCount(); + for( int i = 0; i < c; i++ ) + { + NL3D::CTileLand *land = m_pvt->m_bank.getLand( i ); + l.push_back( land->getName().c_str() ); + } +} + +void TileBank::setLandSets( int idx, const QStringList &l ) +{ + NL3D::CTileLand *land = m_pvt->m_bank.getLand( idx ); + land->clear(); + + QStringListIterator itr( l ); + while( itr.hasNext() ) + { + land->addTileSet( itr.next().toUtf8().constData() ); + } +} + +void TileBank::getLandSets( int idx, QStringList &l ) +{ + NL3D::CTileLand *land = m_pvt->m_bank.getLand( idx ); + if( land == NULL ) + return; + + l.clear(); + + std::set< std::string> sets = land->getTileSets(); + std::set< std::string >::const_iterator itr = sets.begin(); + while( itr != sets.end() ) + { + l.push_back( itr->c_str() ); + ++itr; + } +} + +bool TileBank::addTile( int setIdx, const QString &name, const QVariant &pixmap, TileConstants::TTileChannel channel, TileConstants::TNodeTileType type ) +{ + resetError(); + + NL3D::CTileSet *set = m_pvt->m_bank.getTileSet( setIdx ); + + int tile; + switch( type ) + { + case TileConstants::Tile128: set->addTile128( tile, m_pvt->m_bank ); break; + case TileConstants::Tile256: set->addTile256( tile, m_pvt->m_bank ); break; + } + + bool b = setTile( setIdx, tile, name, pixmap, channel, type ); + if( b ) + return true; + + // There was an error, roll back + switch( type ) + { + case TileConstants::Tile128: set->removeTile128( tile, m_pvt->m_bank ); break; + case TileConstants::Tile256: set->removeTile256( tile, m_pvt->m_bank ); break; + } + + return false; +} + +void TileBank::removeTile( int ts, int type, int tile ) +{ + NL3D::CTileSet *set = m_pvt->m_bank.getTileSet( ts ); + + switch( type ) + { + case TileConstants::Tile128: set->removeTile128( tile, m_pvt->m_bank ); break; + case TileConstants::Tile256: set->removeTile256( tile, m_pvt->m_bank ); break; + } +} + +bool TileBank::setTile( int tileset, int tile, const QString &name, const QVariant &pixmap, TileConstants::TTileChannel channel, TileConstants::TNodeTileType type ) +{ + resetError(); + + NL3D::CTileSet *set = m_pvt->m_bank.getTileSet( tileset ); + if( set == NULL ) + return false; + + QPixmap pm = pixmap.value< QPixmap >(); + if( pm.isNull() ) + { + m_hasError = true; + m_lastError = "Failed to load image."; + return false; + } + + if( pm.width() != pm.height() ) + { + m_hasError = true; + m_lastError = "Image isn't square."; + return false; + } + + if( !m_pvt->checkSize( type, channel, pm.width(), pm.height() ) ) + { + m_hasError = true; + m_lastError = "Invalid image size."; + return false; + } + + NL3D::CTileBorder border; + m_pvt->buildBorder( pm, border ); + + if( ( type == TileConstants::TileTransition ) && ( channel == TileConstants::TileAlpha ) ) + { + int rotBits = m_rotation; + while( rotBits > 0 ) + { + border.rotate(); + rotBits--; + } + } + + QString msg; + NL3D::CTileSet::TError error = m_pvt->checkTile( set, tile, type, border, channelToTBitmap( channel ), msg ); + + // Tile checks out fine, set it + if( ( error == NL3D::CTileSet::ok ) || ( error == NL3D::CTileSet::addFirstA128128 ) ) + { + if( error == NL3D::CTileSet::addFirstA128128 ) + set->setBorder( channelToTBitmap( channel ), border ); + + m_pvt->setTile( set, tile, m_rotation, name, channelToTBitmap( channel ), type, border ); + + return true; + } + + setError( msg ); + + return false; +} + +void TileBank::replaceImage( int ts, int type, int tile, TileConstants::TTileChannel channel, const QString &name, const QVariant &pixmap ) +{ + setTile( ts, tile, name, pixmap, channel, TileConstants::TNodeTileType( type ) ); +} + +void TileBank::clearImage( int ts, int type, int tile, TileConstants::TTileChannel channel ) +{ + NL3D::CTileSet *set = m_pvt->m_bank.getTileSet( ts ); + + int tileId; + + NL3D::CTile::TBitmap bm = channelToTBitmap( channel ); + + switch( type ) + { + case TileConstants::Tile128: + set->clearTile128( tile, bm, m_pvt->m_bank ); + break; + + case TileConstants::Tile256: + set->clearTile256( tile, bm, m_pvt->m_bank ); + break; + + case TileConstants::TileTransition: + set->clearTransition( NL3D::CTileSet::TTransition( tile ), bm, m_pvt->m_bank ); + break; + + case TileConstants::TileDisplacement: + set->clearDisplacement( NL3D::CTileSet::TDisplacement( tile ), m_pvt->m_bank ); + break; + } + +} + +int TileBank::getTileCount( int tileSet, TileConstants::TNodeTileType type ) +{ + NL3D::CTileSet *set = m_pvt->m_bank.getTileSet( tileSet ); + if( set == NULL ) + return -1; + + int c = 0; + + switch( type ) + { + case TileConstants::Tile128: + c = set->getNumTile128(); + break; + + case TileConstants::Tile256: + c = set->getNumTile256(); + break; + + case TileConstants::TileTransition: + c = NL3D::CTileSet::count; + break; + + case TileConstants::TileDisplacement: + c = NL3D::CTileSet::CountDisplace; + break; + } + + return c; +} + +int TileBank::getRealTileId( int tileSet, TileConstants::TNodeTileType type, int tileIdInSet ) +{ + NL3D::CTileSet *set = m_pvt->m_bank.getTileSet( tileSet ); + if( set == NULL ) + return -1; + + int tile = -1; + + switch( type ) + { + case TileConstants::Tile128: + tile = set->getTile128( tileIdInSet ); + break; + + case TileConstants::Tile256: + tile = set->getTile256( tileIdInSet ); + break; + + case TileConstants::TileTransition: + tile = set->getTransition( tileIdInSet )->getTile(); + break; + + case TileConstants::TileDisplacement: + tile = set->getDisplacementTile( NL3D::CTileSet::TDisplacement( tileIdInSet ) ); + break; + } + + return tile; +} + +void TileBank::getTileImages( int tileSet, TileConstants::TNodeTileType type, int tileId, TileImages &images ) +{ + NL3D::CTileSet *set = m_pvt->m_bank.getTileSet( tileSet ); + if( set == NULL ) + return; + + switch( type ) + { + case TileConstants::Tile128: + case TileConstants::Tile256: + case TileConstants::TileTransition: + { + NL3D::CTile *t = m_pvt->m_bank.getTile( tileId ); + if( t == NULL ) + return; + + images.diffuse = t->getFileName( channelToTBitmap( TileConstants::TileDiffuse ) ).c_str(); + images.additive = t->getFileName( channelToTBitmap( TileConstants::TileAdditive ) ).c_str(); + images.alpha = t->getFileName( channelToTBitmap( TileConstants::TileAlpha ) ).c_str(); + } + break; + + case TileConstants::TileDisplacement: + { + images.diffuse = m_pvt->m_bank.getDisplacementMap( tileId ); + } + break; + } + +} + +void TileBank::getTileImages( int tileSet, TileConstants::TNodeTileType type, QList< TileImages > &l ) +{ + l.clear(); + + NL3D::CTileSet *set = m_pvt->m_bank.getTileSet( tileSet ); + if( set == NULL ) + return; + + int c = getTileCount( tileSet, type ); + + TileImages images; + + for( int i = 0; i < c; i++ ) + { + images.clear(); + + int id = getRealTileId( tileSet, type, i ); + if( id < 0 ) + { + l.push_back( images ); + continue; + } + + getTileImages( tileSet, type, id, images ); + + l.push_back( images ); + } + +} + +void TileBank::setVegetation( int tileSet, const QString &vegetation ) +{ + NL3D::CTileSet *set = m_pvt->m_bank.getTileSet( tileSet ); + if( set == NULL ) + return; + + set->setTileVegetableDescFileName( vegetation.toUtf8().constData() ); +} + + +QString TileBank::getVegetation( int tileSet ) const +{ + NL3D::CTileSet *set = m_pvt->m_bank.getTileSet( tileSet ); + if( set == NULL ) + return ""; + + return set->getTileVegetableDescFileName().c_str(); +} + +void TileBank::setOriented( int tileSet, bool b ) +{ + NL3D::CTileSet *set = m_pvt->m_bank.getTileSet( tileSet ); + if( set == NULL ) + return; + + set->setOriented( b ); +} + +bool TileBank::getOriented( int tileSet ) const +{ + NL3D::CTileSet *set = m_pvt->m_bank.getTileSet( tileSet ); + if( set == NULL ) + return false; + + return set->getOriented(); +} + + +void TileBank::setSurfaceData( int tileSet, unsigned long data ) +{ + NL3D::CTileSet *set = m_pvt->m_bank.getTileSet( tileSet ); + if( set == NULL ) + return; + + set->SurfaceData = data; +} + +unsigned long TileBank::getSurfaceData( int tileSet ) const +{ + NL3D::CTileSet *set = m_pvt->m_bank.getTileSet( tileSet ); + if( set == NULL ) + return 0; + + return set->SurfaceData; +} + +void TileBank::setTexturePath( const QString &path ) +{ + m_pvt->m_bank.setAbsPath( path.toUtf8().constData() ); +} + +QString TileBank::getTexturePath() const +{ + return m_pvt->m_bank.getAbsPath().c_str(); +} + +void TileBank::setRotation( int rotation ) +{ + m_rotation = rotation; +} + +void TileBank::serial( NLMISC::IStream &f ) +{ + m_pvt->m_bank.serial( f ); +} + + diff --git a/code/studio/src/plugins/tile_editor/tile_bank.h b/code/studio/src/plugins/tile_editor/tile_bank.h new file mode 100644 index 000000000..9d765b8ae --- /dev/null +++ b/code/studio/src/plugins/tile_editor/tile_bank.h @@ -0,0 +1,102 @@ +// Ryzom Core Studio - Tile Editor plugin +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + + +#ifndef TILE_BANK_H +#define TILE_BANK_H + +#include +#include +#include +#include + +#include "tile_constants.h" +#include "tile_images.h" + +namespace NLMISC +{ + class IStream; +} + +class TileBankPvt; + +class TileBank +{ +public: + TileBank(); + ~TileBank(); + + void addTileSet( const QString &name ); + void removeTileSet( int idx ); + void renameTileSet( int idx, const QString &newName ); + void getTileSets( QStringList &l ); + + void addLand( const QString &name ); + void removeLand( int idx ); + void getLands( QStringList &l ); + void setLandSets( int idx, const QStringList &l ); + void getLandSets( int idx, QStringList &l ); + + bool addTile( int setIdx, const QString &name, const QVariant &pixmap, TileConstants::TTileChannel channel, TileConstants::TNodeTileType type ); + void removeTile( int ts, int type, int tile ); + bool setTile( int tileset, int tile, const QString &name, const QVariant &pixmap, TileConstants::TTileChannel channel, TileConstants::TNodeTileType type ); + void replaceImage( int ts, int type, int tile, TileConstants::TTileChannel channel, const QString &name, const QVariant &pixmap ); + void clearImage( int ts, int type, int tile, TileConstants::TTileChannel channel ); + + + int getTileCount( int tileSet, TileConstants::TNodeTileType type ); + int getRealTileId( int tileSet, TileConstants::TNodeTileType type, int tileIdInSet ); + void getTileImages( int tileSet, TileConstants::TNodeTileType type, int tileId, TileImages &images ); + void getTileImages( int tileSet, TileConstants::TNodeTileType type, QList< TileImages > &l ); + + void setVegetation( int tileSet, const QString &vegetation ); + QString getVegetation( int tileSet ) const; + + void setOriented( int tileSet, bool b ); + bool getOriented( int tileSet ) const; + + void setSurfaceData( int tileSet, unsigned long data ); + unsigned long getSurfaceData( int tileSet ) const; + + void setTexturePath( const QString &path ); + QString getTexturePath() const; + + void setRotation( int rotation ); + + void serial( NLMISC::IStream &f ); + + bool hasError() const{ return m_hasError; } + QString getLastError() const{ return m_lastError; } + void resetError(){ + m_hasError = false; + m_lastError = ""; + } + + void setError( const QString &msg ) + { + m_hasError = true; + m_lastError = msg; + } + +private: + TileBankPvt *m_pvt; + QString m_lastError; + bool m_hasError; + int m_rotation; +}; + +#endif + diff --git a/code/studio/src/plugins/tile_editor/tile_constants.h b/code/studio/src/plugins/tile_editor/tile_constants.h new file mode 100644 index 000000000..56748cb58 --- /dev/null +++ b/code/studio/src/plugins/tile_editor/tile_constants.h @@ -0,0 +1,43 @@ +// Ryzom Core Studio - Tile Editor plugin +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + + +#ifndef TILE_CONSTANTS_H +#define TILE_CONSTANTS_H + + +namespace TileConstants +{ + enum TTileChannel + { + TileDiffuse = 0, + TileAdditive = 1, + TileAlpha = 2, + TileChannelCount = 3 + }; + + enum TNodeTileType + { + Tile128 = 0, + Tile256 = 1, + TileTransition = 2, + TileDisplacement = 3, + TileNodeTypeCount = 4 + }; +} + + +#endif diff --git a/code/studio/src/plugins/tile_editor/tile_editor.qrc b/code/studio/src/plugins/tile_editor/tile_editor.qrc new file mode 100644 index 000000000..55950d217 --- /dev/null +++ b/code/studio/src/plugins/tile_editor/tile_editor.qrc @@ -0,0 +1,29 @@ + + + images/add_tile.png + images/delete_image.png + images/delete_tile.png + images/replace_image.png + + + images/ic_nel_add_item.png + images/ic_nel_new.png + images/ic_nel_open.png + images/ic_nel_save.png + images/ic_nel_save_as.png + images/down.png + images/left.png + images/reset.png + images/right.png + images/up.png + + + images/rotation0.png + images/rotation90.png + images/rotation180.png + images/rotation270.png + + + images/empty_image.png + + diff --git a/code/studio/src/plugins/tile_editor/tile_editor_main_window.cpp b/code/studio/src/plugins/tile_editor/tile_editor_main_window.cpp new file mode 100644 index 000000000..4b00fb044 --- /dev/null +++ b/code/studio/src/plugins/tile_editor/tile_editor_main_window.cpp @@ -0,0 +1,957 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "tile_editor_main_window.h" + +#include "nel/misc/path.h" + +#include +#include +#include +#include +#include + +#include "../core/icore.h" +#include "../core/core_constants.h" +#include "../core/menu_manager.h" + +#include "tile_model.h" +#include "tile_item.h" +#include "tile_item_delegate.h" + +#include "tilebank_saver.h" +#include "tilebank_loader.h" + +#include "land_edit_dialog.h" + +#include + +TileEditorMainWindow::TileEditorMainWindow(QWidget *parent) + : QMainWindow(parent), + m_ui(new Ui::TileEditorMainWindow) +{ + m_ui->setupUi(this); + m_undoStack = new QUndoStack(this); + + if( !TileItemNode::loadEmptyPixmap() ) + { + QTimer::singleShot( 0, this, SLOT( onEmptyImageLoadFailed() ) ); + } + + // Retrieve the menu manager + Core::ICore *core = Core::ICore::instance(); + Core::MenuManager *menuManager = core->menuManager(); + + // Create tile rotation drop down toolbar menu. + m_rotationMenu = new QMenu(tr("Rotate Tile"), m_ui->toolBar); + m_rotationMenu->setIcon(QIcon(":/tileRotation/images/rotation0.png")); + QList rotateActions; + rotateActions.push_back(m_ui->actionRotateTile0); + rotateActions.push_back(m_ui->actionRotateTile90); + rotateActions.push_back(m_ui->actionRotateTile180); + rotateActions.push_back(m_ui->actionRotateTile270); + m_rotationMenu->addActions(rotateActions); + m_ui->toolBar->addAction(m_rotationMenu->menuAction()); + m_rotateSM = new QSignalMapper(); + m_rotateAG = new QActionGroup(this); + m_rotateAG->addAction(m_ui->actionRotateTile0); + m_rotateAG->addAction(m_ui->actionRotateTile90); + m_rotateAG->addAction(m_ui->actionRotateTile180); + m_rotateAG->addAction(m_ui->actionRotateTile270); + m_ui->actionRotateTile0->setChecked( true ); + + connect( m_ui->actionRotateTile0, SIGNAL( triggered() ), m_rotateSM, SLOT( map() ) ); + connect( m_ui->actionRotateTile90, SIGNAL( triggered() ), m_rotateSM, SLOT( map() ) ); + connect( m_ui->actionRotateTile180, SIGNAL( triggered() ), m_rotateSM, SLOT( map() ) ); + connect( m_ui->actionRotateTile270, SIGNAL( triggered() ), m_rotateSM, SLOT( map() ) ); + m_rotateSM->setMapping( m_ui->actionRotateTile0, 0 ); + m_rotateSM->setMapping( m_ui->actionRotateTile90, 1 ); + m_rotateSM->setMapping( m_ui->actionRotateTile180, 2 ); + m_rotateSM->setMapping( m_ui->actionRotateTile270, 3 ); + connect( m_rotateSM, SIGNAL( mapped( int ) ), this, SLOT( onRotate( int ) ) ); + + // Create the tile zoom menu. + m_zoomMenu = new QMenu(tr("Zoom"), m_ui->toolBar); + m_zoomActionGroup = new QActionGroup(this); + m_zoomSignalMapper = new QSignalMapper(this); + QList zoomActions; + zoomActions.push_back(m_ui->actionZoom50); + zoomActions.push_back(m_ui->actionZoom100); + zoomActions.push_back(m_ui->actionZoom200); + m_zoomActionGroup->addAction(m_ui->actionZoom50); + m_zoomActionGroup->addAction(m_ui->actionZoom100); + m_zoomActionGroup->addAction(m_ui->actionZoom200); + m_zoomMenu->addActions(zoomActions); + m_ui->toolBar->addAction(m_zoomMenu->menuAction()); + + m_tileEditorMenu = new QMenu(tr("Tile Editor"), core->menuManager()->menuBar()); + m_tileDisplayMenu = new QMenu(tr("Tile Display"), m_ui->toolBar); + QList displayActions; + displayActions.push_back(m_ui->actionTileDisplayFilename); + displayActions.push_back(m_ui->actionTileDisplayIndex); + m_ui->actionTileDisplayIndex->setChecked(true); + m_tileDisplayMenu->addActions(displayActions); + m_tileEditorMenu->addMenu(m_tileDisplayMenu); + core->menuManager()->menuBar()->addMenu(m_tileEditorMenu); + + // Set up the list views. + m_tileItemDelegate = new TileItemDelegate(); + + // Set up the tile set list view. + //m_ui->tileSetLV->setModel(m_model); + //m_ui->tileSetLV->setRootIndex(m_model->index(0,0)); + + connect(m_ui->tileSetAddTB, SIGNAL(clicked()), this, SLOT(onTileSetAdd())); + connect(m_ui->tileSetDeleteTB, SIGNAL(clicked()), this, SLOT(onTileSetDelete())); + connect(m_ui->tileSetEditTB, SIGNAL(clicked()), this, SLOT(onTileSetEdit())); + + connect(m_ui->landAddTB, SIGNAL(clicked()), this, SLOT(onLandAdd())); + connect(m_ui->landRemoveTB, SIGNAL(clicked()), this, SLOT(onLandRemove())); + connect(m_ui->landEditTB, SIGNAL(clicked()), this, SLOT(onLandEdit())); + + connect(m_ui->chooseVegetPushButton, SIGNAL(clicked()), this, SLOT(onChooseVegetation())); + connect(m_ui->resetVegetPushButton, SIGNAL(clicked()), this, SLOT(onResetVegetation())); + + connect(m_ui->tileBankTexturePathPB, SIGNAL(clicked()), this, SLOT(onChooseTexturePath())); + + m_tileModel = createTileModel(); + m_ui->tileSetLV->setModel( m_tileModel ); + + // 128x128 List View + //m_ui->listView128->setItemDelegate(m_tileItemDelegate); + m_ui->listView128->setModel( m_tileModel ); + m_ui->listView128->addAction(m_ui->actionAddTile); + m_ui->listView128->addAction(m_ui->actionDeleteTile); + m_ui->listView128->addAction(m_ui->actionReplaceImage); + m_ui->listView128->addAction(m_ui->actionDeleteImage); + + // 256x256 List View + //m_ui->listView256->setItemDelegate(m_tileItemDelegate); + m_ui->listView256->setModel( m_tileModel ); + m_ui->listView256->addAction(m_ui->actionAddTile); + m_ui->listView256->addAction(m_ui->actionDeleteTile); + m_ui->listView256->addAction(m_ui->actionReplaceImage); + m_ui->listView256->addAction(m_ui->actionDeleteImage); + + // Transition List View + //m_ui->listViewTransition->setItemDelegate(m_tileItemDelegate); + m_ui->listViewTransition->setModel( m_tileModel ); + m_ui->listViewTransition->addAction(m_ui->actionReplaceImage); + m_ui->listViewTransition->addAction(m_ui->actionDeleteImage); + + // Displacement List View + //m_ui->listViewDisplacement->setItemDelegate(m_tileItemDelegate); + m_ui->listViewDisplacement->setModel( m_tileModel ); + m_ui->listViewDisplacement->addAction(m_ui->actionReplaceImage); + m_ui->listViewDisplacement->addAction(m_ui->actionDeleteImage); + + + // Connect context menu actions up. + connect(m_ui->actionAddTile, SIGNAL(triggered(bool)), this, SLOT(onActionAddTile(bool))); + connect(m_ui->actionDeleteTile, SIGNAL(triggered(bool)), this, SLOT(onActionDeleteTile(bool))); + connect(m_ui->actionReplaceImage, SIGNAL(triggered(bool)), this, SLOT(onActionReplaceImage(bool))); + connect(m_ui->actionDeleteImage, SIGNAL(triggered(bool)), this, SLOT(onActionDeleteImage(bool))); + + //connect(m_ui->tileViewTabWidget, SIGNAL(currentChanged(int)), m_tileItemDelegate, SLOT(currentTab(int))); + connect( m_ui->tileSetLV->selectionModel(), SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ), + this, SLOT( changeActiveTileSet( const QModelIndex &, const QModelIndex & ) ) ); + + // Connect the zoom buttons. + connect(m_ui->actionZoom50, SIGNAL(triggered()), m_zoomSignalMapper, SLOT(map())); + m_zoomSignalMapper->setMapping(m_ui->actionZoom50, 0); + connect(m_ui->actionZoom100, SIGNAL(triggered()), m_zoomSignalMapper, SLOT(map())); + m_zoomSignalMapper->setMapping(m_ui->actionZoom100, 1); + connect(m_ui->actionZoom200, SIGNAL(triggered()), m_zoomSignalMapper, SLOT(map())); + m_zoomSignalMapper->setMapping(m_ui->actionZoom200, 2); + connect(m_zoomSignalMapper, SIGNAL(mapped(int)), this, SLOT(onZoomFactor(int))); + + QAction *saveAction = Core::ICore::instance()->menuManager()->action( Core::Constants::SAVE ); + saveAction->setEnabled( true ); + QAction *saveAsAction = Core::ICore::instance()->menuManager()->action( Core::Constants::SAVE_AS ); + saveAsAction->setEnabled( true ); + QAction *openAction = Core::ICore::instance()->menuManager()->action( Core::Constants::OPEN ); + openAction->setEnabled( true ); + + connect( m_ui->actionSaveTileBank, SIGNAL( triggered() ), this, SLOT( save() ) ); + connect( m_ui->actionSaveTileBankAs, SIGNAL( triggered() ), this, SLOT( saveAs() ) ); + connect( m_ui->actionOpenTileBank, SIGNAL( triggered() ), this, SLOT( open() ) ); + + connect( m_ui->orientedCheckBox, SIGNAL( stateChanged( int ) ), this, SLOT( onOrientedStateChanged( int ) ) ); + connect( m_ui->surfaceDataLineEdit, SIGNAL( textEdited( const QString& ) ), this, SLOT( onSurfaceDataChanged( const QString& ) ) ); + + connect( m_ui->diffuse128BT, SIGNAL( toggled( bool ) ), this, SLOT( onDiffuseToggled( bool ) ) ); + connect( m_ui->diffuse256BT, SIGNAL( toggled( bool ) ), this, SLOT( onDiffuseToggled( bool ) ) ); + connect( m_ui->diffuseTrBT, SIGNAL( toggled( bool ) ), this, SLOT( onDiffuseToggled( bool ) ) ); + connect( m_ui->additive128BT, SIGNAL( toggled( bool ) ), this, SLOT( onAdditiveToggled( bool ) ) ); + connect( m_ui->additive256BT, SIGNAL( toggled( bool ) ), this, SLOT( onAdditiveToggled( bool ) ) ); + connect( m_ui->additiveTrBT, SIGNAL( toggled( bool ) ), this, SLOT( onAdditiveToggled( bool ) ) ); + connect( m_ui->alphaTrBT, SIGNAL( toggled( bool ) ), this, SLOT( onAlphaToggled( bool ) ) ); + + connect( m_ui->tileViewTabWidget, SIGNAL( currentChanged( int ) ), this, SLOT( onTabChanged( int ) ) ); + +} + +TileEditorMainWindow::~TileEditorMainWindow() +{ + delete m_ui; + delete m_undoStack; + delete m_rotationMenu; + delete m_rotateSM; + delete m_rotateAG; + + delete m_tileDisplayMenu; + delete m_tileEditorMenu; + + delete m_zoomMenu; + delete m_zoomActionGroup; + delete m_zoomSignalMapper; + + delete m_tileModel; + m_tileModel = NULL; +} + +void TileEditorMainWindow::save() +{ + if( m_fileName.isEmpty() ) + saveAs(); + else + saveAs( m_fileName ); +} + +void TileEditorMainWindow::saveAs() +{ + QString fn = QFileDialog::getSaveFileName( this, + tr( "Save TileBank as..." ), + "", + tr( "TileBank files (*.tilebank)" ) ); + + if( fn.isEmpty() ) + return; + + saveAs( fn ); + +} + +void TileEditorMainWindow::saveAs( const QString &fn ) +{ + QList< QString > landNames; + + int c = m_ui->landLW->count(); + for( int i = 0; i < c; i++ ) + { + QListWidgetItem *item = m_ui->landLW->item( i ); + landNames.push_back( item->text() ); + } + + TileBankSaver saver; + bool ok = saver.save( fn.toUtf8().constData(), m_tileModel ); + + if( !ok ) + { + QMessageBox::critical( this, + tr( "Saving tilebank" ), + tr( "Failed to save tilebank :(" ) ); + } +} + +void TileEditorMainWindow::open() +{ + QString fn = QFileDialog::getOpenFileName( this, + tr( "Loading tilebank" ), + m_lastOpenDir, + tr( "tilebank files (*.tilebank)" ) ); + + if( fn.isEmpty() ) + return; + + TileBankLoader loader; + bool b = loader.load( fn.toUtf8().constData(), m_tileModel ); + + if( !b ) + { + QMessageBox::critical( this, + tr( "Loading tilebank" ), + tr( "Failed to load tilebank %1" ).arg( fn ) ); + } + + // Put the loaded data into the GUI + onTileBankLoaded(); + + m_fileName = fn; + + int idx = fn.lastIndexOf( '/' ); + m_lastOpenDir = fn.left( idx ); +} + +void TileEditorMainWindow::onZoomFactor(int level) +{ + int tile128Scaled=TileModel::TILE_128_BASE_SIZE; + int tile256Scaled=TileModel::TILE_256_BASE_SIZE; + int tileTransScaled=TileModel::TILE_TRANSITION_BASE_SIZE; + int tileDispScaled=TileModel::TILE_DISPLACE_BASE_SIZE; + switch(level) + { + // Zoom Level 50% + case 0: + nlinfo("zooming to 50%"); + TileModel::CurrentZoomFactor = TileModel::TileZoom50; + tile128Scaled /= 2; + tile256Scaled /= 2; + tileTransScaled /= 2; + tileDispScaled /= 2; + break; + case 1: + nlinfo("zooming to 100%"); + TileModel::CurrentZoomFactor = TileModel::TileZoom100; + break; + case 2: + nlinfo("zooming to 200%"); + TileModel::CurrentZoomFactor = TileModel::TileZoom200; + tile128Scaled *= 2; + tile256Scaled *= 2; + tileTransScaled *= 2; + tileDispScaled *= 2; + break; + default: + nlwarning("Invalid Time Zoom Factor passed."); + break; + }; + + nlinfo("resizing transition view. base size: %d factor %d to: %d", TileModel::TILE_TRANSITION_BASE_SIZE, level, tileTransScaled); + + m_ui->listView128->setIconSize(QSize(tile128Scaled, tile128Scaled)); + m_ui->listView128->setCurrentIndex(m_ui->listView128->model()->index(0, 0, m_ui->listView128->rootIndex())); + m_ui->listView256->setIconSize(QSize(tile256Scaled, tile256Scaled)); + m_ui->listView256->setCurrentIndex(m_ui->listView256->model()->index(0, 0, m_ui->listView256->rootIndex())); + m_ui->listViewTransition->setIconSize(QSize(tileTransScaled, tileTransScaled)); + m_ui->listViewTransition->setCurrentIndex(m_ui->listViewTransition->model()->index(0, 0, m_ui->listViewTransition->rootIndex())); + m_ui->listViewDisplacement->setIconSize(QSize(tileDispScaled, tileDispScaled)); + m_ui->listViewDisplacement->setCurrentIndex(m_ui->listViewDisplacement->model()->index(0, 0, m_ui->listViewDisplacement->rootIndex())); + m_ui->listViewTransition->repaint(); +} + +void TileEditorMainWindow::onRotate( int id ) +{ + m_tileModel->setAlphaRot( id ); +} + +void TileEditorMainWindow::onEmptyImageLoadFailed() +{ + QMessageBox::critical( this, + tr( "Empty image load failed" ), + tr( "Couldn't load the image for empty tiles :(" ) ); +} + +void TileEditorMainWindow::onActionAddTile(bool triggered) +{ + onActionAddTile(m_ui->tileViewTabWidget->currentIndex()); +} + +void TileEditorMainWindow::onActionDeleteTile(bool triggered) +{ + onActionDeleteTile(m_ui->tileViewTabWidget->currentIndex()); +} + +void TileEditorMainWindow::onActionReplaceImage(bool triggered) +{ + onActionReplaceImage(m_ui->tileViewTabWidget->currentIndex()); +} + +void TileEditorMainWindow::onActionDeleteImage(bool triggered) +{ + onActionDeleteImage(m_ui->tileViewTabWidget->currentIndex()); +} + +void TileEditorMainWindow::onTileSetAdd() +{ + bool ok; + QString text = QInputDialog::getText(this, tr("Add Tile Set"), tr("Enter Tile Set name:"), QLineEdit::Normal, "", &ok); + if (ok && !text.isEmpty()) + { + TileModel *model = static_cast(m_ui->tileSetLV->model()); + + if( model->hasTileSet( text ) ) + { + QMessageBox::information( this, tr("Error Adding Tile Set"), tr("This name already exists") ); + return; + } + + // Create and append the new tile set to the model. + m_tileModel->addTileSet( text ); + + // Retrieve how many rows there currently are and set the current index using that. + uint32 rows = model->rowCount(); + m_ui->tileSetLV->setCurrentIndex(model->index(rows-1, 0)); + } +} + +void TileEditorMainWindow::onTileSetDelete() +{ + QModelIndex idx = m_ui->tileSetLV->currentIndex(); + if( !idx.isValid() ) + return; + + int reply = QMessageBox::question( this, + tr( "Removing tile set" ), + tr( "Are you sure you want to remove this tile set?" ), + QMessageBox::Yes | QMessageBox::Cancel ); + + if( reply != QMessageBox::Yes ) + return; + + QString set = reinterpret_cast< TileSetNode* >( idx.internalPointer() )->getTileSetName(); + + m_tileModel->removeTileSet( idx.row() ); +} + +void TileEditorMainWindow::onTileSetEdit() +{ + QModelIndex idx = m_ui->tileSetLV->currentIndex(); + if( !idx.isValid() ) + return; + + TileSetNode *node = reinterpret_cast< TileSetNode* >( idx.internalPointer() ); + QString name = node->getTileSetName(); + + bool ok = false; + + QString newName = QInputDialog::getText( this, + tr( "Edit tileset" ), + tr( "Enter tileset name" ), + QLineEdit::Normal, + name, + &ok ); + + if( !ok ) + return; + + TileModel *model = static_cast(m_ui->tileSetLV->model()); + if( model->hasTileSet( newName ) ) + { + QMessageBox::information( this, + tr("Tileset already exists"), + tr("A tileset with that name already exists!") ); + return; + } + + QString oldName = node->getTileSetName(); + node->setTileSetName( newName ); + m_ui->tileSetLV->reset(); + + m_tileModel->renameTileSet( idx.row(), newName ); +} + +void TileEditorMainWindow::onLandAdd() +{ + QString name = QInputDialog::getText( this, + tr("Adding new land"), + tr("Please specify the new land's name") ); + + if( name.isEmpty() ) + return; + + for( int i = 0; i < m_ui->landLW->count(); i++ ) + { + QListWidgetItem *item = m_ui->landLW->item( i ); + if( item->text() == name ) + { + QMessageBox::information( this, + tr( "Error adding new land" ), + tr( "A land with that name already exists." ) ); + return; + } + } + + m_ui->landLW->addItem( name ); + + m_tileModel->addLand( name ); +} + +void TileEditorMainWindow::onLandRemove() +{ + QListWidgetItem *item = m_ui->landLW->currentItem(); + if( item == NULL ) + return; + + int idx = m_ui->landLW->currentRow(); + + int reply = QMessageBox::question( this, + tr( "Removing land" ), + tr( "Are you sure you want to remove this land?" ), + QMessageBox::Yes | QMessageBox::Cancel ); + + if( reply != QMessageBox::Yes ) + return; + + delete item; + + m_tileModel->removeLand( idx ); +} + +void TileEditorMainWindow::onLandEdit() +{ + QListWidgetItem *item = m_ui->landLW->currentItem(); + if( item == NULL ) + return; + + QStringList ts; + int c = m_tileModel->rowCount(); + for( int i = 0; i < c; i++ ) + { + QModelIndex idx = m_tileModel->index( i, 0 ); + if( !idx.isValid() ) + continue; + + TileSetNode *n = reinterpret_cast< TileSetNode* >( idx.internalPointer() ); + ts.push_back( n->getTileSetName() ); + } + + int r = m_ui->landLW->currentRow(); + + QStringList sts; + m_tileModel->getLandSets( r, sts ); + + LandEditDialog d; + d.setSelectedTileSets( sts ); + d.setTileSets( ts ); + int result = d.exec(); + + if( result != QDialog::Accepted ) + return; + + // Update the tileset of the land + sts.clear(); + d.getSelectedTileSets( sts ); + + m_tileModel->setLandSets( r, sts ); +} + +void TileEditorMainWindow::onChooseVegetation() +{ + QModelIndex idx = m_ui->tileSetLV->currentIndex(); + if( !idx.isValid() ) + { + QMessageBox::information( this, + tr("Choosing a vegetation set"), + tr("You need to select a tileset before choosing a vegetation set!") ); + return; + } + + QString vegetSet = QFileDialog::getOpenFileName( this, + tr( "Choose vegetation set" ), + "", + tr( "Nel vegetset files (*.vegetset)" ) ); + + if( vegetSet.isEmpty() ) + return; + + m_tileModel->setVegetation( idx.row(), vegetSet ); + + m_ui->chooseVegetPushButton->setText( vegetSet ); +} + +void TileEditorMainWindow::onResetVegetation() +{ + QModelIndex idx = m_ui->tileSetLV->currentIndex(); + if( !idx.isValid() ) + { + QMessageBox::information( this, + tr("Resetting a vegetation set"), + tr("You need to select a tileset before resetting a vegetation set!") ); + return; + } + m_ui->chooseVegetPushButton->setText( "..." ); + + m_tileModel->setVegetation( idx.row(), "" ); +} + +void TileEditorMainWindow::onChooseTexturePath() +{ + QString path = QFileDialog::getExistingDirectory( this, + tr("Choose tilebank absolute texture path "), + "" ); + + if( path.isEmpty() ) + return; + + int reply = QMessageBox::question( this, + tr("tilebank texture path"), + tr("Are you sure you want to make '%1' the tilebank absolute texture path?").arg( path ), + QMessageBox::Yes | QMessageBox::Cancel ); + + if( reply != QMessageBox::Yes ) + return; + + m_texturePath = path; + m_ui->tileBankTexturePathPB->setText( path ); + m_tileModel->setTexturePath( path ); +} + +void TileEditorMainWindow::onOrientedStateChanged( int state ) +{ + QModelIndex idx = m_ui->tileSetLV->currentIndex(); + if( !idx.isValid() ) + return; + + int row = idx.row(); + + if( state == Qt::Checked ) + m_tileModel->setOriented( row, true ); + else + m_tileModel->setOriented( row, false ); +} + +void TileEditorMainWindow::onSurfaceDataChanged( const QString &text ) +{ + QModelIndex idx = m_ui->tileSetLV->currentIndex(); + if( !idx.isValid() ) + return; + + bool ok = false; + unsigned long data = text.toUInt( &ok ); + if( !ok ) + return; + + m_tileModel->setSurfaceData( idx.row(), data ); +} + +void TileEditorMainWindow::onDiffuseToggled( bool b ) +{ + if( !b ) + return; + + TileItemNode::setDisplayChannel( TileConstants::TileDiffuse ); + updateTab(); +} + +void TileEditorMainWindow::onAdditiveToggled( bool b ) +{ + if( !b ) + return; + + TileItemNode::setDisplayChannel( TileConstants::TileAdditive ); + updateTab(); +} + +void TileEditorMainWindow::onAlphaToggled( bool b ) +{ + if( !b ) + return; + + TileItemNode::setDisplayChannel( TileConstants::TileAlpha ); + updateTab(); +} + +void TileEditorMainWindow::onTabChanged( int tab ) +{ + if( tab == -1 ) + return; + + m_ui->diffuse128BT->setChecked( true ); + m_ui->diffuse256BT->setChecked( true ); + m_ui->diffuseTrBT->setChecked( true ); +} + +TileConstants::TNodeTileType tabToType( int tabId ) +{ + if( tabId >= TileConstants::TileNodeTypeCount ) + return TileConstants::TileNodeTypeCount; + + return TileConstants::TNodeTileType( tabId ); +} + +void TileEditorMainWindow::onActionAddTile(int tabId) +{ + QModelIndex idx = m_ui->tileSetLV->currentIndex(); + if( !idx.isValid() ) + { + QMessageBox::information( this, + tr( "Adding new tiles" ), + tr( "You need to have a tileset selected before you can add tiles!" ) ); + return; + } + + int tileSet = idx.row(); + + idx = m_tileModel->index( tileSet, 0 ); + if( !idx.isValid() ) + return; + + int setId = idx.row(); + + TileSetNode *tsn = reinterpret_cast< TileSetNode* >( idx.internalPointer() ); + + Node *n = tsn->child( tabId ); + + QFileDialog::Options options; + QString selectedFilter; + QStringList fileNames = QFileDialog::getOpenFileNames(this, "Choose Tile Texture", m_lastTileDir , "Images (*.png);;All Files (*.*)", &selectedFilter, options); + if( fileNames.empty() ) + return; + + TileConstants::TNodeTileType type = tabToType( tabId ); + + QStringListIterator itr( fileNames ); + QString error; + + while( itr.hasNext() ) + { + bool b = m_tileModel->addTile( setId, type, itr.next(), TileConstants::TileDiffuse ); + + if( !b ) + { + if( m_tileModel->hasError() ) + error = m_tileModel->getLastError(); + + int reply = QMessageBox::question( this, + tr( "Error adding tile" ), + error + "\nContinue?", + QMessageBox::Yes, QMessageBox::No ); + if( reply != QMessageBox::Yes ) + break; + else + continue; + } + + } + + QModelIndex rootIdx = m_tileModel->index( tabId, 0, m_ui->tileSetLV->currentIndex()); + + QListView *lv = getListViewByTab( tabId ); + + lv->reset(); + lv->setRootIndex( rootIdx ); + lv->setCurrentIndex( lv->model()->index( 0, 0, rootIdx ) ); + + QString fn = fileNames[ 0 ].replace( '\\', '/' ); + int slashIdx = fn.lastIndexOf( '/' ); + m_lastTileDir = fn.left( slashIdx ); +} + +void TileEditorMainWindow::onActionDeleteTile( int tabId ) +{ + QListView *lv = getListViewByTab( tabId ); + + QModelIndex idx = lv->currentIndex(); + if( !idx.isValid() ) + { + QMessageBox::information( this, + tr( "Deleting a tile" ), + tr( "You need to select a tile to delete is!" ) ); + return; + } + + QModelIndex tsidx = m_ui->tileSetLV->currentIndex(); + if( !tsidx.isValid() ) + return; + int ts = tsidx.row(); + int tile = idx.row(); + + m_tileModel->removeTile( ts, tabId, tile ); +} + +void TileEditorMainWindow::onActionDeleteImage( int tabId ) +{ + QListView *lv = getListViewByTab( tabId ); + + QModelIndex idx = lv->currentIndex(); + if( !idx.isValid() ) + { + QMessageBox::information( this, + tr( "Deleting tile image" ), + tr( "No tile selected!" ) ); + return; + } + + QModelIndex tsidx = m_ui->tileSetLV->currentIndex(); + if( !tsidx.isValid() ) + return; + int ts = tsidx.row(); + + TileItemNode *n = reinterpret_cast< TileItemNode* >( idx.internalPointer() ); + int tile = n->id(); + + m_tileModel->clearImage( ts, tabId, tile, TileItemNode::displayChannel() ); +} + +void TileEditorMainWindow::onActionReplaceImage( int tabId ) +{ + QListView *lv = getListViewByTab( tabId ); + + QModelIndex tsidx = m_ui->tileSetLV->currentIndex(); + if( !tsidx.isValid() ) + return; + int set = tsidx.row(); + + QModelIndex idx = lv->currentIndex(); + if( !idx.isValid() ) + { + QMessageBox::information( this, + tr( "Replacing tile image" ), + tr( "No tile selected!" ) ); + return; + } + + QString fileName = QFileDialog::getOpenFileName( this, + tr( "Select tile image" ), + m_lastTileDir, + tr( "PNG files (*.png)" ) ); + if( fileName.isEmpty() ) + return; + + TileItemNode *n = reinterpret_cast< TileItemNode* >( idx.internalPointer() ); + int tile = n->id(); + + m_tileModel->replaceImage( set, tabId, tile, TileItemNode::displayChannel(), fileName ); + if( m_tileModel->hasError() ) + { + QString error = m_tileModel->getLastError(); + QMessageBox::information( this, + tr( "Error replacing tile image" ), + error ); + } + + QString fn = fileName.replace( '\\', '/' ); + int slashIdx = fn.lastIndexOf( '/' ); + m_lastTileDir = fn.left( slashIdx ); + + updateTab(); +} + +void TileEditorMainWindow::onTileBankLoaded() +{ + m_ui->landLW->clear(); + QStringList lands; + m_tileModel->getLands( lands ); + QStringListIterator itr( lands ); + while( itr.hasNext() ) + { + m_ui->landLW->addItem( itr.next() ); + } + + m_tileModel->onTBLoaded(); + + m_ui->listView128->reset(); + m_ui->listView256->reset(); + m_ui->listViewTransition->reset(); + + QString path = m_tileModel->getTexturePath(); + if( path.isEmpty() ) + m_ui->tileBankTexturePathPB->setText( "..." ); + else + m_ui->tileBankTexturePathPB->setText( path ); + + QModelIndex idx = m_tileModel->index( 0, 0 ); + if( idx.isValid() ) + m_ui->tileSetLV->setCurrentIndex( idx ); + + if( m_ui->landLW->count() > 0 ) + m_ui->landLW->setCurrentRow( 0 ); +} + +void TileEditorMainWindow::updateTab() +{ + int idx = m_ui->tileViewTabWidget->currentIndex(); + + switch( idx ) + { + case 0: m_ui->listView128->viewport()->repaint(); break; + case 1: m_ui->listView256->viewport()->repaint(); break; + case 2: m_ui->listViewTransition->viewport()->repaint(); break; + case 3: m_ui->listViewDisplacement->viewport()->repaint(); break; + } +} + +TileModel* TileEditorMainWindow::createTileModel() +{ + QStringList headers; + headers << "Tile Set"; + TileModel *m = new TileModel( headers ); + + connect( m_ui->actionTileDisplayFilename, SIGNAL( toggled( bool )), m, SLOT( selectFilenameDisplay( bool ) ) ); + connect( m_ui->actionTileDisplayIndex, SIGNAL( toggled( bool )), m, SLOT( selectIndexDisplay( bool ) ) ); + + return m; +} + +void TileEditorMainWindow::changeActiveTileSet(const QModelIndex &newIndex, const QModelIndex &oldIndex) +{ + TileModel *model = static_cast(m_ui->tileSetLV->model()); + + QModelIndex tile128Idx = model->index(0, 0, newIndex); + QModelIndex tile256Idx = model->index(1, 0, newIndex); + QModelIndex tileTransIdx = model->index(2, 0, newIndex); + QModelIndex tileDispIdx = model->index(3, 0, newIndex); + + m_ui->listView128->setRootIndex(tile128Idx); + m_ui->listView128->setCurrentIndex(m_ui->listView128->model()->index(0, 0, m_ui->listView128->rootIndex())); + m_ui->listView256->setRootIndex(tile256Idx); + m_ui->listView256->setCurrentIndex(m_ui->listView256->model()->index(0, 0, m_ui->listView256->rootIndex())); + m_ui->listViewTransition->setRootIndex(tileTransIdx); + m_ui->listViewTransition->setCurrentIndex(m_ui->listViewTransition->model()->index(0, 0, m_ui->listViewTransition->rootIndex())); + m_ui->listViewDisplacement->setRootIndex(tileDispIdx); + m_ui->listViewDisplacement->setCurrentIndex(m_ui->listViewDisplacement->model()->index(0, 0, m_ui->listViewDisplacement->rootIndex())); + + TileSetNode *oldNode = NULL; + TileSetNode *newNode = NULL; + + if( oldIndex.isValid() ) + oldNode = reinterpret_cast< TileSetNode* >( oldIndex.internalPointer() ); + if( newIndex.isValid() ) + newNode = reinterpret_cast< TileSetNode* >( newIndex.internalPointer() ); + + if( newIndex.isValid() ) + { + QString vegetSet = m_tileModel->getVegetation( newIndex.row() ); + + if( !vegetSet.isEmpty() ) + m_ui->chooseVegetPushButton->setText( vegetSet ); + else + m_ui->chooseVegetPushButton->setText( "..." ); + + m_ui->orientedCheckBox->setChecked( m_tileModel->getOriented( newIndex.row() ) ); + m_ui->surfaceDataLineEdit->setText( QString::number( m_tileModel->getSurfaceData( newIndex.row() ) ) ); + } + else + { + m_ui->chooseVegetPushButton->setText( "..." ); + } + + //nlinfo("number of rows in displacement: %d", tileDispIdx.model()->rowCount(tileDispIdx)); + + //m_ui->listView128->reset(); + //m_ui->listView256->reset(); + //m_ui->listViewTransition->reset(); + //m_ui->listViewDisplacement->reset(); +} + + +QListView* TileEditorMainWindow::getListViewByTab( int tab ) const +{ + QListView *lv = NULL; + + switch( tab ) + { + case TAB_128: lv = m_ui->listView128; break; + case TAB_256: lv = m_ui->listView256; break; + case TAB_TRANSITION: lv = m_ui->listViewTransition; break; + case TAB_DISPLACEMENT: lv = m_ui->listViewDisplacement; break; + } + + return lv; +} + + diff --git a/code/studio/src/plugins/tile_editor/tile_editor_main_window.h b/code/studio/src/plugins/tile_editor/tile_editor_main_window.h new file mode 100644 index 000000000..d06d6deca --- /dev/null +++ b/code/studio/src/plugins/tile_editor/tile_editor_main_window.h @@ -0,0 +1,131 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef TILE_EDITOR_MAIN_WINDOW_H +#define TILE_EDITOR_MAIN_WINDOW_H + +#include "ui_tile_editor_main_window.h" + +#include "nel/misc/types_nl.h" +#include "nel/misc/sheet_id.h" + +#include +#include + +namespace Ui { + class TileEditorMainWindow; +} + +class TileModel; +class TileItemDelegate; + +class TileEditorMainWindow : public QMainWindow +{ + Q_OBJECT + +public: + explicit TileEditorMainWindow(QWidget *parent = 0); + ~TileEditorMainWindow(); + + QUndoStack *getUndoStack() { return m_undoStack; } + +public Q_SLOTS: + void save(); + void saveAs(); + void saveAs( const QString &fn ); + void open(); + +private Q_SLOTS: + void onActionAddTile(bool triggered); + void onActionDeleteTile(bool triggered); + void onActionReplaceImage(bool triggered); + void onActionDeleteImage(bool triggered); + + void onTileSetAdd(); + void onTileSetDelete(); + void onTileSetEdit(); + + void onLandAdd(); + void onLandRemove(); + void onLandEdit(); + + void onResetVegetation(); + void onChooseVegetation(); + + void onChooseTexturePath(); + + void onOrientedStateChanged( int state ); + void onSurfaceDataChanged( const QString &text ); + + void onDiffuseToggled( bool b ); + void onAdditiveToggled( bool b ); + void onAlphaToggled( bool b ); + + void onTabChanged( int tab ); + + void changeActiveTileSet(const QModelIndex &newIndex, const QModelIndex &oldIndex); + void onZoomFactor(int level); + void onRotate(int id); + + void onEmptyImageLoadFailed(); + +private: + void onActionAddTile(int tabId); + void onActionDeleteTile(int tabId); + void onActionDeleteImage(int tabId); + void onActionReplaceImage(int tabId); + + void onTileBankLoaded(); + + void updateTab(); + + TileModel* createTileModel(); + QListView* getListViewByTab( int tab ) const; + + Ui::TileEditorMainWindow *m_ui; + QUndoStack *m_undoStack; + QMenu *m_rotationMenu; + + QMenu *m_tileDisplayMenu; + QMenu *m_tileEditorMenu; + + QMenu *m_zoomMenu; + QActionGroup *m_zoomActionGroup; + QSignalMapper *m_zoomSignalMapper; + QActionGroup *m_rotateAG; + QSignalMapper *m_rotateSM; + + TileItemDelegate *m_tileItemDelegate; + + TileModel *m_tileModel; + + QString m_texturePath; + + enum Tabs + { + TAB_128 = 0, + TAB_256 = 1, + TAB_TRANSITION = 2, + TAB_DISPLACEMENT = 3, + TAB_DETAILS = 4 + }; + + QString m_fileName; + QString m_lastOpenDir; + QString m_lastTileDir; +}; + +#endif // TILE_EDITOR_MAIN_WINDOW_H diff --git a/code/studio/src/plugins/tile_editor/tile_editor_main_window.ui b/code/studio/src/plugins/tile_editor/tile_editor_main_window.ui new file mode 100644 index 000000000..08d14ca79 --- /dev/null +++ b/code/studio/src/plugins/tile_editor/tile_editor_main_window.ui @@ -0,0 +1,748 @@ + + + TileEditorMainWindow + + + + 0 + 0 + 800 + 600 + + + + MainWindow + + + + + + + 0 + + + + 128x128 + + + + + + Qt::ActionsContextMenu + + + + 128 + 128 + + + + QListView::LeftToRight + + + true + + + QListView::IconMode + + + true + + + + + + + Edit Channel + + + + + + Diffuse + + + true + + + + + + + Additive + + + + + + + + + + + 256x256 + + + + + + Qt::ActionsContextMenu + + + + 256 + 256 + + + + QListView::LeftToRight + + + true + + + QListView::IconMode + + + true + + + + + + + Edit Channel + + + + + + Diffuse + + + true + + + true + + + + + + + Additive + + + + + + + + + + + Transition + + + + + + Qt::ActionsContextMenu + + + + 64 + 64 + + + + QListView::Static + + + QListView::LeftToRight + + + true + + + QListView::Adjust + + + QListView::SinglePass + + + QListView::IconMode + + + true + + + + + + + Edit Channel + + + + + + Diffuse + + + true + + + + + + + Additive + + + + + + + Alpha + + + + + + + + + + + Displacement + + + + + + Qt::ActionsContextMenu + + + + 32 + 32 + + + + QListView::Static + + + QListView::LeftToRight + + + true + + + QListView::Fixed + + + QListView::IconMode + + + false + + + + + + + + Tile Set Details + + + + + + Qt::LeftToRight + + + Oriented + + + + + + + + + + Surface Data: + + + + + + + Vegetation Set: + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + ... + + + + + + + Reset + + + + :/newPrefix/reset.png:/newPrefix/reset.png + + + + + + + + + + + + + Tile Editor Tool Bar + + + TopToolBarArea + + + false + + + + + + + + + Tile Bank + + + 1 + + + + + + + Lands + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + ... + + + + :/movementIcons/images/ic_nel_add_item.png:/movementIcons/images/ic_nel_add_item.png + + + + + + + ... + + + + :/movementIcons/images/reset.png:/movementIcons/images/reset.png + + + + + + + ... + + + + :/movementIcons/images/ic_nel_open.png:/movementIcons/images/ic_nel_open.png + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + Tile Sets + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + ... + + + + :/movementIcons/images/ic_nel_add_item.png:/movementIcons/images/ic_nel_add_item.png + + + + + + + ... + + + + :/movementIcons/images/reset.png:/movementIcons/images/reset.png + + + + + + + ... + + + + :/movementIcons/images/ic_nel_open.png:/movementIcons/images/ic_nel_open.png + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Tile Bank Texture Path + + + + + + + + + + + + ... + + + + + + + + + + + + + + + :/movementIcons/images/ic_nel_open.png:/movementIcons/images/ic_nel_open.png + + + Open Tile Bank + + + Open Tile Bank + + + + + true + + + + :/tileRotation/images/rotation0.png:/tileRotation/images/rotation0.png + + + 0 + + + Rotate Tile 0 Degrees + + + + + + :/movementIcons/images/ic_nel_save.png:/movementIcons/images/ic_nel_save.png + + + Save Tile Bank + + + Save Tile Bank + + + + + + :/movementIcons/images/ic_nel_save_as.png:/movementIcons/images/ic_nel_save_as.png + + + Save Tile Bank As... + + + Save Tile Bank As... + + + + + true + + + + :/tileRotation/images/rotation90.png:/tileRotation/images/rotation90.png + + + 90 + + + Rotate Tile 90 Degrees + + + + + true + + + + :/tileRotation/images/rotation180.png:/tileRotation/images/rotation180.png + + + 180 + + + Rotate Tile180 Degrees + + + + + true + + + + :/tileRotation/images/rotation270.png:/tileRotation/images/rotation270.png + + + 270 + + + Rotate Tile 270 Degrees + + + + + Batch Load + + + Batch Load + + + + + Import Border + + + Import Border + + + + + Export Border + + + Export Border + + + + + true + + + true + + + Index + + + Display Tile Index + + + + + true + + + true + + + Filename + + + Display Tile Filename + + + + + + :/tileTools/images/add_tile.png:/tileTools/images/add_tile.png + + + Add Tile + + + Add Tile + + + + + + :/tileTools/images/delete_tile.png:/tileTools/images/delete_tile.png + + + Delete Tile + + + Delete Tile + + + + + + :/tileTools/images/replace_image.png:/tileTools/images/replace_image.png + + + Replace Image + + + Replace Image + + + + + + :/tileTools/images/delete_image.png:/tileTools/images/delete_image.png + + + Delete Image + + + Delete Image + + + + + true + + + Zoom 50% + + + + + true + + + true + + + Zoom 100% + + + + + true + + + Zoom 200% + + + + + + + + + diff --git a/code/studio/src/plugins/tile_editor/tile_editor_plugin.cpp b/code/studio/src/plugins/tile_editor/tile_editor_plugin.cpp new file mode 100644 index 000000000..b10eb6074 --- /dev/null +++ b/code/studio/src/plugins/tile_editor/tile_editor_plugin.cpp @@ -0,0 +1,78 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +// Project includes +#include "tile_editor_plugin.h" +#include "tile_editor_main_window.h" +#include "../core/icore.h" +#include "../core/menu_manager.h" +#include "../core/core_constants.h" + +// Qt includes +#include +#include +#include +#include +#include +#include + +// NeL includes +#include "nel/misc/debug.h" + +using namespace TileEditorPluginQt; + +TileEditorPlugin::~TileEditorPlugin() +{ + Q_FOREACH(QObject *obj, m_autoReleaseObjects) + { + m_plugMan->removeObject(obj); + } + qDeleteAll(m_autoReleaseObjects); + m_autoReleaseObjects.clear(); + + delete m_LibContext; + m_LibContext = NULL; +} + +bool TileEditorPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) +{ + Q_UNUSED(errorString); + m_plugMan = pluginManager; + addAutoReleasedObject(new TileEditorContext()); + return true; +} + +void TileEditorPlugin::extensionsInitialized() +{ +} + +void TileEditorPlugin::setNelContext(NLMISC::INelContext *nelContext) +{ +#ifdef NL_OS_WINDOWS + // Ensure that a context doesn't exist yet. + // This only applies to platforms without PIC, e.g. Windows. + nlassert(!NLMISC::INelContext::isContextInitialised()); +#endif // NL_OS_WINDOWS + m_LibContext = new NLMISC::CLibraryContext(*nelContext); +} + +void TileEditorPlugin::addAutoReleasedObject(QObject *obj) +{ + m_plugMan->addObject(obj); + m_autoReleaseObjects.prepend(obj); +} + +Q_EXPORT_PLUGIN(TileEditorPlugin) diff --git a/code/studio/src/plugins/tile_editor/tile_editor_plugin.h b/code/studio/src/plugins/tile_editor/tile_editor_plugin.h new file mode 100644 index 000000000..70fb38e77 --- /dev/null +++ b/code/studio/src/plugins/tile_editor/tile_editor_plugin.h @@ -0,0 +1,120 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef TILE_EDITOR_PLUGIN_H +#define TILE_EDITOR_PLUGIN_H + +#include "../../extension_system/iplugin.h" +#include "../core/icontext.h" + +#include "nel/misc/app_context.h" + +#include "tile_editor_main_window.h" + +#include + +namespace NLMISC +{ +class CLibraryContext; +} + +namespace TileEditorPluginQt +{ + +class TileEditorPlugin : public QObject, public ExtensionSystem::IPlugin +{ + Q_OBJECT + Q_INTERFACES(ExtensionSystem::IPlugin) +public: + + ~TileEditorPlugin(); + + bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString); + void extensionsInitialized(); + void setNelContext(NLMISC::INelContext *nelContext); + + void addAutoReleasedObject(QObject *obj); + +protected: + NLMISC::CLibraryContext *m_LibContext; + +private: + ExtensionSystem::IPluginManager *m_plugMan; + QList m_autoReleaseObjects; + +}; + +class TileEditorContext: public Core::IContext +{ + Q_OBJECT +public: + TileEditorContext(QObject *parent = 0) : IContext(parent) + { + m_tileEditorMainWindow = new TileEditorMainWindow(); + } + + virtual ~TileEditorContext() + { + m_tileEditorMainWindow = NULL; + } + + virtual QString id() const + { + return QLatin1String("TileEditor"); + } + + virtual QString trName() const + { + return tr("Tile Editor"); + } + + virtual QIcon icon() const + { + return QIcon(":/tileRotation/images/rotation0.png"); + } + + virtual QUndoStack *undoStack() + { + return m_tileEditorMainWindow->getUndoStack(); + } + + virtual void open() + { + m_tileEditorMainWindow->open(); + } + + void save() + { + m_tileEditorMainWindow->save(); + } + + void saveAs() + { + m_tileEditorMainWindow->saveAs(); + } + + virtual QWidget *widget() + { + return m_tileEditorMainWindow; + } + +private: + TileEditorMainWindow *m_tileEditorMainWindow; +}; + +} // namespace TileEditorPluginQt + +#endif // TILE_EDITOR_PLUGIN_H diff --git a/code/nel/src/misc/keyboard_device.cpp b/code/studio/src/plugins/tile_editor/tile_images.h similarity index 74% rename from code/nel/src/misc/keyboard_device.cpp rename to code/studio/src/plugins/tile_editor/tile_images.h index 4c7f353bc..280e0a126 100644 --- a/code/nel/src/misc/keyboard_device.cpp +++ b/code/studio/src/plugins/tile_editor/tile_images.h @@ -1,4 +1,4 @@ -// NeL - MMORPG Framework +// Ryzom Core Studio - Tile Editor plugin // Copyright (C) 2010 Winch Gate Property Limited // // This program is free software: you can redistribute it and/or modify @@ -14,23 +14,27 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -#include "stdmisc.h" -//#include "nel/3d/u_keyboard_device.h" +#ifndef TILE_IMAGES_H +#define TILE_IMAGES_H -#ifdef DEBUG_NEW - #define new DEBUG_NEW -#endif +#include -namespace NL3D { +struct TileImages +{ + QString diffuse; + QString additive; + QString alpha; + void clear() + { + diffuse.clear(); + additive.clear(); + alpha.clear(); + } +}; -/* - * Constructor - */ -/*UKeyboardDevice::UKeyboardDevice() -{ -}*/ -} // NL3D +#endif + diff --git a/code/studio/src/plugins/tile_editor/tile_item.cpp b/code/studio/src/plugins/tile_editor/tile_item.cpp new file mode 100644 index 000000000..71fe336a2 --- /dev/null +++ b/code/studio/src/plugins/tile_editor/tile_item.cpp @@ -0,0 +1,422 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include + +#include "tile_item.h" + +#include + +Node::Node() : m_parentItem(0) +{ +} + +Node::Node(const QVector &data, Node *parent) +{ + m_parentItem = parent; + m_itemData = data; +} + +Node::~Node() +{ + qDeleteAll(m_childItems); + m_childItems.clear(); +} + +void Node::appendChild(Node *item) +{ + item->setParent( this ); + m_childItems.append(item); +} + +Node *Node::child(int row) +{ + //nlinfo("row %d and size %d", row, childItems.size()); + return m_childItems.value(row); +} + +int Node::childCount() const +{ + return m_childItems.count(); +} + +int Node::childNumber() const +{ + if(m_parentItem) + return m_parentItem->m_childItems.indexOf(const_cast(this)); + return 0; +} + +bool Node::insertChildren(int position, int count, int columns) +{ + if(position<0 || position>m_childItems.size()) + return false; + + for(int row = 0; row < count; row++) + { + QVector data(columns); + Node *item = new Node(data, this); + m_childItems.insert(position, item); + } + + return true; +} + +bool Node::removeChildren(int position, int count) +{ + if(position<0 || position+count>m_childItems.size()) + return false; + + for(int row=0; row m_itemData.size()) + return false; + + for(int column=0; columninsertColumns(position, columns); + + return true; +} + +int Node::row() const +{ + if(m_parentItem) + return m_parentItem->m_childItems.indexOf(const_cast(this)); + + return 0; +} + +int Node::columnCount() const +{ + return m_itemData.count(); +} + +QVariant Node::data(int column, int role) const +{ + if(role == Qt::DisplayRole || + role == TileModel::TileFilenameIndexRole || + role == TileModel::TileFilenameRole || + role == TileModel::TileIndexRole) + return m_itemData.value(column); + return QVariant(); +} + +bool Node::setData(int column, const QVariant &value) +{ + if(column < 0 || column >= m_itemData.size()) + return false; + + m_itemData[column] = value; + return true; +} + +Node *Node::parent() +{ + return m_parentItem; +} + +void Node::setParent(Node *parent) +{ + m_parentItem = parent; +} + +void Node::appendRow(const QList &items) +{ + Q_FOREACH(Node *item, items) + appendRow(item); +} + +void Node::appendRow(Node *item) +{ + item->setParent(this); + m_childItems.append(item); +} + +void Node::swapRows( int a, int b ) +{ + Node *temp = m_childItems[ a ]; + m_childItems[ a ] = m_childItems[ b ]; + m_childItems[ b ] = temp; +} + +void Node::clear() +{ + qDeleteAll( m_childItems ); + m_childItems.clear(); + m_itemData.clear(); +} + +/////////////////////////////////////////////////// + +TileSetNode::TileSetNode(QString tileSetName, Node *parent) : m_tileSetName(tileSetName) +{ + m_parentItem = parent; +} + +TileSetNode::~TileSetNode() +{ + qDeleteAll(m_childItems); + m_childItems.clear(); +} + +QVariant TileSetNode::data(int column, int role) const +{ + if(role == Qt::DisplayRole || + role == TileModel::TileFilenameIndexRole || + role == TileModel::TileFilenameRole || + role == TileModel::TileIndexRole) + return QVariant(m_tileSetName); + return QVariant(); +} + +int TileSetNode::columnCount() const +{ + return 1; +} + +/////////////////////////////////////////////////// + +TileTypeNode::TileTypeNode(TileConstants::TNodeTileType type, Node *parent) : m_nodeTileType(type) +{ + m_parentItem = parent; +} + +TileTypeNode::~TileTypeNode() +{ + qDeleteAll(m_childItems); + m_childItems.clear(); +} + +QVariant TileTypeNode::data(int column, int role) const +{ + if(role == Qt::DisplayRole || + role == TileModel::TileFilenameIndexRole || + role == TileModel::TileFilenameRole || + role == TileModel::TileIndexRole) + return QVariant(TileModel::getTileTypeName(m_nodeTileType)); + return QVariant(); + +} + +int TileTypeNode::columnCount() const +{ + return 1; +} + +TileConstants::TNodeTileType TileTypeNode::getTileType() +{ + return m_nodeTileType; +} + +bool TileTypeNode::removeChildren( int position, int count ) +{ + bool ok = Node::removeChildren( position, count ); + if( !ok ) + return false; + + reindex(); + + return true; +} + +void TileTypeNode::reindex() +{ + int i = 0; + + QListIterator< Node* > itr( m_childItems ); + while( itr.hasNext() ) + { + TileItemNode *n = dynamic_cast< TileItemNode* >( itr.next() ); + if( n == NULL ) + continue; + + n->setId( i ); + + i++; + } +} + + +/////////////////////////////////////////////////// + +class TileItemNodePvt +{ +public: + + TileItemNodePvt() + { + } + + bool loadImage( TileConstants::TTileChannel channel, const QString &fn ) + { + if( fn.isEmpty() ) + { + pixmaps[ channel ] = TileItemNodePvt::emptyPm(); + return true; + } + + QPixmap temp; + bool b = temp.load( fn ); + + if( !b ) + { + return false; + } + + pixmaps[ channel ] = temp; + + return true; + } + + static bool loadEmptyImage() + { + bool b = empty.load( ":/placeHolder/images/empty_image.png" ); + if( !b ) + { + empty = QPixmap(); + } + + return b; + } + + void clearImage( TileConstants::TTileChannel channel ) + { + pixmaps[ channel ] = QPixmap(); + } + + const QPixmap& pixMap( TileConstants::TTileChannel channel ) const{ + return pixmaps[ channel ]; + } + + static QPixmap& emptyPm(){ return empty; } + +private: + QPixmap pixmaps[ TileConstants::TileChannelCount ]; + static QPixmap empty; + +}; + +QPixmap TileItemNodePvt::empty = QPixmap(); +TileConstants::TTileChannel TileItemNode::s_displayChannel = TileConstants::TileDiffuse; + +TileItemNode::TileItemNode( TileConstants::TNodeTileType type, int tileId, Node *parent ) +{ + m_id = tileId; + m_parentItem = parent; + pvt = new TileItemNodePvt(); + + for( int i = 0; i < TileConstants::TileChannelCount; i++ ) + { + setTileFilename( TileConstants::TTileChannel( i ), "" ); + } +} + +TileItemNode::~TileItemNode() +{ + delete pvt; + pvt = NULL; + + qDeleteAll(m_childItems); +} + +bool TileItemNode::setTileFilename(TileConstants::TTileChannel channel, QString filename) +{ + bool b = pvt->loadImage( channel, filename ); + if( !b ) + return false; + + m_tileFilename[channel] = filename; + return true; +} + +QString TileItemNode::getTileFilename(TileConstants::TTileChannel channel) +{ + QMap< TileConstants::TTileChannel, QString >::const_iterator itr + = m_tileFilename.find( channel ); + if( itr == m_tileFilename.end() ) + return ""; + + return itr.value(); +} + +bool TileItemNode::loadEmptyPixmap() +{ + return TileItemNodePvt::loadEmptyImage(); +} + +QVariant TileItemNode::data(int column, int role) const +{ + QString tileFilename = m_tileFilename[ TileItemNode::s_displayChannel ]; + + if(role == TileModel::TilePixmapRole || role == Qt::DecorationRole) + { + TileTypeNode *parent = dynamic_cast(m_parentItem); + if(parent == NULL) + return QVariant(); + + // Retrieve the target tile size. + uint32 tileSize = TileModel::getTileTypeSize(parent->getTileType()); + + if(TileModel::CurrentZoomFactor == TileModel::TileZoom200) + tileSize *= 2; + else if(TileModel::CurrentZoomFactor == TileModel::TileZoom50) + tileSize /= 2; + + QPixmap pixmap = pvt->pixMap( TileItemNode::s_displayChannel ); + + pixmap = pixmap.scaled(tileSize, tileSize); + + return pixmap; + } + else if(role == Qt::DisplayRole) + { + return QVariant(tileFilename); + } + else if(role == TileModel::TileFilenameRole) + { + return QVariant(tileFilename); + } + else if(role == TileModel::TileIndexRole) + { + return QVariant("("+QString::number(m_id)+")"); + } + else if(role == TileModel::TileFilenameIndexRole) + { + return QVariant(tileFilename + " ("+QString::number(m_id)+")"); + } + + return QVariant(); +} + +int TileItemNode::columnCount() const +{ + return 1; +} + +QVariant TileItemNode::pixmap( TileConstants::TTileChannel channel ) const +{ + return pvt->pixMap( channel ); +} + diff --git a/code/studio/src/plugins/tile_editor/tile_item.h b/code/studio/src/plugins/tile_editor/tile_item.h new file mode 100644 index 000000000..5387a710d --- /dev/null +++ b/code/studio/src/plugins/tile_editor/tile_item.h @@ -0,0 +1,136 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef TILE_ITEM_H +#define TILE_ITEM_H + +#include "nel/misc/types_nl.h" + +#include +#include + +#include "tile_model.h" + +namespace NL3D +{ + class CTileBorder; +} + +class TileWidget; + +class Node +{ +public: + Node(); + Node(const QVector &data, Node *parent=0); + virtual ~Node(); + + void appendChild(Node *child); + + Node *child(int row); + int childCount() const; + int childNumber() const; + virtual int columnCount() const; + bool setData(int column, const QVariant &value); + virtual QVariant data(int column, int role) const; + + bool insertChildren(int position, int count, int columns); + virtual bool removeChildren(int position, int count); + bool insertColumns(int position, int columns); + + int row() const; + Node *parent(); + void setParent(Node *parent); + + void appendRow(const QList &items); + void appendRow(Node *item); + + void swapRows( int a, int b ); + + void clear(); + +protected: + QList m_childItems; + QVector m_itemData; + Node *m_parentItem; +}; + +class TileSetNode : public Node +{ +public: + TileSetNode(QString tileSetName, Node *parent=0); + virtual ~TileSetNode(); + QVariant data(int column, int role) const; + int columnCount() const; + + const QString &getTileSetName(){ return m_tileSetName; } + void setTileSetName( const QString &name ){ m_tileSetName = name; } + +private: + QString m_tileSetName; +}; + +class TileTypeNode : public Node +{ +public: + + TileTypeNode(TileConstants::TNodeTileType type, Node *parent=0); + virtual ~TileTypeNode(); + QVariant data(int column, int role) const; + int columnCount() const; + + TileConstants::TNodeTileType getTileType(); + + bool removeChildren( int position, int count ); + +private: + void reindex(); + TileConstants::TNodeTileType m_nodeTileType; +}; + +class TileItemNodePvt; + +class TileItemNode : public Node +{ +public: + TileItemNode( TileConstants::TNodeTileType type, int tileId, Node *parent=0); + virtual ~TileItemNode(); + QVariant data(int column, int role) const; + int columnCount() const; + bool setTileFilename(TileConstants::TTileChannel channel, QString filename); + QString getTileFilename(TileConstants::TTileChannel channel); + void setId( int id ){ m_id = id; } + int id() const{ return m_id; } + + static void setDisplayChannel( TileConstants::TTileChannel channel ){ s_displayChannel = channel; } + static TileConstants::TTileChannel displayChannel(){ return s_displayChannel; } + static bool loadEmptyPixmap(); + + QVariant pixmap( TileConstants::TTileChannel channel ) const; + +private: + QMap m_tileFilename; + QMap m_tileWidget; + + static TileConstants::TTileChannel s_displayChannel; + + int m_id; + + TileItemNodePvt *pvt; + +}; + +#endif // TILE_ITEM_H diff --git a/code/studio/src/plugins/tile_editor/tile_item_delegate.cpp b/code/studio/src/plugins/tile_editor/tile_item_delegate.cpp new file mode 100644 index 000000000..6f9479354 --- /dev/null +++ b/code/studio/src/plugins/tile_editor/tile_item_delegate.cpp @@ -0,0 +1,122 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include + +#include + +#include "tile_item_delegate.h" + +#include "tile_model.h" + +TileItemDelegate::TileItemDelegate() +{ + m_zoomFactor = ZoomNormal; + m_imageHint = 128; +} + +TileItemDelegate::~TileItemDelegate() +{ +} + +void TileItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const +{ + QStyledItemDelegate::paint(painter,option,index); + + painter->save(); + + QFont font = QApplication::font(); + + //font.setBold(true); + //SubFont.setWeight(SubFont.weight()-2); + QFontMetrics fm(font); + + QPixmap tile = qvariant_cast(index.data(TileModel::TilePixmapRole)); + QString tileFileText = qvariant_cast(index.data(TileModel::TileFilenameRole)); + QString tileIdText = qvariant_cast(index.data(TileModel::TileIndexRole)); + + QSize tileSize = tile.size(); + + //QRect headerRect = option.rect; + QRect rect(option.rect); + //QRect tileRect(option.rect); + int textHeight = fm.height(); + int iconPosModX = PIXMAP_MARGIN + (tile.width() / 2); + int iconPosModY = (option.rect.height() - tile.height()) / 2; + + painter->drawPixmap(rect.adjusted(iconPosModX, iconPosModY, iconPosModX, iconPosModY).topLeft(), tile); + + + + //tileRect.setRight(tileSize.width()+30); + //tileRect.setTop(tileRect.top()+5); + //headerRect.setLeft(tileRect.right()); + //subheaderRect.setLeft(tileRect.right()); + //headerRect.setTop(headerRect.top()+5); + //headerRect.setBottom(headerRect.top()+fm.height()); + + //subheaderRect.setTop(headerRect.bottom()+2); + + //painter->drawPixmap(targetrect, pixmap, sourcerect) + + //painter->drawPixmap(QPoint(iconRect.right()/2,iconRect.top()/2),icon.pixmap(iconsize.width(),iconsize.height())); + //painter->drawPixmap(QPoint(tileRect.left()+tileSize.width()/2+2,tileRect.top()+tileSize.height()/2+3),tile); + + //painter->setFont(font); + //painter->drawText(headerRect,headerText); + + + //painter->setFont(SubFont); + //painter->drawText(subheaderRect.left(),subheaderRect.top()+17,subText); + + painter->restore(); +} + +QSize TileItemDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index ) const +{ + QPixmap tile = qvariant_cast(index.data(TileModel::TilePixmapRole)); + QSize tileSize = tile.size(); + QFont font = QApplication::font(); + QFontMetrics fm(font); + + return(QSize(tileSize.width()+(2*PIXMAP_MARGIN), tileSize.height()+fm.height()+(2*PIXMAP_MARGIN))); +} + +TileItemDelegate::TZoomFactor TileItemDelegate::getZoomFactor() +{ + return m_zoomFactor; +} + +void TileItemDelegate::setZoomFactor(TileItemDelegate::TZoomFactor zoomFactor) +{ + m_zoomFactor = zoomFactor; +} + +// SLOTS + +void TileItemDelegate::currentTab(int index) +{ + if(index == 1) + { + nlinfo("switching delegate to 1 or 256"); + m_imageHint = 256; + } + else + { + nlinfo("switching delegate to 0,2,3 or 128"); + m_imageHint = 128; + } +} \ No newline at end of file diff --git a/code/studio/src/plugins/tile_editor/tile_item_delegate.h b/code/studio/src/plugins/tile_editor/tile_item_delegate.h new file mode 100644 index 000000000..015f32021 --- /dev/null +++ b/code/studio/src/plugins/tile_editor/tile_item_delegate.h @@ -0,0 +1,55 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . +#ifndef TILE_ITEM_DELEGATE_H +#define TILE_ITEM_DELEGATE_H + +#include +#include +#include + +#include + +class TileItemDelegate : public QStyledItemDelegate + { + public: + + enum TZoomFactor + { + ZoomSmall = 0, + ZoomNormal = 1, + ZoomLarge = 2 + }; + + static const int PIXMAP_MARGIN = 5; + + TileItemDelegate(); + virtual ~TileItemDelegate(); + + void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; + QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index ) const; + + TZoomFactor getZoomFactor(); + void setZoomFactor(TZoomFactor zoomFactor); + +public Q_SLOTS: + void currentTab(int index); + + private: + TZoomFactor m_zoomFactor; + int m_imageHint; + }; + +#endif // TILE_ITEM_DELEGATE_H diff --git a/code/studio/src/plugins/tile_editor/tile_model.cpp b/code/studio/src/plugins/tile_editor/tile_model.cpp new file mode 100644 index 000000000..2af4c6a84 --- /dev/null +++ b/code/studio/src/plugins/tile_editor/tile_model.cpp @@ -0,0 +1,564 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "tile_model.h" +#include "tile_item.h" +#include "tile_bank.h" + +#include + +#include + +// Initialize the static members +TileModel::TTileZoomFactor TileModel::CurrentZoomFactor; + +TileModel::TileModel(const QStringList &headers, QObject *parent) : QAbstractItemModel(parent) +{ + QVector rootData; + Q_FOREACH(QString header, headers) + rootData << header; + + rootItem = new Node(rootData); + + TileModel::CurrentZoomFactor = TileModel::TileZoom100; + m_indexDisplay = true; + m_fileDisplay = true; + + m_tileBank = new TileBank(); +} + +TileModel::~TileModel() +{ + delete rootItem; +} + +Node *TileModel::getItem(const QModelIndex &index) const +{ + if(index.isValid()) + { + Node *item = static_cast(index.internalPointer()); + if(item) return item; + } + return rootItem; +} + +QModelIndex TileModel::index(int row, int column, const QModelIndex &parent) const +{ + if(parent.isValid() && parent.column() != 0) + return QModelIndex(); + + Node *parentItem = getItem(parent); + + Node *childItem = parentItem->child(row); + if(childItem) + return createIndex(row, column, childItem); + else + return QModelIndex(); +} + +QModelIndex TileModel::parent(const QModelIndex &index) const +{ + if(!index.isValid()) + return QModelIndex(); + + Node *childItem = getItem(index); + Node *parentItem = childItem->parent(); + + if(parentItem == rootItem) + return QModelIndex(); + + return createIndex(parentItem->childNumber(), 0, parentItem); +} + +int TileModel::rowCount(const QModelIndex &parent) const +{ + Node *parentItem = getItem(parent); + return parentItem->childCount(); +} + +int TileModel::columnCount(const QModelIndex &parent) const +{ + Node *parentItem = getItem(parent); + return parentItem->columnCount(); +} + +QVariant TileModel::data(const QModelIndex &index, int role) const +{ + if(!index.isValid()) + return QVariant(); + + Node *item = static_cast(index.internalPointer()); + + // Translate the display role to the settings-specific role. + + if(role == Qt::DisplayRole) + { + if(m_indexDisplay && m_fileDisplay) + role = TileFilenameIndexRole; + else if(m_fileDisplay) + role = TileFilenameRole; + else if(m_indexDisplay) + role = TileIndexRole; + } + return item->data(index.column(), role); +} + +Qt::ItemFlags TileModel::flags(const QModelIndex &index) const +{ + if(!index.isValid()) + return Qt::ItemIsEnabled; + + return Qt::ItemIsEnabled|Qt::ItemIsSelectable; +} + +QVariant TileModel::headerData(int section, Qt::Orientation orientation, int role) const +{ + if(orientation == Qt::Horizontal && role == Qt::DisplayRole) + return rootItem->data(section,role); + + return QVariant(); +} + +void TileModel::appendRow(const QList &items) +{ + rootItem->appendRow(items); +} + + +void TileModel::appendRow(Node *item) +{ + int c = rootItem->childCount(); + + beginInsertRows( QModelIndex(), c, c ); + + rootItem->appendRow(item); + + endInsertRows(); +} + +bool TileModel::removeRows( int row, int count, const QModelIndex &parent ) +{ + Node *parentNode = NULL; + + if( !parent.isValid() ) + parentNode = rootItem; + else + parentNode = getItem( parent ); + + if( parentNode == NULL ) + return false; + + int c = parentNode->childCount(); + if( row + count > c ) + return false; + + beginRemoveRows( parent, row, row + count - 1 ); + + bool ok = parentNode->removeChildren( row, count ); + + endRemoveRows(); + + return ok; +} + +void TileModel::swapRows( int a, int b ) +{ + rootItem->swapRows( a, b ); +} + +TileSetNode *TileModel::createTileSetNode(QString tileSetName) +{ + // Create the new tile set. + TileSetNode *tileSet = new TileSetNode(tileSetName); + + // child for 128x128 tiles + TileTypeNode *tile128= new TileTypeNode( TileConstants::Tile128); + tileSet->appendRow(tile128); + + // child for 256x256 tiles + TileTypeNode *tile256= new TileTypeNode( TileConstants::Tile256); + tileSet->appendRow(tile256); + + // child for transition tiles. + TileTypeNode *tileTrans= new TileTypeNode( TileConstants::TileTransition); + tileSet->appendRow(tileTrans); + + // Add the default transition tiles. + // TODO tie this to CTileSet::count from NeL + for(int transPos=0; transPos<48; transPos++) + { + TileItemNode *transTile= new TileItemNode( TileConstants::TileTransition, transPos ); + tileTrans->appendRow(transTile); + } + + // child for displacement tiles + TileTypeNode *tileDisp= new TileTypeNode( TileConstants::TileDisplacement); + tileSet->appendRow(tileDisp); + + // Add the default displacement tiles. + // TODO tie this to CTileSet::CountDisplace from NeL + for(int dispPos=0; dispPos<16; dispPos++) + { + TileItemNode *dispTile= new TileItemNode( TileConstants::TileDisplacement, dispPos ); + tileDisp->appendRow(dispTile); + } + + // Append them in the correct order to the tile set. + this->appendRow(tileSet); + + return tileSet; +} + +const char *TileModel::getTileTypeName(TileConstants::TNodeTileType type) +{ + switch(type) + { + case TileConstants::Tile128: + return "128"; + case TileConstants::Tile256: + return "256"; + case TileConstants::TileTransition: + return "Transition"; + case TileConstants::TileDisplacement: + return "Displacement"; + default: + break; + } + return "UNKNOWN"; +} + +uint32 TileModel::getTileTypeSize(TileConstants::TNodeTileType type) +{ + switch(type) + { + case TileConstants::Tile128: + return 128; + case TileConstants::Tile256: + return 256; + case TileConstants::TileTransition: + return 64; + case TileConstants::TileDisplacement: + return 32; + default: + break; + } + return 0; +} + +bool TileModel::hasTileSet( const QString &name ) +{ + for( int i = 0; i < rowCount(); i++ ) + { + QModelIndex idx = index( i, 0 ); + if( !idx.isValid() ) + { + continue; + } + + TileSetNode *n = reinterpret_cast< TileSetNode* >( idx.internalPointer() ); + if( n->getTileSetName() == name ) + return true; + } + + return false; +} + +void TileModel::clear() +{ + int c = rootItem->childCount(); + if( c == 0 ) + return; + + removeRows( 0, c ); +} + +void TileModel::onTBLoaded() +{ + clear(); + loadTileSets(); +} + + +void TileModel::addLand( const QString &name ) +{ + m_tileBank->addLand( name ); +} + +void TileModel::removeLand( int idx ) +{ + m_tileBank->removeLand( idx ); +} + +void TileModel::getLands( QStringList &l ) +{ + m_tileBank->getLands( l ); +} + +void TileModel::setLandSets( int idx, const QStringList &l ) +{ + m_tileBank->setLandSets( idx, l ); +} + +void TileModel::getLandSets( int idx, QStringList &l ) +{ + m_tileBank->getLandSets( idx, l ); +} + + +bool TileModel::addTileSet( const QString &name ) +{ + m_tileBank->addTileSet( name ); + TileSetNode *tsn = createTileSetNode( name ); + + return false; +} + +void TileModel::removeTileSet( int idx ) +{ + TileSetNode *set = static_cast< TileSetNode* >( rootItem->child( idx ) ); + if( set == NULL ) + return; + + removeRow( idx ); + + m_tileBank->removeTileSet( idx ); +} + +void TileModel::renameTileSet( int idx, const QString &newName ) +{ + m_tileBank->renameTileSet( idx, newName ); +} + +bool TileModel::addTile( int ts, int type, const QString &fileName, TileConstants::TTileChannel channel ) +{ + TileSetNode *tsn = static_cast< TileSetNode* >( rootItem->child( ts ) ); + if( tsn == NULL ) + return false; + + TileTypeNode *ttn = static_cast< TileTypeNode* >( tsn->child( type ) ); + if( ttn == NULL ) + return false; + + int tile = ttn->childCount(); + + TileConstants::TNodeTileType t = TileConstants::TNodeTileType( type ); + + TileItemNode *item = new TileItemNode( t, tile ); + item->setTileFilename( channel, fileName ); + + bool b = m_tileBank->addTile( ts, fileName, item->pixmap( channel ), channel, t ); + if( !b ) + { + delete item; + return false; + } + + item->setParent( ttn ); + ttn->appendRow( item ); + + return true; +} + +void TileModel::removeTile( int ts, int type, int tile ) +{ + TileSetNode *set = static_cast< TileSetNode* >( rootItem->child( ts ) ); + if( set == NULL ) + return; + + TileTypeNode *typeNode = static_cast< TileTypeNode* >( set->child( type ) ); + if( typeNode == NULL ) + return; + + TileItemNode *tileNode = static_cast< TileItemNode* >( typeNode->child( tile ) ); + if( tileNode == NULL ) + return; + + QModelIndex tileIdx = createIndex( tile, 0, tileNode ); + removeRow( tile, tileIdx.parent() ); + + m_tileBank->removeTile( ts, type, tile ); +} + +bool TileModel::replaceImage( int ts, int type, int tile, TileConstants::TTileChannel channel, const QString &name ) +{ + Node *set = rootItem->child( ts ); + Node *tn = set->child( type ); + Node *n = tn->child( tile ); + + TileItemNode *tin = static_cast< TileItemNode* >( n ); + QString old = tin->getTileFilename( channel ); + + bool b = tin->setTileFilename( channel, name ); + if( !b ) + return false; + + m_tileBank->replaceImage( ts, type, tile, channel, name, tin->pixmap( channel ) ); + if( m_tileBank->hasError() ) + { + tin->setTileFilename( channel, old ); + return false; + } + + return true; +} + +void TileModel::clearImage( int ts, int type, int tile, TileConstants::TTileChannel channel ) +{ + Node *set = rootItem->child( ts ); + Node *tn = set->child( type ); + Node *n = tn->child( tile ); + + TileItemNode *tin = static_cast< TileItemNode* >( n ); + tin->setTileFilename( channel, "" ); + + m_tileBank->clearImage( ts, type, tile, channel ); +} + +void TileModel::setVegetation( int tileSet, const QString &vegetation ) +{ + m_tileBank->setVegetation( tileSet, vegetation ); +} + +QString TileModel::getVegetation( int tileSet ) const +{ + return m_tileBank->getVegetation( tileSet ); +} + +void TileModel::setOriented( int tileSet, bool b ) +{ + m_tileBank->setOriented( tileSet, b ); +} + +bool TileModel::getOriented( int tileSet ) const +{ + return m_tileBank->getOriented( tileSet ); +} + +void TileModel::setSurfaceData( int tileSet, unsigned long data ) +{ + m_tileBank->setSurfaceData( tileSet, data ); +} + +unsigned long TileModel::getSurfaceData( int tileSet ) const +{ + return m_tileBank->getSurfaceData( tileSet ); +} + +void TileModel::setTexturePath( const QString &path ) +{ + m_tileBank->setTexturePath( path ); +} + +void TileModel::serial( NLMISC::IStream &f ) +{ + m_tileBank->serial( f ); +} + +QString TileModel::getTexturePath() const +{ + return m_tileBank->getTexturePath(); +} + +void TileModel::setAlphaRot( int rotation ) +{ + m_tileBank->setRotation( rotation ); +} + +QString TileModel::getLastError() const{ + return m_tileBank->getLastError(); +} + +bool TileModel::hasError() const +{ + return m_tileBank->hasError(); +} + +void TileModel::selectFilenameDisplay(bool selected) +{ + m_fileDisplay = selected; +} + +void TileModel::selectIndexDisplay(bool selected) +{ + m_indexDisplay = selected; +} + +void TileModel::loadTileSets() +{ + QStringList l; + m_tileBank->getTileSets( l ); + + // Create tile sets + QStringListIterator itr( l ); + while( itr.hasNext() ) + { + createTileSetNode( itr.next() ); + } + + // Loads sets + int c = rootItem->childCount(); + for( int i = 0; i < c; i++ ) + { + loadTileSet( i ); + } +} + + +void TileModel::loadTileSet( int tileSet ) +{ + TileSetNode *set = static_cast< TileSetNode* >( rootItem->child( tileSet ) ); + + QList< TileImages > l; + for( int i = TileConstants::Tile128; i < TileConstants::TileNodeTypeCount; i++ ) + { + TileConstants::TNodeTileType type = TileConstants::TNodeTileType( i ); + l.clear(); + m_tileBank->getTileImages( tileSet, type, l ); + + loadTileTypeNode( tileSet, type, l ); + } +} + +void TileModel::loadTileTypeNode( int tileSet, int type, const QList< TileImages > &l ) +{ + TileSetNode *set = static_cast< TileSetNode* >( rootItem->child( tileSet ) ); + TileTypeNode *ttn = static_cast< TileTypeNode* >( set->child( type ) ); + + int tile = 0; + + QList< TileImages >::const_iterator itr = l.begin(); + while( itr != l.end() ) + { + const TileImages &images = *itr; + + TileItemNode *item = NULL; + + if( ( type == TileConstants::Tile128 ) || ( type == TileConstants::Tile256 ) ) + item = new TileItemNode( TileConstants::TNodeTileType( type ), tile, ttn ); + else + item = static_cast< TileItemNode* >( ttn->child( tile ) ); + + item->setTileFilename( TileConstants::TileDiffuse, images.diffuse ); + item->setTileFilename( TileConstants::TileAdditive, images.additive ); + item->setTileFilename( TileConstants::TileAlpha, images.alpha ); + + if( ( type == TileConstants::Tile128 ) || ( type == TileConstants::Tile256 ) ) + ttn->appendRow( item ); + + ++itr; + tile++; + } +} diff --git a/code/studio/src/plugins/tile_editor/tile_model.h b/code/studio/src/plugins/tile_editor/tile_model.h new file mode 100644 index 000000000..c6bfc8788 --- /dev/null +++ b/code/studio/src/plugins/tile_editor/tile_model.h @@ -0,0 +1,150 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef TILE_MODEL_H +#define TILE_MODEL_H + +#include "nel/misc/types_nl.h" + +#include + +#include "tile_constants.h" +#include "tile_images.h" + +namespace NLMISC +{ + class IStream; +} + +class Node; +class TileSetNode; +class TileItemNode; +class TileBank; +class TileModelPvt; + +class TileModel : public QAbstractItemModel +{ + Q_OBJECT + +public: + enum TTileItemRole + { + TilePixmapRole = Qt::UserRole+1, + TileFilenameRole = Qt::UserRole+2, + TileIndexRole = Qt::UserRole+3, + TileFilenameIndexRole = Qt::UserRole+4 + }; + + enum TTileZoomFactor + { + TileZoom50 = 0, + TileZoom100 = 1, + TileZoom200 = 2 + }; + + static const int TILE_DISPLACE_BASE_SIZE = 32; + static const int TILE_TRANSITION_BASE_SIZE = 64; + static const int TILE_128_BASE_SIZE = 128; + static const int TILE_256_BASE_SIZE = 256; + + TileModel(const QStringList &headers, QObject *parent = NULL); + ~TileModel(); + + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + Qt::ItemFlags flags(const QModelIndex &index) const; + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; + QModelIndex index(int row, int column, const QModelIndex &parent= QModelIndex()) const; + QModelIndex parent(const QModelIndex &index) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const; + int columnCount(const QModelIndex &parent = QModelIndex()) const; + + // Tile Model specific functions + void appendRow(const QList &items); + void appendRow(Node *item); + + bool removeRows( int row, int count, const QModelIndex &parent = QModelIndex() ); + + void swapRows( int a, int b ); + + static const char *getTileTypeName(TileConstants::TNodeTileType type); + static uint32 getTileTypeSize(TileConstants::TNodeTileType type); + + static TTileZoomFactor CurrentZoomFactor; + + bool hasTileSet( const QString &name ); + + void clear(); + void onTBLoaded(); + + void addLand( const QString &name ); + void removeLand( int idx ); + void getLands( QStringList &l ); + + bool addTileSet( const QString &name ); + + void removeTileSet( int idx ); + void renameTileSet( int idx, const QString &newName ); + void setLandSets( int idx, const QStringList &l ); + void getLandSets( int idx, QStringList &l ); + + bool addTile( int ts, int type, const QString &fileName, TileConstants::TTileChannel channel ); + void removeTile( int ts, int type, int tile ); + bool replaceImage( int ts, int type, int tile, TileConstants::TTileChannel channel, const QString &name ); + void clearImage( int ts, int type, int tile, TileConstants::TTileChannel channel ); + + void setVegetation( int tileSet, const QString &vegetation ); + QString getVegetation( int tileSet ) const; + + void setOriented( int tileSet, bool b ); + bool getOriented( int tileSet ) const; + + void setSurfaceData( int tileSet, unsigned long data ); + unsigned long getSurfaceData( int tileSet ) const; + + void setTexturePath( const QString &path ); + QString getTexturePath() const; + + void setAlphaRot( int rotation ); + + void serial( NLMISC::IStream &f ); + + QString getLastError() const; + bool hasError() const; + +public Q_SLOTS: + void selectFilenameDisplay(bool selected); + void selectIndexDisplay(bool selected); + +private: + TileSetNode *createTileSetNode(QString tileSetName); + Node *getItem(const QModelIndex &index) const; + void loadTileSets(); + void loadTileSet( int tileSet ); + void loadTileTypeNode( int tileSet, int type, const QList< TileImages > &l ); + + bool m_fileDisplay; + bool m_indexDisplay; + //TTileZoomFactor m_tileZoomFactor; + + //QList m_tiles; + //int m_activeEditChannel; + Node *rootItem; + + TileBank *m_tileBank; + TileModelPvt *pvt; +}; + +#endif // TILE_MODEL_H diff --git a/code/studio/src/plugins/tile_editor/tilebank_loader.cpp b/code/studio/src/plugins/tile_editor/tilebank_loader.cpp new file mode 100644 index 000000000..ceae137cc --- /dev/null +++ b/code/studio/src/plugins/tile_editor/tilebank_loader.cpp @@ -0,0 +1,42 @@ +// Ryzom Core Studio - Tile Editor plugin +// 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 "tilebank_loader.h" + +#include "tile_model.h" +#include "nel/misc/file.h" + +TileBankLoader::TileBankLoader() +{ +} + +TileBankLoader::~TileBankLoader() +{ +} + +bool TileBankLoader::load( const char *filename, TileModel *model ) +{ + NLMISC::CIFile file; + if( !file.open( filename, false ) ) + return false; + + model->serial( file ); + + file.close(); + + return true; +} diff --git a/code/nel/src/misc/input_device.cpp b/code/studio/src/plugins/tile_editor/tilebank_loader.h similarity index 74% rename from code/nel/src/misc/input_device.cpp rename to code/studio/src/plugins/tile_editor/tilebank_loader.h index 3825935a6..6f41234ba 100644 --- a/code/nel/src/misc/input_device.cpp +++ b/code/studio/src/plugins/tile_editor/tilebank_loader.h @@ -1,4 +1,4 @@ -// NeL - MMORPG Framework +// Ryzom Core Studio - Tile Editor plugin // Copyright (C) 2010 Winch Gate Property Limited // // This program is free software: you can redistribute it and/or modify @@ -14,18 +14,22 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -#include "stdmisc.h" -#include "nel/misc/input_device.h" +#ifndef TILEBANK_LOADER_H +#define TILEBANK_LOADER_H -// remove stupid VC6 warnings -void foo_input_device_cpp() {} +class TileModel; -#ifdef DEBUG_NEW - #define new DEBUG_NEW -#endif - -namespace NLMISC +class TileBankLoader { +public: + TileBankLoader(); + ~TileBankLoader(); + + bool load( const char *filename, TileModel *model ); +private: +}; + + +#endif -} // NLMISC diff --git a/code/studio/src/plugins/tile_editor/tilebank_saver.cpp b/code/studio/src/plugins/tile_editor/tilebank_saver.cpp new file mode 100644 index 000000000..85c96ee94 --- /dev/null +++ b/code/studio/src/plugins/tile_editor/tilebank_saver.cpp @@ -0,0 +1,48 @@ +// Ryzom Core Studio - Tile Editor plugin +// 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 "tilebank_saver.h" +#include "tile_model.h" +#include "tile_item.h" + +#include "nel/3d/tile_bank.h" +#include "nel/misc/file.h" + +TileBankSaver::TileBankSaver() +{ +} + +TileBankSaver::~TileBankSaver() +{ +} + +bool TileBankSaver::save( const char *fileName, TileModel* model ) +{ + // Save to file + NLMISC::COFile f; + bool b = f.open( fileName, false, false, false ); + if( !b ) + return false; + + model->serial( f ); + + f.flush(); + f.close(); + + return true; +} + diff --git a/code/nel/src/misc/game_device_events.cpp b/code/studio/src/plugins/tile_editor/tilebank_saver.h similarity index 72% rename from code/nel/src/misc/game_device_events.cpp rename to code/studio/src/plugins/tile_editor/tilebank_saver.h index bf64a1c4b..ba9c3c7fd 100644 --- a/code/nel/src/misc/game_device_events.cpp +++ b/code/studio/src/plugins/tile_editor/tilebank_saver.h @@ -1,4 +1,4 @@ -// NeL - MMORPG Framework +// Ryzom Core Studio - Tile Editor plugin // Copyright (C) 2010 Winch Gate Property Limited // // This program is free software: you can redistribute it and/or modify @@ -14,20 +14,26 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -#include "stdmisc.h" -#include "nel/misc/game_device_events.h" +#ifndef TILEBANK_SAVER_H +#define TILEBANK_SAVER_H -#ifdef DEBUG_NEW - #define new DEBUG_NEW -#endif +#include +#include -namespace NLMISC -{ +class TileModel; -void dummyToAvoidStupidCompilerWarning_game_device_events_cpp() +class TileBankSaver { - -} +public: + TileBankSaver(); + ~TileBankSaver(); + + bool save( const char *filename, TileModel* model ); + +private: + +}; + +#endif -} // NLMISC diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/CMakeLists.txt b/code/studio/src/plugins/translation_manager/CMakeLists.txt similarity index 57% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/CMakeLists.txt rename to code/studio/src/plugins/translation_manager/CMakeLists.txt index 1d96ebc77..b35c64735 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/CMakeLists.txt +++ b/code/studio/src/plugins/translation_manager/CMakeLists.txt @@ -17,6 +17,7 @@ SET(OVQT_PLUG_TRANSLATION_MANAGER_HDR translation_manager_plugin.h ftp_selection.h editor_worksheet.h editor_phrase.h + uxt_editor.h ) SET(OVQT_PLUG_TRANSLATION_MANAGER_UIS translation_manager_settings_page.ui @@ -38,29 +39,29 @@ SOURCE_GROUP(QtGeneratedMocSrc FILES ${OVQT_PLUG_TRANSLATION_MANAGER_MOC_SRC}) SOURCE_GROUP("Translation Manager Plugin" FILES ${SRC}) SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) -ADD_LIBRARY(ovqt_plugin_translation_manager MODULE ${SRC} ${OVQT_PLUG_TRANSLATION_MANAGER_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUG_TRANSLATION_MANAGER_UI_HDRS}) +ADD_LIBRARY(studio_plugin_translation_manager MODULE ${SRC} ${OVQT_PLUG_TRANSLATION_MANAGER_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUG_TRANSLATION_MANAGER_UI_HDRS}) -TARGET_LINK_LIBRARIES(ovqt_plugin_translation_manager ovqt_plugin_core nelmisc nelligo nelgeorges ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY} ${QT_QTNETWORK_LIBRARY} ) +TARGET_LINK_LIBRARIES(studio_plugin_translation_manager studio_plugin_core nelmisc nelligo nelgeorges ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY} ${QT_QTNETWORK_LIBRARY} ) -NL_DEFAULT_PROPS(ovqt_plugin_translation_manager "NeL, Tools, 3D: Object Viewer Qt Plugin: Translation Manager") -NL_ADD_RUNTIME_FLAGS(ovqt_plugin_translation_manager) -NL_ADD_LIB_SUFFIX(ovqt_plugin_translation_manager) +NL_DEFAULT_PROPS(studio_plugin_translation_manager "Tools: Studio Plugin: Translation Manager") +NL_ADD_RUNTIME_FLAGS(studio_plugin_translation_manager) +NL_ADD_LIB_SUFFIX(studio_plugin_translation_manager) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) IF(WIN32) IF(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_translation_manager LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_translation_manager LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) ELSE(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_translation_manager LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_translation_manager LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) ENDIF(WITH_INSTALL_LIBRARIES) ELSE(WIN32) IF(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_translation_manager LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_translation_manager LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) ELSE(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_translation_manager LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_translation_manager LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) ENDIF(WITH_INSTALL_LIBRARIES) ENDIF(WIN32) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_translation_manager.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/studio_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/README b/code/studio/src/plugins/translation_manager/README similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/README rename to code/studio/src/plugins/translation_manager/README diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/editor_phrase.cpp b/code/studio/src/plugins/translation_manager/editor_phrase.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/editor_phrase.cpp rename to code/studio/src/plugins/translation_manager/editor_phrase.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/editor_phrase.h b/code/studio/src/plugins/translation_manager/editor_phrase.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/editor_phrase.h rename to code/studio/src/plugins/translation_manager/editor_phrase.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/editor_worksheet.cpp b/code/studio/src/plugins/translation_manager/editor_worksheet.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/editor_worksheet.cpp rename to code/studio/src/plugins/translation_manager/editor_worksheet.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/editor_worksheet.h b/code/studio/src/plugins/translation_manager/editor_worksheet.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/editor_worksheet.h rename to code/studio/src/plugins/translation_manager/editor_worksheet.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/extract_bot_names.cpp b/code/studio/src/plugins/translation_manager/extract_bot_names.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/extract_bot_names.cpp rename to code/studio/src/plugins/translation_manager/extract_bot_names.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/extract_bot_names.h b/code/studio/src/plugins/translation_manager/extract_bot_names.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/extract_bot_names.h rename to code/studio/src/plugins/translation_manager/extract_bot_names.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/extract_new_sheet_names.cpp b/code/studio/src/plugins/translation_manager/extract_new_sheet_names.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/extract_new_sheet_names.cpp rename to code/studio/src/plugins/translation_manager/extract_new_sheet_names.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/extract_new_sheet_names.h b/code/studio/src/plugins/translation_manager/extract_new_sheet_names.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/extract_new_sheet_names.h rename to code/studio/src/plugins/translation_manager/extract_new_sheet_names.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/ftp_selection.cpp b/code/studio/src/plugins/translation_manager/ftp_selection.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/ftp_selection.cpp rename to code/studio/src/plugins/translation_manager/ftp_selection.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/ftp_selection.h b/code/studio/src/plugins/translation_manager/ftp_selection.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/ftp_selection.h rename to code/studio/src/plugins/translation_manager/ftp_selection.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/ftp_selection.qrc b/code/studio/src/plugins/translation_manager/ftp_selection.qrc similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/ftp_selection.qrc rename to code/studio/src/plugins/translation_manager/ftp_selection.qrc diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/ftp_selection.ui b/code/studio/src/plugins/translation_manager/ftp_selection.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/ftp_selection.ui rename to code/studio/src/plugins/translation_manager/ftp_selection.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/images/cdtoparent.png b/code/studio/src/plugins/translation_manager/images/cdtoparent.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/images/cdtoparent.png rename to code/studio/src/plugins/translation_manager/images/cdtoparent.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/images/dir.png b/code/studio/src/plugins/translation_manager/images/dir.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/images/dir.png rename to code/studio/src/plugins/translation_manager/images/dir.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/images/file.png b/code/studio/src/plugins/translation_manager/images/file.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/images/file.png rename to code/studio/src/plugins/translation_manager/images/file.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/source_selection.cpp b/code/studio/src/plugins/translation_manager/source_selection.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/source_selection.cpp rename to code/studio/src/plugins/translation_manager/source_selection.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/source_selection.h b/code/studio/src/plugins/translation_manager/source_selection.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/source_selection.h rename to code/studio/src/plugins/translation_manager/source_selection.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/source_selection.ui b/code/studio/src/plugins/translation_manager/source_selection.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/source_selection.ui rename to code/studio/src/plugins/translation_manager/source_selection.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/ovqt_plugin_translation_manager.xml b/code/studio/src/plugins/translation_manager/studio_plugin_translation_manager.xml similarity index 76% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/ovqt_plugin_translation_manager.xml rename to code/studio/src/plugins/translation_manager/studio_plugin_translation_manager.xml index c5574777a..261fbe65a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/ovqt_plugin_translation_manager.xml +++ b/code/studio/src/plugins/translation_manager/studio_plugin_translation_manager.xml @@ -1,5 +1,5 @@ - ovqt_plugin_translation_manager + studio_plugin_translation_manager TranslationManager 0.8 Ryzom Core diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_constants.h b/code/studio/src/plugins/translation_manager/translation_manager_constants.h similarity index 94% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_constants.h rename to code/studio/src/plugins/translation_manager/translation_manager_constants.h index d72a2b223..7ff813d40 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_constants.h +++ b/code/studio/src/plugins/translation_manager/translation_manager_constants.h @@ -21,8 +21,9 @@ namespace TranslationManager { namespace Constants { -const int ED_SHEET = 1; +const int ED_SHEET = 1; const int ED_PHRASE = 2; +const int ED_UXT = 3; const char *const WK_BOTNAMES = "bot_names_wk.txt"; const char *const WK_ITEM = "item_words_wk.txt"; @@ -32,6 +33,7 @@ const char *const WK_SPHRASE = "sphrase_words_wk.txt"; const char *const WK_PLACE = "place_words_wk.txt"; const char *const WK_CONTINENT = "place_words_wk.txt"; const char *const WK_STABLE = "place_words_wk.txt"; +const char *const WK_UXT = "wk.uxt"; } } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_editor.h b/code/studio/src/plugins/translation_manager/translation_manager_editor.h similarity index 91% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_editor.h rename to code/studio/src/plugins/translation_manager/translation_manager_editor.h index fd53ba863..3ded2c3af 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_editor.h +++ b/code/studio/src/plugins/translation_manager/translation_manager_editor.h @@ -32,8 +32,8 @@ class CEditor : public QMdiSubWindow Q_OBJECT public: - CEditor(QMdiArea *parent) : QMdiSubWindow(parent) {} - CEditor() : QMdiSubWindow() {} + CEditor(QMdiArea *parent) : QMdiSubWindow(parent) { current_stack = NULL; } + CEditor() : QMdiSubWindow() { current_stack = NULL; } virtual void open(QString filename) =0; virtual void save() =0; virtual void saveAs(QString filename) =0; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_main_window.cpp b/code/studio/src/plugins/translation_manager/translation_manager_main_window.cpp similarity index 93% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_main_window.cpp rename to code/studio/src/plugins/translation_manager/translation_manager_main_window.cpp index 9fcb9626a..c5228fae6 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_main_window.cpp +++ b/code/studio/src/plugins/translation_manager/translation_manager_main_window.cpp @@ -41,16 +41,20 @@ #include #include +#include "uxt_editor.h" + namespace TranslationManager { CMainWindow::CMainWindow(QWidget *parent) : QMainWindow(parent) { + menu = NULL; _ui.setupUi(this); _ui.mdiArea->closeAllSubWindows(); windowMapper = new QSignalMapper(this); + m_UXTMapper = new QSignalMapper(this); connect(windowMapper, SIGNAL(mapped(QWidget *)), this, SLOT(setActiveSubWindow(QWidget *))); initialize_settings["georges"] = false; @@ -59,10 +63,53 @@ CMainWindow::CMainWindow(QWidget *parent) connect(Core::ICore::instance(), SIGNAL(changeSettings()), this, SLOT(readSettings())); readSettings(); createToolbar(); + createMenus(); m_undoStack = new QUndoStack(this); } +CMainWindow::~CMainWindow() +{ + removeMenus(); +} + +void CMainWindow::removeMenus() +{ + delete menu; + menu = NULL; +} + +void CMainWindow::createMenus() +{ + // Windows menu + Core::MenuManager *menuManager = Core::ICore::instance()->menuManager(); + QMenu *m = menuManager->menuBar()->addMenu( "Translation Manager" ); + if( m != NULL ) + { + windowMenu = m->addMenu("Window"); + + QMenu *mm = m->addMenu( "UI translation" ); + if( mm != NULL ) + { + QStringListIterator itr( languages ); + while( itr.hasNext() ) + { + QString lang = itr.next(); + QAction *a = mm->addAction( lang ); + connect( a, SIGNAL( triggered() ), m_UXTMapper, SLOT( map() ) ); + m_UXTMapper->setMapping( a, lang ); + } + + connect( m_UXTMapper, SIGNAL( mapped( QString ) ), this, SLOT( onUxtMapped( QString ) ) ); + } + + menu = m; + } + + updateWindowsList(); + connect(windowMenu, SIGNAL(aboutToShow()), this, SLOT(updateWindowsList())); +} + // Functions that will insert the plugin buttons void CMainWindow::createToolbar() { @@ -126,12 +173,8 @@ void CMainWindow::createToolbar() mergeSingleFileAct->setStatusTip(tr("Merge worksheet file from local or remote directory")); connect(mergeSingleFileAct, SIGNAL(triggered()), this, SLOT(mergeSingleFile())); - // Windows menu Core::ICore *core = Core::ICore::instance(); Core::MenuManager *menuManager = core->menuManager(); - windowMenu = menuManager->menuBar()->addMenu("Window"); - updateWindowsList(); - connect(windowMenu, SIGNAL(aboutToShow()), this, SLOT(updateWindowsList())); // Undo, Redo actions QAction *undoAction = menuManager->action(Core::Constants::UNDO); @@ -256,6 +299,7 @@ void CMainWindow::openWorkFile(QString file) if(isWorksheetEditor(file_path->filePath())) { CEditorWorksheet *new_window = new CEditorWorksheet(_ui.mdiArea); + new_window->setUndoStack( m_undoStack ); new_window->open(file_path->filePath()); new_window->activateWindow(); } @@ -519,6 +563,20 @@ void CMainWindow::mergeSingleFile() } } +void CMainWindow::onUxtMapped( QString lang ) +{ + QString path = translation_path + "/" + lang + ".uxt"; + path.replace( "\\", "/" ); + + if( getEditorByWindowFilePath( path ) != NULL ) + return; + + UXTEditor *e = new UXTEditor(); + e->open( path ); + _ui.mdiArea->addSubWindow( e ); + e->activateWindow(); +} + // Read the settings from QSettings void CMainWindow::readSettings() { @@ -533,7 +591,7 @@ void CMainWindow::readSettings() // core settings settings->beginGroup(Core::Constants::DATA_PATH_SECTION); level_design_path = settings->value(Core::Constants::LEVELDESIGN_PATH).toString(); - primitives_path = QString(Core::Constants::PRIMITIVES_PATH); //TODO + primitives_path = settings->value( Core::Constants::PRIMITIVES_PATH ).toString(); settings->endGroup(); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_main_window.h b/code/studio/src/plugins/translation_manager/translation_manager_main_window.h similarity index 96% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_main_window.h rename to code/studio/src/plugins/translation_manager/translation_manager_main_window.h index c67f282e0..34f60ff19 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_main_window.h +++ b/code/studio/src/plugins/translation_manager/translation_manager_main_window.h @@ -58,7 +58,7 @@ class CMainWindow : public QMainWindow public: CMainWindow(QWidget *parent = 0); - virtual ~CMainWindow() {} + ~CMainWindow(); QUndoStack *m_undoStack; public: @@ -71,6 +71,7 @@ private: QAction *saveAsAct; QMenu *windowMenu; QSignalMapper *windowMapper; + QSignalMapper *m_UXTMapper; // config QMap initialize_settings; QList filters; @@ -90,12 +91,14 @@ private Q_SLOTS: void setActiveSubWindow(QWidget *window); void updateWindowsList(); void mergeSingleFile(); + void onUxtMapped( QString lang ); private: void openWorkFile(QString file); void updateToolbar(QMdiSubWindow *window); bool verifySettings(); void readSettings(); + void removeMenus(); void createMenus(); void createToolbar(); void initializeSettings(bool georges); @@ -105,6 +108,9 @@ private: CEditorWorksheet *getEditorByWorksheetType(const QString &type); bool isWorksheetEditor(QString filename); bool isPhraseEditor(QString filename); + + + QMenu *menu; }; class CCoreListener : public Core::ICoreListener diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_main_window.ui b/code/studio/src/plugins/translation_manager/translation_manager_main_window.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_main_window.ui rename to code/studio/src/plugins/translation_manager/translation_manager_main_window.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_plugin.cpp b/code/studio/src/plugins/translation_manager/translation_manager_plugin.cpp similarity index 96% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_plugin.cpp rename to code/studio/src/plugins/translation_manager/translation_manager_plugin.cpp index 20359ccbd..3fafc7510 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_plugin.cpp +++ b/code/studio/src/plugins/translation_manager/translation_manager_plugin.cpp @@ -48,6 +48,9 @@ TranslationManagerPlugin::~TranslationManagerPlugin() } qDeleteAll(_autoReleaseObjects); _autoReleaseObjects.clear(); + + delete _LibContext; + _LibContext = NULL; } bool TranslationManagerPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_plugin.h b/code/studio/src/plugins/translation_manager/translation_manager_plugin.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_plugin.h rename to code/studio/src/plugins/translation_manager/translation_manager_plugin.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_settings_page.cpp b/code/studio/src/plugins/translation_manager/translation_manager_settings_page.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_settings_page.cpp rename to code/studio/src/plugins/translation_manager/translation_manager_settings_page.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_settings_page.h b/code/studio/src/plugins/translation_manager/translation_manager_settings_page.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_settings_page.h rename to code/studio/src/plugins/translation_manager/translation_manager_settings_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_settings_page.ui b/code/studio/src/plugins/translation_manager/translation_manager_settings_page.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_settings_page.ui rename to code/studio/src/plugins/translation_manager/translation_manager_settings_page.ui diff --git a/code/studio/src/plugins/translation_manager/uxt_editor.cpp b/code/studio/src/plugins/translation_manager/uxt_editor.cpp new file mode 100644 index 000000000..06e6f98b4 --- /dev/null +++ b/code/studio/src/plugins/translation_manager/uxt_editor.cpp @@ -0,0 +1,472 @@ +// Ryzom Core Studio - Translation Manager Plugin +// 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 "translation_manager_constants.h" +#include "uxt_editor.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "nel/misc/diff_tool.h" +#include "nel/misc/i18n.h" + +namespace +{ + +QString getLang( const QString &fn ) +{ + QString lang = fn; + int idx = lang.lastIndexOf( '/' ); + if( idx == -1 ) + return ""; + + lang = lang.mid( idx + 1 ); + idx = lang.lastIndexOf( '.' ); + if( idx == -1 ) + return ""; + + lang = lang.left( idx ); + return lang; +} + +} + +namespace TranslationManager +{ + +void markItemTranslated( QTableWidgetItem *item ) +{ + item->setBackground( QColor::fromRgb( 126, 247, 134 ) ); +} + +void markItemUntranslated( QTableWidgetItem *item ) +{ + item->setBackground( QColor::fromRgb( 247, 126, 126 ) ); +} + +class UXTEditorPvt +{ +public: + + UXTEditorPvt() + { + t = new QTableWidget(); + loadedFromWK = false; + } + + QTableWidget *t; + std::vector< STRING_MANAGER::TStringInfo > infos; + bool loadedFromWK; +}; + + +UXTEditor::UXTEditor( QMdiArea *parent ) : +CEditor( parent ) +{ + editor_type = Constants::ED_UXT; + setAttribute( Qt::WA_DeleteOnClose ); + + d_ptr = new UXTEditorPvt(); + + blockTableSignals( false ); +} + +UXTEditor::~UXTEditor() +{ + delete d_ptr; + d_ptr = NULL; +} + +void UXTEditor::open( QString filename ) +{ + std::vector< STRING_MANAGER::TStringInfo > &infos = d_ptr->infos; + QString lang = getLang( filename ); + + infos.clear(); + STRING_MANAGER::loadStringFile( filename.toUtf8().constData(), infos, false ); + + if( d_ptr->infos.size() == 0 ) + { + // The work file cannot be found, cannot proceed + if( filename.endsWith( "wk.uxt" ) ) + { + QMessageBox::critical( this, + tr( "Error opening file.." ), + tr( "There was an error opening wk.uxt" ) ); + return; + } + + int l = filename.lastIndexOf( "/" ); + if( l == -1 ) + return; + + QString fn = filename.left( l ); + fn += "/wk.uxt"; + + // The work file cannot be found, cannot proceed + STRING_MANAGER::loadStringFile( fn.toUtf8().constData(), infos, true ); + if( d_ptr->infos.size() == 0 ) + { + QMessageBox::critical( this, + tr( "Error opening Uxt file" ), + tr( "Neither the specified file nor wk.uxt could be opened." ) ); + return; + } + + d_ptr->loadedFromWK = true; + } + + blockTableSignals( true ); + + d_ptr->t->clear(); + d_ptr->t->setColumnCount( 2 ); + d_ptr->t->setRowCount( infos.size() ); + + setHeaderText( "Id", lang.toUpper() + " Text" ); + + int i = 0; + + std::vector< STRING_MANAGER::TStringInfo >::const_iterator itr = infos.begin(); + while( itr != infos.end() ) + { + const STRING_MANAGER::TStringInfo &info = *itr; + + QTableWidgetItem *name = new QTableWidgetItem( info.Identifier.c_str() ); + QTableWidgetItem *text1 = new QTableWidgetItem( info.Text.toUtf8().c_str() ); + + d_ptr->t->setItem( i, 0, name ); + d_ptr->t->setItem( i, 1, text1 ); + + if( ( info.HashValue != 0 ) && !d_ptr->loadedFromWK ) + { + markItemTranslated( name ); + markItemTranslated( text1 ); + } + else + { + markItemUntranslated( name ); + markItemUntranslated( text1 ); + } + + ++itr; + i++; + } + + d_ptr->t->resizeColumnsToContents(); + + blockTableSignals( false ); + + setWidget( d_ptr->t ); + + current_file = filename; + setWindowTitle( filename + "[*]" ); + setWindowFilePath( filename ); +} + +void UXTEditor::save() +{ + saveAs( current_file ); +} + +void UXTEditor::saveAs( QString filename ) +{ + QFile f( filename ); + if( !f.open( QIODevice::WriteOnly ) ) + return; + + QTextStream out( &f ); + + int idx = 0; + std::vector< STRING_MANAGER::TStringInfo >::const_iterator itr = d_ptr->infos.begin(); + while( itr != d_ptr->infos.end() ) + { + uint64 hash = 0; + + // If text2 is not empty we can assume the string was translated, so we store with the correct hash + // If text2 is empty, it wasn't translated so we can just use the old hash. + // Additionally, if the strings were loaded from the wk.uxt file, we use a hash of 0 so we know it was not translated + if( itr->Text2.empty() ) + { + if( d_ptr->loadedFromWK ) + hash = 0; + else + hash = itr->HashValue; + } + else + { + hash = NLMISC::CI18N::makeHash( itr->Text2 ); + } + + QString hashLine = "// HASH_VALUE "; + hashLine += QString( NLMISC::CI18N::hashToString( hash ).c_str() ).toUpper(); + hashLine += "\r\n"; + + QString idxLine = "// INDEX "; + idxLine += QString::number( idx ); + idxLine += "\r\n"; + + + QString trLine = ""; + trLine += itr->Identifier.c_str(); + trLine += "\t"; + trLine += "["; + + if( itr->Text2.empty() ) + trLine += itr->Text.toUtf8().c_str(); + else + trLine += itr->Text2.toUtf8().c_str(); + + trLine += "]"; + trLine += "\r\n"; + + QString newLine = "\r\n"; + + out << hashLine; + out << idxLine; + out << trLine; + out << newLine; + + ++itr; + idx++; + } + + f.close(); + + setWindowModified( false ); +} + +void UXTEditor::activateWindow() +{ + showMaximized(); +} + + +void UXTEditor::insertRow() +{ + blockTableSignals( true ); + + d_ptr->infos.push_back( STRING_MANAGER::TStringInfo() ); + d_ptr->t->setRowCount( d_ptr->t->rowCount() + 1 ); + int row = d_ptr->t->rowCount() - 1; + + QTableWidgetItem *item1 = new QTableWidgetItem(); + QTableWidgetItem *item2 = new QTableWidgetItem(); + d_ptr->t->setItem( row, 0, item1 ); + d_ptr->t->setItem( row, 1, item2 ); + + markRowUntranslated( row ); + + setWindowModified( true ); + + blockTableSignals( false ); +} + + +void UXTEditor::deleteRow() +{ + int r = d_ptr->t->currentRow(); + if( r < 0 ) + return; + + int answer = QMessageBox::question( this, + tr( "Deleting a row" ), + tr( "Are you sure you want to delete this row?" ), + QMessageBox::Yes, + QMessageBox::Cancel ); + if( QMessageBox::Yes != answer ) + return; + + std::vector< STRING_MANAGER::TStringInfo >::iterator itr = d_ptr->infos.begin(); + itr += r; + d_ptr->infos.erase( itr ); + + d_ptr->t->removeRow( r ); + + setWindowModified( true ); +} + +void UXTEditor::closeEvent( QCloseEvent *e ) +{ + if( isWindowModified() ) + { + int reply = QMessageBox::question( this, + tr( "Table changed" ), + tr( "The table has changed. Would you like to save your changes?" ), + QMessageBox::Yes, + QMessageBox::No + ); + + if( reply == QMessageBox::Yes ) + save(); + + } + + e->accept(); + close(); +} + +void UXTEditor::contextMenuEvent( QContextMenuEvent *e ) +{ + QMenu *menu = new QMenu( this ); + QAction *insertAction = new QAction( "Insert row", menu ); + QAction *deleteAction = new QAction( "Delete row", menu ); + QAction *markAction = new QAction( "Mark translated", menu ); + QAction *unmarkAction = new QAction( "Mark not-translated", menu ); + QAction *saveAction = new QAction( "Save", menu ); + QAction *saveAsAction = new QAction( "Save as..", menu ); + + connect( insertAction, SIGNAL( triggered( bool ) ), this, SLOT( insertRow() ) ); + connect( deleteAction, SIGNAL( triggered( bool ) ), this, SLOT( deleteRow() ) ); + connect( markAction, SIGNAL( triggered( bool ) ), this, SLOT( markTranslated() ) ); + connect( unmarkAction, SIGNAL( triggered( bool ) ), this, SLOT( markUntranslated() ) ); + connect( saveAction, SIGNAL( triggered( bool ) ), this, SLOT( onSaveClicked() ) ); + connect( saveAsAction, SIGNAL( triggered( bool ) ), this, SLOT( onSaveAsClicked() ) ); + + menu->addAction( insertAction ); + menu->addAction( deleteAction ); + menu->addAction( markAction ); + menu->addAction( unmarkAction ); + menu->addAction( saveAction ); + menu->addAction( saveAsAction ); + menu->exec( e->globalPos() ); +} + +void UXTEditor::onCellChanged( int row, int column ) +{ + QTableWidgetItem *item = d_ptr->t->item( row, column ); + STRING_MANAGER::TStringInfo &info = d_ptr->infos[ row ]; + + if( column == 0 ) + info.Identifier = item->text().toUtf8().constData(); + else + if( column == 1 ) + info.Text2 = item->text().toUtf8().constData(); + + setWindowModified( true ); + + markRowTranslated( row ); +} + +void UXTEditor::markTranslated() +{ + int r = d_ptr->t->currentRow(); + if( r < 0 ) + return; + + STRING_MANAGER::TStringInfo &info = d_ptr->infos[ r ]; + if( !info.Text2.empty() ) + return; + + info.Text2 = info.Text; + + setWindowModified( true ); + + markRowTranslated( r ); +} + +void UXTEditor::markUntranslated() +{ + int r = d_ptr->t->currentRow(); + if( r < 0 ) + return; + + STRING_MANAGER::TStringInfo &info = d_ptr->infos[ r ]; + + info.Text2.clear(); + info.HashValue = 0; + + setWindowModified( true ); + + markRowUntranslated( r ); +} + +void UXTEditor::onSaveClicked() +{ + save(); +} + +void UXTEditor::onSaveAsClicked() +{ + QString path = current_file; + int idx = path.lastIndexOf( '/' ); + if( idx < 0 ) + path = ""; + else + path = path.left( idx + 1 ); + + QString file = QFileDialog::getSaveFileName( this, + tr( "Save Uxt as.." ), + path, + tr( "Uxt files ( *.uxt)" ) ); + + if( file.isEmpty() ) + return; + + saveAs( file ); +} + +void UXTEditor::setHeaderText( const QString &id, const QString &text ) +{ + QTableWidgetItem *h1 = new QTableWidgetItem( id ); + QTableWidgetItem *h2 = new QTableWidgetItem( text ); + h1->setTextAlignment( Qt::AlignLeft ); + h2->setTextAlignment( Qt::AlignLeft ); + d_ptr->t->setHorizontalHeaderItem( 0, h1 ); + d_ptr->t->setHorizontalHeaderItem( 1, h2 ); +} + +void UXTEditor::blockTableSignals( bool block ) +{ + if( block ) + disconnect( d_ptr->t, SIGNAL( cellChanged( int, int ) ), this, SLOT( onCellChanged( int, int ) ) ); + else + connect( d_ptr->t, SIGNAL( cellChanged( int, int ) ), this, SLOT( onCellChanged( int, int ) ) ); +} + +void UXTEditor::markRowTranslated( int row ) +{ + blockTableSignals( true ); + + QTableWidgetItem *item1 = d_ptr->t->item( row, 0 ); + QTableWidgetItem *item2 = d_ptr->t->item( row, 1 ); + markItemTranslated( item1 ); + markItemTranslated( item2 ); + + blockTableSignals( false ); +} + +void UXTEditor::markRowUntranslated( int row ) +{ + blockTableSignals( true ); + + QTableWidgetItem *item1 = d_ptr->t->item( row, 0 ); + QTableWidgetItem *item2 = d_ptr->t->item( row, 1 ); + markItemUntranslated( item1 ); + markItemUntranslated( item2 ); + + blockTableSignals( false ); +} + +} diff --git a/code/studio/src/plugins/translation_manager/uxt_editor.h b/code/studio/src/plugins/translation_manager/uxt_editor.h new file mode 100644 index 000000000..b749e65e3 --- /dev/null +++ b/code/studio/src/plugins/translation_manager/uxt_editor.h @@ -0,0 +1,67 @@ +// Ryzom Core Studio - Translation Manager Plugin +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + + +#ifndef UXT_EDITOR_H +#define UXT_EDITOR_H + +#include "translation_manager_editor.h" + +namespace TranslationManager +{ + +class UXTEditorPvt; + +class UXTEditor : public CEditor +{ + Q_OBJECT +public: + UXTEditor( QMdiArea *parent = NULL ); + ~UXTEditor(); + + void open( QString filename ); + void save(); + void saveAs( QString filename ); + void activateWindow(); + +public Q_SLOTS: + void insertRow(); + void deleteRow(); + +protected: + void closeEvent( QCloseEvent *e ); + void contextMenuEvent( QContextMenuEvent *e ); + +private Q_SLOTS: + void onCellChanged( int row, int column ); + void markTranslated(); + void markUntranslated(); + void onSaveClicked(); + void onSaveAsClicked(); + +private: + void setHeaderText( const QString &id, const QString &text ); + void blockTableSignals( bool block = false ); + void markRowTranslated( int row ); + void markRowUntranslated( int row ); + + UXTEditorPvt *d_ptr; +}; + +} + +#endif + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/CMakeLists.txt b/code/studio/src/plugins/world_editor/CMakeLists.txt similarity index 64% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/CMakeLists.txt rename to code/studio/src/plugins/world_editor/CMakeLists.txt index 150cc4c4f..441ff5d02 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/CMakeLists.txt +++ b/code/studio/src/plugins/world_editor/CMakeLists.txt @@ -20,12 +20,15 @@ SET(OVQT_PLUGIN_WORLD_EDITOR_HDR world_editor_plugin.h project_settings_dialog.h property_editor_widget.h world_editor_settings_page.h + const_string_array_property.h + const_string_array_editor.h ) SET(OVQT_PLUGIN_WORLD_EDITOR_UIS world_editor_window.ui project_settings_dialog.ui property_editor_widget.ui world_editor_settings_page.ui + const_string_array_editor.ui ) SET(OVQT_PLUGIN_WORLD_EDITOR_RCS world_editor.qrc) @@ -43,41 +46,42 @@ SOURCE_GROUP(QtGeneratedMocQrcSrc FILES ${OVQT_PLUGIN_WORLD_EDITOR_MOC_SRC} OVQT SOURCE_GROUP("World Editor Plugin" FILES ${SRC}) SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) -ADD_LIBRARY(ovqt_plugin_world_editor MODULE ${SRC} +ADD_LIBRARY(studio_plugin_world_editor MODULE ${SRC} ${OVQT_PLUGIN_WORLD_EDITOR_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUGIN_WORLD_EDITOR_UI_HDRS} ${OVQT_PLUGIN_WORLD_EDITOR_RC_SRCS}) -TARGET_LINK_LIBRARIES( ovqt_plugin_world_editor - ovqt_plugin_core - ovqt_plugin_landscape_editor +TARGET_LINK_LIBRARIES( studio_plugin_world_editor + studio_plugin_core + studio_plugin_landscape_editor nelmisc nel3d qt_property_browser ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY} + ${LIBXML2_LIBRARIES} ) -NL_DEFAULT_PROPS(ovqt_plugin_world_editor "NeL, Tools, 3D: Object Viewer Qt Plugin: World Editor") -NL_ADD_RUNTIME_FLAGS(ovqt_plugin_world_editor) -NL_ADD_LIB_SUFFIX(ovqt_plugin_world_editor) +NL_DEFAULT_PROPS(studio_plugin_world_editor "Tools: Studio Plugin: World Editor") +NL_ADD_RUNTIME_FLAGS(studio_plugin_world_editor) +NL_ADD_LIB_SUFFIX(studio_plugin_world_editor) ADD_DEFINITIONS(-DWORLD_EDITOR_LIBRARY ${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) IF(WIN32) IF(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_world_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_world_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) ELSE(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_world_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_world_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) ENDIF(WITH_INSTALL_LIBRARIES) ELSE(WIN32) IF(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_world_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_world_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) ELSE(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_world_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_world_editor LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) ENDIF(WITH_INSTALL_LIBRARIES) ENDIF(WIN32) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_world_editor.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/studio_plugin_world_editor.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) diff --git a/code/studio/src/plugins/world_editor/const_string_array_editor.cpp b/code/studio/src/plugins/world_editor/const_string_array_editor.cpp new file mode 100644 index 000000000..1f9907646 --- /dev/null +++ b/code/studio/src/plugins/world_editor/const_string_array_editor.cpp @@ -0,0 +1,106 @@ +// Ryzom Core Studio World Editor plugin +// 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 "const_string_array_editor.h" + +ConstStrArrEditDialog::ConstStrArrEditDialog( QDialog *parent ) : +QDialog( parent ) +{ + setupUi( this ); + setupConnections(); +} + +ConstStrArrEditDialog::~ConstStrArrEditDialog() +{ +} + +void ConstStrArrEditDialog::setStrings( const QStringList &strings ) +{ + cb->clear(); + + QStringListIterator itr( strings ); + while( itr.hasNext() ) + { + cb->addItem( itr.next() ); + } + + cb->setCurrentIndex( 0 ); +} + +void ConstStrArrEditDialog::setValue( const QString &value ) +{ + listWidget->clear(); + + if( value.isEmpty() ) + return; + + QStringList l = value.split( '\n' ); + + QStringListIterator itr( l ); + while( itr.hasNext() ) + { + listWidget->addItem( itr.next() ); + } +} + +QString ConstStrArrEditDialog::getValue() const +{ + QString value; + + for( int i = 0; i < listWidget->count(); i++ ) + { + QListWidgetItem *item = listWidget->item( i ); + value += item->text(); + + if( i < ( listWidget->count() - 1 ) ) + value += '\n'; + } + + return value; +} + +void ConstStrArrEditDialog::accept() +{ + QDialog::accept(); +} + +void ConstStrArrEditDialog::reject() +{ + QDialog::reject(); +} + +void ConstStrArrEditDialog::onAddClicked() +{ + listWidget->addItem( cb->currentText() ); +} + +void ConstStrArrEditDialog::onRemoveClicked() +{ + QListWidgetItem *item = listWidget->currentItem(); + if( item == NULL ) + return; + + delete item; +} + +void ConstStrArrEditDialog::setupConnections() +{ + connect( addButton, SIGNAL( clicked( bool ) ), this, SLOT( onAddClicked() ) ); + connect( removeButton, SIGNAL( clicked( bool ) ), this, SLOT( onRemoveClicked() ) ); +} + + diff --git a/code/studio/src/plugins/world_editor/const_string_array_editor.h b/code/studio/src/plugins/world_editor/const_string_array_editor.h new file mode 100644 index 000000000..a2c458e7c --- /dev/null +++ b/code/studio/src/plugins/world_editor/const_string_array_editor.h @@ -0,0 +1,50 @@ +// Ryzom Core Studio World Editor plugin +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + + +#ifndef CONST_STR_ARR_EDIT_DLG +#define CONST_STR_ARR_EDIT_DLG + +#include "ui_const_string_array_editor.h" +#include + +class ConstStrArrEditDialog : public QDialog, public Ui::ConstStrArrEditorDialog +{ + Q_OBJECT +public: + ConstStrArrEditDialog( QDialog *parent = NULL ); + ~ConstStrArrEditDialog(); + + void setStrings( const QStringList &strings ); + void setValue( const QString &value ); + QString getValue() const; + +public Q_SLOTS: + void accept(); + void reject(); + +private Q_SLOTS: + void onAddClicked(); + void onRemoveClicked(); + +private: + void setupConnections(); +}; + + +#endif + + diff --git a/code/studio/src/plugins/world_editor/const_string_array_editor.ui b/code/studio/src/plugins/world_editor/const_string_array_editor.ui new file mode 100644 index 000000000..6aec02352 --- /dev/null +++ b/code/studio/src/plugins/world_editor/const_string_array_editor.ui @@ -0,0 +1,130 @@ + + + ConstStrArrEditorDialog + + + + 0 + 0 + 392 + 293 + + + + Dialog + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + Add + + + + + + + + 0 + 0 + + + + Remove + + + + + + + + + + 6 + + + 0 + + + + + Qt::Horizontal + + + + 131 + 31 + + + + + + + + OK + + + + + + + Cancel + + + + + + + + + + + okButton + clicked() + ConstStrArrEditorDialog + accept() + + + 278 + 253 + + + 96 + 254 + + + + + cancelButton + clicked() + ConstStrArrEditorDialog + reject() + + + 369 + 253 + + + 179 + 282 + + + + + diff --git a/code/studio/src/plugins/world_editor/const_string_array_property.cpp b/code/studio/src/plugins/world_editor/const_string_array_property.cpp new file mode 100644 index 000000000..5ef7566d8 --- /dev/null +++ b/code/studio/src/plugins/world_editor/const_string_array_property.cpp @@ -0,0 +1,363 @@ +// Ryzom Core Studio World Editor plugin +// 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 "const_string_array_property.h" +#include "const_string_array_editor.h" +#include +#include +#include +#include +#include + + +////////////////////////////////////////////////////////////////// Manager /////////////////////////////////////////////////////////////////////////// + + +struct ConstStrArrPropMgrPriv +{ + QMap< const QtProperty*, QString > values; +}; + +ConstStrArrPropMgr::ConstStrArrPropMgr( QObject *parent ) : +QtAbstractPropertyManager( parent ) +{ + d_ptr = new ConstStrArrPropMgrPriv(); +} + +ConstStrArrPropMgr::~ConstStrArrPropMgr() +{ + delete d_ptr; + d_ptr = NULL; +} + +QString ConstStrArrPropMgr::value( const QtProperty *p ) const +{ + return valueText( p ); +} + +void ConstStrArrPropMgr::setValue( QtProperty *p, const QString &value ) +{ + if( !d_ptr->values.contains( p ) ) + return; + + if( d_ptr->values[ p ] == value ) + return; + + d_ptr->values[ p ] = value; + + Q_EMIT propertyChanged( p ); + Q_EMIT valueChanged( p, value ); +} + +void ConstStrArrPropMgr::setStrings( QtProperty *p, const QStringList &strings ) +{ + Q_EMIT stringsChanged( p, strings ); +} + +bool ConstStrArrPropMgr::hasValue( const QtProperty *p ) const +{ + return d_ptr->values.contains( p ); +} + +QString ConstStrArrPropMgr::valueText( const QtProperty *p ) const +{ + if( !d_ptr->values.contains( p ) ) + return ""; + + return d_ptr->values[ p ]; +} + +void ConstStrArrPropMgr::initializeProperty( QtProperty *p ) +{ + if( d_ptr->values.contains( p ) ) + return; + + d_ptr->values[ p ] = ""; +} + +void ConstStrArrPropMgr::uninitializeProperty( QtProperty *p ) +{ + d_ptr->values.remove( p ); +} + + + +//////////////////////////////////////////////////////////////////// Factory /////////////////////////////////////////////////////////////////////// + + + +struct ConstStrArrEditorFactoryPriv +{ + QMap< QtProperty*, QList< ConstStrArrEditor* > > createdEditors; + QMap< ConstStrArrEditor*, QtProperty* > editorToProperty; + QMap< QtProperty*, QStringList > strings; + + ~ConstStrArrEditorFactoryPriv() + { + createdEditors.clear(); + + QMap< ConstStrArrEditor*, QtProperty* >::iterator itr = editorToProperty.begin(); + while( itr != editorToProperty.end() ) + { + delete itr.key(); + ++itr; + } + editorToProperty.clear(); + } + + void addEditor( QtProperty *p, ConstStrArrEditor *editor ) + { + QMap< QtProperty*, QList< ConstStrArrEditor* > >::iterator itr = createdEditors.find( p ); + + if( itr != createdEditors.end() ) + { + itr->push_back( editor ); + } + else + { + QList< ConstStrArrEditor* > l; + l.push_back( editor ); + createdEditors.insert( p, l ); + } + + editorToProperty.insert( editor, p ); + } + + void removeEditor( QObject *o ) + { + // Remove from editorToProperty first + QMap< ConstStrArrEditor*, QtProperty* >::iterator itr1 = editorToProperty.begin(); + while( itr1 != editorToProperty.end() ) + { + if( itr1.key() == o ) + break; + + ++itr1; + } + if( itr1 != editorToProperty.end() ) + editorToProperty.erase( itr1 ); + + // Then from createdEditors + QMap< QtProperty*, QList< ConstStrArrEditor* > >::iterator itr2 = createdEditors.begin(); + while( itr2 != createdEditors.end() ) + { + QList< ConstStrArrEditor* > &l = *itr2; + QList< ConstStrArrEditor* >::iterator itr = l.begin(); + while( itr != l.end() ) + { + if( *itr == o ) + { + QList< ConstStrArrEditor* >::iterator d = itr; + ++itr; + l.erase( d ); + continue; + } + + ++itr; + } + + ++itr2; + } + } + +}; + +ConstStrArrEditorFactory::ConstStrArrEditorFactory( QObject *parent ) : +QtAbstractEditorFactory( parent ) +{ + d_ptr = new ConstStrArrEditorFactoryPriv(); +} + +ConstStrArrEditorFactory::~ConstStrArrEditorFactory() +{ + delete d_ptr; + d_ptr = NULL; +} + +void ConstStrArrEditorFactory::connectPropertyManager( ConstStrArrPropMgr *manager ) +{ + connect( manager, SIGNAL( valueChanged( QtProperty*, const QString& ) ), this, SLOT( onPropertyChanged( QtProperty*, const QString& ) ) ); + connect( manager, SIGNAL( stringsChanged( QtProperty*, const QStringList& ) ), this, SLOT( onStringsChanged( QtProperty*, const QStringList & ) ) ); +} + +void ConstStrArrEditorFactory::disconnectPropertyManager( ConstStrArrPropMgr *manager ) +{ + disconnect( manager, SIGNAL( valueChanged( QtProperty*, const QString& ) ), this, SLOT( onPropertyChanged( QtProperty*, const QString& ) ) ); + disconnect( manager, SIGNAL( stringsChanged( const QStringList& ) ), this, SLOT( onStringsChanged( const QStringList & ) ) ); +} + +QWidget* ConstStrArrEditorFactory::createEditor( ConstStrArrPropMgr *manager, QtProperty *p, QWidget *parent ) +{ + ConstStrArrEditor *editor = new ConstStrArrEditor( parent ); + editor->setValue( manager->value( p ) ); + + QMap< QtProperty*, QStringList >::iterator itr = d_ptr->strings.find( p ); + if( itr != d_ptr->strings.end() ) + { + editor->setStrings( *itr ); + } + + connect( editor, SIGNAL( valueChanged( const QString& ) ), this, SLOT( onSetValue( const QString& ) ) ); + connect( editor, SIGNAL( destroyed( QObject* ) ), this, SLOT( onEditorDestroyed( QObject* ) ) ); + + d_ptr->addEditor( p, editor ); + + return editor; +} + +void ConstStrArrEditorFactory::onPropertyChanged( QtProperty *p, const QString &value ) +{ + QMap< QtProperty*, QList< ConstStrArrEditor* > >::iterator itr = d_ptr->createdEditors.find( p ); + if( itr == d_ptr->createdEditors.end() ) + return; + + QList< ConstStrArrEditor* > &l = *itr; + QList< ConstStrArrEditor* >::iterator i = l.begin(); + while( i != l.end() ) + { + ConstStrArrEditor *editor = *i; + + editor->blockSignals( true ); + editor->setValue( value ); + editor->blockSignals( false ); + + ++i; + } +} + +void ConstStrArrEditorFactory::onStringsChanged( QtProperty *p, const QStringList &strings ) +{ + if( p == NULL ) + return; + + d_ptr->strings[ p ] = strings; +} + +void ConstStrArrEditorFactory::onSetValue( const QString &value ) +{ + QObject *s = sender(); + ConstStrArrEditor *editor = qobject_cast< ConstStrArrEditor* >( s ); + if( editor == NULL ) + return; + + QMap< ConstStrArrEditor*, QtProperty* >::iterator itr = d_ptr->editorToProperty.find( editor ); + if( itr == d_ptr->editorToProperty.end() ) + return; + + QtProperty *p = *itr; + + ConstStrArrPropMgr *manager = qobject_cast< ConstStrArrPropMgr* >( p->propertyManager() ); + if( manager == NULL ) + return; + + blockSignals( true ); + manager->setValue( p, value ); + blockSignals( false ); +} + +void ConstStrArrEditorFactory::onEditorDestroyed( QObject *editor ) +{ + d_ptr->removeEditor( editor ); +} + + + +//////////////////////////////////////////////////////////////////////// Editor ////////////////////////////////////////////////////////////////// + +ConstStrArrEditor::ConstStrArrEditor( QWidget *parent ) : +QWidget( parent ) +{ + setupUi(); + setupConnections(); +} + +ConstStrArrEditor::~ConstStrArrEditor() +{ +} + +void ConstStrArrEditor::setStrings( const QStringList &strings ) +{ + this->strings.clear(); + + QStringListIterator itr( strings ); + while( itr.hasNext() ) + { + this->strings.push_back( itr.next() ); + } +} + +void ConstStrArrEditor::setValue( const QString &value ) +{ + if( lineEdit->text() == value ) + return; + + disableConnections(); + lineEdit->setText( value ); + setupConnections(); +} + +void ConstStrArrEditor::showEvent( QShowEvent *e ) +{ + QWidget::showEvent( e ); +} + +void ConstStrArrEditor::onToolButtonClicked() +{ + ConstStrArrEditDialog d; + d.setStrings( strings ); + d.setValue( lineEdit->text() ); + int result = d.exec(); + if( QDialog::Accepted != result ) + return; + lineEdit->setText( d.getValue() ); +} + +void ConstStrArrEditor::onTextChanged( const QString &text ) +{ + Q_EMIT valueChanged( text ); +} + +void ConstStrArrEditor::setupConnections() +{ + connect( toolButton, SIGNAL( clicked( bool ) ), this, SLOT( onToolButtonClicked() ) ); + connect( lineEdit, SIGNAL( textChanged( const QString& ) ), this, SLOT( onTextChanged( const QString& ) ) ); +} + +void ConstStrArrEditor::disableConnections() +{ + disconnect( toolButton, SIGNAL( clicked( bool ) ), this, SLOT( onToolButtonClicked() ) ); + disconnect( lineEdit, SIGNAL( textChanged( const QString& ) ), this, SLOT( onTextChanged( const QString& ) ) ); +} + +void ConstStrArrEditor::setupUi() +{ + lineEdit = new QLineEdit(); + toolButton = new QToolButton(); + toolButton->setText( "..." ); + + QHBoxLayout *lt = new QHBoxLayout( this ); + lt->setContentsMargins( 0, 0, 0, 0 ); + lt->setSpacing( 0 ); + lt->addWidget( lineEdit ); + lt->addWidget( toolButton ); + + setFocusProxy( lineEdit ); + setSizePolicy( QSizePolicy::Ignored, QSizePolicy::Fixed ); + +} + + diff --git a/code/studio/src/plugins/world_editor/const_string_array_property.h b/code/studio/src/plugins/world_editor/const_string_array_property.h new file mode 100644 index 000000000..a079f4802 --- /dev/null +++ b/code/studio/src/plugins/world_editor/const_string_array_property.h @@ -0,0 +1,131 @@ +// Ryzom Core Studio World Editor plugin +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + + +#ifndef CONST_STR_ARR_PROP_H +#define CONST_STR_ARR_PROP_H + +#define QT_QTPROPERTYBROWSER_IMPORT + +#include "3rdparty/qtpropertybrowser/qtpropertybrowser.h" +#include +#include + +/////////////////////////////////////////////////////// Manager /////////////////////////////////////////////////////////////////////////// + +struct ConstStrArrPropMgrPriv; + +class ConstStrArrPropMgr : public QtAbstractPropertyManager +{ + Q_OBJECT + +public: + ConstStrArrPropMgr( QObject *parent = NULL ); + ~ConstStrArrPropMgr(); + + QString value( const QtProperty *p ) const; + +public Q_SLOTS: + void setValue( QtProperty *p, const QString &value ); + void setStrings( QtProperty *p, const QStringList &strings ); + +Q_SIGNALS: + void valueChanged( QtProperty *p, const QString &value ); + void stringsChanged( QtProperty *p, const QStringList &strings ); + +protected: + bool hasValue( const QtProperty *p ) const; + QString valueText( const QtProperty *p ) const; + void initializeProperty( QtProperty *p ); + void uninitializeProperty( QtProperty *p ); + +private: + ConstStrArrPropMgrPriv *d_ptr; + + Q_DISABLE_COPY( ConstStrArrPropMgr ); +}; + + +////////////////////////////////////////////////////////////////// Factory ///////////////////////////////////////////////////////////////////////// + +struct ConstStrArrEditorFactoryPriv; + +class ConstStrArrEditorFactory : public QtAbstractEditorFactory< ConstStrArrPropMgr > +{ + Q_OBJECT + +public: + ConstStrArrEditorFactory( QObject *parent = NULL ); + ~ConstStrArrEditorFactory(); + +protected: + void connectPropertyManager( ConstStrArrPropMgr *manager ); + void disconnectPropertyManager( ConstStrArrPropMgr *manager ); + + QWidget* createEditor( ConstStrArrPropMgr *manager, QtProperty *p, QWidget *parent ); + +private Q_SLOTS: + void onPropertyChanged( QtProperty *p, const QString &value ); + void onStringsChanged( QtProperty *p, const QStringList &strings ); + void onSetValue( const QString &value ); + void onEditorDestroyed( QObject *editor ); + +private: + ConstStrArrEditorFactoryPriv *d_ptr; + + Q_DISABLE_COPY( ConstStrArrEditorFactory ); +}; + + +///////////////////////////////////////////////////////////////// Editor /////////////////////////////////////////////////////////////////////////// + +class QLineEdit; +class QToolButton; + +class ConstStrArrEditor : public QWidget +{ + Q_OBJECT +public: + ConstStrArrEditor( QWidget *parent = NULL ); + ~ConstStrArrEditor(); + void setStrings( const QStringList &strings ); + +public Q_SLOTS: + void setValue( const QString &value ); + +protected: + void showEvent( QShowEvent *e ); + +private Q_SLOTS: + void onToolButtonClicked(); + void onTextChanged( const QString &text ); + +Q_SIGNALS: + void valueChanged( const QString &value ); + +private: + void setupUi(); + void setupConnections(); + void disableConnections(); + + + QLineEdit *lineEdit; + QToolButton *toolButton; + QStringList strings; +}; + +#endif + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/icons/ic_nel_move.png b/code/studio/src/plugins/world_editor/icons/ic_nel_move.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/icons/ic_nel_move.png rename to code/studio/src/plugins/world_editor/icons/ic_nel_move.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/icons/ic_nel_rotate.png b/code/studio/src/plugins/world_editor/icons/ic_nel_rotate.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/icons/ic_nel_rotate.png rename to code/studio/src/plugins/world_editor/icons/ic_nel_rotate.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/icons/ic_nel_scale.png b/code/studio/src/plugins/world_editor/icons/ic_nel_scale.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/icons/ic_nel_scale.png rename to code/studio/src/plugins/world_editor/icons/ic_nel_scale.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/icons/ic_nel_select.png b/code/studio/src/plugins/world_editor/icons/ic_nel_select.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/icons/ic_nel_select.png rename to code/studio/src/plugins/world_editor/icons/ic_nel_select.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/icons/ic_nel_turn.png b/code/studio/src/plugins/world_editor/icons/ic_nel_turn.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/icons/ic_nel_turn.png rename to code/studio/src/plugins/world_editor/icons/ic_nel_turn.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/icons/ic_nel_world_editor.png b/code/studio/src/plugins/world_editor/icons/ic_nel_world_editor.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/icons/ic_nel_world_editor.png rename to code/studio/src/plugins/world_editor/icons/ic_nel_world_editor.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/primitive_item.cpp b/code/studio/src/plugins/world_editor/primitive_item.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/primitive_item.cpp rename to code/studio/src/plugins/world_editor/primitive_item.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/primitive_item.h b/code/studio/src/plugins/world_editor/primitive_item.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/primitive_item.h rename to code/studio/src/plugins/world_editor/primitive_item.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/primitives_model.cpp b/code/studio/src/plugins/world_editor/primitives_model.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/primitives_model.cpp rename to code/studio/src/plugins/world_editor/primitives_model.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/primitives_model.h b/code/studio/src/plugins/world_editor/primitives_model.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/primitives_model.h rename to code/studio/src/plugins/world_editor/primitives_model.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/primitives_view.cpp b/code/studio/src/plugins/world_editor/primitives_view.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/primitives_view.cpp rename to code/studio/src/plugins/world_editor/primitives_view.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/primitives_view.h b/code/studio/src/plugins/world_editor/primitives_view.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/primitives_view.h rename to code/studio/src/plugins/world_editor/primitives_view.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/project_settings_dialog.cpp b/code/studio/src/plugins/world_editor/project_settings_dialog.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/project_settings_dialog.cpp rename to code/studio/src/plugins/world_editor/project_settings_dialog.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/project_settings_dialog.h b/code/studio/src/plugins/world_editor/project_settings_dialog.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/project_settings_dialog.h rename to code/studio/src/plugins/world_editor/project_settings_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/project_settings_dialog.ui b/code/studio/src/plugins/world_editor/project_settings_dialog.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/project_settings_dialog.ui rename to code/studio/src/plugins/world_editor/project_settings_dialog.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/property_editor_widget.cpp b/code/studio/src/plugins/world_editor/property_editor_widget.cpp similarity index 65% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/property_editor_widget.cpp rename to code/studio/src/plugins/world_editor/property_editor_widget.cpp index 6d3fdaec1..9c24c8452 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/property_editor_widget.cpp +++ b/code/studio/src/plugins/world_editor/property_editor_widget.cpp @@ -28,10 +28,48 @@ // Qt includes #include +#include + +#include "const_string_array_property.h" namespace WorldEditor { +struct PropertyEditorWidgetPrivate +{ + QMap< QtProperty*, NLLIGO::IPrimitive* > propToPrim; + + void clearPrimitives() + { + propToPrim.clear(); + } + + void addPrimitive( QtProperty *p, NLLIGO::IPrimitive *prim ) + { + QMap< QtProperty*, NLLIGO::IPrimitive* >::const_iterator itr + = propToPrim.find( p ); + if( itr != propToPrim.end() ) + return; + + propToPrim[ p ] = prim; + } + + NLLIGO::IPrimitive* getPrimitive( QtProperty *p ) + { + NLLIGO::IPrimitive *prim = NULL; + + QMap< QtProperty*, NLLIGO::IPrimitive* >::const_iterator itr + = propToPrim.find( p ); + + if( itr != propToPrim.end() ) + { + prim = itr.value(); + } + + return prim; + } +}; + PropertyEditorWidget::PropertyEditorWidget(QWidget *parent) : QWidget(parent) { @@ -42,6 +80,9 @@ PropertyEditorWidget::PropertyEditorWidget(QWidget *parent) m_enumManager = new QtEnumPropertyManager(this); m_stringArrayManager = new QtTextPropertyManager(this); + m_constStrArrPropMgr = new ConstStrArrPropMgr(this); + m_constStrArrEditorFactory = new ConstStrArrEditorFactory(this); + QtLineEditFactory *lineEditFactory = new QtLineEditFactory(this); QtCheckBoxFactory *boolFactory = new QtCheckBoxFactory(this); QtEnumEditorFactory *enumFactory = new QtEnumEditorFactory(this); @@ -51,13 +92,17 @@ PropertyEditorWidget::PropertyEditorWidget(QWidget *parent) m_ui.treePropertyBrowser->setFactoryForManager(m_boolManager, boolFactory); m_ui.treePropertyBrowser->setFactoryForManager(m_enumManager, enumFactory); m_ui.treePropertyBrowser->setFactoryForManager(m_stringArrayManager, textFactory); + m_ui.treePropertyBrowser->setFactoryForManager(m_constStrArrPropMgr, m_constStrArrEditorFactory); m_groupManager = new QtGroupPropertyManager(this); + d_ptr = new PropertyEditorWidgetPrivate(); + connect(m_stringManager, SIGNAL(propertyChanged(QtProperty *)), this, SLOT(propertyChanged(QtProperty *))); connect(m_boolManager, SIGNAL(propertyChanged(QtProperty *)), this, SLOT(propertyChanged(QtProperty *))); connect(m_enumManager, SIGNAL(propertyChanged(QtProperty *)), this, SLOT(propertyChanged(QtProperty *))); connect(m_stringArrayManager, SIGNAL(propertyChanged(QtProperty *)), this, SLOT(propertyChanged(QtProperty *))); + connect(m_constStrArrPropMgr, SIGNAL(propertyChanged(QtProperty *)), this, SLOT(propertyChanged(QtProperty *))); connect(m_boolManager, SIGNAL(resetProperty(QtProperty *)), this, SLOT(resetProperty(QtProperty *))); connect(m_stringManager, SIGNAL(resetProperty(QtProperty *)), this, SLOT(resetProperty(QtProperty *))); @@ -67,10 +112,13 @@ PropertyEditorWidget::PropertyEditorWidget(QWidget *parent) PropertyEditorWidget::~PropertyEditorWidget() { + delete d_ptr; + d_ptr = NULL; } void PropertyEditorWidget::clearProperties() { + d_ptr->clearPrimitives(); m_ui.treePropertyBrowser->clear(); } @@ -163,6 +211,8 @@ void PropertyEditorWidget::updateSelection(Node *node) else prop = addBoolProperty(ligoProperty, parameter, primitive); + d_ptr->addPrimitive( prop, const_cast< NLLIGO::IPrimitive* >( primitive ) ); + // Default value ? if ((ligoProperty == NULL) || (ligoProperty->Default)) prop->setModified(false); @@ -188,9 +238,9 @@ void PropertyEditorWidget::updateSelection(Node *node) blockSignalsOfProperties(false); } -void PropertyEditorWidget::propertyChanged(QtProperty *property) +void PropertyEditorWidget::propertyChanged(QtProperty *p) { - nlinfo(QString("property %1 changed").arg(property->propertyName()).toUtf8().constData()); + nlinfo(QString("property %1 changed").arg(p->propertyName()).toUtf8().constData()); } void PropertyEditorWidget::resetProperty(QtProperty *property) @@ -198,6 +248,115 @@ void PropertyEditorWidget::resetProperty(QtProperty *property) nlinfo(QString("property %1 reset").arg(property->propertyName()).toUtf8().constData()); } +NLLIGO::IProperty* PropertyEditorWidget::getLigoProperty( QtProperty *p ) +{ + NLLIGO::IPrimitive *prim = d_ptr->getPrimitive( p ); + if( prim == NULL ) + { + return NULL; + } + + NLLIGO::IProperty *prop = NULL; + prim->getPropertyByName( p->propertyName().toUtf8().constData(), prop ); + if( prop == NULL ) + { + return NULL; + } + + return prop; +} + +void PropertyEditorWidget::onBoolValueChanged( QtProperty *p, bool v ) +{ + NLLIGO::IProperty *prop = getLigoProperty( p ); + if( prop == NULL ) + return; + + NLLIGO::CPropertyString *pp = dynamic_cast< NLLIGO::CPropertyString* >( prop ); + if( pp == NULL ) + return; + + if( v ) + pp->String = "true"; + else + pp->String = "false"; + + pp->Default = false; +} + +void PropertyEditorWidget::onStringValueChanged( QtProperty *p, const QString &v ) +{ + NLLIGO::IProperty *prop = getLigoProperty( p ); + if( prop == NULL ) + return; + + NLLIGO::CPropertyString *pp = dynamic_cast< NLLIGO::CPropertyString* >( prop ); + if( pp == NULL ) + return; + + pp->String = v.toUtf8().constData(); + pp->Default = false; +} + +void PropertyEditorWidget::onEnumValueChanged( QtProperty *p, int v ) +{ + NLLIGO::IProperty *prop = getLigoProperty( p ); + if( prop == NULL ) + return; + + NLLIGO::CPropertyString *pp = dynamic_cast< NLLIGO::CPropertyString* >( prop ); + if( pp == NULL ) + return; + + pp->String = p->valueText().toUtf8().constData(); + pp->Default = false; +} + +void PropertyEditorWidget::onStrArrValueChanged( QtProperty *p, const QString &v ) +{ + NLLIGO::IProperty *prop = getLigoProperty( p ); + if( prop == NULL ) + return; + + NLLIGO::CPropertyStringArray *pp = dynamic_cast< NLLIGO::CPropertyStringArray* >( prop ); + if( pp == NULL ) + return; + + pp->StringArray.clear(); + + QStringList l = v.split( '\n' ); + QStringListIterator itr( l ); + while( itr.hasNext() ) + { + pp->StringArray.push_back( itr.next().toUtf8().constData() ); + } + + pp->Default = false; +} + +void PropertyEditorWidget::onConstStrArrValueChanged( QtProperty *p, const QString &v ) +{ + NLLIGO::IProperty *prop = getLigoProperty( p ); + if( prop == NULL ) + return; + + NLLIGO::CPropertyStringArray *pp = dynamic_cast< NLLIGO::CPropertyStringArray* >( prop ); + if( pp == NULL ) + return; + + pp->StringArray.clear(); + + QStringList l = v.split( '\n' ); + QStringListIterator itr( l ); + while( itr.hasNext() ) + { + pp->StringArray.push_back( itr.next().toUtf8().constData() ); + } + + pp->Default = false; +} + + QtProperty *PropertyEditorWidget::addBoolProperty(const NLLIGO::IProperty *property, const NLLIGO::CPrimitiveClass::CParameter ¶meter, const NLLIGO::IPrimitive *primitive) @@ -326,62 +485,47 @@ QtProperty *PropertyEditorWidget::addConstStringArrayProperty(const NLLIGO::IPro primitive->getPropertyByName(name.c_str(), value); // Create qt property -// QtProperty *prop = m_enumManager->addProperty(parameter.Name.c_str()); - QtProperty *prop = m_stringArrayManager->addProperty(parameter.Name.c_str()); + QtProperty *prop = m_constStrArrPropMgr->addProperty(parameter.Name.c_str()); QStringList listEnums = getComboValues(parameter); if (listEnums.isEmpty()) { -// listEnums << QString(value.c_str()) + tr(" (WRN: Check leveldesign!)"); -// m_enumManager->setEnumNames(prop, listEnums); -// m_enumManager->setValue(prop, 0); prop->setEnabled(false); } else { // Fill qt property - m_enumManager->setEnumNames(prop, listEnums); + m_constStrArrPropMgr->setStrings(prop, listEnums); - // Find index of current value - //for (int i = 0; i < listEnums.size(); i++) - //{ - // if (value == std::string(listEnums[i].toUtf8().constData())) - // { - // m_enumManager->setValue(prop, i); - // break; - // } - //} - - const NLLIGO::IProperty *ligoProperty; - std::vector vectString; + const NLLIGO::IProperty *ligoProperty; + std::vector vectString; - if (primitive->getPropertyByName (parameter.Name.c_str(), ligoProperty)) - { - const NLLIGO::CPropertyStringArray *const propStringArray = dynamic_cast (ligoProperty); - if (propStringArray) + if (primitive->getPropertyByName (parameter.Name.c_str(), ligoProperty)) { - const std::vector &vectString = propStringArray->StringArray; - if (!vectString.empty()) + const NLLIGO::CPropertyStringArray *const propStringArray = dynamic_cast (ligoProperty); + if (propStringArray) { - std::string temp; - for (size_t i = 0; i < vectString.size(); i++) + const std::vector &vectString = propStringArray->StringArray; + if (!vectString.empty()) { - temp += vectString[i]; - if (i != (vectString.size() - 1)) - temp += '\n'; + std::string temp; + for (size_t i = 0; i < vectString.size(); i++) + { + temp += vectString[i]; + if (i != (vectString.size() - 1)) + temp += '\n'; + } + m_constStrArrPropMgr->setValue(prop, temp.c_str()); + prop->setToolTip(temp.c_str()); } - m_stringArrayManager->setValue(prop, temp.c_str()); - prop->setToolTip(temp.c_str()); + } + else + { + m_constStrArrPropMgr->setValue(prop, "StringArray :("); } } - else - { - m_stringArrayManager->setValue(prop, "StringArray :("); - } - } - m_enumManager->setValue(prop, 0); } return prop; @@ -430,5 +574,44 @@ void PropertyEditorWidget::blockSignalsOfProperties(bool block) m_boolManager->blockSignals(block); m_enumManager->blockSignals(block); m_stringArrayManager->blockSignals(block); + + if( block ) + { + disconnect(m_constStrArrPropMgr, SIGNAL(propertyChanged(QtProperty *)), this, SLOT(propertyChanged(QtProperty *))); + + disconnect(m_boolManager, SIGNAL( valueChanged( QtProperty*, bool ) ), + this, SLOT( onBoolValueChanged( QtProperty*, bool ) ) ); + + disconnect(m_stringManager, SIGNAL( valueChanged( QtProperty*, const QString& ) ), + this, SLOT( onStringValueChanged( QtProperty*, const QString& ) ) ); + + disconnect(m_enumManager, SIGNAL( valueChanged( QtProperty*, int ) ), + this, SLOT( onEnumValueChanged( QtProperty*, int ) ) ); + + disconnect(m_stringArrayManager, SIGNAL( valueChanged( QtProperty*, const QString& ) ), + this, SLOT( onStrArrValueChanged( QtProperty*, const QString& ) ) ); + + disconnect(m_constStrArrPropMgr, SIGNAL( valueChanged( QtProperty*, const QString& ) ), + this, SLOT( onConstStrArrValueChanged( QtProperty*, const QString& ) ) ); + } + else + { + connect(m_constStrArrPropMgr, SIGNAL(propertyChanged(QtProperty *)), this, SLOT(propertyChanged(QtProperty *))); + + connect(m_boolManager, SIGNAL( valueChanged( QtProperty*, bool ) ), + this, SLOT( onBoolValueChanged( QtProperty*, bool ) ) ); + + connect(m_stringManager, SIGNAL( valueChanged( QtProperty*, const QString& ) ), + this, SLOT( onStringValueChanged( QtProperty*, const QString& ) ) ); + + connect(m_enumManager, SIGNAL( valueChanged( QtProperty*, int ) ), + this, SLOT( onEnumValueChanged( QtProperty*, int ) ) ); + + connect(m_stringArrayManager, SIGNAL( valueChanged( QtProperty*, const QString& ) ), + this, SLOT( onStrArrValueChanged( QtProperty*, const QString& ) ) ); + + connect(m_constStrArrPropMgr, SIGNAL( valueChanged( QtProperty*, const QString& ) ), + this, SLOT( onConstStrArrValueChanged( QtProperty*, const QString& ) ) ); + } } } /* namespace WorldEditor */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/property_editor_widget.h b/code/studio/src/plugins/world_editor/property_editor_widget.h similarity index 82% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/property_editor_widget.h rename to code/studio/src/plugins/world_editor/property_editor_widget.h index 85935cccd..dae7ad13e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/property_editor_widget.h +++ b/code/studio/src/plugins/world_editor/property_editor_widget.h @@ -33,8 +33,14 @@ // Qt includes +class ConstStrArrPropMgr; +class ConstStrArrEditorFactory; + namespace WorldEditor { + +struct PropertyEditorWidgetPrivate; + /** @class PropertyEditorWidget @brief PropertyEditorWidget @@ -54,9 +60,18 @@ public Q_SLOTS: /// Update of selections void updateSelection(Node *node); - void propertyChanged(QtProperty *property); + void propertyChanged(QtProperty *p); void resetProperty(QtProperty *property); + NLLIGO::IProperty* getLigoProperty( QtProperty *p ); + + void onBoolValueChanged( QtProperty *p, bool v ); + void onStringValueChanged( QtProperty *p, const QString &v ); + void onEnumValueChanged( QtProperty *p, int v ); + void onStrArrValueChanged( QtProperty *p, const QString &v ); + void onConstStrArrValueChanged( QtProperty *p, const QString &v ); + + private: QtProperty *addBoolProperty(const NLLIGO::IProperty *property, const NLLIGO::CPrimitiveClass::CParameter ¶meter, @@ -84,7 +99,12 @@ private: QtGroupPropertyManager *m_groupManager; QtTextPropertyManager *m_stringArrayManager; + ConstStrArrPropMgr *m_constStrArrPropMgr; + ConstStrArrEditorFactory *m_constStrArrEditorFactory; + Ui::PropertyEditorWidget m_ui; + + PropertyEditorWidgetPrivate *d_ptr; }; /* PropertyEditorWidget */ } /* namespace WorldEditor */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/property_editor_widget.ui b/code/studio/src/plugins/world_editor/property_editor_widget.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/property_editor_widget.ui rename to code/studio/src/plugins/world_editor/property_editor_widget.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/ovqt_plugin_world_editor.xml b/code/studio/src/plugins/world_editor/studio_plugin_world_editor.xml similarity index 81% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/ovqt_plugin_world_editor.xml rename to code/studio/src/plugins/world_editor/studio_plugin_world_editor.xml index 13a157a7e..1b15af6a0 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/ovqt_plugin_world_editor.xml +++ b/code/studio/src/plugins/world_editor/studio_plugin_world_editor.xml @@ -1,5 +1,5 @@ - ovqt_plugin_world_editor + studio_plugin_world_editor WorldEditor 0.6 GSoC2011_dnk-88 diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor.qrc b/code/studio/src/plugins/world_editor/world_editor.qrc similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor.qrc rename to code/studio/src/plugins/world_editor/world_editor.qrc diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_actions.cpp b/code/studio/src/plugins/world_editor/world_editor_actions.cpp similarity index 83% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_actions.cpp rename to code/studio/src/plugins/world_editor/world_editor_actions.cpp index e10e15745..5255e976f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_actions.cpp +++ b/code/studio/src/plugins/world_editor/world_editor_actions.cpp @@ -209,6 +209,178 @@ void CreateWorldCommand::redo() m_model->createWorldEditNode(m_fileName); } + +WorldSaver::WorldSaver( PrimitivesTreeModel *model, LandscapeEditor::ZoneBuilderBase *zoneBuilder, const std::string &dataDir, const std::string &context ) +{ + m_model = model; + m_zoneBuilder = zoneBuilder; + m_dataDir = dataDir; + m_context = context; +} + +bool WorldSaver::save() +{ + QModelIndex pidx = m_model->index( 0, 0 ); + if( !pidx.isValid() ) + { + lastError = "No root node."; + return false; + } + + int rows = m_model->rowCount( pidx ); + bool ok = false; + + for( int i = 0; i < rows; i++ ) + { + QModelIndex idx = m_model->index( i, 0, pidx ); + + Node *node = reinterpret_cast< Node* >( idx.internalPointer() ); + Node::NodeType t = node->type(); + + switch( t ) + { + case Node::LandscapeNodeType: ok = saveLandscapeNode( node ); break; + case Node::RootPrimitiveNodeType: ok = savePrimitiveNode( node ); break; + } + + if( !ok ) + return false; + } + + ok = saveWorldEditFile(); + return ok; +} + +bool WorldSaver::saveLandscapeNode( Node *node ) +{ + LandscapeNode *n = dynamic_cast< LandscapeNode* >( node ); + if( n == NULL ) + { + lastError = "Trying to save a non-landscape node as landscape."; + return false; + } + + LandscapeEditor::ZoneRegionObject *z = m_zoneBuilder->zoneRegion( n->id() ); + if( z == NULL ) + { + lastError = "The specified zoneregion doesn't exist."; + return false; + } + + z->setFileName( n->fileName().toUtf8().constData() ); + bool ok = z->save(); + + if( ok ) + { + std::pair< std::string, std::string > p; + p.first = "landscape"; + p.second = n->fileName().toUtf8().constData(); + + m_data.push_back( p ); + } + else + { + lastError = "Couldn't save landscape file " + std::string( n->fileName().toUtf8().constData() ); + } + + return ok; +} + +bool WorldSaver::savePrimitiveNode( Node *node ) +{ + RootPrimitiveNode *n = dynamic_cast< RootPrimitiveNode* >( node ); + if( n == NULL ) + { + lastError = "Trying to save a non-primitive node as primitive."; + return false; + } + + bool ok = NLLIGO::saveXmlPrimitiveFile( *(n->primitives()), n->fileName().toUtf8().constData() ); + + if( ok ) + { + std::pair< std::string, std::string > p; + p.first = "primitive"; + p.second = n->fileName().toUtf8().constData(); + + m_data.push_back( p ); + } + else + { + lastError = "Couldn't save primitive file " + std::string( n->fileName().toUtf8().constData() ); + } + + return ok; +} + +bool WorldSaver::saveWorldEditFile() +{ + QModelIndex idx = m_model->index( 0, 0 ); + Node *node = reinterpret_cast< Node* >( idx.internalPointer() ); + Node::NodeType t = node->type(); + + WorldEditNode *n = dynamic_cast< WorldEditNode* >( node ); + if( n == NULL ) + { + lastError = "Not a worldedit node."; + return false; + } + + std::string fn = n->data( 0 ).toString().toUtf8().constData(); + bool ok = writeWorldEditFile( fn ); + + return ok; +} + +bool WorldSaver::writeWorldEditFile( const std::string &fn ) +{ + if( fn.empty() ) + return false; + + NLMISC::COFile of; + if( !of.open( fn, false, true, false ) ) + { + lastError = "Couldn't open file " + fn + " for writing."; + return false; + } + + NLMISC::COXml xml; + xml.init( &of ); + + xmlNodePtr rootNode = xmlNewDocNode (xml.getDocument (), NULL, (const xmlChar*)"NEL_WORLD_EDITOR_PROJECT", NULL); + xmlDocSetRootElement (xml.getDocument (), rootNode); + xmlNodePtr node = xmlNewChild ( rootNode, NULL, (const xmlChar*)"VERSION", NULL); + xmlNodePtr text = xmlNewText ((const xmlChar *) NLMISC::toString( WORLD_EDITOR_FILE_VERSION ).c_str ()); + xmlAddChild( node, text ); + node = xmlNewChild ( rootNode, NULL, (const xmlChar*)"DATA_DIRECTORY", NULL); + xmlSetProp (node, (const xmlChar*)"VALUE", (const xmlChar*)m_dataDir.c_str ()); + node = xmlNewChild ( rootNode, NULL, (const xmlChar*)"CONTEXT", NULL); + xmlSetProp (node, (const xmlChar*)"VALUE", (const xmlChar*)m_context.c_str ()); + + std::vector< std::pair< std::string, std::string > >::const_iterator itr = m_data.begin(); + while( itr != m_data.end() ) + { + const std::pair< std::string, std::string > &p = *itr; + + node = xmlNewChild ( rootNode, NULL, (const xmlChar*)"DATABASE_ELEMENT", NULL); + xmlSetProp (node, (const xmlChar*)"FILENAME", (const xmlChar*)p.second.c_str ()); + + if( p.first == "landscape" ) + xmlSetProp (node, (const xmlChar*)"TYPE", (const xmlChar*)("landscape")); + else + xmlSetProp (node, (const xmlChar*)"TYPE", (const xmlChar*)("primitive")); + + ++itr; + } + + xml.flush(); + + of.close(); + + + return true; +} + LoadLandscapeCommand::LoadLandscapeCommand(const QString &fileName, PrimitivesTreeModel *model, LandscapeEditor::ZoneBuilderBase *zoneBuilder, QUndoCommand *parent) : QUndoCommand(parent), diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_actions.h b/code/studio/src/plugins/world_editor/world_editor_actions.h similarity index 93% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_actions.h rename to code/studio/src/plugins/world_editor/world_editor_actions.h index 89de14e9a..95ce093e2 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_actions.h +++ b/code/studio/src/plugins/world_editor/world_editor_actions.h @@ -72,6 +72,31 @@ private: PrimitivesTreeModel *const m_model; }; + +class WorldSaver +{ +public: + WorldSaver( PrimitivesTreeModel *model, LandscapeEditor::ZoneBuilderBase *zoneBuilder, const std::string &dataDir, const std::string &context ); + bool save(); + + std::string getLastError() const{ return lastError; } + +private: + bool saveLandscapeNode( Node *node ); + bool savePrimitiveNode( Node *node ); + bool saveWorldEditFile(); + bool writeWorldEditFile( const std::string &fn ); + + std::string m_dataDir; + std::string m_context; + PrimitivesTreeModel *m_model; + LandscapeEditor::ZoneBuilderBase *m_zoneBuilder; + + std::vector< std::pair< std::string, std::string > > m_data; + + std::string lastError; +}; + /** @class LoadLandscapeCommand @brief diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_constants.h b/code/studio/src/plugins/world_editor/world_editor_constants.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_constants.h rename to code/studio/src/plugins/world_editor/world_editor_constants.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_global.h b/code/studio/src/plugins/world_editor/world_editor_global.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_global.h rename to code/studio/src/plugins/world_editor/world_editor_global.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_misc.cpp b/code/studio/src/plugins/world_editor/world_editor_misc.cpp similarity index 89% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_misc.cpp rename to code/studio/src/plugins/world_editor/world_editor_misc.cpp index 7401f49fb..a2736b1c5 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_misc.cpp +++ b/code/studio/src/plugins/world_editor/world_editor_misc.cpp @@ -34,35 +34,11 @@ namespace WorldEditor namespace Utils { -void syntaxError(const char *filename, xmlNodePtr xmlNode, const char *format, ...) -{ - char buffer[1024]; - - if (format) - { - va_list args; - va_start( args, format ); - sint ret = vsnprintf( buffer, 1024, format, args ); - va_end( args ); - } - else - { - strcpy(buffer, "Unknown error"); - } +std::string lastError; - nlerror("(%s), node (%s), line (%s) :\n%s", filename, xmlNode->name, xmlNode->content, buffer); -} - -bool getPropertyString(std::string &result, const char *filename, xmlNodePtr xmlNode, const char *propName) +std::string getLastError() { - // Call the CIXml version - if (!NLMISC::CIXml::getPropertyString(result, xmlNode, propName)) - { - // Output a formated error - syntaxError(filename, xmlNode, "Missing XML node property (%s)", propName); - return false; - } - return true; + return lastError; } uint32 getUniqueId() @@ -81,6 +57,10 @@ bool loadWorldEditFile(const std::string &fileName, WorldEditList &worldEditList { bool result = false; + lastError = ""; + + std::string p = NLMISC::CFile::getPath( fileName ); + // Load the document NLMISC::CIFile file; if (file.open(fileName)) @@ -110,20 +90,31 @@ bool loadWorldEditFile(const std::string &fileName, WorldEditList &worldEditList } if (version == -1) - syntaxError(fileName.c_str(), rootNode, "No version node"); + { + std::string error = "No version node in file " + fileName; + lastError = error; + nlinfo( "%s", error.c_str() ); + return false; + } else { // Old format, if (version <= 1) { - syntaxError(fileName.c_str(), rootNode, "Old version node"); + std::string error = "Old version node in file " + fileName; + lastError = error; + nlinfo( "%s", error.c_str() ); + return false; } else { // Read it if (version > WORLD_EDITOR_FILE_VERSION) { - syntaxError(fileName.c_str(), node, "Unknown file version"); + std::string error = "Unknown file version in file " + fileName; + lastError = error; + nlinfo( "%s", error.c_str() ); + return false; } else { @@ -133,6 +124,8 @@ bool loadWorldEditFile(const std::string &fileName, WorldEditList &worldEditList { std::string dataDir; NLMISC::CIXml::getPropertyString(dataDir, node, "VALUE"); + + dataDir = NLMISC::CPath::makePathAbsolute( dataDir, p ); worldEditList.push_back(WorldEditItem(DataDirectoryType, dataDir)); } @@ -153,12 +146,16 @@ bool loadWorldEditFile(const std::string &fileName, WorldEditList &worldEditList { // Get the type std::string type; - if (getPropertyString(type, fileName.c_str(), node, "TYPE")) + + if ( NLMISC::CIXml::getPropertyString(type, node, "TYPE")) { // Read the filename std::string filenameChild; - if (getPropertyString(filenameChild, fileName.c_str(), node, "FILENAME")) + if ( NLMISC::CIXml::getPropertyString(filenameChild, node, "FILENAME")) { + + filenameChild = NLMISC::CPath::makePathAbsolute( filenameChild, p ); + // Is it a landscape ? if (type == "landscape") { @@ -179,11 +176,34 @@ bool loadWorldEditFile(const std::string &fileName, WorldEditList &worldEditList } } else + if ( type == "primitive" ) { worldEditList.push_back(WorldEditItem(PrimitiveType, filenameChild)); } + else + if( type.empty() ) + { + std::string error = "Empty type node property in file " + fileName; + lastError = error; + nlinfo( "%s", error.c_str() ); + return false; + } } + else + { + std::string error = "Missing filename node property in file " + fileName; + lastError = error; + nlinfo( "%s", error.c_str() ); + return false; + } + } + else + { + std::string error = "Missing type node property in file " + fileName; + lastError = error; + nlinfo( "%s", error.c_str() ); + return false; } } while (node = NLMISC::CIXml::getNextChildNode(node, "DATABASE_ELEMENT")); @@ -197,18 +217,26 @@ bool loadWorldEditFile(const std::string &fileName, WorldEditList &worldEditList } else { - // Error - syntaxError(fileName.c_str(), rootNode, "Unknown file header : %s", rootNode->name); + std::string error = "Unknown file header in file " + fileName; + lastError = error; + nlinfo( "%s", error.c_str() ); + return false; } } } catch (NLMISC::Exception &e) { - nlerror("Error reading file %s : %s", fileName.c_str(), e.what()); + std::string error = "Error reading file " + fileName + " : " + std::string( e.what() ); + lastError = error; + nlinfo( "%s", error.c_str() ); } } else - nlerror("Can't open the file %s for reading.", fileName.c_str()); + { + std::string error = "Can't open the file " + fileName + " for reading."; + lastError = error; + nlinfo( "%s", error.c_str() ); + } return result; } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_misc.h b/code/studio/src/plugins/world_editor/world_editor_misc.h similarity index 98% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_misc.h rename to code/studio/src/plugins/world_editor/world_editor_misc.h index d29b2553b..36c7b1a6a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_misc.h +++ b/code/studio/src/plugins/world_editor/world_editor_misc.h @@ -49,6 +49,8 @@ typedef std::vector WorldEditList; // Generate unique identificator uint32 getUniqueId(); +std::string getLastError(); + // Load *.worldedit file and return list primitives and landscapes. bool loadWorldEditFile(const std::string &fileName, WorldEditList &worldEditList); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_plugin.cpp b/code/studio/src/plugins/world_editor/world_editor_plugin.cpp similarity index 67% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_plugin.cpp rename to code/studio/src/plugins/world_editor/world_editor_plugin.cpp index 301939cb6..9b9622d00 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_plugin.cpp +++ b/code/studio/src/plugins/world_editor/world_editor_plugin.cpp @@ -43,6 +43,9 @@ WorldEditorPlugin::~WorldEditorPlugin() } qDeleteAll(m_autoReleaseObjects); m_autoReleaseObjects.clear(); + + delete m_libContext; + m_libContext = NULL; } bool WorldEditorPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) @@ -51,36 +54,6 @@ bool WorldEditorPlugin::initialize(ExtensionSystem::IPluginManager *pluginManage WorldEditorSettingsPage *weSettings = new WorldEditorSettingsPage(this); addAutoReleasedObject(weSettings); - - QSettings *settings = Core::ICore::instance()->settings(); - settings->beginGroup(Constants::WORLD_EDITOR_SECTION); - m_ligoConfig.CellSize = settings->value(Constants::WORLD_EDITOR_CELL_SIZE, "160").toFloat(); - m_ligoConfig.Snap = settings->value(Constants::WORLD_EDITOR_SNAP, "1").toFloat(); - m_ligoConfig.ZoneSnapShotRes = settings->value(Constants::ZONE_SNAPSHOT_RES, "128").toUInt(); - QString fileName = settings->value(Constants::PRIMITIVE_CLASS_FILENAME, "world_editor_classes.xml").toString(); - settings->endGroup(); - try - { - // Search path of file world_editor_classes.xml - std::string ligoPath = NLMISC::CPath::lookup(fileName.toUtf8().constData()); - // Init LIGO - m_ligoConfig.readPrimitiveClass(ligoPath.c_str(), true); - NLLIGO::Register(); - NLLIGO::CPrimitiveContext::instance().CurrentLigoConfig = &m_ligoConfig; - } - catch (NLMISC::Exception &e) - { - *errorString = tr("(%1)").arg(e.what()); - return false; - } - - // Reset - m_ligoConfig.resetPrimitiveConfiguration (); - - // TODO: get file names! from settings - m_ligoConfig.readPrimitiveClass("world_editor_primitive_configuration.xml", true); - - addAutoReleasedObject(new WorldEditorContext(this)); return true; } @@ -113,6 +86,33 @@ WorldEditorContext::WorldEditorContext(QObject *parent) : IContext(parent), m_worldEditorWindow(0) { + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Constants::WORLD_EDITOR_SECTION); + m_ligoConfig.CellSize = settings->value(Constants::WORLD_EDITOR_CELL_SIZE, "160").toFloat(); + m_ligoConfig.Snap = settings->value(Constants::WORLD_EDITOR_SNAP, "1").toFloat(); + m_ligoConfig.ZoneSnapShotRes = settings->value(Constants::ZONE_SNAPSHOT_RES, "128").toUInt(); + QString fileName = settings->value(Constants::PRIMITIVE_CLASS_FILENAME, "world_editor_classes.xml").toString(); + settings->endGroup(); + try + { + // Search path of file world_editor_classes.xml + std::string ligoPath = NLMISC::CPath::lookup(fileName.toUtf8().constData()); + // Init LIGO + m_ligoConfig.readPrimitiveClass(ligoPath.c_str(), true); + NLLIGO::Register(); + NLLIGO::CPrimitiveContext::instance().CurrentLigoConfig = &m_ligoConfig; + } + catch (NLMISC::Exception &e) + { + nlinfo( "Error starting LIGO." ); + } + + // Reset + m_ligoConfig.resetPrimitiveConfiguration (); + + // TODO: get file names! from settings + m_ligoConfig.readPrimitiveClass("world_editor_primitive_configuration.xml", true); + m_worldEditorWindow = new WorldEditorWindow(); } @@ -121,6 +121,11 @@ QUndoStack *WorldEditorContext::undoStack() return m_worldEditorWindow->undoStack(); } +void WorldEditorContext::onActivated() +{ + NLLIGO::CPrimitiveContext::instance().CurrentLigoConfig = &m_ligoConfig; +} + void WorldEditorContext::open() { m_worldEditorWindow->open(); @@ -133,4 +138,4 @@ QWidget *WorldEditorContext::widget() } -Q_EXPORT_PLUGIN(WorldEditor::WorldEditorPlugin) \ No newline at end of file +Q_EXPORT_PLUGIN(WorldEditor::WorldEditorPlugin) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_plugin.h b/code/studio/src/plugins/world_editor/world_editor_plugin.h similarity index 97% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_plugin.h rename to code/studio/src/plugins/world_editor/world_editor_plugin.h index 686b87e14..cfb5448e3 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_plugin.h +++ b/code/studio/src/plugins/world_editor/world_editor_plugin.h @@ -59,7 +59,6 @@ protected: NLMISC::CLibraryContext *m_libContext; private: - NLLIGO::CLigoConfig m_ligoConfig; ExtensionSystem::IPluginManager *m_plugMan; QList m_autoReleaseObjects; }; @@ -88,9 +87,14 @@ public: virtual QUndoStack *undoStack(); + void onActivated(); + virtual QWidget *widget(); WorldEditorWindow *m_worldEditorWindow; + +private: + NLLIGO::CLigoConfig m_ligoConfig; }; } // namespace WorldEditor diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_scene.cpp b/code/studio/src/plugins/world_editor/world_editor_scene.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_scene.cpp rename to code/studio/src/plugins/world_editor/world_editor_scene.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_scene.h b/code/studio/src/plugins/world_editor/world_editor_scene.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_scene.h rename to code/studio/src/plugins/world_editor/world_editor_scene.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_scene_item.cpp b/code/studio/src/plugins/world_editor/world_editor_scene_item.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_scene_item.cpp rename to code/studio/src/plugins/world_editor/world_editor_scene_item.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_scene_item.h b/code/studio/src/plugins/world_editor/world_editor_scene_item.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_scene_item.h rename to code/studio/src/plugins/world_editor/world_editor_scene_item.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_settings_page.cpp b/code/studio/src/plugins/world_editor/world_editor_settings_page.cpp similarity index 72% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_settings_page.cpp rename to code/studio/src/plugins/world_editor/world_editor_settings_page.cpp index bb8ef2a00..d3b8bb849 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_settings_page.cpp +++ b/code/studio/src/plugins/world_editor/world_editor_settings_page.cpp @@ -17,9 +17,11 @@ // Project includes #include "world_editor_settings_page.h" #include "world_editor_constants.h" +#include "../core/icore.h" // Qt includes #include +#include // NeL includes @@ -61,11 +63,31 @@ QWidget *WorldEditorSettingsPage::createPage(QWidget *parent) { m_currentPage = new QWidget(parent); m_ui.setupUi(m_currentPage); + readSettings(); + return m_currentPage; } +void WorldEditorSettingsPage::readSettings() +{ + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Constants::WORLD_EDITOR_SECTION); + bool b = false; + + b = settings->value( Constants::WORLD_EDITOR_USE_OPENGL, true ).toBool(); + m_ui.glCB->setChecked( b ); + + settings->endGroup(); +} + void WorldEditorSettingsPage::apply() { + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Constants::WORLD_EDITOR_SECTION); + bool b = false; + b = m_ui.glCB->isChecked(); + settings->setValue( Constants::WORLD_EDITOR_USE_OPENGL, b ); + settings->endGroup(); } } /* namespace WorldEditor */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_settings_page.h b/code/studio/src/plugins/world_editor/world_editor_settings_page.h similarity index 98% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_settings_page.h rename to code/studio/src/plugins/world_editor/world_editor_settings_page.h index aa7677b9f..7eeb30e1d 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_settings_page.h +++ b/code/studio/src/plugins/world_editor/world_editor_settings_page.h @@ -46,6 +46,7 @@ public: QIcon categoryIcon() const; virtual QWidget *createPage(QWidget *parent); + virtual void readSettings(); virtual void apply(); virtual void finish() {} diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_settings_page.ui b/code/studio/src/plugins/world_editor/world_editor_settings_page.ui similarity index 64% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_settings_page.ui rename to code/studio/src/plugins/world_editor/world_editor_settings_page.ui index 9219da6c4..a5cb12559 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_settings_page.ui +++ b/code/studio/src/plugins/world_editor/world_editor_settings_page.ui @@ -3,7 +3,7 @@ WorldEditorSettingsPage - false + true @@ -25,6 +25,9 @@ + + true + Workspace @@ -37,10 +40,18 @@ - + + + false + + - + + + false + + @@ -50,15 +61,32 @@ - + + + false + + - + + + false + + - + + + true + - Use OpenGL + Use OpenGL ( requires restart ) + + + true + + + false @@ -79,7 +107,11 @@ - + + + false + + @@ -89,7 +121,11 @@ - + + + false + + @@ -101,10 +137,17 @@ - + + + false + + + + false + ... diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_window.cpp b/code/studio/src/plugins/world_editor/world_editor_window.cpp similarity index 93% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_window.cpp rename to code/studio/src/plugins/world_editor/world_editor_window.cpp index b23e62063..6dbd07a8a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_window.cpp +++ b/code/studio/src/plugins/world_editor/world_editor_window.cpp @@ -121,6 +121,10 @@ WorldEditorWindow::~WorldEditorWindow() writeSettings(); delete m_zoneBuilderBase; + + Core::ICore::instance()->mainWindow()->statusBar()->removeWidget( m_statusInfo ); + delete m_statusInfo; + m_statusInfo = NULL; } QUndoStack *WorldEditorWindow::undoStack() const @@ -170,7 +174,12 @@ void WorldEditorWindow::loadWorldEditFile(const QString &fileName) Utils::WorldEditList worldEditList; if (!Utils::loadWorldEditFile(fileName.toUtf8().constData(), worldEditList)) { - // TODO: add the message box + std::string error = Utils::getLastError(); + + QMessageBox::critical( this, + tr( "Error opening world editor file" ), + tr( error.c_str() ) ); + return; } @@ -185,8 +194,10 @@ void WorldEditorWindow::loadWorldEditFile(const QString &fileName) { case Utils::DataDirectoryType: m_zoneBuilderBase->init(QString(worldEditList[i].second.c_str()), true); + m_dataDir = worldEditList[i].second.c_str(); break; case Utils::ContextType: + m_context = worldEditList[i].second.c_str(); break; case Utils::LandscapeType: m_undoStack->push(new LoadLandscapeCommand(QString(worldEditList[i].second.c_str()), m_primitivesModel, m_zoneBuilderBase)); @@ -212,6 +223,16 @@ void WorldEditorWindow::newWorldEditFile() void WorldEditorWindow::saveWorldEditFile() { + WorldSaver saver( m_primitivesModel, m_zoneBuilderBase, m_dataDir.toUtf8().constData(), m_context.toUtf8().constData() ); + bool ok = saver.save(); + QString error = saver.getLastError().c_str(); + + if( !ok ) + { + QMessageBox::critical( this, + tr( "Failed to save world editor files" ), + tr( "Failed to save world editor files.\nError:\n " ) + error ); + } } void WorldEditorWindow::openProjectSettings() @@ -415,6 +436,7 @@ void WorldEditorWindow::writeSettings() settings->beginGroup(Constants::WORLD_EDITOR_SECTION); settings->setValue(Constants::WORLD_WINDOW_STATE, saveState()); settings->setValue(Constants::WORLD_WINDOW_GEOMETRY, saveGeometry()); + settings->setValue(Constants::WORLD_EDITOR_USE_OPENGL, settings->value(Constants::WORLD_EDITOR_USE_OPENGL)); settings->endGroup(); settings->sync(); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_window.h b/code/studio/src/plugins/world_editor/world_editor_window.h similarity index 97% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_window.h rename to code/studio/src/plugins/world_editor/world_editor_window.h index f289e6c2a..9080187f9 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_window.h +++ b/code/studio/src/plugins/world_editor/world_editor_window.h @@ -46,6 +46,7 @@ public: ~WorldEditorWindow(); QUndoStack *undoStack() const; + void onActivated(); void maybeSave(); Q_SIGNALS: @@ -76,6 +77,9 @@ private: void loadWorldEditFile(const QString &fileName); void checkCurrentWorld(); + QString m_context; + QString m_dataDir; + QString m_lastDir; QLabel *m_statusInfo; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_window.ui b/code/studio/src/plugins/world_editor/world_editor_window.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_window.ui rename to code/studio/src/plugins/world_editor/world_editor_window.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/CMakeLists.txt b/code/studio/src/plugins/zone_painter/CMakeLists.txt similarity index 58% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/CMakeLists.txt rename to code/studio/src/plugins/zone_painter/CMakeLists.txt index 729658ab4..94f5e85f7 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/CMakeLists.txt +++ b/code/studio/src/plugins/zone_painter/CMakeLists.txt @@ -32,30 +32,30 @@ SOURCE_GROUP(QtGeneratedMocSrc FILES ${OVQT_PLUG_ZONE_PAINTER_MOC_SRC} ${OVQT_PL SOURCE_GROUP("Zone Painter Plugin" FILES ${SRC}) SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) -ADD_LIBRARY(ovqt_plugin_zone_painter MODULE ${SRC} ${OVQT_PLUG_ZONE_PAINTER_MOC_SRC} ${OVQT_PLUG_ZONE_PAINTER_RC_SRCS} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUG_ZONE_PAINTER_UI_HDRS}) +ADD_LIBRARY(studio_plugin_zone_painter MODULE ${SRC} ${OVQT_PLUG_ZONE_PAINTER_MOC_SRC} ${OVQT_PLUG_ZONE_PAINTER_RC_SRCS} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUG_ZONE_PAINTER_UI_HDRS}) -TARGET_LINK_LIBRARIES(ovqt_plugin_zone_painter ovqt_plugin_core nelmisc nel3d ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY}) +TARGET_LINK_LIBRARIES(studio_plugin_zone_painter studio_plugin_core nelmisc nel3d ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY}) -NL_DEFAULT_PROPS(ovqt_plugin_zone_painter "NeL, Tools, 3D: Object Viewer Qt Plugin: Zone Painter") -NL_ADD_RUNTIME_FLAGS(ovqt_plugin_zone_painter) -NL_ADD_LIB_SUFFIX(ovqt_plugin_zone_painter) +NL_DEFAULT_PROPS(studio_plugin_zone_painter "Tools: Studio Plugin: Zone Painter") +NL_ADD_RUNTIME_FLAGS(studio_plugin_zone_painter) +NL_ADD_LIB_SUFFIX(studio_plugin_zone_painter) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) IF(WIN32) IF(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_zone_painter LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_zone_painter LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) ELSE(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_zone_painter LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_zone_painter LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${OVQT_PLUGIN_DIR} COMPONENT tools3d) ENDIF(WITH_INSTALL_LIBRARIES) ELSE(WIN32) IF(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_zone_painter LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_zone_painter LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) ELSE(WITH_INSTALL_LIBRARIES) - INSTALL(TARGETS ovqt_plugin_zone_painter LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) + INSTALL(TARGETS studio_plugin_zone_painter LIBRARY DESTINATION ${OVQT_PLUGIN_DIR} RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) ENDIF(WITH_INSTALL_LIBRARIES) ENDIF(WIN32) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/ovqt_plugin_zone_painter.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/studio_plugin_zone_painter.xml DESTINATION ${OVQT_PLUGIN_SPECS_DIR} COMPONENT tools3d) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/images/color-fill.png b/code/studio/src/plugins/zone_painter/images/color-fill.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/images/color-fill.png rename to code/studio/src/plugins/zone_painter/images/color-fill.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/images/color-picker-black.png b/code/studio/src/plugins/zone_painter/images/color-picker-black.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/images/color-picker-black.png rename to code/studio/src/plugins/zone_painter/images/color-picker-black.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/images/colorize.png b/code/studio/src/plugins/zone_painter/images/colorize.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/images/colorize.png rename to code/studio/src/plugins/zone_painter/images/colorize.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/images/draw-brush.png b/code/studio/src/plugins/zone_painter/images/draw-brush.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/images/draw-brush.png rename to code/studio/src/plugins/zone_painter/images/draw-brush.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/images/go-down-7.png b/code/studio/src/plugins/zone_painter/images/go-down-7.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/images/go-down-7.png rename to code/studio/src/plugins/zone_painter/images/go-down-7.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/images/go-jump-4.png b/code/studio/src/plugins/zone_painter/images/go-jump-4.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/images/go-jump-4.png rename to code/studio/src/plugins/zone_painter/images/go-jump-4.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/images/lock-6.png b/code/studio/src/plugins/zone_painter/images/lock-6.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/images/lock-6.png rename to code/studio/src/plugins/zone_painter/images/lock-6.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/images/lock-silver.png b/code/studio/src/plugins/zone_painter/images/lock-silver.png similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/images/lock-silver.png rename to code/studio/src/plugins/zone_painter/images/lock-silver.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/painter_dock_widget.cpp b/code/studio/src/plugins/zone_painter/painter_dock_widget.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/painter_dock_widget.cpp rename to code/studio/src/plugins/zone_painter/painter_dock_widget.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/painter_dock_widget.h b/code/studio/src/plugins/zone_painter/painter_dock_widget.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/painter_dock_widget.h rename to code/studio/src/plugins/zone_painter/painter_dock_widget.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/painter_dock_widget.ui b/code/studio/src/plugins/zone_painter/painter_dock_widget.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/painter_dock_widget.ui rename to code/studio/src/plugins/zone_painter/painter_dock_widget.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/qnel_widget.cpp b/code/studio/src/plugins/zone_painter/qnel_widget.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/qnel_widget.cpp rename to code/studio/src/plugins/zone_painter/qnel_widget.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/qnel_widget.h b/code/studio/src/plugins/zone_painter/qnel_widget.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/qnel_widget.h rename to code/studio/src/plugins/zone_painter/qnel_widget.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/ovqt_plugin_zone_painter.xml b/code/studio/src/plugins/zone_painter/studio_plugin_zone_painter.xml similarity index 76% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/ovqt_plugin_zone_painter.xml rename to code/studio/src/plugins/zone_painter/studio_plugin_zone_painter.xml index 9a07a6be6..eb796aa42 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/ovqt_plugin_zone_painter.xml +++ b/code/studio/src/plugins/zone_painter/studio_plugin_zone_painter.xml @@ -1,5 +1,5 @@ - ovqt_plugin_zone_painter + studio_plugin_zone_painter ZonePainter 0.0 Ryzom Core diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter.qrc b/code/studio/src/plugins/zone_painter/zone_painter.qrc similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter.qrc rename to code/studio/src/plugins/zone_painter/zone_painter.qrc diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_main_window.cpp b/code/studio/src/plugins/zone_painter/zone_painter_main_window.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_main_window.cpp rename to code/studio/src/plugins/zone_painter/zone_painter_main_window.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_main_window.h b/code/studio/src/plugins/zone_painter/zone_painter_main_window.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_main_window.h rename to code/studio/src/plugins/zone_painter/zone_painter_main_window.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_main_window.ui b/code/studio/src/plugins/zone_painter/zone_painter_main_window.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_main_window.ui rename to code/studio/src/plugins/zone_painter/zone_painter_main_window.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_model.cpp b/code/studio/src/plugins/zone_painter/zone_painter_model.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_model.cpp rename to code/studio/src/plugins/zone_painter/zone_painter_model.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_model.h b/code/studio/src/plugins/zone_painter/zone_painter_model.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_model.h rename to code/studio/src/plugins/zone_painter/zone_painter_model.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_plugin.cpp b/code/studio/src/plugins/zone_painter/zone_painter_plugin.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_plugin.cpp rename to code/studio/src/plugins/zone_painter/zone_painter_plugin.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_plugin.h b/code/studio/src/plugins/zone_painter/zone_painter_plugin.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_plugin.h rename to code/studio/src/plugins/zone_painter/zone_painter_plugin.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_settings_page.cpp b/code/studio/src/plugins/zone_painter/zone_painter_settings_page.cpp similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_settings_page.cpp rename to code/studio/src/plugins/zone_painter/zone_painter_settings_page.cpp diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_settings_page.h b/code/studio/src/plugins/zone_painter/zone_painter_settings_page.h similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_settings_page.h rename to code/studio/src/plugins/zone_painter/zone_painter_settings_page.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_settings_page.ui b/code/studio/src/plugins/zone_painter/zone_painter_settings_page.ui similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_settings_page.ui rename to code/studio/src/plugins/zone_painter/zone_painter_settings_page.ui diff --git a/code/studio/src/pm_watcher.cpp b/code/studio/src/pm_watcher.cpp new file mode 100644 index 000000000..0bbd28ca1 --- /dev/null +++ b/code/studio/src/pm_watcher.cpp @@ -0,0 +1,103 @@ +// Ryzom Core - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + + +#include "pm_watcher.h" +#include "extension_system/iplugin_manager.h" +#include "splash_screen.h" + +namespace +{ + enum Progress + { + PLUGINS_LOADED = 10, + PLUGINS_INITIALIZED = 90, + PLUGINS_STARTED = 100 + }; +} + +void PluginManagerWatcher::connect() +{ + QObject::connect( pm, SIGNAL( pluginLoading( const char * ) ), this, SLOT( onPluginLoading( const char * ) ) ); + QObject::connect( pm, SIGNAL( pluginInitializing( const char * ) ), this, SLOT( onPluginInitializing( const char * ) ) ); + QObject::connect( pm, SIGNAL( pluginStarting( const char * ) ), this, SLOT( onPluginStarting( const char * ) ) ); + QObject::connect( pm, SIGNAL( pluginsLoaded() ), this, SLOT( onPluginsLoaded() ) ); + QObject::connect( pm, SIGNAL( pluginsInitialized() ), this, SLOT( onPluginsInitialized() ) ); + QObject::connect( pm, SIGNAL( pluginsStarted() ), this, SLOT( onPluginsStarted() ) ); + QObject::connect( pm, SIGNAL( pluginCount( int ) ), this, SLOT( onPluginCount( int ) ) ); +} + +void PluginManagerWatcher::disconnect() +{ + QObject::disconnect( pm, SIGNAL( pluginLoading( const char * ) ), this, SLOT( onPluginLoading( const char * ) ) ); + QObject::disconnect( pm, SIGNAL( pluginInitializing( const char * ) ), this, SLOT( onPluginInitializing( const char * ) ) ); + QObject::disconnect( pm, SIGNAL( pluginStarting( const char * ) ), this, SLOT( onPluginStarting( const char * ) ) ); + QObject::disconnect( pm, SIGNAL( pluginsLoaded() ), this, SLOT( onPluginsLoaded() ) ); + QObject::disconnect( pm, SIGNAL( pluginsInitialized() ), this, SLOT( onPluginsInitialized() ) ); + QObject::disconnect( pm, SIGNAL( pluginsStarted() ), this, SLOT( onPluginsStarted() ) ); + QObject::disconnect( pm, SIGNAL( pluginCount( int ) ), this, SLOT( onPluginCount( int ) ) ); +} + +void PluginManagerWatcher::onPluginLoading( const char *plugin ) +{ + QString s = "Loading plugin "; + s += plugin; + s += "..."; + sp->setText( s ); + + sp->advanceProgress( PLUGINS_LOADED / pluginCount ); +} + +void PluginManagerWatcher::onPluginInitializing( const char *plugin ) +{ + QString s = "Initializing plugin "; + s += plugin; + s += "..."; + sp->setText( s ); + + sp->advanceProgress( ( PLUGINS_INITIALIZED - PLUGINS_LOADED ) / pluginCount ); +} + +void PluginManagerWatcher::onPluginStarting( const char *plugin ) +{ + QString s = "Starting plugin "; + s += plugin; + s += "..."; + sp->setText( s ); + + sp->advanceProgress( ( PLUGINS_STARTED - PLUGINS_INITIALIZED ) / pluginCount ); +} + + +void PluginManagerWatcher::onPluginsLoaded() +{ + sp->setProgress( PLUGINS_LOADED ); +} + +void PluginManagerWatcher::onPluginsInitialized() +{ + sp->setProgress( PLUGINS_INITIALIZED ); +} + +void PluginManagerWatcher::onPluginsStarted() +{ + sp->setProgress( PLUGINS_STARTED ); +} + +void PluginManagerWatcher::onPluginCount( int count ) +{ + pluginCount = count; +} \ No newline at end of file diff --git a/code/studio/src/pm_watcher.h b/code/studio/src/pm_watcher.h new file mode 100644 index 000000000..e37e81401 --- /dev/null +++ b/code/studio/src/pm_watcher.h @@ -0,0 +1,72 @@ +// Ryzom Core - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + + +#ifndef PM_WATCHER_H +#define PM_WATCHER_H + +#include + +namespace ExtensionSystem +{ + class IPluginManager; +} + +class SplashScreen; +class PluginManager; + +class PluginManagerWatcher : public QObject +{ + Q_OBJECT +public: + + PluginManagerWatcher(){ + sp = NULL; + pm = NULL; + pluginCount = 0; + } + + ~PluginManagerWatcher(){ + sp = NULL; + pm = NULL; + } + + void setSplashScreen( SplashScreen *s ){ sp = s; } + void setPluginManager( ExtensionSystem::IPluginManager *m ){ pm = m; } + + void connect(); + void disconnect(); + +private Q_SLOTS: + void onPluginLoading( const char *plugin ); + void onPluginInitializing( const char *plugin ); + void onPluginStarting( const char *plugin ); + + void onPluginsLoaded(); + void onPluginsInitialized(); + void onPluginsStarted(); + + void onPluginCount( int count ); + +private: + SplashScreen *sp; + ExtensionSystem::IPluginManager *pm; + int pluginCount; +}; + + +#endif + diff --git a/code/studio/src/splash_screen.cpp b/code/studio/src/splash_screen.cpp new file mode 100644 index 000000000..36f7b3bc0 --- /dev/null +++ b/code/studio/src/splash_screen.cpp @@ -0,0 +1,109 @@ +// Ryzom Core - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + + +#include "splash_screen.h" +#include +#include +#include +#include + +SplashScreen::SplashScreen() : +QSplashScreen() +{ + progress = 0; + textX = 5; + textY = 20; + pbLeft = 2; + pbTop = 0; + pbWidth = 100; + pbHeight = 20; +} + +SplashScreen::~SplashScreen() +{ +} + +void SplashScreen::setPixmap( const QPixmap &pixmap ) +{ + QSplashScreen::setPixmap( pixmap ); + + if( this->pixmap().width() > 0 ) + pbWidth = this->pixmap().width() - 4; + + if( this->pixmap().height() > 0 ) + pbTop = this->pixmap().height() - pbHeight - 2; + + textY = pbTop - pbHeight / 2; +} + +void SplashScreen::setText( const QString &text ) +{ + this->text = text; + repaint(); + QCoreApplication::instance()->processEvents(); +} + +void SplashScreen::clearText() +{ + setText( "" ); +} + +void SplashScreen::setProgress( int percent ) +{ + progress = percent; + repaint(); + QCoreApplication::instance()->processEvents(); +} + +void SplashScreen::advanceProgress( int percent ) +{ + progress += percent; + repaint(); + QCoreApplication::instance()->processEvents(); +} + +void SplashScreen::drawContents( QPainter *painter ) +{ + QSplashScreen::drawContents( painter ); + + if( progressBarEnabled ) + { + QStyleOptionProgressBarV2 pbStyle; + pbStyle.initFrom( this ); + pbStyle.state = QStyle::State_Enabled; + pbStyle.textVisible = false; + pbStyle.minimum = 0; + pbStyle.maximum = 100; + pbStyle.progress = progress; + pbStyle.invertedAppearance = false; + pbStyle.rect = QRect( pbLeft, pbTop, pbWidth, pbHeight ); + + style()->drawControl( QStyle::CE_ProgressBar, &pbStyle, painter, this ); + } + + if( !text.isEmpty() ) + { + QPen oldPen = painter->pen(); + QPen pen; + pen.setColor( Qt::white ); + painter->setPen( pen ); + painter->drawText( textX, textY, text ); + painter->setPen( oldPen ); + } +} + + diff --git a/code/studio/src/splash_screen.h b/code/studio/src/splash_screen.h new file mode 100644 index 000000000..c4ba0f648 --- /dev/null +++ b/code/studio/src/splash_screen.h @@ -0,0 +1,60 @@ +// Ryzom Core - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + + +#ifndef SPLASH_SCREEN_H +#define SPLASH_SCREEN_H + + +#include + +class SplashScreen : public QSplashScreen +{ + Q_OBJECT +public: + SplashScreen(); + ~SplashScreen(); + + void setPixmap( const QPixmap &pixmap ); + + void setText( const QString &text ); + void clearText(); + void setTextXY( int x, int y ){ textX = x; textY = y; } + void setProgress( int percent ); + void advanceProgress( int percent ); + + void setProgressBarEnabled( bool b ){ progressBarEnabled = b; } + void setProgressBarRect( int left, int top, int width, int height ){} + +protected: + void drawContents( QPainter *painter ); + +private: + int progress; + int pbLeft; + int pbTop; + int pbWidth; + int pbHeight; + + QString text; + int textX; + int textY; + + bool progressBarEnabled; +}; + +#endif + diff --git a/code/studio/src/startup_settings_dlg.cpp b/code/studio/src/startup_settings_dlg.cpp new file mode 100644 index 000000000..645df7040 --- /dev/null +++ b/code/studio/src/startup_settings_dlg.cpp @@ -0,0 +1,237 @@ +// Ryzom Core - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + + +#include "startup_settings_dlg.h" +#include +#include +#include + +int findListItem( QListWidget *l, const QString &s ) +{ + for( int i = 0; i < l->count(); i++ ) + { + QListWidgetItem *item = l->item( i ); + if( item->text() == s ) + return i; + } + + return -1; +} + +StartupSettingsDlg::StartupSettingsDlg( QDialog *parent ) : +QDialog( parent ) +{ + setupUi( this ); + setupConnections(); + settings = NULL; +} + +StartupSettingsDlg::~StartupSettingsDlg() +{ +} + +void StartupSettingsDlg::load() +{ + pluginsLE->setText( settings->value( "PluginPath" ).toString() ); + + settings->beginGroup( "DataPath" ); + + sheetsLE->setText( settings->value( "LevelDesignPath" ).toString() ); + assetsLE->setText( settings->value( "AssetsPath" ).toString() ); + primitivesLE->setText( settings->value( "PrimitivesPath" ).toString() ); + ligoLE->setText( settings->value( "LigoConfigFile" ).toString() ); + + QStringList l = settings->value( "SearchPaths" ).toStringList(); + { + QStringListIterator itr( l ); + while( itr.hasNext() ) + { + QString p = itr.next(); + if( findListItem( searchLW, p ) == -1 ) + searchLW->addItem( p ); + } + } + + l.clear(); + + l = settings->value( "RecursiveSearchPathes" ).toStringList(); + { + QStringListIterator itr( l ); + while( itr.hasNext() ) + { + QString p = itr.next(); + if( findListItem( recursiveLW, p ) == -1 ) + recursiveLW->addItem( p ); + } + } + + settings->endGroup(); +} + +void StartupSettingsDlg::saveSearchPaths() +{ + QStringList l; + for( int i = 0; i < searchLW->count(); i++ ) + { + l.push_back( searchLW->item( i )->text() ); + } + + settings->setValue( "SearchPaths", l ); +} + +void StartupSettingsDlg::saveRecursivePaths() +{ + QStringList l; + for( int i = 0; i < recursiveLW->count(); i++ ) + { + l.push_back( recursiveLW->item( i )->text() ); + } + + settings->setValue( "RecursiveSearchPathes", l ); +} + +void StartupSettingsDlg::save() +{ + settings->setValue( "PluginPath", pluginsLE->text() ); + + settings->beginGroup( "DataPath" ); + + settings->setValue( "LevelDesignPath", sheetsLE->text() ); + settings->setValue( "AssetsPath", assetsLE->text() ); + settings->setValue( "PrimitivesPath", primitivesLE->text() ); + settings->setValue( "LigoConfigFile", ligoLE->text() ); + + saveSearchPaths(); + saveRecursivePaths(); + + settings->endGroup(); + + settings->sync(); +} + +void StartupSettingsDlg::accept() +{ + save(); + QDialog::accept(); +} + +void StartupSettingsDlg::reject() +{ + QDialog::reject(); +} + +void StartupSettingsDlg::onOKClicked() +{ + accept(); +} + +void StartupSettingsDlg::onCancelClicked() +{ + reject(); +} + +void StartupSettingsDlg::onPluginBClicked() +{ + QString p = QFileDialog::getExistingDirectory( this, tr( "Plugins directory" ), "" ); + pluginsLE->setText( p ); +} + +void StartupSettingsDlg::onSheetsBClicked() +{ + QString p = QFileDialog::getExistingDirectory( this, tr( "Sheets directory" ), "" ); + sheetsLE->setText( p ); +} + +void StartupSettingsDlg::onAssetsBClicked() +{ + QString p = QFileDialog::getExistingDirectory( this, tr( "Assets directory" ), "" ); + assetsLE->setText( p ); +} + +void StartupSettingsDlg::onPrimitivesBClicked() +{ + QString p = QFileDialog::getExistingDirectory( this, tr( "Primitives directory" ), "" ); + primitivesLE->setText( p ); +} + +void StartupSettingsDlg::onLigoBClicked() +{ + QString p; + p = QFileDialog::getOpenFileName( this, tr( "LIGO config file" ), "" ); + ligoLE->setText( p ); +} + +void StartupSettingsDlg::onPathAddClicked() +{ + QString p = QFileDialog::getExistingDirectory( this, tr( "Search path" ), "" ); + if( p.isEmpty() ) + return; + + if( findListItem( searchLW, p ) != -1 ) + return; + + searchLW->addItem( p ); +} + +void StartupSettingsDlg::onPathRemoveClicked() +{ + QListWidgetItem *i = searchLW->currentItem(); + if( i == NULL ) + return; + + delete i; +} + +void StartupSettingsDlg::onRecursiveAddClicked() +{ + QString p = QFileDialog::getExistingDirectory( this, tr( "Recursive search path" ), "" ); + if( p.isEmpty() ) + return; + + if( findListItem( recursiveLW, p ) != -1 ) + return; + + recursiveLW->addItem( p ); +} + +void StartupSettingsDlg::onRecursiveRemoveClicked() +{ + QListWidgetItem *i = recursiveLW->currentItem(); + if( i == NULL ) + return; + + delete i; +} + + +void StartupSettingsDlg::setupConnections() +{ + connect( bb, SIGNAL( accepted() ), this, SLOT( onOKClicked() ) ); + connect( bb, SIGNAL( rejected() ), this, SLOT( onCancelClicked() ) ); + + connect( pluginsB, SIGNAL( clicked( bool ) ), this, SLOT( onPluginBClicked() ) ); + connect( sheetsB, SIGNAL( clicked( bool ) ), this, SLOT( onSheetsBClicked() ) ); + connect( assetsB, SIGNAL( clicked( bool ) ), this, SLOT( onAssetsBClicked() ) ); + connect( primitivesB, SIGNAL( clicked( bool ) ), this, SLOT( onPrimitivesBClicked() ) ); + connect( ligoB, SIGNAL( clicked( bool ) ), this, SLOT( onLigoBClicked() ) ); + + connect( pathAddB, SIGNAL( clicked( bool ) ), this, SLOT( onPathAddClicked() ) ); + connect( pathRemoveB, SIGNAL( clicked( bool ) ), this, SLOT( onPathRemoveClicked() ) ); + connect( recAddB, SIGNAL( clicked( bool ) ), this, SLOT( onRecursiveAddClicked() ) ); + connect( recRemoveB, SIGNAL( clicked( bool ) ), this, SLOT( onRecursiveRemoveClicked() ) ); +} + diff --git a/code/studio/src/startup_settings_dlg.h b/code/studio/src/startup_settings_dlg.h new file mode 100644 index 000000000..49dd01ef7 --- /dev/null +++ b/code/studio/src/startup_settings_dlg.h @@ -0,0 +1,62 @@ +// Ryzom Core - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef STARTUP_SETTINGS_DIALOG_H +#define STARTUP_SETTINGS_DIALOG_H + +#include "ui_startup_settings_dlg.h" + +class QSettings; + +class StartupSettingsDlg : public QDialog, public Ui::StartupSettingsDlg +{ + Q_OBJECT +public: + StartupSettingsDlg( QDialog *parent = NULL ); + ~StartupSettingsDlg(); + + void setSettings( QSettings *s ){ settings = s; } + + void load(); + +public Q_SLOTS: + void accept(); + void reject(); + + void onOKClicked(); + void onCancelClicked(); + + void onPluginBClicked(); + void onSheetsBClicked(); + void onAssetsBClicked(); + void onPrimitivesBClicked(); + void onLigoBClicked(); + + void onPathAddClicked(); + void onPathRemoveClicked(); + void onRecursiveAddClicked(); + void onRecursiveRemoveClicked(); + +private: + void setupConnections(); + void save(); + void saveSearchPaths(); + void saveRecursivePaths(); + + QSettings *settings; +}; + +#endif diff --git a/code/studio/src/startup_settings_dlg.ui b/code/studio/src/startup_settings_dlg.ui new file mode 100644 index 000000000..5f125ed14 --- /dev/null +++ b/code/studio/src/startup_settings_dlg.ui @@ -0,0 +1,255 @@ + + + StartupSettingsDlg + + + Qt::ApplicationModal + + + + 0 + 0 + 451 + 539 + + + + Ryzom Core Studio settings + + + + + + Paths + + + + + + Plugins + + + + + + + + + + ... + + + + + + + Sheets + + + + + + + + + + ... + + + + + + + Assets database + + + + + + + + + + ... + + + + + + + Primitives + + + + + + + + + + ... + + + + + + + LIGO config file + + + + + + + + + + ... + + + + + + + + + + Search paths + + + + + + + + + + 0 + 0 + + + + Add + + + Qt::ToolButtonTextOnly + + + + + + + + 0 + 0 + + + + Remove + + + Qt::ToolButtonTextOnly + + + + + + + Qt::Vertical + + + + 20 + 75 + + + + + + + + + + + Recursive search paths + + + + + + + + + + 0 + 0 + + + + Add + + + Qt::ToolButtonTextOnly + + + + + + + + 0 + 0 + + + + Remove + + + Qt::ToolButtonTextOnly + + + + + + + Qt::Vertical + + + + 20 + 76 + + + + + + + + + + + Qt::Horizontal + + + + 120 + 20 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/ic_nel_pill.ico b/code/studio/src/studio.ico similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/ic_nel_pill.ico rename to code/studio/src/studio.ico diff --git a/code/nel/tools/3d/object_viewer_qt/src/object_viewer_qt.qrc b/code/studio/src/studio.qrc similarity index 56% rename from code/nel/tools/3d/object_viewer_qt/src/object_viewer_qt.qrc rename to code/studio/src/studio.qrc index 13d47d75b..17306e2cc 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/object_viewer_qt.qrc +++ b/code/studio/src/studio.qrc @@ -1,5 +1,5 @@ - images/nel_ide_load.png + images/studio_splash.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/object_viewer_qt.rc b/code/studio/src/studio.rc similarity index 83% rename from code/nel/tools/3d/object_viewer_qt/src/object_viewer_qt.rc rename to code/studio/src/studio.rc index a0f0e7099..05ade2766 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/object_viewer_qt.rc +++ b/code/studio/src/studio.rc @@ -28,12 +28,12 @@ BEGIN VALUE "CompanyName", "Ryzom Core\0" VALUE "FileDescription", "\0" VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "Object_Viewer_Qt\0" + VALUE "InternalName", "Ryzom Core Studio\0" VALUE "LegalCopyright", "Copyright (C) 2011\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "\0" VALUE "PrivateBuild", "\0" - VALUE "ProductName", "Object Viewer Qt\0" + VALUE "ProductName", "Ryzom Core Studio\0" VALUE "ProductVersion", "1, 0, 0, 1\0" VALUE "SpecialBuild", "\0" END @@ -51,4 +51,4 @@ END // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDR_MAINFRAME ICON DISCARDABLE "ic_nel_pill.ico" +IDR_MAINFRAME ICON DISCARDABLE "studio.ico" diff --git a/code/nel/tools/3d/object_viewer_qt/src/translations/object_viewer_qt_de.ts b/code/studio/src/translations/object_viewer_qt_de.ts similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/translations/object_viewer_qt_de.ts rename to code/studio/src/translations/object_viewer_qt_de.ts diff --git a/code/nel/tools/3d/object_viewer_qt/src/translations/object_viewer_qt_en.ts b/code/studio/src/translations/object_viewer_qt_en.ts similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/translations/object_viewer_qt_en.ts rename to code/studio/src/translations/object_viewer_qt_en.ts diff --git a/code/nel/tools/3d/object_viewer_qt/src/translations/object_viewer_qt_fr.ts b/code/studio/src/translations/object_viewer_qt_fr.ts similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/translations/object_viewer_qt_fr.ts rename to code/studio/src/translations/object_viewer_qt_fr.ts diff --git a/code/nel/tools/3d/object_viewer_qt/src/translations/object_viewer_qt_ru.ts b/code/studio/src/translations/object_viewer_qt_ru.ts similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/translations/object_viewer_qt_ru.ts rename to code/studio/src/translations/object_viewer_qt_ru.ts diff --git a/code/nel/tools/3d/object_viewer_qt/src/translations/translations.qrc b/code/studio/src/translations/translations.qrc similarity index 100% rename from code/nel/tools/3d/object_viewer_qt/src/translations/translations.qrc rename to code/studio/src/translations/translations.qrc diff --git a/code/web/app/app_achievements/index.php b/code/web/app/app_achievements/index.php deleted file mode 100644 index 90ce612bb..000000000 --- a/code/web/app/app_achievements/index.php +++ /dev/null @@ -1,110 +0,0 @@ -isIG()) { - require_once("include/ach_render_ig.php"); -} -else { - require_once("include/ach_render_web.php"); -} -require_once("include/ach_render_common.php"); - -require_once("class/DLL_class.php"); -#require_once("class/InDev_trait.php"); -require_once("class/Node_abstract.php"); -require_once("class/AVLTree_class.php"); -require_once("class/Parentum_abstract.php"); -require_once("class/AchList_abstract.php"); -require_once("class/Tieable_inter.php"); -require_once("class/NodeIterator_class.php"); - - -require_once("class/AchMenu_class.php"); -require_once("class/AchMenuNode_class.php"); -require_once("class/AchSummary_class.php"); -require_once("class/AchCategory_class.php"); -require_once("class/AchAchievement_class.php"); -require_once("class/AchTask_class.php"); -require_once("class/AchObjective_class.php"); - -#require_once("fb/facebook.php"); - -// Update user acces on Db -#$DBc = ryDB::getInstance(APP_NAME."_test"); -$DBc = ryDB::getInstance(APP_NAME); - -$c = ""; -if(!$_USER->isIG()) { - /*$facebook = new Facebook(array( - 'appId' => $_CONF['fb_id'], - 'secret' => $_CONF['fb_secret'], - 'cookie' => true - )); - - #code taken from facebook tutorial - - // Get the url to redirect for login to facebook - // and request permission to write on the user's wall. - $login_url = $facebook->getLoginUrl( - array('scope' => 'publish_stream') - ); - - // If not authenticated, redirect to the facebook login dialog. - // The $login_url will take care of redirecting back to us - // after successful login. - if (! $facebook->getUser()) { - $c .= ';'; - } - else { - $DBc->sqlQuery("INSERT INTO ach_fb_token (aft_player,aft_token,aft_date,aft_allow) VALUES ('".$_USER->getID()."','".$DBc->sqlEscape($facebook->getAccessToken())."','".time()."','1') ON DUPLICATE KEY UPDATE aft_token='".$DBc->sqlEscape($facebook->getAccessToken())."', aft_date='".time()."'"); - }*/ - - -} - -if(!$_USER->isIG && $_CONF['enable_webig'] == false) { - $c .= ach_render_forbidden(false); -} -elseif($_USER->isIG && $_CONF['enable_offgame'] == false) { - $c .= ach_render_forbidden(true); -} -else { - $c .= ach_render(); -} - - -echo ryzom_app_render(strtoupper(get_translation('ach_app_name',$_USER->getLang())), $c, $_USER->isIG()); - -?> diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/Filelist.xml b/code/web/docs/admin/shard_restart/Filelist.xml similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/Filelist.xml rename to code/web/docs/admin/shard_restart/Filelist.xml diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/H38.css b/code/web/docs/admin/shard_restart/H38.css similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/H38.css rename to code/web/docs/admin/shard_restart/H38.css diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/H70_2.htm b/code/web/docs/admin/shard_restart/H70_2.htm similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/H70_2.htm rename to code/web/docs/admin/shard_restart/H70_2.htm diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/HOWTO_Restarting_Ryzom_Game_Shards.htm b/code/web/docs/admin/shard_restart/HOWTO_Restarting_Ryzom_Game_Shards.htm similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/HOWTO_Restarting_Ryzom_Game_Shards.htm rename to code/web/docs/admin/shard_restart/HOWTO_Restarting_Ryzom_Game_Shards.htm diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/Hd36.xml b/code/web/docs/admin/shard_restart/Hd36.xml similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/Hd36.xml rename to code/web/docs/admin/shard_restart/Hd36.xml diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/Hf69.htm b/code/web/docs/admin/shard_restart/Hf69.htm similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/Hf69.htm rename to code/web/docs/admin/shard_restart/Hf69.htm diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/Hg39_1.gif b/code/web/docs/admin/shard_restart/Hg39_1.gif similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/Hg39_1.gif rename to code/web/docs/admin/shard_restart/Hg39_1.gif diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/Hg39_1.htm b/code/web/docs/admin/shard_restart/Hg39_1.htm similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/Hg39_1.htm rename to code/web/docs/admin/shard_restart/Hg39_1.htm diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/Hg41_2.gif b/code/web/docs/admin/shard_restart/Hg41_2.gif similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/Hg41_2.gif rename to code/web/docs/admin/shard_restart/Hg41_2.gif diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/Hg41_2.htm b/code/web/docs/admin/shard_restart/Hg41_2.htm similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/Hg41_2.htm rename to code/web/docs/admin/shard_restart/Hg41_2.htm diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/Hg43_3.gif b/code/web/docs/admin/shard_restart/Hg43_3.gif similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/Hg43_3.gif rename to code/web/docs/admin/shard_restart/Hg43_3.gif diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/Hg43_3.htm b/code/web/docs/admin/shard_restart/Hg43_3.htm similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/Hg43_3.htm rename to code/web/docs/admin/shard_restart/Hg43_3.htm diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/Hg45_4.gif b/code/web/docs/admin/shard_restart/Hg45_4.gif similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/Hg45_4.gif rename to code/web/docs/admin/shard_restart/Hg45_4.gif diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/Hg45_4.htm b/code/web/docs/admin/shard_restart/Hg45_4.htm similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/Hg45_4.htm rename to code/web/docs/admin/shard_restart/Hg45_4.htm diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/Hg47_5.gif b/code/web/docs/admin/shard_restart/Hg47_5.gif similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/Hg47_5.gif rename to code/web/docs/admin/shard_restart/Hg47_5.gif diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/Hg47_5.htm b/code/web/docs/admin/shard_restart/Hg47_5.htm similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/Hg47_5.htm rename to code/web/docs/admin/shard_restart/Hg47_5.htm diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/Hg49_6.gif b/code/web/docs/admin/shard_restart/Hg49_6.gif similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/Hg49_6.gif rename to code/web/docs/admin/shard_restart/Hg49_6.gif diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/Hg49_6.htm b/code/web/docs/admin/shard_restart/Hg49_6.htm similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/Hg49_6.htm rename to code/web/docs/admin/shard_restart/Hg49_6.htm diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/Hg51_7.gif b/code/web/docs/admin/shard_restart/Hg51_7.gif similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/Hg51_7.gif rename to code/web/docs/admin/shard_restart/Hg51_7.gif diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/Hg51_7.htm b/code/web/docs/admin/shard_restart/Hg51_7.htm similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/Hg51_7.htm rename to code/web/docs/admin/shard_restart/Hg51_7.htm diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/Hg53_8.gif b/code/web/docs/admin/shard_restart/Hg53_8.gif similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/Hg53_8.gif rename to code/web/docs/admin/shard_restart/Hg53_8.gif diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/Hg53_8.htm b/code/web/docs/admin/shard_restart/Hg53_8.htm similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/Hg53_8.htm rename to code/web/docs/admin/shard_restart/Hg53_8.htm diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/Hg55_9.gif b/code/web/docs/admin/shard_restart/Hg55_9.gif similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/Hg55_9.gif rename to code/web/docs/admin/shard_restart/Hg55_9.gif diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/Hg55_9.htm b/code/web/docs/admin/shard_restart/Hg55_9.htm similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/Hg55_9.htm rename to code/web/docs/admin/shard_restart/Hg55_9.htm diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/Hg57_10.gif b/code/web/docs/admin/shard_restart/Hg57_10.gif similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/Hg57_10.gif rename to code/web/docs/admin/shard_restart/Hg57_10.gif diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/Hg57_10.htm b/code/web/docs/admin/shard_restart/Hg57_10.htm similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/Hg57_10.htm rename to code/web/docs/admin/shard_restart/Hg57_10.htm diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/Hg59_11.gif b/code/web/docs/admin/shard_restart/Hg59_11.gif similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/Hg59_11.gif rename to code/web/docs/admin/shard_restart/Hg59_11.gif diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/Hg59_11.htm b/code/web/docs/admin/shard_restart/Hg59_11.htm similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/Hg59_11.htm rename to code/web/docs/admin/shard_restart/Hg59_11.htm diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/Hg61_12.gif b/code/web/docs/admin/shard_restart/Hg61_12.gif similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/Hg61_12.gif rename to code/web/docs/admin/shard_restart/Hg61_12.gif diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/Hg61_12.htm b/code/web/docs/admin/shard_restart/Hg61_12.htm similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/Hg61_12.htm rename to code/web/docs/admin/shard_restart/Hg61_12.htm diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/Hn68.htm b/code/web/docs/admin/shard_restart/Hn68.htm similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/Hn68.htm rename to code/web/docs/admin/shard_restart/Hn68.htm diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/Hu37.js b/code/web/docs/admin/shard_restart/Hu37.js similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/Hu37.js rename to code/web/docs/admin/shard_restart/Hu37.js diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/Hz63.htm b/code/web/docs/admin/shard_restart/Hz63.htm similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/Hz63.htm rename to code/web/docs/admin/shard_restart/Hz63.htm diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/lt_off.gif b/code/web/docs/admin/shard_restart/lt_off.gif similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/lt_off.gif rename to code/web/docs/admin/shard_restart/lt_off.gif diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/lt_over.gif b/code/web/docs/admin/shard_restart/lt_over.gif similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/lt_over.gif rename to code/web/docs/admin/shard_restart/lt_over.gif diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/rt_off.gif b/code/web/docs/admin/shard_restart/rt_off.gif similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/rt_off.gif rename to code/web/docs/admin/shard_restart/rt_off.gif diff --git a/code/ryzom/tools/server/admin/docs/shard_restart/rt_over.gif b/code/web/docs/admin/shard_restart/rt_over.gif similarity index 100% rename from code/ryzom/tools/server/admin/docs/shard_restart/rt_over.gif rename to code/web/docs/admin/shard_restart/rt_over.gif diff --git a/code/ryzom/tools/server/ryzom_ams_docs/doxygen/Doxyfile b/code/web/docs/ams/doxygen/Doxyfile similarity index 99% rename from code/ryzom/tools/server/ryzom_ams_docs/doxygen/Doxyfile rename to code/web/docs/ams/doxygen/Doxyfile index 8c4cad40f..61d3b042f 100644 --- a/code/ryzom/tools/server/ryzom_ams_docs/doxygen/Doxyfile +++ b/code/web/docs/ams/doxygen/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = "Ryzom Account Management System" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.0 +PROJECT_NUMBER = 1.1 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -721,7 +721,7 @@ WARN_FORMAT = "$file:$line: $text" # messages should be written. If left blank the output is written to standard # error (stderr). -WARN_LOGFILE = +WARN_LOGFILE = warnfile.log #--------------------------------------------------------------------------- # Configuration options related to the input files @@ -733,8 +733,8 @@ WARN_LOGFILE = # spaces. # Note: If this tag is empty the current directory is searched. -INPUT = ../../ryzom_ams \ - info.php +INPUT = ../../../private_php/ams \ + ../../../public_php/ams # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -769,11 +769,8 @@ RECURSIVE = YES # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = ../../ryzom_ams/ams_lib/smarty \ - ../../ryzom_ams/ams_lib/plugins \ - ../../ryzom_ams/www/html/misc \ - ../../ryzom_ams/www/html/templates_c \ - ../../ryzom_ams/drupal +EXCLUDE = ../../../private_php/ams/smarty \ + ../../../public_php/ams/misc/elfinder-connector # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded @@ -894,7 +891,7 @@ USE_MDFILE_AS_MAINPAGE = # also VERBATIM_HEADERS is set to NO. # The default value is: NO. -SOURCE_BROWSER = NO +SOURCE_BROWSER = YES # Setting the INLINE_SOURCES tag to YES will include the body of functions, # classes and enums directly into the documentation. @@ -1356,7 +1353,7 @@ ECLIPSE_DOC_ID = org.doxygen.Project # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. -DISABLE_INDEX = NO +DISABLE_INDEX = YES # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. If the tag @@ -1373,7 +1370,7 @@ DISABLE_INDEX = NO # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. -GENERATE_TREEVIEW = NO +GENERATE_TREEVIEW = YES # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that # doxygen will group on one line in the generated HTML documentation. @@ -2309,4 +2306,3 @@ GENERATE_LEGEND = YES # This tag requires that the tag HAVE_DOT is set to YES. DOT_CLEANUP = YES - diff --git a/code/ryzom/tools/server/ryzom_ams_docs/doxygen/img/db.png b/code/web/docs/ams/doxygen/img/db.png similarity index 100% rename from code/ryzom/tools/server/ryzom_ams_docs/doxygen/img/db.png rename to code/web/docs/ams/doxygen/img/db.png diff --git a/code/ryzom/tools/server/ryzom_ams_docs/doxygen/img/info.jpg b/code/web/docs/ams/doxygen/img/info.jpg similarity index 100% rename from code/ryzom/tools/server/ryzom_ams_docs/doxygen/img/info.jpg rename to code/web/docs/ams/doxygen/img/info.jpg diff --git a/code/ryzom/tools/server/ryzom_ams_docs/doxygen/img/info.psd b/code/web/docs/ams/doxygen/img/info.psd old mode 100755 new mode 100644 similarity index 100% rename from code/ryzom/tools/server/ryzom_ams_docs/doxygen/img/info.psd rename to code/web/docs/ams/doxygen/img/info.psd diff --git a/code/ryzom/tools/server/ryzom_ams_docs/doxygen/info.php b/code/web/docs/ams/doxygen/info.php similarity index 100% rename from code/ryzom/tools/server/ryzom_ams_docs/doxygen/info.php rename to code/web/docs/ams/doxygen/info.php diff --git a/code/ryzom/tools/server/ryzom_ams_docs/doxygen/logo.png b/code/web/docs/ams/doxygen/logo.png similarity index 100% rename from code/ryzom/tools/server/ryzom_ams_docs/doxygen/logo.png rename to code/web/docs/ams/doxygen/logo.png diff --git a/code/web/private_php/ams/autoload/.plugincache.php.swp b/code/web/private_php/ams/autoload/.plugincache.php.swp new file mode 100644 index 000000000..4993b302e Binary files /dev/null and b/code/web/private_php/ams/autoload/.plugincache.php.swp differ diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/assigned.php b/code/web/private_php/ams/autoload/assigned.php similarity index 83% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/assigned.php rename to code/web/private_php/ams/autoload/assigned.php index 8de17a9e2..9c0c2da55 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/assigned.php +++ b/code/web/private_php/ams/autoload/assigned.php @@ -6,12 +6,12 @@ */ class Assigned{ - private $user; /**< The id of the user being assigned */ - private $ticket; /**< The id of the ticket being assigned */ - - + private $user; /**< The id of the user being assigned */ + private $ticket; /**< The id of the ticket being assigned */ + + ////////////////////////////////////////////Functions//////////////////////////////////////////////////// - + /** * Assigns a ticket to a user or returns an error message. * It will first check if the ticket isn't already assigned, if not, it will create a new 'assigned' entry. @@ -30,10 +30,10 @@ class Assigned{ }else{ return "ALREADY_ASSIGNED"; } - + } - - + + /** * Unassign a ticket being coupled to a user or return an error message. * It will first check if the ticket is assigned, if this is indeed the case it will delete the 'assigned' entry. @@ -52,9 +52,9 @@ class Assigned{ }else{ return "NOT_ASSIGNED"; } - + } - + /** * Get the (external) id of the user assigned to a ticket * @param $ticket_id the Id of the ticket that's being queried @@ -65,11 +65,11 @@ class Assigned{ $statement = $dbl->execute("SELECT ticket_user.ExternId FROM `assigned` JOIN `ticket_user` ON assigned.User = ticket_user.TUserId WHERE `Ticket` = :ticket_id", Array('ticket_id' => $ticket_id)); $user_id = $statement->fetch(); return $user_id['ExternId']; - - - + + + } - + /** * Check if a ticket is already assigned (in case the user_id param is used, it will check if it's assigned to that user) * @param $ticket_id the Id of the ticket that's being queried @@ -79,26 +79,26 @@ class Assigned{ public static function isAssigned( $ticket_id, $user_id = 0) { $dbl = new DBLayer("lib"); //check if ticket is already assigned - - if($user_id == 0 && $dbl->execute(" SELECT * FROM `assigned` WHERE `Ticket` = :ticket_id", array('ticket_id' => $ticket_id) )->rowCount() ){ + + if($user_id == 0 && $dbl->select("`assigned`", array('ticket_id' => $ticket_id), "`Ticket` = :ticket_id")->rowCount() ){ return true; - }else if( $dbl->execute(" SELECT * FROM `assigned` WHERE `Ticket` = :ticket_id and `User` = :user_id", array('ticket_id' => $ticket_id, 'user_id' => $user_id) )->rowCount()){ + }else if( $dbl->select("`assigned`", array('ticket_id' => $ticket_id, 'user_id' => $user_id), "`Ticket` = :ticket_id and `User` = :user_id")->rowCount() ){ return true; }else{ return false; - } + } } - + ////////////////////////////////////////////Methods//////////////////////////////////////////////////// - + /** * A constructor. * Empty constructor */ public function __construct() { } - - + + /** * sets the object's attributes. * @param $values should be an array of the form array('User' => user_id, 'Ticket' => ticket_id). @@ -107,29 +107,25 @@ class Assigned{ $this->setUser($values['User']); $this->setTicket($values['Ticket']); } - - + + /** * creates a new 'assigned' entry. * this method will use the object's attributes for creating a new 'assigned' entry in the database. */ public function create() { $dbl = new DBLayer("lib"); - $query = "INSERT INTO `assigned` (`User`,`Ticket`) VALUES (:user, :ticket)"; - $values = Array('user' => $this->getUser(), 'ticket' => $this->getTicket()); - $dbl->execute($query, $values); + $dbl->insert("`assigned`", Array('User' => $this->getUser(), 'Ticket' => $this->getTicket())); } - - + + /** * deletes an existing 'assigned' entry. * this method will use the object's attributes for deleting an existing 'assigned' entry in the database. */ public function delete() { $dbl = new DBLayer("lib"); - $query = "DELETE FROM `assigned` WHERE `User` = :user_id and `Ticket` = :ticket_id"; - $values = array('user_id' => $this->getUser() ,'ticket_id' => $this->getTicket()); - $dbl->execute($query, $values); + $dbl->delete("`assigned`", array('user_id' => $this->getUser() ,'ticket_id' => $this->getTicket()), "`User` = :user_id and `Ticket` = :ticket_id"); } /** @@ -139,29 +135,29 @@ class Assigned{ */ public function load($ticket_id) { $dbl = new DBLayer("lib"); - $statement = $dbl->execute("SELECT * FROM `assigned` WHERE `Ticket` = :ticket_id", Array('ticket_id' => $ticket_id)); + $statement = $dbl->select("`assigned`", Array('ticket_id' => $ticket_id), "`Ticket` = :ticket_id"); $row = $statement->fetch(); $this->set($row); } - + ////////////////////////////////////////////Getters//////////////////////////////////////////////////// - + /** * get user attribute of the object. */ public function getUser(){ return $this->user; } - - + + /** * get ticket attribute of the object. */ public function getTicket(){ return $this->ticket; } - + ////////////////////////////////////////////Setters//////////////////////////////////////////////////// /** @@ -171,7 +167,7 @@ class Assigned{ public function setUser($u){ $this->user = $u; } - + /** * set ticket attribute of the object. * @param $t integer id of the ticket @@ -179,6 +175,6 @@ class Assigned{ public function setTicket($t){ $this->ticket = $t; } - - -} \ No newline at end of file + + +} diff --git a/code/web/private_php/ams/autoload/dblayer.php b/code/web/private_php/ams/autoload/dblayer.php new file mode 100644 index 000000000..f7871ebcb --- /dev/null +++ b/code/web/private_php/ams/autoload/dblayer.php @@ -0,0 +1,272 @@ + First create an object of dblayer --> $db = new DBLayer('short database name used in config') + * + * --> Insert --> $db->insert( $tb_name, $data ) + * $tb_name = table name in which we want to insert data + * $data = array of data that needs to be inserted in format('fieldname' => $value) where fieldname must be a field in that table. + * + * --> select --> $db->select( $tb_name, $data, $where ) + * $tb_name = table name which we want to select + * $data = array of data which is then required in WHERE clause in format array('fieldname'=>$value) fieldname must be a field in that table. + * $where = string in format ('fieldname=:fieldname') where :fieldname takes it's value from $data array. + * + * --> update --> $db->update( $tb_name, $data, $where ) + * $tb_name = table name which we want to update + * $data = array of data which contains the filelds that need to be updated with their values in the format('fieldname' => $value,...) where fieldname must be a field in that table. + * $where = string contains the filename with a value at that field in the format ('fieldname = $value') where fieldname must be a field in that table and $value is value respect to that field. + * + * --> delete --> $db->delete( $tb_name, $data, $where ) + * $tb_name = table name where we want to delete. + * $data = array of data which is then required in WHERE clause in format array('fieldname'=> $value) where fieldname must be a field in that table. + * $where = string in format ('fieldname=:fieldname') where :fieldname takes it's value from $data array. + * + * + * @author Daan Janssens, mentored by Matthew Lagoe + * + */ + +$PDOCache = array(); + +class DBLayer { + + private $PDO; + private $host; + private $dbname; + + /** + * The PDO object, instantiated by the constructor + */ + + /** + * The constructor. + * Instantiates the PDO object attribute by connecting to the arguments matching database(the db info is stored in the $cfg global var) + * + * @param $db String, the name of the databases entry in the $cfg global var. + * @param $dbn String, the name of the databases entry in the $cfg global var if $db referenced to an action(install etc). + */ + function __construct($db, $dbn = null) { + if ($db == "ring" && $dbn == null) { + throw new Exception("Domain database access from AMS must have database name specified"); + } + + global $cfg; + $this->host = $cfg['db'][$db]['host']; + $this->dbname = $cfg['db'][$db]['name']; + global $PDOCache; + if (isset($PDOCache[$this->host])) { + if (isset($PDOCache[$this->host]['exception'])) { + throw $PDOCache[$this->host]['exception']; + } + $this->PDO = $PDOCache[$this->host]['pdo']; + } else { + $dsn = "mysql:"; + $dsn .= "host=" . $cfg['db'][$db]['host'] . ";"; + // $dsn .= "dbname=" . $cfg['db'][$db]['name'] . ";"; // Comment this out when using the cache + $dsn .= "port=" . $cfg['db'][$db]['port'] . ";"; + + $opt = array( + PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, + PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, + // PDO::ATTR_PERSISTENT => true, + PDO::ATTR_TIMEOUT => 5 + ); + $PDOCache[$this->host] = array(); + try { + $this->PDO = new PDO($dsn, $cfg['db'][$db]['user'], $cfg['db'][$db]['pass'], $opt); + } catch (PDOException $e) { + $exception = new PDOException("Failed to connect to the '" . $db . "' database server", $e->getCode()); + $PDOCache[$this->host]['exception'] = $exception; + throw $exception; + return; + } + $PDOCache[$this->host]['pdo'] = $this->PDO; + $PDOCache[$this->host]['use'] = $this->dbname; + $this->PDO->query('USE ' . $this->dbname . ';'); // FIXME safety + } + } + + function __destruct() { + $this->PDO = NULL; + } + + function useDb() { + global $PDOCache; + if ($PDOCache[$this->host]['use'] != $this->dbname) { + $PDOCache[$this->host]['use'] = $this->dbname; + $this->PDO->query('USE ' . $this->dbname . ';'); // FIXME safety + } + } + + /** + * Execute a query that doesn't have any parameters. + * + * @param $query the mysql query. + * @return returns a PDOStatement object. + */ + public function executeWithoutParams($query) { + $this->useDb(); + $statement = $this->PDO->prepare($query); + $statement->execute(); + return $statement; + } + + /** + * Execute a query that has parameters. + * + * @param $query the mysql query. + * @param $params the parameters that are being used by the query. + * @return returns a PDOStatement object. + */ + public function execute( $query, $params ) { + $this->useDb(); + $statement = $this -> PDO -> prepare( $query ); + $statement -> execute( $params ); + return $statement; + } + + /** + * Insert function which returns id of the inserting field. + * + * @param $tb_name table name where we want to insert data. + * @param $data the parameters that are being inserted into table. + * @return returns the id of the last inserted element. + */ + public function executeReturnId($tb_name, $data, $datafunc = array()) { + $this->useDb(); + $field_options = implode(',', array_merge(array_keys($data), array_keys($datafunc))); + $field_values = implode(',', array_merge(array(':' . implode(',:', array_keys($data))), array_values($datafunc))); + try { + $sth = $this -> PDO -> prepare( "INSERT INTO $tb_name ($field_options) VALUE ($field_values)" ); + foreach ($data as $key => $value) { + $sth->bindValue( ":$key", $value ); + } + $sth->execute(); + $lastId = $this->PDO->lastInsertId(); + } + catch (Exception $e) { + throw $e; // new Exception( "error in inseting" ); + } + return $lastId; + } + + /** + * Select function using prepared statement. + * For selecting particular fields. + * + * @param string $param field to select, can be multiple fields. + * @param string $tb_name Table Name to Select. + * @param array $data array of data to be used in WHERE clause in format('fieldname'=>$value). 'fieldname' must be a field in that table. + * @param string $where where to select. + * @return statement object. + */ + public function selectWithParameter( $param, $tb_name, $data, $where ) { + $this->useDb(); + try { + $sth = $this->PDO->prepare("SELECT $param FROM $tb_name WHERE $where"); + $sth->execute($data); + } + catch (Exception $e) { + throw $e; // new Exception( "error selection" ); + return false; + } + return $sth; + } + + /** + * Select function using prepared statement. + * For selecting all fields in a table. + * + * @param string $tb_name Table Name to Select. + * @param array $data array of data to be used with WHERE part in format('fieldname'=>$value,...). 'fieldname' must be a field in that table. + * @param string $where where to select in format('fieldname=:fieldname' AND ...). + * @return statement object. + */ + public function select($tb_name, $data , $where) { + $this->useDb(); + try { + $sth = $this->PDO->prepare("SELECT * FROM $tb_name WHERE $where"); + $sth->execute( $data ); + } + catch (Exception $e) { + throw $e; // new Exception( "error selection" ); + return false; + } + return $sth; + } + + /** + * Update function with prepared statement. + * + * @param string $tb_name name of the table on which operation to be performed. + * @param array $data array of data in format('fieldname' => $value,...).Here, only those fields must be stored which needs to be updated. + * @param string $where where part in format ('fieldname'= $value AND ...). 'fieldname' must be a field in that table. + * @throws Exception error in updating. + */ + public function update($tb_name, $data, $where) { + $this->useDb(); + $field_option_values = null; + foreach ( $data as $key => $value ) { + $field_option_values .= ",$key" . '=:' . $key; + } + $field_option_values = ltrim($field_option_values, ','); + try { + $sth = $this->PDO->prepare("UPDATE `$tb_name` SET $field_option_values WHERE $where "); + + foreach ($data as $key => $value) { + $sth->bindValue(":$key", $value); + } + $sth->execute(); + } + catch (Exception $e) { + throw $e; // new Exception( 'error in updating' ); + return false; + } + return true; + } + + /** + * insert function using prepared statements. + * + * @param string $tb_name Name of the table on which operation to be performed. + * @param array $data array of data to insert in format('fieldname' => $value,....). 'fieldname' must be a field in that table. + * @throws error in inserting. + */ + public function insert($tb_name, $data, $datafunc = array()) { + $this->useDb(); + $field_options = '`'.implode('`,`', array_merge(array_keys($data), array_keys($datafunc))).'`'; + $field_values = implode(',', array_merge(array(':' . implode(',:', array_keys($data))), array_values($datafunc))); + try { + $sth = $this->PDO->prepare("INSERT INTO $tb_name ($field_options) VALUE ($field_values)"); + foreach ($data as $key => $value) { + $sth->bindValue(":$key", $value); + } + $sth->execute(); + } + catch (Exception $e) { + throw $e; // new Exception("error in inserting"); + } + } + + /** + * Delete database entery using prepared statement. + * + * @param string $tb_name table name on which operations to be performed. + * @param $data array with values in the format('fieldname'=> $value,...). 'fieldname' must be a field in that table. + * @param string $where condition based on $data array in the format('fieldname=:fieldname' AND ...). + * @throws error in deleting. + */ + public function delete( $tb_name, $data, $where ) { + $this->useDb(); + try { + $sth = $this->PDO->prepare("DELETE FROM $tb_name WHERE $where"); + $sth->execute($data); + } + catch (Exception $e) { + throw $e; // new Exception( "error in deleting" ); + } + } +} diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/forwarded.php b/code/web/private_php/ams/autoload/forwarded.php similarity index 83% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/forwarded.php rename to code/web/private_php/ams/autoload/forwarded.php index 54fece58c..a49dbedcc 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/forwarded.php +++ b/code/web/private_php/ams/autoload/forwarded.php @@ -3,16 +3,16 @@ * Handles the forwarding of a ticket to a support_group. This is being used to transfer tickets to different groups (eg Developers, Website-Team, SupportGroup etc..) * The idea is that someone can easily forward a ticket to a group and by doing that, the moderators that are in that group will receive the ticket in their todo queue. * @author Daan Janssens, mentored by Matthew Lagoe -* +* */ class Forwarded{ - - private $group; /**< The id of the group to which the ticket is being forwarded */ - private $ticket; /**< The id of the ticket being forwarded */ - + + private $group; /**< The id of the group to which the ticket is being forwarded */ + private $ticket; /**< The id of the ticket being forwarded */ + ////////////////////////////////////////////Functions//////////////////////////////////////////////////// - - + + /** * Forward a ticket to a group, also removes the previous group where it was forwarded to. * It will first check if the ticket is already forwarded, if that's the case, it will delete that entry. @@ -32,10 +32,10 @@ class Forwarded{ $forward->set(array('Group' => $group_id, 'Ticket' => $ticket_id)); $forward->create(); return "SUCCESS_FORWARDED"; - + } - - + + /** * get the id of the group a ticket is forwarded to. * @param $ticket_id the id of the ticket. @@ -46,8 +46,8 @@ class Forwarded{ $forw->load($ticket_id); return $forw->getGroup(); } - - + + /** * check if the ticket is forwarded * @param $ticket_id the id of the ticket. @@ -55,25 +55,25 @@ class Forwarded{ */ public static function isForwarded( $ticket_id) { $dbl = new DBLayer("lib"); - if( $dbl->execute(" SELECT * FROM `forwarded` WHERE `Ticket` = :ticket_id", array('ticket_id' => $ticket_id))->rowCount()){ + if( $dbl->select("`forwarded`", array('ticket_id' => $ticket_id), "`Ticket` = :ticket_id")->rowCount() ){ return true; }else{ return false; - } - + } + } - + ////////////////////////////////////////////Methods//////////////////////////////////////////////////// - - + + /** * A constructor. * Empty constructor */ public function __construct() { } - - + + /** * sets the object's attributes. * @param $values should be an array of the form array('Group' => group_id, 'Ticket' => ticket_id). @@ -82,29 +82,25 @@ class Forwarded{ $this->setGroup($values['Group']); $this->setTicket($values['Ticket']); } - - + + /** * creates a new 'forwarded' entry. * this method will use the object's attributes for creating a new 'forwarded' entry in the database. */ public function create() { $dbl = new DBLayer("lib"); - $query = "INSERT INTO `forwarded` (`Group`,`Ticket`) VALUES (:group, :ticket)"; - $values = Array('group' => $this->getGroup(), 'ticket' => $this->getTicket()); - $dbl->execute($query, $values); + $dbl->insert("`forwarded`", Array('Group' => $this->getGroup(), 'Ticket' => $this->getTicket())); } - - + + /** * deletes an existing 'forwarded' entry. * this method will use the object's attributes for deleting an existing 'forwarded' entry in the database. */ public function delete() { $dbl = new DBLayer("lib"); - $query = "DELETE FROM `forwarded` WHERE `Group` = :group_id and `Ticket` = :ticket_id"; - $values = array('group_id' => $this->getGroup() ,'ticket_id' => $this->getTicket()); - $dbl->execute($query, $values); + $dbl->delete("`forwarded`", array('group_id' => $this->getGroup() ,'ticket_id' => $this->getTicket(), "`Group` = :group_id and `Ticket` = :ticket_id")); } @@ -115,28 +111,28 @@ class Forwarded{ */ public function load( $ticket_id) { $dbl = new DBLayer("lib"); - $statement = $dbl->execute("SELECT * FROM `forwarded` WHERE `Ticket` = :ticket_id", Array('ticket_id' => $ticket_id)); + $statement = $dbl->select("`forwarded`", Array('ticket_id' => $ticket_id), "`Ticket` = :ticket_id"); $row = $statement->fetch(); $this->set($row); } - + ////////////////////////////////////////////Getters//////////////////////////////////////////////////// - + /** * get group attribute of the object. */ public function getGroup(){ return $this->group; } - + /** * get ticket attribute of the object. */ public function getTicket(){ return $this->ticket; } - + ////////////////////////////////////////////Setters//////////////////////////////////////////////////// /** @@ -146,7 +142,7 @@ class Forwarded{ public function setGroup($g){ $this->group = $g; } - + /** * set ticket attribute of the object. * @param $t integer id of the ticket @@ -154,6 +150,6 @@ class Forwarded{ public function setTicket($t){ $this->ticket = $t; } - - -} \ No newline at end of file + + +} diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/gui_elements.php b/code/web/private_php/ams/autoload/gui_elements.php similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/gui_elements.php rename to code/web/private_php/ams/autoload/gui_elements.php diff --git a/code/web/private_php/ams/autoload/helpers.php b/code/web/private_php/ams/autoload/helpers.php new file mode 100644 index 000000000..28e4ce036 --- /dev/null +++ b/code/web/private_php/ams/autoload/helpers.php @@ -0,0 +1,278 @@ + setCompileDir( $SITEBASE . '/templates_c/' ); + $smarty -> setCacheDir( $AMS_CACHEDIR ); + $smarty -> setConfigDir( $SITEBASE . '/configs/' ); + // turn smarty debugging on/off + $smarty -> debugging = false; + // caching must be disabled for multi-language support + $smarty -> caching = false; + $smarty -> cache_lifetime = 300; + + $smarty->addPluginsDir($AMS_PLUGINS); + + if (function_exists('apc_cache_info')) { + // production + //$smarty->caching = true; + //$smarty->setCachingType("apc"); + //$smarty->compile_check = false; + } + + // needed by smarty. + helpers :: create_folders (); + global $FORCE_INGAME; + + // if ingame, then use the ingame templates + if ( helpers :: check_if_game_client() or $FORCE_INGAME ) { + $smarty -> template_dir = $AMS_LIB . '/ingame_templates/'; + $smarty -> setConfigDir( $AMS_LIB . '/configs' ); + $variables = parse_ini_file( $AMS_LIB . '/configs/ingame_layout.ini', true ); + foreach ( $variables[$INGAME_LAYOUT] as $key => $value ) { + $smarty -> assign( $key, $value ); + } + } else { + $smarty -> template_dir = $SITEBASE . '/templates/'; + $smarty -> setConfigDir( $SITEBASE . '/configs' ); + } + + foreach ( $vars as $key => $value ) { + $smarty -> assign( $key, $value ); + } + + // load page specific variables that are language dependent + $variables = Helpers :: handle_language(); + if ( $template != 'layout_plugin' ) + { + foreach ( $variables[$template] as $key => $value ) { + $smarty -> assign( $key, $value ); + } + } + // load ams content variables that are language dependent + foreach ( $variables['ams_content'] as $key => $value ) { + $smarty -> assign( $key, $value ); + } + + //load ams content variables that are language dependent + foreach ( $variables['ams_content'] as $key => $value){ + $smarty -> assign( $key, $value); + } + + $id = session_id(); + $smarty -> assign( "sessionid", $id ); + + $dbl = new DBLayer("lib"); + $statement = $dbl->executeWithoutParams("SELECT * FROM settings"); + $rows = $statement->fetchAll(); + + foreach ($rows as &$value) { + $smarty -> assign( $value['Setting'], $value['Value'] ); + } + + // smarty inheritance for loading the matching wrapper layout (with the matching menu bar) + if ( isset( $vars['permission'] ) && $vars['permission'] == 3 ) { + $inherited = "extends:layout_admin.tpl|"; + } else if ( isset( $vars['permission'] ) && $vars['permission'] == 2 ) { + $inherited = "extends:layout_mod.tpl|"; + } else if ( isset( $vars['permission'] ) && $vars['permission'] == 1 ) { + $inherited = "extends:layout_user.tpl|"; + } else { + $inherited = ""; + } + + // if $returnHTML is set to true, return the html by fetching the template else display the template. + if ( $returnHTML == true ) { + return $smarty -> fetch( $inherited . $template . '.tpl' ); + } else { + $smarty -> display( $inherited . $template . '.tpl' ); + } + } + + + /** + * creates the folders that are needed for smarty. + * + * @todo for the drupal module it might be possible that drupal_mkdir needs to be used instead of mkdir, also this should be in the install.php instead. + */ + static public function create_folders() { + global $AMS_LIB; + global $SITEBASE; + $arr = array( $AMS_LIB . '/ingame_templates/', + $AMS_LIB . '/configs', + // $AMS_LIB . '/cache', + $SITEBASE . '/cache/', + $SITEBASE . '/templates/', + $SITEBASE . '/templates_c/', + $SITEBASE . '/configs' + ); + foreach ( $arr as &$value ) { + + if ( !file_exists( $value ) ) { + print( $value ); + mkdir( $value ); + } + } + + } + + + /** + * check if the http request is sent ingame or not. + * + * @return returns true in case it's sent ingame, else false is returned. + */ + static public function check_if_game_client() + { + // if HTTP_USER_AGENT is not set then its ryzom core + global $FORCE_INGAME; + if ( ( isset( $_SERVER['HTTP_USER_AGENT'] ) && ( strpos( $_SERVER['HTTP_USER_AGENT'], "Ryzom" ) === 0 ) ) || $FORCE_INGAME || ! isset( $_SERVER['HTTP_USER_AGENT'] ) ) { + return true; + } else { + return false; + } + } + + + /** + * Handles the language specific aspect. + * The language can be changed by setting the $_GET['Language'] & $_GET['setLang'] together. This will also change the language entry of the user in the db. + * Cookies are also being used in case the user isn't logged in. + * + * @return returns the parsed content of the language .ini file related to the users language setting. + */ + static public function handle_language() { + global $DEFAULT_LANGUAGE; + global $AMS_TRANS; + + // if user wants to change the language + if ( isset( $_GET['Language'] ) && isset( $_GET['setLang'] ) ) { + // The ingame client sometimes sends full words, derive those! + switch ( $_GET['Language'] ) { + + case "English": + $lang = "en"; + break; + + case "French": + $lang = "fr"; + break; + + default: + $lang = $_GET['Language']; + } + // if the file exists en the setLang = true + if ( file_exists( $AMS_TRANS . '/' . $lang . '.ini' ) && $_GET['setLang'] == "true" ) { + // set a cookie & session var and incase logged in write it to the db! + setcookie( 'Language', $lang , time() + 60 * 60 * 24 * 30 ); + $_SESSION['Language'] = $lang; + if ( WebUsers :: isLoggedIn() ) { + WebUsers :: setLanguage( $_SESSION['id'], $lang ); + } + } else { + $_SESSION['Language'] = $DEFAULT_LANGUAGE; + } + } else { + // if the session var is not set yet + if ( !isset( $_SESSION['Language'] ) ) { + // check if a cookie already exists for it + if ( isset( $_COOKIE['Language'] ) ) { + $_SESSION['Language'] = $_COOKIE['Language']; + // else use the default language + } else { + $_SESSION['Language'] = $DEFAULT_LANGUAGE; + } + } + } + +if ( $_SESSION['Language'] == "" ) { + $_SESSION['Language'] = $DEFAULT_LANGUAGE; + } +return parse_ini_file( $AMS_TRANS . '/' . $_SESSION['Language'] . '.ini', true ); + + } + + + /** + * Time output function for handling the time display. + * + * @return returns the time in the format specified in the $TIME_FORMAT global variable. + */ + static public function outputTime($time, $str = 1) { + global $TIME_FORMAT; + if ($str) { + return date($TIME_FORMAT, strtotime($time)); + } else { + return date($TIME_FORMAT, $time); + } + } + + /** + * Auto login function for ingame use. + * This function will allow users who access the website ingame, to log in without entering the username and password. It uses the COOKIE entry in the open_ring db. + * it checks if the cookie sent by the http request matches the one in the db. This cookie in the db is changed everytime the user relogs. + * + * @return returns "FALSE" if the cookies didn't match, else it returns an array with the user's id and name. + */ + static public function check_login_ingame() { + return NULL; + + // FIXME + /* + if ( helpers :: check_if_game_client () or $forcelibrender = false ) { + $dbr = new DBLayer( "ring" ); + if ( isset( $_GET['UserId'] ) && isset( $_COOKIE['ryzomId'] ) ) { + $id = $_GET['UserId']; + + $statement = $dbr -> select( "ring_users", array( 'id' => $id, 'cookie' => $_COOKIE['ryzomId'] ), "user_id=:id AND cookie =:cookie" ); + + // $statement = $dbr->execute("SELECT * FROM ring_users WHERE user_id=:id AND cookie =:cookie", array('id' => $id, 'cookie' => $_COOKIE['ryzomId'])); + + if ( $statement -> rowCount() ) { + $entry = $statement -> fetch(); + // print_r($entry); + return array( 'id' => $entry['user_id'], 'name' => $entry['user_name'] ); + } else { + return "FALSE"; + } + } else { + return "FALSE"; + } + } else { + return "FALSE"; + } + } + */ + } + +} diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/in_support_group.php b/code/web/private_php/ams/autoload/in_support_group.php similarity index 83% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/in_support_group.php rename to code/web/private_php/ams/autoload/in_support_group.php index bf10d3d9a..73d075168 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/in_support_group.php +++ b/code/web/private_php/ams/autoload/in_support_group.php @@ -21,7 +21,7 @@ class In_Support_Group{ public static function userExistsInSGroup( $user_id, $group_id) { $dbl = new DBLayer("lib"); //check if name is already used - if( $dbl->execute(" SELECT * FROM `in_support_group` WHERE `User` = :user_id and `Group` = :group_id ", array('user_id' => $user_id, 'group_id' => $group_id) )->rowCount() ){ + if( $dbl->select("in_support_group", array('user_id' => $user_id, 'group_id' => $group_id), "`User` = :user_id and `Group` = :group_id")->rowCount() ){ return true; }else{ return false; @@ -54,9 +54,7 @@ class In_Support_Group{ */ public function create() { $dbl = new DBLayer("lib"); - $query = "INSERT INTO `in_support_group` (`User`,`Group`) VALUES (:user, :group)"; - $values = Array('user' => $this->user, 'group' => $this->group); - $dbl->execute($query, $values); + $dbl->insert("`in_support_group`", Array('User' => $this->user, 'Group' => $this->group)); } @@ -66,9 +64,7 @@ class In_Support_Group{ */ public function delete() { $dbl = new DBLayer("lib"); - $query = "DELETE FROM `in_support_group` WHERE `User` = :user_id and `Group` = :group_id"; - $values = array('user_id' => $this->getUser() ,'group_id' => $this->getGroup()); - $dbl->execute($query, $values); + $dbl->delete("`in_support_group`", array('user_id' => $this->getUser() ,'group_id' => $this->getGroup()), "`User` = :user_id and `Group` = :group_id"); } /* @@ -118,4 +114,4 @@ class In_Support_Group{ } -} \ No newline at end of file +} diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/mail_handler.php b/code/web/private_php/ams/autoload/mail_handler.php similarity index 97% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/mail_handler.php rename to code/web/private_php/ams/autoload/mail_handler.php index dde8d4e02..643b57076 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/mail_handler.php +++ b/code/web/private_php/ams/autoload/mail_handler.php @@ -16,7 +16,11 @@ class Mail_Handler{ */ private function mail_fork() { //Start a new child process and return the process id! - $pid = pcntl_fork(); + if (function_exists('pcntl_fork')) { + $pid = pcntl_fork(); + } else { + $pid = getmypid (); + } return $pid; } @@ -118,12 +122,8 @@ class Mail_Handler{ $id_user = $recipient; $recipient = NULL; } - - $query = "INSERT INTO email (Recipient,Subject,Body,Status,Attempts,Sender,UserId,MessageId,TicketId) VALUES (:recipient, :subject, :body, :status, :attempts, :sender, :id_user, :messageId, :ticketId)"; - $values = array('recipient' => $recipient, 'subject' => $subject, 'body' => $body, 'status' => 'NEW', 'attempts'=> 0, 'sender' => $from,'id_user' => $id_user, 'messageId' => 0, 'ticketId'=> $ticket_id); - $db = new DBLayer("lib"); - $db->execute($query, $values); - + $db = new DBLayer($db); + $db->insert("email", array('Recipient' => $recipient, 'Subject' => $subject, 'Body' => $body, 'Status' => 'NEW', 'Attempts'=> 0, 'Sender' => $from,'UserId' => $id_user, 'MessageId' => 0, 'TicketId'=> $ticket_id)); } @@ -173,7 +173,7 @@ class Mail_Handler{ //select all new & failed emails & try to send them //$emails = db_query("select * from email where status = 'NEW' or status = 'FAILED'"); - $statement = $this->db->executeWithoutParams("select * from email where Status = 'NEW' or Status = 'FAILED'"); + $statement = $this->db->select("email",array(null), "Status = 'NEW' or Status = 'FAILED'"); $emails = $statement->fetchAll(); foreach($emails as $email) { diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/mycrypt.php b/code/web/private_php/ams/autoload/mycrypt.php similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/mycrypt.php rename to code/web/private_php/ams/autoload/mycrypt.php diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/pagination.php b/code/web/private_php/ams/autoload/pagination.php similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/pagination.php rename to code/web/private_php/ams/autoload/pagination.php diff --git a/code/web/private_php/ams/autoload/plugincache.php b/code/web/private_php/ams/autoload/plugincache.php new file mode 100644 index 000000000..7150e2087 --- /dev/null +++ b/code/web/private_php/ams/autoload/plugincache.php @@ -0,0 +1,280 @@ + setId( $values['Id'] ); + $this -> setPluginName( $values['Name'] ); + $this -> setPluginType( $values['Type'] ); + $this -> setPluginPermission( $values['Permission'] ); + $this -> setPluginStatus( $values['Status'] ); + $this -> setPluginInfo( json_decode( $values['Info'] ) ); + @$this -> setUpdateInfo( json_decode( $values['UpdateInfo'] ) ); + } + + /** + * loads the object's attributes. + */ + + public function load_With_SID() { + $dbl = new DBLayer( "lib" ); + $statement = $dbl -> executeWithoutParams( "SELECT * FROM plugins" ); + $row = $statement -> fetch(); + $this -> set( $row ); + } + + /** + * get plugin id attribute of the object. + * + * @return integer id + */ + public function getId() { + return $this -> Id; + } + + /** + * get plugin permission attribute of the object. + */ + public function getPluginPermission() { + return $this -> plugin_permission; + } + + /** + * get plugin Type attribute of the object. + */ + public function getPluginType() { + return $this -> plugin_version; + } + + /** + * get plugin status attribute of the object. + */ + public function getPluginStatus() { + return $this -> plugin_status; + } + + /** + * get plugin name attribute of the object. + */ + public function getPluginName() { + return $this -> plugin_name; + } + + /** + * get plugin info array attribute of the object. + */ + public function getPluginInfo() { + return $this -> plugin_info; + } + + /** + * set plugin id attribute of the object. + * + * @param $s integer id + */ + public function setId( $s ) { + $this -> Id = $s; + } + + /** + * set plugin permission attribute of the object. + * + * @param $t type of the query, set permission + */ + public function setPluginPermission( $t ) { + $this -> plugin_permission = $t; + } + + /** + * set plugin version attribute of the object. + * + * @param $q string to set plugin version + */ + public function setPluginType( $q ) { + $this -> plugin_version = $q; + } + + /** + * set plugin status attribute of the object. + * + * @param $d status code type int + */ + public function setPluginStatus( $d ) { + $this -> plugin_status = $d; + } + + /** + * set plugin name attribute of the object. + * + * @param $p_n string to set plugin name. + */ + public function setPluginName( $p_n ) { + $this -> plugin_name = $p_n; + } + + /** + * set plugin info attribute array of the object. + * + * @param $p_n array + */ + public function setPluginInfo( $p_n ) { + $this -> plugin_info = $p_n; + } + + /** + * functionalities for plugin updates + */ + + /** + * set update info attribute array of the object. + * + * @param $p_n array + */ + public function setUpdateInfo( $p_n ) { + $this -> update_info = $p_n; + } + + /** + * get plugin info array attribute of the object. + */ + public function getUpdateInfo() { + return $this -> update_info; + } + + /** + * some more plugin function that requires during plugin operations + */ + + /** + * function to remove a non empty directory + * + * @param $dir directory address + * @return boolean + */ + public static function rrmdir( $dir ) { + $result = array_diff( scandir( $dir ), array( '.', '..' ) ); + foreach( $result as $item ) + { + if ( !@unlink( $dir . '/' . $item ) ) + Plugincache :: rrmdir( $dir . '/' . $item ); + } + return rmdir( $dir ); + } + + /** + * function to unzip the zipped files + * + * @param $target_path path to the target zipped file + * @param $destination path to the destination + * @return boolean + */ + public static function zipExtraction( $target_path, $destination ) + { + $zip = new ZipArchive(); + $x = $zip -> open( $target_path ); + if ( $x === true ) { + if ( $zip -> extractTo( $destination ) ) + { + $zip -> close(); + return true; + } + else + { + $zip -> close(); + return false; + } + } + } + + /** + * Returns plugin information with respect to the id. + * + * @param $id plugin id. + * @param $fieldName string plugin field to return + * + * @return info field from the db. + */ + public static function pluginInfoUsingId( $id, $fieldName ) + { + $db = new DBLayer( 'lib' ); + $sth = $db -> selectWithParameter( $fieldName, 'plugins', array( 'id' => $id ), 'Id=:id' ); + $row = $sth -> fetch(); + return $row[$fieldName]; + } + + /** + * Function provides list of active plugins + * + * @return list of active plugins + */ + public static function activePlugins() + { + $db = new DBLayer( 'lib' ); + $sth = $db -> selectWithParameter( 'Id', 'plugins', array( 'status' => 1 ), 'Status=:status' ); + $row = $sth -> fetchAll(); + return $row; + } + + /** + * function to load hooks for the active plugins + * and return the contents get from them. + * + * -->Get the list of active plugins then call the global + * hooks exists in the plugins hook file ($pluginName.php). + * -->Collect the contents from the hooks and associate within + * array with key referenced plugin name. + * -->return the content to use with smarty template loader + * + * @return $content content get from hooks + */ + public static function loadHooks() { + $content = array(); + $ac_arr = Plugincache::activePlugins(); + foreach ($ac_arr as $key => $value) { + $plugin_path = Plugincache::pluginInfoUsingId($value['Id'], 'FileName'); + $template_path = json_decode(Plugincache::pluginInfoUsingId($value['Id'], 'Info'))->TemplatePath; + $plugin_name = $plugin_path; + + // calling hooks in the $pluginName.php + global $AMS_PLUGINS; + include $AMS_PLUGINS . '/' . $plugin_name . '/' . $plugin_name . '.php'; + $arr = get_defined_functions(); + + foreach ($arr['user'] as $key => $value) { + switch (strtolower($value)) { + case strtolower($plugin_name).'_hook_display': + case strtolower($plugin_name).'_hook_call_rest': + case strtolower($plugin_name).'_hook_get_db': + case strtolower($plugin_name).'_hook_return_global': + case strtolower($plugin_name).'_hook_activate': + $content['hook_info'][$plugin_name] = call_user_func($value); + break; + } + } + // path for the template + $content['hook_info'][$plugin_name]['TemplatePath'] = $template_path; + } + + return $content; + } +} diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/querycache.php b/code/web/private_php/ams/autoload/querycache.php similarity index 89% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/querycache.php rename to code/web/private_php/ams/autoload/querycache.php index 3da0887c9..ef55085b4 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/querycache.php +++ b/code/web/private_php/ams/autoload/querycache.php @@ -47,7 +47,7 @@ class Querycache{ */ public function load_With_SID( $id) { $dbl = new DBLayer("lib"); - $statement = $dbl->execute("SELECT * FROM ams_querycache WHERE SID=:id", array('id' => $id)); + $statement = $dbl->select("ams_querycache", array('id' => $id), "SID=:id"); $row = $statement->fetch(); $this->set($row); } @@ -58,9 +58,7 @@ class Querycache{ */ public function update(){ $dbl = new DBLayer("lib"); - $query = "UPDATE ams_querycache SET type= :t, query = :q, db = :d WHERE SID=:id"; - $values = Array('id' => $this->getSID(), 't' => $this->getType(), 'q' => $this->getQuery(), 'd' => $this->getDb()); - $statement = $dbl->execute($query, $values); + $dbl->update("ams_querycache", Array('type' => $this->getType(), 'query' => $this->getQuery(), 'db' => $this->getDb(), "SID=$this->getSID()" )); } ////////////////////////////////////////////Getters//////////////////////////////////////////////////// @@ -127,4 +125,4 @@ class Querycache{ $this->db= $d; } -} \ No newline at end of file +} diff --git a/code/web/private_php/ams/autoload/rest_api.php b/code/web/private_php/ams/autoload/rest_api.php new file mode 100644 index 000000000..e35586042 --- /dev/null +++ b/code/web/private_php/ams/autoload/rest_api.php @@ -0,0 +1,74 @@ +execute("SELECT * FROM support_group WHERE SGroupId = :id", array('id' => $id)); + $statement = $dbl->select("support_group", array('id' => $id), "SGroupId = :id"); $row = $statement->fetch(); $instanceGroup = new self(); $instanceGroup->set($row); @@ -60,10 +60,10 @@ class Support_Group{ * @return a string that specifies if it was a success or not (SUCCESS, SIZE_ERROR, NAME_TAKEN or TAG_TAKEN ) */ public static function createSupportGroup( $name, $tag, $groupemail, $imap_mailserver, $imap_username, $imap_password) { - error_log( "Error at line " . __LINE__ . " in file " . __FILE__); + //error_log( "Error at line " . __LINE__ . " in file " . __FILE__); if(strlen($name) <= 21 && strlen($name) >= 4 &&strlen($tag) <= 8 && strlen($tag) >= 2 ){ $notExists = self::supportGroup_EntryNotExists($name, $tag); - error_log( "Error at line " . __LINE__ . " in file " . __FILE__); + //error_log( "Error at line " . __LINE__ . " in file " . __FILE__); if ( $notExists == "SUCCESS" ){ $sGroup = new self(); $values = array('Name' => $name, 'Tag' => $tag, 'GroupEmail' => $groupemail, 'IMAP_MailServer' => $imap_mailserver, 'IMAP_Username' => $imap_username, 'IMAP_Password' => $imap_password); @@ -80,14 +80,14 @@ class Support_Group{ $sGroup->setIMAP_Password($enc_password); $sGroup->create(); - error_log( "Error at line " . __LINE__ . " in file " . __FILE__); + //error_log( "Error at line " . __LINE__ . " in file " . __FILE__); }else{ - error_log( "Error at line " . __LINE__ . " in file " . __FILE__); + //error_log( "Error at line " . __LINE__ . " in file " . __FILE__); //return NAME_TAKEN or TAG_TAKEN return $notExists; } }else{ - error_log( "Error at line " . __LINE__ . " in file " . __FILE__); + //error_log( "Error at line " . __LINE__ . " in file " . __FILE__); //RETURN ERROR that indicates SIZE return "SIZE_ERROR"; } @@ -102,10 +102,10 @@ class Support_Group{ public static function supportGroup_EntryNotExists( $name, $tag) { $dbl = new DBLayer("lib"); //check if name is already used - if( $dbl->execute("SELECT * FROM support_group WHERE Name = :name",array('name' => $name))->rowCount() ){ + if( $dbl->select("support_group", array('name' => $name), "Name = :name")->rowCount() ){ return "NAME_TAKEN"; } - else if( $dbl->execute("SELECT * FROM support_group WHERE Tag = :tag",array('tag' => $tag))->rowCount() ){ + else if( $dbl->select("support_group", array('tag' => $tag), "Tag = :tag")->rowCount() ){ return "TAG_TAKEN"; }else{ return "SUCCESS"; @@ -121,7 +121,7 @@ class Support_Group{ public static function supportGroup_Exists( $id) { $dbl = new DBLayer("lib"); //check if supportgroup id exist - if( $dbl->execute("SELECT * FROM support_group WHERE SGroupId = :id",array('id' => $id ))->rowCount() ){ + if( $dbl->select("support_group", array('id' => $id ), "SGroupId = :id")->rowCount() ){ return true; }else{ return false; @@ -305,9 +305,7 @@ class Support_Group{ */ public function create() { $dbl = new DBLayer("lib"); - $query = "INSERT INTO support_group (Name, Tag, GroupEmail, IMAP_MailServer, IMAP_Username, IMAP_Password) VALUES (:name, :tag, :groupemail, :imap_mailserver, :imap_username, :imap_password)"; - $values = Array('name' => $this->getName(), 'tag' => $this->getTag(), 'groupemail' => $this->getGroupEmail(), 'imap_mailserver' => $this->getIMAP_MailServer(), 'imap_username' => $this->getIMAP_Username(), 'imap_password' => $this->getIMAP_Password()); - $dbl->execute($query, $values); + $dbl->insert("support_group", Array('Name' => $this->getName(), 'Tag' => $this->getTag(), 'GroupEmail' => $this->getGroupEmail(), 'IMAP_MailServer' => $this->getIMAP_MailServer(), 'IMAP_Username' => $this->getIMAP_Username(), 'IMAP_Password' => $this->getIMAP_Password())); } @@ -318,7 +316,7 @@ class Support_Group{ */ public function load_With_SGroupId( $id) { $dbl = new DBLayer("lib"); - $statement = $dbl->execute("SELECT * FROM `support_group` WHERE `SGroupId` = :id", array('id' => $id)); + $statement = $dbl->select("`support_group`", array('id' => $id), "`SGroupId` = :id"); $row = $statement->fetch(); $this->set($row); } @@ -329,9 +327,7 @@ class Support_Group{ */ public function update(){ $dbl = new DBLayer("lib"); - $query = "UPDATE `support_group` SET `Name` = :name, `Tag` = :tag, `GroupEmail` = :groupemail, `IMAP_MailServer` = :mailserver, `IMAP_Username` = :username, `IMAP_Password` = :password WHERE `SGroupId` = :id"; - $values = Array('id' => $this->getSGroupId(), 'name' => $this->getName(), 'tag' => $this->getTag(), 'groupemail' => $this->getGroupEmail(), 'mailserver' => $this->getIMAP_MailServer(), 'username' => $this->getIMAP_Username(), 'password' => $this->getIMAP_Password() ); - $statement = $dbl->execute($query, $values); + $dbl->update("`support_group`", Array('Name' => $this->getName(), 'Tag' => $this->getTag(), 'GroupEmail' => $this->getGroupEmail(), 'IMAP_MailServer' => $this->getIMAP_MailServer(), 'IMAP_Username' => $this->getIMAP_Username(), 'IMAP_password' => $this->getIMAP_Password()), "`SGroupId` = ".$this->getSGroupId()); } @@ -341,9 +337,7 @@ class Support_Group{ */ public function delete(){ $dbl = new DBLayer("lib"); - $query = "DELETE FROM `support_group` WHERE `SGroupId` = :id"; - $values = Array('id' => $this->getSGroupId()); - $statement = $dbl->execute($query, $values); + $dbl->delete("`support_group`", Array('id' => $this->getSGroupId()), "`SGroupId` = :id"); } ////////////////////////////////////////////Getters//////////////////////////////////////////////////// @@ -453,4 +447,4 @@ class Support_Group{ public function setIMAP_Password($p){ $this->iMap_Password = $p; } -} \ No newline at end of file +} diff --git a/code/web/private_php/ams/autoload/sync.php b/code/web/private_php/ams/autoload/sync.php new file mode 100644 index 000000000..1160b91b5 --- /dev/null +++ b/code/web/private_php/ams/autoload/sync.php @@ -0,0 +1,132 @@ +executeWithoutParams("SELECT * FROM ams_querycache"); + $rows = $statement->fetchAll(); + foreach ($rows as $record) { + + $db = new DBLayer($record['db']); + switch($record['type']) { + case 'createPermissions': + $decode = json_decode($record['query']); + $values = array('username' => $decode[0]); + //make connection with and put into shard db & delete from the lib + $sth=$db->selectWithParameter("UId", "user", $values, "Login= :username" ); + $result = $sth->fetchAll(); + /*foreach ($result as $UId) { + $ins_values = array('UId' => $UId['UId']); + $ins_values['ClientApplication'] = "r2"; + $ins_values['AccessPrivilege'] = "OPEN"; + $db->insert("permission", $ins_values); + $ins_values['ClientApplication'] = 'ryzom_open'; + $db->insert("permission",$ins_values); + }*/ // FIXME: GARBAGE + break; + case 'change_pass': + $decode = json_decode($record['query']); + $values = array('Password' => $decode[1]); + //make connection with and put into shard db & delete from the lib + $db->update("user", $values, "Login = '$decode[0]'"); + break; + case 'change_mail': + $decode = json_decode($record['query']); + $values = array('Email' => $decode[1]); + //make connection with and put into shard db & delete from the lib + $db->update("user", $values, "Login = '$decode[0]'"); + break; + case 'createUser': + $decode = json_decode($record['query']); + $values = array('Login' => $decode[0], 'Password' => $decode[1], 'Email' => $decode[2] ); + //make connection with and put into shard db & delete from the lib + $db->insert("user", $values); + break; + } + $dbl->delete("ams_querycache", array('SID' => $record['SID']), "SID=:SID"); + } + if ($display == true) { + print('Syncing completed'); + } + } + catch (PDOException $e) { + if ($display == true) { + print('Something went wrong! The shard is probably still offline!'); + print_r($e); + } + } + unlink($pidfile); + } + + } + } + + public static function check_for_pid($pid){ + + $OS = Sync::getOS(); + + if ($OS == 2) { + $processes = explode( "\n", shell_exec( "tasklist.exe" )); + foreach( $processes as $key => $value ) + { + if( empty($value) != '1' && strpos( "Image Name", $value ) === 0 + || empty($value) != '1' && strpos( "===", $value ) === 0 ) + continue; + $matches = false; + preg_match( "/(.*?)\s+(\d+).*$/", $value, $matches ); + if (isset($matches[ 2 ]) && $pid = $matches[ 2 ]) { + return true; + } + } + } else { + return file_exists( "/proc/".$pid ); + } + } + static public function getOS() { + switch (true) { + case stristr(PHP_OS, 'DAR'): return self::OS_OSX; + case stristr(PHP_OS, 'WIN'): return self::OS_WIN; + case stristr(PHP_OS, 'LINUX'): return self::OS_LINUX; + default : return self::OS_UNKNOWN; + } + } +} diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket.php b/code/web/private_php/ams/autoload/ticket.php similarity index 83% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket.php rename to code/web/private_php/ams/autoload/ticket.php index 21e2614d5..a47a61659 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket.php +++ b/code/web/private_php/ams/autoload/ticket.php @@ -6,19 +6,19 @@ * @author Daan Janssens, mentored by Matthew Lagoe */ class Ticket{ - - private $tId; /**< The id of ticket */ - private $timestamp; /**< Timestamp of the ticket */ - private $title; /**< Title of the ticket */ - private $status; /**< Status of the ticket (0 = waiting on user reply, 1 = waiting on support, (2= not used atm), 3 = closed */ - private $queue; /**< (not in use atm) */ - private $ticket_category; /**< the id of the category belonging to the ticket */ - private $author; /**< The ticket_users id */ - private $priority; /**< The priority of the ticket where 0 = low, 3= supadupahigh */ - + + private $tId; /**< The id of ticket */ + private $timestamp; /**< Timestamp of the ticket */ + private $title; /**< Title of the ticket */ + private $status; /**< Status of the ticket (0 = waiting on user reply, 1 = waiting on support, (2= not used atm), 3 = closed */ + private $queue; /**< (not in use atm) */ + private $ticket_category; /**< the id of the category belonging to the ticket */ + private $author; /**< The ticket_users id */ + private $priority; /**< The priority of the ticket where 0 = low, 3= supadupahigh */ + ////////////////////////////////////////////Functions//////////////////////////////////////////////////// - - + + /** * check if a ticket exists. * @param $id the id of the ticket to be checked. @@ -27,14 +27,14 @@ class Ticket{ public static function ticketExists($id) { $dbl = new DBLayer("lib"); //check if ticket exists - if( $dbl->execute(" SELECT * FROM `ticket` WHERE `TId` = :ticket_id", array('ticket_id' => $id) )->rowCount() ){ + if( $dbl->select("`ticket`", array('ticket_id' => $id), "`TId` = :ticket_id")->rowCount() ){ return true; }else{ return false; - } + } } - - + + /** * return an array of the possible statuses * @return an array containing the string values that represent the different statuses. @@ -51,8 +51,8 @@ class Ticket{ public static function getPriorityArray() { return Array("Low","Normal","High","Super Dupa High"); } - - + + /** * return an entire ticket. * returns the ticket object and an array of all replies to that ticket. @@ -64,10 +64,10 @@ class Ticket{ $ticket = new Ticket(); $ticket->load_With_TId($id); $reply_array = Ticket_Reply::getRepliesOfTicket($id, $view_as_admin); - return Array('ticket_obj' => $ticket,'reply_array' => $reply_array); + return Array('ticket_obj' => $ticket,'reply_array' => $reply_array); } - - + + /** * return all tickets of a specific user. * an array of all tickets created by a specific user are returned by this function. @@ -90,11 +90,11 @@ class Ticket{ $instance->setAuthor($ticket['Author']); $result[] = $instance; } - return $result; + return $result; } - - - + + + /** * function that creates a new ticket. * A new ticket will be created, in case the extra_info != 0 and the http request came from ingame, then a ticket_info page will be created. @@ -117,13 +117,13 @@ class Ticket{ $ticket->set($values); $ticket->create(); $ticket_id = $ticket->getTId(); - + //if ingame then add an extra info if(Helpers::check_if_game_client() && $extra_info != 0){ $extra_info['Ticket'] = $ticket_id; Ticket_Info::create_Ticket_Info($extra_info); } - + //write a log entry if ( $author == $real_author){ Ticket_Log::createLogEntry( $ticket_id, $author, 1); @@ -131,18 +131,18 @@ class Ticket{ Ticket_Log::createLogEntry( $ticket_id, $real_author, 2, $author); } Ticket_Reply::createReply($content, $author, $ticket_id, 0, $author); - + //forwards the ticket directly after creation to the supposed support group if($for_support_group){ Ticket::forwardTicket(0, $ticket_id, $for_support_group); } - + //send email that new ticket has been created Mail_Handler::send_ticketing_mail($ticket->getAuthor(), $ticket, $content, "NEW", $ticket->getForwardedGroupId()); return $ticket_id; - + } - + /** * updates the ticket's status. @@ -152,7 +152,7 @@ class Ticket{ * @param $author the user (id) that performed the update status action */ public static function updateTicketStatus( $ticket_id, $newStatus, $author) { - + $ticket = new Ticket(); $ticket->load_With_TId($ticket_id); if ($ticket->getStatus() != $newStatus){ @@ -160,10 +160,10 @@ class Ticket{ Ticket_Log::createLogEntry( $ticket_id, $author, 5, $newStatus); } $ticket->update(); - + } - - + + /** * updates the ticket's status & priority. * A log entry about this will be created only if the newStatus is different from the current status and also when the newPriority is different from the current priority. @@ -174,7 +174,7 @@ class Ticket{ * @param $author the user (id) that performed the update */ public static function updateTicketStatusAndPriority( $ticket_id, $newStatus, $newPriority, $author) { - + $ticket = new Ticket(); $ticket->load_With_TId($ticket_id); if ($ticket->getStatus() != $newStatus){ @@ -186,10 +186,10 @@ class Ticket{ Ticket_Log::createLogEntry( $ticket_id, $author, 6, $newPriority); } $ticket->update(); - + } - - + + /** * return the latest reply of a ticket * @param $ticket_id the id of the ticket. @@ -202,7 +202,36 @@ class Ticket{ $reply->set($statement->fetch()); return $reply; } - + + /** + * return the attachments list + * @param $ticket_id the id of the ticket. + * @return a ticket_reply object. + */ + public static function getAttachments( $ticket_id) { + $dbl = new DBLayer("lib"); + $statement = $dbl->select("`ticket_attachments`",array('ticket_TId' => $ticket_id), "`ticket_TId` =:ticket_TId ORDER BY Timestamp DESC"); + $fetchall = $statement->fetchall(); + $base = 0; + foreach ($fetchall as &$value) { + $webUser = new WebUsers($value['Uploader']); + $fetchall[$base]['Username'] = $webUser->getUsername(); + + $bytes = $fetchall[$base]['Filesize']; + $precision = 2; + $units = array('B', 'KB', 'MB', 'GB', 'TB'); + + $bytes = max($bytes, 0); + $pow = floor(($bytes ? log($bytes) : 0) / log(1024)); + $pow = min($pow, count($units) - 1); + + $bytes /= pow(1024, $pow); + + $fetchall[$base]['Filesize'] = round($bytes, $precision) . ' ' . $units[$pow];; + $base++; + } + return $fetchall; + } /** * create a new reply for a ticket. @@ -222,13 +251,13 @@ class Ticket{ //if status is not closed if($ticket->getStatus() != 3){ Ticket_Reply::createReply($content, $author, $ticket_id, $hidden, $ticket->getAuthor()); - + //notify ticket author that a new reply is added! if($ticket->getAuthor() != $author){ Mail_Handler::send_ticketing_mail($ticket->getAuthor(), $ticket, $content, "REPLY", $ticket->getForwardedGroupId()); } - - + + }else{ //TODO: Show error message that ticket is closed } @@ -236,8 +265,8 @@ class Ticket{ //TODO: Show error content is empty } } - - + + /** * assign a ticket to a user. * Checks if the ticket exists, if so then it will try to assign the user to it, a log entry will be written about this. @@ -254,8 +283,8 @@ class Ticket{ return "TICKET_NOT_EXISTING"; } } - - + + /** * unassign a ticket of a user. * Checks if the ticket exists, if so then it will try to unassign the user of it, a log entry will be written about this. @@ -272,8 +301,8 @@ class Ticket{ return "TICKET_NOT_EXISTING"; } } - - + + /** * forward a ticket to a specific support group. * Checks if the ticket exists, if so then it will try to forward the ticket to the support group specified, a log entry will be written about this. @@ -288,7 +317,7 @@ class Ticket{ if(isset($group_id) && $group_id != ""){ //forward the ticket $returnvalue = Forwarded::forwardTicket($group_id, $ticket_id); - + if($user_id != 0){ //unassign the ticket incase the ticket is assined to yourself self::unAssignTicket($user_id, $ticket_id); @@ -303,12 +332,12 @@ class Ticket{ return "TICKET_NOT_EXISTING"; } } - - - - + + + + ////////////////////////////////////////////Methods//////////////////////////////////////////////////// - + /** * A constructor. * Empty constructor @@ -335,20 +364,18 @@ class Ticket{ $this->author = $values['Author']; $this->priority = $values['Priority']; } - - + + /** * creates a new 'ticket' entry. * this method will use the object's attributes for creating a new 'ticket' entry in the database. */ public function create(){ $dbl = new DBLayer("lib"); - $query = "INSERT INTO ticket (Timestamp, Title, Status, Queue, Ticket_Category, Author, Priority) VALUES (now(), :title, :status, :queue, :tcat, :author, :priority)"; - $values = Array('title' => $this->title, 'status' => $this->status, 'queue' => $this->queue, 'tcat' => $this->ticket_category, 'author' => $this->author, 'priority' => $this->priority); - $this->tId = $dbl->executeReturnId($query, $values); ; + $this->tId = $dbl->executeReturnId("ticket", Array('Title' => $this->title, 'Status' => $this->status, 'Queue' => $this->queue, 'Ticket_Category' => $this->ticket_category, 'Author' => $this->author, 'Priority' => $this->priority), array('Timestamp'=>'now()')); } - + /** * loads the object's attributes. * loads the object's attributes by giving a TId (ticket id). @@ -356,7 +383,7 @@ class Ticket{ */ public function load_With_TId( $id) { $dbl = new DBLayer("lib"); - $statement = $dbl->execute("SELECT * FROM ticket WHERE TId=:id", array('id' => $id)); + $statement = $dbl->select("ticket", array('id' => $id), "TId=:id"); $row = $statement->fetch(); $this->tId = $row['TId']; $this->timestamp = $row['Timestamp']; @@ -367,19 +394,17 @@ class Ticket{ $this->author = $row['Author']; $this->priority = $row['Priority']; } - - + + /** * update the objects attributes to the db. */ public function update(){ $dbl = new DBLayer("lib"); - $query = "UPDATE ticket SET Timestamp = :timestamp, Title = :title, Status = :status, Queue = :queue, Ticket_Category = :tcat, Author = :author, Priority = :priority WHERE TId=:id"; - $values = Array('id' => $this->tId, 'timestamp' => $this->timestamp, 'title' => $this->title, 'status' => $this->status, 'queue' => $this->queue, 'tcat' => $this->ticket_category, 'author' => $this->author, 'priority' => $this->priority); - $statement = $dbl->execute($query, $values); + $dbl->update("ticket", Array('Timestamp' => $this->timestamp, 'Title' => $this->title, 'Status' => $this->status, 'Queue' => $this->queue, 'Ticket_Category' => $this->ticket_category, 'Author' => $this->author, 'Priority' => $this->priority), "TId=$this->tId"); } - - + + /** * check if a ticket has a ticket_info page or not. * @return true or false @@ -387,38 +412,38 @@ class Ticket{ public function hasInfo(){ return Ticket_Info::TicketHasInfo($this->getTId()); } - - + + ////////////////////////////////////////////Getters//////////////////////////////////////////////////// - + /** * get tId attribute of the object. */ public function getTId(){ return $this->tId; } - + /** * get timestamp attribute of the object in the format defined in the outputTime function of the Helperclass. */ public function getTimestamp(){ return Helpers::outputTime($this->timestamp); } - + /** * get title attribute of the object. */ public function getTitle(){ return $this->title; } - + /** * get status attribute of the object. */ public function getStatus(){ return $this->status; } - + /** * get status attribute of the object in the form of text (string). */ @@ -426,43 +451,43 @@ class Ticket{ $statusArray = Ticket::getStatusArray(); return $statusArray[$this->getStatus()]; } - + /** * get category attribute of the object in the form of text (string). */ public function getCategoryName(){ $category = Ticket_Category::constr_TCategoryId($this->getTicket_Category()); - return $category->getName(); + return $category->getName(); } - + /** * get queue attribute of the object. */ public function getQueue(){ return $this->queue; } - + /** * get ticket_category attribute of the object (int). */ public function getTicket_Category(){ return $this->ticket_category; } - + /** * get author attribute of the object (int). */ public function getAuthor(){ return $this->author; } - + /** * get priority attribute of the object (int). */ public function getPriority(){ return $this->priority; } - + /** * get priority attribute of the object in the form of text (string). */ @@ -470,7 +495,7 @@ class Ticket{ $priorityArray = Ticket::getPriorityArray(); return $priorityArray[$this->getPriority()]; } - + /** * get the user assigned to the ticket. * or return 0 in case not assigned. @@ -483,7 +508,7 @@ class Ticket{ return $user_id; } } - + /** * get the name of the support group to whom the ticket is forwarded * or return 0 in case not forwarded. @@ -496,7 +521,7 @@ class Ticket{ return Support_Group::getGroup($group_id)->getName(); } } - + /** * get the id of the support group to whom the ticket is forwarded * or return 0 in case not forwarded. @@ -510,7 +535,7 @@ class Ticket{ } } ////////////////////////////////////////////Setters//////////////////////////////////////////////////// - + /** * set tId attribute of the object. * @param $id integer id of the ticket @@ -518,7 +543,7 @@ class Ticket{ public function setTId($id){ $this->tId = $id; } - + /** * set timestamp attribute of the object. * @param $ts timestamp of the ticket @@ -526,7 +551,7 @@ class Ticket{ public function setTimestamp($ts){ $this->timestamp = $ts; } - + /** * set title attribute of the object. * @param $t title of the ticket @@ -534,7 +559,7 @@ class Ticket{ public function setTitle($t){ $this->title = $t; } - + /** * set status attribute of the object. * @param $s status of the ticket(int) @@ -542,7 +567,7 @@ class Ticket{ public function setStatus($s){ $this->status = $s; } - + /** * set queue attribute of the object. * @param $q queue of the ticket @@ -550,7 +575,7 @@ class Ticket{ public function setQueue($q){ $this->queue = $q; } - + /** * set ticket_category attribute of the object. * @param $tc ticket_category id of the ticket(int) @@ -558,7 +583,7 @@ class Ticket{ public function setTicket_Category($tc){ $this->ticket_category = $tc; } - + /** * set author attribute of the object. * @param $a author of the ticket @@ -566,7 +591,7 @@ class Ticket{ public function setAuthor($a){ $this->author = $a; } - + /** * set priority attribute of the object. * @param $p priority of the ticket @@ -574,5 +599,47 @@ class Ticket{ public function setPriority($p){ $this->priority = $p; } + + /** + * function that creates a ticket Attachment. + */ + public static function add_Attachment($TId,$filename,$author,$tempFile){ + + global $FILE_STORAGE_PATH; + $length = mt_rand(20, 25); + $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$-_.+!*\'(),'; + $randomString = ''; + for ($i = 0; $i < $length; $i++) { + $randomString .= $characters[rand(0, strlen($characters) - 1)]; + } + $targetFile = $FILE_STORAGE_PATH . $randomString . "/" . $filename; + + if(file_exists($targetFile)) { return self::add_Attachment($TId,$filename,$author,$tempFile); } + + $ticket = new Ticket(); + $ticket->load_With_TId($TId); + + //create the attachment! + try { + $dbl = new DBLayer("lib"); + $dbl->insert("`ticket_attachments`", Array('ticket_TId' => $TId, 'Filename' => $filename, 'Filesize' => filesize($tempFile), 'Uploader' => $author, 'Path' => $randomString . "/" . $filename)); + } + catch (Exception $e) { + return $false; + } + + + mkdir($FILE_STORAGE_PATH . $randomString); + $return = move_uploaded_file($tempFile,$targetFile); + + if ($return == false) { + $dbl->delete("`ticket_attachments`", array('Path' => $randomString . "/" . $filename), "`Path` = :Path"); + } + + //write a log entry + Ticket_Log::createLogEntry( $TId, $author, 10); + + return $return; + } -} \ No newline at end of file +} diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_category.php b/code/web/private_php/ams/autoload/ticket_category.php similarity index 84% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_category.php rename to code/web/private_php/ams/autoload/ticket_category.php index 92e603d12..f6941febe 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_category.php +++ b/code/web/private_php/ams/autoload/ticket_category.php @@ -16,10 +16,7 @@ class Ticket_Category{ */ public static function createTicketCategory( $name) { $dbl = new DBLayer("lib"); - $query = "INSERT INTO ticket_category (Name) VALUES (:name)"; - $values = Array('name' => $name); - $dbl->execute($query, $values); - + $dbl->insert("ticket_category", Array('Name' => $name)); } @@ -40,7 +37,7 @@ class Ticket_Category{ */ public static function getAllCategories() { $dbl = new DBLayer("lib"); - $statement = $dbl->executeWithoutParams("SELECT * FROM ticket_category"); + $statement = $dbl->select("ticket_category", array(null), "1"); $row = $statement->fetchAll(); $result = Array(); foreach($row as $category){ @@ -70,7 +67,7 @@ class Ticket_Category{ */ public function load_With_TCategoryId( $id) { $dbl = new DBLayer("lib"); - $statement = $dbl->execute("SELECT * FROM ticket_category WHERE TCategoryId=:id", array('id' => $id)); + $statement = $dbl->select("ticket_category", array('id' => $id), "TCategoryId=:id"); $row = $statement->fetch(); $this->tCategoryId = $row['TCategoryId']; $this->name = $row['Name']; @@ -82,9 +79,7 @@ class Ticket_Category{ */ public function update(){ $dbl = new DBLayer("lib"); - $query = "UPDATE ticket_category SET Name = :name WHERE TCategoryId=:id"; - $values = Array('id' => $this->tCategoryId, 'name' => $this->name); - $statement = $dbl->execute($query, $values); + $dbl->update("ticket_category", Array('Name' => $this->name), "TCategoryId = $this->tCategoryId"); } ////////////////////////////////////////////Getters//////////////////////////////////////////////////// @@ -126,4 +121,4 @@ class Ticket_Category{ } -} \ No newline at end of file +} diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_content.php b/code/web/private_php/ams/autoload/ticket_content.php similarity index 85% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_content.php rename to code/web/private_php/ams/autoload/ticket_content.php index 445cad867..8b7787f8e 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_content.php +++ b/code/web/private_php/ams/autoload/ticket_content.php @@ -43,9 +43,7 @@ class Ticket_Content{ */ public function create() { $dbl = new DBLayer("lib"); - $query = "INSERT INTO ticket_content (Content) VALUES (:content)"; - $values = Array('content' => $this->content); - $this->tContentId = $dbl->executeReturnId($query, $values); ; + $this->tContentId = $dbl->executeReturnId("ticket_content", Array('Content' => $this->content)); } @@ -56,7 +54,7 @@ class Ticket_Content{ */ public function load_With_TContentId( $id) { $dbl = new DBLayer("lib"); - $statement = $dbl->execute("SELECT * FROM ticket_content WHERE TContentId=:id", array('id' => $id)); + $statement = $dbl->select("ticket_content", array('id' => $id), "TContentId=:id"); $row = $statement->fetch(); $this->tContentId = $row['TContentId']; $this->content = $row['Content']; @@ -67,9 +65,7 @@ class Ticket_Content{ */ public function update(){ $dbl = new DBLayer("lib"); - $query = "UPDATE ticket_content SET Content = :content WHERE TContentId=:id"; - $values = Array('id' => $this->tContentId, 'content' => $this->content); - $statement = $dbl->execute($query, $values); + $dbl->update("ticket_content", Array('Content' => $this->content), "TContentId = $this->tContentId"); } ////////////////////////////////////////////Getters//////////////////////////////////////////////////// @@ -110,4 +106,4 @@ class Ticket_Content{ $this->tContentId = $c; } -} \ No newline at end of file +} diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_info.php b/code/web/private_php/ams/autoload/ticket_info.php similarity index 88% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_info.php rename to code/web/private_php/ams/autoload/ticket_info.php index fc852d093..eb7c8ebc5 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_info.php +++ b/code/web/private_php/ams/autoload/ticket_info.php @@ -52,7 +52,7 @@ class Ticket_Info{ public static function TicketHasInfo($ticket_id) { $dbl = new DBLayer("lib"); //check if ticket is already assigned - if( $dbl->execute(" SELECT * FROM `ticket_info` WHERE `Ticket` = :ticket_id", array('ticket_id' => $ticket_id) )->rowCount() ){ + if( $dbl->select("`ticket_info`", array('ticket_id' => $ticket_id), "`Ticket` = :ticket_id")->rowCount() ){ return true; }else{ return false; @@ -102,7 +102,7 @@ class Ticket_Info{ */ public function load_With_TInfoId( $id) { $dbl = new DBLayer("lib"); - $statement = $dbl->execute("SELECT * FROM ticket_info WHERE TInfoId=:id", array('id' => $id)); + $statement = $dbl->select("ticket_info", array('id' => $id), "TInfoId=:id"); $row = $statement->fetch(); $this->set($row); } @@ -115,7 +115,7 @@ class Ticket_Info{ */ public function load_With_Ticket( $id) { $dbl = new DBLayer("lib"); - $statement = $dbl->execute("SELECT * FROM ticket_info WHERE Ticket=:id", array('id' => $id)); + $statement = $dbl->select("ticket_info", array('id' => $id), "Ticket=:id"); $row = $statement->fetch(); $this->set($row); } @@ -127,12 +127,10 @@ class Ticket_Info{ */ public function create() { $dbl = new DBLayer("lib"); - $query = "INSERT INTO ticket_info ( Ticket, ShardId, UserPosition,ViewPosition, ClientVersion, PatchVersion,ServerTick, ConnectState, LocalAddress, Memory, OS, -Processor, CPUID, CpuMask, HT, NeL3D, UserId) VALUES ( :ticket, :shardid, :userposition, :viewposition, :clientversion, :patchversion, :servertick, :connectstate, :localaddress, :memory, :os, :processor, :cpuid, :cpu_mask, :ht, :nel3d, :user_id )"; - $values = Array('ticket' => $this->getTicket(), 'shardid' => $this->getShardId(), 'userposition' => $this->getUser_Position(), 'viewposition' => $this->getView_Position(), 'clientversion' => $this->getClient_Version(), -'patchversion' => $this->getPatch_Version(), 'servertick' => $this->getServer_Tick(), 'connectstate' => $this->getConnect_State(), 'localaddress' => $this->getLocal_Address(), 'memory' => $this->getMemory(), 'os'=> $this->getOS(), 'processor' => $this->getProcessor(), 'cpuid' => $this->getCPUId(), -'cpu_mask' => $this->getCpu_Mask(), 'ht' => $this->getHT(), 'nel3d' => $this->getNel3D(), 'user_id' => $this->getUser_Id()); - $dbl->execute($query, $values); + $values = Array('Ticket' => $this->getTicket(), 'ShardId' => $this->getShardId(), 'UserPosition' => $this->getUser_Position(), 'ViewPosition' => $this->getView_Position(), 'ClientVersion' => $this->getClient_Version(), +'PatchVersion' => $this->getPatch_Version(), 'ServerTick' => $this->getServer_Tick(), 'ConnectState' => $this->getConnect_State(), 'LocalAddress' => $this->getLocal_Address(), 'Memory' => $this->getMemory(), 'OS'=> $this->getOS(), 'Processor' => $this->getProcessor(), 'CPUID' => $this->getCPUId(), +'CpuMask' => $this->getCpu_Mask(), 'HT' => $this->getHT(), 'NeL3D' => $this->getNel3D(), 'UserId' => $this->getUser_Id()); + $dbl->insert("ticket_info",$values); } @@ -411,4 +409,4 @@ Processor, CPUID, CpuMask, HT, NeL3D, UserId) VALUES ( :ticket, :shardid, :user } -} \ No newline at end of file +} diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_log.php b/code/web/private_php/ams/autoload/ticket_log.php similarity index 86% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_log.php rename to code/web/private_php/ams/autoload/ticket_log.php index 8c7439bc0..6ca354d3e 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_log.php +++ b/code/web/private_php/ams/autoload/ticket_log.php @@ -2,7 +2,7 @@ /** * Class that handles the logging. The logging will be used when a ticket is created, a reply is added, if someone views a ticket, * if someone assigns a ticket to him or if someone forwards a ticket. This class provides functions to get retrieve those logs and also make them. -* +* *-the Action IDs being used are: * -# User X Created ticket * -# Admin X created ticket for arg @@ -13,18 +13,19 @@ * -# assigned to the ticket * -# forwarded ticket to support group arg * -# unassigned to the ticket +* -# added attachment to the ticket * * @author Daan Janssens, mentored by Matthew Lagoe */ class Ticket_Log{ - - private $tLogId; /**< The id of the log entry */ - private $timestamp; /**< The timestamp of the log entry */ - private $query; /**< The query (json encoded array containing action id & argument) */ - private $author; /**< author of the log */ - private $ticket; /**< the id of the ticket related to the log entry */ - + + private $tLogId; /**< The id of the log entry */ + private $timestamp; /**< The timestamp of the log entry */ + private $query; /**< The query (json encoded array containing action id & argument) */ + private $author; /**< author of the log */ + private $ticket; /**< the id of the ticket related to the log entry */ + /**************************************** *Action ID's: * 1: User X Created Ticket @@ -36,12 +37,13 @@ class Ticket_Log{ * 7: assigned to the ticket * 8: Forwarded ticket to support group arg * 9: unassigned to the ticket + *10: added attachment to the ticket * ****************************************/ - - + + ////////////////////////////////////////////Functions//////////////////////////////////////////////////// - + /** * return all log entries related to a ticket. * @param $ticket_id the id of the ticket of which we want all related log entries returned. @@ -65,10 +67,10 @@ class Ticket_Log{ $instanceLog->setQuery($log['Query']); $result[] = $instanceLog; } - return $result; + return $result; } - - + + /** * create a new log entry. * It will check if the $TICKET_LOGGING global var is true, this var is used to turn logging on and off. In case it's on, the log message will be stored. @@ -82,9 +84,8 @@ class Ticket_Log{ global $TICKET_LOGGING; if($TICKET_LOGGING){ $dbl = new DBLayer("lib"); - $query = "INSERT INTO ticket_log (Timestamp, Query, Ticket, Author) VALUES (now(), :query, :ticket, :author )"; - $values = Array('ticket' => $ticket_id, 'author' => $author_id, 'query' => json_encode(array($action,$arg))); - $dbl->execute($query, $values); + $values = Array('Query' => json_encode(array($action,$arg)), 'Ticket' => $ticket_id, 'Author' => $author_id); + $dbl->insert("ticket_log", $values, array('Timestamp'=>'now()')); } } @@ -99,7 +100,7 @@ class Ticket_Log{ $instance->setTLogId($id); return $instance; } - + /** * return all log entries related to a ticket. * @param $ticket_id the id of the ticket of which we want all related log entries returned. @@ -116,19 +117,19 @@ class Ticket_Log{ $instance->set($log); $result[] = $instance; } - return $result; + return $result; } - - + + ////////////////////////////////////////////Methods//////////////////////////////////////////////////// - + /** * A constructor. * Empty constructor */ public function __construct() { } - + /** * sets the object's attributes. * @param $values should be an array. @@ -139,68 +140,69 @@ class Ticket_Log{ $this->setQuery($values['Query']); $this->setTicket($values['Ticket']); $this->setAuthor($values['Author']); - } + } /** * loads the object's attributes. * loads the object's attributes by giving a ticket_log entries ID (TLogId). - * @param id the id of the ticket_log entry that should be loaded + * @param $id the id of the ticket_log entry that should be loaded */ public function load_With_TLogId( $id) { $dbl = new DBLayer("lib"); - $statement = $dbl->execute("SELECT * FROM ticket_log WHERE TLogId=:id", array('id' => $id)); + $dbl->select("ticket_log", array('id' => $id), "TLogId=:id"); $row = $statement->fetch(); $this->set($row); } - - + + /** * update attributes of the object to the DB. */ public function update(){ $dbl = new DBLayer("lib"); - $query = "UPDATE ticket_log SET Timestamp = :timestamp, Query = :query, Author = :author, Ticket = :ticket WHERE TLogId=:id"; - $values = Array('id' => $this->getTLogId(), 'timestamp' => $this->getTimestamp(), 'query' => $this->getQuery(), 'author' => $this->getAuthor(), 'ticket' => $this->getTicket() ); - $statement = $dbl->execute($query, $values); + + $values = Array('timestamp' => $this->getTimestamp(), 'query' => $this->getQuery(), 'author' => $this->getAuthor(), 'ticket' => $this->getTicket() ); + $dbl->update("ticket_log", $values, "TLogId = $this->getTLogId()"); + } - + ////////////////////////////////////////////Getters//////////////////////////////////////////////////// - + /** * get tLogId attribute of the object. */ public function getTLogId(){ return $this->tLogId; } - + /** * get timestamp attribute of the object. */ public function getTimestamp(){ return Helpers::outputTime($this->timestamp); } - + /** * get query attribute of the object. */ public function getQuery(){ return $this->query; } - + /** * get author attribute of the object. */ public function getAuthor(){ return $this->author; } - + /** * get ticket attribute of the object. */ public function getTicket(){ return $this->ticket; } - + /** * get the action id out of the query by decoding it. */ @@ -208,7 +210,7 @@ class Ticket_Log{ $decodedQuery = json_decode($this->query); return $decodedQuery[0]; } - + /** * get the argument out of the query by decoding it. */ @@ -216,7 +218,7 @@ class Ticket_Log{ $decodedQuery = json_decode($this->query); return $decodedQuery[1]; } - + /** * get the action text(string) array. * this is being read from the language .ini files. @@ -229,9 +231,9 @@ class Ticket_Log{ } return $result; } - + ////////////////////////////////////////////Setters//////////////////////////////////////////////////// - + /** * set tLogId attribute of the object. * @param $id integer id of the log entry @@ -239,7 +241,7 @@ class Ticket_Log{ public function setTLogId($id){ $this->tLogId = $id; } - + /** * set timestamp attribute of the object. * @param $t timestamp of the log entry @@ -247,7 +249,7 @@ class Ticket_Log{ public function setTimestamp($t){ $this->timestamp = $t; } - + /** * set query attribute of the object. * @param $q the encoded query @@ -255,7 +257,7 @@ class Ticket_Log{ public function setQuery($q){ $this->query = $q; } - + /** * set author attribute of the object. * @param $a integer id of the user who created the log entry @@ -263,7 +265,7 @@ class Ticket_Log{ public function setAuthor($a){ $this->author = $a; } - + /** * set ticket attribute of the object. * @param $t integer id of ticket of which the log entry is related to. @@ -271,6 +273,6 @@ class Ticket_Log{ public function setTicket($t){ $this->ticket = $t; } - - -} \ No newline at end of file + + +} diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_queue.php b/code/web/private_php/ams/autoload/ticket_queue.php similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_queue.php rename to code/web/private_php/ams/autoload/ticket_queue.php diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_queue_handler.php b/code/web/private_php/ams/autoload/ticket_queue_handler.php similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_queue_handler.php rename to code/web/private_php/ams/autoload/ticket_queue_handler.php diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_reply.php b/code/web/private_php/ams/autoload/ticket_reply.php similarity index 85% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_reply.php rename to code/web/private_php/ams/autoload/ticket_reply.php index 8e784543d..9d806d161 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_reply.php +++ b/code/web/private_php/ams/autoload/ticket_reply.php @@ -4,15 +4,15 @@ * @author Daan Janssens, mentored by Matthew Lagoe */ class Ticket_Reply{ - private $tReplyId; /**< The id of the reply */ - private $ticket; /**< the ticket id related to the reply */ - private $content; /**< the content of the reply */ - private $author; /**< The id of the user that made the reply */ - private $timestamp; /**< The timestamp of the reply */ - private $hidden; /**< indicates if reply should be hidden for normal users or not */ - + private $tReplyId; /**< The id of the reply */ + private $ticket; /**< the ticket id related to the reply */ + private $content; /**< the content of the reply */ + private $author; /**< The id of the user that made the reply */ + private $timestamp; /**< The timestamp of the reply */ + private $hidden; /**< indicates if reply should be hidden for normal users or not */ + ////////////////////////////////////////////Functions//////////////////////////////////////////////////// - + /** * return constructed element based on TReplyId. * @param $id the Id the reply we want to load. @@ -23,8 +23,8 @@ class Ticket_Reply{ $instance->setTReplyId($id); return $instance; } - - + + /** * return all replies on a specific ticket. * @param $ticket_id the id of the ticket of which we want the replies. @@ -43,12 +43,12 @@ class Ticket_Reply{ $instanceAuthor = Ticket_User::constr_TUserId($tReply['Author']); $instanceAuthor->setExternId($tReply['ExternId']); $instanceAuthor->setPermission($tReply['Permission']); - + //load content $instanceContent = new Ticket_Content(); $instanceContent->setTContentId($tReply['TContentId']); $instanceContent->setContent($tReply['Content']); - + //load reply and add the author and content object in it. $instanceReply = new self(); $instanceReply->setTReplyId($tReply['TReplyId']); @@ -60,9 +60,9 @@ class Ticket_Reply{ $result[] = $instanceReply; } } - return $result; + return $result; } - + /** * creates a new reply on a ticket. * Creates a ticket_content entry and links it with a new created ticket_reply, a log entry will be written about this. @@ -78,19 +78,19 @@ class Ticket_Reply{ $ticket_content->setContent($content); $ticket_content->create(); $content_id = $ticket_content->getTContentId(); - + $ticket_reply = new Ticket_Reply(); $ticket_reply->set(Array('Ticket' => $ticket_id,'Content' => $content_id,'Author' => $author, 'Hidden' => $hidden)); $ticket_reply->create(); $reply_id = $ticket_reply->getTReplyId(); - + if($ticket_creator == $author){ Ticket::updateTicketStatus( $ticket_id, 1, $author); } - + Ticket_Log::createLogEntry( $ticket_id, $author, 4, $reply_id); } - + ////////////////////////////////////////////Methods//////////////////////////////////////////////////// /** @@ -116,16 +116,14 @@ class Ticket_Reply{ $this->setHidden($values['Hidden']); } } - + /** * creates a new 'ticket_reply' entry. * this method will use the object's attributes for creating a new 'ticket_reply' entry in the database (the now() function will create the timestamp). */ public function create(){ $dbl = new DBLayer("lib"); - $query = "INSERT INTO ticket_reply (Ticket, Content, Author, Timestamp, Hidden) VALUES (:ticket, :content, :author, now(), :hidden)"; - $values = Array('ticket' => $this->ticket, 'content' => $this->content, 'author' => $this->author, 'hidden' => $this->hidden); - $this->tReplyId = $dbl->executeReturnId($query, $values); + $this->tReplyId = $dbl->executeReturnId("ticket_reply", Array('Ticket' => $this->ticket, 'Content' => $this->content, 'Author' => $this->author, 'Hidden' => $this->hidden), array('Timestamp'=>'now()')); } /** @@ -135,7 +133,7 @@ class Ticket_Reply{ */ public function load_With_TReplyId( $id) { $dbl = new DBLayer("lib"); - $statement = $dbl->execute("SELECT * FROM ticket_reply WHERE TReplyId=:id", array('id' => $id)); + $statement = $dbl->select("ticket_reply", array('id' => $id), "TReplyId=:id"); $row = $statement->fetch(); $this->tReplyId = $row['TReplyId']; $this->ticket = $row['Ticket']; @@ -144,26 +142,24 @@ class Ticket_Reply{ $this->timestamp = $row['Timestamp']; $this->hidden = $row['Hidden']; } - + /** * updates a ticket_reply entry based on the objects attributes. */ public function update(){ $dbl = new DBLayer("lib"); - $query = "UPDATE ticket SET Ticket = :ticket, Content = :content, Author = :author, Timestamp = :timestamp, Hidden = :hidden WHERE TReplyId=:id"; - $values = Array('id' => $this->tReplyId, 'timestamp' => $this->timestamp, 'ticket' => $this->ticket, 'content' => $this->content, 'author' => $this->author, 'hidden' => $this->hidden); - $statement = $dbl->execute($query, $values); + $dbl->update("ticket", Array('Ticket' => $this->ticket, 'Content' => $this->content, 'Author' => $this->author, 'Timestamp' => $this->timestamp, 'Hidden' => $this->hidden), "TReplyId=$this->tReplyId, "); } - + ////////////////////////////////////////////Getters//////////////////////////////////////////////////// - + /** * get ticket attribute of the object. */ public function getTicket(){ return $this->ticket; } - + /** * get content attribute of the object. */ @@ -177,7 +173,7 @@ class Ticket_Reply{ public function getAuthor(){ return $this->author; } - + /** * get timestamp attribute of the object. * The output format is defined by the Helpers class function, outputTime(). @@ -185,23 +181,23 @@ class Ticket_Reply{ public function getTimestamp(){ return Helpers::outputTime($this->timestamp); } - + /** * get tReplyId attribute of the object. */ public function getTReplyId(){ return $this->tReplyId; } - + /** * get hidden attribute of the object. */ public function getHidden(){ return $this->hidden; - } - + } + ////////////////////////////////////////////Setters//////////////////////////////////////////////////// - + /** * set ticket attribute of the object. * @param $t integer id of the ticket @@ -209,7 +205,7 @@ class Ticket_Reply{ public function setTicket($t){ $this->ticket = $t; } - + /** * set content attribute of the object. * @param $c integer id of the ticket_content entry @@ -217,7 +213,7 @@ class Ticket_Reply{ public function setContent($c){ $this->content = $c; } - + /** * set author attribute of the object. * @param $a integer id of the user @@ -225,7 +221,7 @@ class Ticket_Reply{ public function setAuthor($a){ $this->author = $a; } - + /** * set timestamp attribute of the object. * @param $t timestamp of the reply @@ -233,7 +229,7 @@ class Ticket_Reply{ public function setTimestamp($t){ $this->timestamp = $t; } - + /** * set tReplyId attribute of the object. * @param $i integer id of the ticket_reply @@ -241,7 +237,7 @@ class Ticket_Reply{ public function setTReplyId($i){ $this->tReplyId = $i; } - + /** * set hidden attribute of the object. * @param $h should be 0 or 1 @@ -249,4 +245,4 @@ class Ticket_Reply{ public function setHidden($h){ $this->hidden = $h; } -} \ No newline at end of file +} diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_user.php b/code/web/private_php/ams/autoload/ticket_user.php similarity index 84% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_user.php rename to code/web/private_php/ams/autoload/ticket_user.php index 46125e284..a52ffaec8 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_user.php +++ b/code/web/private_php/ams/autoload/ticket_user.php @@ -7,27 +7,34 @@ * @author Daan Janssens, mentored by Matthew Lagoe */ class Ticket_User{ - - private $tUserId; /**< The id of the user inside the ticket system*/ - private $permission; /**< The permission of the user */ - private $externId; /**< The id of the user account in the www (could be drupal,...) that is linked to the ticket_user */ - + + private $tUserId; /**< The id of the user inside the ticket system*/ + private $permission; /**< The permission of the user */ + private $externId; /**< The id of the user account in the www (could be drupal,...) that is linked to the ticket_user */ + ////////////////////////////////////////////Functions//////////////////////////////////////////////////// - + /** * create a new ticket user. * @param $extern_id the id of the user account in the www version (drupal,...) * @param $permission the permission that will be given to the user. 1=user, 2=mod, 3=admin */ public static function createTicketUser( $extern_id, $permission) { - $dbl = new DBLayer("lib"); - $query = "INSERT INTO ticket_user (Permission, ExternId) VALUES (:perm, :ext_id)"; - $values = Array('perm' => $permission, 'ext_id' => $extern_id); - $dbl->execute($query, $values); - + try { + //make connection with and put into db + $dbl = new DBLayer("lib"); + $dbl->insert("ticket_user",array('TUserId' => $extern_id, 'Permission' => $permission, 'ExternId' => $extern_id)); + } + catch (PDOException $e) { + //oh noooz... + //error_log(print_r($e, true)); + //print_r($e); + echo "Problem creating user in database!"; + } + } - - + + /** * check if a ticket_user object is a mod or not. * @param $user the ticket_user object itself @@ -39,8 +46,8 @@ class Ticket_User{ } return false; } - - + + /** * check if a ticket_user object is an admin or not. * @param $user the ticket_user object itself @@ -52,8 +59,8 @@ class Ticket_User{ } return false; } - - + + /** * return constructed ticket_user object based on TUserId. * @param $id the TUserId of the entry. @@ -63,17 +70,17 @@ class Ticket_User{ $instance = new self(); $instance->setTUserId($id); return $instance; - + } - - + + /** * return a list of all mods/admins. * @return an array consisting of ticket_user objects that are mods & admins. */ public static function getModsAndAdmins() { $dbl = new DBLayer("lib"); - $statement = $dbl->executeWithoutParams("SELECT * FROM `ticket_user` WHERE `Permission` > 1"); + $statement = $dbl->select("ticket_user", array(null), "`Permission` > 1" ); $rows = $statement->fetchAll(); $result = Array(); foreach($rows as $user){ @@ -81,10 +88,10 @@ class Ticket_User{ $instanceUser->set($user); $result[] = $instanceUser; } - return $result; + return $result; } - - + + /** * return constructed ticket_user object based on ExternId. * @param $id the ExternId of the entry. @@ -93,15 +100,15 @@ class Ticket_User{ public static function constr_ExternId( $id) { $instance = new self(); $dbl = new DBLayer("lib"); - $statement = $dbl->execute("SELECT * FROM ticket_user WHERE ExternId=:id", array('id' => $id)); + $statement = $dbl->select("ticket_user" ,array('id'=>$id) ,"ExternId=:id"); $row = $statement->fetch(); $instance->tUserId = $row['TUserId']; $instance->permission = $row['Permission']; $instance->externId = $row['ExternId']; return $instance; } - - + + /** * change the permission of a ticket_user. * @param $user_id the TUserId of the entry. @@ -113,8 +120,8 @@ class Ticket_User{ $user->setPermission($perm); $user->update(); } - - + + /** * return the email address of a ticket_user. * @param $id the TUserId of the entry. @@ -124,10 +131,10 @@ class Ticket_User{ $user = new Ticket_User(); $user->load_With_TUserId($id); $webUser = new WebUsers($user->getExternId()); - return $webUser->getEmail(); + return $webUser->getEmail(); } - - + + /** * return the username of a ticket_user. * @param $id the TUserId of the entry. @@ -137,10 +144,10 @@ class Ticket_User{ $user = new Ticket_User(); $user->load_With_TUserId($id); $webUser = new WebUsers($user->getExternId()); - return $webUser->getUsername(); + return $webUser->getUsername(); } - - + + /** * return the TUserId of a ticket_user by giving a username. * @param $username the username of a user. @@ -149,9 +156,9 @@ class Ticket_User{ public static function get_id_from_username($username){ $externId = WebUsers::getId($username); $user = Ticket_User::constr_ExternId($externId); - return $user->getTUserId(); + return $user->getTUserId(); } - + /** * return the ticket_user id from an email address. * @param $email the emailaddress of a user. @@ -166,18 +173,18 @@ class Ticket_User{ return "FALSE"; } } - - + + ////////////////////////////////////////////Methods//////////////////////////////////////////////////// - + /** * A constructor. * Empty constructor */ public function __construct() { } - - + + /** * sets the object's attributes. * @param $values should be an array of the form array('TUserId' => id, 'Permission' => perm, 'ExternId' => ext_id). @@ -187,8 +194,8 @@ class Ticket_User{ $this->setPermission($values['Permission']); $this->setExternId($values['ExternId']); } - - + + /** * loads the object's attributes. * loads the object's attributes by giving a TUserId. @@ -196,50 +203,48 @@ class Ticket_User{ */ public function load_With_TUserId( $id) { $dbl = new DBLayer("lib"); - $statement = $dbl->execute("SELECT * FROM ticket_user WHERE TUserId=:id", array('id' => $id)); + $statement = $dbl->select("ticket_user" ,array('id'=>$id), "TUserId=:id" ); $row = $statement->fetch(); $this->tUserId = $row['TUserId']; $this->permission = $row['Permission']; $this->externId = $row['ExternId']; - } - - + } + + /** * update the object's attributes to the db. */ public function update(){ $dbl = new DBLayer("lib"); - $query = "UPDATE ticket_user SET Permission = :perm, ExternId = :ext_id WHERE TUserId=:id"; - $values = Array('id' => $this->tUserId, 'perm' => $this->permission, 'ext_id' => $this->externId); - $statement = $dbl->execute($query, $values); + $dbl->update("ticket_user" ,array('Permission' => $this->permission, 'ExternId' => $this->externId) ,"TUserId=$this->tUserId"); } - + ////////////////////////////////////////////Getters//////////////////////////////////////////////////// - + /** * get permission attribute of the object. */ public function getPermission(){ return $this->permission; } - + /** * get externId attribute of the object. */ public function getExternId(){ return $this->externId; } - + /** * get tUserId attribute of the object. */ public function getTUserId(){ return $this->tUserId; } - - + + ////////////////////////////////////////////Setters//////////////////////////////////////////////////// - + /** * set permission attribute of the object. * @param $perm integer that indicates the permission level. (1= user, 2= mod, 3= admin) @@ -247,16 +252,16 @@ class Ticket_User{ public function setPermission($perm){ $this->permission = $perm; } - - + + /** * set externId attribute of the object. * @param $id the external id. - */ + */ public function setExternId($id){ $this->externId = $id; } - + /** * set tUserId attribute of the object. * @param $id the ticket_user id @@ -264,6 +269,6 @@ class Ticket_User{ public function setTUserId($id){ $this->tUserId= $id; } - - -} \ No newline at end of file + + +} diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/users.php b/code/web/private_php/ams/autoload/users.php similarity index 82% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/users.php rename to code/web/private_php/ams/autoload/users.php index f83f46576..67ed9af88 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/users.php +++ b/code/web/private_php/ams/autoload/users.php @@ -6,12 +6,12 @@ * @author Daan Janssens, mentored by Matthew Lagoe */ class Users{ - + /** * checks if entered values before registering are valid. * @param $values array with Username,Password, ConfirmPass and Email. * @return string Info: Returns a string, if input data is valid then "success" is returned, else an array with errors - */ + */ public function check_Register($values){ // check values if ( isset( $values["Username"] ) and isset( $values["Password"] ) and isset( $values["ConfirmPass"] ) and isset( $values["Email"] ) ){ @@ -26,7 +26,15 @@ class Users{ $email = ""; } - if ( ( $user == "success" ) and ( $pass == "success" ) and ( $cpass == "success" ) and ( $email == "success" ) and ( isset( $_POST["TaC"] ) ) ){ + if ( helpers :: check_if_game_client() or isset($FORCE_INGAME) ) { + if ( isset( $_POST["TaC"] )) { + $tac="success"; + } + } else { + $tac="success"; + } + + if ( ( $user == "success" ) and ( $pass == "success" ) and ( $cpass == "success" ) and ( $email == "success" ) and ($tac=="success") ){ return "success"; }else{ global $TOS_URL; @@ -44,7 +52,7 @@ class Users{ }else{ $pageElements['USERNAME_ERROR'] = 'FALSE'; } - + if ( $pass != "success" ){ $pageElements['PASSWORD_ERROR'] = 'TRUE'; }else{ @@ -69,13 +77,13 @@ class Users{ } } - - + + /** * checks if entered username is valid. * @param $username the username that the user wants to use. * @return string Info: Returns a string based on if the username is valid, if valid then "success" is returned - */ + */ public function checkUser( $username ) { if ( isset( $username ) ){ @@ -95,7 +103,7 @@ class Users{ } return "fail"; } - + /** * check if username already exists. * This is the base function, it should be overwritten by the WebUsers class. @@ -105,10 +113,10 @@ class Users{ protected function checkUserNameExists($username){ //You should overwrite this method with your own version! print('this is the base class!'); - + } - - + + /** * checks if the password is valid. * @param $pass the password willing to be used. @@ -129,8 +137,8 @@ class Users{ } return "fail"; } - - + + /** * checks if the confirmPassword matches the original. * @param $pass_result the result of the previous password check. @@ -152,8 +160,8 @@ class Users{ } return "fail"; } - - + + /** * wrapper to check if the email address is valid. * @param $email the email address @@ -185,16 +193,16 @@ class Users{ protected function checkEmailExists($email){ //TODO: You should overwrite this method with your own version! print('this is the base class!'); - + } - - + + /** * check if the emailaddress structure is valid. * @param $email the email address * @return true or false */ - public function validEmail( $email ){ + public static function validEmail( $email ){ $isValid = true; $atIndex = strrpos( $email, "@" ); if ( is_bool( $atIndex ) && !$atIndex ){ @@ -244,8 +252,8 @@ class Users{ * @param $length the length of the SALT which is by default 2 * @return a random salt of 2 chars */ - public static function generateSALT( $length = 2 ) - { + public static function generateSALT( $length = 16 ) + { // start with a blank salt $salt = ""; // define possible characters - any character in this string can be @@ -274,9 +282,13 @@ class Users{ } } // done! + if ($length > 2) + { + $salt = '$6$'.$salt; + } return $salt; } - + /** @@ -286,63 +298,85 @@ class Users{ * @param $user_id the extern id of the user (the id given by the www/CMS) * @return ok if it's get correctly added to the shard, else return lib offline and put in libDB, if libDB is also offline return liboffline. */ - public static function createUser($values, $user_id){ + public static function createUser($values, $user_id) { + ticket_user::createTicketUser($user_id, 1); try { //make connection with and put into shard db - $values['user_id']= $user_id; + $values["UId"] = $user_id; $dbs = new DBLayer("shard"); - $dbs->execute("INSERT INTO user (Login, Password, Email) VALUES (:name, :pass, :mail)",$values); + $dbs->insert("user", $values); + /* $dbr = new DBLayer("ring"); - $dbr->execute("INSERT INTO ring_users (user_id, user_name, user_type) VALUES (:user_id, :name, 'ut_pioneer')",$values); - ticket_user::createTicketUser( $user_id, 1); + $valuesRing['user_id'] =$user_id; + $valuesRing['user_name'] = $values['Login']; + $valuesRing['user_type'] = 'ut_pioneer'; + $dbr->insert("ring_users", $valuesRing); + */ return "ok"; } catch (PDOException $e) { //oh noooz, the shard is offline! Put in query queue at ams_lib db! try { - $dbl = new DBLayer("lib"); - $dbl->execute("INSERT INTO ams_querycache (type, query, db) VALUES (:type, :query, :db)",array("type" => "createUser", - "query" => json_encode(array($values["name"],$values["pass"],$values["mail"])), "db" => "shard")); - ticket_user::createTicketUser( $user_id , 1 ); + $dbl = new DBLayer("lib"); + $dbl->insert("ams_querycache", array("type" => "createUser", + "query" => json_encode(array($values["Login"], $values["Password"], $values["Email"])), "db" => "shard")); return "shardoffline"; - }catch (PDOException $e) { + } catch (PDOException $e) { print_r($e); return "liboffline"; } - } - + } } - + /** * creates permissions in the shard db for a user. * incase the shard is offline it will place it in the ams_querycache. * @param $pvalues with username */ public static function createPermissions($pvalues) { - + try { $values = array('username' => $pvalues[0]); $dbs = new DBLayer("shard"); - $sth = $dbs->execute("SELECT UId FROM user WHERE Login= :username;", $values); + $sth = $dbs->selectWithParameter("UId", "user", $values, "Login= :username"); $result = $sth->fetchAll(); - foreach ($result as $UId) { - $ins_values = array('id' => $UId['UId']); - $dbs->execute("INSERT INTO permission (UId, ClientApplication, AccessPrivilege) VALUES (:id, 'r2', 'OPEN');", $ins_values); - $dbs->execute("INSERT INTO permission (UId, ClientApplication, AccessPrivilege) VALUES (:id , 'ryzom_open', 'OPEN');", $ins_values); + $dbl = new DBLayer("lib"); + + $UId = $result['0']['UId']; + + $statement = $dbl->execute("SELECT * FROM `settings` WHERE `Setting` = :setting", Array('setting' => 'Domain_Auto_Add')); + $json = $statement->fetch(); + $json = json_decode($json['Value'],true); + + $db = new DBLayer( 'shard' ); + + // get all domains + $statement = $db -> executeWithoutParams( "SELECT * FROM domain" ); + $rows = $statement -> fetchAll(); + + //error_log(print_r($rows,true)); + //error_log(print_r($result,true)); + //error_log(print_r($json,true)); + foreach ($json as $key => $value) { + //error_log(print_r($key,true)); + //error_log(print_r($value,true)); + + $ins_values = array('UId' => $UId, 'DomainId' => $key, 'AccessPrivilege' => $value['1']); + error_log(print_r($ins_values,true)); + $dbs = new DBLayer("shard"); + $dbs->insert("permission", $ins_values); } } catch (PDOException $e) { //oh noooz, the shard is offline! Put it in query queue at ams_lib db! $dbl = new DBLayer("lib"); - $dbl->execute("INSERT INTO ams_querycache (type, query, db) VALUES (:type, :query, :db)",array("type" => "createPermissions", + $dbl->insert("ams_querycache", array("type" => "createPermissions", "query" => json_encode(array($pvalues[0])), "db" => "shard")); - - - } + } return true; } - - + + /** * check if username and password matches. * This is the base function, it should be overwritten by the WebUsers class. @@ -352,7 +386,7 @@ class Users{ protected static function checkLoginMatch($user,$pass){ print('This is the base class!'); } - + /** * check if the changing of a password is valid. * a mod/admin doesn't has to fill in the previous password when he wants to change the password, however for changing his own password he has to fill it in. @@ -411,7 +445,7 @@ class Users{ return $pageElements; } } - + /** * sets the shards password. * in case the shard is offline, the entry will be stored in the ams_querycache. @@ -420,28 +454,28 @@ class Users{ * @return ok if it worked, if the lib or shard is offline it will return liboffline or shardoffline. */ protected static function setAmsPassword($user, $pass){ - - $values = Array('user' => $user, 'pass' => $pass); - + + $values = Array('Password' => $pass); + try { //make connection with and put into shard db $dbs = new DBLayer("shard"); - $dbs->execute("UPDATE user SET Password = :pass WHERE Login = :user ",$values); + $dbs->update("user", $values, "Login = '$user'"); return "ok"; } catch (PDOException $e) { //oh noooz, the shard is offline! Put in query queue at ams_lib db! try { $dbl = new DBLayer("lib"); - $dbl->execute("INSERT INTO ams_querycache (type, query, db) VALUES (:type, :query, :db)",array("type" => "change_pass", - "query" => json_encode(array($values["user"],$values["pass"])), "db" => "shard")); + $dbl->insert("ams_querycache", array("type" => "change_pass", + "query" => json_encode(array($user,$pass)), "db" => "shard")); return "shardoffline"; }catch (PDOException $e) { return "liboffline"; } - } + } } - + /** * sets the shards email. * in case the shard is offline, the entry will be stored in the ams_querycache. @@ -450,28 +484,26 @@ class Users{ * @return ok if it worked, if the lib or shard is offline it will return liboffline or shardoffline. */ protected static function setAmsEmail($user, $mail){ - - $values = Array('user' => $user, 'mail' => $mail); - + + $values = Array('Email' => $mail); + try { //make connection with and put into shard db $dbs = new DBLayer("shard"); - $dbs->execute("UPDATE user SET Email = :mail WHERE Login = :user ",$values); + $dbs->update("user", $values, "Login = '$user'"); return "ok"; } catch (PDOException $e) { //oh noooz, the shard is offline! Put in query queue at ams_lib db! try { + error_log($e); $dbl = new DBLayer("lib"); - $dbl->execute("INSERT INTO ams_querycache (type, query, db) VALUES (:type, :query, :db)",array("type" => "change_mail", - "query" => json_encode(array($values["user"],$values["mail"])), "db" => "shard")); + $dbl->insert("ams_querycache", array("type" => "change_mail", + "query" => json_encode(array($user,$mail)), "db" => "shard")); return "shardoffline"; }catch (PDOException $e) { return "liboffline"; } - } + } } } - - - \ No newline at end of file diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/configs/ams_lib.conf b/code/web/private_php/ams/configs/ams_lib.conf similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/configs/ams_lib.conf rename to code/web/private_php/ams/configs/ams_lib.conf diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/configs/ingame_layout.ini b/code/web/private_php/ams/configs/ingame_layout.ini similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/configs/ingame_layout.ini rename to code/web/private_php/ams/configs/ingame_layout.ini diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/client.png b/code/web/private_php/ams/img/info/client.png old mode 100755 new mode 100644 similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/client.png rename to code/web/private_php/ams/img/info/client.png diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/connect.png b/code/web/private_php/ams/img/info/connect.png similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/connect.png rename to code/web/private_php/ams/img/info/connect.png diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/cpuid.png b/code/web/private_php/ams/img/info/cpuid.png old mode 100755 new mode 100644 similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/cpuid.png rename to code/web/private_php/ams/img/info/cpuid.png diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/ht.png b/code/web/private_php/ams/img/info/ht.png old mode 100755 new mode 100644 similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/ht.png rename to code/web/private_php/ams/img/info/ht.png diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/local.png b/code/web/private_php/ams/img/info/local.png old mode 100755 new mode 100644 similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/local.png rename to code/web/private_php/ams/img/info/local.png diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/mask.png b/code/web/private_php/ams/img/info/mask.png old mode 100755 new mode 100644 similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/mask.png rename to code/web/private_php/ams/img/info/mask.png diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/memory.png b/code/web/private_php/ams/img/info/memory.png old mode 100755 new mode 100644 similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/memory.png rename to code/web/private_php/ams/img/info/memory.png diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/nel.png b/code/web/private_php/ams/img/info/nel.png old mode 100755 new mode 100644 similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/nel.png rename to code/web/private_php/ams/img/info/nel.png diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/os.png b/code/web/private_php/ams/img/info/os.png old mode 100755 new mode 100644 similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/os.png rename to code/web/private_php/ams/img/info/os.png diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/patch.png b/code/web/private_php/ams/img/info/patch.png old mode 100755 new mode 100644 similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/patch.png rename to code/web/private_php/ams/img/info/patch.png diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/position.png b/code/web/private_php/ams/img/info/position.png old mode 100755 new mode 100644 similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/position.png rename to code/web/private_php/ams/img/info/position.png diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/processor.png b/code/web/private_php/ams/img/info/processor.png old mode 100755 new mode 100644 similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/processor.png rename to code/web/private_php/ams/img/info/processor.png diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/server.png b/code/web/private_php/ams/img/info/server.png old mode 100755 new mode 100644 similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/server.png rename to code/web/private_php/ams/img/info/server.png diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/shard.png b/code/web/private_php/ams/img/info/shard.png old mode 100755 new mode 100644 similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/shard.png rename to code/web/private_php/ams/img/info/shard.png diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/user.png b/code/web/private_php/ams/img/info/user.png old mode 100755 new mode 100644 similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/user.png rename to code/web/private_php/ams/img/info/user.png diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/view.png b/code/web/private_php/ams/img/info/view.png old mode 100755 new mode 100644 similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/img/info/view.png rename to code/web/private_php/ams/img/info/view.png diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/createticket.tpl b/code/web/private_php/ams/ingame_templates/createticket.tpl similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/createticket.tpl rename to code/web/private_php/ams/ingame_templates/createticket.tpl diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/dashboard.tpl b/code/web/private_php/ams/ingame_templates/dashboard.tpl similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/dashboard.tpl rename to code/web/private_php/ams/ingame_templates/dashboard.tpl diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/index.tpl b/code/web/private_php/ams/ingame_templates/index.tpl similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/index.tpl rename to code/web/private_php/ams/ingame_templates/index.tpl diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/layout.tpl b/code/web/private_php/ams/ingame_templates/layout.tpl similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/layout.tpl rename to code/web/private_php/ams/ingame_templates/layout.tpl diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/layout_admin.tpl b/code/web/private_php/ams/ingame_templates/layout_admin.tpl similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/layout_admin.tpl rename to code/web/private_php/ams/ingame_templates/layout_admin.tpl diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/layout_mod.tpl b/code/web/private_php/ams/ingame_templates/layout_mod.tpl similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/layout_mod.tpl rename to code/web/private_php/ams/ingame_templates/layout_mod.tpl diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/layout_user.tpl b/code/web/private_php/ams/ingame_templates/layout_user.tpl similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/layout_user.tpl rename to code/web/private_php/ams/ingame_templates/layout_user.tpl diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/login.tpl b/code/web/private_php/ams/ingame_templates/login.tpl similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/login.tpl rename to code/web/private_php/ams/ingame_templates/login.tpl diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/register.tpl b/code/web/private_php/ams/ingame_templates/register.tpl similarity index 95% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/register.tpl rename to code/web/private_php/ams/ingame_templates/register.tpl index 9fa8fef32..7f34e8639 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/register.tpl +++ b/code/web/private_php/ams/ingame_templates/register.tpl @@ -7,6 +7,8 @@ {$welcome_message} + {if $userRegistration == '0'|| $userRegistration == '1'} +
    @@ -89,6 +91,8 @@
    + + {/if}
    executeWithoutParams( $sql ); + } + +/** + * Hook to store data to database which is sent as post + * method from the forms in this plugin + * It also calls the local hook + */ +function api_key_management_hook_store_db() + { + global $var_set; + global $API_key_management_return_set; + + // if the form been submited move forward + if ( @hook_validate( $_POST['gen_key'] ) ) { + + // local hook to validate the POST variables + hook_variables(); + + // if validation successfull move forward + if ( $API_key_management_return_set['gen_key_validate'] == 'true' && $_GET['plugin_action'] == 'generate_key' ) + { + // this part generated the access token + include 'generate_key.php'; + $var_set['AccessToken'] = generate_key :: randomToken( 56, false, true, false ); + + // database connection + $db = new DBLayer( 'lib' ); + // insert the form data to the database + $db -> insert( 'ams_api_keys', $var_set ); + + // redirect to the the main page with success code + // 1 refers to the successfull addition of key to the database + header( "Location: index.php?page=layout_plugin&&name=API_key_management&&success=1" ); + throw new SystemExit(); + } + } + } + +/** + * Global Hook to load the data from db and set it + * into the global array to return it to the template + */ +function api_key_management_hook_load_db() + { + global $var_set; + global $API_key_management_return_set; + + $dbl = new DBLayer("lib"); + + if ( isset( $_SESSION['user'] ) ) + { + // returns the registered keys + $sth = $dbl -> select( 'ams_api_keys', array( 'user' => $_SESSION['user'] ), 'User = :user' ); + $row = $sth -> fetchAll(); + $API_key_management_return_set['api_keys'] = $row; + + // fetch the character from the array to compare + $com = array_column( $API_key_management_return_set['api_keys'], 'UserCharacter' ); + + // returns the characters with respect to the user id in the ring_tool->characters + try { + $dbl = new DBLayer( 'ring' ); + $sth = $dbl -> selectWithParameter( 'char_name', 'characters' , array(), '1' ); + $row = $sth -> fetch(); + + // loop through the character list and remove the character if already have an api key + $API_key_management_return_set['characters'] = array_diff( $row, $com ); + }catch( PDOException $e ) { + error_log($e->getMessage()); +} + } + } + +/** + * Global Hook to update or delete the data from db + */ +function api_key_management_hook_update_db() + { + global $var_set; + global $API_key_management_return_set; + + $db = new DBLayer( 'lib' ); + if ( isset( $_GET['delete_id'] ) ) + { + // removes the registered key using get variable which contains the id of the registered key + $db -> delete( 'ams_api_keys', array( 'SNo' => $_GET['delete_id'] ), 'SNo = :SNo' ); + + // redirecting to the API_key_management plugins template with success code + // 2 refers to the succssfull delete condition + header( "Location: index.php?page=layout_plugin&&name=API_key_management&&success=2" ); + throw new SystemExit(); + } + } + +/** + * Global Hook to return global variables which contains + * the content to use in the smarty templates + * + * @return $API_key_management_return_set global array returns the template data + */ +function api_key_management_hook_return_global() + { + global $API_key_management_return_set; + return $API_key_management_return_set; + } diff --git a/code/web/private_php/ams/plugins/API_key_management/generate_key.php b/code/web/private_php/ams/plugins/API_key_management/generate_key.php new file mode 100644 index 000000000..1ddfab7ed --- /dev/null +++ b/code/web/private_php/ams/plugins/API_key_management/generate_key.php @@ -0,0 +1,53 @@ + 2, 2 => 8, 3 => 10, 4 => 16, 5 => 10 ); + if ( !is_array( $chars ) ) { + $chars = array_unique( str_split( $chars ) ); + } + if ( $standardChars ) { + $chars = array_merge( $chars, range( 48, 57 ), range( 65, 90 ), range( 97, 122 ) ); + } + if ( $specialChars ) { + $chars = array_merge( $chars, range( 33, 47 ), range( 58, 64 ), range( 91, 96 ), range( 123, 126 ) ); + } + array_walk( $chars, function( &$val ) { + if ( !is_int( $val ) ) { + $val = ord( $val ); } + } + ); + if ( is_int( $len ) ) { + while ( $len ) { + $tmp = ord( openssl_random_pseudo_bytes( 1 ) ); + if ( in_array( $tmp, $chars ) ) { + if ( !$output || !in_array( $output, range( 1, 5 ) ) || $output == 3 || $output == 5 ) { + $out .= ( $output == 3 ) ? $tmp : chr( $tmp ); + } + else { + $based = base_convert( $tmp, 10, $outputMap[$output] ); + $out .= ( ( ( $output == 1 ) ? '00' : ( ( $output == 4 ) ? '0x' : '' ) ) . ( ( $output == 2 ) ? sprintf( '%03d', $based ) : $based ) ); + } + $len--; + } + } + } + return ( empty( $out ) ) ? false : $out; + } + } diff --git a/code/web/private_php/ams/plugins/API_key_management/templates/gen_key.tpl b/code/web/private_php/ams/plugins/API_key_management/templates/gen_key.tpl new file mode 100644 index 000000000..1f474481d --- /dev/null +++ b/code/web/private_php/ams/plugins/API_key_management/templates/gen_key.tpl @@ -0,0 +1,50 @@ +
    +
    +
    +
    + API KEY management +
    + + + +
    +
    +
    +
    +
    + Generate Access Key +
    + + +
    +
    +
    +
    +
    + Generate Key + +
    + +
    +
    + + +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + diff --git a/code/web/private_php/ams/plugins/API_key_management/templates/index.tpl b/code/web/private_php/ams/plugins/API_key_management/templates/index.tpl new file mode 100644 index 000000000..37d1c8433 --- /dev/null +++ b/code/web/private_php/ams/plugins/API_key_management/templates/index.tpl @@ -0,0 +1,141 @@ +{block name=content} + +{if isset($smarty.get.plugin_action) and $smarty.get.plugin_action eq 'generate_key'} +
    +
    +
    +
    + API KEY management +
    + + + +
    +
    +
    +
    + Generate Access Key +
    + + +
    +
    +
    +
    +
    + Generate Key + +
    + +
    +
    + + +
    +
    +
    + +
    + +
    + +
    +
    +
    + +
    + +
    +
    + +
    + +
    +
    + + +
    +
    +
    + +
    + +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +{else} +
    +
    +
    +
    + API KEY management +
    + + + +
    +
    + + + {if isset($hook_info.API_key_management['gen_key_validate']) and $hook_info.API_key_management['gen_key_validate'] eq 'false' }

    Please enter all the fields

    {/if} + {if isset($smarty.get.success) and $smarty.get.success eq '1'}

    Key added successfully

    {/if} + {if isset($smarty.get.success) and $smarty.get.success eq '2'}

    Key deleted successfully

    {/if} +
    + +
    +
    +
    +

    All the keys you have generated will be shown and you can customize from here.

    + + + + + + + + + + + + + + {if isset($hook_info.API_key_management.api_keys)} + {foreach from=$hook_info.API_key_management.api_keys item=element} + + + + + + + + {/foreach} + {/if} + + + +
    NameTypeCharacterAccess KeyExpiresActions
    {$element.FrName}{$element.UserType}{$element.UserCharacter}{$element.AccessToken}{$element.ExpiryDate} +
    +
    +
    +
    +
    +
    + {/if} +{/block} diff --git a/code/web/private_php/ams/plugins/Achievements/.info b/code/web/private_php/ams/plugins/Achievements/.info new file mode 100644 index 000000000..d3d553e58 --- /dev/null +++ b/code/web/private_php/ams/plugins/Achievements/.info @@ -0,0 +1,8 @@ +PluginName = Achievements +Description = Returns the achivements of a user with respect to the character =. +Version = 1.0.0 +TemplatePath = ../../../private_php/ams/plugins/Achievements/templates/index.tpl +Type = Manual + + + diff --git a/code/web/private_php/ams/plugins/Achievements/Achievements.php b/code/web/private_php/ams/plugins/Achievements/Achievements.php new file mode 100644 index 000000000..13404598b --- /dev/null +++ b/code/web/private_php/ams/plugins/Achievements/Achievements.php @@ -0,0 +1,201 @@ + select( 'ams_api_keys', $data , 'User = :User AND UserCharacter = :UserCharacter' ); + $row = $sth -> fetchAll(); + return $row; + } + +/** + * Local Hook to get database content + * which is called by the global hook + * by passing a parameter + * + * This hook returns the id of the character + * whose achivements we have to get + * + * @param $data array with respective information + * @return $row extracted db content wrt $data + */ +function hook_get_char_id( $data ) + { + // returns the character id with respect to the character name in the ring_tool->characters + $db = new DBLayer( 'ring' ); + $sth = $db -> selectWithParameter( 'char_id', 'characters' , array( 'char_name' => $data ), 'char_name=:char_name' ); + $row = $sth -> fetch(); + return $row['char_id']; + } + +/** + * Local Hook to get database content + * which is called by the global hook + * by passing a parameter + * + * Hook to get the player stats of the character + * + * @param $data array with respective information + * @return $row extracted db content wrt $data + */ +function hook_get_player_stat( $data ) + { + // returns the character id with respect to the character name in the ring_tool->characters + $db = new DBLayer( 'webig' ); + $sth = $db -> select( 'players' , array( 'name' => $data ), 'name=:name' ); + $row = $sth -> fetch(); + return $row; + } + +/** + * Local Hook to set variables which contains + * the content to use during the plugin functionality. + */ +function hook_variable_set() + { + global $achievements_return_set; + global $var_set; + if ( isset( $_POST['Character'] ) && !empty( $_POST['Character'] ) ) + { + $var_set['character'] = $_POST['Character']; + + // get char id from ring_open table + if ( $var_set['character'] != 'All Characters' ) + { + $var_set['char_id'] = hook_get_char_id( $var_set['character'] ); + + } + + // get db content for variable set + $row = hook_get_db_content( array( 'User' => $_SESSION['user'], 'UserCharacter' => $var_set['character'] ) ); + + // access key automatically taken from the database wrt user and character + @$var_set['app_key'] = $row['AccessToken']; + + // here you can set the host where this plugin is set + $var_set['host'] = 'localhost'; + + // here we get the stats of the character + $ref_set = hook_get_player_stat( $var_set['character'] ); + + // here we have set items that are required to get the achivements + // these are player stats from webig->players table + @$var_set['items'] = json_encode( array( 'dev_shard' => $ref_set['dev_shard'] , 'name' => $ref_set['name'] , 'cid' => $ref_set['cid'] , 'lang' => 'en' , 'translater_mode' => '', 'last_played_date' => $ref_set['last_login'] ) ); + + // url where we have to make request for achievements + // it sends get parameter search(what to search) and format(in which format data exchange takes place) + $var_set['url'] = 'http://localhost6/?search=achievements&&format=json'; + } + else + { + $achievements_return_set['no_char'] = "Please Generate key for a character before requesting for achievements"; + } + } + +/** + * Global Hook to interact with the REST api + * Pass the variables in the REST object to + * make request + * + * variables REST object expects + * url --> on which request is to be made + * appkey --> app key for authentication + * host --> host from which request have been sent + * + * @return $achievements_return_set global array returns the template data + */ +function achievements_hook_call_rest() + { + // defined the variables + global $var_set; + global $achievements_return_set; + + if ( isset( $_POST['get_data'] ) ) + { + hook_variable_set(); + // here we make the REST connection + $rest_api = new Rest_Api(); + $ach_data = $rest_api -> request( $var_set['url'], $var_set['app_key'], $var_set['host'], $var_set['items'] ); + // here we store the response we get from the server + $achievements_return_set['char_achievements'] = $ach_data ; + } + } + +/** + * Global Hook to return global variables which contains + * the content to use in the smarty templates extracted from + * the database + * + * @return $achievements_return_set global array returns the template data + */ +function achievements_hook_get_db() + { + global $achievements_return_set; + + if ( isset( $_SESSION['user'] ) ) + { + $db = new DBLayer( 'lib' ); + + // getting content for selecting characters + $sth = $db -> selectWithParameter( 'UserCharacter', 'ams_api_keys', array( 'User' => $_SESSION['user'] ) , 'User = :User' ); + $row = $sth -> fetch(); + $achievements_return_set['Character'] = $row; + } + } + +/** + * Global Hook to return global variables which contains + * the content to use in the smarty templates + * + * @return $achievements_return_set global array returns the template data + */ +function achievements_hook_return_global() + { + global $achievements_return_set; + return $achievements_return_set; + } diff --git a/code/web/private_php/ams/plugins/Achievements/templates/index.tpl b/code/web/private_php/ams/plugins/Achievements/templates/index.tpl new file mode 100644 index 000000000..884273668 --- /dev/null +++ b/code/web/private_php/ams/plugins/Achievements/templates/index.tpl @@ -0,0 +1,53 @@ +{block name=content} +{if isset($smarty.get.plugin_action) and $smarty.get.plugin_action eq 'get_achievements'} +
    +
    +
    +
    + Achievements +
    +
    + {if isset($hook_info.Achievements.no_char)}

    {$hook_info.Achievements.no_char}

    {/if} +
    + {$hook_info.Achievements.char_achievements} +
    +
    +
    +
    +
    +{else} +
    +
    +
    +
    + Select your Character +
    +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +{/if} +{/block} diff --git a/code/web/private_php/ams/plugins/Domain_Management/.info b/code/web/private_php/ams/plugins/Domain_Management/.info new file mode 100644 index 000000000..502846e4f --- /dev/null +++ b/code/web/private_php/ams/plugins/Domain_Management/.info @@ -0,0 +1,8 @@ +PluginName = Domain_Management +Description = Plug-in for Domain Management. +Version = 1.0.0 +TemplatePath = ../../../private_php/ams/plugins/Domain_Management/templates/index.tpl +Type = Manual + + + diff --git a/code/web/private_php/ams/plugins/Domain_Management/Domain_Management.php b/code/web/private_php/ams/plugins/Domain_Management/Domain_Management.php new file mode 100644 index 000000000..a99ac5551 --- /dev/null +++ b/code/web/private_php/ams/plugins/Domain_Management/Domain_Management.php @@ -0,0 +1,168 @@ + on which request is to be made + * appkey --> app key for authentication + * host --> host from which request have been sent + * + * @return $domain_management_return_set global array returns the template data + */ +function domain_management_hook_call_rest() + { + + global $domain_management_return_set; + global $WEBPATH; + + $domain_management_return_set['path'] = $WEBPATH; + + } + +/** + * Global Hook to return global variables which contains + * the content to use in the smarty templates extracted from + * the database + * + * @return $domain_management_return_set global array returns the template data + */ +function domain_management_hook_get_db() + { + global $domain_management_return_set; + + if ( isset( $_GET['ModifyDomain'] ) && $_GET['ModifyDomain'] = '1' && isset($_POST['domain_name'])) { + try { + + $dbs = new DBLayer( 'shard' ); + $dbs->update("domain", Array( 'domain_name' => $_POST['domain_name'], 'status' => $_POST['status'], 'patch_version' => $_POST['patch_version'],'backup_patch_url' => $_POST['backup_patch_url'],'patch_urls' => $_POST['patch_urls'],'login_address' => $_POST['login_address'],'session_manager_address' => $_POST['session_manager_address'],'ring_db_name' => $_POST['ring_db_name'],'web_host' => $_POST['web_host'],'web_host_php' => $_POST['web_host_php'],'description' => $_POST['description'],),'`domain_id` = '.$_GET['edit_domain']); + + } + catch ( Exception $e ) { + return null; + } + } + + if ( isset( $_GET['ModifyPermission'] ) && $_GET['ModifyPermission'] = '1' && isset($_POST['user'])) { + try { + + $dbl = new DBLayer("lib"); + + $statement = $dbl->execute("SELECT * FROM `settings` WHERE `Setting` = :setting", Array('setting' => 'Domain_Auto_Add')); + $json = $statement->fetch(); + $json = json_decode($json['Value'],true); + + $json[$_GET['edit_domain']]['1'] = $_POST['user']; + $json[$_GET['edit_domain']]['2'] = $_POST['moderator']; + $json[$_GET['edit_domain']]['3'] = $_POST['admin']; + + $update = json_encode($json); + + $dbl->update("settings", Array( 'Value' => $update),"`Setting` = 'Domain_Auto_Add'"); + + } + catch ( Exception $e ) { + return null; + } + } + + try { + + $db = new DBLayer( 'shard' ); + + // get all domains + $statement = $db -> executeWithoutParams( "SELECT * FROM domain" ); + $rows = $statement -> fetchAll(); + $domain_management_return_set['domains'] = $rows; + + if ( isset( $_GET['edit_domain'] ) ) { + // get permissions + $statement = $db -> executeWithoutParams( "SELECT * FROM `domain` WHERE `domain_id` = '" . $_GET['edit_domain'] . "'" ); + $rows = $statement -> fetchAll(); + $domain_management_return_set['domains'] = $rows; + + $statement = $db -> executeWithoutParams( "SELECT * FROM `permission` WHERE `DomainId` = '" . $_GET['edit_domain'] . "'" ); + $rows = $statement -> fetchAll(); + $domain_management_return_set['permissions'] = $rows; + + // get all users + $pagination = new Pagination( WebUsers :: getAllUsersQuery(), "web", 10, "WebUsers" ); + $domain_management_return_set['userlist'] = Gui_Elements :: make_table( $pagination -> getElements() , Array( "getUId", "getUsername", "getEmail" ), Array( "id", "username", "email" ) ); + + $dbl = new DBLayer("lib"); + + $statement = $dbl->execute("SELECT * FROM `settings` WHERE `Setting` = :setting", Array('setting' => 'Domain_Auto_Add')); + $json = $statement->fetch(); + $json = json_decode($json['Value'],true); + + $domain_management_return_set['Domain_Auto_Add'] = $json[$_GET['edit_domain']]; + + } + + return $rows; + + } + catch ( Exception $e ) { + return null; + } + } + +/** + * Global Hook to return global variables which contains + * the content to use in the smarty templates + * + * @return $domain_management_return_set global array returns the template data + */ +function domain_management_hook_return_global() + { + global $domain_management_return_set; + return $domain_management_return_set; + } + + +function api_key_management_hook_activate() + { + $dbl = new DBLayer( "lib" ); + $sql = "INSERT INTO `settings` (Setting) + SELECT 'Domain_Auto_Add' FROM DUAL + WHERE NOT EXISTS + (SELECT Setting FROM settings WHERE Setting='Domain_Auto_Add');"; + + $dbl -> executeWithoutParams( $sql ); + } \ No newline at end of file diff --git a/code/web/private_php/ams/plugins/Domain_Management/templates/index.tpl b/code/web/private_php/ams/plugins/Domain_Management/templates/index.tpl new file mode 100644 index 000000000..803d1133e --- /dev/null +++ b/code/web/private_php/ams/plugins/Domain_Management/templates/index.tpl @@ -0,0 +1,319 @@ +{block name=content} + +{if $permission eq 3} + {if isset($smarty.get.edit_domain)} +
    +
    +
    +
    + Domain: {$hook_info['Domain_Management']['domains']['0']['domain_name']} +
    +
    +
    + Users with permissions in domain + + + + + + + + + + + {assign var=val value=0} + {foreach from=$hook_info['Domain_Management']['userlist'] item=element name=loop} + + + + + + + {/foreach} + +
    User IDUsernamePermissions
    {$element.id}{$element.username} + {if isset($hook_info['Domain_Management']['permissions'][{$val}]['UId']) and $smarty.foreach.loop.iteration eq $hook_info['Domain_Management']['permissions'][{$val}]['UId']} + {if $hook_info['Domain_Management']['permissions'][{$val}]['AccessPrivilege'] eq ''} + BANNED! + {else} + {$hook_info['Domain_Management']['permissions'][{$val}]['AccessPrivilege']} + {/if} + {assign var=val value=$val+1} + {else} + NO PERMISSIONS + {/if} + + +
    +
    +
    +
    +
    + +
    +
    +
    + Modify Domain Settings +
    +
    +
    + +
    + + Domain Settings of '{$hook_info['Domain_Management']['domains']['0']['domain_name']}' + +
    + +
    +
    + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    + +
    + +
    + +
    +
    + +
    + +
    +
    + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    + +
    + +
    + +
    +
    + + {if isset($RESULT_OF_MODIFYING) and $RESULT_OF_MODIFYING eq "SUCCESS"} +
    + {$modify_mail_of_group_success} +
    + {/if} + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    + Permission Settings +
    +
    +
    + +
    + + Permission Settings of '{$hook_info['Domain_Management']['domains']['0']['domain_name']}' +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + + {if isset($RESULT_OF_MODIFYING) and $RESULT_OF_MODIFYING eq "SUCCESS"} +
    + {$modify_mail_of_group_success} +
    + {/if} + + +
    +
    +
    + +
    + {else} + +
    +
    +
    +
    + + +Domains + +
    +
    + + + + + + + + + + + + {if isset($hook_info['Domain_Management']['domains'][0])} + {foreach from=$hook_info['Domain_Management']['domains'] item=array} + + + + + + + + {/foreach} + {/if} + +
    Domain IDDomain NameStatusPatch VersionDescription
    {$array['domain_id']}{$array['domain_name']}{$array['status']}{$array['patch_version']}{$array['description']|truncate}
    +
    +
    +
    + +
    + {/if} +{/if} +{/block} diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/plugins/cacheresource.apc.php b/code/web/private_php/ams/plugins/cacheresource.apc.php similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/plugins/cacheresource.apc.php rename to code/web/private_php/ams/plugins/cacheresource.apc.php diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/plugins/cacheresource.memcache.php b/code/web/private_php/ams/plugins/cacheresource.memcache.php similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/plugins/cacheresource.memcache.php rename to code/web/private_php/ams/plugins/cacheresource.memcache.php diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/plugins/cacheresource.mysql.php b/code/web/private_php/ams/plugins/cacheresource.mysql.php similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/plugins/cacheresource.mysql.php rename to code/web/private_php/ams/plugins/cacheresource.mysql.php diff --git a/code/web/private_php/ams/plugins/doxygen_plugin_management.php b/code/web/private_php/ams/plugins/doxygen_plugin_management.php new file mode 100644 index 000000000..e7f937dc2 --- /dev/null +++ b/code/web/private_php/ams/plugins/doxygen_plugin_management.php @@ -0,0 +1,119 @@ + . \b info -- This file contains the information related to plugins and is described in below section. +\n --> \b Plugin_Name.php -- This file contains the hooks for the plugins . For more info related to hooks see last section: creating hooks. +\subsection subsection1 Plugin Management: Supportable Extensions +Plugin management system always looks for the Plugins which are compressed with .zip extension.If the uploaded plugin is not a file type of "zip/application", it throws an error and stops updloading. +\subsection subsection2 Plugin Management: .info File +Plugins always with a .info file inside it which contains the information related to plugins which will be displayed below, otherwise installation will not proceed further. +\n\b -------- Content of the .info File---------- +\n\b PluginName = Sample Plugin +\n\b Description = Sample Plugin shows sample +\n\b Version = 1.0.0 +\n\b TemplatePath = Path to the template +\n\b Type = Manual or Automatic +\n\n If this is an update there must be a field in the .info file +\n\b UpdateInfo = what is updated? +\subsection subsection3 Plugin Management: Versioning +For all plugins we have used semantic versioning +\n -->Format: X.Y.Z ,X->Major, Y->Minor, Z->Patch +\n -->change in the X Y & Z values refer the type of change in the plugin. +\n -->for initial development only Minor an Patch MUST be 0. +\n -->if there is bug fix then there MUST be an increment in the Z value. +\n -->if there is change in the functionality or addition of new functionality +\n -->then there MUST be an increment in the Y value. +\n -->When there is increment in the X value , Y and Z MUST be 0. +\n -->comparing if there is some change +\n -->For more info refer: https://semver.org +\subsection subsection4 Plugin Management: Naming Conventions +--> The plugin folder and hooks file must have same names in the format +\n ----> Plugin Folder name = "Sample_Plugin" +\n ----> Plugin hooks file = "Sample_Plugin.php" +\n--> All the fields in the .info file must follow the pattern as written in sample above. +\subsection subsection5 Plugin Management: Installing New plugins +To install a plugin we have to upload the plugin compressed with zip extension.There is an option to Install Plugin in the AMS plugins template which redirects +the admin to the uploading pannel. Here, in uploading pannel user uploads the plugin which he want to install and an option to install will occur when uploads finished. +Now, admin select the option to install plugin , AMS starts checking for the .info file and compare names for the plugin folder with hook file. +If all successfully completed without error your plugin is installed. +\subsection subsection6 Plugin Management: Activate Plugin +When a plugin is installed now you can perform many actions on it, one of them is Activate plugin. +When admin selects Activate Plugin option , AMS start executing hooks available in the Plugin. +\subsection subsection7 Plugin Management: Deactivate Plugin +When the admin wants to deactivate a running Plugin , Deactivate Plugin option can help him out. +\subsection subsection8 Plugin Management: Delete Plugin +When a admin want to Delete a plugin from the AMS , he must have to check if the plugin is activated or not. +\n if active then to use delete option he must have to deactivate that plugin. +\n if inactive then the delete option is already there. +\subsection subsection9 Plugin Management: Install Update +If admin wants to install the update follow the following steps: +\n --> Modify the changes or write the code which need to be added. +\n --> Improve the Versioning by following the Versioning sections. +\n --> Add a field 'UpdateInfo' (as described above in .info file section) in the .info file. +\n --> compress the plugin again with zip extension and upload it in the Install Plugin part. +\n\n When the upload is validated , the update is added to the updates template with proper information provided. +If admin wants to apply update to the plugin , he have to select the Update option. + +\section section2 Creating Plugins for AMS: +\subsection subsection10 Creating Local and Global Variables +\b Global \b Variables: +\n --> These variables are defined to store the Global information or information that are usable Globally in AMS. +\n --> These must be an array to store data with key => value pair. +\n --> This is the only variable which is returned after going through all hooks. +\n --> Sample: +\n \n +\b $return_set \b = \b array(); +\n \n All the information that hooks return will store in it to use with smarty loader or other functionalities. +\n --> Field that must be defined to display in menu bar : +\n \n +\b $return_set[ \b 'menu_display'] \b = \b 'Name \b to \b display \b in \b menu \b bar' +\n \n +\n \b Local \b Variables: +\n --> These variables are defined to store the local information or information that are usable in hooks. +\n --> It is used to store values which we get from GET and POST requests. +\n --> These must be an array to store data with key => value pair. +\n --> Sample: +\n \n +\b $var_set \b = \b array(); +\n \n All the information that needs to be usable in hooks is stored in this local array. +\subsection subsection12 Creating Global Hooks +\b Defining \b Hooks: +\n --> Hooks are defined as \b $PluginName_hook_task(). +\n --> Where \b $PluginName must be same as the file name in which hooks are defined. +\n Example: +\n + --> \b Display \b hook: +\n \n +\b function \b PluginName_hook_display() +\n \b { +\n \b $return_set[ \b 'menu_display'] \b = \b 'PluginName' +\n \b } +\n \n +--> For creating hooks for storing and fetching data from databases. You have to define hook like \b $PluginName_hook_store_db() or \b $PluginName_hook_get_db(), Then create the object of the DBLayer class present in AMS libraries. + +\n \b --> \b One \b Global \b hook \b must \b always \b be \b in \b hooks \b list \b that \b will \b return \b the \b Global \b variables. +\subsection subsection13 Creating Local Hooks +\b Defining \b Hooks: +\n --> Hooks are defined as \b hook_task( \b $param,..). +\n --> Where \b $param must be the values stored in Local variables. +\n Example: +\n + --> \b cron \b hook: +\n \n +\b function \b hook_set_cron( \b $connection, \b $path, \b $handle, \b $cron_file ) +\n \b { +\n \b ... \b statements \b ...... +\n \b } +\n \n +--> Local hooks are created to set or use values from GET and POST request or stored values stored in local variables. +\n --> Local hooks are called according to requests made by the server.(for more info see sample apps at the end of this section) + +\subsection subsection14 Plugins Already installed with AMS +\n \b --> \b Achievements.php +\n \b --> \b API_key_management.php +*/ + diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/plugins/resource.extendsall.php b/code/web/private_php/ams/plugins/resource.extendsall.php similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/plugins/resource.extendsall.php rename to code/web/private_php/ams/plugins/resource.extendsall.php diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/plugins/resource.mysql.php b/code/web/private_php/ams/plugins/resource.mysql.php similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/plugins/resource.mysql.php rename to code/web/private_php/ams/plugins/resource.mysql.php diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/plugins/resource.mysqls.php b/code/web/private_php/ams/plugins/resource.mysqls.php similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/plugins/resource.mysqls.php rename to code/web/private_php/ams/plugins/resource.mysqls.php diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/README b/code/web/private_php/ams/smarty/README similarity index 99% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/README rename to code/web/private_php/ams/smarty/README index bf03403aa..50e0d60e5 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/README +++ b/code/web/private_php/ams/smarty/README @@ -1,4 +1,4 @@ -Smarty 3.1.13 +Smarty 3.1.19 Author: Monte Ohrt Author: Uwe Tews @@ -120,7 +120,7 @@ $smarty->unregisterObject($object_name) $smarty->unregisterFilter($type, $function_name) $smarty->unregisterResource($resource_type) -$smarty->compileAllTemplates($extention = '.tpl', $force_compile = false, $time_limit = 0, $max_errors = null) +$smarty->compileAllTemplates($extension = '.tpl', $force_compile = false, $time_limit = 0, $max_errors = null) $smarty->clearCompiledTemplate($resource_name = null, $compile_id = null, $exp_time = null) $smarty->testInstall() diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/SMARTY_2_BC_NOTES.txt b/code/web/private_php/ams/smarty/SMARTY_2_BC_NOTES.txt similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/SMARTY_2_BC_NOTES.txt rename to code/web/private_php/ams/smarty/SMARTY_2_BC_NOTES.txt diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/SMARTY_3.0_BC_NOTES.txt b/code/web/private_php/ams/smarty/SMARTY_3.0_BC_NOTES.txt similarity index 100% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/SMARTY_3.0_BC_NOTES.txt rename to code/web/private_php/ams/smarty/SMARTY_3.0_BC_NOTES.txt diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/SMARTY_3.1_NOTES.txt b/code/web/private_php/ams/smarty/SMARTY_3.1_NOTES.txt similarity index 99% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/SMARTY_3.1_NOTES.txt rename to code/web/private_php/ams/smarty/SMARTY_3.1_NOTES.txt index e56e56f67..57709f0d7 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/SMARTY_3.1_NOTES.txt +++ b/code/web/private_php/ams/smarty/SMARTY_3.1_NOTES.txt @@ -199,7 +199,7 @@ Relative paths are available with {include file="..."} and $smarty->fetch('./foo.tpl') cannot be relative to a template, an exception is thrown. - Adressing a specific $template_dir + Addressing a specific $template_dir Smarty 3.1 introduces the $template_dir index notation. $smarty->fetch('[foo]bar.tpl') and {include file="[foo]bar.tpl"} diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/change_log.txt b/code/web/private_php/ams/smarty/change_log.txt similarity index 88% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/change_log.txt rename to code/web/private_php/ams/smarty/change_log.txt index 69642e276..7eb58320d 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/change_log.txt +++ b/code/web/private_php/ams/smarty/change_log.txt @@ -1,9 +1,227 @@ -===== Smarty-3.1.13 ===== + ===== 3.1.20-dev ===== (xx.xx.2014) + ===== 3.1.19 ===== (06.30.2014) + 20.06.2014 + - bugfix template variables could not be passed as paramter in {include} when the include was in a {nocache} section (topic 25131) + + 17.06.2014 + - bugfix large template text of some charsets could cause parsing errors (topic 24630) + + 08.06.2014 + - bugfix registered objects did not work after spelling fixes of 06.06.2014 + - bugfix {block} tags within {literal} .. {/literal} got not displayed correctly (topic 25024) + - bugfix UNC WINDOWS PATH like "\\psf\path\to\dir" did not work as template directory (Issue 192) + - bugfix {html_image} security check did fail on files relative to basedir (Issue 191) + + 06.06.2014 + - fixed PHPUnit outputFilterTrimWhitespaceTests.php assertion of test result + - fixed spelling, PHPDoc , minor errors, code cleanup + + 02.06.2014 + - using multiple cwd with relative template dirs could result in identical compiled file names. (issue 194 and topic 25099) + + 19.04.2014 + - bugfix calling createTemplate(template, data) with empty data array caused notice of array to string conversion (Issue 189) + - bugfix clearCompiledTemplate() did not delete files on WINDOWS when a compile_id was specified + + 18.04.2014 + - revert bugfix of 5.4.2014 because %-e date format is not supported on all operating systems + + ===== 3.1.18 ===== (07.04.2014) + 06.04.2014 + - bugfix template inheritance fail when using custom resource after patch of 8.3.2014 (Issue 187) + - bugfix update of composer file (Issue 168 and 184) + + 05.04.2014 + - bugfix default date format leads to extra spaces when displaying dates with single digit days (Issue 165) + + 26.03.2014 + - bugfix Smart_Resource_Custom should not lowercase the resource name (Issue 183) + + 24.03.2014 + - bugfix using a {foreach} property like @iteration could fail when used in inheritance parent templates (Issue 182) + + 20.03.2014 + - bugfix $smarty->auto_literal and mbsting.func_overload 2, 6 or 7 did fail (forum topic 24899) + + 18.03.2014 + - revert change of 17.03.2014 + +17.03.2014 + - bugfix $smarty->auto_literal and mbsting.func_overload 2, 6 or 7 did fail (forum topic 24899) + + 15.03.2014 + - bugfix Smarty_CacheResource_Keyvaluestore did use different keys on read/writes and clearCache() calls (Issue 169) + + 13.03.2014 + - bugfix clearXxx() change of 27.1.2014 did not work when specifing cache_id or compile_id (forum topic 24868 and 24867) + + ===== 3.1.17 ===== + 08.03.2014 + - bugfix relative file path {include} within {block} of child templates did throw exception on first call (Issue 177) + + 17.02.2014 + - bugfix Smarty failed when executing PHP on HHVM (Hip Hop 2.4) because uniqid('',true) does return string with ',' (forum topic 20343) + + 16.02.2014 + - bugfix a '//' or '\\' in template_dir path could produce wrong path on relative filepath in {include} (Issue 175) + + 05.02.2014 + - bugfix shared.literal_compiler_param.php did throw an exception when literal did contain a '-' (smarty-developers group) + + 27.01.2014 + - bugfix $smarty->debugging = true; did show the variable of the $smarty object not the variables used in display() call (forum topic 24764) + - bugfix clearCompiledTemplate(), clearAll() and clear() should use realpath to avoid possible exception from RecursiveDirectoryIterator (Issue 171) + + 26.01.2014 + - bugfix undo block nesting checks for {nocache} for reasons like forum topic 23280 (forum topic 24762) + + 18.01.2014 + - bugfix the compiler did fail when using template inheritance and recursive {include} (smarty-developers group) + + 11.01.2014 + - bugfix "* }" (spaces before right delimiter) was interpreted by mistake as comment end tag (Issue 170) + - internals content cache should be clear when updating cache file + + 08.01.2014 + - bugfix Smarty_CacheResource_Custom did not handle template resource type specifications on clearCache() calls (Issue 169) + - bugfix SmartyBC.class.php should use require_once to load Smarty.class.php (forum topic 24683) + + ===== 3.1.16 ===== + 15.12.2013 + - bugfix {include} with {block} tag handling (forum topic 24599, 24594, 24682) (Issue 161) + Read 3.1.16_RELEASE_NOTES for more details + - enhancement additional debug output at $smarty->_parserdebug = true; + + 07.11.2013 + - bugfix too restrictive handling of {include} within {block} tags. 3.1.15 did throw errors where 3.1.14 did not (forum topic 24599) + - bugfix compiler could fail if PHP mbstring.func_overload is enabled (Issue 164) + + 28.10.2013 + - bugfix variable resource name at custom resource plugin did not work within {block} tags (Issue 163) + - bugfix notice "Trying to get property of non-object" removed (Issue 163) + - bugfix correction of modifier capitalize fix from 3.10.2013 (issue 159) + - bugfix multiple {block}s with same name in parent did not work (forum topic 24631) + + 20.10.2013 + - bugfix a variable file name at {extends} tag did fail (forum topic 24618) + + 14.10.2013 + - bugfix yesterdays fix could result in an undefined variable + + 13.10.2013 + - bugfix variable names on {include} in template inheritance did unextepted error message (forum topic 24594) (Issue 161) +.- bugfix relative includes with same name like {include './foo.tpl'} from different folder failed (forum topic 24590)(Issue 161) + + 04.10.2013 + - bugfix variable file names at {extends} had been disbabled by mistake with the rewrite of + template inheritance of 24.08.2013 (forum topic 24585) + +03.10.2013 + - bugfix loops using modifier capitalize did eat up memory (issue 159) + + ===== Smarty 3.1.15 ===== +01.10.2013 + - use current delimiters in compiler error messages (issue 157) + - improvement on performance when using error handler and multiple template folders (issue 152) + +17.09.2013 + - improvement added patch for additional SmartyCompilerException properties for better access to scource information (forum topic 24559) + +16.09.2013 + - bugfix recompiled templates did not show on first request with zend opcache cache (forum topic 24320) + +13.09.2013 + - bugfix html_select_time defaulting error for the Meridian dropdown (forum topic 24549) + +09.09.2012 +- bugfix incorrect compiled code with array(object,method) callback at registered Variable Filter (forum topic 24542) + +27.08.2013 +- bugfix delimiter followed by linebreak did not work as auto literal after update from 24.08.2013 (forum topic 24518) + +24.08.2013 +- bugfix and enhancement + Because several recent problems with template inheritance the {block} tag compiler has been rewriten + - Error messages shown now the correct child template file and line number + - The compiler could fail on some larger UTF-8 text block (forum topic 24455) + - The {strip} tag can now be placed outside {block} tags in child templates (forum topic 24289) +- change SmartyException::$escape is now false by default +- change PHP traceback has been remove for SmartyException and SmartyCompilerException + +14.08.2013 +- bugfix compiled filepath of config file did not observe different config_dir (forum topic 24493) + +13.08.2013 +- bugfix the internal resource cache did not observe config_dir changes (forum topic 24493) + +12.08.2013 +- bugfix internal $tmpx variables must be unique over all inheritance templates (Issue 149) + +10.08.2013 +- bugfix a newline was eaten when a was passed by a Smarty variable and caching was enabled (forum topic 24482) + +29.07.2013 +- bugfix headers already send warning thrown when using 'SMARTY_DEBUG=on' from URL (Issue 148) + +27.07.2013 +- enhancement allow access to properties of registered opjects for Smarty2 BC (forum topic 24344) + +26.07.2013 +- bugfix template inheritance nesting problem (forum topic 24387) + +15.7.2013 +- update code generated by PSR-2 standards fixer which introduced PHP 5.4 incompatibilities of 14.7.2013 + +14.7.2013 +- bugfix increase of internal maximum parser stacksize to allow more complex tag code {forum topic 24426} +- update for PHP 5.4 compatibility +- reformat source to PSR-2 standard + +12.7.2013 +- bugfix Do not remove '//' from file path at normalization (Issue 142) + +2.7.2013 +- bugfix trimwhitespace would replace captured items in wrong order (forum topic 24387) + +===== Smarty-3.1.14 ===== +27.06.2013 +- bugfix removed PHP 5.5 deprecated preg_replace /e option in modifier capitalize (forum topic 24389) + +17.06.2013 +- fixed spelling in sources and documentation (from smarty-developers forum Veres Lajos) +- enhancement added constant SMARTY::CLEAR_EXPIRED for the change of 26.05.2013 (forum topic 24310) +- bugfix added smarty_security.php to composer.json (Issue 135) + +26.05.2013 +- enhancement an expire_time of -1 in clearCache() and clearAllCache() will delete outdated cache files + by their individual cache_lifetime used at creation (forum topic 24310) + +21.05.2013 +- bugfix modifier strip_tags:true was compiled into wrong code (Forum Topic 24287) +- bugfix /n after ?> in Smarty.class.php did start output buffering (Issue 138) + +25.04.2013 +- bugfix escape and wordrap modifier could be compiled into wrong code when used in {nocache}{/nocache} + section but caching is disabled (Forum Topic 24260) + +05.04.2013 +- bugfix post filter must not run when compiling inheritance child blocks (Forum Topic 24094) +- bugfix after the fix for Issue #130 compiler exceptions got double escaped (Forum Topic 24199) + +28.02.2013 +- bugfix nocache blocks could be lost when using CACHING_LIFETIME_SAVED (Issue #133) +- bugfix Compile ID gets nulled when compiling child blocks (Issue #134) + + +24.01.2013 +- bugfix wrong tag type in smarty_internal_templatecompilerbase.php could cause wrong plugin search order (Forum Topic 24028) + +===== Smarty-3.1.13 ===== 13.01.2013 - enhancement allow to disable exception message escaping by SmartyException::$escape = false; (Issue #130) 09.01.2013 -- bugfix compilation did fail when a prefilter did modify an {extends} tag (Forum Topic 23966) +- bugfix compilation did fail when a prefilter did modify an {extends} tag c - bugfix template inheritance could fail if nested {block} tags in childs did contain {$smarty.block.child} (Issue #127) - bugfix template inheritance could fail if {block} tags in childs did have similar name as used plugins (Issue #128) - added abstract method declaration doCompile() in Smarty_Internal_TemplateCompilerBase (Forum Topic 23969) @@ -417,7 +635,7 @@ 03/09/2011 - bugfix createTemplate() must default to cache_id and compile_id of Smarty object - bugfix Smarty_CacheResource_KeyValueStore must include $source->uid in cache filepath to keep templates with same - name but different folders seperated + name but different folders separated - added cacheresource.apc.php example in demo folder 02/09/2011 @@ -608,7 +826,7 @@ - changed ./ and ../ behaviour 14/02/2011 -- added {block ... hide} option to supress block if no child is defined +- added {block ... hide} option to suppress block if no child is defined 13/02/2011 - update handling of recursive subtemplate calls @@ -722,7 +940,7 @@ - bugfix on compiler object destruction. compiler_object property was by mistake unset. 09/03/2011 --bugfix a variable filter should run before modifers on an output tag (see change of 23/07/2010) +-bugfix a variable filter should run before modifiers on an output tag (see change of 23/07/2010) 08/03/2011 - bugfix loading config file without section should load only defaults @@ -1026,10 +1244,10 @@ request_use_auto_globals - bugfix passing scope attributes in doublequoted strings did not work at {include} {assign} and {append} 25/07/2010 -- another bugfix of change from 23/07/2010 when compiling modifer +- another bugfix of change from 23/07/2010 when compiling modifier 24/07/2010 -- bugfix of change from 23/07/2010 when compiling modifer +- bugfix of change from 23/07/2010 when compiling modifier 23/07/2010 - changed execution order. A variable filter does now run before modifiers on output of variables @@ -1336,7 +1554,7 @@ request_use_auto_globals - bugfix on {if} tags 01/12/2010 -- changed back modifer handling in parser. Some restrictions still apply: +- changed back modifier handling in parser. Some restrictions still apply: if modifiers are used in side {if...} expression or in mathematical expressions parentheses must be used. - bugfix the {function..} tag did not accept the name attribute in double quotes @@ -1948,7 +2166,7 @@ NOTICE: existing compiled template and cache files must be deleted - fixed exceptions in function plugins - fixed notice error in Smarty.class.php - allow chained objects to span multiple lines -- fixed error in modifers +- fixed error in modifiers 03/20/2009 - moved /plugins folder into /libs folder @@ -1956,7 +2174,7 @@ NOTICE: existing compiled template and cache files must be deleted - autoappend a directory separator if the xxxxx_dir definition have no trailing one 03/19/2009 -- allow array definition as modifer parameter +- allow array definition as modifier parameter - changed modifier to use multi byte string funktions. 03/17/2009 diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/Smarty.class.php b/code/web/private_php/ams/smarty/libs/Smarty.class.php similarity index 78% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/Smarty.class.php rename to code/web/private_php/ams/smarty/libs/Smarty.class.php index 40532fc2a..6291e4cd5 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/Smarty.class.php +++ b/code/web/private_php/ams/smarty/libs/Smarty.class.php @@ -2,33 +2,29 @@ /** * Project: Smarty: the PHP compiling template engine * File: Smarty.class.php - * SVN: $Id: Smarty.class.php 4694 2013-01-13 21:13:14Z uwe.tews@googlemail.com $ - * + * SVN: $Id: Smarty.class.php 4848 2014-06-08 18:12:09Z Uwe.Tews@googlemail.com $ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. - * * This library 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 * Lesser General Public License for more details. - * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * * For questions, help, comments, discussion, etc., please join the * Smarty mailing list. Send a blank e-mail to * smarty-discussion-subscribe@googlegroups.com * - * @link http://www.smarty.net/ + * @link http://www.smarty.net/ * @copyright 2008 New Digital Group, Inc. - * @author Monte Ohrt - * @author Uwe Tews - * @author Rodney Rehm - * @package Smarty - * @version 3.1.13 + * @author Monte Ohrt + * @author Uwe Tews + * @author Rodney Rehm + * @package Smarty + * @version 3.1.19 */ /** @@ -92,20 +88,21 @@ if (SMARTY_SPL_AUTOLOAD && set_include_path(get_include_path() . PATH_SEPARATOR /** * Load always needed external class files */ -include_once SMARTY_SYSPLUGINS_DIR.'smarty_internal_data.php'; -include_once SMARTY_SYSPLUGINS_DIR.'smarty_internal_templatebase.php'; -include_once SMARTY_SYSPLUGINS_DIR.'smarty_internal_template.php'; -include_once SMARTY_SYSPLUGINS_DIR.'smarty_resource.php'; -include_once SMARTY_SYSPLUGINS_DIR.'smarty_internal_resource_file.php'; -include_once SMARTY_SYSPLUGINS_DIR.'smarty_cacheresource.php'; -include_once SMARTY_SYSPLUGINS_DIR.'smarty_internal_cacheresource_file.php'; +include_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_data.php'; +include_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_templatebase.php'; +include_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_template.php'; +include_once SMARTY_SYSPLUGINS_DIR . 'smarty_resource.php'; +include_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_resource_file.php'; +include_once SMARTY_SYSPLUGINS_DIR . 'smarty_cacheresource.php'; +include_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_cacheresource_file.php'; /** * This is the main Smarty class + * * @package Smarty */ -class Smarty extends Smarty_Internal_TemplateBase { - +class Smarty extends Smarty_Internal_TemplateBase +{ /**#@+ * constant definitions */ @@ -113,7 +110,7 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * smarty version */ - const SMARTY_VERSION = 'Smarty-3.1.13'; + const SMARTY_VERSION = 'Smarty-3.1.19'; /** * define variable scopes @@ -128,6 +125,11 @@ class Smarty extends Smarty_Internal_TemplateBase { const CACHING_OFF = 0; const CACHING_LIFETIME_CURRENT = 1; const CACHING_LIFETIME_SAVED = 2; + /** + * define constant for clearing cache files be saved expiration datees + */ + const CLEAR_EXPIRED = - 1; + /** * define compile check modes */ @@ -201,106 +203,133 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * auto literal on delimiters with whitspace + * * @var boolean */ public $auto_literal = true; /** * display error on not assigned variables + * * @var boolean */ public $error_unassigned = false; /** * look up relative filepaths in include_path + * * @var boolean */ public $use_include_path = false; /** * template directory + * * @var array */ private $template_dir = array(); /** * joined template directory string used in cache keys + * * @var string */ public $joined_template_dir = null; /** * joined config directory string used in cache keys + * * @var string */ public $joined_config_dir = null; /** * default template handler + * * @var callable */ public $default_template_handler_func = null; /** * default config handler + * * @var callable */ public $default_config_handler_func = null; /** * default plugin handler + * * @var callable */ public $default_plugin_handler_func = null; /** * compile directory + * * @var string */ private $compile_dir = null; /** * plugins directory + * * @var array */ private $plugins_dir = array(); /** * cache directory + * * @var string */ private $cache_dir = null; /** * config directory + * * @var array */ private $config_dir = array(); /** * force template compiling? + * * @var boolean */ public $force_compile = false; /** * check template for modifications? + * * @var boolean */ public $compile_check = true; /** * use sub dirs for compiled/cached files? + * * @var boolean */ public $use_sub_dirs = false; /** * allow ambiguous resources (that are made unique by the resource handler) + * * @var boolean */ public $allow_ambiguous_resources = false; /** * caching enabled + * * @var boolean */ public $caching = false; /** * merge compiled includes + * * @var boolean */ public $merge_compiled_includes = false; + /** + * template inheritance merge compiled includes + * + * @var boolean + */ + public $inheritance_merge_compiled_includes = true; /** * cache lifetime in seconds + * * @var integer */ public $cache_lifetime = 3600; /** * force cache file creation + * * @var boolean */ public $force_cache = false; @@ -320,11 +349,13 @@ class Smarty extends Smarty_Internal_TemplateBase { public $compile_id = null; /** * template left-delimiter + * * @var string */ public $left_delimiter = "{"; /** * template right-delimiter + * * @var string */ public $right_delimiter = "}"; @@ -333,7 +364,6 @@ class Smarty extends Smarty_Internal_TemplateBase { */ /** * class name - * * This should be instance of Smarty_Security. * * @var string @@ -360,7 +390,6 @@ class Smarty extends Smarty_Internal_TemplateBase { public $allow_php_templates = false; /** * Should compiled-templates be prevented from being called directly? - * * {@internal * Currently used by Smarty_Internal_Template only. * }} @@ -371,7 +400,6 @@ class Smarty extends Smarty_Internal_TemplateBase { /**#@-*/ /** * debug mode - * * Setting this to true enables the debug-console. * * @var boolean @@ -383,12 +411,12 @@ class Smarty extends Smarty_Internal_TemplateBase { *
  • NONE => no debugging control allowed
  • *
  • URL => enable debugging when SMARTY_DEBUG is found in the URL.
  • * + * * @var string */ public $debugging_ctrl = 'NONE'; /** * Name of debugging URL-param. - * * Only used when $debugging_ctrl is set to 'URL'. * The name of the URL-parameter that activates debugging. * @@ -397,16 +425,19 @@ class Smarty extends Smarty_Internal_TemplateBase { public $smarty_debug_id = 'SMARTY_DEBUG'; /** * Path of debug template. + * * @var string */ public $debug_tpl = null; /** * When set, smarty uses this value as error_reporting-level. + * * @var int */ public $error_reporting = null; /** * Internal flag for getTags() + * * @var boolean */ public $get_used_tags = false; @@ -417,16 +448,19 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * Controls whether variables with the same name overwrite each other. + * * @var boolean */ public $config_overwrite = true; /** * Controls whether config values of on/true/yes and off/false/no get converted to boolean. + * * @var boolean */ public $config_booleanize = true; /** * Controls whether hidden config sections/vars are read from the file. + * * @var boolean */ public $config_read_hidden = false; @@ -439,16 +473,19 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * locking concurrent compiles + * * @var boolean */ public $compile_locking = true; /** * Controls whether cache resources should emply locking mechanism + * * @var boolean */ public $cache_locking = false; /** * seconds to wait for acquiring a lock before ignoring the write lock + * * @var float */ public $locking_timeout = 10; @@ -457,19 +494,19 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * global template functions + * * @var array */ public $template_functions = array(); /** * resource type used if none given - * * Must be an valid key of $registered_resources. + * * @var string */ public $default_resource_type = 'file'; /** * caching type - * * Must be an element of $cache_resource_types. * * @var string @@ -477,121 +514,145 @@ class Smarty extends Smarty_Internal_TemplateBase { public $caching_type = 'file'; /** * internal config properties + * * @var array */ public $properties = array(); /** * config type + * * @var string */ public $default_config_type = 'file'; /** * cached template objects + * * @var array */ public $template_objects = array(); /** * check If-Modified-Since headers + * * @var boolean */ public $cache_modified_check = false; /** * registered plugins + * * @var array */ public $registered_plugins = array(); /** * plugin search order + * * @var array */ public $plugin_search_order = array('function', 'block', 'compiler', 'class'); /** * registered objects + * * @var array */ public $registered_objects = array(); /** * registered classes + * * @var array */ public $registered_classes = array(); /** * registered filters + * * @var array */ public $registered_filters = array(); /** * registered resources + * * @var array */ public $registered_resources = array(); /** * resource handler cache + * * @var array */ public $_resource_handlers = array(); /** * registered cache resources + * * @var array */ public $registered_cache_resources = array(); /** * cache resource handler cache + * * @var array */ public $_cacheresource_handlers = array(); /** * autoload filter + * * @var array */ public $autoload_filters = array(); /** * default modifier + * * @var array */ public $default_modifiers = array(); /** * autoescape variable output + * * @var boolean */ public $escape_html = false; /** * global internal smarty vars + * * @var array */ public static $_smarty_vars = array(); /** * start time for execution time calculation + * * @var int */ public $start_time = 0; /** * default file permissions + * * @var int */ public $_file_perms = 0644; /** * default dir permissions + * * @var int */ public $_dir_perms = 0771; /** * block tag hierarchy + * * @var array */ public $_tag_stack = array(); /** * self pointer to Smarty object + * * @var Smarty */ public $smarty; /** * required by the compiler for BC + * * @var string */ public $_current_file = null; /** * internal flag to enable parser debugging + * * @var bool */ public $_parserdebug = false; @@ -605,7 +666,7 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * Initialize new Smarty object - * + */ public function __construct() { @@ -628,7 +689,6 @@ class Smarty extends Smarty_Internal_TemplateBase { } } - /** * Class destructor */ @@ -645,36 +705,34 @@ class Smarty extends Smarty_Internal_TemplateBase { $this->smarty = $this; } - /** * <> Generic getter. - * * Calls the appropriate getter function. * Issues an E_USER_NOTICE if no valid getter is found. * - * @param string $name property name + * @param string $name property name + * * @return mixed */ public function __get($name) { $allowed = array( - 'template_dir' => 'getTemplateDir', - 'config_dir' => 'getConfigDir', - 'plugins_dir' => 'getPluginsDir', - 'compile_dir' => 'getCompileDir', - 'cache_dir' => 'getCacheDir', + 'template_dir' => 'getTemplateDir', + 'config_dir' => 'getConfigDir', + 'plugins_dir' => 'getPluginsDir', + 'compile_dir' => 'getCompileDir', + 'cache_dir' => 'getCacheDir', ); if (isset($allowed[$name])) { return $this->{$allowed[$name]}(); } else { - trigger_error('Undefined property: '. get_class($this) .'::$'. $name, E_USER_NOTICE); + trigger_error('Undefined property: ' . get_class($this) . '::$' . $name, E_USER_NOTICE); } } /** * <> Generic setter. - * * Calls the appropriate setter function. * Issues an E_USER_NOTICE if no valid setter is found. * @@ -684,11 +742,11 @@ class Smarty extends Smarty_Internal_TemplateBase { public function __set($name, $value) { $allowed = array( - 'template_dir' => 'setTemplateDir', - 'config_dir' => 'setConfigDir', - 'plugins_dir' => 'setPluginsDir', - 'compile_dir' => 'setCompileDir', - 'cache_dir' => 'setCacheDir', + 'template_dir' => 'setTemplateDir', + 'config_dir' => 'setConfigDir', + 'plugins_dir' => 'setPluginsDir', + 'compile_dir' => 'setCompileDir', + 'cache_dir' => 'setCacheDir', ); if (isset($allowed[$name])) { @@ -701,7 +759,8 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * Check if a template resource exists * - * @param string $resource_name template name + * @param string $resource_name template name + * * @return boolean status */ public function templateExists($resource_name) @@ -712,14 +771,15 @@ class Smarty extends Smarty_Internal_TemplateBase { // check if it does exists $result = $tpl->source->exists; $this->template_objects = $save; + return $result; } /** * Returns a single or all global variables * - * @param object $smarty - * @param string $varname variable name or null + * @param string $varname variable name or null + * * @return string variable value or or array of variables */ public function getGlobal($varname = null) @@ -735,6 +795,7 @@ class Smarty extends Smarty_Internal_TemplateBase { foreach (self::$global_tpl_vars AS $key => $var) { $_result[$key] = $var->value; } + return $_result; } } @@ -742,26 +803,29 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * Empty cache folder * - * @param integer $exp_time expiration time - * @param string $type resource type + * @param integer $exp_time expiration time + * @param string $type resource type + * * @return integer number of cache files deleted */ - function clearAllCache($exp_time = null, $type = null) + public function clearAllCache($exp_time = null, $type = null) { // load cache resource and call clearAll $_cache_resource = Smarty_CacheResource::load($this, $type); Smarty_CacheResource::invalidLoadedCache($this); + return $_cache_resource->clearAll($this, $exp_time); } /** * Empty cache for a specific template * - * @param string $template_name template name - * @param string $cache_id cache id - * @param string $compile_id compile id - * @param integer $exp_time expiration time - * @param string $type resource type + * @param string $template_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param integer $exp_time expiration time + * @param string $type resource type + * * @return integer number of cache files deleted */ public function clearCache($template_name, $cache_id = null, $compile_id = null, $exp_time = null, $type = null) @@ -769,20 +833,23 @@ class Smarty extends Smarty_Internal_TemplateBase { // load cache resource and call clear $_cache_resource = Smarty_CacheResource::load($this, $type); Smarty_CacheResource::invalidLoadedCache($this); + return $_cache_resource->clear($this, $template_name, $cache_id, $compile_id, $exp_time); } /** * Loads security class and enables security * - * @param string|Smarty_Security $security_class if a string is used, it must be class-name - * @return Smarty current Smarty instance for chaining - * @throws SmartyException when an invalid class name is provided + * @param string|Smarty_Security $security_class if a string is used, it must be class-name + * + * @return Smarty current Smarty instance for chaining + * @throws SmartyException when an invalid class name is provided */ public function enableSecurity($security_class = null) { if ($security_class instanceof Smarty_Security) { $this->security_policy = $security_class; + return $this; } elseif (is_object($security_class)) { throw new SmartyException("Class '" . get_class($security_class) . "' must extend Smarty_Security."); @@ -803,6 +870,7 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * Disable security + * * @return Smarty current Smarty instance for chaining */ public function disableSecurity() @@ -815,145 +883,164 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * Set template directory * - * @param string|array $template_dir directory(s) of template sources - * @return Smarty current Smarty instance for chaining + * @param string|array $template_dir directory(s) of template sources + * + * @return Smarty current Smarty instance for chaining */ public function setTemplateDir($template_dir) { $this->template_dir = array(); foreach ((array) $template_dir as $k => $v) { - $this->template_dir[$k] = rtrim($v, '/\\') . DS; + $this->template_dir[$k] = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($v, '/\\')) . DS; } $this->joined_template_dir = join(DIRECTORY_SEPARATOR, $this->template_dir); + return $this; } /** * Add template directory(s) * - * @param string|array $template_dir directory(s) of template sources - * @param string $key of the array element to assign the template dir to - * @return Smarty current Smarty instance for chaining + * @param string|array $template_dir directory(s) of template sources + * @param string $key of the array element to assign the template dir to + * + * @return Smarty current Smarty instance for chaining * @throws SmartyException when the given template directory is not valid */ - public function addTemplateDir($template_dir, $key=null) + public function addTemplateDir($template_dir, $key = null) { // make sure we're dealing with an array $this->template_dir = (array) $this->template_dir; if (is_array($template_dir)) { foreach ($template_dir as $k => $v) { + $v = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($v, '/\\')) . DS; if (is_int($k)) { // indexes are not merged but appended - $this->template_dir[] = rtrim($v, '/\\') . DS; + $this->template_dir[] = $v; } else { // string indexes are overridden - $this->template_dir[$k] = rtrim($v, '/\\') . DS; + $this->template_dir[$k] = $v; } } - } elseif ($key !== null) { - // override directory at specified index - $this->template_dir[$key] = rtrim($template_dir, '/\\') . DS; } else { - // append new directory - $this->template_dir[] = rtrim($template_dir, '/\\') . DS; + $v = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($template_dir, '/\\')) . DS; + if ($key !== null) { + // override directory at specified index + $this->template_dir[$key] = $v; + } else { + // append new directory + $this->template_dir[] = $v; + } } $this->joined_template_dir = join(DIRECTORY_SEPARATOR, $this->template_dir); + return $this; } /** * Get template directories * - * @param mixed index of directory to get, null to get all + * @param mixed $index index of directory to get, null to get all + * * @return array|string list of template directories, or directory of $index */ - public function getTemplateDir($index=null) + public function getTemplateDir($index = null) { if ($index !== null) { return isset($this->template_dir[$index]) ? $this->template_dir[$index] : null; } - return (array)$this->template_dir; + return (array) $this->template_dir; } /** * Set config directory * - * @param string|array $template_dir directory(s) of configuration sources - * @return Smarty current Smarty instance for chaining + * @param $config_dir + * + * @return Smarty current Smarty instance for chaining */ public function setConfigDir($config_dir) { $this->config_dir = array(); foreach ((array) $config_dir as $k => $v) { - $this->config_dir[$k] = rtrim($v, '/\\') . DS; + $this->config_dir[$k] = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($v, '/\\')) . DS; } $this->joined_config_dir = join(DIRECTORY_SEPARATOR, $this->config_dir); + return $this; } /** * Add config directory(s) * - * @param string|array $config_dir directory(s) of config sources - * @param string key of the array element to assign the config dir to + * @param string|array $config_dir directory(s) of config sources + * @param mixed $key key of the array element to assign the config dir to + * * @return Smarty current Smarty instance for chaining */ - public function addConfigDir($config_dir, $key=null) + public function addConfigDir($config_dir, $key = null) { // make sure we're dealing with an array $this->config_dir = (array) $this->config_dir; if (is_array($config_dir)) { foreach ($config_dir as $k => $v) { + $v = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($v, '/\\')) . DS; if (is_int($k)) { // indexes are not merged but appended - $this->config_dir[] = rtrim($v, '/\\') . DS; + $this->config_dir[] = $v; } else { // string indexes are overridden - $this->config_dir[$k] = rtrim($v, '/\\') . DS; + $this->config_dir[$k] = $v; } } - } elseif( $key !== null ) { - // override directory at specified index - $this->config_dir[$key] = rtrim($config_dir, '/\\') . DS; } else { - // append new directory - $this->config_dir[] = rtrim($config_dir, '/\\') . DS; + $v = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($config_dir, '/\\')) . DS; + if ($key !== null) { + // override directory at specified index + $this->config_dir[$key] = rtrim($v, '/\\') . DS; + } else { + // append new directory + $this->config_dir[] = rtrim($v, '/\\') . DS; + } } $this->joined_config_dir = join(DIRECTORY_SEPARATOR, $this->config_dir); + return $this; } /** * Get config directory * - * @param mixed index of directory to get, null to get all + * @param mixed $index index of directory to get, null to get all + * * @return array|string configuration directory */ - public function getConfigDir($index=null) + public function getConfigDir($index = null) { if ($index !== null) { return isset($this->config_dir[$index]) ? $this->config_dir[$index] : null; } - return (array)$this->config_dir; + return (array) $this->config_dir; } /** * Set plugins directory * - * @param string|array $plugins_dir directory(s) of plugins - * @return Smarty current Smarty instance for chaining + * @param string|array $plugins_dir directory(s) of plugins + * + * @return Smarty current Smarty instance for chaining */ public function setPluginsDir($plugins_dir) { $this->plugins_dir = array(); - foreach ((array)$plugins_dir as $k => $v) { + foreach ((array) $plugins_dir as $k => $v) { $this->plugins_dir[$k] = rtrim($v, '/\\') . DS; } @@ -963,8 +1050,8 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * Adds directory of plugin files * - * @param object $smarty - * @param string $ |array $ plugins folder + * @param $plugins_dir + * * @return Smarty current Smarty instance for chaining */ public function addPluginsDir($plugins_dir) @@ -988,6 +1075,7 @@ class Smarty extends Smarty_Internal_TemplateBase { } $this->plugins_dir = array_unique($this->plugins_dir); + return $this; } @@ -998,13 +1086,14 @@ class Smarty extends Smarty_Internal_TemplateBase { */ public function getPluginsDir() { - return (array)$this->plugins_dir; + return (array) $this->plugins_dir; } /** * Set compile directory * - * @param string $compile_dir directory to store compiled templates in + * @param string $compile_dir directory to store compiled templates in + * * @return Smarty current Smarty instance for chaining */ public function setCompileDir($compile_dir) @@ -1013,6 +1102,7 @@ class Smarty extends Smarty_Internal_TemplateBase { if (!isset(Smarty::$_muted_directories[$this->compile_dir])) { Smarty::$_muted_directories[$this->compile_dir] = null; } + return $this; } @@ -1029,7 +1119,8 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * Set cache directory * - * @param string $cache_dir directory to store cached templates in + * @param string $cache_dir directory to store cached templates in + * * @return Smarty current Smarty instance for chaining */ public function setCacheDir($cache_dir) @@ -1038,6 +1129,7 @@ class Smarty extends Smarty_Internal_TemplateBase { if (!isset(Smarty::$_muted_directories[$this->cache_dir])) { Smarty::$_muted_directories[$this->cache_dir] = null; } + return $this; } @@ -1054,20 +1146,23 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * Set default modifiers * - * @param array|string $modifiers modifier or list of modifiers to set - * @return Smarty current Smarty instance for chaining + * @param array|string $modifiers modifier or list of modifiers to set + * + * @return Smarty current Smarty instance for chaining */ public function setDefaultModifiers($modifiers) { $this->default_modifiers = (array) $modifiers; + return $this; } /** * Add default modifiers * - * @param array|string $modifiers modifier or list of modifiers to add - * @return Smarty current Smarty instance for chaining + * @param array|string $modifiers modifier or list of modifiers to add + * + * @return Smarty current Smarty instance for chaining */ public function addDefaultModifiers($modifiers) { @@ -1090,15 +1185,15 @@ class Smarty extends Smarty_Internal_TemplateBase { return $this->default_modifiers; } - /** * Set autoload filters * - * @param array $filters filters to load automatically - * @param string $type "pre", "output", … specify the filter type to set. Defaults to none treating $filters' keys as the appropriate types + * @param array $filters filters to load automatically + * @param string $type "pre", "output", … specify the filter type to set. Defaults to none treating $filters' keys as the appropriate types + * * @return Smarty current Smarty instance for chaining */ - public function setAutoloadFilters($filters, $type=null) + public function setAutoloadFilters($filters, $type = null) { if ($type !== null) { $this->autoload_filters[$type] = (array) $filters; @@ -1112,11 +1207,12 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * Add autoload filters * - * @param array $filters filters to load automatically - * @param string $type "pre", "output", … specify the filter type to set. Defaults to none treating $filters' keys as the appropriate types + * @param array $filters filters to load automatically + * @param string $type "pre", "output", … specify the filter type to set. Defaults to none treating $filters' keys as the appropriate types + * * @return Smarty current Smarty instance for chaining */ - public function addAutoloadFilters($filters, $type=null) + public function addAutoloadFilters($filters, $type = null) { if ($type !== null) { if (!empty($this->autoload_filters[$type])) { @@ -1140,10 +1236,11 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * Get autoload filters * - * @param string $type type of filter to get autoloads for. Defaults to all autoload filters - * @return array array( 'type1' => array( 'filter1', 'filter2', … ) ) or array( 'filter1', 'filter2', …) if $type was specified + * @param string $type type of filter to get autoloads for. Defaults to all autoload filters + * + * @return array array( 'type1' => array( 'filter1', 'filter2', … ) ) or array( 'filter1', 'filter2', …) if $type was specified */ - public function getAutoloadFilters($type=null) + public function getAutoloadFilters($type = null) { if ($type !== null) { return isset($this->autoload_filters[$type]) ? $this->autoload_filters[$type] : array(); @@ -1165,8 +1262,9 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * set the debug template * - * @param string $tpl_name - * @return Smarty current Smarty instance for chaining + * @param string $tpl_name + * + * @return Smarty current Smarty instance for chaining * @throws SmartyException if file is not readable */ public function setDebugTemplate($tpl_name) @@ -1182,20 +1280,21 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * creates a template object * - * @param string $template the resource handle of the template file - * @param mixed $cache_id cache id to be used with this template - * @param mixed $compile_id compile id to be used with this template - * @param object $parent next higher level of Smarty variables - * @param boolean $do_clone flag is Smarty object shall be cloned - * @return object template object + * @param string $template the resource handle of the template file + * @param mixed $cache_id cache id to be used with this template + * @param mixed $compile_id compile id to be used with this template + * @param object $parent next higher level of Smarty variables + * @param boolean $do_clone flag is Smarty object shall be cloned + * + * @return object template object */ public function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null, $do_clone = true) { - if (!empty($cache_id) && (is_object($cache_id) || is_array($cache_id))) { + if ($cache_id !== null && (is_object($cache_id) || is_array($cache_id))) { $parent = $cache_id; $cache_id = null; } - if (!empty($parent) && is_array($parent)) { + if ($parent !== null && is_array($parent)) { $data = $parent; $parent = null; } else { @@ -1242,17 +1341,19 @@ class Smarty extends Smarty_Internal_TemplateBase { $tpl->tpl_vars[$_key] = new Smarty_variable($_val); } } + return $tpl; } - /** * Takes unknown classes and loads plugin files for them * class name format: Smarty_PluginType_PluginName * plugin filename format: plugintype.pluginname.php * - * @param string $plugin_name class plugin name to load - * @param bool $check check if already loaded + * @param string $plugin_name class plugin name to load + * @param bool $check check if already loaded + * + * @throws SmartyException * @return string |boolean filepath of loaded file or false */ public function loadPlugin($plugin_name, $check = true) @@ -1267,13 +1368,13 @@ class Smarty extends Smarty_Internal_TemplateBase { // count($_name_parts) < 3 === !isset($_name_parts[2]) if (!isset($_name_parts[2]) || strtolower($_name_parts[0]) !== 'smarty') { throw new SmartyException("plugin {$plugin_name} is not a valid name format"); - return false; } // if type is "internal", get plugin from sysplugins if (strtolower($_name_parts[1]) == 'internal') { $file = SMARTY_SYSPLUGINS_DIR . strtolower($plugin_name) . '.php'; if (file_exists($file)) { require_once($file); + return $file; } else { return false; @@ -1285,7 +1386,7 @@ class Smarty extends Smarty_Internal_TemplateBase { $_stream_resolve_include_path = function_exists('stream_resolve_include_path'); // loop through plugin dirs and find the plugin - foreach($this->getPluginsDir() as $_plugin_dir) { + foreach ($this->getPluginsDir() as $_plugin_dir) { $names = array( $_plugin_dir . $_plugin_filename, $_plugin_dir . strtolower($_plugin_filename), @@ -1293,6 +1394,7 @@ class Smarty extends Smarty_Internal_TemplateBase { foreach ($names as $file) { if (file_exists($file)) { require_once($file); + return $file; } if ($this->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_plugin_dir)) { @@ -1305,6 +1407,7 @@ class Smarty extends Smarty_Internal_TemplateBase { if ($file !== false) { require_once($file); + return $file; } } @@ -1317,37 +1420,40 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * Compile all template files * - * @param string $extension file extension - * @param bool $force_compile force all to recompile - * @param int $time_limit - * @param int $max_errors + * @param string $extension file extension + * @param bool $force_compile force all to recompile + * @param int $time_limit + * @param int $max_errors + * * @return integer number of template files recompiled */ - public function compileAllTemplates($extention = '.tpl', $force_compile = false, $time_limit = 0, $max_errors = null) + public function compileAllTemplates($extension = '.tpl', $force_compile = false, $time_limit = 0, $max_errors = null) { - return Smarty_Internal_Utility::compileAllTemplates($extention, $force_compile, $time_limit, $max_errors, $this); + return Smarty_Internal_Utility::compileAllTemplates($extension, $force_compile, $time_limit, $max_errors, $this); } /** * Compile all config files * - * @param string $extension file extension - * @param bool $force_compile force all to recompile - * @param int $time_limit - * @param int $max_errors + * @param string $extension file extension + * @param bool $force_compile force all to recompile + * @param int $time_limit + * @param int $max_errors + * * @return integer number of template files recompiled */ - public function compileAllConfig($extention = '.conf', $force_compile = false, $time_limit = 0, $max_errors = null) + public function compileAllConfig($extension = '.conf', $force_compile = false, $time_limit = 0, $max_errors = null) { - return Smarty_Internal_Utility::compileAllConfig($extention, $force_compile, $time_limit, $max_errors, $this); + return Smarty_Internal_Utility::compileAllConfig($extension, $force_compile, $time_limit, $max_errors, $this); } /** * Delete compiled template file * - * @param string $resource_name template name - * @param string $compile_id compile id - * @param integer $exp_time expiration time + * @param string $resource_name template name + * @param string $compile_id compile id + * @param integer $exp_time expiration time + * * @return integer number of template files deleted */ public function clearCompiledTemplate($resource_name = null, $compile_id = null, $exp_time = null) @@ -1355,12 +1461,12 @@ class Smarty extends Smarty_Internal_TemplateBase { return Smarty_Internal_Utility::clearCompiledTemplate($resource_name, $compile_id, $exp_time, $this); } - /** * Return array of tag/attributes of all tags used by an template * - * @param object $templae template object - * @return array of tag/attributes + * @param Smarty_Internal_Template $template + * + * @return array of tag/attributes */ public function getTags(Smarty_Internal_Template $template) { @@ -1370,10 +1476,11 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * Run installation test * - * @param array $errors Array to write errors into, rather than outputting them + * @param array $errors Array to write errors into, rather than outputting them + * * @return boolean true if setup is fine, false if something is wrong */ - public function testInstall(&$errors=null) + public function testInstall(&$errors = null) { return Smarty_Internal_Utility::testInstall($this, $errors); } @@ -1382,7 +1489,13 @@ class Smarty extends Smarty_Internal_TemplateBase { * Error Handler to mute expected messages * * @link http://php.net/set_error_handler - * @param integer $errno Error level + * + * @param integer $errno Error level + * @param $errstr + * @param $errfile + * @param $errline + * @param $errcontext + * * @return boolean */ public static function mutingErrorHandler($errno, $errstr, $errfile, $errline, $errcontext) @@ -1394,7 +1507,7 @@ class Smarty extends Smarty_Internal_TemplateBase { $smarty_dir = realpath(SMARTY_DIR); if ($smarty_dir !== false) { Smarty::$_muted_directories[SMARTY_DIR] = array( - 'file' => $smarty_dir, + 'file' => $smarty_dir, 'length' => strlen($smarty_dir), ); } @@ -1411,7 +1524,7 @@ class Smarty extends Smarty_Internal_TemplateBase { continue; } $dir = array( - 'file' => $file, + 'file' => $file, 'length' => strlen($file), ); } @@ -1485,20 +1598,55 @@ if (Smarty::$_CHARSET !== 'UTF-8') { /** * Smarty exception class + * * @package Smarty */ -class SmartyException extends Exception { - public static $escape = true; - public function __construct($message) { - $this->message = self::$escape ? htmlentities($message) : $message; +class SmartyException extends Exception +{ + public static $escape = false; + + public function __toString() + { + return ' --> Smarty: ' . (self::$escape ? htmlentities($this->message) : $this->message) . ' <-- '; } } /** * Smarty compiler exception class + * * @package Smarty */ -class SmartyCompilerException extends SmartyException { +class SmartyCompilerException extends SmartyException +{ + public function __toString() + { + return ' --> Smarty Compiler: ' . $this->message . ' <-- '; + } + + /** + * The line number of the template error + * + * @type int|null + */ + public $line = null; + /** + * The template source snippet relating to the error + * + * @type string|null + */ + public $source = null; + /** + * The raw text of the error message + * + * @type string|null + */ + public $desc = null; + /** + * The resource identifier or template name + * + * @type string|null + */ + public $template = null; } /** @@ -1507,22 +1655,20 @@ class SmartyCompilerException extends SmartyException { function smartyAutoload($class) { $_class = strtolower($class); - $_classes = array( - 'smarty_config_source' => true, - 'smarty_config_compiled' => true, - 'smarty_security' => true, - 'smarty_cacheresource' => true, - 'smarty_cacheresource_custom' => true, + static $_classes = array( + 'smarty_config_source' => true, + 'smarty_config_compiled' => true, + 'smarty_security' => true, + 'smarty_cacheresource' => true, + 'smarty_cacheresource_custom' => true, 'smarty_cacheresource_keyvaluestore' => true, - 'smarty_resource' => true, - 'smarty_resource_custom' => true, - 'smarty_resource_uncompiled' => true, - 'smarty_resource_recompiled' => true, + 'smarty_resource' => true, + 'smarty_resource_custom' => true, + 'smarty_resource_uncompiled' => true, + 'smarty_resource_recompiled' => true, ); if (!strncmp($_class, 'smarty_internal_', 16) || isset($_classes[$_class])) { include SMARTY_SYSPLUGINS_DIR . $_class . '.php'; } } - -?> diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/SmartyBC.class.php b/code/web/private_php/ams/smarty/libs/SmartyBC.class.php similarity index 87% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/SmartyBC.class.php rename to code/web/private_php/ams/smarty/libs/SmartyBC.class.php index f8f0a138f..cec946746 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/SmartyBC.class.php +++ b/code/web/private_php/ams/smarty/libs/SmartyBC.class.php @@ -1,460 +1,467 @@ - - * @author Uwe Tews - * @author Rodney Rehm - * @package Smarty - */ -/** - * @ignore - */ -require(dirname(__FILE__) . '/Smarty.class.php'); - -/** - * Smarty Backward Compatability Wrapper Class - * - * @package Smarty - */ -class SmartyBC extends Smarty { - - /** - * Smarty 2 BC - * @var string - */ - public $_version = self::SMARTY_VERSION; - - /** - * Initialize new SmartyBC object - * - * @param array $options options to set during initialization, e.g. array( 'forceCompile' => false ) - */ - public function __construct(array $options=array()) - { - parent::__construct($options); - // register {php} tag - $this->registerPlugin('block', 'php', 'smarty_php_tag'); - } - - /** - * wrapper for assign_by_ref - * - * @param string $tpl_var the template variable name - * @param mixed &$value the referenced value to assign - */ - public function assign_by_ref($tpl_var, &$value) - { - $this->assignByRef($tpl_var, $value); - } - - /** - * wrapper for append_by_ref - * - * @param string $tpl_var the template variable name - * @param mixed &$value the referenced value to append - * @param boolean $merge flag if array elements shall be merged - */ - public function append_by_ref($tpl_var, &$value, $merge = false) - { - $this->appendByRef($tpl_var, $value, $merge); - } - - /** - * clear the given assigned template variable. - * - * @param string $tpl_var the template variable to clear - */ - public function clear_assign($tpl_var) - { - $this->clearAssign($tpl_var); - } - - /** - * Registers custom function to be used in templates - * - * @param string $function the name of the template function - * @param string $function_impl the name of the PHP function to register - * @param bool $cacheable - * @param mixed $cache_attrs - */ - public function register_function($function, $function_impl, $cacheable=true, $cache_attrs=null) - { - $this->registerPlugin('function', $function, $function_impl, $cacheable, $cache_attrs); - } - - /** - * Unregisters custom function - * - * @param string $function name of template function - */ - public function unregister_function($function) - { - $this->unregisterPlugin('function', $function); - } - - /** - * Registers object to be used in templates - * - * @param string $object name of template object - * @param object $object_impl the referenced PHP object to register - * @param array $allowed list of allowed methods (empty = all) - * @param boolean $smarty_args smarty argument format, else traditional - * @param array $block_functs list of methods that are block format - */ - public function register_object($object, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array()) - { - settype($allowed, 'array'); - settype($smarty_args, 'boolean'); - $this->registerObject($object, $object_impl, $allowed, $smarty_args, $block_methods); - } - - /** - * Unregisters object - * - * @param string $object name of template object - */ - public function unregister_object($object) - { - $this->unregisterObject($object); - } - - /** - * Registers block function to be used in templates - * - * @param string $block name of template block - * @param string $block_impl PHP function to register - * @param bool $cacheable - * @param mixed $cache_attrs - */ - public function register_block($block, $block_impl, $cacheable=true, $cache_attrs=null) - { - $this->registerPlugin('block', $block, $block_impl, $cacheable, $cache_attrs); - } - - /** - * Unregisters block function - * - * @param string $block name of template function - */ - public function unregister_block($block) - { - $this->unregisterPlugin('block', $block); - } - - /** - * Registers compiler function - * - * @param string $function name of template function - * @param string $function_impl name of PHP function to register - * @param bool $cacheable - */ - public function register_compiler_function($function, $function_impl, $cacheable=true) - { - $this->registerPlugin('compiler', $function, $function_impl, $cacheable); - } - - /** - * Unregisters compiler function - * - * @param string $function name of template function - */ - public function unregister_compiler_function($function) - { - $this->unregisterPlugin('compiler', $function); - } - - /** - * Registers modifier to be used in templates - * - * @param string $modifier name of template modifier - * @param string $modifier_impl name of PHP function to register - */ - public function register_modifier($modifier, $modifier_impl) - { - $this->registerPlugin('modifier', $modifier, $modifier_impl); - } - - /** - * Unregisters modifier - * - * @param string $modifier name of template modifier - */ - public function unregister_modifier($modifier) - { - $this->unregisterPlugin('modifier', $modifier); - } - - /** - * Registers a resource to fetch a template - * - * @param string $type name of resource - * @param array $functions array of functions to handle resource - */ - public function register_resource($type, $functions) - { - $this->registerResource($type, $functions); - } - - /** - * Unregisters a resource - * - * @param string $type name of resource - */ - public function unregister_resource($type) - { - $this->unregisterResource($type); - } - - /** - * Registers a prefilter function to apply - * to a template before compiling - * - * @param callable $function - */ - public function register_prefilter($function) - { - $this->registerFilter('pre', $function); - } - - /** - * Unregisters a prefilter function - * - * @param callable $function - */ - public function unregister_prefilter($function) - { - $this->unregisterFilter('pre', $function); - } - - /** - * Registers a postfilter function to apply - * to a compiled template after compilation - * - * @param callable $function - */ - public function register_postfilter($function) - { - $this->registerFilter('post', $function); - } - - /** - * Unregisters a postfilter function - * - * @param callable $function - */ - public function unregister_postfilter($function) - { - $this->unregisterFilter('post', $function); - } - - /** - * Registers an output filter function to apply - * to a template output - * - * @param callable $function - */ - public function register_outputfilter($function) - { - $this->registerFilter('output', $function); - } - - /** - * Unregisters an outputfilter function - * - * @param callable $function - */ - public function unregister_outputfilter($function) - { - $this->unregisterFilter('output', $function); - } - - /** - * load a filter of specified type and name - * - * @param string $type filter type - * @param string $name filter name - */ - public function load_filter($type, $name) - { - $this->loadFilter($type, $name); - } - - /** - * clear cached content for the given template and cache id - * - * @param string $tpl_file name of template file - * @param string $cache_id name of cache_id - * @param string $compile_id name of compile_id - * @param string $exp_time expiration time - * @return boolean - */ - public function clear_cache($tpl_file = null, $cache_id = null, $compile_id = null, $exp_time = null) - { - return $this->clearCache($tpl_file, $cache_id, $compile_id, $exp_time); - } - - /** - * clear the entire contents of cache (all templates) - * - * @param string $exp_time expire time - * @return boolean - */ - public function clear_all_cache($exp_time = null) - { - return $this->clearCache(null, null, null, $exp_time); - } - - /** - * test to see if valid cache exists for this template - * - * @param string $tpl_file name of template file - * @param string $cache_id - * @param string $compile_id - * @return boolean - */ - public function is_cached($tpl_file, $cache_id = null, $compile_id = null) - { - return $this->isCached($tpl_file, $cache_id, $compile_id); - } - - /** - * clear all the assigned template variables. - */ - public function clear_all_assign() - { - $this->clearAllAssign(); - } - - /** - * clears compiled version of specified template resource, - * or all compiled template files if one is not specified. - * This function is for advanced use only, not normally needed. - * - * @param string $tpl_file - * @param string $compile_id - * @param string $exp_time - * @return boolean results of {@link smarty_core_rm_auto()} - */ - public function clear_compiled_tpl($tpl_file = null, $compile_id = null, $exp_time = null) - { - return $this->clearCompiledTemplate($tpl_file, $compile_id, $exp_time); - } - - /** - * Checks whether requested template exists. - * - * @param string $tpl_file - * @return boolean - */ - public function template_exists($tpl_file) - { - return $this->templateExists($tpl_file); - } - - /** - * Returns an array containing template variables - * - * @param string $name - * @return array - */ - public function get_template_vars($name=null) - { - return $this->getTemplateVars($name); - } - - /** - * Returns an array containing config variables - * - * @param string $name - * @return array - */ - public function get_config_vars($name=null) - { - return $this->getConfigVars($name); - } - - /** - * load configuration values - * - * @param string $file - * @param string $section - * @param string $scope - */ - public function config_load($file, $section = null, $scope = 'global') - { - $this->ConfigLoad($file, $section, $scope); - } - - /** - * return a reference to a registered object - * - * @param string $name - * @return object - */ - public function get_registered_object($name) - { - return $this->getRegisteredObject($name); - } - - /** - * clear configuration values - * - * @param string $var - */ - public function clear_config($var = null) - { - $this->clearConfig($var); - } - - /** - * trigger Smarty error - * - * @param string $error_msg - * @param integer $error_type - */ - public function trigger_error($error_msg, $error_type = E_USER_WARNING) - { - trigger_error("Smarty error: $error_msg", $error_type); - } - -} - -/** - * Smarty {php}{/php} block function - * - * @param array $params parameter list - * @param string $content contents of the block - * @param object $template template object - * @param boolean &$repeat repeat flag - * @return string content re-formatted - */ -function smarty_php_tag($params, $content, $template, &$repeat) -{ - eval($content); - return ''; -} - -?> \ No newline at end of file + + * @author Uwe Tews + * @author Rodney Rehm + * @package Smarty + */ +/** + * @ignore + */ +require_once(dirname(__FILE__) . '/Smarty.class.php'); + +/** + * Smarty Backward Compatability Wrapper Class + * + * @package Smarty + */ +class SmartyBC extends Smarty +{ + /** + * Smarty 2 BC + * + * @var string + */ + public $_version = self::SMARTY_VERSION; + + /** + * Initialize new SmartyBC object + * + * @param array $options options to set during initialization, e.g. array( 'forceCompile' => false ) + */ + public function __construct(array $options = array()) + { + parent::__construct($options); + // register {php} tag + $this->registerPlugin('block', 'php', 'smarty_php_tag'); + } + + /** + * wrapper for assign_by_ref + * + * @param string $tpl_var the template variable name + * @param mixed &$value the referenced value to assign + */ + public function assign_by_ref($tpl_var, &$value) + { + $this->assignByRef($tpl_var, $value); + } + + /** + * wrapper for append_by_ref + * + * @param string $tpl_var the template variable name + * @param mixed &$value the referenced value to append + * @param boolean $merge flag if array elements shall be merged + */ + public function append_by_ref($tpl_var, &$value, $merge = false) + { + $this->appendByRef($tpl_var, $value, $merge); + } + + /** + * clear the given assigned template variable. + * + * @param string $tpl_var the template variable to clear + */ + public function clear_assign($tpl_var) + { + $this->clearAssign($tpl_var); + } + + /** + * Registers custom function to be used in templates + * + * @param string $function the name of the template function + * @param string $function_impl the name of the PHP function to register + * @param bool $cacheable + * @param mixed $cache_attrs + */ + public function register_function($function, $function_impl, $cacheable = true, $cache_attrs = null) + { + $this->registerPlugin('function', $function, $function_impl, $cacheable, $cache_attrs); + } + + /** + * Unregisters custom function + * + * @param string $function name of template function + */ + public function unregister_function($function) + { + $this->unregisterPlugin('function', $function); + } + + /** + * Registers object to be used in templates + * + * @param string $object name of template object + * @param object $object_impl the referenced PHP object to register + * @param array $allowed list of allowed methods (empty = all) + * @param boolean $smarty_args smarty argument format, else traditional + * @param array $block_methods list of methods that are block format + * + * @throws SmartyException + * @internal param array $block_functs list of methods that are block format + */ + public function register_object($object, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array()) + { + settype($allowed, 'array'); + settype($smarty_args, 'boolean'); + $this->registerObject($object, $object_impl, $allowed, $smarty_args, $block_methods); + } + + /** + * Unregisters object + * + * @param string $object name of template object + */ + public function unregister_object($object) + { + $this->unregisterObject($object); + } + + /** + * Registers block function to be used in templates + * + * @param string $block name of template block + * @param string $block_impl PHP function to register + * @param bool $cacheable + * @param mixed $cache_attrs + */ + public function register_block($block, $block_impl, $cacheable = true, $cache_attrs = null) + { + $this->registerPlugin('block', $block, $block_impl, $cacheable, $cache_attrs); + } + + /** + * Unregisters block function + * + * @param string $block name of template function + */ + public function unregister_block($block) + { + $this->unregisterPlugin('block', $block); + } + + /** + * Registers compiler function + * + * @param string $function name of template function + * @param string $function_impl name of PHP function to register + * @param bool $cacheable + */ + public function register_compiler_function($function, $function_impl, $cacheable = true) + { + $this->registerPlugin('compiler', $function, $function_impl, $cacheable); + } + + /** + * Unregisters compiler function + * + * @param string $function name of template function + */ + public function unregister_compiler_function($function) + { + $this->unregisterPlugin('compiler', $function); + } + + /** + * Registers modifier to be used in templates + * + * @param string $modifier name of template modifier + * @param string $modifier_impl name of PHP function to register + */ + public function register_modifier($modifier, $modifier_impl) + { + $this->registerPlugin('modifier', $modifier, $modifier_impl); + } + + /** + * Unregisters modifier + * + * @param string $modifier name of template modifier + */ + public function unregister_modifier($modifier) + { + $this->unregisterPlugin('modifier', $modifier); + } + + /** + * Registers a resource to fetch a template + * + * @param string $type name of resource + * @param array $functions array of functions to handle resource + */ + public function register_resource($type, $functions) + { + $this->registerResource($type, $functions); + } + + /** + * Unregisters a resource + * + * @param string $type name of resource + */ + public function unregister_resource($type) + { + $this->unregisterResource($type); + } + + /** + * Registers a prefilter function to apply + * to a template before compiling + * + * @param callable $function + */ + public function register_prefilter($function) + { + $this->registerFilter('pre', $function); + } + + /** + * Unregisters a prefilter function + * + * @param callable $function + */ + public function unregister_prefilter($function) + { + $this->unregisterFilter('pre', $function); + } + + /** + * Registers a postfilter function to apply + * to a compiled template after compilation + * + * @param callable $function + */ + public function register_postfilter($function) + { + $this->registerFilter('post', $function); + } + + /** + * Unregisters a postfilter function + * + * @param callable $function + */ + public function unregister_postfilter($function) + { + $this->unregisterFilter('post', $function); + } + + /** + * Registers an output filter function to apply + * to a template output + * + * @param callable $function + */ + public function register_outputfilter($function) + { + $this->registerFilter('output', $function); + } + + /** + * Unregisters an outputfilter function + * + * @param callable $function + */ + public function unregister_outputfilter($function) + { + $this->unregisterFilter('output', $function); + } + + /** + * load a filter of specified type and name + * + * @param string $type filter type + * @param string $name filter name + */ + public function load_filter($type, $name) + { + $this->loadFilter($type, $name); + } + + /** + * clear cached content for the given template and cache id + * + * @param string $tpl_file name of template file + * @param string $cache_id name of cache_id + * @param string $compile_id name of compile_id + * @param string $exp_time expiration time + * + * @return boolean + */ + public function clear_cache($tpl_file = null, $cache_id = null, $compile_id = null, $exp_time = null) + { + return $this->clearCache($tpl_file, $cache_id, $compile_id, $exp_time); + } + + /** + * clear the entire contents of cache (all templates) + * + * @param string $exp_time expire time + * + * @return boolean + */ + public function clear_all_cache($exp_time = null) + { + return $this->clearCache(null, null, null, $exp_time); + } + + /** + * test to see if valid cache exists for this template + * + * @param string $tpl_file name of template file + * @param string $cache_id + * @param string $compile_id + * + * @return boolean + */ + public function is_cached($tpl_file, $cache_id = null, $compile_id = null) + { + return $this->isCached($tpl_file, $cache_id, $compile_id); + } + + /** + * clear all the assigned template variables. + */ + public function clear_all_assign() + { + $this->clearAllAssign(); + } + + /** + * clears compiled version of specified template resource, + * or all compiled template files if one is not specified. + * This function is for advanced use only, not normally needed. + * + * @param string $tpl_file + * @param string $compile_id + * @param string $exp_time + * + * @return boolean results of {@link smarty_core_rm_auto()} + */ + public function clear_compiled_tpl($tpl_file = null, $compile_id = null, $exp_time = null) + { + return $this->clearCompiledTemplate($tpl_file, $compile_id, $exp_time); + } + + /** + * Checks whether requested template exists. + * + * @param string $tpl_file + * + * @return boolean + */ + public function template_exists($tpl_file) + { + return $this->templateExists($tpl_file); + } + + /** + * Returns an array containing template variables + * + * @param string $name + * + * @return array + */ + public function get_template_vars($name = null) + { + return $this->getTemplateVars($name); + } + + /** + * Returns an array containing config variables + * + * @param string $name + * + * @return array + */ + public function get_config_vars($name = null) + { + return $this->getConfigVars($name); + } + + /** + * load configuration values + * + * @param string $file + * @param string $section + * @param string $scope + */ + public function config_load($file, $section = null, $scope = 'global') + { + $this->ConfigLoad($file, $section, $scope); + } + + /** + * return a reference to a registered object + * + * @param string $name + * + * @return object + */ + public function get_registered_object($name) + { + return $this->getRegisteredObject($name); + } + + /** + * clear configuration values + * + * @param string $var + */ + public function clear_config($var = null) + { + $this->clearConfig($var); + } + + /** + * trigger Smarty error + * + * @param string $error_msg + * @param integer $error_type + */ + public function trigger_error($error_msg, $error_type = E_USER_WARNING) + { + trigger_error("Smarty error: $error_msg", $error_type); + } +} + +/** + * Smarty {php}{/php} block function + * + * @param array $params parameter list + * @param string $content contents of the block + * @param object $template template object + * @param boolean &$repeat repeat flag + * + * @return string content re-formatted + */ +function smarty_php_tag($params, $content, $template, &$repeat) +{ + eval($content); + + return ''; +} diff --git a/code/web/private_php/ams/smarty/libs/debug.tpl b/code/web/private_php/ams/smarty/libs/debug.tpl new file mode 100644 index 000000000..61b8876a4 --- /dev/null +++ b/code/web/private_php/ams/smarty/libs/debug.tpl @@ -0,0 +1,137 @@ +{capture name='_smarty_debug' assign=debug_output} + + + + Smarty Debug Console + + + + +

    Smarty Debug Console + - {if isset($template_name)}{$template_name|debug_print_var nofilter}{else}Total Time {$execution_time|string_format:"%.5f"}{/if}

    + + {if !empty($template_data)} +

    included templates & config files (load time in seconds)

    +
    + {foreach $template_data as $template} + {$template.name} + + (compile {$template['compile_time']|string_format:"%.5f"}) (render {$template['render_time']|string_format:"%.5f"}) (cache {$template['cache_time']|string_format:"%.5f"} + ) + +
    + {/foreach} +
    + {/if} + +

    assigned template variables

    + + + {foreach $assigned_vars as $vars} + + + + + {/foreach} +
    ${$vars@key|escape:'html'}{$vars|debug_print_var nofilter}
    + +

    assigned config file variables (outer template scope)

    + + + {foreach $config_vars as $vars} + + + + + {/foreach} + +
    {$vars@key|escape:'html'}{$vars|debug_print_var nofilter}
    + + +{/capture} + diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/plugins/block.textformat.php b/code/web/private_php/ams/smarty/libs/plugins/block.textformat.php similarity index 91% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/plugins/block.textformat.php rename to code/web/private_php/ams/smarty/libs/plugins/block.textformat.php index b22b104a5..abf544939 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/plugins/block.textformat.php +++ b/code/web/private_php/ams/smarty/libs/plugins/block.textformat.php @@ -2,13 +2,12 @@ /** * Smarty plugin to format text blocks * - * @package Smarty + * @package Smarty * @subpackage PluginsBlock */ /** * Smarty {textformat}{/textformat} block plugin - * * Type: block function
    * Name: textformat
    * Purpose: format text a certain way with preset styles @@ -23,12 +22,14 @@ * - wrap_boundary - boolean (true) * * - * @link http://www.smarty.net/manual/en/language.function.textformat.php {textformat} - * (Smarty online manual) + * @link http://www.smarty.net/manual/en/language.function.textformat.php {textformat} + * (Smarty online manual) + * * @param array $params parameters * @param string $content contents of the block * @param Smarty_Internal_Template $template template object * @param boolean &$repeat repeat flag + * * @return string content re-formatted * @author Monte Ohrt */ @@ -53,17 +54,17 @@ function smarty_block_textformat($params, $content, $template, &$repeat) case 'indent_char': case 'wrap_char': case 'assign': - $$_key = (string)$_val; + $$_key = (string) $_val; break; case 'indent': case 'indent_first': case 'wrap': - $$_key = (int)$_val; + $$_key = (int) $_val; break; case 'wrap_cut': - $$_key = (bool)$_val; + $$_key = (bool) $_val; break; default: @@ -76,8 +77,6 @@ function smarty_block_textformat($params, $content, $template, &$repeat) } // split into paragraphs $_paragraphs = preg_split('![\r\n]{2}!', $content); - $_output = ''; - foreach ($_paragraphs as &$_paragraph) { if (!$_paragraph) { @@ -102,12 +101,10 @@ function smarty_block_textformat($params, $content, $template, &$repeat) } } $_output = implode($wrap_char . $wrap_char, $_paragraphs); - + if ($assign) { $template->assign($assign, $_output); } else { return $_output; } } - -?> \ No newline at end of file diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/plugins/function.counter.php b/code/web/private_php/ams/smarty/libs/plugins/function.counter.php similarity index 75% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/plugins/function.counter.php rename to code/web/private_php/ams/smarty/libs/plugins/function.counter.php index 3906badf0..4da85a14e 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/plugins/function.counter.php +++ b/code/web/private_php/ams/smarty/libs/plugins/function.counter.php @@ -1,22 +1,24 @@ * Name: counter
    * Purpose: print out a counter value * * @author Monte Ohrt - * @link http://www.smarty.net/manual/en/language.function.counter.php {counter} - * (Smarty online manual) + * @link http://www.smarty.net/manual/en/language.function.counter.php {counter} + * (Smarty online manual) + * * @param array $params parameters * @param Smarty_Internal_Template $template template object + * * @return string|null */ function smarty_function_counter($params, $template) @@ -26,16 +28,16 @@ function smarty_function_counter($params, $template) $name = (isset($params['name'])) ? $params['name'] : 'default'; if (!isset($counters[$name])) { $counters[$name] = array( - 'start'=>1, - 'skip'=>1, - 'direction'=>'up', - 'count'=>1 - ); + 'start' => 1, + 'skip' => 1, + 'direction' => 'up', + 'count' => 1 + ); } $counter =& $counters[$name]; if (isset($params['start'])) { - $counter['start'] = $counter['count'] = (int)$params['start']; + $counter['start'] = $counter['count'] = (int) $params['start']; } if (!empty($params['assign'])) { @@ -45,9 +47,9 @@ function smarty_function_counter($params, $template) if (isset($counter['assign'])) { $template->assign($counter['assign'], $counter['count']); } - + if (isset($params['print'])) { - $print = (bool)$params['print']; + $print = (bool) $params['print']; } else { $print = empty($counter['assign']); } @@ -61,18 +63,16 @@ function smarty_function_counter($params, $template) if (isset($params['skip'])) { $counter['skip'] = $params['skip']; } - + if (isset($params['direction'])) { $counter['direction'] = $params['direction']; } - if ($counter['direction'] == "down") + if ($counter['direction'] == "down") { $counter['count'] -= $counter['skip']; - else + } else { $counter['count'] += $counter['skip']; - + } + return $retval; - } - -?> \ No newline at end of file diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/plugins/function.cycle.php b/code/web/private_php/ams/smarty/libs/plugins/function.cycle.php similarity index 67% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/plugins/function.cycle.php rename to code/web/private_php/ams/smarty/libs/plugins/function.cycle.php index 1778ffb53..8dc5cd9d5 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/plugins/function.cycle.php +++ b/code/web/private_php/ams/smarty/libs/plugins/function.cycle.php @@ -2,13 +2,12 @@ /** * Smarty plugin * - * @package Smarty + * @package Smarty * @subpackage PluginsFunction */ /** * Smarty {cycle} function plugin - * * Type: function
    * Name: cycle
    * Date: May 3, 2002
    @@ -31,15 +30,17 @@ * {cycle name=row} * * - * @link http://www.smarty.net/manual/en/language.function.cycle.php {cycle} - * (Smarty online manual) - * @author Monte Ohrt - * @author credit to Mark Priatel - * @author credit to Gerard - * @author credit to Jason Sweat + * @link http://www.smarty.net/manual/en/language.function.cycle.php {cycle} + * (Smarty online manual) + * @author Monte Ohrt + * @author credit to Mark Priatel + * @author credit to Gerard + * @author credit to Jason Sweat * @version 1.3 + * * @param array $params parameters * @param Smarty_Internal_Template $template template object + * * @return string|null */ @@ -48,18 +49,20 @@ function smarty_function_cycle($params, $template) static $cycle_vars; $name = (empty($params['name'])) ? 'default' : $params['name']; - $print = (isset($params['print'])) ? (bool)$params['print'] : true; - $advance = (isset($params['advance'])) ? (bool)$params['advance'] : true; - $reset = (isset($params['reset'])) ? (bool)$params['reset'] : false; + $print = (isset($params['print'])) ? (bool) $params['print'] : true; + $advance = (isset($params['advance'])) ? (bool) $params['advance'] : true; + $reset = (isset($params['reset'])) ? (bool) $params['reset'] : false; if (!isset($params['values'])) { - if(!isset($cycle_vars[$name]['values'])) { + if (!isset($cycle_vars[$name]['values'])) { trigger_error("cycle: missing 'values' parameter"); + return; } } else { - if(isset($cycle_vars[$name]['values']) - && $cycle_vars[$name]['values'] != $params['values'] ) { + if (isset($cycle_vars[$name]['values']) + && $cycle_vars[$name]['values'] != $params['values'] + ) { $cycle_vars[$name]['index'] = 0; } $cycle_vars[$name]['values'] = $params['values']; @@ -71,13 +74,13 @@ function smarty_function_cycle($params, $template) $cycle_vars[$name]['delimiter'] = ','; } - if(is_array($cycle_vars[$name]['values'])) { + if (is_array($cycle_vars[$name]['values'])) { $cycle_array = $cycle_vars[$name]['values']; } else { - $cycle_array = explode($cycle_vars[$name]['delimiter'],$cycle_vars[$name]['values']); + $cycle_array = explode($cycle_vars[$name]['delimiter'], $cycle_vars[$name]['values']); } - if(!isset($cycle_vars[$name]['index']) || $reset ) { + if (!isset($cycle_vars[$name]['index']) || $reset) { $cycle_vars[$name]['index'] = 0; } @@ -86,21 +89,19 @@ function smarty_function_cycle($params, $template) $template->assign($params['assign'], $cycle_array[$cycle_vars[$name]['index']]); } - if($print) { + if ($print) { $retval = $cycle_array[$cycle_vars[$name]['index']]; } else { $retval = null; } - if($advance) { - if ( $cycle_vars[$name]['index'] >= count($cycle_array) -1 ) { + if ($advance) { + if ($cycle_vars[$name]['index'] >= count($cycle_array) - 1) { $cycle_vars[$name]['index'] = 0; } else { - $cycle_vars[$name]['index']++; + $cycle_vars[$name]['index'] ++; } } return $retval; } - -?> \ No newline at end of file diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/plugins/function.fetch.php b/code/web/private_php/ams/smarty/libs/plugins/function.fetch.php similarity index 67% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/plugins/function.fetch.php rename to code/web/private_php/ams/smarty/libs/plugins/function.fetch.php index eca1182d5..3506d4a8d 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/plugins/function.fetch.php +++ b/code/web/private_php/ams/smarty/libs/plugins/function.fetch.php @@ -2,50 +2,53 @@ /** * Smarty plugin * - * @package Smarty + * @package Smarty * @subpackage PluginsFunction */ /** * Smarty {fetch} plugin - * * Type: function
    * Name: fetch
    * Purpose: fetch file, web or ftp data and display results * - * @link http://www.smarty.net/manual/en/language.function.fetch.php {fetch} - * (Smarty online manual) + * @link http://www.smarty.net/manual/en/language.function.fetch.php {fetch} + * (Smarty online manual) * @author Monte Ohrt + * * @param array $params parameters * @param Smarty_Internal_Template $template template object + * + * @throws SmartyException * @return string|null if the assign parameter is passed, Smarty assigns the result to a template variable */ function smarty_function_fetch($params, $template) { if (empty($params['file'])) { - trigger_error("[plugin] fetch parameter 'file' cannot be empty",E_USER_NOTICE); + trigger_error("[plugin] fetch parameter 'file' cannot be empty", E_USER_NOTICE); + return; } - + // strip file protocol if (stripos($params['file'], 'file://') === 0) { $params['file'] = substr($params['file'], 7); } - + $protocol = strpos($params['file'], '://'); if ($protocol !== false) { $protocol = strtolower(substr($params['file'], 0, $protocol)); } - + if (isset($template->smarty->security_policy)) { if ($protocol) { // remote resource (or php stream, …) - if(!$template->smarty->security_policy->isTrustedUri($params['file'])) { + if (!$template->smarty->security_policy->isTrustedUri($params['file'])) { return; } } else { // local file - if(!$template->smarty->security_policy->isTrustedResourceDir($params['file'])) { + if (!$template->smarty->security_policy->isTrustedResourceDir($params['file'])) { return; } } @@ -54,53 +57,54 @@ function smarty_function_fetch($params, $template) $content = ''; if ($protocol == 'http') { // http fetch - if($uri_parts = parse_url($params['file'])) { + if ($uri_parts = parse_url($params['file'])) { // set defaults $host = $server_name = $uri_parts['host']; $timeout = 30; $accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*"; - $agent = "Smarty Template Engine ". Smarty::SMARTY_VERSION; + $agent = "Smarty Template Engine " . Smarty::SMARTY_VERSION; $referer = ""; $uri = !empty($uri_parts['path']) ? $uri_parts['path'] : '/'; $uri .= !empty($uri_parts['query']) ? '?' . $uri_parts['query'] : ''; $_is_proxy = false; - if(empty($uri_parts['port'])) { + if (empty($uri_parts['port'])) { $port = 80; } else { $port = $uri_parts['port']; } - if(!empty($uri_parts['user'])) { + if (!empty($uri_parts['user'])) { $user = $uri_parts['user']; } - if(!empty($uri_parts['pass'])) { + if (!empty($uri_parts['pass'])) { $pass = $uri_parts['pass']; } // loop through parameters, setup headers - foreach($params as $param_key => $param_value) { - switch($param_key) { + foreach ($params as $param_key => $param_value) { + switch ($param_key) { case "file": case "assign": case "assign_headers": break; case "user": - if(!empty($param_value)) { + if (!empty($param_value)) { $user = $param_value; } break; case "pass": - if(!empty($param_value)) { + if (!empty($param_value)) { $pass = $param_value; } break; case "accept": - if(!empty($param_value)) { + if (!empty($param_value)) { $accept = $param_value; } break; case "header": - if(!empty($param_value)) { - if(!preg_match('![\w\d-]+: .+!',$param_value)) { - trigger_error("[plugin] invalid header format '".$param_value."'",E_USER_NOTICE); + if (!empty($param_value)) { + if (!preg_match('![\w\d-]+: .+!', $param_value)) { + trigger_error("[plugin] invalid header format '" . $param_value . "'", E_USER_NOTICE); + return; } else { $extra_headers[] = $param_value; @@ -108,99 +112,104 @@ function smarty_function_fetch($params, $template) } break; case "proxy_host": - if(!empty($param_value)) { + if (!empty($param_value)) { $proxy_host = $param_value; } break; case "proxy_port": - if(!preg_match('!\D!', $param_value)) { + if (!preg_match('!\D!', $param_value)) { $proxy_port = (int) $param_value; } else { - trigger_error("[plugin] invalid value for attribute '".$param_key."'",E_USER_NOTICE); + trigger_error("[plugin] invalid value for attribute '" . $param_key . "'", E_USER_NOTICE); + return; } break; case "agent": - if(!empty($param_value)) { + if (!empty($param_value)) { $agent = $param_value; } break; case "referer": - if(!empty($param_value)) { + if (!empty($param_value)) { $referer = $param_value; } break; case "timeout": - if(!preg_match('!\D!', $param_value)) { + if (!preg_match('!\D!', $param_value)) { $timeout = (int) $param_value; } else { - trigger_error("[plugin] invalid value for attribute '".$param_key."'",E_USER_NOTICE); + trigger_error("[plugin] invalid value for attribute '" . $param_key . "'", E_USER_NOTICE); + return; } break; default: - trigger_error("[plugin] unrecognized attribute '".$param_key."'",E_USER_NOTICE); + trigger_error("[plugin] unrecognized attribute '" . $param_key . "'", E_USER_NOTICE); + return; } } - if(!empty($proxy_host) && !empty($proxy_port)) { + if (!empty($proxy_host) && !empty($proxy_port)) { $_is_proxy = true; - $fp = fsockopen($proxy_host,$proxy_port,$errno,$errstr,$timeout); + $fp = fsockopen($proxy_host, $proxy_port, $errno, $errstr, $timeout); } else { - $fp = fsockopen($server_name,$port,$errno,$errstr,$timeout); + $fp = fsockopen($server_name, $port, $errno, $errstr, $timeout); } - if(!$fp) { - trigger_error("[plugin] unable to fetch: $errstr ($errno)",E_USER_NOTICE); + if (!$fp) { + trigger_error("[plugin] unable to fetch: $errstr ($errno)", E_USER_NOTICE); + return; } else { - if($_is_proxy) { + if ($_is_proxy) { fputs($fp, 'GET ' . $params['file'] . " HTTP/1.0\r\n"); } else { fputs($fp, "GET $uri HTTP/1.0\r\n"); } - if(!empty($host)) { + if (!empty($host)) { fputs($fp, "Host: $host\r\n"); } - if(!empty($accept)) { + if (!empty($accept)) { fputs($fp, "Accept: $accept\r\n"); } - if(!empty($agent)) { + if (!empty($agent)) { fputs($fp, "User-Agent: $agent\r\n"); } - if(!empty($referer)) { + if (!empty($referer)) { fputs($fp, "Referer: $referer\r\n"); } - if(isset($extra_headers) && is_array($extra_headers)) { - foreach($extra_headers as $curr_header) { - fputs($fp, $curr_header."\r\n"); + if (isset($extra_headers) && is_array($extra_headers)) { + foreach ($extra_headers as $curr_header) { + fputs($fp, $curr_header . "\r\n"); } } - if(!empty($user) && !empty($pass)) { - fputs($fp, "Authorization: BASIC ".base64_encode("$user:$pass")."\r\n"); + if (!empty($user) && !empty($pass)) { + fputs($fp, "Authorization: BASIC " . base64_encode("$user:$pass") . "\r\n"); } fputs($fp, "\r\n"); - while(!feof($fp)) { - $content .= fgets($fp,4096); + while (!feof($fp)) { + $content .= fgets($fp, 4096); } fclose($fp); - $csplit = preg_split("!\r\n\r\n!",$content,2); + $csplit = preg_split("!\r\n\r\n!", $content, 2); $content = $csplit[1]; - if(!empty($params['assign_headers'])) { - $template->assign($params['assign_headers'],preg_split("!\r\n!",$csplit[0])); + if (!empty($params['assign_headers'])) { + $template->assign($params['assign_headers'], preg_split("!\r\n!", $csplit[0])); } } } else { - trigger_error("[plugin fetch] unable to parse URL, check syntax",E_USER_NOTICE); + trigger_error("[plugin fetch] unable to parse URL, check syntax", E_USER_NOTICE); + return; } } else { $content = @file_get_contents($params['file']); if ($content === false) { - throw new SmartyException("{fetch} cannot read resource '" . $params['file'] ."'"); + throw new SmartyException("{fetch} cannot read resource '" . $params['file'] . "'"); } } @@ -210,5 +219,3 @@ function smarty_function_fetch($params, $template) return $content; } } - -?> \ No newline at end of file diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/plugins/function.html_checkboxes.php b/code/web/private_php/ams/smarty/libs/plugins/function.html_checkboxes.php similarity index 84% rename from code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/plugins/function.html_checkboxes.php rename to code/web/private_php/ams/smarty/libs/plugins/function.html_checkboxes.php index 1866bc2f3..d78680368 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/smarty/libs/plugins/function.html_checkboxes.php +++ b/code/web/private_php/ams/smarty/libs/plugins/function.html_checkboxes.php @@ -2,13 +2,12 @@ /** * Smarty plugin * - * @package Smarty + * @package Smarty * @subpackage PluginsFunction */ /** * Smarty {html_checkboxes} function plugin - * * File: function.html_checkboxes.php
    * Type: function
    * Name: html_checkboxes
    @@ -32,15 +31,17 @@ * - escape (optional) - escape the content (not value), defaults to true * * - * @link http://www.smarty.net/manual/en/language.function.html.checkboxes.php {html_checkboxes} - * (Smarty online manual) + * @link http://www.smarty.net/manual/en/language.function.html.checkboxes.php {html_checkboxes} + * (Smarty online manual) * @author Christopher Kvarme - * @author credits to Monte Ohrt + * @author credits to Monte Ohrt * @version 1.0 - * @param array $params parameters + * + * @param array $params parameters * @param object $template template object + * * @return string - * @uses smarty_function_escape_special_chars() + * @uses smarty_function_escape_special_chars() */ function smarty_function_html_checkboxes($params, $template) { @@ -58,8 +59,8 @@ function smarty_function_html_checkboxes($params, $template) $extra = ''; - foreach($params as $_key => $_val) { - switch($_key) { + foreach ($params as $_key => $_val) { + switch ($_key) { case 'name': case 'separator': $$_key = (string) $_val; @@ -89,7 +90,7 @@ function smarty_function_html_checkboxes($params, $template) if (method_exists($_sel, "__toString")) { $_sel = smarty_function_escape_special_chars((string) $_sel->__toString()); } else { - trigger_error("html_checkboxes: selected attribute contains an object of class '". get_class($_sel) ."' without __toString() method", E_USER_NOTICE); + trigger_error("html_checkboxes: selected attribute contains an object of class '" . get_class($_sel) . "' without __toString() method", E_USER_NOTICE); continue; } } else { @@ -101,7 +102,7 @@ function smarty_function_html_checkboxes($params, $template) if (method_exists($_val, "__toString")) { $selected = smarty_function_escape_special_chars((string) $_val->__toString()); } else { - trigger_error("html_checkboxes: selected attribute is an object of class '". get_class($_val) ."' without __toString() method", E_USER_NOTICE); + trigger_error("html_checkboxes: selected attribute is an object of class '" . get_class($_val) . "' without __toString() method", E_USER_NOTICE); } } else { $selected = smarty_function_escape_special_chars((string) $_val); @@ -116,7 +117,8 @@ function smarty_function_html_checkboxes($params, $template) case 'assign': break; - case 'strict': break; + case 'strict': + break; case 'disabled': case 'readonly': @@ -131,11 +133,11 @@ function smarty_function_html_checkboxes($params, $template) break; } - // omit break; to fall through! + // omit break; to fall through! default: - if(!is_array($_val)) { - $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"'; + if (!is_array($_val)) { + $extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_val) . '"'; } else { trigger_error("html_checkboxes: extra attribute '$_key' cannot be an array", E_USER_NOTICE); } @@ -143,76 +145,79 @@ function smarty_function_html_checkboxes($params, $template) } } - if (!isset($options) && !isset($values)) - return ''; /* raise error here? */ + if (!isset($options) && !isset($values)) { + return ''; + } /* raise error here? */ $_html_result = array(); if (isset($options)) { - foreach ($options as $_key=>$_val) { + foreach ($options as $_key => $_val) { $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids, $escape); } } else { - foreach ($values as $_i=>$_key) { + foreach ($values as $_i => $_key) { $_val = isset($output[$_i]) ? $output[$_i] : ''; $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids, $escape); } } - if(!empty($params['assign'])) { + if (!empty($params['assign'])) { $template->assign($params['assign'], $_html_result); } else { return implode("\n", $_html_result); } - } -function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids, $escape=true) { +function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids, $escape = true) +{ $_output = ''; - + if (is_object($value)) { if (method_exists($value, "__toString")) { $value = (string) $value->__toString(); } else { - trigger_error("html_options: value is an object of class '". get_class($value) ."' without __toString() method", E_USER_NOTICE); + trigger_error("html_options: value is an object of class '" . get_class($value) . "' without __toString() method", E_USER_NOTICE); + return ''; } } else { $value = (string) $value; } - + if (is_object($output)) { if (method_exists($output, "__toString")) { $output = (string) $output->__toString(); } else { - trigger_error("html_options: output is an object of class '". get_class($output) ."' without __toString() method", E_USER_NOTICE); + trigger_error("html_options: output is an object of class '" . get_class($output) . "' without __toString() method", E_USER_NOTICE); + return ''; } } else { $output = (string) $output; } - + if ($labels) { if ($label_ids) { $_id = smarty_function_escape_special_chars(preg_replace('![^\w\-\.]!' . Smarty::$_UTF8_MODIFIER, '_', $name . '_' . $value)); $_output .= '