diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index a8efd9dfa..630ff4414 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -41,10 +41,6 @@ INCLUDE(${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL) # Force out of source builds. CHECK_OUT_OF_SOURCE() -# Variables which must be set before PROJECT -NL_SETUP_BUILD() -NL_SETUP_BUILD_FLAGS() - CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(RyzomCore CXX C) SET(NL_VERSION_MAJOR 0) @@ -52,6 +48,9 @@ SET(NL_VERSION_MINOR 8) SET(NL_VERSION_PATCH 0) SET(NL_VERSION "${NL_VERSION_MAJOR}.${NL_VERSION_MINOR}.${NL_VERSION_PATCH}") +NL_SETUP_BUILD() +NL_SETUP_BUILD_FLAGS() + #----------------------------------------------------------------------------- # Redirect output files SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) @@ -91,20 +90,11 @@ NL_CONFIGURE_CHECKS() #----------------------------------------------------------------------------- #Platform specifics +SETUP_EXTERNAL() + IF(WIN32) - INCLUDE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake) SET(WINSOCK2_LIB ws2_32.lib) - FIND_PACKAGE(External REQUIRED) - - IF(${CMAKE_MAKE_PROGRAM} MATCHES "Common7") - # convert IDE fullpath to VC++ path - STRING(REGEX REPLACE "Common7/IDE/.+" "VC" VC_DIR ${CMAKE_MAKE_PROGRAM}) - ELSE(${CMAKE_MAKE_PROGRAM} MATCHES "Common7") - # convert compiler fullpath to VC++ path - STRING(REGEX REPLACE "VC/bin/.+" "VC" VC_DIR ${CMAKE_CXX_COMPILER}) - ENDIF(${CMAKE_MAKE_PROGRAM} MATCHES "Common7") - IF(WITH_MFC) FIND_PACKAGE(CustomMFC REQUIRED) ENDIF(WITH_MFC) @@ -119,20 +109,15 @@ IF(WITH_STATIC) # libxml2 could need winsock2 library SET(LIBXML2_DEFINITIONS ${LIBXML2_DEFINITIONS} -DLIBXML_STATIC) SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${WINSOCK2_LIB}) + + # on Mac OS X libxml2 requieres iconv + IF(APPLE) + FIND_PACKAGE(Iconv REQUIRED) + SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${ICONV_LIBRARIES}) + INCLUDE_DIRECTORIES(${ICONV_INCLUDE_DIR}) + ENDIF(APPLE) ENDIF(WITH_STATIC) -IF(WITH_STLPORT) - FIND_PACKAGE(STLport REQUIRED) - INCLUDE_DIRECTORIES(${STLPORT_INCLUDE_DIR}) - IF(WIN32) - SET(VC_INCLUDE_DIR "${VC_DIR}/include") - - FIND_PACKAGE(WindowsSDK REQUIRED) - # use VC++ and Windows SDK include paths - INCLUDE_DIRECTORIES(${VC_INCLUDE_DIR} ${WINSDK_INCLUDE_DIR}) - ENDIF(WIN32) -ENDIF(WITH_STLPORT) - INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/PCHSupport.cmake) IF(FINAL_VERSION) diff --git a/code/CMakeModules/ConfigureChecks.cmake b/code/CMakeModules/ConfigureChecks.cmake index 707b85c86..baf6e0e7c 100644 --- a/code/CMakeModules/ConfigureChecks.cmake +++ b/code/CMakeModules/ConfigureChecks.cmake @@ -47,6 +47,10 @@ MACRO(NL_CONFIGURE_CHECKS) IF(WITH_DRIVER_OPENGL) SET(NL_OPENGL_AVAILABLE 1) ENDIF(WITH_DRIVER_OPENGL) + + IF(WITH_DRIVER_OPENGLES) + SET(NL_OPENGLES_AVAILABLE 1) + ENDIF(WITH_DRIVER_OPENGLES) IF(WITH_DRIVER_DIRECT3D) SET(NL_DIRECT3D_AVAILABLE 1) diff --git a/code/CMakeModules/FindCustomMFC.cmake b/code/CMakeModules/FindCustomMFC.cmake index e37936ef0..7dd87c15f 100644 --- a/code/CMakeModules/FindCustomMFC.cmake +++ b/code/CMakeModules/FindCustomMFC.cmake @@ -40,17 +40,12 @@ ENDIF(WITH_STLPORT OR NOT MFC_FOUND) # Only if using a custom path IF(CUSTOM_MFC_DIR) - IF(NOT CMAKE_SIZEOF_VOID_P) - INCLUDE (CheckTypeSize) - CHECK_TYPE_SIZE("void*" CMAKE_SIZEOF_VOID_P) - ENDIF(NOT CMAKE_SIZEOF_VOID_P) - # Using 32 or 64 bits libraries - IF(CMAKE_SIZEOF_VOID_P EQUAL 8) + IF(TARGET_X64) SET(MFC_LIBRARY_DIR "${MFC_DIR}/lib/amd64") - ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8) + ELSE(TARGET_X64) SET(MFC_LIBRARY_DIR "${MFC_DIR}/lib") - ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8) + ENDIF(TARGET_X64) # Add MFC libraries directory to default library path LINK_DIRECTORIES(${MFC_LIBRARY_DIR}) diff --git a/code/CMakeModules/FindDirectXSDK.cmake b/code/CMakeModules/FindDirectXSDK.cmake index d21261b95..1f832cf95 100644 --- a/code/CMakeModules/FindDirectXSDK.cmake +++ b/code/CMakeModules/FindDirectXSDK.cmake @@ -30,16 +30,11 @@ ENDMACRO(FIND_DXSDK_LIBRARY MYLIBRARY MYLIBRARYNAME) IF(DXSDK_DIR) SET(DXSDK_INCLUDE_DIR "${DXSDK_DIR}/Include") - IF(NOT CMAKE_SIZEOF_VOID_P) - INCLUDE (CheckTypeSize) - CHECK_TYPE_SIZE("void*" CMAKE_SIZEOF_VOID_P) - ENDIF(NOT CMAKE_SIZEOF_VOID_P) - - IF(CMAKE_SIZEOF_VOID_P EQUAL 8) + IF(TARGET_X64) SET(DXSDK_LIBRARY_DIR "${DXSDK_DIR}/Lib/x64") - ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8) + ELSE(TARGET_X64) SET(DXSDK_LIBRARY_DIR "${DXSDK_DIR}/Lib/x86") - ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8) + ENDIF(TARGET_X64) FIND_DXSDK_LIBRARY(DXSDK_GUID_LIBRARY dxguid) FIND_DXSDK_LIBRARY(DXSDK_DINPUT_LIBRARY dinput8) @@ -59,7 +54,7 @@ ENDIF(DXSDK_DIR) # all listed variables are TRUE. INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(DIRECTXSDK DEFAULT_MSG DXSDK_DIR DXSDK_GUID_LIBRARY DXSDK_DINPUT_LIBRARY) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(DirectXSDK DEFAULT_MSG DXSDK_DIR DXSDK_GUID_LIBRARY DXSDK_DINPUT_LIBRARY) MARK_AS_ADVANCED(DXSDK_INCLUDE_DIR DXSDK_GUID_LIBRARY diff --git a/code/CMakeModules/FindExternal.cmake b/code/CMakeModules/FindExternal.cmake index 3ca7774ba..fae4af92d 100644 --- a/code/CMakeModules/FindExternal.cmake +++ b/code/CMakeModules/FindExternal.cmake @@ -3,11 +3,12 @@ # The following values are defined # EXTERNAL_PATH - where to find external # EXTERNAL_INCLUDE_PATH - where to find external includes +# EXTERNAL_BINARY_PATH - where to find external binaries # EXTERNAL_LIBRARY_PATH - where to find external libraries # EXTERNAL_FOUND - True if the external libraries are available SET(EXTERNAL_TEMP_PATH ${CMAKE_CURRENT_SOURCE_DIR}/external ${CMAKE_CURRENT_SOURCE_DIR}/../external ${CMAKE_CURRENT_SOURCE_DIR}/3rdParty ${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty ${EXTERNAL_PATH}) -SET(EXTERNAL_TEMP_FILE "include/png.h") +SET(EXTERNAL_TEMP_FILE "include/zlib.h") SET(EXTERNAL_NAME "external") # If using STLport preprend external_stlport @@ -17,36 +18,42 @@ IF(WITH_STLPORT) SET(EXTERNAL_NAME "external with STLport") ENDIF(WITH_STLPORT) -SET(EXTERNAL_FOUND FALSE) -FOREACH(ITEM ${EXTERNAL_TEMP_PATH}) - IF(EXISTS "${ITEM}/${EXTERNAL_TEMP_FILE}" AND NOT EXTERNAL_FOUND) - SET(EXTERNAL_FOUND TRUE) - # Get absolute path to avoid .. - GET_FILENAME_COMPONENT(ITEM ${ITEM} ABSOLUTE) - SET(EXTERNAL_PATH ${ITEM} CACHE PATH "" FORCE) - ENDIF(EXISTS "${ITEM}/${EXTERNAL_TEMP_FILE}" AND NOT EXTERNAL_FOUND) -ENDFOREACH(ITEM ${EXTERNAL_TEMP_PATH}) +FIND_PATH(EXTERNAL_PATH + ${EXTERNAL_TEMP_FILE} + PATHS + $ENV{EXTERNAL_PATH} + ${EXTERNAL_TEMP_PATH} + /usr/local + /usr + /sw + /opt/local + /opt/csw + /opt +) -IF(EXTERNAL_FOUND) +IF(EXTERNAL_PATH) + SET(EXTERNAL_FOUND TRUE) SET(EXTERNAL_INCLUDE_PATH "${EXTERNAL_PATH}/include") - IF(NOT CMAKE_SIZEOF_VOID_P) - INCLUDE (CheckTypeSize) - CHECK_TYPE_SIZE("void*" CMAKE_SIZEOF_VOID_P) - ENDIF(NOT CMAKE_SIZEOF_VOID_P) - + # Using 32 or 64 bits binaries + IF(TARGET_X64) + SET(EXTERNAL_BINARY_PATH "${EXTERNAL_PATH}/bin64") + ELSE(TARGET_X64) + SET(EXTERNAL_BINARY_PATH "${EXTERNAL_PATH}/bin") + ENDIF(TARGET_X64) + # Using 32 or 64 bits libraries - IF(CMAKE_SIZEOF_VOID_P EQUAL 8) + IF(TARGET_X64) SET(EXTERNAL_LIBRARY_PATH "${EXTERNAL_PATH}/lib64") - ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8) + ELSE(TARGET_X64) SET(EXTERNAL_LIBRARY_PATH "${EXTERNAL_PATH}/lib") - ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8) + ENDIF(TARGET_X64) SET(CMAKE_INCLUDE_PATH "${EXTERNAL_INCLUDE_PATH};${CMAKE_INCLUDE_PATH}") # Stupid hack for FindOpenAL.cmake SET(CMAKE_INCLUDE_PATH "${EXTERNAL_PATH};${CMAKE_INCLUDE_PATH}") SET(CMAKE_LIBRARY_PATH "${EXTERNAL_LIBRARY_PATH};${CMAKE_LIBRARY_PATH}") -ENDIF(EXTERNAL_FOUND) +ENDIF(EXTERNAL_PATH) IF(EXTERNAL_FOUND) IF(NOT External_FIND_QUIETLY) @@ -62,4 +69,4 @@ ELSE(EXTERNAL_FOUND) ENDIF(External_FIND_REQUIRED) ENDIF(EXTERNAL_FOUND) -MARK_AS_ADVANCED(EXTERNAL_INCLUDE_PATH EXTERNAL_LIBRARY_PATH) +MARK_AS_ADVANCED(EXTERNAL_INCLUDE_PATH EXTERNAL_BINARY_PATH EXTERNAL_LIBRARY_PATH) diff --git a/code/CMakeModules/FindIconv.cmake b/code/CMakeModules/FindIconv.cmake new file mode 100644 index 000000000..5e9e48250 --- /dev/null +++ b/code/CMakeModules/FindIconv.cmake @@ -0,0 +1,83 @@ +# - Try to find Iconv on Mac OS X +# Once done this will define +# +# ICONV_FOUND - system has Iconv +# ICONV_INCLUDE_DIR - the Iconv include directory +# ICONV_LIBRARIES - Link these to use Iconv +# ICONV_SECOND_ARGUMENT_IS_CONST - the second argument for iconv() is const +# + +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) diff --git a/code/CMakeModules/FindLuabind.cmake b/code/CMakeModules/FindLuabind.cmake index b73530ef5..c94a61e30 100644 --- a/code/CMakeModules/FindLuabind.cmake +++ b/code/CMakeModules/FindLuabind.cmake @@ -6,7 +6,7 @@ IF(LUABIND_LIBRARIES AND LUABIND_INCLUDE_DIR) # in cache already - SET(LUABIND_FIND_QUIETLY TRUE) + SET(Luabind_FIND_QUIETLY TRUE) ENDIF(LUABIND_LIBRARIES AND LUABIND_INCLUDE_DIR) FIND_PATH(LUABIND_INCLUDE_DIR @@ -22,7 +22,7 @@ FIND_PATH(LUABIND_INCLUDE_DIR ) SET(LIBRARY_NAME_RELEASE luabind libluabind) -SET(LIBRARY_NAME_DEBUG luabind_d libluabind_d libluabindd) +SET(LIBRARY_NAME_DEBUG luabind_d luabindd libluabind_d libluabindd) IF(WITH_STLPORT) SET(LIBRARY_NAME_RELEASE luabind_stlport ${LIBRARY_NAME_RELEASE}) @@ -62,30 +62,35 @@ FIND_LIBRARY(LUABIND_LIBRARY_DEBUG FIND_PACKAGE(Boost REQUIRED) IF(LUABIND_INCLUDE_DIR AND Boost_INCLUDE_DIR) - IF(LUABIND_LIBRARY_RELEASE) + IF(LUABIND_LIBRARY_RELEASE AND LUABIND_LIBRARY_DEBUG) + # Case where both Release and Debug versions are provided SET(LUABIND_FOUND TRUE) - SET(LUABIND_INCLUDE_DIR ${LUABIND_INCLUDE_DIR} ${Boost_INCLUDE_DIR}) - IF(LUABIND_LIBRARY_DEBUG) - SET(LUABIND_LIBRARIES "optimized;${LUABIND_LIBRARY_RELEASE};debug;${LUABIND_LIBRARY_DEBUG}") - ELSE(LUABIND_LIBRARY_DEBUG) - SET(LUABIND_LIBRARIES "${LUABIND_LIBRARY_RELEASE}") - ENDIF(LUABIND_LIBRARY_DEBUG) - ENDIF(LUABIND_LIBRARY_RELEASE) + SET(LUABIND_LIBRARIES optimized ${LUABIND_LIBRARY_RELEASE} debug ${LUABIND_LIBRARY_DEBUG}) + ELSEIF(LUABIND_LIBRARY_RELEASE) + # Normal case + SET(LUABIND_FOUND TRUE) + SET(LUABIND_LIBRARIES ${LUABIND_LIBRARY_RELEASE}) + ELSEIF(LUABIND_LIBRARY_DEBUG) + # Case where Luabind is compiled from sources (debug version is compiled by default) + SET(LUABIND_FOUND TRUE) + SET(LUABIND_LIBRARIES ${LUABIND_LIBRARY_DEBUG}) + ENDIF(LUABIND_LIBRARY_RELEASE AND LUABIND_LIBRARY_DEBUG) ENDIF(LUABIND_INCLUDE_DIR AND Boost_INCLUDE_DIR) IF(LUABIND_FOUND) + SET(LUABIND_INCLUDE_DIR ${LUABIND_INCLUDE_DIR} ${Boost_INCLUDE_DIR}) # Check if luabind/version.hpp exists FIND_FILE(LUABIND_VERSION_FILE luabind/version.hpp PATHS ${LUABIND_INCLUDE_DIR}) IF(LUABIND_VERSION_FILE) SET(LUABIND_DEFINITIONS "-DHAVE_LUABIND_VERSION") ENDIF(LUABIND_VERSION_FILE) - IF(NOT LUABIND_FIND_QUIETLY) + IF(NOT Luabind_FIND_QUIETLY) MESSAGE(STATUS "Found Luabind: ${LUABIND_LIBRARIES}") - ENDIF(NOT LUABIND_FIND_QUIETLY) + ENDIF(NOT Luabind_FIND_QUIETLY) ELSE(LUABIND_FOUND) - IF(NOT LUABIND_FIND_QUIETLY) + IF(NOT Luabind_FIND_QUIETLY) MESSAGE(STATUS "Warning: Unable to find Luabind!") - ENDIF(NOT LUABIND_FIND_QUIETLY) + ENDIF(NOT Luabind_FIND_QUIETLY) ENDIF(LUABIND_FOUND) MARK_AS_ADVANCED(LUABIND_LIBRARY_RELEASE LUABIND_LIBRARY_DEBUG Boost_LIB_DIAGNOSTIC_DEFINITIONS) diff --git a/code/CMakeModules/FindSTLport.cmake b/code/CMakeModules/FindSTLport.cmake index a235d42f3..22e0745ba 100644 --- a/code/CMakeModules/FindSTLport.cmake +++ b/code/CMakeModules/FindSTLport.cmake @@ -71,9 +71,9 @@ IF(STLPORT_INCLUDE_DIR) IF(STLPORT_LIBRARY_RELEASE) SET(STLPORT_FOUND TRUE) - SET(STLPORT_LIBRARIES "optimized;${STLPORT_LIBRARY_RELEASE}") + SET(STLPORT_LIBRARIES ${STLPORT_LIBRARY_RELEASE}) IF(STLPORT_LIBRARY_DEBUG) - SET(STLPORT_LIBRARIES "${STLPORT_LIBRARIES};debug;${STLPORT_LIBRARY_DEBUG}") + SET(STLPORT_LIBRARIES optimized ${STLPORT_LIBRARIES} debug ${STLPORT_LIBRARY_DEBUG}) ENDIF(STLPORT_LIBRARY_DEBUG) ENDIF(STLPORT_LIBRARY_RELEASE) ENDIF(STLPORT_INCLUDE_DIR) diff --git a/code/CMakeModules/FindWindowsSDK.cmake b/code/CMakeModules/FindWindowsSDK.cmake index 04059a6a5..30e507f85 100644 --- a/code/CMakeModules/FindWindowsSDK.cmake +++ b/code/CMakeModules/FindWindowsSDK.cmake @@ -9,17 +9,32 @@ IF(WINSDK_INCLUDE_DIR) SET(WINSDK_FIND_QUIETLY TRUE) ENDIF(WINSDK_INCLUDE_DIR) +GET_FILENAME_COMPONENT(WINSDK71_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.1;InstallationFolder]" ABSOLUTE CACHE) +GET_FILENAME_COMPONENT(WINSDK71_VERSION "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.1;ProductVersion]" NAME) + +IF(WINSDK71_DIR) + IF(NOT WINSDK_FIND_QUIETLY) + MESSAGE(STATUS "Found Windows SDK ${WINSDK71_VERSION} in ${WINSDK71_DIR}") + ENDIF(NOT WINSDK_FIND_QUIETLY) +ENDIF(WINSDK71_DIR) + +GET_FILENAME_COMPONENT(WINSDKCURRENT_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" ABSOLUTE CACHE) +GET_FILENAME_COMPONENT(WINSDKCURRENT_VERSION "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentVersion]" NAME) + +IF(WINSDKCURRENT_DIR) + IF(NOT WINSDK_FIND_QUIETLY) + MESSAGE(STATUS "Found Windows SDK ${WINSDKCURRENT_VERSION} in ${WINSDKCURRENT_DIR}") + ENDIF(NOT WINSDK_FIND_QUIETLY) +ENDIF(WINSDKCURRENT_DIR) + FIND_PATH(WINSDK_INCLUDE_DIR Windows.h PATHS - "[HKEY_CURRENT_USER\\Software\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]/Include" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]/Include" + ${WINSDK71_DIR}/Include + ${WINSDKCURRENT_DIR}/Include ) IF(WINSDK_INCLUDE_DIR) SET(WINSDK_FOUND TRUE) - IF(NOT WINSDK_FIND_QUIETLY) - MESSAGE(STATUS "Found Windows SDK.") - ENDIF(NOT WINSDK_FIND_QUIETLY) ELSE(WINSDK_INCLUDE_DIR) IF(NOT WINSDK_FIND_QUIETLY) MESSAGE(STATUS "Warning: Unable to find Windows SDK!") diff --git a/code/CMakeModules/FindZLIB.cmake b/code/CMakeModules/FindZLIB.cmake deleted file mode 100644 index cb055740e..000000000 --- a/code/CMakeModules/FindZLIB.cmake +++ /dev/null @@ -1,39 +0,0 @@ -# - Find zlib -# Find the native ZLIB includes and library -# -# ZLIB_INCLUDE_DIRS - where to find zlib.h, etc. -# ZLIB_LIBRARIES - List of libraries when using zlib. -# ZLIB_FOUND - True if zlib found. - -#============================================================================= -# Copyright 2001-2009 Kitware, Inc. -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distributed this file outside of CMake, substitute the full -# License text for the above reference.) - -IF (ZLIB_INCLUDE_DIR) - # Already in cache, be silent - SET(ZLIB_FIND_QUIETLY TRUE) -ENDIF (ZLIB_INCLUDE_DIR) - -FIND_PATH(ZLIB_INCLUDE_DIR zlib.h) - -SET(ZLIB_NAMES z zlib zdll) -FIND_LIBRARY(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} ) -MARK_AS_ADVANCED( ZLIB_LIBRARY ZLIB_INCLUDE_DIR ) - -# Per-recommendation -SET(ZLIB_INCLUDE_DIRS "${ZLIB_INCLUDE_DIR}") -SET(ZLIB_LIBRARIES "${ZLIB_LIBRARY}") - -# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if -# all listed variables are TRUE -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB DEFAULT_MSG ZLIB_LIBRARIES ZLIB_INCLUDE_DIRS) diff --git a/code/CMakeModules/PCHSupport.cmake b/code/CMakeModules/PCHSupport.cmake index 74d009864..bb34aebfe 100644 --- a/code/CMakeModules/PCHSupport.cmake +++ b/code/CMakeModules/PCHSupport.cmake @@ -45,8 +45,6 @@ MACRO(_PCH_GET_COMPILE_FLAGS _out_compile_flags) IF(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY) LIST(APPEND ${_out_compile_flags} "-fPIC") ENDIF(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY) - ELSE(CMAKE_COMPILER_IS_GNUCXX) - ## TODO ... ? or does it work out of the box ENDIF(CMAKE_COMPILER_IS_GNUCXX) GET_DIRECTORY_PROPERTY(DIRINC INCLUDE_DIRECTORIES ) @@ -54,13 +52,23 @@ MACRO(_PCH_GET_COMPILE_FLAGS _out_compile_flags) LIST(APPEND ${_out_compile_flags} " ${_PCH_include_prefix}\"${item}\"") ENDFOREACH(item) + # Required for CMake 2.6 + SET(GLOBAL_DEFINITIONS "") + GET_DIRECTORY_PROPERTY(DEFINITIONS COMPILE_DEFINITIONS) + FOREACH(item ${DEFINITIONS}) + LIST(APPEND GLOBAL_DEFINITIONS -D${item}) + ENDFOREACH(item) + GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS) - GET_DIRECTORY_PROPERTY(_global_definitions DIRECTORY ${CMAKE_SOURCE_DIR} DEFINITIONS) + GET_DIRECTORY_PROPERTY(_directory_definitions DIRECTORY ${CMAKE_SOURCE_DIR} DEFINITIONS) + LIST(APPEND ${_out_compile_flags} ${GLOBAL_DEFINITIONS}) LIST(APPEND ${_out_compile_flags} ${_directory_flags}) - LIST(APPEND ${_out_compile_flags} ${_global_definitions}) + LIST(APPEND ${_out_compile_flags} ${_directory_definitions}) LIST(APPEND ${_out_compile_flags} ${CMAKE_CXX_FLAGS}) + # Format definitions and remove duplicates SEPARATE_ARGUMENTS(${_out_compile_flags}) + LIST(REMOVE_DUPLICATES ${_out_compile_flags}) ENDMACRO(_PCH_GET_COMPILE_FLAGS) MACRO(_PCH_GET_PDB_FILENAME out_filename _target) @@ -115,6 +123,11 @@ MACRO(GET_PRECOMPILED_HEADER_OUTPUT _targetName _input _output) ENDMACRO(GET_PRECOMPILED_HEADER_OUTPUT _targetName _input) MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName _input _pch_output_to_use ) + GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS) + IF(${oldProps} MATCHES NOTFOUND) + SET(oldProps "") + ENDIF(${oldProps} MATCHES NOTFOUND) + IF(CMAKE_COMPILER_IS_GNUCXX) # to do: test whether compiler flags match between target _targetName # and _pch_output_to_use @@ -123,19 +136,17 @@ MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName _input _pch_output_to_use ) # for use with distcc and gcc >4.0.1 if preprocessed files are accessible # on all remote machines set # PCH_ADDITIONAL_COMPILER_FLAGS to -fpch-preprocess - SET(_target_cflags "${PCH_ADDITIONAL_COMPILER_FLAGS}-include ${_input} -Winvalid-pch") + SET(_target_cflags "${oldProps} ${PCH_ADDITIONAL_COMPILER_FLAGS}-include ${_input} -Winvalid-pch") ELSE(CMAKE_COMPILER_IS_GNUCXX) IF(MSVC) - GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS) - IF(${oldProps} MATCHES NOTFOUND) - SET(oldProps "") - ENDIF(${oldProps} MATCHES NOTFOUND) - SET(_target_cflags "${oldProps} /Yu\"${_input}\" /FI\"${_input}\" /Fp\"${_pch_output_to_use}\"") ENDIF(MSVC) ENDIF(CMAKE_COMPILER_IS_GNUCXX) SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS ${_target_cflags}) + IF(oldProps) + SET_TARGET_PROPERTIES(${_targetName}_pch_dephelp PROPERTIES COMPILE_FLAGS ${oldProps}) + ENDIF(oldProps) ADD_CUSTOM_TARGET(pch_Generate_${_targetName} DEPENDS ${_pch_output_to_use}) ADD_DEPENDENCIES(${_targetName} pch_Generate_${_targetName}) ENDMACRO(ADD_PRECOMPILED_HEADER_TO_TARGET) diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index dc6b477d0..fbd70c842 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -37,16 +37,17 @@ ENDMACRO(NL_TARGET_DRIVER) # Argument: ### MACRO(NL_DEFAULT_PROPS name label) + IF(NOT MSVC10) + SET_TARGET_PROPERTIES(${name} PROPERTIES PROJECT_LABEL ${label}) + ENDIF(NOT MSVC10) GET_TARGET_PROPERTY(type ${name} TYPE) IF(${type} STREQUAL SHARED_LIBRARY) # Set versions only if target is a shared library SET_TARGET_PROPERTIES(${name} PROPERTIES - VERSION ${NL_VERSION} SOVERSION ${NL_VERSION_MAJOR} - INSTALL_NAME_DIR ${NL_LIB_PREFIX} - PROJECT_LABEL ${label}) - ELSE(${type} STREQUAL SHARED_LIBRARY) - SET_TARGET_PROPERTIES(${name} PROPERTIES - PROJECT_LABEL ${label}) + VERSION ${NL_VERSION} SOVERSION ${NL_VERSION_MAJOR}) + IF(NL_LIB_PREFIX) + SET_TARGET_PROPERTIES(${name} PROPERTIES INSTALL_NAME_DIR ${NL_LIB_PREFIX}) + ENDIF(NL_LIB_PREFIX) ENDIF(${type} STREQUAL SHARED_LIBRARY) IF(WITH_STLPORT AND WIN32) SET_TARGET_PROPERTIES(${name} PROPERTIES COMPILE_FLAGS "/X") @@ -93,6 +94,14 @@ MACRO(NL_ADD_STATIC_VID_DRIVERS name) TARGET_LINK_LIBRARIES(${name} nel_drv_opengl) ENDIF(WIN32) ENDIF(WITH_DRIVER_OPENGL) + + IF(WITH_DRIVER_OPENGLES) + IF(WIN32) + TARGET_LINK_LIBRARIES(${name} nel_drv_opengles_win) + ELSE(WIN32) + TARGET_LINK_LIBRARIES(${name} nel_drv_opengles) + ENDIF(WIN32) + ENDIF(WITH_DRIVER_OPENGLES) ENDIF(WITH_STATIC_DRIVERS) ENDMACRO(NL_ADD_STATIC_VID_DRIVERS) @@ -208,6 +217,7 @@ MACRO(NL_SETUP_NEL_DEFAULT_OPTIONS) # Drivers Support ### OPTION(WITH_DRIVER_OPENGL "Build OpenGL Driver (3D)" ON ) + OPTION(WITH_DRIVER_OPENGLES "Build OpenGL ES Driver (3D)" OFF) OPTION(WITH_DRIVER_DIRECT3D "Build Direct3D Driver (3D)" OFF) OPTION(WITH_DRIVER_OPENAL "Build OpenAL Driver (Sound)" ON ) OPTION(WITH_DRIVER_FMOD "Build FMOD Driver (Sound)" OFF) @@ -278,19 +288,56 @@ MACRO(NL_SETUP_BUILD) ENDIF(CMAKE_BUILD_TYPE MATCHES "Release") ENDIF(CMAKE_BUILD_TYPE MATCHES "Debug") + # Determine target CPU +# IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86") + IF(NOT CMAKE_SIZEOF_VOID_P) + INCLUDE (CheckTypeSize) + CHECK_TYPE_SIZE("void*" CMAKE_SIZEOF_VOID_P) + ENDIF(NOT CMAKE_SIZEOF_VOID_P) + + # Using 32 or 64 bits libraries + SET(TARGET_X86 1) + IF(CMAKE_SIZEOF_VOID_P EQUAL 8) + SET(ARCH "x86_64") + SET(TARGET_X64 1) + ADD_DEFINITIONS(-DHAVE_X86_64) + ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8) + SET(ARCH "x86") + ADD_DEFINITIONS(-DHAVE_X86) + ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8) +# ADD_DEFINITIONS(-DHAVE_IA64) +# ENDIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86") + IF(WIN32) - # don't use a /O[012x] flag if you want custom optimizations - SET(SPEED_OPTIMIZATIONS "/Ob2 /Oi /Ot /Oy /GT /GF /GS-") - # without inlining it's unusable, use custom optimizations again - SET(MIN_OPTIMIZATIONS "/Ob1") + IF(MSVC10) + # /Ox is working with VC++ 2010, but custom optimizations don't exist + SET(SPEED_OPTIMIZATIONS "/Ox /GF /GS-") + # without inlining it's unusable, use custom optimizations again + SET(MIN_OPTIMIZATIONS "/Od /Ob1") + ELSE(MSVC10) + # don't use a /O[012x] flag if you want custom optimizations + SET(SPEED_OPTIMIZATIONS "/Ob2 /Oi /Ot /Oy /GT /GF /GS-") + # without inlining it's unusable, use custom optimizations again + SET(MIN_OPTIMIZATIONS "/Ob1") + ENDIF(MSVC10) - SET(PLATFORM_CFLAGS "/D_CRT_SECURE_NO_WARNINGS /DWIN32 /D_WINDOWS /W3 /Zi /Zm1000") - - # Exceptions are only set for C++ - SET(PLATFORM_CXXFLAGS "${PLATFORM_CFLAGS} /EHa") + SET(PLATFORM_CFLAGS "/D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /DWIN32 /D_WINDOWS /W3 /Zi /Zm1000 /MP /Gy-") # Common link flags SET(PLATFORM_LINKFLAGS "-DEBUG") + + IF(TARGET_X64) + # Fix a bug with Intellisense + SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} /D_WIN64") + # Fix a compilation error for some big C++ files + SET(MIN_OPTIMIZATIONS "${MIN_OPTIMIZATIONS} /bigobj") + ELSE(TARGET_X64) + # Allows 32 bits applications to use 3 GB of RAM + SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /LARGEADDRESSAWARE") + ENDIF(TARGET_X64) + + # Exceptions are only set for C++ + SET(PLATFORM_CXXFLAGS "${PLATFORM_CFLAGS} /EHa") SET(NL_DEBUG_CFLAGS "/MDd /RTC1 /D_DEBUG ${MIN_OPTIMIZATIONS}") SET(NL_RELEASE_CFLAGS "/MD /D NDEBUG ${SPEED_OPTIMIZATIONS}") @@ -314,33 +361,10 @@ MACRO(NL_SETUP_BUILD) SET(NL_DEBUG_CFLAGS "-DNL_DEBUG -D_DEBUG") SET(NL_RELEASE_CFLAGS "-DNL_RELEASE -DNDEBUG -O6") - ENDIF(WIN32) - - # Determine host CPU - IF(UNIX AND NOT WIN32) - FIND_PROGRAM(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin ) - IF(CMAKE_UNAME) - EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_SYSTEM_PROCESSOR) - SET(CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR} CACHE INTERNAL "processor type (i386 and x86_64)") - IF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") - ADD_DEFINITIONS(-DHAVE_X86_64) - ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "ia64") - ADD_DEFINITIONS(-DHAVE_IA64) - ELSE(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") - ADD_DEFINITIONS(-DHAVE_X86) - ENDIF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") - ELSE(CMAKE_UNAME) # Assume that if uname is not found that we're x86. - ADD_DEFINITIONS(-DHAVE_X86) - ENDIF(CMAKE_UNAME) - ENDIF(UNIX AND NOT WIN32) - ENDMACRO(NL_SETUP_BUILD) MACRO(NL_SETUP_BUILD_FLAGS) - #SET(CMAKE_DEBUG_POSTFIX "_d") - #SET(CMAKE_RELEASE_POSTFIX "_r") - SET(CMAKE_C_FLAGS ${PLATFORM_CFLAGS} CACHE STRING "" FORCE) SET(CMAKE_CXX_FLAGS ${PLATFORM_CXXFLAGS} CACHE STRING "" FORCE) @@ -472,3 +496,44 @@ MACRO(RYZOM_SETUP_PREFIX_PATHS) ENDIF(NOT RYZOM_GAMES_PREFIX) ENDMACRO(RYZOM_SETUP_PREFIX_PATHS) + +MACRO(SETUP_EXTERNAL) + IF(WIN32) + FIND_PACKAGE(External REQUIRED) + + INCLUDE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake) + IF(MSVC10) + GET_FILENAME_COMPONENT(VC_ROOT_DIR "[HKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\10.0_Config;InstallDir]" ABSOLUTE) + # VC_ROOT_DIR is set to "registry" when a key is not found + IF(VC_ROOT_DIR MATCHES "registry") + GET_FILENAME_COMPONENT(VC_ROOT_DIR "[HKEY_CURRENT_USER\\Software\\Microsoft\\VCExpress\\10.0_Config;InstallDir]" ABSOLUTE) + IF(VC_ROOT_DIR MATCHES "registry") + MESSAGE(FATAL_ERROR "Unable to find VC++ 2010 directory!") + ENDIF(VC_ROOT_DIR MATCHES "registry") + ENDIF(VC_ROOT_DIR MATCHES "registry") + # convert IDE fullpath to VC++ path + STRING(REGEX REPLACE "Common7/.*" "VC" VC_DIR ${VC_ROOT_DIR}) + ELSE(MSVC10) + IF(${CMAKE_MAKE_PROGRAM} MATCHES "Common7") + # convert IDE fullpath to VC++ path + STRING(REGEX REPLACE "Common7/.*" "VC" VC_DIR ${CMAKE_MAKE_PROGRAM}) + ELSE(${CMAKE_MAKE_PROGRAM} MATCHES "Common7") + # convert compiler fullpath to VC++ path + STRING(REGEX REPLACE "VC/bin/.+" "VC" VC_DIR ${CMAKE_CXX_COMPILER}) + ENDIF(${CMAKE_MAKE_PROGRAM} MATCHES "Common7") + ENDIF(MSVC10) + ENDIF(WIN32) + + IF(WITH_STLPORT) + FIND_PACKAGE(STLport REQUIRED) + INCLUDE_DIRECTORIES(${STLPORT_INCLUDE_DIR}) + IF(WIN32) + SET(VC_INCLUDE_DIR "${VC_DIR}/include") + + FIND_PACKAGE(WindowsSDK REQUIRED) + # use VC++ and Windows SDK include paths + INCLUDE_DIRECTORIES(${VC_INCLUDE_DIR} ${WINSDK_INCLUDE_DIR}) + ENDIF(WIN32) + ENDIF(WITH_STLPORT) + +ENDMACRO(SETUP_EXTERNAL) diff --git a/code/README b/code/README index 3c19258ee..4f1b1d51b 100644 --- a/code/README +++ b/code/README @@ -29,4 +29,4 @@ file for for more details on license terms and other legal issues. Installation ------------ -Please check the dev.ryzom.com for more information +Please visit http://dev.ryzom.com for more information. diff --git a/code/config.h.cmake b/code/config.h.cmake index a2f65aa41..2f2ff8095 100644 --- a/code/config.h.cmake +++ b/code/config.h.cmake @@ -35,6 +35,7 @@ #cmakedefine HAVE_STAT64 1 #cmakedefine NL_OPENGL_AVAILABLE ${NL_OPENGL_AVAILABLE} +#cmakedefine NL_OPENGLES_AVAILABLE ${NL_OPENGLES_AVAILABLE} #cmakedefine NL_DIRECT3D_AVAILABLE ${NL_DIRECT3D_AVAILABLE} #cmakedefine NL_FMOD_AVAILABLE ${NL_FMOD_AVAILABLE} diff --git a/code/nel/include/nel/3d/scene_group.h b/code/nel/include/nel/3d/scene_group.h index 9b4f8d792..d587f23d9 100644 --- a/code/nel/include/nel/3d/scene_group.h +++ b/code/nel/include/nel/3d/scene_group.h @@ -107,7 +107,7 @@ public: bool Visible; /// Precomputed Lighting. - // If true (false by default), then the instance don't cast shadow (used by ig_lighter.exe). + // If true (false by default), then the instance don't cast shadow (used by ig_lighter). bool DontCastShadow; // If true (false by default), then the instance's lighting will not be precomputed. bool AvoidStaticLightPreCompute; @@ -120,7 +120,7 @@ public: * If 0xFF => take Ambient of the sun. */ uint8 LocalAmbientId; - /** if true (false by default), the instance don't cast shadow, but ONLY FOR ig_lighter.exe (ig_lighter_lib) + /** if true (false by default), the instance don't cast shadow, but ONLY FOR ig_lighter (ig_lighter_lib) * (zone_lighter and zone_ig_lighter ignore it). * This is a special trick for the "Matis Serre" where the exterior mesh cast shadow in the interior, but * is not visible in the interior in realTime because of cluster clipping.... omg :( diff --git a/code/nel/include/nel/3d/track_keyframer.h b/code/nel/include/nel/3d/track_keyframer.h index 2ae43c011..5f2cde6da 100644 --- a/code/nel/include/nel/3d/track_keyframer.h +++ b/code/nel/include/nel/3d/track_keyframer.h @@ -697,6 +697,7 @@ public: virtual bool addLinearFloatKey(const UKeyLinearFloat &key) { CKeyFloat k; + k.OODeltaTime= 0.f; k.Value= key.Value; addKey(k, key.Time); return true; diff --git a/code/nel/include/nel/cegui/nelrenderer.h b/code/nel/include/nel/cegui/nelrenderer.h index ba1340f5c..84e1221c1 100644 --- a/code/nel/include/nel/cegui/nelrenderer.h +++ b/code/nel/include/nel/cegui/nelrenderer.h @@ -142,11 +142,14 @@ namespace CEGUI void captureCursor(bool capture) { m_Captured=capture; - if(capture) { + if(capture) + { m_Driver->setCapture(true); m_Driver->showCursor(false); m_InputDriver.activateMouse(); - } else { + } + else + { m_Driver->setCapture(false); m_Driver->showCursor(true); m_InputDriver.deactivateMouse(); @@ -178,7 +181,8 @@ namespace CEGUI class NeLInputDriver : public NLMISC::IEventListener { public: - NeLInputDriver() { + NeLInputDriver() + { m_MouseX=0.5f; m_MouseY=0.5f; m_Active=false; @@ -189,7 +193,8 @@ namespace CEGUI } virtual ~NeLInputDriver() { ; } - void addToServer(NLMISC::CEventServer& server) { + void addToServer(NLMISC::CEventServer& server) + { server.addListener(NLMISC::EventMouseMoveId, this); server.addListener(NLMISC::EventMouseDownId, this); server.addListener(NLMISC::EventMouseUpId, this); @@ -200,7 +205,8 @@ namespace CEGUI m_AsyncListener.addToServer(server); } - void removeFromServer(NLMISC::CEventServer& server) { + void removeFromServer(NLMISC::CEventServer& server) + { server.removeListener(NLMISC::EventMouseMoveId, this); server.removeListener(NLMISC::EventMouseDownId, this); server.removeListener(NLMISC::EventMouseUpId, this); @@ -226,9 +232,11 @@ namespace CEGUI * * \param event An event, probably a CEventMouse or CEventKey/Char. */ - virtual void operator ()(const NLMISC::CEvent& event) { + virtual void operator ()(const NLMISC::CEvent& event) + { // don't process any input if we're inactive. - if(m_Active==false) { + if(m_Active==false) + { return; // not processing ANY input } @@ -236,36 +244,51 @@ namespace CEGUI { // otherwise, on with the festivities. // catch ALL mouse event, just in case. - if(event==NLMISC::EventMouseDownId||event==NLMISC::EventMouseUpId||event==NLMISC::EventMouseMoveId||event==NLMISC::EventMouseDblClkId||event==NLMISC::EventMouseWheelId) { - if(!m_MouseActive) { + if(event==NLMISC::EventMouseDownId||event==NLMISC::EventMouseUpId||event==NLMISC::EventMouseMoveId||event==NLMISC::EventMouseDblClkId||event==NLMISC::EventMouseWheelId) + { + if(!m_MouseActive) + { // we're not processing any mouse activity. The cursor isn't captured maybe? return; } NLMISC::CEventMouse *mouseEvent=(NLMISC::CEventMouse *)&event; // a mouse button was pressed. - if(event == NLMISC::EventMouseDownId) { + if(event == NLMISC::EventMouseDownId) + { // it was the left button... - if (mouseEvent->Button & NLMISC::leftButton) { + if (mouseEvent->Button & NLMISC::leftButton) + { CEGUI::System::getSingleton().injectMouseButtonDown(CEGUI::LeftButton); // it was the right button... - } else if (mouseEvent->Button & NLMISC::rightButton) { + } + else if (mouseEvent->Button & NLMISC::rightButton) + { CEGUI::System::getSingleton().injectMouseButtonDown(CEGUI::RightButton); - } else if (mouseEvent->Button & NLMISC::middleButton) { + } + else if (mouseEvent->Button & NLMISC::middleButton) + { CEGUI::System::getSingleton().injectMouseButtonDown(CEGUI::MiddleButton); } // a mouse button was released - } else if (event == NLMISC::EventMouseUpId) { + } + else if (event == NLMISC::EventMouseUpId) + { // it was the left button... - if(mouseEvent->Button & NLMISC::leftButton) { + if(mouseEvent->Button & NLMISC::leftButton) + { CEGUI::System::getSingleton().injectMouseButtonUp(CEGUI::LeftButton); // it was the right button... - } else if (mouseEvent->Button & NLMISC::rightButton) { + } + else if (mouseEvent->Button & NLMISC::rightButton) + { CEGUI::System::getSingleton().injectMouseButtonUp(CEGUI::RightButton); } else if (mouseEvent->Button & NLMISC::middleButton) { CEGUI::System::getSingleton().injectMouseButtonUp(CEGUI::MiddleButton); } - } else if (event == NLMISC::EventMouseMoveId) { + } + else if (event == NLMISC::EventMouseMoveId) + { // convert into screen coordinates. float delta_x=(float)(mouseEvent->X - m_MouseX)*m_Width; float delta_y=(float)((1.0f-mouseEvent->Y) - m_MouseY)*m_Height; @@ -276,18 +299,26 @@ namespace CEGUI // and save for delta. m_MouseX=mouseEvent->X; m_MouseY=1.0f-mouseEvent->Y; - } else if (event == NLMISC::EventMouseWheelId) { + } + else if (event == NLMISC::EventMouseWheelId) + { NLMISC::CEventMouseWheel *ev=(NLMISC::CEventMouseWheel *)&event; float dir=0.0f; if(ev->Direction) dir=0.5f; else dir=-0.5f; CEGUI::System::getSingleton().injectMouseWheelChange(dir); } - } else { // assume otherwise that it's a character. - if(event==NLMISC::EventCharId) { + } + else + { + // assume otherwise that it's a character. + if(event==NLMISC::EventCharId) + { unsigned char c = (char)((NLMISC::CEventChar&)event).Char; CEGUI::System::getSingleton().injectChar((CEGUI::utf32)c); - } else if(event==NLMISC::EventKeyDownId) { + } + else if(event==NLMISC::EventKeyDownId) + { NLMISC::CEventKeyDown *keyvent=(NLMISC::CEventKeyDown *)&event; CEGUI::System::getSingleton().injectKeyDown(m_KeyMap[keyvent->Key]); } @@ -296,7 +327,8 @@ namespace CEGUI catch (CEGUI::Exception) { } } - void initKeyMap() { + void initKeyMap() + { m_KeyMap[NLMISC::Key0 ]=CEGUI::Key::Zero; m_KeyMap[NLMISC::Key1 ]=CEGUI::Key::One; m_KeyMap[NLMISC::Key2 ]=CEGUI::Key::Two; diff --git a/code/nel/include/nel/georges/load_form.h b/code/nel/include/nel/georges/load_form.h index 1a9a759f9..3a2e6d839 100644 --- a/code/nel/include/nel/georges/load_form.h +++ b/code/nel/include/nel/georges/load_form.h @@ -201,7 +201,7 @@ void loadForm (const std::vector &sheetFilters, const std::string & ifile.serialCont (container); ifile.close (); } - catch (NLMISC::Exception &e) + catch (const NLMISC::Exception &e) { // clear the container because it can contains partially loaded sheet so we must clean it before continue container.clear (); @@ -456,7 +456,7 @@ void loadForm (const std::vector &sheetFilters, const std::string & ofile.close (); } } - catch (NLMISC::Exception &e) + catch (const NLMISC::Exception &e) { nlinfo ("loadForm(): Exception during saving the packed file, it will be recreated next launch (%s)", e.what()); } @@ -564,7 +564,7 @@ void loadForm2(const std::vector &sheetFilters, const std::string & ifile.serialPtrCont (container); ifile.close (); } - catch (NLMISC::Exception &e) + catch (const NLMISC::Exception &e) { // clear the container because it can contains partially loaded sheet so we must clean it before continue container.clear (); @@ -819,7 +819,7 @@ void loadForm2(const std::vector &sheetFilters, const std::string & ofile.close (); } } - catch (NLMISC::Exception &e) + catch (const NLMISC::Exception &e) { nlinfo ("loadForm(): Exception during saving the packed file, it will be recreated next launch (%s)", e.what()); } @@ -925,7 +925,7 @@ void loadForm (const std::vector &sheetFilters, const std::string & ifile.serialCont (container); ifile.close (); } - catch (NLMISC::Exception &e) + catch (const NLMISC::Exception &e) { // clear the container because it can contains partially loaded sheet so we must clean it before continue container.clear (); @@ -1183,7 +1183,7 @@ void loadForm (const std::vector &sheetFilters, const std::string & ofile.close (); } } - catch (NLMISC::Exception &e) + catch (const NLMISC::Exception &e) { nlinfo ("loadForm(): Exception during saving the packed file, it will be recreated next launch (%s)", e.what()); } diff --git a/code/nel/include/nel/ligo/primitive_utils.h b/code/nel/include/nel/ligo/primitive_utils.h index cc71e2d50..c5049b06b 100644 --- a/code/nel/include/nel/ligo/primitive_utils.h +++ b/code/nel/include/nel/ligo/primitive_utils.h @@ -261,7 +261,7 @@ inline bool loadXmlPrimitiveFile(CPrimitives &primDoc, const std::string &fileNa // Read it return primDoc.read (xmlIn.getRootNode (), NLMISC::CFile::getFilename(fileName).c_str(), ligoConfig); } - catch(NLMISC::Exception e) + catch(const NLMISC::Exception &e) { nlwarning("Error reading input file '%s': '%s'", fileName.c_str(), e.what()); return false; @@ -294,7 +294,7 @@ inline bool saveXmlPrimitiveFile(CPrimitives &primDoc, const std::string &fileNa // return xmlSaveFile(fileName.c_str(), xmlDoc) != -1; } - catch(NLMISC::Exception e) + catch(const NLMISC::Exception &e) { nlwarning("Error writing output file '%s': '%s'", fileName.c_str(), e.what()); return false; diff --git a/code/nel/include/nel/misc/config_file.h b/code/nel/include/nel/misc/config_file.h index eb7239b14..b1223fa14 100644 --- a/code/nel/include/nel/misc/config_file.h +++ b/code/nel/include/nel/misc/config_file.h @@ -63,7 +63,7 @@ namespace NLMISC * printf ("%d ", bar.asInt (i)); * printf("\n"); * } - * catch (EConfigFile &e) + * catch (const EConfigFile &e) * { * // Something goes wrong... catch that * printf ("%s\n", e.what ()); diff --git a/code/nel/include/nel/misc/debug.h b/code/nel/include/nel/misc/debug.h index f794e6fca..af92c4a16 100644 --- a/code/nel/include/nel/misc/debug.h +++ b/code/nel/include/nel/misc/debug.h @@ -169,7 +169,7 @@ void setCrashAlreadyReported(bool state); *\endcode */ #ifdef NL_NO_DEBUG -# if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) +# if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) # define nldebug __noop # else # define nldebug 0&& @@ -184,7 +184,7 @@ void setCrashAlreadyReported(bool state); * Same as nldebug but it will be display in debug and in release mode. */ #ifdef NL_NO_DEBUG -# if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) +# if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) # define nlinfo __noop # else # define nlinfo 0&& @@ -212,7 +212,7 @@ void setCrashAlreadyReported(bool state); */ #ifdef NL_NO_DEBUG -# if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) +# if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) # define nlwarning __noop # else # define nlwarning 0&& @@ -583,7 +583,11 @@ template inline T type_cast(U o) /** Compile time assertion */ -#define nlctassert(cond) sizeof(uint[(cond) ? 1 : 0]) +#ifdef NL_ISO_CPP0X_AVAILABLE +# define nlctassert(cond) static_assert(cond, "Compile time assert in "#cond) +#else +# define nlctassert(cond) sizeof(uint[(cond) ? 1 : 0]) +#endif /** * Allow to verify an object was accessed before its destructor call. diff --git a/code/nel/include/nel/misc/diff_tool.h b/code/nel/include/nel/misc/diff_tool.h index b8a8db327..64989fcaf 100644 --- a/code/nel/include/nel/misc/diff_tool.h +++ b/code/nel/include/nel/misc/diff_tool.h @@ -238,11 +238,11 @@ namespace STRING_MANAGER return false; } - bool findCol(ucstring colName, uint &colIndex) + bool findCol(const ucstring &colName, uint &colIndex) { if (Data.empty()) return false; - TWorksheet::TRow::iterator it = std::find(Data[0].begin(), Data[0].end(), ucstring(colName)); + TWorksheet::TRow::iterator it = std::find(Data[0].begin(), Data[0].end(), colName); if (it == Data[0].end()) return false; diff --git a/code/nel/include/nel/misc/i_xml.h b/code/nel/include/nel/misc/i_xml.h index e988375f7..7d2ff86b7 100644 --- a/code/nel/include/nel/misc/i_xml.h +++ b/code/nel/include/nel/misc/i_xml.h @@ -71,7 +71,7 @@ struct EXmlParsingError : public EStream // File not found } } - catch (Exception &e) + catch (const Exception &e) { // Something wrong appends } diff --git a/code/nel/include/nel/misc/o_xml.h b/code/nel/include/nel/misc/o_xml.h index af4e830ff..bbaa2e951 100644 --- a/code/nel/include/nel/misc/o_xml.h +++ b/code/nel/include/nel/misc/o_xml.h @@ -64,7 +64,7 @@ namespace NLMISC { // Close the file file.close (); } - catch (Exception &e) + catch (const Exception &e) { } \endcode diff --git a/code/nel/include/nel/misc/sha1.h b/code/nel/include/nel/misc/sha1.h index 6a32d47e3..d0bee0cd9 100644 --- a/code/nel/include/nel/misc/sha1.h +++ b/code/nel/include/nel/misc/sha1.h @@ -105,4 +105,7 @@ CHashKey getSHA1(const std::string &filename, bool forcePath = false); // This function get a buffer with size and returns his SHA hash key CHashKey getSHA1(const uint8 *buffer, uint32 size); +// This function get a buffer and key with size and returns his HMAC-SHA1 hash key +CHashKey getHMacSHA1(const uint8 *text, uint32 text_len, const uint8 *key, uint32 key_len); + #endif // NL_SHA1_H diff --git a/code/nel/include/nel/misc/smart_ptr.h b/code/nel/include/nel/misc/smart_ptr.h index 50fbf4a4a..81b5c0e75 100644 --- a/code/nel/include/nel/misc/smart_ptr.h +++ b/code/nel/include/nel/misc/smart_ptr.h @@ -352,7 +352,7 @@ public: } }; -#if defined(NL_COMP_VC8) || defined(NL_COMP_VC9) +#if defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) // This operator only purpose is to compare with NULL value template diff --git a/code/nel/include/nel/misc/sstring.h b/code/nel/include/nel/misc/sstring.h index 7b4fa717d..513c681c9 100644 --- a/code/nel/include/nel/misc/sstring.h +++ b/code/nel/include/nel/misc/sstring.h @@ -945,10 +945,13 @@ inline CSString operator+(const char* s0,const CSString& s1) return CSString(s0)+s1; } +#ifndef NL_COMP_VC10 +// 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 } // NLMISC diff --git a/code/nel/include/nel/misc/types_nl.h b/code/nel/include/nel/misc/types_nl.h index 04b56f63e..08db88924 100644 --- a/code/nel/include/nel/misc/types_nl.h +++ b/code/nel/include/nel/misc/types_nl.h @@ -51,14 +51,10 @@ # ifndef _WIN32_WINNT # define _WIN32_WINNT 0x0500 // Minimal OS = Windows 2000 (NeL is not supported on Windows 95/98) # endif -# if _MSC_VER >= 1500 +# if _MSC_VER >= 1600 +# define NL_COMP_VC10 +# elif _MSC_VER >= 1500 # define NL_COMP_VC9 -# ifndef _STLPORT_VERSION // STLport doesn't depend on MS STL features -# if defined(_HAS_TR1) && (_HAS_TR1 + 0) // VC9 TR1 feature pack -# define NL_ISO_STDTR1_AVAILABLE -# define NL_ISO_STDTR1_HEADER(header)
-# endif -# endif # elif _MSC_VER >= 1400 # define NL_COMP_VC8 # undef nl_time @@ -79,6 +75,10 @@ # define NL_COMP_VC6 # define NL_COMP_NEED_PARAM_ON_METHOD # endif +# if defined(_HAS_TR1) && (_HAS_TR1 + 0) // VC9 TR1 feature pack or later +# define NL_ISO_STDTR1_AVAILABLE +# define NL_ISO_STDTR1_HEADER(header)
+# endif # ifdef _DEBUG # define NL_DEBUG # elif defined (NDEBUG) @@ -117,6 +117,10 @@ # define NL_COMP_GCC #endif +#if defined(_HAS_CPP0X) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define NL_ISO_CPP0X_AVAILABLE +#endif + // gcc 3.4 introduced ISO C++ with tough template rules // // NL_ISO_SYNTAX can be used using #if NL_ISO_SYNTAX or #if !NL_ISO_SYNTAX @@ -149,7 +153,7 @@ # pragma warning (disable : 4390) // don't warn in empty block "if(exp) ;" # pragma warning (disable : 4996) // 'vsnprintf': This function or variable may be unsafe. Consider using vsnprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. // Debug : Sept 01 2006 -# if defined(NL_COMP_VC8) || defined(NL_COMP_VC9) +# if defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) # pragma warning (disable : 4005) // don't warn on redefinitions caused by xp platform sdk # endif // NL_COMP_VC8 || NL_COMP_VC9 #endif // NL_OS_WINDOWS @@ -287,20 +291,18 @@ typedef unsigned int uint; // at least 32bits (depend of processor) #define __STDC_FORMAT_MACROS #include -#ifdef NL_OS_MAC -#define NL_I64 __PRI_64_LENGTH_MODIFIER__ +#if defined(__PRI_64_LENGTH_MODIFIER__) +# define NL_I64 __PRI_64_LENGTH_MODIFIER__ +#elif defined(__PRI64_PREFIX) +# define NL_I64 __PRI64_PREFIX #else -#define NL_I64 __PRI64_PREFIX +# ifdef _LP64 +# define NL_I64 "l" +# else +# define NL_I64 "ll" +# endif // _LP64 #endif -/* -#ifdef _LP64 -# define NL_I64 "l" -#else -# define NL_I64 "ll" -#endif // _LP64 -*/ - #endif // NL_OS_UNIX // CHashMap, CHashSet and CHashMultiMap definitions @@ -364,7 +366,7 @@ typedef uint16 ucchar; // To define a 64bits constant; ie: UINT64_CONSTANT(0x123456781234) #ifdef NL_OS_WINDOWS -# if defined(NL_COMP_VC8) || defined(NL_COMP_VC9) +# if defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) # 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/net/module.h b/code/nel/include/nel/net/module.h index 70f11f1bc..62d2a0baf 100644 --- a/code/nel/include/nel/net/module.h +++ b/code/nel/include/nel/net/module.h @@ -524,7 +524,7 @@ namespace NLNET // run the module task command control to module task method (_Module->*_TaskMethod)(); } - catch (NLMISC::Exception e) + catch (const NLMISC::Exception &e) { nlwarning("In module task '%s', exception '%e' thrown", typeid(this).name(), e.what()); } diff --git a/code/nel/samples/3d/cluster_viewer/main.cpp b/code/nel/samples/3d/cluster_viewer/main.cpp index bc314e43a..b77a0d669 100644 --- a/code/nel/samples/3d/cluster_viewer/main.cpp +++ b/code/nel/samples/3d/cluster_viewer/main.cpp @@ -94,7 +94,7 @@ CInstanceGroup* LoadInstanceGroup(const char* sFilename) newIG->serial (file); // All is good } - catch (Exception &) + catch (const Exception &) { // Cannot save the file delete newIG; diff --git a/code/nel/samples/3d/font/main.cpp b/code/nel/samples/3d/font/main.cpp index 1a417cae7..e834c4620 100644 --- a/code/nel/samples/3d/font/main.cpp +++ b/code/nel/samples/3d/font/main.cpp @@ -42,7 +42,6 @@ using namespace std; using namespace NL3D; using namespace NLMISC; - #ifdef NL_OS_WINDOWS int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, @@ -139,7 +138,7 @@ int main(int argc, char **argv) tc.setScaleX (scale); tc.setScaleZ (scale); tc.printAt (0.1f, 0.3f, string("printAt Scale String")); - + // display the same string with no scale tc.setHotSpot (CComputedString::TopLeft); tc.setScaleX (1.0f); diff --git a/code/nel/samples/misc/configfile/main.cpp b/code/nel/samples/misc/configfile/main.cpp index f5a3fd472..c23acd652 100644 --- a/code/nel/samples/misc/configfile/main.cpp +++ b/code/nel/samples/misc/configfile/main.cpp @@ -116,7 +116,7 @@ int main (int /* argc */, char ** /* argv */) int val = cf.getVar ("unknown_variable").asInt(); nlinfo("unknown_variable = %d", val); } - catch (EConfigFile &e) + catch (const EConfigFile &e) { nlinfo("something goes wrong with configfile: %s", e.what()); } diff --git a/code/nel/samples/misc/debug/main.cpp b/code/nel/samples/misc/debug/main.cpp index 9d17d158c..84f712c6a 100644 --- a/code/nel/samples/misc/debug/main.cpp +++ b/code/nel/samples/misc/debug/main.cpp @@ -63,7 +63,7 @@ int main (int /* argc */, char ** /* argv */) { nlerror ("nlerror() %d", 4); } - catch(EFatalError &) + catch(const EFatalError &) { // just continue... nlinfo ("nlerror() generated an EFatalError exception, just ignore it"); diff --git a/code/nel/samples/net/chat/client.cpp b/code/nel/samples/net/chat/client.cpp index a22843c0c..c2aee8c86 100644 --- a/code/nel/samples/net/chat/client.cpp +++ b/code/nel/samples/net/chat/client.cpp @@ -109,7 +109,7 @@ int main (int argc, char **argv) CInetAddress addr(LSHost+":3333"); Client->connect(addr); } - catch(ESocket &e) + catch(const ESocket &e) { printf("%s\n", e.what()); return 0; diff --git a/code/nel/samples/net/login_system/frontend_service.cpp b/code/nel/samples/net/login_system/frontend_service.cpp index 189bbaf67..e71e935bf 100644 --- a/code/nel/samples/net/login_system/frontend_service.cpp +++ b/code/nel/samples/net/login_system/frontend_service.cpp @@ -101,7 +101,7 @@ public: { fsPort = IService::ConfigFile.getVar("FSPort").asInt(); } - catch ( EUnknownVar& ) + catch (const EUnknownVar&) { } _FServer.init(fsPort); @@ -148,7 +148,7 @@ public: { fesPort = IService5::ConfigFile.getVar("FESPort").asInt(); } - catch ( EUnknownVar& ) + catch (const EUnknownVar&) { } diff --git a/code/nel/samples/net/udp/bench_service.cpp b/code/nel/samples/net/udp/bench_service.cpp index 0b8db1a71..40786dd26 100644 --- a/code/nel/samples/net/udp/bench_service.cpp +++ b/code/nel/samples/net/udp/bench_service.cpp @@ -190,7 +190,7 @@ void cbInit (CMessage &msgin, TSockId from, CCallbackNetBase &netbase) return; } } - catch (Exception &) + catch (const Exception &) { // bad client version, disconnect it CallbackServer->disconnect (from); @@ -530,7 +530,7 @@ void handleReceivedPong (CClient *client, sint64 pongTime) // init the UDP connection if (client == NULL) { - uint32 session; + uint32 session = 0; msgin.serial (session); // Find a new udp connection, find the linked @@ -568,13 +568,13 @@ void handleReceivedPong (CClient *client, sint64 pongTime) } // Read the message - sint64 pingTime; + sint64 pingTime = 0; msgin.serial(pingTime); - uint32 pongNumber; + uint32 pongNumber = 0; msgin.serial(pongNumber); - uint32 blockNumber; + uint32 blockNumber = 0; msgin.serial(blockNumber); // nlinfo ("receive a pong from %s pongnb %d %"NL_I64"d", CurrentInMsg->AddrFrom.asString().c_str(), pongNumber, pongTime - pingTime); @@ -611,7 +611,7 @@ void sendPing () // send the new ping to the client ReceiveTask->DataSock->sendTo (msgout.buffer(), size, GETCLIENTA(it)->Address); } - catch (Exception &e) + catch (const Exception &e) { nlwarning ("Can't send UDP packet to '%s' (%s)", GETCLIENTA(it)->Address.asString().c_str(), e.what()); } @@ -734,7 +734,7 @@ public: updateStat (); } } - catch (Exception &e) + catch (const Exception &e) { nlerrornoex ("Exception not catched: '%s'", e.what()); } diff --git a/code/nel/samples/net/udp/client.cpp b/code/nel/samples/net/udp/client.cpp index 749797368..dbf15c11d 100644 --- a/code/nel/samples/net/udp/client.cpp +++ b/code/nel/samples/net/udp/client.cpp @@ -232,7 +232,7 @@ void cbInit (CMessage &msgin, TSockId from, CCallbackNetBase &netbase) { UdpSock->connect( CInetAddress (ServerAddr, UDPPort) ); } - catch ( Exception& e ) + catch (const Exception &e) { InfoLog->displayRawNL ("Cannot connect to remote UDP host '%s': %s", ServerAddr.c_str(), e.what() ); exit (""); @@ -291,7 +291,7 @@ int main( int argc, char **argv ) InfoLog->displayRawNL ("Waiting the server answer..."); } - catch(Exception &e) + catch(const Exception &e) { InfoLog->displayRawNL ("Can't connect to %s:%d (%s)\n", ServerAddr.c_str(), TCPPort, e.what()); exit (""); diff --git a/code/nel/samples/net/udp/receive_task.cpp b/code/nel/samples/net/udp/receive_task.cpp index 70276180c..bdfabbe29 100644 --- a/code/nel/samples/net/udp/receive_task.cpp +++ b/code/nel/samples/net/udp/receive_task.cpp @@ -108,7 +108,7 @@ void CReceiveTask::run() DataSock->receivedFrom( _ReceivedMessage.userDataW(), _DatagramLength, _ReceivedMessage.AddrFrom ); d = CTime::getLocalTime (); } - catch ( ESocket& ) + catch (const ESocket&) { // Remove the client corresponding to the address _ReceivedMessage.setTypeEvent( TReceivedMessage::RemoveClient ); diff --git a/code/nel/samples/pacs/main.cpp b/code/nel/samples/pacs/main.cpp index d3d87a938..fcbd7d8a9 100644 --- a/code/nel/samples/pacs/main.cpp +++ b/code/nel/samples/pacs/main.cpp @@ -371,7 +371,7 @@ int main () // Remove mouse listener pDriver->delete3dMouseListener (plistener); } - catch (Exception& e) + catch (const Exception& e) { #ifdef NL_OS_WINDOWS ::MessageBox (NULL, e.what(), "Test collision move", MB_OK|MB_ICONEXCLAMATION); diff --git a/code/nel/samples/sound_sources/main.cpp b/code/nel/samples/sound_sources/main.cpp index 50d28de6a..fb6753f63 100644 --- a/code/nel/samples/sound_sources/main.cpp +++ b/code/nel/samples/sound_sources/main.cpp @@ -85,7 +85,7 @@ void Init() AudioMixer->getListener()->setOrientation( frontvec, upvec ); } - catch( Exception& e ) + catch(const Exception &e) { nlerror( "Error: %s", e.what() ); } diff --git a/code/nel/src/3d/animation_set.cpp b/code/nel/src/3d/animation_set.cpp index 940592396..ec034e300 100644 --- a/code/nel/src/3d/animation_set.cpp +++ b/code/nel/src/3d/animation_set.cpp @@ -227,7 +227,7 @@ bool CAnimationSet::loadFromFiles(const std::string &path, bool recurse /* = tru iFile.close(); } - catch (NLMISC::EStream &e) + catch (const NLMISC::EStream &e) { if (wantWarningMessage) { diff --git a/code/nel/src/3d/async_file_manager_3d.cpp b/code/nel/src/3d/async_file_manager_3d.cpp index 7fbb170d1..382dc0039 100644 --- a/code/nel/src/3d/async_file_manager_3d.cpp +++ b/code/nel/src/3d/async_file_manager_3d.cpp @@ -338,7 +338,7 @@ void CAsyncFileManager3D::CMeshLoad::run() // Finally affect the pointer (Trans-Thread operation -> this operation must be atomic) *_ppShp = mesh.getShapePointer(); } - catch(EPathNotFound &) + catch(const EPathNotFound &) { nlwarning ("Couldn't load '%s'", MeshName.c_str()); *_ppShp = (IShape*)-1; @@ -382,7 +382,7 @@ void CAsyncFileManager3D::CIGLoad::run (void) *_ppIG = pIG; } - catch(EPathNotFound &) + catch(const EPathNotFound &) { nlwarning ("Couldn't load '%s'", _IGName.c_str()); *_ppIG = (CInstanceGroup*)-1; @@ -429,7 +429,7 @@ void CAsyncFileManager3D::CIGLoadUser::run (void) return; } } - catch(EPathNotFound &) + catch(const EPathNotFound &) { nlwarning ("Couldn't load '%s'", _IGName.c_str()); delete pIG; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp index e05e52e7c..5ac1d2906 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp @@ -1600,7 +1600,7 @@ bool CDriverD3D::setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool r _EventEmitter.addEmitter(diee, true); } } - catch(EDirectInput &e) + catch(const EDirectInput &e) { nlinfo(e.what()); } diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_inputs.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_inputs.cpp index e64585ad7..eaae085f9 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_inputs.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_inputs.cpp @@ -485,7 +485,7 @@ NLMISC::IMouseDevice* CDriverD3D::enableLowLevelMouse(bool enable, bool exclusiv if (diee) res = diee->getMouseDevice(exclusive); } - catch (EDirectInput &) + catch (const EDirectInput &) { } } @@ -517,7 +517,7 @@ NLMISC::IKeyboardDevice* CDriverD3D::enableLowLevelKeyboard(bool enable) if (diee) res = diee->getKeyboardDevice(); } - catch (EDirectInput &) + catch (const EDirectInput &) { } } @@ -561,7 +561,7 @@ uint CDriverD3D::getDoubleClickDelay(bool hardwareMouse) { md = diee->getMouseDevice(hardwareMouse); } - catch (EDirectInput &) + catch (const EDirectInput &) { // could not get device .. } 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 8a9e864cc..a4ccb437a 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_material.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_material.cpp @@ -318,7 +318,7 @@ bool CDriverD3D::setupMaterial(CMaterial &mat) if (!mat._MatDrvInfo) { // Insert into driver list. (so it is deleted when driver is deleted). - ItMatDrvInfoPtrList it= _MatDrvInfos.insert(_MatDrvInfos.end(), NULL); + ItMatDrvInfoPtrList it= _MatDrvInfos.insert(_MatDrvInfos.end(), (NL3D::IMaterialDrvInfos*)NULL); *it = mat._MatDrvInfo = new CMaterialDrvInfosD3D(this, it); diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d_shader.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d_shader.cpp index 445b52451..5f1c1bc43 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_shader.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_shader.cpp @@ -347,7 +347,7 @@ bool CDriverD3D::activeShader(CShader *shd) if ( !shd->_DrvInfo ) { // insert into driver list. (so it is deleted when driver is deleted). - ItShaderDrvInfoPtrList it= _ShaderDrvInfos.insert(_ShaderDrvInfos.end(), NULL); + ItShaderDrvInfoPtrList it= _ShaderDrvInfos.insert(_ShaderDrvInfos.end(), (NL3D::IShaderDrvInfos*)NULL); // create and set iterator, for future deletion. shaderInfo = new CShaderDrvInfosD3D(this, it); *it= shd->_DrvInfo = shaderInfo; 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 0c10a3eb8..94615628b 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d_texture.cpp @@ -514,7 +514,7 @@ bool CDriverD3D::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded if ( !tex.TextureDrvShare ) { // insert into driver list. (so it is deleted when driver is deleted). - ItTexDrvSharePtrList it= _TexDrvShares.insert(_TexDrvShares.end(), NULL); + ItTexDrvSharePtrList it= _TexDrvShares.insert(_TexDrvShares.end(), (NL3D::CTextureDrvShare*)NULL); // create and set iterator, for future deletion. *it= tex.TextureDrvShare= new CTextureDrvShare(this, it, &tex); diff --git a/code/nel/src/3d/driver/opengl/CMakeLists.txt b/code/nel/src/3d/driver/opengl/CMakeLists.txt index 25216998c..6fdecab71 100644 --- a/code/nel/src/3d/driver/opengl/CMakeLists.txt +++ b/code/nel/src/3d/driver/opengl/CMakeLists.txt @@ -1,4 +1,5 @@ FILE(GLOB SRC *.cpp *.h *.def) + IF(APPLE) FILE(GLOB MAC_SRC mac/*.h mac/*.m mac/*.mm mac/*.cpp) SET(SRC ${SRC} ${MAC_SRC}) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl.cpp b/code/nel/src/3d/driver/opengl/driver_opengl.cpp index 02ba70993..f222dc5a7 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl.cpp @@ -2508,8 +2508,13 @@ void CDriverGL::checkTextureOn() const GLboolean flagCM; GLboolean flagTR; glGetBooleanv(GL_TEXTURE_2D, &flag2D); +#ifdef USE_OPENGLES + glGetBooleanv(GL_TEXTURE_CUBE_MAP_OES, &flagCM); + flagTR = true; // always true in OpenGL ES +#else glGetBooleanv(GL_TEXTURE_CUBE_MAP_ARB, &flagCM); glGetBooleanv(GL_TEXTURE_RECTANGLE_NV, &flagTR); +#endif switch(dgs.getTextureMode()) { case CDriverGLStates::TextureDisabled: @@ -2545,7 +2550,8 @@ bool CDriverGL::supportOcclusionQuery() const // *************************************************************************** bool CDriverGL::supportTextureRectangle() const { - H_AUTO_OGL(CDriverGL_supportTextureRectangle) + H_AUTO_OGL(CDriverGL_supportTextureRectangle); + return (_Extensions.NVTextureRectangle || _Extensions.EXTTextureRectangle || _Extensions.ARBTextureRectangle); } 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 decd4a0c5..c1ecfe8c0 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 @@ -20,22 +20,67 @@ #include "nel/misc/types_nl.h" -#ifdef NL_OS_MAC -# define GL_GLEXT_LEGACY -# include -# include "mac/glext.h" +#ifdef USE_OPENGLES +# include +# include #else -# include -# include // Please download it from http://www.opengl.org/registry/ -# if defined(NL_OS_WINDOWS) -# include -# endif +# ifdef NL_OS_MAC +# define GL_GLEXT_LEGACY +# include +# include "mac/glext.h" +# else +# include +# include +# if defined(NL_OS_WINDOWS) +# include +# endif +# endif #endif #ifdef __cplusplus extern "C" { #endif +#ifdef USE_OPENGLES +// OES_mapbuffer +//============== +typedef void* (APIENTRY * NEL_PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access); +typedef GLboolean (APIENTRY * NEL_PFNGLUNMAPBUFFEROESPROC) (GLenum target); +typedef void (APIENTRY * NEL_PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, void** params); + +typedef void (APIENTRY * NEL_PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); + +// GL_OES_framebuffer_object +//================================== +typedef GLboolean (APIENTRY * NEL_PFNGLISRENDERBUFFEROESPROC) (GLuint renderbuffer); +typedef void (APIENTRY * NEL_PFNGLBINDRENDERBUFFEROESPROC) (GLenum target, GLuint renderbuffer); +typedef void (APIENTRY * NEL_PFNGLDELETERENDERBUFFERSOESPROC) (GLsizei n, const GLuint* renderbuffers); +typedef void (APIENTRY * NEL_PFNGLGENRENDERBUFFERSOESPROC) (GLsizei n, GLuint* renderbuffers); +typedef void (APIENTRY * NEL_PFNGLRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRY * NEL_PFNGLGETRENDERBUFFERPARAMETERIVOESPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (APIENTRY * NEL_PFNGLISFRAMEBUFFEROESPROC) (GLuint framebuffer); +typedef void (APIENTRY * NEL_PFNGLBINDFRAMEBUFFEROESPROC) (GLenum target, GLuint framebuffer); +typedef void (APIENTRY * NEL_PFNGLDELETEFRAMEBUFFERSOESPROC) (GLsizei n, const GLuint* framebuffers); +typedef void (APIENTRY * NEL_PFNGLGENFRAMEBUFFERSOESPROC) (GLsizei n, GLuint* framebuffers); +typedef GLenum (APIENTRY * NEL_PFNGLCHECKFRAMEBUFFERSTATUSOESPROC) (GLenum target); +typedef void (APIENTRY * NEL_PFNGLFRAMEBUFFERRENDERBUFFEROESPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRY * NEL_PFNGLFRAMEBUFFERTEXTURE2DOESPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRY * NEL_PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVOESPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); +typedef void (APIENTRY * NEL_PFNGLGENERATEMIPMAPOESPROC) (GLenum target); + +// GL_OES_texture_cube_map +//================================== +typedef void (APIENTRY * NEL_PFNGLTEXGENFOESPROC) (GLenum coord, GLenum pname, GLfloat param); +typedef void (APIENTRY * NEL_PFNGLTEXGENFVOESPROC) (GLenum coord, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * NEL_PFNGLTEXGENIOESPROC) (GLenum coord, GLenum pname, GLint param); +typedef void (APIENTRY * NEL_PFNGLTEXGENIVOESPROC) (GLenum coord, GLenum pname, const GLint *params); +typedef void (APIENTRY * NEL_PFNGLTEXGENXOESPROC) (GLenum coord, GLenum pname, GLfixed param); +typedef void (APIENTRY * NEL_PFNGLTEXGENXVOESPROC) (GLenum coord, GLenum pname, const GLfixed *params); +typedef void (APIENTRY * NEL_PFNGLGETTEXGENFVOESPROC) (GLenum coord, GLenum pname, GLfloat *params); +typedef void (APIENTRY * NEL_PFNGLGETTEXGENIVOESPROC) (GLenum coord, GLenum pname, GLint *params); +typedef void (APIENTRY * NEL_PFNGLGETTEXGENXVOESPROC) (GLenum coord, GLenum pname, GLfixed *params); +#endif + // *************************************************************************** // *************************************************************************** // The NEL Functions Typedefs. 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 b957b372a..acfdac253 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_inputs.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_inputs.cpp @@ -684,7 +684,7 @@ NLMISC::IMouseDevice* CDriverGL::enableLowLevelMouse(bool enable, bool exclusive if (diee) res = diee->getMouseDevice(exclusive); } - catch (EDirectInput &) + catch (const EDirectInput &) { } } @@ -722,7 +722,7 @@ NLMISC::IKeyboardDevice* CDriverGL::enableLowLevelKeyboard(bool enable) if (diee) res = diee->getKeyboardDevice(); } - catch (EDirectInput &) + catch (const EDirectInput &) { } } @@ -778,7 +778,7 @@ uint CDriverGL::getDoubleClickDelay(bool hardwareMouse) { md = diee->getMouseDevice(hardwareMouse); } - catch (EDirectInput &) + catch (const EDirectInput &) { // could not get device .. } diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_light.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_light.cpp index 073d39176..e5c3cff6e 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_light.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_light.cpp @@ -139,8 +139,13 @@ void CDriverGL::setLightInternal(uint8 num, const CLight& light) else { // Deactivate spot properties +#ifdef USE_OPENGLES + glLightf (lightNum, GL_SPOT_CUTOFF, 180.f); + glLightf (lightNum, GL_SPOT_EXPONENT, 0.f); +#else glLighti (lightNum, GL_SPOT_CUTOFF, 180); glLighti (lightNum, GL_SPOT_EXPONENT, 0); +#endif } // Flag this light as dirt. 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 569aceb0c..4fe6e8c71 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_material.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_material.cpp @@ -35,10 +35,18 @@ static void convBlend(CMaterial::TBlend blend, GLenum& glenum) case CMaterial::srccolor: glenum=GL_SRC_COLOR; break; case CMaterial::invsrccolor:glenum=GL_ONE_MINUS_SRC_COLOR; break; // Extended Blend modes. +#ifdef USE_OPENGLES + case CMaterial::blendConstantColor: glenum=GL_CONSTANT_COLOR; break; + case CMaterial::blendConstantInvColor: glenum=GL_ONE_MINUS_CONSTANT_COLOR; break; + case CMaterial::blendConstantAlpha: glenum=GL_CONSTANT_ALPHA; break; + case CMaterial::blendConstantInvAlpha: glenum=GL_ONE_MINUS_CONSTANT_ALPHA; break; +#else case CMaterial::blendConstantColor: glenum=GL_CONSTANT_COLOR_EXT; break; case CMaterial::blendConstantInvColor: glenum=GL_ONE_MINUS_CONSTANT_COLOR_EXT; break; case CMaterial::blendConstantAlpha: glenum=GL_CONSTANT_ALPHA_EXT; break; case CMaterial::blendConstantInvAlpha: glenum=GL_ONE_MINUS_CONSTANT_ALPHA_EXT; break; +#endif + default: nlstop; } } @@ -137,7 +145,9 @@ void CDriverGL::setTextureEnvFunction(uint stage, CMaterial& mat) _DriverGLStates.setTexGenMode (stage, GL_OBJECT_LINEAR); } else if(mode==CMaterial::TexCoordGenEyeSpace) + { _DriverGLStates.setTexGenMode (stage, GL_EYE_LINEAR); + } } else { @@ -240,7 +250,9 @@ void CDriverGL::setTextureShaders(const uint8 *addressingModes, const CSmartPtr< if (glAddrMode != _CurrentTexAddrMode[stage]) // addressing mode different from the one in the device? { _DriverGLStates.activeTextureARB(stage); +#ifndef USE_OPENGLES glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, glAddrMode); +#endif _CurrentTexAddrMode[stage] = glAddrMode; } } @@ -264,7 +276,7 @@ bool CDriverGL::setupMaterial(CMaterial& mat) if (!mat._MatDrvInfo) { // insert into driver list. (so it is deleted when driver is deleted). - ItMatDrvInfoPtrList it= _MatDrvInfos.insert(_MatDrvInfos.end(), NULL); + ItMatDrvInfoPtrList it= _MatDrvInfos.insert(_MatDrvInfos.end(), (NL3D::IMaterialDrvInfos*)NULL); // create and set iterator, for future deletion. *it= mat._MatDrvInfo= new CShaderGL(this, it); @@ -807,7 +819,7 @@ void CDriverGL::setupLightMapPass(uint pass) // fallBack if extension MulAdd not found. just mul factor with (Ambient+Diffuse) if(_LightMapNoMulAddFallBack) { - // do not use consant color to blend lightmap, but incoming diffuse color, for stage0 only. + // do not use constant color to blend lightmap, but incoming diffuse color, for stage0 only. GLfloat glcol[4]; convColor(lmapFactor, glcol); _DriverGLStates.setEmissive(lmapFactor.getPacked(), glcol); @@ -918,7 +930,11 @@ void CDriverGL::setupLightMapPass(uint pass) if (mat._LightMapsMulx2) { // Multiply x 2 +#ifdef USE_OPENGLES + glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE, 2); +#else glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE_EXT, 2); +#endif } } } @@ -1027,7 +1043,11 @@ void CDriverGL::endLightMapMultiPass() for (uint32 i = 0; i < (_NLightMapPerPass+1); ++i) { _DriverGLStates.activeTextureARB(i); +#ifdef USE_OPENGLES + glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE, 1); +#else glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE_EXT, 1); +#endif } } } @@ -1102,13 +1122,16 @@ void CDriverGL::setupSpecularBegin() // todo hulud remove // _DriverGLStates.setTextureMode(CDriverGLStates::TextureCubeMap); +#ifdef USE_OPENGLES + _DriverGLStates.setTexGenMode (1, GL_REFLECTION_MAP_OES); +#else _DriverGLStates.setTexGenMode (1, GL_REFLECTION_MAP_ARB); +#endif + // setup the good matrix for stage 1. glMatrixMode(GL_TEXTURE); glLoadMatrixf( _SpecularTexMtx.get() ); glMatrixMode(GL_MODELVIEW); - - } // *************************************************************************** @@ -1292,7 +1315,8 @@ void CDriverGL::setupSpecularPass(uint pass) _DriverGLStates.setTextureMode(CDriverGLStates::TextureDisabled); } else - { // Multiply texture1 by alpha_texture0 and display with add + { + // Multiply texture1 by alpha_texture0 and display with add _DriverGLStates.enableBlend(true); _DriverGLStates.blendFunc(GL_ONE, GL_ONE); @@ -1957,7 +1981,9 @@ void CDriverGL::endCloudMultiPass() nlassert(_CurrentMaterial->getShader() == CMaterial::Cloud); if (ATICloudShaderHandle) { +#ifndef USE_OPENGLES glDisable(GL_FRAGMENT_SHADER_ATI); +#endif } } @@ -1975,7 +2001,9 @@ sint CDriverGL::beginWaterMultiPass() */ void CDriverGL::setupWaterPassR200(const CMaterial &mat) { - H_AUTO_OGL(CDriverGL_setupWaterPassR200) + H_AUTO_OGL(CDriverGL_setupWaterPassR200); + +#ifndef USE_OPENGLES uint k; ITexture *tex = mat.getTexture(0); if (tex) @@ -2047,6 +2075,7 @@ void CDriverGL::setupWaterPassR200(const CMaterial &mat) float cst[4] = { 1.f, 1.f, 1.f, 0.f }; nglSetFragmentShaderConstantATI(GL_CON_0_ATI, cst); } +#endif } // *************************************************************************** @@ -2054,7 +2083,9 @@ void CDriverGL::setupWaterPassR200(const CMaterial &mat) */ void CDriverGL::setupWaterPassARB(const CMaterial &mat) { - H_AUTO_OGL(CDriverGL_setupWaterPassARB) + H_AUTO_OGL(CDriverGL_setupWaterPassARB); + +#ifndef USE_OPENGLES uint k; ITexture *tex = mat.getTexture(0); if (tex) @@ -2133,6 +2164,7 @@ void CDriverGL::setupWaterPassARB(const CMaterial &mat) } } } +#endif } // *************************************************************************** @@ -2159,8 +2191,9 @@ static const float IdentityTexMat[4] = { 1.f, 0.f, 0.f, 1.f }; // *************************************************************************** void CDriverGL::setupWaterPassNV20(const CMaterial &mat) { - H_AUTO_OGL(CDriverGL_setupWaterPassNV20) + H_AUTO_OGL(CDriverGL_setupWaterPassNV20); +#ifndef USE_OPENGLES static bool setupDone = false; static CMaterial::CTexEnv texEnvReplace; static CMaterial::CTexEnv texEnvModulate; @@ -2245,6 +2278,7 @@ void CDriverGL::setupWaterPassNV20(const CMaterial &mat) activateTexEnvMode(2, texEnvReplace); activateTexEnvMode(3, texEnvModulate); } +#endif } // *************************************************************************** @@ -2272,7 +2306,9 @@ void CDriverGL::setupWaterPass(uint /* pass */) // *************************************************************************** void CDriverGL::endWaterMultiPass() { - H_AUTO_OGL(CDriverGL_endWaterMultiPass) + H_AUTO_OGL(CDriverGL_endWaterMultiPass); + +#ifndef USE_OPENGLES nlassert(_CurrentMaterial->getShader() == CMaterial::Water); // NB : as fragment shaders / programs bypass the texture envs, no special env enum is added (c.f CTexEnvSpecial) if (_Extensions.NVTextureShader) return; @@ -2284,6 +2320,7 @@ void CDriverGL::endWaterMultiPass() { glDisable(GL_FRAGMENT_SHADER_ATI); } +#endif } } // NL3D 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 0e5cea073..4106c38f2 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_matrix.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_matrix.cpp @@ -15,24 +15,35 @@ // along with this program. If not, see . #include "stdopengl.h" - #include "driver_opengl.h" + namespace NL3D { // *************************************************************************** void CDriverGL::setFrustum(float left, float right, float bottom, float top, float znear, float zfar, bool perspective) { - H_AUTO_OGL(CDriverGL_setFrustum) + H_AUTO_OGL(CDriverGL_setFrustum); + glMatrixMode(GL_PROJECTION); glLoadIdentity(); + 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; // Backup znear and zfar for zbias setup 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 fb4f14dc2..cf30758dc 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_states.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_states.cpp @@ -77,7 +77,8 @@ void CDriverGLStates::init(bool supportTextureCubeMap, bool supportTextureRect // *************************************************************************** void CDriverGLStates::forceDefaults(uint nbStages) { - H_AUTO_OGL(CDriverGLStates_forceDefaults) + H_AUTO_OGL(CDriverGLStates_forceDefaults); + // Enable / disable. _CurFog= false; _CurBlend= false; @@ -86,6 +87,7 @@ void CDriverGLStates::forceDefaults(uint nbStages) _CurLighting= false; _CurZWrite= true; _CurStencilTest=false; + // setup GLStates. glDisable(GL_FOG); glDisable(GL_BLEND); @@ -144,33 +146,62 @@ void CDriverGLStates::forceDefaults(uint nbStages) for(stage=0;stage +#ifdef USE_OPENGLES +# include #else -# include +# ifdef NL_OS_MAC +# define GL_GLEXT_LEGACY +# include +# else +# include +# endif #endif @@ -41,7 +45,7 @@ namespace NL3D - GL_ALPHA_TEST - GL_LIGHTING - GL_LIGHT0 + i ..... - - GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP_ARB. + - GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP_ARB/OES. - GL_TEXTURE_GEN_S, GL_TEXTURE_GEN_T, GL_TEXTURE_GEN_R - GL_COLOR_MATERIAL - GL_FOG diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp index 6079dc6f3..315c9ee2a 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_texture.cpp @@ -155,7 +155,11 @@ bool CTextureDrvInfosGL::initFrameBufferObject(ITexture * tex) // check status GLenum status; +#ifdef USE_OPENGLES + status = (GLenum) nglCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES); +#else status = (GLenum) nglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); +#endif switch(status) { case GL_FRAMEBUFFER_COMPLETE_EXT: InitFBO = true; @@ -197,19 +201,31 @@ bool CTextureDrvInfosGL::initFrameBufferObject(ITexture * tex) break; #endif default: - nlwarning("Framebuffer incomplete\n"); + nlwarning("Framebuffer incomplete status %d", (sint)status); //nlassert(0); } // 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 } } @@ -226,14 +242,22 @@ 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; @@ -481,7 +505,7 @@ static inline GLenum translateMinFilterToGl(CTextureDrvInfosGL *glText) // *************************************************************************** static inline bool sameDXTCFormat(ITexture &tex, GLint glfmt) { - H_AUTO_OGL(sameDXTCFormat) + H_AUTO_OGL(sameDXTCFormat); if(glfmt==GL_COMPRESSED_RGB_S3TC_DXT1_EXT && tex.PixelFormat==CBitmap::DXTC1) return true; if(glfmt==GL_COMPRESSED_RGBA_S3TC_DXT1_EXT && tex.PixelFormat==CBitmap::DXTC1Alpha) @@ -497,7 +521,7 @@ static inline bool sameDXTCFormat(ITexture &tex, GLint glfmt) // *************************************************************************** static inline bool isDXTCFormat(GLint glfmt) { - H_AUTO_OGL(isDXTCFormat) + H_AUTO_OGL(isDXTCFormat); if(glfmt==GL_COMPRESSED_RGB_S3TC_DXT1_EXT) return true; if(glfmt==GL_COMPRESSED_RGBA_S3TC_DXT1_EXT) @@ -602,7 +626,7 @@ bool CDriverGL::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded, { //nldebug("3D: creating CTextureDrvShare()"); // insert into driver list. (so it is deleted when driver is deleted). - ItTexDrvSharePtrList it= _TexDrvShares.insert(_TexDrvShares.end(), NULL); + ItTexDrvSharePtrList it= _TexDrvShares.insert(_TexDrvShares.end(), (NL3D::CTextureDrvShare*)NULL); // create and set iterator, for future deletion. *it= tex.TextureDrvShare= new CTextureDrvShare(this, it, &tex); @@ -840,8 +864,13 @@ bool CDriverGL::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded, sint size= tex.getPixels(i).size(); if (bUpload) { +#ifdef USE_OPENGLES + glCompressedTexImage2D (GL_TEXTURE_2D, i-decalMipMapResize, glfmt, + tex.getWidth(i),tex.getHeight(i), 0, size, ptr); +#else nglCompressedTexImage2DARB (GL_TEXTURE_2D, i-decalMipMapResize, glfmt, tex.getWidth(i),tex.getHeight(i), 0, size, ptr); +#endif bAllUploaded = true; } 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 d739aea0b..502c971f1 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp @@ -140,7 +140,7 @@ bool CDriverGL::setupVertexBuffer(CVertexBuffer& VB) // 1. Retrieve/Create driver shader. //================================== // insert into driver list. (so it is deleted when driver is deleted). - ItVBDrvInfoPtrList it= _VBDrvInfos.insert(_VBDrvInfos.end(), NULL); + ItVBDrvInfoPtrList it= _VBDrvInfos.insert(_VBDrvInfos.end(), (NL3D::IVBDrvInfos*)NULL); // create and set iterator, for future deletion. CVBDrvInfosGL *info = new CVBDrvInfosGL(this, it, &VB); *it= VB.DrvInfos = info; @@ -280,8 +280,12 @@ bool CDriverGL::renderLines(CMaterial& mat, uint32 firstIndex, uint32 nlines) } else { +#ifdef USE_OPENGLES + nlerror("not available in OpenGL ES 1.0, only use 16 bits indices"); +#else nlassert(_LastIB._Format == CIndexBuffer::Indices32); glDrawElements(GL_LINES,2*nlines,GL_UNSIGNED_INT,((uint32 *) _LastIB._Values)+firstIndex); +#endif } } } @@ -336,8 +340,12 @@ bool CDriverGL::renderTriangles(CMaterial& mat, uint32 firstIndex, uint32 ntris) } else { +#ifdef USE_OPENGLES + nlerror("not available in OpenGL ES 1.0, only use 16 bits indices"); +#else nlassert(_LastIB._Format == CIndexBuffer::Indices32); glDrawElements(GL_TRIANGLES,3*ntris,GL_UNSIGNED_INT, ((uint32 *) _LastIB._Values)+firstIndex); +#endif } } } @@ -380,8 +388,12 @@ bool CDriverGL::renderSimpleTriangles(uint32 firstTri, uint32 ntris) } else { +#ifdef USE_OPENGLES + nlerror("not available in OpenGL ES 1.0, only use 16 bits indices"); +#else nlassert(_LastIB._Format == CIndexBuffer::Indices32); glDrawElements(GL_TRIANGLES,3*ntris,GL_UNSIGNED_INT, ((uint32 *) _LastIB._Values)+firstTri); +#endif } // Profiling. @@ -608,6 +620,9 @@ bool CDriverGL::renderRawQuads(CMaterial& mat, uint32 startIndex, uint32 numQuad } else { +#ifdef USE_OPENGLES + nlerror("not available in OpenGL ES 1.0, only use 16 bits indices"); +#else // indices fits on 32 bits GLint indices[QUAD_BATCH_SIZE]; GLint *curr = indices; @@ -625,6 +640,7 @@ bool CDriverGL::renderRawQuads(CMaterial& mat, uint32 startIndex, uint32 numQuad } while(curr != end); glDrawElements(GL_TRIANGLES, 6 * numQuadsToDraw, GL_UNSIGNED_INT, indices); +#endif } numLeftQuads -= numQuadsToDraw; currIndex += 4 * numQuadsToDraw; @@ -665,10 +681,12 @@ void CDriverGL::setupUVPtr(uint stage, CVertexBufferInfo &VB, uint uvId) // Setup ATI VBHard or std ptr. switch(VB.VBMode) { +#ifndef USE_OPENGLES case CVertexBufferInfo::HwATI: nglArrayObjectATI(GL_TEXTURE_COORD_ARRAY, numTexCoord, GL_FLOAT, VB.VertexSize, VB.VertexObjectId, (ptrdiff_t) VB.ValuePtr[CVertexBuffer::TexCoord0+uvId]); break; +#endif case CVertexBufferInfo::HwARB: _DriverGLStates.bindARBVertexBuffer(VB.VertexObjectId); // with arb buffers, position is relative to the start of the stream @@ -811,6 +829,21 @@ const uint CDriverGL::NumCoordinatesType[CVertexBuffer::NumType]= // *************************************************************************** const uint CDriverGL::GLType[CVertexBuffer::NumType]= { +#ifdef USE_OPENGLES + GL_FLOAT, // Double1 + GL_FLOAT, // Float1 + GL_SHORT, // Short1 + GL_FLOAT, // Double2 + GL_FLOAT, // Float2 + GL_SHORT, // Short2 + GL_FLOAT, // Double3 + GL_FLOAT, // Float3 + GL_SHORT, // Short3 + GL_FLOAT, // Double4 + GL_FLOAT, // Float4 + GL_SHORT, // Short4 + GL_UNSIGNED_BYTE // UChar4 +#else GL_DOUBLE, // Double1 GL_FLOAT, // Float1 GL_SHORT, // Short1 @@ -824,6 +857,7 @@ const uint CDriverGL::GLType[CVertexBuffer::NumType]= GL_FLOAT, // Float4 GL_SHORT, // Short4 GL_UNSIGNED_BYTE // UChar4 +#endif }; // *************************************************************************** @@ -926,6 +960,7 @@ void CDriverGL::setupGlArraysStd(CVertexBufferInfo &vb) } } break; +#ifndef USE_OPENGLES case CVertexBufferInfo::HwATI: { // setup vertex ptr. @@ -963,9 +998,12 @@ void CDriverGL::setupGlArraysStd(CVertexBufferInfo &vb) nglArrayObjectATI(GL_COLOR_ARRAY, 4, GL_UNSIGNED_BYTE, vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::PrimaryColor]); } else + { _DriverGLStates.enableColorArray(false); + } } break; +#endif default: nlassert(0); break; @@ -1035,7 +1073,9 @@ void CDriverGL::toggleGlArraysForARBVertexProgram() // If last was a VertexProgram setup, and now it is a standard GL array setup. if( _LastSetupGLArrayVertexProgram && !isVertexProgramEnabled () ) { +#ifndef USE_OPENGLES if (_Extensions.ATITextureEnvCombine3) +#endif { // fix for ATI : when switching from Vertex Program to fixed Pipe, must clean texture, otherwise texture may be disabled in next render // (seems to be a driver bug) @@ -1046,12 +1086,16 @@ void CDriverGL::toggleGlArraysForARBVertexProgram() // activate the texture, or disable texturing if NULL. activateTexture(stage, NULL); } + +#ifndef USE_OPENGLES glBegin(GL_QUADS); glVertex4f(0.f, 0.f, 0.f, 1.f); glVertex4f(0.f, 0.f, 0.f, 1.f); glVertex4f(0.f, 0.f, 0.f, 1.f); glVertex4f(0.f, 0.f, 0.f, 1.f); glEnd(); +#endif + for(uint stage=0 ; stage_DriverGLStates.forceBindARBVertexBuffer(vertexBufferID); switch(_VBType) { case CVertexBuffer::AGPPreferred: +#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::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; default: nlassert(0); @@ -1230,7 +1248,12 @@ IVertexBufferHardGL *CVertexArrayRangeARB::createVBHardGL(uint size, CVertexBuff } if (glGetError() != GL_NO_ERROR) { +#ifdef USE_OPENGLES + glDeleteBuffers(1, &vertexBufferID); +#else nglDeleteBuffersARB(1, &vertexBufferID); +#endif + return false; } CVertexBufferHardARB *newVbHard= new CVertexBufferHardARB(_Driver, vb); @@ -1272,8 +1295,13 @@ 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); } @@ -1300,6 +1328,12 @@ CVertexBufferHardARB::CVertexBufferHardARB(CDriverGL *drv, CVertexBuffer *vb) : #ifdef NL_DEBUG _Unmapping = false; #endif + +#ifdef USE_OPENGLES + _Buffer = NULL; + _BufferSize = 0; + _LastBufferSize = 0; +#endif } // *************************************************************************** @@ -1316,8 +1350,13 @@ 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) { @@ -1336,12 +1375,21 @@ CVertexBufferHardARB::~CVertexBufferHardARB() _VertexArrayRange->_MappedVBList.erase(_IteratorInMappedVBList); } #endif + +#ifdef USE_OPENGLES + if (_Buffer) + { + delete [] _Buffer; + _Buffer = NULL; + } +#endif } // *************************************************************************** void *CVertexBufferHardARB::lock() { - H_AUTO_OGL(CVertexBufferHardARB_lock) + H_AUTO_OGL(CVertexBufferHardARB_lock); + if (_VertexPtr) return _VertexPtr; // already locked if (_Invalid) { @@ -1352,7 +1400,13 @@ 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(); @@ -1363,13 +1417,25 @@ void *CVertexBufferHardARB::lock() switch(_MemType) { case CVertexBuffer::AGPPreferred: +#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::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; default: nlassert(0); @@ -1378,7 +1444,11 @@ void *CVertexBufferHardARB::lock() if (glGetError() != GL_NO_ERROR) { _Driver->incrementResetCounter(); +#ifdef USE_OPENGLES + glDeleteBuffers(1, &vertexBufferID); +#else nglDeleteBuffersARB(1, &vertexBufferID); +#endif return &_DummyVB[0];; } _VertexObjectId = vertexBufferID; @@ -1394,6 +1464,39 @@ void *CVertexBufferHardARB::lock() beforeLock= CTime::getPerformanceTime(); } _Driver->_DriverGLStates.bindARBVertexBuffer(_VertexObjectId); + +#ifdef USE_OPENGLES + if (_Driver->_Extensions.OESMapBuffer) + { + _VertexPtr = nglMapBufferOES(GL_ARRAY_BUFFER, GL_WRITE_ONLY_OES); + if (!_VertexPtr) + { + nglUnmapBufferOES(GL_ARRAY_BUFFER); + nlassert(glIsBuffer(_VertexObjectId)); + invalidate(); + return &_DummyVB[0]; + } + } + else + { + const uint size = VB->getNumVertices() * VB->getVertexSize(); + + if (size > _BufferSize) + { + if (_Buffer) delete [] _Buffer; + + _Buffer = new uint8[size+3]; + _BufferSize = size; + } + + uint8 offset = (size_t)_Buffer % 4; + + if (offset > 0) offset = 4 - offset; + + _VertexPtr = _Buffer + offset; + _LastBufferSize = size; + } +#else _VertexPtr = nglMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); if (!_VertexPtr) { @@ -1402,6 +1505,8 @@ void *CVertexBufferHardARB::lock() invalidate(); return &_DummyVB[0]; } +#endif + #ifdef NL_DEBUG _VertexArrayRange->_MappedVBList.push_front(this); _IteratorInMappedVBList = _VertexArrayRange->_MappedVBList.begin(); @@ -1420,7 +1525,8 @@ void *CVertexBufferHardARB::lock() // *************************************************************************** void CVertexBufferHardARB::unlock() { - H_AUTO_OGL(CVertexBufferHardARB_unlock) + H_AUTO_OGL(CVertexBufferHardARB_unlock); + _VertexPtr = NULL; if (_Invalid) return; if (!_VertexObjectId) return; @@ -1434,7 +1540,17 @@ void CVertexBufferHardARB::unlock() #ifdef NL_DEBUG _Unmapping = true; #endif - GLboolean unmapOk = nglUnmapBufferARB(GL_ARRAY_BUFFER_ARB); + GLboolean unmapOk = false; + +#ifdef USE_OPENGLES + if (_Driver->_Extensions.OESMapBuffer) + { + unmapOk = nglUnmapBufferOES(GL_ARRAY_BUFFER); + } +#else + unmapOk = nglUnmapBufferARB(GL_ARRAY_BUFFER_ARB); +#endif + #ifdef NL_DEBUG _Unmapping = false; #endif diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.h b/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.h index a2b7111f4..da454c558 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.h +++ b/code/nel/src/3d/driver/opengl/driver_opengl_vertex_buffer_hard.h @@ -113,7 +113,7 @@ protected: bool _Invalid; }; - +#ifndef USE_OPENGLES // *************************************************************************** // *************************************************************************** @@ -456,6 +456,8 @@ public: #endif }; +#endif + // *************************************************************************** // *************************************************************************** // ARB_vertex_buffer_object implementation @@ -553,6 +555,11 @@ private: CVertexArrayRangeARB *_VertexArrayRange; CVertexBuffer::TPreferredMemory _MemType; void *_VertexPtr; // pointer on current datas. Null if not locked +#ifdef USE_OPENGLES + uint8 *_Buffer; + uint32 _BufferSize; + uint32 _LastBufferSize; +#endif // if buffer has been invalidated, returns a dummy memory block and silently fails rendering std::vector _DummyVB; // for use by CVertexArrayRangeARB 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 4c255e1d9..4915ed1d4 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 @@ -111,7 +111,7 @@ bool CDriverGL::activeNVVertexProgram (CVertexProgram *program) } // Insert into driver list. (so it is deleted when driver is deleted). - ItVtxPrgDrvInfoPtrList it= _VtxPrgDrvInfos.insert(_VtxPrgDrvInfos.end(), NULL); + ItVtxPrgDrvInfoPtrList it= _VtxPrgDrvInfos.insert(_VtxPrgDrvInfos.end(), (NL3D::IVertexProgramDrvInfos*)NULL); // Create a driver info *it = drvInfo = new CVertexProgamDrvInfosGL (this, it); @@ -309,7 +309,7 @@ static uint convInputRegisterToVBFlag(uint index) // For debugging with swizzling static void doSwizzle(GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW) { - H_AUTO_OGL(doSwizzle) + H_AUTO_OGL(doSwizzle); nglSwizzleEXT(res, in, outX, outY, outZ, outW); #ifdef DEBUG_SETUP_EXT_VERTEX_SHADER std::string swzStr = "Swizzle : "; @@ -359,7 +359,7 @@ static void doSwizzle(GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum ou // Perform write mask and output de bug information static void doWriteMask(GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW) { - H_AUTO_OGL(doWriteMask) + H_AUTO_OGL(doWriteMask); nglWriteMaskEXT(res, in, outX, outY, outZ, outW); #ifdef DEBUG_SETUP_EXT_VERTEX_SHADER nlinfo("3D: Write Mask : %c%c%c%c", @@ -376,7 +376,7 @@ static void doWriteMask(GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum */ bool CDriverGL::setupEXTVertexShader(const CVPParser::TProgram &program, GLuint id, uint variants[EVSNumVariants], uint16 &usedInputRegisters) { - H_AUTO_OGL(CDriverGL_setupEXTVertexShader) + H_AUTO_OGL(CDriverGL_setupEXTVertexShader); // counter to see what is generated uint numOp = 0; uint numOpIndex = 0; @@ -1440,6 +1440,14 @@ bool CDriverGL::setupARBVertexProgram (const CVPParser::TProgram &inParsedProgra nlassert(0); return false; } + +#ifdef NL_OS_MAC + // Wait for GPU to finish program upload, else draw comands might crash. + // Happened to CVegetableBlendLayerModel (glDrawElements()). + // For more information, see http://dev.ryzom.com/issues/1006 + glFinish(); +#endif + return true; } @@ -1472,7 +1480,7 @@ bool CDriverGL::activeARBVertexProgram (CVertexProgram *program) return false; } // Insert into driver list. (so it is deleted when driver is deleted). - ItVtxPrgDrvInfoPtrList it= _VtxPrgDrvInfos.insert(_VtxPrgDrvInfos.end(), NULL); + ItVtxPrgDrvInfoPtrList it= _VtxPrgDrvInfos.insert(_VtxPrgDrvInfos.end(), (NL3D::IVertexProgramDrvInfos*)NULL); // Create a driver info *it = drvInfo = new CVertexProgamDrvInfosGL (this, it); @@ -1554,7 +1562,7 @@ bool CDriverGL::activeEXTVertexShader (CVertexProgram *program) */ // Insert into driver list. (so it is deleted when driver is deleted). - ItVtxPrgDrvInfoPtrList it= _VtxPrgDrvInfos.insert(_VtxPrgDrvInfos.end(), NULL); + ItVtxPrgDrvInfoPtrList it= _VtxPrgDrvInfos.insert(_VtxPrgDrvInfos.end(), (NL3D::IVertexProgramDrvInfos*)NULL); // Create a driver info *it = drvInfo = new CVertexProgamDrvInfosGL (this, it); 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 48af6cf05..6501d70c4 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp @@ -374,18 +374,25 @@ bool CDriverGL::init (uint windowIcon, emptyProc exitFunc) } #endif // HAVE_XRENDER - // list all supported extensions - sint nextensions = 0; - char **extensions = XListExtensions(_dpy, &nextensions); + nldebug("3D: Available X Extensions:"); - std::string exts; + if (DebugLog) + { + // list all supported extensions + sint nextensions = 0; + char **extensions = XListExtensions(_dpy, &nextensions); - for(sint i = 0; i < nextensions; ++i) - exts += NLMISC::toString(" %s", extensions[i]); + for(sint i = 0; i < nextensions; ++i) + { + if(i%5==0) DebugLog->displayRaw("3D: "); + DebugLog->displayRaw(NLMISC::toString("%s ", extensions[i]).c_str()); + if(i%5==4) DebugLog->displayRaw("\n"); + } - XFreeExtensionList(extensions); + DebugLog->displayRaw("\n"); - nlinfo("X Extensions:%s", exts.c_str()); + XFreeExtensionList(extensions); + } // set default X errors handler XSetErrorHandler(nelXErrorsHandler); @@ -906,7 +913,6 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re _hRC=wglCreateContext(_hDC); wglMakeCurrent(_hDC,_hRC); - } /// release old emitter @@ -929,7 +935,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re _EventEmitter.addEmitter(diee, true); } } - catch(EDirectInput &e) + catch(const EDirectInput &e) { nlinfo(e.what()); } @@ -1577,7 +1583,7 @@ bool CDriverGL::destroyWindow() #elif defined(NL_OS_MAC) - if(_DestroyWindow) + if (_DestroyWindow) { [[containerView() window] release]; [containerView() release]; @@ -2297,7 +2303,7 @@ emptyProc CDriverGL::getWindowProc() // -------------------------------------------------- bool CDriverGL::activate() { - H_AUTO_OGL(CDriverGL_activate) + H_AUTO_OGL(CDriverGL_activate); if (_win == EmptyWindow) return false; @@ -2376,11 +2382,15 @@ void CDriverGL::getWindowSize(uint32 &width, uint32 &height) if (_CurrentMode.OffScreen) { #ifdef NL_OS_WINDOWS + +#ifndef USE_OPENGLES if (_PBuffer) { nwglQueryPbufferARB( _PBuffer, WGL_PBUFFER_WIDTH_ARB, (int*)&width ); nwglQueryPbufferARB( _PBuffer, WGL_PBUFFER_HEIGHT_ARB, (int*)&height ); } +#endif + #endif } else 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 525a59171..95c713021 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 @@ -359,7 +359,7 @@ bool CCocoaEventEmitter::processMessage(NSEvent* event, CEventServer* server) // push the key press event to the event server server->postEvent(new NLMISC::CEventKeyDown( virtualKeycodeToNelKey([event keyCode]), - modifierFlagsToNelKeyButton([event modifierFlags]), + modifiers, [event isARepeat] == NO, this)); // if this was a text event @@ -372,7 +372,7 @@ bool CCocoaEventEmitter::processMessage(NSEvent* event, CEventServer* server) // push the text event to event server as well server->postEvent(new NLMISC::CEventChar( - ucstr[0], NLMISC::noKeyButton, this)); + ucstr[0], modifiers, this)); } break; } @@ -381,7 +381,7 @@ bool CCocoaEventEmitter::processMessage(NSEvent* event, CEventServer* server) // push the key release event to the event server server->postEvent(new NLMISC::CEventKeyUp( virtualKeycodeToNelKey([event keyCode]), - modifierFlagsToNelKeyButton([event modifierFlags]), this)); + modifiers, this)); break; } case NSFlagsChanged:break; diff --git a/code/nel/src/3d/driver_user.cpp b/code/nel/src/3d/driver_user.cpp index 220536c4a..118e02141 100644 --- a/code/nel/src/3d/driver_user.cpp +++ b/code/nel/src/3d/driver_user.cpp @@ -1746,7 +1746,7 @@ void CDriverUser::loadHLSBank(const std::string &fileName) throw EPathNotFound(path); fIn.serial(*hlsBank); } - catch(Exception &) + catch(const Exception &) { delete hlsBank; throw; diff --git a/code/nel/src/3d/fasthls_modifier.cpp b/code/nel/src/3d/fasthls_modifier.cpp index 6f90e574a..fb3fdd31d 100644 --- a/code/nel/src/3d/fasthls_modifier.cpp +++ b/code/nel/src/3d/fasthls_modifier.cpp @@ -109,7 +109,7 @@ CRGBA CFastHLSModifier::convert(uint H, uint L, uint S) return col; } -#if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) +#if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) # pragma warning( push ) # pragma warning( disable : 4799 ) #endif @@ -262,7 +262,7 @@ uint16 CFastHLSModifier::applyHLSMod(uint16 colorIn, uint8 dHue, uint dLum, uin #pragma managed(pop) #endif -#if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) +#if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) # pragma warning( pop ) #endif diff --git a/code/nel/src/3d/instance_group_user.cpp b/code/nel/src/3d/instance_group_user.cpp index 3e79f3c15..722d867da 100644 --- a/code/nel/src/3d/instance_group_user.cpp +++ b/code/nel/src/3d/instance_group_user.cpp @@ -121,7 +121,7 @@ bool CInstanceGroupUser::init (const std::string &instanceGroup, bool async) // Read the class _InstanceGroup.serial (file); } - catch (EStream& e) + catch (const EStream& e) { // Avoid visual warning EStream ee=e; diff --git a/code/nel/src/3d/landscape_user.cpp b/code/nel/src/3d/landscape_user.cpp index c088dcdb4..ed646470a 100644 --- a/code/nel/src/3d/landscape_user.cpp +++ b/code/nel/src/3d/landscape_user.cpp @@ -283,7 +283,7 @@ void CLandscapeUser::refreshZonesAround(const CVector &pos, float radius, std::s { _Landscape->Landscape.checkBinds(Work.Zone->getZoneId()); } - catch (EBadBind &e) + catch (const EBadBind &e) { nlwarning ("Bind error : %s", e.what()); nlstopex(("Zone Data Bind Error. Please send a report. You may continue but it should crash!")); diff --git a/code/nel/src/3d/mesh_mrm_skinned.cpp b/code/nel/src/3d/mesh_mrm_skinned.cpp index 8b7f1fa63..f1c49bd56 100644 --- a/code/nel/src/3d/mesh_mrm_skinned.cpp +++ b/code/nel/src/3d/mesh_mrm_skinned.cpp @@ -1867,7 +1867,7 @@ void CMeshMRMSkinnedGeom::updateRawSkinNormal(bool enabled, CMeshMRMSkinnedInst CIndexBufferReadWrite ibaWrite; skinLod.RdrPass[i].lock (ibaWrite); #ifndef NL_SKINNED_MESH_MRM_INDEX16 - nlassert(ibaWrite.getFormat() == CIndexBuffer::Indices32) + nlassert(ibaWrite.getFormat() == CIndexBuffer::Indices32); uint32 *dstTriPtr= (uint32 *) ibaWrite.getPtr(); uint32 numIndices= lod.RdrPass[i].PBlock.size(); for(uint j=0;j +#include // diff --git a/code/nel/src/3d/ps_mesh.cpp b/code/nel/src/3d/ps_mesh.cpp index ca354b09d..5cd61aa90 100644 --- a/code/nel/src/3d/ps_mesh.cpp +++ b/code/nel/src/3d/ps_mesh.cpp @@ -1291,7 +1291,7 @@ bool CPSConstraintMesh::update(std::vector *numVertsVect /*= NULL*/) { _ModelBank->load(_MeshShapeFileName[k]); } - catch (NLMISC::EPathNotFound &) + catch (const NLMISC::EPathNotFound &) { nlwarning("mesh not found : %s; used as a constraint mesh particle", _MeshShapeFileName[k].c_str()); // shape not found, so not present in the shape bank -> we create a dummy shape @@ -2083,8 +2083,9 @@ static void DuplicatePrimitiveBlock(const CIndexBuffer &srcBlock, CIndexBuffer & CIndexBufferReadWrite ibaWrite; destBlock.lock (ibaWrite); - +#ifdef NL_FORCE_INDEX_BUFFER_16 nlassert(destBlock.getFormat() == CIndexBuffer::Indices16); +#endif // TMP TMP TMP if (ibaRead.getFormat() == CIndexBuffer::Indices16) diff --git a/code/nel/src/3d/shader.cpp b/code/nel/src/3d/shader.cpp index 1872b8a4f..deddce762 100644 --- a/code/nel/src/3d/shader.cpp +++ b/code/nel/src/3d/shader.cpp @@ -93,7 +93,7 @@ bool CShader::loadShaderFile (const char *filename) nlwarning ("Can't open the file %s for reading", _filename.c_str()); } } - catch (Exception &e) + catch (const Exception &e) { nlwarning ("Error while reading %s : %s", _filename.c_str(), e.what()); } diff --git a/code/nel/src/3d/texture_grouped.cpp b/code/nel/src/3d/texture_grouped.cpp index fbe593d9d..c7dbe0033 100644 --- a/code/nel/src/3d/texture_grouped.cpp +++ b/code/nel/src/3d/texture_grouped.cpp @@ -50,12 +50,12 @@ static inline void GetTextureSize(ITexture *tex, uint &width, uint &height) width = srcWidth; height = srcHeight; } - catch (NLMISC::EPathNotFound &e) + catch (const NLMISC::EPathNotFound &e) { nlinfo("%s", e.what()); width = height = 0; } - catch (NLMISC::EStream &e) + catch (const NLMISC::EStream &e) { nlinfo("unable to load size from a bitmap ! name = %s", tf->getFileName().c_str()); nlinfo("reason = %s", e.what()); diff --git a/code/nel/src/3d/tile_bank.cpp b/code/nel/src/3d/tile_bank.cpp index 361b3ea83..1f50fa7b5 100644 --- a/code/nel/src/3d/tile_bank.cpp +++ b/code/nel/src/3d/tile_bank.cpp @@ -1573,7 +1573,7 @@ void CTileSet::loadTileVegetableDesc() // load the TileVegetableDesc f.serial(_TileVegetableDesc); } - catch(Exception &e) + catch(const Exception &e) { nlinfo("Error loading TileVegetableDesc: %s", e.what()); } diff --git a/code/nel/src/3d/vegetable_manager.cpp b/code/nel/src/3d/vegetable_manager.cpp index bb472e75a..a51e5c83e 100644 --- a/code/nel/src/3d/vegetable_manager.cpp +++ b/code/nel/src/3d/vegetable_manager.cpp @@ -816,7 +816,7 @@ CVegetableShape *CVegetableManager::getVegetableShape(const std::string &shap ret = NULL; } } - catch (Exception &e) + catch (const Exception &e) { // Warning nlwarning ("CVegetableManager::getVegetableShape error while loading shape file '%s' : '%s'", shape.c_str (), e.what ()); diff --git a/code/nel/src/3d/zone_lighter.cpp b/code/nel/src/3d/zone_lighter.cpp index 4f1e53385..980a83278 100644 --- a/code/nel/src/3d/zone_lighter.cpp +++ b/code/nel/src/3d/zone_lighter.cpp @@ -844,7 +844,7 @@ void SaveZBuffer (CZoneLighter::CZBuffer &zbuffer, const char *filename) // Save it bitmap.writeJPG (outputZFile, 128); } - catch (Exception& except) + catch (const Exception& except) { // Error message nlwarning ("ERROR writing %s: %s\n", filename, except.what()); @@ -3080,13 +3080,13 @@ void CZoneLighter::lightWater(CWaterShape &ws, const CMatrix &MT, const CLightDe diffuseTex->writeTGA(of, 24); of.close(); } - catch (NLMISC::Exception &) + catch (const NLMISC::Exception &) { nlwarning("Zone lighter : while lighting a water shape, writing %s failed! ", texFileName.c_str()); } } } - catch(NLMISC::Exception &e) + catch(const NLMISC::Exception &e) { nlwarning("Water shape lighting failed !"); nlwarning(e.what()); diff --git a/code/nel/src/georges/form_elm.cpp b/code/nel/src/georges/form_elm.cpp index 528f6eec9..6f2f4c523 100644 --- a/code/nel/src/georges/form_elm.cpp +++ b/code/nel/src/georges/form_elm.cpp @@ -233,6 +233,7 @@ const CType* CFormElm::getType () warning (false, "getType", "This node is not an atom."); return 0; } + // *************************************************************************** bool CFormElm::getValue (string &/* result */, TEval /* evaluate */) const diff --git a/code/nel/src/georges/form_loader.cpp b/code/nel/src/georges/form_loader.cpp index e3098709f..b7d4a522e 100644 --- a/code/nel/src/georges/form_loader.cpp +++ b/code/nel/src/georges/form_loader.cpp @@ -105,7 +105,7 @@ CType *CFormLoader::loadType (const char *filename) type = NULL; } } - catch (Exception &e) + catch (const Exception &e) { // Output error warning (false, "loadType", "Error while loading the form (%s): %s", filename, e.what()); @@ -179,7 +179,7 @@ CFormDfn *CFormLoader::loadFormDfn (const char *filename, bool forceLoad) _MapFormDfn.erase (lowerStr); } } - catch (Exception &e) + catch (const Exception &e) { // Output error warning (false, "loadFormDfn", "Error while loading the form (%s): %s", filename, e.what()); @@ -276,7 +276,7 @@ UForm *CFormLoader::loadForm (const char *filename) _MapForm.erase (lowerStr); } } - catch (Exception &e) + catch (const Exception &e) { // Output error warning (false, "loadForm", "Error while loading the form (%s): %s", filename, e.what()); diff --git a/code/nel/src/ligo/ligo_config.cpp b/code/nel/src/ligo/ligo_config.cpp index c61b03d03..1d062d109 100644 --- a/code/nel/src/ligo/ligo_config.cpp +++ b/code/nel/src/ligo/ligo_config.cpp @@ -220,7 +220,7 @@ bool CLigoConfig::readPrimitiveClass (const char *_fileName, bool parsePrimitive syntaxError (filename.c_str(), root, "Wrong root node, should be NEL_LIGO_PRIMITIVE_CLASS"); } } - catch (Exception &e) + catch (const Exception &e) { errorMessage ("File read error (%s):%s", filename.c_str(), e.what ()); } diff --git a/code/nel/src/ligo/zone_bank.cpp b/code/nel/src/ligo/zone_bank.cpp index 5f03c4bb5..28f30db4b 100644 --- a/code/nel/src/ligo/zone_bank.cpp +++ b/code/nel/src/ligo/zone_bank.cpp @@ -146,7 +146,7 @@ void CZoneBank::debugSaveInit (CZoneBankElement &zbeTmp, const string &fileName) output.init (&fileOut); zbeTmp.serial (output); } - catch (Exception& /*e*/) + catch (const Exception& /*e*/) { } @@ -541,7 +541,7 @@ bool CZoneBank::addElement (const std::string &elementName, std::string &error) error = "Can't open file " + elementName; } } - catch (Exception& e) + catch (const Exception& e) { error = "Error while loading ligozone "+elementName+" : "+e.what(); } diff --git a/code/nel/src/misc/command.cpp b/code/nel/src/misc/command.cpp index 313f36dcd..80d074386 100644 --- a/code/nel/src/misc/command.cpp +++ b/code/nel/src/misc/command.cpp @@ -188,7 +188,7 @@ bool ICommand::execute (const std::string &commandWithArgs, CLog &log, bool quie { return CCommandRegistry::getInstance().execute(commandWithArgs, log, quiet, human); } - catch(exception e) + catch(const exception &e) { log.displayNL("Command '%s' thrown an exception :", commandWithArgs.c_str()); log.displayNL(e.what()); diff --git a/code/nel/src/misc/config_file/cf_lexical.lpp b/code/nel/src/misc/config_file/cf_lexical.lpp index a6ced1449..0dbab0067 100644 --- a/code/nel/src/misc/config_file/cf_lexical.lpp +++ b/code/nel/src/misc/config_file/cf_lexical.lpp @@ -27,7 +27,10 @@ using namespace NLMISC; #define YY_NEVER_INTERACTIVE 1 #ifdef WIN32 +#define YY_NO_UNISTD_H 1 +#include #define read _read +#define isatty _isatty #endif /* Types */ @@ -122,6 +125,12 @@ string \"[^\"\n]*\" if (!cf_Ignore) { cflval.Val.Type = T_STRING; + if (strlen(yytext+1) >= sizeof(cflval.Val.String)) + { + strcpy (cflval.Val.String, ""); + DEBUG_PRINTF("lex: string '%s' exceeds max length\n", yytext); + return STRING; + } strcpy (cflval.Val.String, yytext+1); cflval.Val.String[strlen(cflval.Val.String)-1] = '\0'; DEBUG_PRINTF("lex: string '%s' '%s'\n", yytext, cflval.Val.String); @@ -133,6 +142,12 @@ string \"[^\"\n]*\" if (!cf_Ignore) { cflval.Val.Type = T_STRING; + if (strlen(yytext+1) >= sizeof(cflval.Val.String)) + { + strcpy (cflval.Val.String, ""); + DEBUG_PRINTF("lex: string '%s' exceeds max length\n", yytext); + return VARIABLE; + } strcpy (cflval.Val.String, yytext); DEBUG_PRINTF("lex: variable '%s' '%s'\n", yytext, cflval.Val.String); return VARIABLE; diff --git a/code/nel/src/misc/config_file/config_file.cpp b/code/nel/src/misc/config_file/config_file.cpp index f85469003..ebbce4867 100644 --- a/code/nel/src/misc/config_file/config_file.cpp +++ b/code/nel/src/misc/config_file/config_file.cpp @@ -832,7 +832,7 @@ void CConfigFile::checkConfigFiles () { (*it)->reparse (); } - catch (EConfigFile &e) + catch (const EConfigFile &e) { nlwarning ("CF: Exception will re-read modified config file '%s': %s", (*it)->getFilename().c_str(), e.what ()); } diff --git a/code/nel/src/misc/debug.cpp b/code/nel/src/misc/debug.cpp index 472e2cd35..b6fc1d85c 100644 --- a/code/nel/src/misc/debug.cpp +++ b/code/nel/src/misc/debug.cpp @@ -969,14 +969,12 @@ void force_exception_frame(...) {std::cout.flush();} static void exceptionTranslator(unsigned, EXCEPTION_POINTERS *pexp) { #ifndef NL_NO_DEBUG_FILES - FILE *file = fopen ("exception_catched", "wb"); - fclose (file); + CFile::createEmptyFile(getLogDirectory() + "exception_catched"); #endif if (pexp->ExceptionRecord->ExceptionCode == EXCEPTION_BREAKPOINT) { #ifndef NL_NO_DEBUG_FILES - FILE *file2 = fopen ("breakpointed", "wb"); - fclose (file2); + CFile::createEmptyFile(getLogDirectory() + "breakpointed"); #endif return; } @@ -1018,7 +1016,7 @@ void getCallStack(std::string &result, sint skipNFirst) array[0] = skipNFirst; RaiseException (0xACE0ACE, 0, 1, array); } - catch (EDebug &e) + catch (const EDebug &e) { result += e.what(); } @@ -1053,7 +1051,7 @@ void getCallStackAndLog (string &result, sint /* skipNFirst */) // array[0] = skipNFirst; // RaiseException (0xACE0ACE, 0, 1, array); // } -// catch (EDebug &e) +// catch (const EDebug &e) // { // result += e.what(); // } @@ -1683,12 +1681,18 @@ NLMISC_CATEGORISED_COMMAND(nel, writeaccess, "write a uint8 value in an invalid uint8 val = 123; uint8 *adr = (uint8*)0; if(args.size() >= 1) + { #ifdef HAVE_X86_64 - adr = (uint8*)(uint64)atoi(args[0].c_str()); + uint64 addr64; + NLMISC::fromString(args[0], addr64); + adr = (uint8*)addr64; #else - adr = (uint8*)atoi(args[0].c_str()); + uint32 addr32; + NLMISC::fromString(args[0], addr32); + adr = (uint8*)addr32; #endif - if(args.size() >= 2) val = (uint8)atoi(args[1].c_str()); + } + if(args.size() >= 2) NLMISC::fromString(args[1], val); *adr = val; return true; } @@ -1698,11 +1702,17 @@ NLMISC_CATEGORISED_COMMAND(nel, readaccess, "read a uint8 value in an invalid ad uint8 val; uint8 *adr = (uint8*)0; if(args.size() == 1) + { #ifdef HAVE_X86_64 - adr = (uint8*)(uint64)atoi(args[0].c_str()); + uint64 addr64; + NLMISC::fromString(args[0], addr64); + adr = (uint8*)addr64; #else - adr = (uint8*)atoi(args[0].c_str()); + uint32 addr32; + NLMISC::fromString(args[0], addr32); + adr = (uint8*)addr32; #endif + } val = *adr; log.displayNL("value is %hu", (uint16)val); return true; diff --git a/code/nel/src/misc/diff_tool.cpp b/code/nel/src/misc/diff_tool.cpp index 27621748f..24d7bcc47 100644 --- a/code/nel/src/misc/diff_tool.cpp +++ b/code/nel/src/misc/diff_tool.cpp @@ -84,7 +84,7 @@ bool loadStringFile(const std::string filename, vector &stringInfos buffer = new uint8[size]; fp.serialBuffer(buffer, size); } - catch(Exception &e) + catch(const Exception &e) { nlinfo("Can't open file [%s] (%s)\n", filename.c_str(), e.what()); return true; diff --git a/code/nel/src/misc/displayer.cpp b/code/nel/src/misc/displayer.cpp index cc072fd20..c50935b8f 100644 --- a/code/nel/src/misc/displayer.cpp +++ b/code/nel/src/misc/displayer.cpp @@ -120,7 +120,7 @@ void IDisplayer::display ( const CLog::TDisplayInfo& args, const char *message ) { doDisplay( args, message ); } - catch (Exception &) + catch (const Exception &) { // silence } diff --git a/code/nel/src/misc/file.cpp b/code/nel/src/misc/file.cpp index 515c49014..eb1fa643a 100644 --- a/code/nel/src/misc/file.cpp +++ b/code/nel/src/misc/file.cpp @@ -365,7 +365,7 @@ void CIFile::getline (char *buffer, uint32 bufferSize) // read one byte serialBuffer ((uint8 *)buffer, 1); } - catch (EFile &) + catch (const EFile &) { *buffer = '\0'; return; diff --git a/code/nel/src/misc/inter_window_msg_queue.cpp b/code/nel/src/misc/inter_window_msg_queue.cpp index abdb84338..4cda83a04 100644 --- a/code/nel/src/misc/inter_window_msg_queue.cpp +++ b/code/nel/src/misc/inter_window_msg_queue.cpp @@ -419,7 +419,7 @@ namespace NLMISC } } } - catch(EStream &) + catch(const EStream &) { nlwarning("CInterWindowMsgQueue : Bad message format in inter window communication"); } diff --git a/code/nel/src/misc/sha1.cpp b/code/nel/src/misc/sha1.cpp index bb375a928..92929b469 100644 --- a/code/nel/src/misc/sha1.cpp +++ b/code/nel/src/misc/sha1.cpp @@ -187,6 +187,77 @@ CHashKey getSHA1(const string &filename, bool forcePath) return hk; } +/* +* +* HMAC = hash( (Key ^ 0x5c) .. hash( (Key ^0x36) .. Message ) ) +* +*/ + +CHashKey getHMacSHA1(const uint8 *text, uint32 text_len, const uint8 *key, uint32 key_len) +{ + SHA1Context sha; + + uint8_t SHA1_Key[64]; + uint8_t SHA1_Key1[20]; + uint8_t SHA1_Key2[20]; + + string buffer1; + string buffer2; + + // Init some vars + for (uint i = 0; i < 64; i++) + SHA1_Key[i] = 0; + + // If lenght of key > 64 use sha1 hash + if (key_len > 64) { + uint8_t SHA1_Key0[20]; + SHA1Reset(&sha); + SHA1Input(&sha, (const uint8_t*)key, key_len); + SHA1Result(&sha, SHA1_Key0); + CHashKey hk0 (SHA1_Key0); + for (uint i = 0; i < 20; i++) + SHA1_Key[i] = hk0.HashKeyString[i]; + } else { + for (uint i = 0; i < key_len; i++) + SHA1_Key[i] = key[i]; + } + + // Do 0x36 XOR Key + for (uint i = 0; i < 64; i++) + buffer1 += 0x36 ^ SHA1_Key[i]; + + // Append text + for (uint i = 0; i < text_len; i++) + buffer1 += text[i]; + + // Get hash + SHA1Reset(&sha); + SHA1Input(&sha, (const uint8_t*)buffer1.c_str(), (uint)buffer1.size()); + SHA1Result(&sha, SHA1_Key1); + CHashKey hk1 (SHA1_Key1); + + // Do 0x5c XOR Key + for (uint i = 0; i < 64; i++) + buffer2 += 0x5c ^ SHA1_Key[i]; + + // Append previous hash + for (uint i = 0; i < 20; i++) + buffer2 += hk1.HashKeyString[i]; + + // Get new hash + SHA1Reset(&sha); + SHA1Input(&sha, (const uint8_t*)buffer2.c_str(), (uint)buffer2.size()); + SHA1Result(&sha, SHA1_Key2); + CHashKey hk (SHA1_Key2); + + return hk; +} + + +#ifdef _MFC_VER + #pragma runtime_checks( "", off ) +#endif + /* * Define the SHA1 circular left shift macro */ diff --git a/code/nel/src/misc/shared_memory.cpp b/code/nel/src/misc/shared_memory.cpp index 60d63b7d7..bb19981eb 100644 --- a/code/nel/src/misc/shared_memory.cpp +++ b/code/nel/src/misc/shared_memory.cpp @@ -36,8 +36,8 @@ namespace NLMISC { // Storage for file handles, necessary to close the handles map AccessAddressesToHandles; #else - // Storage for shmid, necessary to destroy the segments - map SharedMemIdsToShmids; + // Storage for shmid, necessary to destroy the segments + map SharedMemIdsToShmids; #endif @@ -71,7 +71,7 @@ void *CSharedMemory::createSharedMemory( TSharedMemId sharedMemId, uint32 size #else // Create a shared memory segment - int shmid = shmget( sharedMemId, size, IPC_CREAT | IPC_EXCL | 0666 ); + sint shmid = shmget( sharedMemId, size, IPC_CREAT | IPC_EXCL | 0666 ); if ( shmid == -1 ) return NULL; SharedMemIdsToShmids.insert( make_pair( sharedMemId, shmid ) ); @@ -82,6 +82,7 @@ void *CSharedMemory::createSharedMemory( TSharedMemId sharedMemId, uint32 size return NULL; else return accessAddress; + #endif } diff --git a/code/nel/src/misc/system_info.cpp b/code/nel/src/misc/system_info.cpp index 97397f001..54273be94 100644 --- a/code/nel/src/misc/system_info.cpp +++ b/code/nel/src/misc/system_info.cpp @@ -66,15 +66,20 @@ namespace NLMISC { vector splitted; explode(string(buffer), string("\n"), splitted, true); + std::string value; + for(uint32 i = 0; i < splitted.size(); i++) { vector sline; explode(splitted[i], string(":"), sline, true); if(sline.size() == 2 && trim(sline[0]) == colname) { - return trim(sline[1]); + value = sline[1]; } } + + if (!value.empty()) + return trim(value); } nlwarning ("SI: Can't find the colname '%s' in /proc/cpuinfo", colname.c_str()); return ""; @@ -549,7 +554,7 @@ string CSystemInfo::getOS() { OSString += " Professional"; } - else + else { if( osvi.wSuiteMask & VER_SUITE_DATACENTER ) OSString += " Datacenter Server"; @@ -805,6 +810,9 @@ string CSystemInfo::getProc () #elif defined NL_OS_UNIX + uint processors = 0; + if (fromString(getCpuInfo("processor"), processors)) ++processors; + ProcString = getCpuInfo("model name"); ProcString += " / ?"; ProcString += " Family " + getCpuInfo("cpu family"); @@ -815,7 +823,7 @@ string CSystemInfo::getProc () ProcString += " / "; ProcString += getCpuInfo("cpu MHz")+"MHz"; ProcString += " / "; - ProcString += "? Processors found"; + ProcString += toString("%u Processors found", processors); #endif diff --git a/code/nel/src/misc/words_dictionary.cpp b/code/nel/src/misc/words_dictionary.cpp index 687f9ea79..d3b32546d 100644 --- a/code/nel/src/misc/words_dictionary.cpp +++ b/code/nel/src/misc/words_dictionary.cpp @@ -55,7 +55,7 @@ bool CWordsDictionary::init( const string& configFileName ) cf.load( configFileName ); cfFound = true; } - catch ( EConfigFile& e ) + catch (const EConfigFile &e) { nlwarning( "WD: %s", e.what() ); } diff --git a/code/nel/src/net/buf_client.cpp b/code/nel/src/net/buf_client.cpp index 7866f81cc..7bf9a7b08 100644 --- a/code/nel/src/net/buf_client.cpp +++ b/code/nel/src/net/buf_client.cpp @@ -451,7 +451,7 @@ void CClientReceiveTask::run() NbLoop++; } - catch ( ESocket& ) + catch (const ESocket&) { LNETL1_DEBUG( "LNETL1: Client connection %s broken", sockId()->asString().c_str() ); sockId()->Sock->disconnect(); diff --git a/code/nel/src/net/buf_server.cpp b/code/nel/src/net/buf_server.cpp index 57df165c8..67fe4b84b 100644 --- a/code/nel/src/net/buf_server.cpp +++ b/code/nel/src/net/buf_server.cpp @@ -829,7 +829,7 @@ void CListenTask::run() NbLoop++; } - catch ( ESocket& e ) + catch (const ESocket &e) { LNETL1_INFO( "LNETL1: Exception in listen thread: %s", e.what() ); // It can occur when too many sockets are open (e.g. 885 connections) @@ -1131,12 +1131,12 @@ void CServerReceiveTask::run() */ } } -// catch ( ESocketConnectionClosed& ) +// catch (const ESocketConnectionClosed&) // { // LNETL1_DEBUG( "LNETL1: Connection %s closed", serverbufsock->asString().c_str() ); // // The socket went to _Connected=false when throwing the exception // } - catch ( ESocket& ) + catch (const ESocket&) { LNETL1_DEBUG( "LNETL1: Connection %s broken", serverbufsock->asString().c_str() ); (*ic)->Sock->disconnect(); diff --git a/code/nel/src/net/callback_client.cpp b/code/nel/src/net/callback_client.cpp index 6f6011f38..181f48c89 100644 --- a/code/nel/src/net/callback_client.cpp +++ b/code/nel/src/net/callback_client.cpp @@ -280,7 +280,7 @@ void CCallbackClient::connect( const CInetAddress& addr ) _MR_Recorder.recordNext( _MR_UpdateCounter, Connecting, _BufSock, addrmsg ); } } - catch ( ESocketConnectionFailed& ) + catch (const ESocketConnectionFailed&) { if ( _MR_RecordingState == Record ) { diff --git a/code/nel/src/net/callback_net_base.cpp b/code/nel/src/net/callback_net_base.cpp index 8620a75b3..24c2b9038 100644 --- a/code/nel/src/net/callback_net_base.cpp +++ b/code/nel/src/net/callback_net_base.cpp @@ -155,7 +155,7 @@ void CCallbackNetBase::processOneMessage () { receive (msgin, &tsid); } - catch (Exception &e) + catch (const Exception &e) { nlwarning(e.what()); return; diff --git a/code/nel/src/net/email.cpp b/code/nel/src/net/email.cpp index 313405983..efafe3e90 100644 --- a/code/nel/src/net/email.cpp +++ b/code/nel/src/net/email.cpp @@ -330,7 +330,7 @@ bool sendEmail (const string &smtpServer, const string &from, const string &to, ok = true; } } - catch (Exception &e) + catch (const Exception &e) { nlwarning ("EMAIL: Can't send email: %s", e.what()); goto end; diff --git a/code/nel/src/net/login_client.cpp b/code/nel/src/net/login_client.cpp index 550b620ee..9c34b41a3 100644 --- a/code/nel/src/net/login_client.cpp +++ b/code/nel/src/net/login_client.cpp @@ -146,7 +146,7 @@ string CLoginClient::authenticateBegin(const string &loginServiceAddr, const ucs _LSCallbackClient->disconnect(); _LSCallbackClient->connect (CInetAddress(addr)); } - catch (ESocket &e) + catch (const ESocket &e) { delete _LSCallbackClient; _LSCallbackClient = 0; @@ -226,7 +226,7 @@ string CLoginClient::connectToShard(CLoginCookie &lc, const std::string &addr, C // have we received the answer? if (!ShardValidate) return "FES disconnect me"; } - catch (ESocket &e) + catch (const ESocket &e) { return string("FES refused the connection (") + e.what () + ")"; } @@ -250,7 +250,7 @@ string CLoginClient::connectToShard (const std::string &addr, CUdpSock &cnx) // cnx.connect (CInetAddress(addr)); } - catch (ESocket &e) + catch (const ESocket &e) { return string("FES refused the connection (") + e.what () + ")"; } @@ -272,7 +272,7 @@ string CLoginClient::connectToShard (const std::string &addr, CUdpSimSock &cnx) // cnx.connect (CInetAddress(addr)); } - catch (ESocket &e) + catch (const ESocket &e) { return string("FES refused the connection (") + e.what () + ")"; } diff --git a/code/nel/src/net/login_server.cpp b/code/nel/src/net/login_server.cpp index 2ff2e3b88..38c3ec321 100644 --- a/code/nel/src/net/login_server.cpp +++ b/code/nel/src/net/login_server.cpp @@ -349,17 +349,17 @@ void CLoginServer::init (const string &listenAddress) try { cfcbDefaultUserPriv(IService::getInstance()->ConfigFile.getVar("DefaultUserPriv")); IService::getInstance()->ConfigFile.setCallback("DefaultUserPriv", cfcbDefaultUserPriv); - } catch(Exception &) { } + } catch(const Exception &) { } try { cfcbAcceptInvalidCookie (IService::getInstance()->ConfigFile.getVar("AcceptInvalidCookie")); IService::getInstance()->ConfigFile.setCallback("AcceptInvalidCookie", cfcbAcceptInvalidCookie); - } catch(Exception &) { } + } catch(const Exception &) { } try { cfcbTimeBeforeEraseCookie (IService::getInstance()->ConfigFile.getVar("TimeBeforeEraseCookie")); IService::getInstance()->ConfigFile.setCallback("TimeBeforeEraseCookie", cfcbTimeBeforeEraseCookie); - } catch(Exception &) { } + } catch(const Exception &) { } // setup the listen address diff --git a/code/nel/src/net/module.cpp b/code/nel/src/net/module.cpp index d09ed3084..41489abfb 100644 --- a/code/nel/src/net/module.cpp +++ b/code/nel/src/net/module.cpp @@ -330,7 +330,7 @@ namespace NLNET _onProcessModuleMessage(currentSender, currentMessage); _CurrentMessageFailed = false; } - catch (NLMISC::Exception e) + catch (const NLMISC::Exception &e) { nlwarning("In module task '%s' (cotask message receiver), exception '%e' thrown", typeid(this).name(), e.what()); // an exception have been thrown diff --git a/code/nel/src/net/module_gateway.cpp b/code/nel/src/net/module_gateway.cpp index 9f838afd1..efe29ae1b 100644 --- a/code/nel/src/net/module_gateway.cpp +++ b/code/nel/src/net/module_gateway.cpp @@ -109,7 +109,7 @@ namespace NLNET sd->serial(s); } } - catch(EStreamOverflow e) + catch(const EStreamOverflow &) { // FAILED to read the security block, rewind to old pos and serial as unknow nlwarning("Error while reading stream for security data type %u", dataTag); diff --git a/code/nel/src/net/module_gateway_transport.cpp b/code/nel/src/net/module_gateway_transport.cpp index 6088ab3e8..b839584d1 100644 --- a/code/nel/src/net/module_gateway_transport.cpp +++ b/code/nel/src/net/module_gateway_transport.cpp @@ -684,7 +684,7 @@ namespace NLNET route->CallbackClient.connect(addr); nldebug("CGatewayL3ClientTransport : Connected to %s with connId %u", addr.asString().c_str(), connId); } - catch (ESocketConnectionFailed e) + catch (const ESocketConnectionFailed &) { nlinfo("CGatewayL3ClientTransport : Failed to connect to server %s, retrying in %u seconds", addr.asString().c_str(), _RetryInterval); } diff --git a/code/nel/src/net/naming_client.cpp b/code/nel/src/net/naming_client.cpp index 5c735cf97..4aac61ea1 100644 --- a/code/nel/src/net/naming_client.cpp +++ b/code/nel/src/net/naming_client.cpp @@ -502,7 +502,7 @@ bool CNamingClient::lookupAndConnect (const std::string &name, CCallbackClient & // connection succeeded return true; } - catch (ESocketConnectionFailed &e) + catch (const ESocketConnectionFailed &e) { nldebug( "NC: Connection to %s failed: %s, tring another service if available", servaddr.asString().c_str(), e.what() ); diff --git a/code/nel/src/net/net_displayer.cpp b/code/nel/src/net/net_displayer.cpp index d9aff2a49..d2a354786 100644 --- a/code/nel/src/net/net_displayer.cpp +++ b/code/nel/src/net/net_displayer.cpp @@ -79,7 +79,7 @@ void CNetDisplayer::setLogServer (const CInetAddress& logServerAddr) { _Server->connect (_ServerAddr); } - catch( ESocket& ) + catch(const ESocket&) { // Silence } @@ -153,7 +153,7 @@ void CNetDisplayer::doDisplay ( const CLog::TDisplayInfo& args, const char *mess msg.serial( s ); _Server->send (msg, 0, false); } - catch( NLMISC::Exception& ) + catch(const NLMISC::Exception& ) { // Silence } diff --git a/code/nel/src/net/service.cpp b/code/nel/src/net/service.cpp index d59dbe5a8..8ed4c10c9 100644 --- a/code/nel/src/net/service.cpp +++ b/code/nel/src/net/service.cpp @@ -914,7 +914,7 @@ sint IService::main (const char *serviceShortName, const char *serviceLongName, // Get the localhost name localhost = CInetAddress::localHost().hostName(); } - catch (NLNET::ESocket &) + catch (const NLNET::ESocket &) { localhost = ""; } @@ -1091,7 +1091,7 @@ sint IService::main (const char *serviceShortName, const char *serviceLongName, return 10; } } - catch (ESocketConnectionFailed &) + catch (const ESocketConnectionFailed &) { nlinfo ("SERVICE: Could not connect to the Naming Service (%s). Retrying in a few seconds...", loc.asString().c_str()); nlSleep (5000); @@ -1495,13 +1495,13 @@ sint IService::main (const char *serviceShortName, const char *serviceLongName, MyTAT.deactivate(); } } - catch (EFatalError &) + catch (const EFatalError &) { // Somebody call nlerror, so we have to quit now, the message already display // so we don't have to to anything setExitStatus (EXIT_FAILURE); } - catch (ESocket &e) + catch (const ESocket &e) { // Catch NeL network exception to release the system cleanly setExitStatus (EXIT_FAILURE); ErrorLog->displayNL( "NeL Exception in \"%s\": %s", _ShortName.c_str(), e.what() ); @@ -1560,7 +1560,7 @@ sint IService::main (const char *serviceShortName, const char *serviceLongName, nlinfo ("SERVICE: Service released successfully"); } - catch (EFatalError &) + catch (const EFatalError &) { // Somebody call nlerror, so we have to quit now, the message already display // so we don't have to to anything diff --git a/code/nel/src/net/sock.cpp b/code/nel/src/net/sock.cpp index 475548821..e2a0c4205 100644 --- a/code/nel/src/net/sock.cpp +++ b/code/nel/src/net/sock.cpp @@ -22,10 +22,8 @@ #include "nel/misc/hierarchical_timer.h" #ifdef NL_OS_WINDOWS -# if defined(NL_COMP_VC7) || defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) -# include -# endif # define NOMINMAX +# include # include # define socklen_t int # define ERROR_NUM WSAGetLastError() diff --git a/code/nel/src/net/tcp_sock.cpp b/code/nel/src/net/tcp_sock.cpp index d51281db6..9773e0b00 100644 --- a/code/nel/src/net/tcp_sock.cpp +++ b/code/nel/src/net/tcp_sock.cpp @@ -20,9 +20,7 @@ #include "nel/net/net_log.h" #ifdef NL_OS_WINDOWS -# if defined(NL_COMP_VC7) || defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) -# include -# endif +# include # define NOMINMAX # include # define socklen_t int diff --git a/code/nel/src/net/transport_class.cpp b/code/nel/src/net/transport_class.cpp index 1d9796dd2..a5f826728 100644 --- a/code/nel/src/net/transport_class.cpp +++ b/code/nel/src/net/transport_class.cpp @@ -419,7 +419,7 @@ void getNameOfMessageOrTransportClass( NLNET::CMessage& msgin, std::string& msgN msgin.seek( msgin.getHeaderSize(), NLMISC::IStream::begin ); msgin.serial( msgName ); } - catch ( EStreamOverflow& ) + catch (const EStreamOverflow&) { msgName = ""; } diff --git a/code/nel/src/net/unified_network.cpp b/code/nel/src/net/unified_network.cpp index 8a1a87b85..d3b0d16fe 100644 --- a/code/nel/src/net/unified_network.cpp +++ b/code/nel/src/net/unified_network.cpp @@ -481,7 +481,7 @@ void CAliveCheck::run() CheckList[i].AddressValid = true; cbc.disconnect(); } - catch (ESocketConnectionFailed &e) + catch (const ESocketConnectionFailed &e) { #if FINAL_VERSION nlinfo ("HNETL5: can't connect to %s-%hu now (%s)", CheckList[i].ServiceName.c_str(), CheckList[i].ServiceId.get(), e.what ()); @@ -587,7 +587,7 @@ bool CUnifiedNetwork::init(const CInetAddress *addr, CCallbackNetBase::TRecordin { _CbServer->init(port); } - catch (ESocket &) + catch (const ESocket &) { nlwarning("Failed to init the listen socket on port %u, is the service already running ?", port); // wait a little before retrying @@ -866,7 +866,7 @@ void CUnifiedNetwork::addService(const string &name, const vector cbc->connect(addr[i]); connectSuccess = true; } - catch (ESocketConnectionFailed &e) + catch (const ESocketConnectionFailed &e) { nlwarning ("HNETL5: can't connect to %s (sid %u) now (%s) '%s'", name.c_str(), sid.get(), e.what (), addr[i].asString ().c_str()); connectSuccess = false; @@ -1010,7 +1010,7 @@ void CUnifiedNetwork::update(TTime timeout) laddr[i].setPort(_ServerPort); CNamingClient::resendRegisteration (_Name, laddr, _SId); } - catch (ESocketConnectionFailed &) + catch (const ESocketConnectionFailed &) { nlwarning ("HNETL5: Could not connect to the Naming Service (%s). Retrying in a few seconds...", _NamingServiceAddr.asString().c_str()); } @@ -1209,7 +1209,7 @@ void CUnifiedNetwork::autoReconnect( CUnifiedConnection &uc, uint connectionInde // call the user callback callServiceUpCallback (uc.ServiceName, uc.ServiceId); } - catch (ESocketConnectionFailed &e) + catch (const ESocketConnectionFailed &e) { #if FINAL_VERSION nlinfo ("HNETL5: can't connect to %s-%hu now (%s)", uc.ServiceName.c_str(), uc.ServiceId.get(), e.what ()); diff --git a/code/nel/src/pacs/global_retriever.cpp b/code/nel/src/pacs/global_retriever.cpp index c9ab8cd0c..936846dd2 100644 --- a/code/nel/src/pacs/global_retriever.cpp +++ b/code/nel/src/pacs/global_retriever.cpp @@ -387,7 +387,7 @@ void NLPACS::CGlobalRetriever::makeLinks(uint n) instance.link(neighbor, _RetrieverBank->getRetrievers()); neighbor.link(instance, _RetrieverBank->getRetrievers()); } - catch (Exception &e) + catch (const Exception &e) { nlwarning("in NLPACS::CGlobalRetriever::makeLinks()"); nlwarning("caught an exception during linkage of %d and %d: %s", instance.getInstanceId(), neighbor.getInstanceId(), e.what()); diff --git a/code/nel/src/pacs/retriever_bank.h b/code/nel/src/pacs/retriever_bank.h index bce8b11e6..d98a5db57 100644 --- a/code/nel/src/pacs/retriever_bank.h +++ b/code/nel/src/pacs/retriever_bank.h @@ -150,7 +150,7 @@ public: { f.serial(_Retrievers[i]); } - catch (NLMISC::Exception &e) + catch (const NLMISC::Exception &e) { nlwarning("Couldn't load retriever file '%s', %s", fname.c_str(), e.what()); _Retrievers[i].clear(); diff --git a/code/nel/src/sound/audio_mixer_user.cpp b/code/nel/src/sound/audio_mixer_user.cpp index 7f17f9d35..367abd0e1 100644 --- a/code/nel/src/sound/audio_mixer_user.cpp +++ b/code/nel/src/sound/audio_mixer_user.cpp @@ -370,7 +370,7 @@ void CAudioMixerUser::initDriver(const std::string &driverName) _SoundDriver = ISoundDriver::createDriver(this, driverType); nlassert(_SoundDriver); } - catch (ESoundDriver &e) + catch (const ESoundDriver &e) { nlwarning(e.what()); delete _SoundDriver; _SoundDriver = NULL; @@ -458,7 +458,7 @@ void CAudioMixerUser::initDevice(const std::string &deviceName, const CInitInfo manualRolloff = false; // not really needed, but set anyway in case this is still used later in this function } } - catch (ESoundDriver &e) + catch (const ESoundDriver &e) { nlwarning(e.what()); delete _SoundDriver; _SoundDriver = NULL; @@ -836,7 +836,7 @@ void CAudioMixerUser::buildSampleBankList() nlinfo("Compiling sample bank [%s]", bankname.c_str()); std::string filename = buildSampleBank(bankDir[i], sbp, bankname); if (bankFile.size() < i + 1) bankFile.resize(i + 1); - else bankFile.insert(bankFile.begin() + i, NULL); + else bankFile.insert(bankFile.begin() + i, std::string()); bankFile[i] = filename; } else if (bankname < CFile::getFilenameWithoutExtension(bankDir[i])) @@ -883,7 +883,7 @@ void CAudioMixerUser::buildSampleBankList() } } } - catch(Exception e) + catch(const Exception &) { upToDate = false; } @@ -2100,7 +2100,7 @@ uint32 CAudioMixerUser::loadSampleBank(bool async, const std::string &name, st { bank->load(async); } - catch (Exception& e) + catch (const Exception& e) { if (notfoundfiles) { @@ -2489,7 +2489,7 @@ void CAudioMixerUser::changeMaxTrack(uint maxTrack) _FreeTracks.insert(_FreeTracks.begin(), _Tracks[i]); } } - catch ( ESoundDriver & ) + catch (const ESoundDriver &) { delete _Tracks[i]; // If the source generation failed, keep only the generated number of sources diff --git a/code/nel/src/sound/driver/dsound/sound_driver_dsound.cpp b/code/nel/src/sound/driver/dsound/sound_driver_dsound.cpp index 62efc1510..15d0d708f 100644 --- a/code/nel/src/sound/driver/dsound/sound_driver_dsound.cpp +++ b/code/nel/src/sound/driver/dsound/sound_driver_dsound.cpp @@ -605,7 +605,7 @@ void CSoundDriverDSound::initDevice(const std::string &device, ISoundDriver::TSo _SourceCount++; } } - catch (ESoundDriver& e) + catch (const ESoundDriver& e) { // Okay, here's the situation: I'm listening to WinAmp while debugging. // The caps told me there were 31 buffers available. In reality, there were diff --git a/code/nel/src/sound/driver/openal/source_al.cpp b/code/nel/src/sound/driver/openal/source_al.cpp index f156bfb7c..fe2dcb086 100644 --- a/code/nel/src/sound/driver/openal/source_al.cpp +++ b/code/nel/src/sound/driver/openal/source_al.cpp @@ -892,12 +892,22 @@ void CSourceAL::setStreamingBuffersMax(uint buffers) for(uint i = 0; i < _BuffersMax; ++i) { - // create a new buffer - CBufferAL *buffer = static_cast(_SoundDriver->createBuffer()); - // use StorageSoftware because buffers will be reused - // deleting and recreating them is a waste of time - buffer->setStorageMode(IBuffer::StorageSoftware); - _Buffers[buffer->bufferName()] = buffer; + try + { + // create a new buffer + CBufferAL *buffer = static_cast(_SoundDriver->createBuffer()); + // use StorageSoftware because buffers will be reused + // deleting and recreating them is a waste of time + buffer->setStorageMode(IBuffer::StorageSoftware); + _Buffers[buffer->bufferName()] = buffer; + } + catch(const ESoundDriverGenBuf &e) + { + nlwarning("Cannot create %d buffers. openal fails after %d buffers", buffers, i); + _BuffersMax = i; + _BuffersName.resize(i); + break; + } } } diff --git a/code/nel/src/sound/sample_bank.cpp b/code/nel/src/sound/sample_bank.cpp index a83166879..8dd764f54 100644 --- a/code/nel/src/sound/sample_bank.cpp +++ b/code/nel/src/sound/sample_bank.cpp @@ -213,7 +213,7 @@ void CSampleBank::load(bool async) _SampleBankManager->m_LoadedSize += _ByteSize; } - catch(Exception &e) + catch(const Exception &e) { // loading failed ! nlwarning("Exception %s during loading of sample bank %s", e.what(), filename.c_str()); @@ -281,7 +281,7 @@ void CSampleBank::load(bool async) // Warn the sound bank that the sample are available. CSoundBank::instance()->bufferLoaded(sampleName, ibuffer); } - catch (ESoundDriver &e) + catch (const ESoundDriver &e) { if (ibuffer != NULL) { delete ibuffer; diff --git a/code/nel/src/sound/sample_bank_manager.cpp b/code/nel/src/sound/sample_bank_manager.cpp index 26b55b25d..374775972 100644 --- a/code/nel/src/sound/sample_bank_manager.cpp +++ b/code/nel/src/sound/sample_bank_manager.cpp @@ -36,7 +36,7 @@ using namespace NLMISC; namespace NLSOUND { -CSampleBankManager::CSampleBankManager(CAudioMixerUser *audioMixer) : m_AudioMixer(audioMixer), m_LoadedSize(NULL) +CSampleBankManager::CSampleBankManager(CAudioMixerUser *audioMixer) : m_AudioMixer(audioMixer), m_LoadedSize(0) { } diff --git a/code/nel/src/sound/simple_sound.cpp b/code/nel/src/sound/simple_sound.cpp index dd69a19bb..405b25264 100644 --- a/code/nel/src/sound/simple_sound.cpp +++ b/code/nel/src/sound/simple_sound.cpp @@ -77,7 +77,7 @@ void CSimpleSound::getSubSoundList(std::vector(this)->getBuffer() == 0) - subsounds.push_back(pair(CStringMapper::unmap(_Buffername)+" (sample)", 0)); + subsounds.push_back(pair(CStringMapper::unmap(_Buffername)+" (sample)", (CSound*)NULL)); } diff --git a/code/nel/src/sound/stdsound.h b/code/nel/src/sound/stdsound.h index a4cc08094..a656fa387 100644 --- a/code/nel/src/sound/stdsound.h +++ b/code/nel/src/sound/stdsound.h @@ -36,6 +36,7 @@ #include #include #include +#include #include "nel/misc/vector.h" #include "nel/misc/path.h" diff --git a/code/nel/tools/3d/anim_builder/anim_builder.cpp b/code/nel/tools/3d/anim_builder/anim_builder.cpp index f210e49a9..e8ec3001e 100644 --- a/code/nel/tools/3d/anim_builder/anim_builder.cpp +++ b/code/nel/tools/3d/anim_builder/anim_builder.cpp @@ -103,7 +103,7 @@ int main(int argc, char* argv[]) animationOptimizer.addLowPrecisionTrack(anim_low_precision_tracks.asString(lpt)); } } - catch(EUnknownVar &) + catch(const EUnknownVar &) { nlwarning("\"anim_low_precision_tracks\" not found in the parameter file. Add \"Finger\" and \"Ponytail\" by default"); animationOptimizer.addLowPrecisionTrack("Finger"); @@ -126,7 +126,7 @@ int main(int argc, char* argv[]) animationOptimizer.setSampleFrameRate(sr); } } - catch(EUnknownVar &) + catch(const EUnknownVar &) { nlwarning("\"anim_sample_rate\" not found in the parameter file. Use Default of 30 fps."); animationOptimizer.setSampleFrameRate(30); @@ -198,7 +198,7 @@ int main(int argc, char* argv[]) nlinfo("Anim skipped: %4d", numSkipped); } - catch (Exception& except) + catch (const Exception& except) { // Error message nlwarning ("ERROR %s\n", except.what()); diff --git a/code/nel/tools/3d/animation_set_builder/animation_set_builder.cpp b/code/nel/tools/3d/animation_set_builder/animation_set_builder.cpp index b5e35a9e3..a423d7ff8 100644 --- a/code/nel/tools/3d/animation_set_builder/animation_set_builder.cpp +++ b/code/nel/tools/3d/animation_set_builder/animation_set_builder.cpp @@ -124,7 +124,7 @@ int main(int argc, char* argv[]) return -1; } } - catch (Exception& e) + catch (const Exception& e) { // Error message fprintf (stderr, "Error: %s\n", e.what()); 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 332e7ebad..2caf5c235 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 @@ -173,7 +173,7 @@ int main(int argc, char *argv[]) // NB: the key name here is the entire file, with the .anim, for easier georges editing. lodBuilder.addAnim(animFileName.c_str(), anim, bakeFrameRate); } - catch(EPathNotFound &) + catch(const EPathNotFound &) { printf("ERROR anim not found %s\n", animFileName.c_str()); delete anim; @@ -186,7 +186,7 @@ int main(int argc, char *argv[]) uint32 shapeId= lodShapeBank.addShape(); *lodShapeBank.getShapeFullAcces(shapeId)= lodBuilder.getLodShape(); } - catch(EUnknownVar &evar) + catch(const EUnknownVar &evar) { nlwarning(evar.what()); // Any other exception will make the program quit. @@ -205,7 +205,7 @@ int main(int argc, char *argv[]) oFile.serial(lodShapeBank); oFile.close(); } - catch (Exception& except) + catch (const Exception& except) { // Error message printf ("ERROR %s.\n Aborting.\n", except.what()); diff --git a/code/nel/tools/3d/build_clodtex/main.cpp b/code/nel/tools/3d/build_clodtex/main.cpp index d92a8f7d2..0d43479dc 100644 --- a/code/nel/tools/3d/build_clodtex/main.cpp +++ b/code/nel/tools/3d/build_clodtex/main.cpp @@ -100,7 +100,7 @@ bool computeOneShape(const char *lodFile, const char *shapeIn, const char *shape COFile dbgF("testDBG.tga"); dbg.writeTGA(dbgF, 32);*/ } - catch(Exception &e) + catch(const Exception &e) { nlwarning("ERROR: %s", e.what()); return false; @@ -179,7 +179,7 @@ int main(int argc, char *argv[]) LodFilters[i]= var.asString(i*2+1); } } - catch(Exception &e) + catch(const Exception &e) { // It is not an error to have a bad config file: files will be copied nlwarning(e.what()); diff --git a/code/nel/tools/3d/build_coarse_mesh/build_coarse_mesh.cpp b/code/nel/tools/3d/build_coarse_mesh/build_coarse_mesh.cpp index 236c2727e..854e7bc18 100644 --- a/code/nel/tools/3d/build_coarse_mesh/build_coarse_mesh.cpp +++ b/code/nel/tools/3d/build_coarse_mesh/build_coarse_mesh.cpp @@ -255,12 +255,12 @@ int main(int argc, char* argv[]) nlwarning ("WARNING no coarse mesh to compute, abort.\n"); } } - catch (EConfigFile &e) + catch (const EConfigFile &e) { // Something goes wrong... catch that nlwarning ("ERROR %s\n", e.what ()); } - catch (Exception &e) + catch (const Exception &e) { // Something goes wrong... catch that nlwarning ("ERROR %s\n", e.what ()); diff --git a/code/nel/tools/3d/build_far_bank/build_far_bank.cpp b/code/nel/tools/3d/build_far_bank/build_far_bank.cpp index be8b48e0e..db49575a7 100644 --- a/code/nel/tools/3d/build_far_bank/build_far_bank.cpp +++ b/code/nel/tools/3d/build_far_bank/build_far_bank.cpp @@ -120,7 +120,7 @@ bool fillTileFar (uint tile, const char* sName, CTileFarBank::TFarType type, CTi // Ok. return true; } - catch (Exception& except) + catch (const Exception& except) { nlwarning ("ERROR %s\n", except.what()); } @@ -409,7 +409,7 @@ int main (int argc, char **argv) nlwarning ("ERROR Can't open file %s for writing\n", argv[2]); } } - catch (Exception& except) + catch (const Exception& except) { nlwarning ("ERROR %s\n", except.what()); } diff --git a/code/nel/tools/3d/build_interface/main.cpp b/code/nel/tools/3d/build_interface/main.cpp index b9e9b44f3..40627bab8 100644 --- a/code/nel/tools/3d/build_interface/main.cpp +++ b/code/nel/tools/3d/build_interface/main.cpp @@ -267,7 +267,7 @@ int main(int nNbArg, char **ppArgs) pBtmp->load(inFile); AllMaps[i] = pBtmp; } - catch (NLMISC::Exception &e) + catch (const NLMISC::Exception &e) { outString (string("ERROR :") + e.what()); return -1; diff --git a/code/nel/tools/3d/build_smallbank/build_smallbank.cpp b/code/nel/tools/3d/build_smallbank/build_smallbank.cpp index 45e995427..888799579 100644 --- a/code/nel/tools/3d/build_smallbank/build_smallbank.cpp +++ b/code/nel/tools/3d/build_smallbank/build_smallbank.cpp @@ -70,7 +70,7 @@ int main(int argc, char* argv[]) } } - catch (Exception& e) + catch (const Exception& e) { // Error nlwarning ("ERROR fatal error: %s", e.what()); diff --git a/code/nel/tools/3d/cluster_viewer/view_cs.cpp b/code/nel/tools/3d/cluster_viewer/view_cs.cpp index bed6a7518..6e19af2f0 100644 --- a/code/nel/tools/3d/cluster_viewer/view_cs.cpp +++ b/code/nel/tools/3d/cluster_viewer/view_cs.cpp @@ -94,7 +94,7 @@ CInstanceGroup* LoadInstanceGroup(const char* sFilename) newIG->serial (file); // All is good } - catch (Exception &) + catch (const Exception &) { // Cannot save the file delete newIG; diff --git a/code/nel/tools/3d/file_info/main.cpp b/code/nel/tools/3d/file_info/main.cpp index 4a14a43c9..306a7fc74 100644 --- a/code/nel/tools/3d/file_info/main.cpp +++ b/code/nel/tools/3d/file_info/main.cpp @@ -331,9 +331,9 @@ void displayInfoFileInStream(FILE *logStream, const char *fileName, const setserial (file); } - catch (Exception &) + catch (const Exception &) { delete newIG; return NULL; @@ -62,7 +62,7 @@ bool SaveInstanceGroup (const char* sFilename, CInstanceGroup *pIG) { pIG->serial (file); } - catch (Exception &) + catch (const Exception &) { return false; } diff --git a/code/nel/tools/3d/ig_elevation/main.cpp b/code/nel/tools/3d/ig_elevation/main.cpp index f0044b651..988cde08e 100644 --- a/code/nel/tools/3d/ig_elevation/main.cpp +++ b/code/nel/tools/3d/ig_elevation/main.cpp @@ -106,7 +106,7 @@ struct SExportOptions CConfigFile::CVar &cvLandFile = cf.getVar("LandFile"); LandFile = cvLandFile.asString(); } - catch (EConfigFile &e) + catch (const EConfigFile &e) { string sTmp = string("ERROR : Error in config file : ") + e.what() + "\n"; outString (sTmp); @@ -173,7 +173,7 @@ CZoneRegion *loadLand (const string &filename) outString (sTmp); } } - catch (Exception& e) + catch (const Exception& e) { string sTmp = string("Error in land file : ") + e.what(); outString (sTmp); @@ -194,7 +194,7 @@ CInstanceGroup* LoadInstanceGroup (const char* sFilename) { newIG->serial (file); } - catch (Exception &) + catch (const Exception &) { // Cannot save the file delete newIG; @@ -220,7 +220,7 @@ void SaveInstanceGroup (const char* sFilename, CInstanceGroup *pIG) { pIG->serial (file); } - catch (Exception &e) + catch (const Exception &e) { outString(string(e.what())); } @@ -339,7 +339,7 @@ int main(int nNbArg, char**ppArgs) HeightMap1 = NULL; } } - catch (Exception &e) + catch (const Exception &e) { string sTmp = string("Cant load height map : ") + options.HeightMapFile1 + " : " + e.what(); outString (sTmp); @@ -365,7 +365,7 @@ int main(int nNbArg, char**ppArgs) HeightMap2 = NULL; } } - catch (Exception &e) + catch (const Exception &e) { string sTmp = string("Cant load height map : ") + options.HeightMapFile2 + " : " + e.what() + "\n"; outString (sTmp); diff --git a/code/nel/tools/3d/ig_info/ig_info.cpp b/code/nel/tools/3d/ig_info/ig_info.cpp index 8de0bcf19..7a765a89c 100644 --- a/code/nel/tools/3d/ig_info/ig_info.cpp +++ b/code/nel/tools/3d/ig_info/ig_info.cpp @@ -83,7 +83,7 @@ int main(int argc, char **argv) printf("TotalCells: %d\n", totalCells); } - catch (std::exception &e) + catch (const std::exception &e) { printf("%s\n", e.what()); } diff --git a/code/nel/tools/3d/ig_lighter/ig_lighter.cpp b/code/nel/tools/3d/ig_lighter/ig_lighter.cpp index f1c30fc20..2a6508399 100644 --- a/code/nel/tools/3d/ig_lighter/ig_lighter.cpp +++ b/code/nel/tools/3d/ig_lighter/ig_lighter.cpp @@ -344,7 +344,7 @@ int main(int argc, char* argv[]) } } - catch (Exception& except) + catch (const Exception& except) { // Error message nlwarning ("ERROR %s\n", except.what()); diff --git a/code/nel/tools/3d/lightmap_optimizer/main.cpp b/code/nel/tools/3d/lightmap_optimizer/main.cpp index 528d85014..7cae0b5f9 100644 --- a/code/nel/tools/3d/lightmap_optimizer/main.cpp +++ b/code/nel/tools/3d/lightmap_optimizer/main.cpp @@ -365,7 +365,7 @@ int main(int nNbArg, char **ppArgs) CMeshBase *pMB = dynamic_cast(mesh.getShapePointer()); AllShapes.push_back (pMB); } - catch (NLMISC::EPathNotFound &e) + catch (const NLMISC::EPathNotFound &e) { outString(string("ERROR: shape not found ")+AllShapeNames[nShp]+" - "+e.what()); return -1; @@ -529,7 +529,7 @@ int main(int nNbArg, char **ppArgs) inFile.open(sTmp2); CBitmap::loadSize(inFile, wRef, hRef); } - catch (NLMISC::Exception &e) + catch (const NLMISC::Exception &e) { outString (string("ERROR :") + e.what()); return -1; @@ -546,7 +546,7 @@ int main(int nNbArg, char **ppArgs) inFile.open(sTmp3); CBitmap::loadSize(inFile, wCur, hCur); } - catch (NLMISC::Exception &) + catch (const NLMISC::Exception &) { } @@ -595,7 +595,7 @@ int main(int nNbArg, char **ppArgs) pBtmp->load(inFile); AllLightmaps[i] = pBtmp; } - catch (NLMISC::Exception &e) + catch (const NLMISC::Exception &e) { outString (string("ERROR :") + e.what()); return -1; @@ -671,7 +671,7 @@ int main(int nNbArg, char **ppArgs) BitmapJ.load (inFile); inFile.close (); } - catch (NLMISC::Exception &e) + catch (const NLMISC::Exception &e) { outString (string("ERROR :") + e.what()); return -1; @@ -883,7 +883,7 @@ int main(int nNbArg, char **ppArgs) meshfile.close (); } } - catch (NLMISC::EPathNotFound &e) + catch (const NLMISC::EPathNotFound &e) { outString(string("ERROR: cannot save shape ")+AllShapeNames[k]+" - "+e.what()); return -1; diff --git a/code/nel/tools/3d/object_viewer_qt/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/CMakeLists.txt index 9341954ab..11196091e 100644 --- a/code/nel/tools/3d/object_viewer_qt/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/CMakeLists.txt @@ -8,6 +8,10 @@ # This tells the application(s) where to fidn the installed data. ADD_DEFINITIONS(-DDATA_DIR="\\"${NL_SHARE_PREFIX}/object_viewer_qt/\\"") +IF(UNIX AND WITH_STATIC) + MESSAGE(FATAL_ERROR "OVQT does not work with static NeL builds on Unix atm.") +ENDIF() + ADD_SUBDIRECTORY(src) INSTALL(DIRECTORY data/ diff --git a/code/nel/tools/3d/object_viewer_qt/doc/ovqt.dox b/code/nel/tools/3d/object_viewer_qt/doc/ovqt.dox index e15e37e5a..b310ad758 100644 --- a/code/nel/tools/3d/object_viewer_qt/doc/ovqt.dox +++ b/code/nel/tools/3d/object_viewer_qt/doc/ovqt.dox @@ -31,7 +31,7 @@ PROJECT_NAME = "Object Viewer Qt" # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = r90 +PROJECT_NUMBER = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. @@ -643,7 +643,7 @@ FILE_PATTERNS = *.c \ # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. -RECURSIVE = NO +RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a diff --git a/code/nel/tools/3d/object_viewer_qt/src/description.h b/code/nel/tools/3d/object_viewer_qt/src/description.h index d22a1918b..a1a041de9 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/description.h +++ b/code/nel/tools/3d/object_viewer_qt/src/description.h @@ -1,6 +1,6 @@ /** @mainpage Object Viewer Qt -@author Dzmitry Kamiahin , (C) 2010 +@author Dzmitry Kamiahin , (C) 2011 @section introduce Introduce @details @@ -15,130 +15,22 @@ The tool can be used in different tasks: - Create and modify micro-vegetation material (.vegetset files) - Viewing landscape (.zonel files) - Dialog allows to specify graphical, sound, search path and landscape settings. - -@section project_structure Overview of the Object Viewer Qt Project Structure -@details -OVQT - consists of several major subsystems. Each subsystem performs its defined part of the task. -Through Modules:: provides access to all other program subsystems. - -Program has the following subsystems: -- @ref Modules - Main modules aggregated all parts of the program. -- @ref NLQT::CConfiguration - is responsible for loading and saving settings from the configuration file. As well as search path of data. -- @ref NLQT::CObjectViewer - main subsystem of the program, which initializes the driver, creates a scene and other supporting elements. -It is a container for loaded models, which can further be viewed and animated. -- @ref NLQT::CMainWindow - is responsible for the GUI. -- @ref NLQT::CParticleEditor - is responsible for the particle systems and provides access to a container that keeps all the loaded particle systems. -And also allows you to view an animation of particle systems, with the ability to control its parameters. -- @ref NLQT::CVegetableEditor - is responsible for the landscape zones and the editor of vegetation. -Allows you to load and view the landscape. Also has the ability to create and edit the parameters of the micro-vegetation. -- @ref NLQT::CSoundSystem - is responsible for the sound in the program. - - -The structure of the GUI in the editor of the particles. -
-This can be useful for new developers who want to add more new dialogs or to improve the functionality of existing dialogues. -Particle Workspace -ParticleWorkspace dialogue uses the technique of model-view. -Using the signal/slot link QTreeView with QStackWidget, Editor properties dialog. -When you select an item in QTreeView, QStackWidget displays the necessary page(PageWidget) where you can edit the element of the particles system. -Each page is made in the designer and has a separate forms(.ui). -In accordance with the recommendations of dialogues design, with a large number of items,every page uses QTabWidget. -In case when there is a great number of controls, and not everything you want to display, -it's used the dynamic creation of tabs. Moreover, each tab uses a separate forms(.ui). - -@section for_new_developer Guide for new developers of the Object Viewer Qt. -@details - First of all, to begin developing dialogues that add new features ovqt, -it is needed to read the documentation Qt libs (http://doc.qt.nokia.com/) and NeL documentation. - - In order to have convenient using of the tool and its further development, -it is expected to make a unified interface that is why all dialogs should adhere to a standard design, -which will be written further. For this goals program provides some additional widgets, -which are recommended to use. As in the development Qt Designer is actively used. -To get access to founded here widgets from the designer,the technique promotion is used, -which can be found here . -
    -
  1. -CEditRangeUIntWidget / CEditRangeIntWidget / CEditRangeFloatWidget -
    -Widgets provides a slider that allows you to specify an integer (or float, depending on which widget used) number within a set range. -The range is also can be set by the user, or for a more accurate selection of numbers, either for receiving large values. -As there may be situations when the range that a user requests,has to be restricted, and widget provides methods that allow you to do so. -

    -CEditRangeIntWidget -
    -CEditRangeFloatWidget -@see -@ref NLQT::CEditRangeUIntWidget, @ref NLQT::CEditRangeIntWidget, @ref NLQT::CEditRangeFloatWidget - -
  2. -CColorEditWidget -
    -Using this widget you can set the color(RGBA) using the four sliders or through the color selection dialog. -

    -CColorEditWidget -@see -@ref NLQT::CColorEditWidget - -
  3. -CDirectionWidget -
    -This widget helps to choose from several preset directions, or to choose a custom one. -

    -CDirectionWidget -@see -@ref NLQT::CDirectionWidget -


- -To further convinience of instrument using dialogues interface is recommended to make as follows. -The most sophisticated tools of the program, should take the form of three dock windows (example shown in the screenshot). -Object Viewer Qt -
    -
  1. -The first dock window - is a control dock window, it should focus all of the control functions of general purpose -(for example: start/stop/pause animations or particles system). -It is recommended to perform of the horizontal type window and placed in the bottom of the main window. -
  2. -The second dock window - is a list or a tree of items. In which selecting of the current element, -which assumes to modify or viewis possible.Operations "add/remove/insert or other" items are recommended to make as a popur menu. -It is recommended to perform of the vertical type window and placed in the left of the main window. -
  3. -The third dock - is an editor for properties of the element that was selected in the list or in the tree of elements. -As all the controls occupy much space or do not fit at all, you have to use tabs QTabWidget, -which in total can contains quite a lot of elements. -For a small number of tabs it is allowed to use both horizontal and vertical location. -But with a large number of tabs, it is necessary to apply the vertical arrangement. -It is recommended to perform of the vertical type of window and placed in the right of the main window. -
-In the simple dialogues do not necessary to use all three windows, but user has to adhere to the recommendations given above as well. -Also, all dialogs must use the qt layout manager. And if you do not use the designer, -make sure you use the qt tools internationalization applications. -

-In ovqt for most dialogs their owner is NLQT::CMainWindow and in its methods creating and initializing all dependent dialogs occur. -For the convenience of the program using, most dialogues are created in the form of docking windows. -Creating all the dialogues are carried out in a private method NLQT::CMainWindow::createDialogs(). -Hence, it is necessary to add operations in this method to create new dialogues. -But we must take into account that at this moment is fully available only one component of the program CConfiguration, -to read the settings from the configuration file. The remaining components of the program are available only after the main window stays visible. -Calling the dialogues going through the menu or the toolbar, usually it is a checkable item. -Adding of the new menu items or items toolbars is need in methods NLQT::CMainWindow::createMenus(), NLQT::CMainWindow::createToolBars(). +- OVQT supports loading third-party plug-ins. @section license_ovqt License Object Viewer Qt @details - Object Viewer Qt +Object Viewer Qt - MMORPG Framework
- Copyright (C) 2010 Dzmitry Kamiahin +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as +published by the Free Software Foundation, either version 3 of the +License, or (at your option) any later version.

- This program is 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 Affero General Public License for more details.

- 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 . +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_manager.h b/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_manager.h index e67c9e588..05d4b832c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_manager.h +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_manager.h @@ -40,7 +40,6 @@ class IPluginSpec; class IPluginManager: public QObject { Q_OBJECT - public: IPluginManager(QObject *parent = 0): QObject(parent) {} virtual ~IPluginManager() {} diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp index 49dcec785..be5f18c74 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp @@ -151,9 +151,9 @@ void CPluginManager::readPluginPaths() { const QDir dir(searchPaths.takeFirst()); #ifdef Q_OS_WIN - const QFileInfoList files = dir.entryInfoList(QStringList() << QString("*.dll"), QDir::Files); + const QFileInfoList files = dir.entryInfoList(QStringList() << QString("ovqt_plugin_*.dll"), QDir::Files); #else - const QFileInfoList files = dir.entryInfoList(QStringList() << QString("*.so"), QDir::Files); + const QFileInfoList files = dir.entryInfoList(QStringList() << QString("libovqt_plugin_*.so"), QDir::Files); #endif Q_FOREACH (const QFileInfo &file, files) pluginsList << file.absoluteFilePath(); @@ -292,4 +292,4 @@ void CPluginManager::deleteAll() } } -}; // namespace NLQT \ No newline at end of file +}; // namespace ExtensionSystem \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.h b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.h index d1a18485b..4ef3b2208 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.h +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.h @@ -74,6 +74,6 @@ private: }; // class CPluginManager -} // namespace NLQT +} // namespace ExtensionSystem #endif // PLUGINMANAGER_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.cpp b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.cpp index 7158c8d9f..d77d90962 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.cpp @@ -266,4 +266,4 @@ bool CPluginSpec::reportError(const QString &err) return false; } -} // namespace NLQT \ No newline at end of file +} // namespace ExtensionSystem \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.h b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.h index e73f3ed93..0cc895ada 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.h +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.h @@ -79,7 +79,7 @@ private: friend class CPluginManager; }; -} // namespace NLQT +} // namespace ExtensionSystem #endif // PLUGINSPEC_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/main.cpp b/code/nel/tools/3d/object_viewer_qt/src/main.cpp index 64cb1fff2..15173fa5c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/main.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/main.cpp @@ -38,6 +38,8 @@ #include #include #include +#include +#include static const char *appNameC = "ObjectViewerQt"; @@ -135,7 +137,7 @@ sint main(int argc, char **argv) QTranslator qtTranslator; QString locale = settings->value("Language", QLocale::system().name()).toString(); QString qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath); - translator.load("object_viewer_qt_" + locale, ":/"); +// translator.load("object_viewer_qt_" + locale, ":/"); qtTranslator.load("qt_" + locale, qtTrPath); app.installTranslator(&translator); app.installTranslator(&qtTranslator); @@ -149,9 +151,9 @@ sint main(int argc, char **argv) pluginManager.setSettings(settings); QStringList pluginPaths; #if !defined(NL_OS_MAC) - pluginPaths << QString("./plugins"); + pluginPaths << settings->value("PluginPath", "./plugins").toString(); #else - pluginPaths << qApp->applicationDirPath() + QString("/../PlugIns/ovqt"); + pluginPaths << settings->value("PluginPath", qApp->applicationDirPath() + QString("/../PlugIns/ovqt")).toString(); #endif pluginManager.setPluginPaths(pluginPaths); @@ -176,6 +178,15 @@ sint main(int argc, char **argv) QString absolutePaths = absolutePluginPaths.absolutePath(); const QString reason = QCoreApplication::translate("Application", "Could not find ovqt_plugin_core in %1").arg(absolutePaths); displayError(msgCoreLoadFailure(reason)); + + QString newPath = QFileDialog::getExistingDirectory(0, QCoreApplication::translate("Application", "Change the plugins path"), QDir::homePath()); + bool ok; + QString text = QInputDialog::getText(0, QCoreApplication::translate("Application", "Enter the plugins path"), + QCoreApplication::translate("Application", "Plugin path:"), QLineEdit::Normal, + newPath, &ok); + if (ok && !text.isEmpty()) + settings->setValue("PluginPath", text); + settings->sync(); return 1; } if (corePlugin->hasError()) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/CMakeLists.txt index d5a792acd..bec71cf94 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/CMakeLists.txt @@ -1,7 +1,9 @@ ADD_SUBDIRECTORY(core) ADD_SUBDIRECTORY(example) ADD_SUBDIRECTORY(ovqt_sheet_builder) +ADD_SUBDIRECTORY(landscape_editor) ADD_SUBDIRECTORY(log) ADD_SUBDIRECTORY(disp_sheet_id) ADD_SUBDIRECTORY(object_viewer) -ADD_SUBDIRECTORY(zone_painter) \ No newline at end of file +ADD_SUBDIRECTORY(zone_painter) +ADD_SUBDIRECTORY(georges_editor) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/CMakeLists.txt index 726cb4a2d..3140f02fb 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/CMakeLists.txt @@ -18,13 +18,18 @@ SET(OVQT_CORE_PLUGIN_HDR core.h main_window.h menu_manager.h + context_manager.h settings_dialog.h search_paths_settings_page.h - plugin_view_dialog.h) + general_settings_page.h + plugin_view_dialog.h +) SET(OVQT_CORE_PLUGIN_UIS settings_dialog.ui plugin_view_dialog.ui - search_paths_settings_page.ui) + general_settings_page.ui + search_paths_settings_page.ui +) SET(OVQT_CORE_PLUGIN_RCS core.qrc) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/context_manager.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/context_manager.cpp new file mode 100644 index 000000000..68e28429d --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/context_manager.cpp @@ -0,0 +1,150 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +// Project includes +#include "context_manager.h" +#include "icontext.h" +#include "main_window.h" + +// NeL includes +#include + +// Qt includes +#include +#include + +namespace Core +{ + +struct ContextManagerPrivate +{ + explicit ContextManagerPrivate(Core::MainWindow *mainWindow, QTabWidget *tabWidget); + Core::MainWindow *m_mainWindow; + QTabWidget *m_tabWidget; + QVector m_contexts; + int m_oldCurrent; +}; + +ContextManagerPrivate::ContextManagerPrivate(Core::MainWindow *mainWindow, QTabWidget *tabWidget) + : m_mainWindow(mainWindow), + m_tabWidget(tabWidget), + m_oldCurrent(-1) +{ +} + +ContextManager::ContextManager(Core::MainWindow *mainWindow, QTabWidget *tabWidget) + : d(new ContextManagerPrivate(mainWindow, tabWidget)) +{ + QObject::connect(d->m_mainWindow->pluginManager(), SIGNAL(objectAdded(QObject *)), + this, SLOT(objectAdded(QObject *))); + QObject::connect(d->m_mainWindow->pluginManager(), SIGNAL(aboutToRemoveObject(QObject *)), + this, SLOT(aboutToRemoveObject(QObject *))); + + QObject::connect(d->m_tabWidget, SIGNAL(currentChanged(int)), this, SLOT(currentTabChanged(int))); +} + +ContextManager::~ContextManager() +{ + delete d; +} + +Core::IContext *ContextManager::currentContext() const +{ + int currentIndex = d->m_tabWidget->currentIndex(); + if (currentIndex < 0) + return 0; + return d->m_contexts.at(currentIndex); +} + +Core::IContext *ContextManager::context(const QString &id) const +{ + const int index = indexOf(id); + if (index >= 0) + return d->m_contexts.at(index); + return 0; +} + +void ContextManager::activateContext(const QString &id) +{ + const int index = indexOf(id); + if (index >= 0) + d->m_tabWidget->setCurrentIndex(index); +} + +void ContextManager::objectAdded(QObject *obj) +{ + IContext *context = qobject_cast(obj); + if (context) + addContextObject(context); +} + +void ContextManager::aboutToRemoveObject(QObject *obj) +{ + IContext *context = qobject_cast(obj); + if (context) + removeContextObject(context); +} + +void ContextManager::addContextObject(IContext *context) +{ + d->m_contexts.push_back(context); + d->m_mainWindow->addContextObject(context); + + QWidget *tabWidget = new QWidget(d->m_tabWidget); + d->m_tabWidget->addTab(tabWidget, context->icon(), context->trName()); + QGridLayout *gridLayout = new QGridLayout(tabWidget); + gridLayout->setObjectName(QString::fromUtf8("gridLayout_") + context->id()); + gridLayout->setContentsMargins(0, 0, 0, 0); + gridLayout->addWidget(context->widget(), 0, 0, 1, 1); +} + +void ContextManager::removeContextObject(IContext *context) +{ + d->m_mainWindow->removeContextObject(context); + + const int index = indexOf(context->id()); + QWidget *widget = d->m_tabWidget->widget(index); + d->m_tabWidget->removeTab(index); + d->m_contexts.remove(index); + delete widget; +} + +void ContextManager::currentTabChanged(int index) +{ + if (index >= 0) + { + IContext *context = d->m_contexts.at(index); + IContext *oldContext = 0; + if (d->m_oldCurrent >= 0) + oldContext = d->m_contexts.at(d->m_oldCurrent); + d->m_oldCurrent = index; + Q_EMIT currentContextChanged(context, oldContext); + } +} + +int ContextManager::indexOf(const QString &id) const +{ + for (int i = 0; i < d->m_contexts.count(); ++i) + { + if (d->m_contexts.at(i)->id() == id) + return i; + } + nlwarning(QString("Warning, no such context: %1").arg(id).toStdString().c_str()); + return -1; +} + +} /* namespace Core */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/context_manager.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/context_manager.h new file mode 100644 index 000000000..7a3658fff --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/context_manager.h @@ -0,0 +1,70 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef CONTEXT_MANAGER_H +#define CONTEXT_MANAGER_H + +// Project includes +#include "core_global.h" + +// Qt includes +#include + +QT_BEGIN_NAMESPACE +class QTabWidget; +QT_END_NAMESPACE + +namespace Core +{ +class IContext; +class MainWindow; +struct ContextManagerPrivate; + +class CORE_EXPORT ContextManager : public QObject +{ + Q_OBJECT + +public: + explicit ContextManager(Core::MainWindow *mainWindow, QTabWidget *tabWidget); + virtual ~ContextManager(); + + Core::IContext *currentContext() const; + Core::IContext *context(const QString &id) const; + +Q_SIGNALS: + // the default argument '=0' is important for connects without the oldContext argument. + void currentContextChanged(Core::IContext *context, Core::IContext *oldContext = 0); + +public Q_SLOTS: + void activateContext(const QString &id); + +private Q_SLOTS: + void objectAdded(QObject *obj); + void aboutToRemoveObject(QObject *obj); + void addContextObject(IContext *context); + void removeContextObject(IContext *context); + void currentTabChanged(int index); + +private: + int indexOf(const QString &id) const; + + ContextManagerPrivate *d; +}; + +} // namespace Core + +#endif // CONTEXT_MANAGER_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.cpp index 6c681f15a..fa61b5700 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.cpp @@ -18,6 +18,7 @@ #include "core.h" #include "imenu_manager.h" +#include "context_manager.h" #include "main_window.h" #include "../../extension_system/iplugin_manager.h" @@ -54,6 +55,11 @@ IMenuManager *CoreImpl::menuManager() const return m_mainWindow->menuManager(); } +ContextManager *CoreImpl::contextManager() const +{ + return m_mainWindow->contextManager(); +} + QSettings *CoreImpl::settings() const { return m_mainWindow->settings(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.h index d3b25b918..2613a06a5 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.h @@ -38,6 +38,7 @@ public: QWidget *parent = 0); virtual IMenuManager *menuManager() const; + virtual ContextManager *contextManager() const; virtual QSettings *settings() const; virtual QMainWindow *mainWindow() const; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.qrc b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.qrc index 85b4702b0..a4c87d29c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.qrc +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.qrc @@ -6,6 +6,9 @@ icons/ic_nel_down_item.png icons/ic_nel_generic_settings.png icons/ic_nel_open.png + icons/ic_nel_new.png + icons/ic_nel_save.png + icons/ic_nel_save_as.png icons/ic_nel_path_settings.png icons/ic_nel_pill.png icons/ic_nel_reset_all.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_constants.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_constants.h index 18dc11c87..2acf4f731 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_constants.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_constants.h @@ -1,80 +1,117 @@ -// Object Viewer Qt - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// Copyright (C) 2010 Dzmitry Kamiahin -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -#ifndef CORE_CONSTANTS_H -#define CORE_CONSTANTS_H - -namespace Core -{ -namespace Constants -{ - -const char * const OVQT_VERSION_LONG = "0.0.1"; -const char * const OVQT_VENDOR = "Dzmitry Kamiahin"; -const char * const OVQT_YEAR = "2010, 2011"; -const char * const OVQT_CORE_PLUGIN = "Core"; - -//mainwindow -const char * const MAIN_WINDOW = "ObjectViewerQt.MainWindow"; - -//menubar -const char * const MENU_BAR = "ObjectViewerQt.MenuBar"; - -//menus -const char * const M_FILE = "ObjectViewerQt.Menu.File"; -const char * const M_EDIT = "ObjectViewerQt.Menu.Edit"; -const char * const M_VIEW = "ObjectViewerQt.Menu.View"; -const char * const M_SCENE = "ObjectViewerQt.Menu.Scene"; -const char * const M_TOOLS = "ObjectViewerQt.Menu.Tools"; -const char * const M_WINDOW = "ObjectViewerQt.Menu.Window"; -const char * const M_HELP = "ObjectViewerQt.Menu.Help"; - -const char * const M_SHEET = "ObjectViewerQt.Menu.Sheet"; - -//actions -const char * const NEW = "ObjectViewerQt.New"; -const char * const OPEN = "ObjectViewerQt.Open"; -const char * const EXIT = "ObjectViewerQt.Exit"; - -const char * const SETTINGS = "ObjectViewerQt.Settings"; -const char * const TOGGLE_FULLSCREEN = "ObjectViewerQt.ToggleFullScreen"; - -const char * const CLOSE = "ObjectViewerQt.Close"; -const char * const CLOSEALL = "ObjectViewerQt.CloseAll"; -const char * const CLOSEOTHERS = "ObjectViewerQt.CloseOthers"; -const char * const ABOUT = "ObjectViewerQt.About"; -const char * const ABOUT_PLUGINS = "ObjectViewerQt.AboutPlugins"; -const char * const ABOUT_QT = "ObjectViewerQt.AboutQt"; - -//settings -const char * const DATA_PATH_SECTION = "DataPath"; -const char * const SEARCH_PATHS = "SearchPaths"; -const char * const RECURSIVE_SEARCH_PATHS = "RecursiveSearchPathes"; -const char * const LEVELDESIGN_PATH = "LevelDesignPath"; -const char * const ASSETS_PATH = "LevelDesignPath"; - -//resources -const char * const ICON_NEL = ":/core/images/nel.png"; -const char * const ICON_SETTINGS = ":/core/images/preferences.png"; -const char * const ICON_PILL = ":/core/icons/ic_nel_pill.png"; -const char * const ICON_OPEN = ":/core/icons/ic_nel_open.png"; -const char * const ICON_CRASH = ":/core/icons/ic_nel_crash.png"; - -} // namespace Constants -} // namespace Core - -#endif // CORE_CONSTANTS_H +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2010 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef CORE_CONSTANTS_H +#define CORE_CONSTANTS_H + +namespace Core +{ +namespace Constants +{ + +const char * const OVQT_VERSION_LONG = "0.1"; +const char * const OVQT_VENDOR = "Ryzom Core"; +const char * const OVQT_YEAR = "2010, 2011"; +const char * const OVQT_CORE_PLUGIN = "Core"; + +//mainwindow +const char * const MAIN_WINDOW = "ObjectViewerQt.MainWindow"; + +//menubar +const char * const MENU_BAR = "ObjectViewerQt.MenuBar"; + +//menus +const char * const M_FILE = "ObjectViewerQt.Menu.File"; +const char * const M_EDIT = "ObjectViewerQt.Menu.Edit"; +const char * const M_VIEW = "ObjectViewerQt.Menu.View"; +const char * const M_SCENE = "ObjectViewerQt.Menu.Scene"; +const char * const M_TOOLS = "ObjectViewerQt.Menu.Tools"; +const char * const M_WINDOW = "ObjectViewerQt.Menu.Window"; +const char * const M_HELP = "ObjectViewerQt.Menu.Help"; + +const char * const M_FILE_RECENTFILES = "ObjectViewerQt.Menu.File.RecentFiles"; +const char * const M_SHEET = "ObjectViewerQt.Menu.Sheet"; + +//actions +const char * const NEW = "ObjectViewerQt.New"; +const char * const OPEN = "ObjectViewerQt.Open"; +const char * const SAVE = "ObjectViewerQt.Save"; +const char * const SAVE_AS = "ObjectViewerQt.SaveAs"; +const char * const SAVE_ALL = "ObjectViewerQt.SaveAll"; +const char * const EXIT = "ObjectViewerQt.Exit"; + +const char * const UNDO = "ObjectViewerQt.Undo"; +const char * const REDO = "ObjectViewerQt.Redo"; +const char * const CUT = "ObjectViewerQt.Cut"; +const char * const COPY = "ObjectViewerQt.Copy"; +const char * const PASTE = "ObjectViewerQt.Paste"; +const char * const DEL = "ObjectViewerQt.Del"; +const char * const FIND = "ObjectViewerQt.Find"; +const char * const SELECT_ALL = "ObjectViewerQt.SelectAll"; +const char * const GOTO_POS = "ObjectViewerQt.Goto"; + +const char * const SETTINGS = "ObjectViewerQt.Settings"; +const char * const TOGGLE_FULLSCREEN = "ObjectViewerQt.ToggleFullScreen"; + +const char * const CLOSE = "ObjectViewerQt.Close"; +const char * const CLOSEALL = "ObjectViewerQt.CloseAll"; +const char * const CLOSEOTHERS = "ObjectViewerQt.CloseOthers"; +const char * const ABOUT = "ObjectViewerQt.About"; +const char * const ABOUT_PLUGINS = "ObjectViewerQt.AboutPlugins"; +const char * const ABOUT_QT = "ObjectViewerQt.AboutQt"; + +//settings +const char * const SETTINGS_CATEGORY_GENERAL = "general"; +const char * const SETTINGS_CATEGORY_GENERAL_ICON = ":/icons/ic_nel_generic_settings.png"; +const char * const SETTINGS_TR_CATEGORY_GENERAL = QT_TR_NOOP("General"); + +const char * const MAIN_WINDOW_SECTION = "MainWindow"; +const char * const MAIN_WINDOW_STATE = "WindowState"; +const char * const MAIN_WINDOW_GEOMETRY = "WindowGeometry"; +const char * const QT_STYLE = "QtStyle"; +const char * const QT_PALETTE = "QtPalette"; + +const char * const LANGUAGE = "Language"; +const char * const PLUGINS_PATH = "PluginPath"; +const char * const DATA_PATH_SECTION = "DataPath"; +const char * const SEARCH_PATHS = "SearchPaths"; +const char * const RECURSIVE_SEARCH_PATHS = "RecursiveSearchPathes"; +const char * const LEVELDESIGN_PATH = "LevelDesignPath"; +const char * const ASSETS_PATH = "AssetsPath"; +const char * const REMAP_EXTENSIONS = "RemapExtensions"; + +const char * const LOG_SECTION = "LogSettings"; +const char * const LOG_ERROR = "LogError"; +const char * const LOG_WARNING = "LogWarning"; +const char * const LOG_DEBUG = "LogDebug"; +const char * const LOG_ASSERT = "LogAssert"; +const char * const LOG_INFO = "LogInfo"; + +//resources +const char * const ICON_NEL = ":/core/images/nel.png"; +const char * const ICON_SETTINGS = ":/core/images/preferences.png"; +const char * const ICON_PILL = ":/core/icons/ic_nel_pill.png"; +const char * const ICON_OPEN = ":/core/icons/ic_nel_open.png"; +const char * const ICON_NEW = ":/core/icons/ic_nel_new.png"; +const char * const ICON_SAVE = ":/core/icons/ic_nel_save.png"; +const char * const ICON_SAVE_AS = ":/core/icons/ic_nel_save_as.png"; +const char * const ICON_CRASH = ":/core/icons/ic_nel_crash.png"; + +} // namespace Constants +} // namespace Core + +#endif // CORE_CONSTANTS_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.cpp index 6d051d64d..92e776068 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.cpp @@ -20,8 +20,8 @@ #include "settings_dialog.h" #include "core_constants.h" #include "search_paths_settings_page.h" +#include "general_settings_page.h" #include "../../extension_system/iplugin_spec.h" -#include "qtwin.h" // NeL includes #include "nel/misc/debug.h" @@ -42,37 +42,40 @@ CorePlugin::CorePlugin() CorePlugin::~CorePlugin() { - Q_FOREACH(QObject *obj, _autoReleaseObjects) + Q_FOREACH(QObject *obj, m_autoReleaseObjects) { - _plugMan->removeObject(obj); + m_plugMan->removeObject(obj); } - qDeleteAll(_autoReleaseObjects); - _autoReleaseObjects.clear(); + qDeleteAll(m_autoReleaseObjects); + m_autoReleaseObjects.clear(); - delete _mainWindow; + delete m_mainWindow; } bool CorePlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) { Q_UNUSED(errorString); - _plugMan = pluginManager; + m_plugMan = pluginManager; - _mainWindow = new MainWindow(pluginManager); - /*if (QtWin::isCompositionEnabled()) - { - QtWin::extendFrameIntoClientArea(_mainWindow); - _mainWindow->setContentsMargins(0, 0, 0, 0); - }*/ - bool success = _mainWindow->initialize(errorString); - CSearchPathsSettingsPage *serchPathPage = new CSearchPathsSettingsPage(this); - serchPathPage->applySearchPaths(); - addAutoReleasedObject(serchPathPage); + m_mainWindow = new MainWindow(pluginManager); + bool success = m_mainWindow->initialize(errorString); + + GeneralSettingsPage *generalSettings = new GeneralSettingsPage(this); + CSearchPathsSettingsPage *searchPathPage = new CSearchPathsSettingsPage(false, this); + CSearchPathsSettingsPage *recureseSearchPathPage = new CSearchPathsSettingsPage(true, this); + + generalSettings->applyGeneralSettings(); + searchPathPage->applySearchPaths(); + recureseSearchPathPage->applySearchPaths(); + addAutoReleasedObject(generalSettings); + addAutoReleasedObject(searchPathPage); + addAutoReleasedObject(recureseSearchPathPage); return success; } void CorePlugin::extensionsInitialized() { - _mainWindow->extensionsInitialized(); + m_mainWindow->extensionsInitialized(); } void CorePlugin::shutdown() @@ -86,7 +89,7 @@ void CorePlugin::setNelContext(NLMISC::INelContext *nelContext) // This only applies to platforms without PIC, e.g. Windows. nlassert(!NLMISC::INelContext::isContextInitialised()); #endif // NL_OS_WINDOWS - _LibContext = new NLMISC::CLibraryContext(*nelContext); + m_libContext = new NLMISC::CLibraryContext(*nelContext); } QString CorePlugin::name() const @@ -116,8 +119,8 @@ QStringList CorePlugin::dependencies() const void CorePlugin::addAutoReleasedObject(QObject *obj) { - _plugMan->addObject(obj); - _autoReleaseObjects.prepend(obj); + m_plugMan->addObject(obj); + m_autoReleaseObjects.prepend(obj); } Q_EXPORT_PLUGIN(CorePlugin) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.h index ef590e1fc..5c95d22c9 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.h @@ -63,16 +63,16 @@ public: ExtensionSystem::IPluginManager *pluginManager() const { - return _plugMan; + return m_plugMan; } protected: - NLMISC::CLibraryContext *_LibContext; + NLMISC::CLibraryContext *m_libContext; private: - ExtensionSystem::IPluginManager *_plugMan; - MainWindow *_mainWindow; - QList _autoReleaseObjects; + ExtensionSystem::IPluginManager *m_plugMan; + MainWindow *m_mainWindow; + QList m_autoReleaseObjects; }; } // namespace Core diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.cpp new file mode 100644 index 000000000..51da80f67 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.cpp @@ -0,0 +1,192 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +// Project includes +#include "general_settings_page.h" +#include "core_constants.h" +#include "icore.h" + +// NeL includes +#include + +// Qt includes +#include +#include +#include +#include +#include +#include + +namespace Core +{ + +GeneralSettingsPage::GeneralSettingsPage(QObject *parent) + : IOptionsPage(parent), + m_page(0) +{ + m_originalPalette = QApplication::palette(); +} + +GeneralSettingsPage::~GeneralSettingsPage() +{ +} + +QString GeneralSettingsPage::id() const +{ + return QLatin1String("general_settings"); +} + +QString GeneralSettingsPage::trName() const +{ + return tr("General"); +} + +QString GeneralSettingsPage::category() const +{ + return QLatin1String(Constants::SETTINGS_CATEGORY_GENERAL); +} + +QString GeneralSettingsPage::trCategory() const +{ + return tr(Constants::SETTINGS_TR_CATEGORY_GENERAL); +} + +QIcon GeneralSettingsPage::categoryIcon() const +{ + return QIcon(); +} + +void GeneralSettingsPage::applyGeneralSettings() +{ + QSettings *settings = Core::ICore::instance()->settings(); + + settings->beginGroup(Constants::MAIN_WINDOW_SECTION); + QApplication::setStyle(QStyleFactory::create(settings->value(Constants::QT_STYLE, "").toString())); + + if (settings->value(Constants::QT_PALETTE, true).toBool()) + QApplication::setPalette(QApplication::style()->standardPalette()); + else + QApplication::setPalette(m_originalPalette); + settings->endGroup(); +} + +QWidget *GeneralSettingsPage::createPage(QWidget *parent) +{ + m_page = new QWidget(parent); + m_ui.setupUi(m_page); + + readSettings(); + connect(m_ui.languageComboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(changeLanguage(QString))); + connect(m_ui.pluginsPathButton, SIGNAL(clicked()), this, SLOT(setPluginsPath())); + connect(m_ui.leveldesignPathButton, SIGNAL(clicked()), this, SLOT(setLevelDesignPath())); + connect(m_ui.assetsPathButton, SIGNAL(clicked()), this, SLOT(setAssetsPath())); + return m_page; +} + +void GeneralSettingsPage::apply() +{ + writeSettings(); + applyGeneralSettings(); +} + +void GeneralSettingsPage::finish() +{ + delete m_page; + m_page = 0; +} + +void GeneralSettingsPage::changeLanguage(const QString &lang) +{ + QMessageBox::information(0, tr("Restart required"), + tr("The language change will take effect after a restart of Object Viewer Qt.")); +} + +void GeneralSettingsPage::setPluginsPath() +{ + QString newPath = QFileDialog::getExistingDirectory(0, tr("Set the plugins path"), + m_ui.pluginsPathLineEdit->text()); + if (!newPath.isEmpty()) + { + m_ui.pluginsPathLineEdit->setText(newPath); + } +} + +void GeneralSettingsPage::setLevelDesignPath() +{ + QString newPath = QFileDialog::getExistingDirectory(0, tr("Set the level design path"), + m_ui.leveldesignPathLineEdit->text()); + if (!newPath.isEmpty()) + { + m_ui.leveldesignPathLineEdit->setText(newPath); + } +} + +void GeneralSettingsPage::setAssetsPath() +{ + QString newPath = QFileDialog::getExistingDirectory(0, tr("Set the assets path"), + m_ui.assetsPathLineEdit->text()); + if (!newPath.isEmpty()) + { + m_ui.assetsPathLineEdit->setText(newPath); + } +} + +void GeneralSettingsPage::readSettings() +{ + QSettings *settings = Core::ICore::instance()->settings(); + + m_ui.pluginsPathLineEdit->setText(settings->value(Core::Constants::PLUGINS_PATH, "./plugins").toString()); + + settings->beginGroup(Constants::MAIN_WINDOW_SECTION); + m_ui.styleComboBox->addItems(QStyleFactory::keys()); + QString style = settings->value(Constants::QT_STYLE, "").toString(); + if (style == "") + m_ui.styleComboBox->setCurrentIndex(0); + else + m_ui.styleComboBox->setCurrentIndex(m_ui.styleComboBox->findText(style)); + m_ui.paletteCheckBox->setChecked(settings->value(Constants::QT_PALETTE, true).toBool()); + settings->endGroup(); + + QStringList paths; + settings->beginGroup(Core::Constants::DATA_PATH_SECTION); + m_ui.leveldesignPathLineEdit->setText(settings->value(Core::Constants::LEVELDESIGN_PATH, "l:/leveldesign").toString()); + m_ui.assetsPathLineEdit->setText(settings->value(Core::Constants::ASSETS_PATH, "w:/database").toString()); + settings->endGroup(); +} + +void GeneralSettingsPage::writeSettings() +{ + QSettings *settings = Core::ICore::instance()->settings(); + + settings->setValue(Core::Constants::PLUGINS_PATH, m_ui.pluginsPathLineEdit->text()); + + settings->beginGroup(Constants::MAIN_WINDOW_SECTION); + if (m_ui.styleComboBox->currentIndex() == 0) + settings->setValue(Constants::QT_STYLE, ""); + else + settings->setValue(Constants::QT_STYLE, m_ui.styleComboBox->currentText()); + settings->setValue(Constants::QT_PALETTE, m_ui.paletteCheckBox->isChecked()); + settings->endGroup(); + + settings->beginGroup(Core::Constants::DATA_PATH_SECTION); + settings->setValue(Core::Constants::LEVELDESIGN_PATH, m_ui.leveldesignPathLineEdit->text()); + settings->setValue(Core::Constants::ASSETS_PATH, m_ui.assetsPathLineEdit->text()); + settings->endGroup(); + settings->sync(); +} + +} /* namespace Core */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.h new file mode 100644 index 000000000..2fbcb842a --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.h @@ -0,0 +1,72 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + + +#ifndef GENERAL_SETTINGS_PAGE_H +#define GENERAL_SETTINGS_PAGE_H + +#include + +#include "ioptions_page.h" + +#include "ui_general_settings_page.h" + +class QWidget; + +namespace Core +{ +/** +@class GeneralSettingsPage +*/ +class GeneralSettingsPage : public Core::IOptionsPage +{ + Q_OBJECT + +public: + GeneralSettingsPage(QObject *parent = 0); + ~GeneralSettingsPage(); + + QString id() const; + QString trName() const; + QString category() const; + QString trCategory() const; + QIcon categoryIcon() const; + QWidget *createPage(QWidget *parent); + + void apply(); + void finish(); + + void applyGeneralSettings(); + +private Q_SLOTS: + void changeLanguage(const QString &lang); + void setPluginsPath(); + void setLevelDesignPath(); + void setAssetsPath(); + +private: + void readSettings(); + void writeSettings(); + + QPalette m_originalPalette; + QWidget *m_page; + Ui::GeneralSettingsPage m_ui; +}; + +} // namespace Core + +#endif // GENERAL_SETTINGS_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.ui new file mode 100644 index 000000000..d2aa042e3 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.ui @@ -0,0 +1,199 @@ + + + GeneralSettingsPage + + + + 0 + 0 + 267 + 282 + + + + Form + + + + 6 + + + 3 + + + + + Qt Style + + + + 6 + + + 6 + + + + + + default + + + + + + + + Use style's standard palette + + + + + + + + + + Language + + + + 6 + + + + + false + + + + English + + + + + German + + + + + French + + + + + Russian + + + + + + + + + + + Paths + + + + 6 + + + 6 + + + + + Plugins path: + + + + + + + + 0 + 0 + + + + + + + + ... + + + + + + + Level design path: + + + + + + + + 0 + 0 + + + + + + + + ... + + + + + + + Assets path: + + + + + + + + 0 + 0 + + + + + + + + ... + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_new.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_new.png new file mode 100644 index 000000000..159e3e18e Binary files /dev/null and b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_new.png differ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_save.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_save.png new file mode 100644 index 000000000..5aeb3bbe9 Binary files /dev/null and b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_save.png differ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_save_as.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_save_as.png new file mode 100644 index 000000000..6cb71a334 Binary files /dev/null and b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icons/ic_nel_save_as.png differ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icontext.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icontext.h index 776246d8d..8af601418 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icontext.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icontext.h @@ -28,6 +28,7 @@ QT_BEGIN_NAMESPACE class QWidget; +class QUndoStack; QT_END_NAMESPACE namespace Core @@ -56,6 +57,10 @@ public: /// The widget will be destroyed by the widget hierarchy when the main window closes virtual QWidget *widget() = 0; + + virtual QUndoStack *undoStack() = 0; + + virtual void open() = 0; }; } // namespace Core diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icore.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icore.h index 8f0c5b4ca..13b22bfa5 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icore.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icore.h @@ -36,6 +36,7 @@ class IPluginManager; namespace Core { class IMenuManager; +class ContextManager; class CORE_EXPORT ICore : public QObject { @@ -52,6 +53,7 @@ public: QWidget *parent = 0) = 0; virtual IMenuManager *menuManager() const = 0; + virtual ContextManager *contextManager() const = 0; virtual QSettings *settings() const = 0; virtual QMainWindow *mainWindow() const = 0; @@ -59,6 +61,7 @@ public: virtual ExtensionSystem::IPluginManager *pluginManager() const = 0; Q_SIGNALS: + void changeSettings(); void closeMainWindow(); }; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/ioptions_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/ioptions_page.h index 74692833a..4d9ed6fda 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/ioptions_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/ioptions_page.h @@ -27,6 +27,7 @@ QT_BEGIN_NAMESPACE class QWidget; +class QIcon; QT_END_NAMESPACE namespace Core @@ -56,6 +57,8 @@ public: /// trCategory() is the translated category virtual QString trCategory() const = 0; + virtual QIcon categoryIcon() const = 0; + /// createPage() is called to retrieve the widget to show in the preferences dialog /// The widget will be destroyed by the widget hierarchy when the dialog closes virtual QWidget *createPage(QWidget *parent) = 0; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp index 44f415a25..21334f7ea 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp @@ -20,6 +20,7 @@ #include "icontext.h" #include "icore_listener.h" #include "menu_manager.h" +#include "context_manager.h" #include "core.h" #include "core_constants.h" #include "settings_dialog.h" @@ -38,8 +39,10 @@ MainWindow::MainWindow(ExtensionSystem::IPluginManager *pluginManager, QWidget * : QMainWindow(parent), m_pluginManager(0), m_menuManager(0), + m_contextManager(0), m_coreImpl(0), m_lastDir("."), + m_undoGroup(0), m_settings(0) { QCoreApplication::setApplicationName(QLatin1String("ObjectViewerQt")); @@ -54,16 +57,27 @@ MainWindow::MainWindow(ExtensionSystem::IPluginManager *pluginManager, QWidget * m_settings = m_pluginManager->settings(); m_coreImpl = new CoreImpl(this); +#ifdef Q_WS_MAC + m_menuBar = new QMenuBar(0); +#else + m_menuBar = new QMenuBar(this); + setMenuBar(m_menuBar); +#endif + m_menuManager = new MenuManager(this); - m_menuManager->setMenuBar(menuBar()); + m_menuManager->setMenuBar(m_menuBar); m_tabWidget = new QTabWidget(this); m_tabWidget->setTabPosition(QTabWidget::South); - m_tabWidget->setMovable(true); + m_tabWidget->setMovable(false); + m_tabWidget->setDocumentMode(true); setCentralWidget(m_tabWidget); + m_contextManager = new ContextManager(this, m_tabWidget); + setDockNestingEnabled(true); m_originalPalette = QApplication::palette(); + m_undoGroup = new QUndoGroup(this); createDialogs(); createActions(); @@ -91,15 +105,11 @@ bool MainWindow::initialize(QString *errorString) void MainWindow::extensionsInitialized() { - QList listContexts = m_pluginManager->getObjects(); - - Q_FOREACH(IContext *context, listContexts) - { - addContextObject(context); - } - - connect(m_pluginManager, SIGNAL(objectAdded(QObject *)), this, SLOT(checkObject(QObject *))); readSettings(); + connect(m_contextManager, SIGNAL(currentContextChanged(Core::IContext*)), + this, SLOT(updateContext(Core::IContext*))); + if (m_contextManager->currentContext() != NULL) + updateContext(m_contextManager->currentContext()); show(); } @@ -108,6 +118,11 @@ IMenuManager *MainWindow::menuManager() const return m_menuManager; } +ContextManager *MainWindow::contextManager() const +{ + return m_contextManager; +} + QSettings *MainWindow::settings() const { return m_settings; @@ -118,11 +133,69 @@ ExtensionSystem::IPluginManager *MainWindow::pluginManager() const return m_pluginManager; } -void MainWindow::checkObject(QObject *obj) +void MainWindow::addContextObject(IContext *context) { - IContext *context = qobject_cast(obj); - if (context) - addContextObject(context); + m_undoGroup->addStack(context->undoStack()); +} + +void MainWindow::removeContextObject(IContext *context) +{ + m_undoGroup->removeStack(context->undoStack()); +} + +void MainWindow::open() +{ + m_contextManager->currentContext()->open(); +} + +void MainWindow::newFile() +{ +} + +void MainWindow::save() +{ +} + +void MainWindow::saveAs() +{ +} + +void MainWindow::saveAll() +{ +} + +void MainWindow::cut() +{ +} + +void MainWindow::copy() +{ +} + +void MainWindow::paste() +{ +} + +void MainWindow::del() +{ +} + +void MainWindow::find() +{ +} + +void MainWindow::gotoPos() +{ +} + +void MainWindow::setFullScreen(bool enabled) +{ + if (bool(windowState() & Qt::WindowFullScreen) == enabled) + return; + if (enabled) + setWindowState(windowState() | Qt::WindowFullScreen); + else + setWindowState(windowState() & ~Qt::WindowFullScreen); } bool MainWindow::showOptionsDialog(const QString &group, @@ -133,7 +206,10 @@ bool MainWindow::showOptionsDialog(const QString &group, parent = this; CSettingsDialog settingsDialog(m_pluginManager, group, page, parent); settingsDialog.show(); - return settingsDialog.execDialog(); + bool ok = settingsDialog.execDialog(); + if (ok) + Q_EMIT m_coreImpl->changeSettings(); + return ok; } void MainWindow::about() @@ -143,6 +219,11 @@ void MainWindow::about() "

Ryzom Core team

Compiled on %1 %2").arg(__DATE__).arg(__TIME__)); } +void MainWindow::updateContext(Core::IContext *context) +{ + m_undoGroup->setActiveStack(context->undoStack()); +} + void MainWindow::closeEvent(QCloseEvent *event) { QList listeners = m_pluginManager->getObjects(); @@ -160,24 +241,41 @@ void MainWindow::closeEvent(QCloseEvent *event) event->accept(); } -void MainWindow::addContextObject(IContext *context) -{ - QWidget *tabWidget = new QWidget(m_tabWidget); - m_tabWidget->addTab(tabWidget, context->icon(), context->trName()); - QGridLayout *gridLayout = new QGridLayout(tabWidget); - gridLayout->setObjectName(QString::fromUtf8("gridLayout_") + context->id()); - gridLayout->setContentsMargins(0, 0, 0, 0); - gridLayout->addWidget(context->widget(), 0, 0, 1, 1); -} - void MainWindow::createActions() { + m_newAction = new QAction(tr("&New"), this); + m_newAction->setIcon(QIcon(Constants::ICON_NEW)); + m_newAction->setShortcut(QKeySequence::New); + menuManager()->registerAction(m_newAction, Constants::NEW); + connect(m_newAction, SIGNAL(triggered()), this, SLOT(newFile())); + m_newAction->setEnabled(false); + m_openAction = new QAction(tr("&Open..."), this); m_openAction->setIcon(QIcon(Constants::ICON_OPEN)); m_openAction->setShortcut(QKeySequence::Open); m_openAction->setStatusTip(tr("Open an existing file")); menuManager()->registerAction(m_openAction, Constants::OPEN); -// connect(m_openAction, SIGNAL(triggered()), this, SLOT(open())); + connect(m_openAction, SIGNAL(triggered()), this, SLOT(open())); + + m_saveAction = new QAction(tr("&Save"), this); + m_saveAction->setIcon(QIcon(Constants::ICON_SAVE)); + m_saveAction->setShortcut(QKeySequence::Save); + menuManager()->registerAction(m_saveAction, Constants::SAVE); + connect(m_saveAction, SIGNAL(triggered()), this, SLOT(save())); + m_saveAction->setEnabled(false); + + m_saveAsAction = new QAction(tr("Save &As..."), this); + m_saveAsAction->setIcon(QIcon(Constants::ICON_SAVE_AS)); + m_saveAsAction->setShortcut(QKeySequence::SaveAs); + menuManager()->registerAction(m_saveAsAction, Constants::SAVE_AS); + connect(m_saveAsAction, SIGNAL(triggered()), this, SLOT(saveAs())); + m_saveAsAction->setEnabled(false); + + m_saveAllAction = new QAction(tr("&Save A&ll"), this); + m_saveAllAction->setShortcut(QKeySequence::SelectAll); + menuManager()->registerAction(m_saveAllAction, Constants::SAVE_ALL); + connect(m_saveAllAction, SIGNAL(triggered()), this, SLOT(saveAll())); + m_saveAllAction->setEnabled(false); m_exitAction = new QAction(tr("E&xit"), this); m_exitAction->setShortcut(QKeySequence(tr("Ctrl+Q"))); @@ -185,6 +283,54 @@ void MainWindow::createActions() menuManager()->registerAction(m_exitAction, Constants::EXIT); connect(m_exitAction, SIGNAL(triggered()), this, SLOT(close())); + m_cutAction = new QAction(tr("Cu&t"), this); + m_cutAction->setShortcut(QKeySequence::Cut); + menuManager()->registerAction(m_cutAction, Constants::CUT); + connect(m_cutAction, SIGNAL(triggered()), this, SLOT(cut())); + m_cutAction->setEnabled(false); + + m_copyAction = new QAction(tr("&Copy"), this); + m_copyAction->setShortcut(QKeySequence::Copy); + menuManager()->registerAction(m_copyAction, Constants::COPY); + connect(m_copyAction, SIGNAL(triggered()), this, SLOT(copy())); + m_copyAction->setEnabled(false); + + m_pasteAction = new QAction(tr("&Paste"), this); + m_pasteAction->setShortcut(QKeySequence::Paste); + menuManager()->registerAction(m_pasteAction, Constants::PASTE); + connect(m_pasteAction, SIGNAL(triggered()), this, SLOT(paste())); + m_pasteAction->setEnabled(false); + + m_delAction = new QAction(tr("&Delete"), this); + m_delAction->setShortcut(QKeySequence::Delete); + menuManager()->registerAction(m_delAction, Constants::DEL); + connect(m_delAction, SIGNAL(triggered()), this, SLOT(del())); + m_delAction->setEnabled(false); + + m_selectAllAction = new QAction(tr("Select &All"), this); + m_selectAllAction->setShortcut(QKeySequence::SelectAll); + menuManager()->registerAction(m_selectAllAction, Constants::SELECT_ALL); + connect(m_selectAllAction, SIGNAL(triggered()), this, SLOT(selectAll())); + m_selectAllAction->setEnabled(false); + + m_findAction = new QAction(tr("&Find"), this); + m_findAction->setShortcut(QKeySequence::Find); + menuManager()->registerAction(m_findAction, Constants::FIND); + connect(m_findAction, SIGNAL(triggered()), this, SLOT(find())); + m_findAction->setEnabled(false); + + m_gotoAction = new QAction(tr("&Go To.."), this); + m_gotoAction->setShortcut(QKeySequence(tr("Ctrl+G"))); + menuManager()->registerAction(m_gotoAction, Constants::GOTO_POS); + connect(m_gotoAction, SIGNAL(triggered()), this, SLOT(gotoPos())); + m_gotoAction->setEnabled(false); + + m_fullscreenAction = new QAction(tr("Fullscreen"), this); + m_fullscreenAction->setCheckable(true); + m_fullscreenAction->setShortcut(QKeySequence(tr("Ctrl+Shift+F11"))); + menuManager()->registerAction(m_fullscreenAction, Constants::TOGGLE_FULLSCREEN); + connect(m_fullscreenAction, SIGNAL(triggered(bool)), this, SLOT(setFullScreen(bool))); + m_settingsAction = new QAction(tr("&Settings"), this); m_settingsAction->setIcon(QIcon(":/images/preferences.png")); m_settingsAction->setShortcut(QKeySequence::Preferences); @@ -218,18 +364,43 @@ void MainWindow::createActions() void MainWindow::createMenus() { - m_fileMenu = menuBar()->addMenu(tr("&File")); + m_fileMenu = m_menuBar->addMenu(tr("&File")); menuManager()->registerMenu(m_fileMenu, Constants::M_FILE); + m_fileMenu->addAction(m_newAction); + m_fileMenu->addAction(m_openAction); + m_fileMenu->addSeparator(); + m_fileMenu->addAction(m_saveAction); + m_fileMenu->addAction(m_saveAsAction); + m_fileMenu->addAction(m_saveAllAction); + m_fileMenu->addSeparator(); + + m_recentFilesMenu = m_fileMenu->addMenu(tr("Recent &Files")); + m_recentFilesMenu->setEnabled(false); + menuManager()->registerMenu(m_recentFilesMenu, Constants::M_FILE_RECENTFILES); + m_fileMenu->addSeparator(); m_fileMenu->addAction(m_exitAction); - m_editMenu = menuBar()->addMenu(tr("&Edit")); + m_editMenu = m_menuBar->addMenu(tr("&Edit")); + m_editMenu->addAction(m_undoGroup->createUndoAction(this)); + m_editMenu->addAction(m_undoGroup->createRedoAction(this)); + m_editMenu->addSeparator(); + m_editMenu->addAction(m_cutAction); + m_editMenu->addAction(m_copyAction); + m_editMenu->addAction(m_pasteAction); + m_editMenu->addAction(m_delAction); + m_editMenu->addSeparator(); + m_editMenu->addAction(m_selectAllAction); + m_editMenu->addSeparator(); + m_editMenu->addAction(m_findAction); + m_editMenu->addAction(m_gotoAction); menuManager()->registerMenu(m_editMenu, Constants::M_EDIT); - m_viewMenu = menuBar()->addMenu(tr("&View")); + m_viewMenu = m_menuBar->addMenu(tr("&View")); + m_viewMenu->addAction(m_fullscreenAction); menuManager()->registerMenu(m_viewMenu, Constants::M_VIEW); - m_toolsMenu = menuBar()->addMenu(tr("&Tools")); + m_toolsMenu = m_menuBar->addMenu(tr("&Tools")); menuManager()->registerMenu(m_toolsMenu, Constants::M_TOOLS); m_sheetMenu = m_toolsMenu->addMenu(tr("&Sheet")); @@ -239,9 +410,9 @@ void MainWindow::createMenus() m_toolsMenu->addAction(m_settingsAction); - menuBar()->addSeparator(); + m_menuBar->addSeparator(); - m_helpMenu = menuBar()->addMenu(tr("&Help")); + m_helpMenu = m_menuBar->addMenu(tr("&Help")); menuManager()->registerMenu(m_helpMenu, Constants::M_HELP); m_helpMenu->addAction(m_aboutAction); m_helpMenu->addAction(m_aboutQtAction); @@ -260,17 +431,17 @@ void MainWindow::createDialogs() void MainWindow::readSettings() { - m_settings->beginGroup("MainWindow"); - restoreState(m_settings->value("WindowState").toByteArray()); - restoreGeometry(m_settings->value("WindowGeometry").toByteArray()); + m_settings->beginGroup(Constants::MAIN_WINDOW_SECTION); + restoreState(m_settings->value(Constants::MAIN_WINDOW_STATE).toByteArray()); + restoreGeometry(m_settings->value(Constants::MAIN_WINDOW_GEOMETRY).toByteArray()); m_settings->endGroup(); } void MainWindow::writeSettings() { - m_settings->beginGroup("MainWindow"); - m_settings->setValue("WindowState", saveState()); - m_settings->setValue("WindowGeometry", saveGeometry()); + m_settings->beginGroup(Constants::MAIN_WINDOW_SECTION); + m_settings->setValue(Constants::MAIN_WINDOW_STATE, saveState()); + m_settings->setValue(Constants::MAIN_WINDOW_GEOMETRY, saveGeometry()); m_settings->endGroup(); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h index 21d091ef3..ce439b885 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h @@ -26,6 +26,7 @@ // Qt includes #include +#include #include namespace Core @@ -35,6 +36,7 @@ class CorePlugin; class IContext; class IMenuManager; class MenuManager; +class ContextManager; class CoreImpl; class MainWindow : public QMainWindow @@ -49,25 +51,39 @@ public: void extensionsInitialized(); IMenuManager *menuManager() const; + ContextManager *contextManager() const; QSettings *settings() const; ExtensionSystem::IPluginManager *pluginManager() const; + void addContextObject(IContext *context); + void removeContextObject(IContext *context); + public Q_SLOTS: bool showOptionsDialog(const QString &group = QString(), const QString &page = QString(), QWidget *parent = 0); private Q_SLOTS: - void checkObject(QObject *obj); + void open(); + void newFile(); + void save(); + void saveAs(); + void saveAll(); + void cut(); + void copy(); + void paste(); + void del(); + void find(); + void gotoPos(); + void setFullScreen(bool enabled); void about(); + void updateContext(Core::IContext *context); protected: virtual void closeEvent(QCloseEvent *event); private: - void addContextObject(IContext *appPage); - void createActions(); void createMenus(); void createStatusBar(); @@ -79,11 +95,13 @@ private: ExtensionSystem::IPluginManager *m_pluginManager; ExtensionSystem::CPluginView *m_pluginView; MenuManager *m_menuManager; + ContextManager *m_contextManager; CoreImpl *m_coreImpl; QPalette m_originalPalette; QString m_lastDir; + QUndoGroup *m_undoGroup; QSettings *m_settings; QTimer *m_mainTimer; @@ -92,15 +110,28 @@ private: QTabWidget *m_tabWidget; QMenu *m_fileMenu; + QMenu *m_recentFilesMenu; QMenu *m_editMenu; QMenu *m_viewMenu; QMenu *m_toolsMenu; QMenu *m_helpMenu; - + QMenuBar *m_menuBar; QMenu *m_sheetMenu; + QAction *m_newAction; QAction *m_openAction; + QAction *m_saveAction; + QAction *m_saveAsAction; + QAction *m_saveAllAction; QAction *m_exitAction; + QAction *m_cutAction; + QAction *m_copyAction; + QAction *m_pasteAction; + QAction *m_delAction; + QAction *m_selectAllAction; + QAction *m_findAction; + QAction *m_gotoAction; + QAction *m_fullscreenAction; QAction *m_settingsAction; QAction *m_pluginViewAction; QAction *m_aboutAction; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp index c52624717..355a9c0e3 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp @@ -33,8 +33,9 @@ namespace Core QString lastDir = "."; -CSearchPathsSettingsPage::CSearchPathsSettingsPage(QObject *parent) +CSearchPathsSettingsPage::CSearchPathsSettingsPage(bool recurse, QObject *parent) : IOptionsPage(parent), + m_recurse(recurse), m_page(0) { } @@ -45,22 +46,33 @@ CSearchPathsSettingsPage::~CSearchPathsSettingsPage() QString CSearchPathsSettingsPage::id() const { - return QLatin1String("SearchPaths"); + if (m_recurse) + return QLatin1String("search_recurse_paths"); + else + return QLatin1String("search_paths"); } QString CSearchPathsSettingsPage::trName() const { - return tr("Search Paths"); + if (m_recurse) + return tr("Search Recurse Paths"); + else + return tr("Search Paths"); } QString CSearchPathsSettingsPage::category() const { - return QLatin1String("General"); + return QLatin1String(Constants::SETTINGS_CATEGORY_GENERAL); } QString CSearchPathsSettingsPage::trCategory() const { - return tr("General"); + return tr(Constants::SETTINGS_TR_CATEGORY_GENERAL); +} + +QIcon CSearchPathsSettingsPage::categoryIcon() const +{ + return QIcon(); } QWidget *CSearchPathsSettingsPage::createPage(QWidget *parent) @@ -92,17 +104,24 @@ void CSearchPathsSettingsPage::finish() void CSearchPathsSettingsPage::applySearchPaths() { - QStringList paths; + QStringList paths, remapExt; QSettings *settings = Core::ICore::instance()->settings(); settings->beginGroup(Core::Constants::DATA_PATH_SECTION); - paths = settings->value(Core::Constants::SEARCH_PATHS).toStringList(); + if (m_recurse) + paths = settings->value(Core::Constants::RECURSIVE_SEARCH_PATHS).toStringList(); + else + paths = settings->value(Core::Constants::SEARCH_PATHS).toStringList(); + + remapExt = settings->value(Core::Constants::REMAP_EXTENSIONS).toStringList(); settings->endGroup(); + + for (int i = 1; i < remapExt.size(); i += 2) + NLMISC::CPath::remapExtension(remapExt.at(i - 1).toStdString(), remapExt.at(i).toStdString(), true); + Q_FOREACH(QString path, paths) { - NLMISC::CPath::addSearchPath(path.toStdString(), false, false); + NLMISC::CPath::addSearchPath(path.toStdString(), m_recurse, false); } - NLMISC::CPath::remapExtension("png", "tga", true); - NLMISC::CPath::remapExtension("png", "dds", true); } void CSearchPathsSettingsPage::addPath() @@ -156,7 +175,10 @@ void CSearchPathsSettingsPage::readSettings() QStringList paths; QSettings *settings = Core::ICore::instance()->settings(); settings->beginGroup(Core::Constants::DATA_PATH_SECTION); - paths = settings->value(Core::Constants::SEARCH_PATHS).toStringList(); + if (m_recurse) + paths = settings->value(Core::Constants::RECURSIVE_SEARCH_PATHS).toStringList(); + else + paths = settings->value(Core::Constants::SEARCH_PATHS).toStringList(); settings->endGroup(); Q_FOREACH(QString path, paths) { @@ -175,8 +197,12 @@ void CSearchPathsSettingsPage::writeSettings() QSettings *settings = Core::ICore::instance()->settings(); settings->beginGroup(Core::Constants::DATA_PATH_SECTION); - settings->setValue(Core::Constants::SEARCH_PATHS, paths); + if (m_recurse) + settings->setValue(Core::Constants::RECURSIVE_SEARCH_PATHS, paths); + else + settings->setValue(Core::Constants::SEARCH_PATHS, paths); settings->endGroup(); + settings->sync(); } void CSearchPathsSettingsPage::checkEnabledButton() diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.h index 15f28f6c8..c7d4c9734 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.h @@ -37,18 +37,20 @@ class CSearchPathsSettingsPage : public Core::IOptionsPage Q_OBJECT public: - CSearchPathsSettingsPage(QObject *parent = 0); + explicit CSearchPathsSettingsPage(bool recurse, QObject *parent = 0); ~CSearchPathsSettingsPage(); QString id() const; QString trName() const; QString category() const; QString trCategory() const; + QIcon categoryIcon() const; QWidget *createPage(QWidget *parent); void apply(); void finish(); + // Set of the search paths(not recursive) and the remap extensions (loading from settings file) void applySearchPaths(); private Q_SLOTS: @@ -62,6 +64,7 @@ private: void writeSettings(); void checkEnabledButton(); + bool m_recurse; QWidget *m_page; Ui::CSearchPathsSettingsPage m_ui; }; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.cpp index 0cb885163..50e7c9db5 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.cpp @@ -53,6 +53,11 @@ QString CExampleSettingsPage::trCategory() const return tr("General"); } +QIcon CExampleSettingsPage::categoryIcon() const +{ + return QIcon(); +} + QWidget *CExampleSettingsPage::createPage(QWidget *parent) { _currentPage = new QWidget(parent); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.h index 64dd940f8..3475f843f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.h @@ -43,6 +43,7 @@ public: virtual QString trName() const; virtual QString category() const; virtual QString trCategory() const; + QIcon categoryIcon() const; virtual QWidget *createPage(QWidget *parent); virtual void apply(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.cpp index cde1ca199..f218c3230 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.cpp @@ -90,7 +90,6 @@ QStringList MyPlugin::dependencies() const { QStringList list; list.append(Core::Constants::OVQT_CORE_PLUGIN); - list.append("ObjectViewer"); return list; } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.h index d3be3bc38..5077ff59e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.h @@ -86,6 +86,15 @@ public: return m_simpleViewer; } + virtual QUndoStack *undoStack() + { + return m_simpleViewer->m_undoStack; + } + + virtual void open() + { + } + CSimpleViewer *m_simpleViewer; }; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.cpp index 9a67abb80..4872923db 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.cpp @@ -38,6 +38,9 @@ QNLWidget::QNLWidget(QWidget *parent) m_initialized(false), m_interval(25) { + setAttribute(Qt::WA_OpaquePaintEvent); + setAttribute(Qt::WA_NoSystemBackground); + setAttribute(Qt::WA_PaintOnScreen); setMouseTracking(true); setFocusPolicy(Qt::StrongFocus); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.cpp index e128710c4..1f6df9117 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.cpp @@ -37,6 +37,8 @@ CSimpleViewer::CSimpleViewer(QWidget *parent) gridLayout->setContentsMargins(0, 0, 0, 0); NLQT::QNLWidget *_nelWidget = new NLQT::QNLWidget(this); gridLayout->addWidget(_nelWidget, 0, 0, 1, 1); + + m_undoStack = new QUndoStack(this); } bool CCoreListener::closeMainWindow() const diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.h index bbff7e9e0..14b782c22 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.h @@ -25,7 +25,7 @@ // Qt includes #include - +#include class QWidget; namespace Plugin @@ -37,6 +37,8 @@ class CSimpleViewer : public QWidget public: CSimpleViewer(QWidget *parent = 0); virtual ~CSimpleViewer() {} + + QUndoStack *m_undoStack; }; class CCoreListener : public Core::ICoreListener 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 new file mode 100644 index 000000000..d1dd346ba --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/CMakeLists.txt @@ -0,0 +1,43 @@ +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) + +SET(OVQT_PLUG_GEORGES_EDITOR_UIS georges_editor_form.ui + georges_dirtree_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 ${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}) + +INSTALL(TARGETS ovqt_plugin_georges_editor LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT tools3d) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_dialog.cpp new file mode 100644 index 000000000..f7e250cce --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_dialog.cpp @@ -0,0 +1,99 @@ +// 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 "georges_dirtree_dialog.h" + +// Qt includes +#include +#include + +// NeL includes + +//using namespace NLMISC; + +namespace Plugin +{ + +CGeorgesDirTreeDialog::CGeorgesDirTreeDialog(QString ldPath, QWidget *parent) + :QDockWidget(parent), m_ldPath(ldPath) +{ + + m_ui.setupUi(this); + + m_dirModel = new CGeorgesFileSystemModel(m_ldPath); + m_ui.dirTree->setModel(m_dirModel); + + if (m_dirModel->isCorrectLDPath()) + { + m_dirModel->setRootPath(m_ldPath); + m_ui.dirTree->setRootIndex(m_dirModel->index(m_ldPath)); + } + else + { + m_dirModel->setRootPath(QDir::currentPath()); + } + + m_ui.dirTree->setAnimated(false); + m_ui.dirTree->setIndentation(20); + + connect(m_ui.dirTree, SIGNAL(activated(QModelIndex)), + this, SLOT(fileSelected(QModelIndex))); +} + +CGeorgesDirTreeDialog::~CGeorgesDirTreeDialog() +{ + delete m_dirModel; +} + +void CGeorgesDirTreeDialog::fileSelected(QModelIndex index) +{ + QString name; + if (index.isValid() && !m_dirModel->isDir(index)) + { + Q_EMIT selectedForm(m_dirModel->fileName(index)); + } +} + +void CGeorgesDirTreeDialog::changeFile(QString file) +{ + QModelIndex index = m_dirModel->index(file); + m_ui.dirTree->selectionModel()->select(index,QItemSelectionModel::ClearAndSelect); + m_ui.dirTree->scrollTo(index,QAbstractItemView::PositionAtCenter); + fileSelected(index); +} + +void CGeorgesDirTreeDialog::ldPathChanged(QString path) +{ + m_ldPath = path; + + delete m_dirModel; + + m_dirModel = new CGeorgesFileSystemModel(m_ldPath); + m_ui.dirTree->setModel(m_dirModel); + + if (m_dirModel->isCorrectLDPath()) + { + m_dirModel->setRootPath(m_ldPath); + m_ui.dirTree->setRootIndex(m_dirModel->index(m_ldPath)); + } + else + { + m_dirModel->setRootPath(QDir::currentPath()); + } +} + +} /* namespace NLQT */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_dialog.h new file mode 100644 index 000000000..3079f76c2 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_dialog.h @@ -0,0 +1,62 @@ +// 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 GEORGES_DIRTREE_DIALOG_H +#define GEORGES_DIRTREE_DIALOG_H + +// Qt includes +#include + +// STL includes + +// NeL includes + +// Project includes +#include "ui_georges_dirtree_form.h" +#include "georges_filesystem_model.h" + +namespace Plugin +{ + +class CGeorgesDirTreeDialog: public QDockWidget +{ + Q_OBJECT + +public: + CGeorgesDirTreeDialog(QString ldPath, QWidget *parent = 0); + ~CGeorgesDirTreeDialog(); + + void ldPathChanged(QString); + +private: + Ui::CGeorgesDirTreeDialog m_ui; + + CGeorgesFileSystemModel *m_dirModel; + QString m_ldPath; + +Q_SIGNALS: + void selectedForm(const QString); + +private Q_SLOTS: + void fileSelected(QModelIndex index); + void changeFile(QString file); + + friend class CMainWindow; +}; /* CGEorgesDirTreeDialog */ + +} /* namespace NLQT */ + +#endif // GEORGES_DIRTREE_DIALOG_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_form.ui new file mode 100644 index 000000000..8731d1ca8 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_dirtree_form.ui @@ -0,0 +1,54 @@ + + + CGeorgesDirTreeDialog + + + + 0 + 0 + 400 + 300 + + + + + 0 + 0 + + + + + 200 + 111 + + + + QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable + + + Leveldesign Path + + + + + 50 + 0 + + + + + + + + 0 + 0 + + + + + + + + + + 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 new file mode 100644 index 000000000..3d514dbc0 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor.qrc @@ -0,0 +1,5 @@ + + + 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/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_constants.h new file mode 100644 index 000000000..bb9fe3306 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_constants.h @@ -0,0 +1,31 @@ +// 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 GEORGES_EDITOR_CONSTANTS_H +#define GEORGES_EDITOR_CONSTANTS_H + +namespace Plugin +{ +namespace Constants +{ +//settings +const char * const GEORGES_EDITOR_SECTION = "GeorgesEditor"; + + +} // namespace Constants +} // namespace Plugin + +#endif // GEORGES_EDITOR_CONSTANTS_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.cpp new file mode 100644 index 000000000..aa614a161 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.cpp @@ -0,0 +1,139 @@ +// 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 "georges_editor_form.h" +#include "georges_editor_constants.h" +#include "georges_dirtree_dialog.h" + +#include "../core/icore.h" +#include "../core/imenu_manager.h" +#include "../core/core_constants.h" + +// NeL includes +#include + +// Qt includes +#include +#include +#include + +namespace Plugin +{ + +GeorgesEditorForm::GeorgesEditorForm(QWidget *parent) + : QMainWindow(parent), + m_georgesDirTreeDialog(0) +{ + m_ui.setupUi(this); + + m_undoStack = new QUndoStack(this); + + _openAction = new QAction(tr("&Open..."), this); + _openAction->setIcon(QIcon(Core::Constants::ICON_OPEN)); + _openAction->setShortcut(QKeySequence::Open); + _openAction->setStatusTip(tr("Open an existing file")); + connect(_openAction, SIGNAL(triggered()), this, SLOT(open())); + + _newAction = new QAction(tr("&New..."), this); + _newAction->setIcon(QIcon(Core::Constants::ICON_NEW)); + _newAction->setShortcut(QKeySequence::New); + _newAction->setStatusTip(tr("Create a new file")); + connect(_newAction, SIGNAL(triggered()), this, SLOT(newFile())); + + _saveAction = new QAction(tr("&Save..."), this); + _saveAction->setIcon(QIcon(Core::Constants::ICON_SAVE)); + _saveAction->setShortcut(QKeySequence::Save); + _saveAction->setStatusTip(tr("Save the current file")); + connect(_saveAction, SIGNAL(triggered()), this, SLOT(save())); + + _fileToolBar = addToolBar(tr("&File")); + _fileToolBar->addAction(_openAction); + _fileToolBar->addAction(_newAction); + _fileToolBar->addAction(_saveAction); + + readSettings(); + + // create leveldesign directory tree dockwidget + m_georgesDirTreeDialog = new CGeorgesDirTreeDialog(m_leveldesignPath, this); + addDockWidget(Qt::LeftDockWidgetArea, m_georgesDirTreeDialog); + //m_georgesDirTreeDialog->setVisible(false); + connect(Core::ICore::instance(), SIGNAL(changeSettings()), + this, SLOT(settingsChanged())); +} + +GeorgesEditorForm::~GeorgesEditorForm() +{ + writeSettings(); +} + +QUndoStack *GeorgesEditorForm::undoStack() const +{ + return m_undoStack; +} + +void GeorgesEditorForm::open() +{ + // TODO: FileDialog & loadFile(); + //QString fileName = QFileDialog::getOpenFileName(); + //loadFile(fileName); +} + +void GeorgesEditorForm::newFile() +{ + +} + +void GeorgesEditorForm::save() +{ + +} + +void GeorgesEditorForm::readSettings() +{ + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Constants::GEORGES_EDITOR_SECTION); + settings->endGroup(); + + settings->beginGroup(Core::Constants::DATA_PATH_SECTION); + m_leveldesignPath = settings->value(Core::Constants::LEVELDESIGN_PATH, "l:/leveldesign").toString(); + settings->endGroup(); +} + +void GeorgesEditorForm::writeSettings() +{ + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Constants::GEORGES_EDITOR_SECTION); + settings->endGroup(); + settings->sync(); +} + +void GeorgesEditorForm::settingsChanged() +{ + QSettings *settings = Core::ICore::instance()->settings(); + + settings->beginGroup(Core::Constants::DATA_PATH_SECTION); + QString oldLDPath = m_leveldesignPath; + m_leveldesignPath = settings->value(Core::Constants::LEVELDESIGN_PATH, "l:/leveldesign").toString(); + settings->endGroup(); + + if (oldLDPath != m_leveldesignPath) + { + m_georgesDirTreeDialog->ldPathChanged(m_leveldesignPath); + } +} + +} /* namespace Plugin */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.h new file mode 100644 index 000000000..96fceb4ed --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.h @@ -0,0 +1,64 @@ +// 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 GEORGES_EDITOR_FORM_H +#define GEORGES_EDITOR_FORM_H + +// Project includes +#include "ui_georges_editor_form.h" + +// Qt includes +#include + +namespace Plugin +{ + +class CGeorgesDirTreeDialog; +class GeorgesEditorForm: public QMainWindow +{ + Q_OBJECT + +public: + GeorgesEditorForm(QWidget *parent = 0); + ~GeorgesEditorForm(); + + QUndoStack *undoStack() const; + +public Q_SLOTS: + void open(); + void newFile(); + void save(); + void settingsChanged(); + +private: + void readSettings(); + void writeSettings(); + + QUndoStack *m_undoStack; + Ui::GeorgesEditorForm m_ui; + + CGeorgesDirTreeDialog *m_georgesDirTreeDialog; + QToolBar *_fileToolBar; + QAction *_openAction; + QAction *_newAction; + QAction *_saveAction; + + QString m_leveldesignPath; +}; /* class GeorgesEditorForm */ + +} /* namespace Plugin */ + +#endif // GEORGES_EDITOR_FORM_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.ui new file mode 100644 index 000000000..905814cc7 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_form.ui @@ -0,0 +1,28 @@ + + + GeorgesEditorForm + + + + 0 + 0 + 800 + 600 + + + + Georges Editor + + + + QWidget#centralwidget { + image: url(:/images/ic_nel_georges_editor.png); + } + + + + + + + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.cpp new file mode 100644 index 000000000..a97188751 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.cpp @@ -0,0 +1,128 @@ +// 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 "georges_editor_plugin.h" +#include "georges_editor_form.h" + +#include "../core/icore.h" +#include "../core/core_constants.h" + +// NeL includes +#include "nel/misc/debug.h" + +// Qt includes +#include + +namespace Plugin +{ + +GeorgesEditorPlugin::~GeorgesEditorPlugin() +{ + Q_FOREACH(QObject *obj, m_autoReleaseObjects) + { + m_plugMan->removeObject(obj); + } + qDeleteAll(m_autoReleaseObjects); + m_autoReleaseObjects.clear(); +} + +bool GeorgesEditorPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) +{ + Q_UNUSED(errorString); + m_plugMan = pluginManager; + + addAutoReleasedObject(new GeorgesEditorContext(this)); + return true; +} + +void GeorgesEditorPlugin::extensionsInitialized() +{ +} + +void GeorgesEditorPlugin::shutdown() +{ +} + +void GeorgesEditorPlugin::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); +} + +QString GeorgesEditorPlugin::name() const +{ + return tr("Georges Editor"); +} + +QString GeorgesEditorPlugin::version() const +{ + return "0.2"; +} + +QString GeorgesEditorPlugin::vendor() const +{ + return "aquiles"; +} + +QString GeorgesEditorPlugin::description() const +{ + return tr("Tool to create & edit sheets or forms."); +} + +QStringList GeorgesEditorPlugin::dependencies() const +{ + QStringList list; + list.append(Core::Constants::OVQT_CORE_PLUGIN); + list.append("ObjectViewer"); // TODO + return list; +} + +void GeorgesEditorPlugin::addAutoReleasedObject(QObject *obj) +{ + m_plugMan->addObject(obj); + m_autoReleaseObjects.prepend(obj); +} + +GeorgesEditorContext::GeorgesEditorContext(QObject *parent) + : IContext(parent), + m_georgesEditorForm(0) +{ + m_georgesEditorForm = new GeorgesEditorForm(); +} + +QUndoStack *GeorgesEditorContext::undoStack() +{ + return m_georgesEditorForm->undoStack(); +} + +void GeorgesEditorContext::open() +{ + m_georgesEditorForm->open(); +} + +QWidget *GeorgesEditorContext::widget() +{ + return m_georgesEditorForm; +} + +} + +Q_EXPORT_PLUGIN(Plugin::GeorgesEditorPlugin) \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.h new file mode 100644 index 000000000..7cc93dfb4 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_editor_plugin.h @@ -0,0 +1,105 @@ +// 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 GEORGES_EDITOR_PLUGIN_H +#define GEORGES_EDITOR_PLUGIN_H + +// Project includes +#include "../../extension_system/iplugin.h" +#include "../core/icontext.h" + +// NeL includes +#include "nel/misc/app_context.h" + +// Qt includes +#include +#include + +namespace NLMISC +{ +class CLibraryContext; +} + +namespace ExtensionSystem +{ +class IPluginSpec; +} + +namespace Plugin +{ +class GeorgesEditorForm; +class GeorgesEditorPlugin : public QObject, public ExtensionSystem::IPlugin +{ + Q_OBJECT + Q_INTERFACES(ExtensionSystem::IPlugin) +public: + + virtual ~GeorgesEditorPlugin(); + + bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString); + void extensionsInitialized(); + void shutdown(); + + void setNelContext(NLMISC::INelContext *nelContext); + + QString name() const; + QString version() const; + QString vendor() const; + QString description() const; + QStringList dependencies() const; + + void addAutoReleasedObject(QObject *obj); + +protected: + NLMISC::CLibraryContext *m_libContext; + +private: + ExtensionSystem::IPluginManager *m_plugMan; + QList m_autoReleaseObjects; +}; + +class GeorgesEditorContext: public Core::IContext +{ + Q_OBJECT +public: + GeorgesEditorContext(QObject *parent = 0); + virtual ~GeorgesEditorContext() {} + + virtual QString id() const + { + return QLatin1String("GeorgesEditorContext"); + } + virtual QString trName() const + { + return tr("Georges Editor"); + } + virtual QIcon icon() const + { + return QIcon(":/images/ic_nel_georges_editor.png"); + } + + virtual void open(); + + virtual QUndoStack *undoStack(); + + virtual QWidget *widget(); + + GeorgesEditorForm *m_georgesEditorForm; +}; + +} // namespace Plugin + +#endif // LANDSCAPE_EDITOR_PLUGIN_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_filesystem_model.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_filesystem_model.cpp new file mode 100644 index 000000000..20cb30b33 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_filesystem_model.cpp @@ -0,0 +1,95 @@ +// 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_filesystem_model.h" + +#include +#include + +namespace Plugin +{ + +CGeorgesFileSystemModel::CGeorgesFileSystemModel(QString ldPath, QObject *parent) + : QFileSystemModel(parent), + m_ldPath(ldPath), + m_correct(false) +{ + checkLDPath(); +} + +CGeorgesFileSystemModel::~CGeorgesFileSystemModel() +{ + +} + +QVariant CGeorgesFileSystemModel::data(const QModelIndex& index, int role) const +{ + + if (role == Qt::DecorationRole) + { + if (!m_correct) + return QVariant(); + if (isDir(index)) + return QApplication::style()->standardIcon(QStyle::SP_DirIcon); + } + if (!m_correct && role == Qt::DisplayRole) + { + if (index.parent().isValid()) + return QVariant(); + return tr("Set a correct leveldesign path ..."); + } + return QFileSystemModel::data(index, role); +} + +int CGeorgesFileSystemModel::columnCount(const QModelIndex &/*parent*/) const +{ + return 1; +} + +int CGeorgesFileSystemModel::rowCount(const QModelIndex &parent) const +{ + + if (!m_correct) + { + if(parent.isValid()) + { + return 0; + } + else + { + return qMin(QFileSystemModel::rowCount(parent),1); + } + } + return QFileSystemModel::rowCount(parent); +} + +void CGeorgesFileSystemModel::checkLDPath() +{ + QFileInfo check1(QString("%1/game_element").arg(m_ldPath)); + QFileInfo check2(QString("%1/DFN").arg(m_ldPath)); + + if (check1.exists() && check2.exists()) + { + m_correct = true; + } + else + { + m_correct = false; + } +} +} /* namespace NLQT */ + +/* end of file */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_filesystem_model.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_filesystem_model.h new file mode 100644 index 000000000..775dcb18d --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_filesystem_model.h @@ -0,0 +1,50 @@ +// 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 GEORGES_FILESYSTEM_MODEL_H +#define GEORGES_FILESYSTEM_MODEL_H + +#include + +namespace Plugin +{ + +class CGeorgesFileSystemModel : public QFileSystemModel +{ + QString m_ldPath; + +public: + CGeorgesFileSystemModel(QString ldPath, QObject *parent = 0); + ~CGeorgesFileSystemModel(); + + int columnCount(const QModelIndex &/*parent*/) const; + int rowCount(const QModelIndex &/*parent*/) const; + + QVariant data(const QModelIndex& index, int role) const ; + + bool isCorrectLDPath() + { + return m_correct; + } + void checkLDPath(); + +private: + bool m_correct; +};/* class CGeorgesFileSystemModel */ + +} /* namespace NLQT */ + +#endif // GEORGES_FILESYSTEM_MODEL_H \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/images/ic_nel_georges_editor.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/images/ic_nel_georges_editor.png new file mode 100644 index 000000000..b293fec52 Binary files /dev/null and b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/images/ic_nel_georges_editor.png differ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/CMakeLists.txt new file mode 100644 index 000000000..3b6a61c5e --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/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_PLUGIN_LANDSCAPE_EDITOR_HDR landscape_editor_plugin.h + landscape_editor_window.h +) + +SET(OVQT_PLUGIN_LANDSCAPE_EDITOR_UIS landscape_editor_window.ui +) + +SET(OVQT_PLUGIN_LANDSCAPE_EDITOR_RCS landscape_editor.qrc) + +SET(QT_USE_QTGUI TRUE) +SET(QT_USE_QTOPENGL TRUE) + +QT4_ADD_RESOURCES(OVQT_PLUGIN_LANDSCAPE_EDITOR_RC_SRCS ${OVQT_PLUGIN_LANDSCAPE_EDITOR_RCS}) +QT4_WRAP_CPP(OVQT_PLUGIN_LANDSCAPE_EDITOR_MOC_SRC ${OVQT_PLUGIN_LANDSCAPE_EDITOR_HDR}) +QT4_WRAP_UI(OVQT_PLUGIN_LANDSCAPE_EDITOR_UI_HDRS ${OVQT_PLUGIN_LANDSCAPE_EDITOR_UIS}) + +SOURCE_GROUP(QtResources FILES ${OVQT_PLUGIN_LANDSCAPE_EDITOR_UIS}) +SOURCE_GROUP(QtGeneratedUiHdr FILES ${OVQT_PLUGIN_LANDSCAPE_EDITOR_UI_HDRS}) +SOURCE_GROUP(QtGeneratedMocQrcSrc FILES ${OVQT_PLUGIN_LANDSCAPE_EDITOR_MOC_SRC} OVQT_PLUGIN_LANDSCAPE_EDITOR_RC_SRCS) +SOURCE_GROUP("Landscape Editor Plugin" FILES ${SRC}) +SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) + +ADD_LIBRARY(ovqt_plugin_landscape_editor MODULE ${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 ${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) + +ADD_DEFINITIONS(-DLANDSCAPE_EDITOR_LIBRARY ${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) + +INSTALL(TARGETS ovqt_plugin_landscape_editor LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT tools3d) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_landscape_item.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_landscape_item.png new file mode 100644 index 000000000..7a51400b3 Binary files /dev/null and b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_landscape_item.png differ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_landscape_settings.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_landscape_settings.png new file mode 100644 index 000000000..4197f7f97 Binary files /dev/null and b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_landscape_settings.png differ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_world_editor.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_world_editor.png new file mode 100644 index 000000000..d41f64e2f Binary files /dev/null and b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_world_editor.png differ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_zone.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_zone.png new file mode 100644 index 000000000..73be27528 Binary files /dev/null and b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_zone.png differ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_zonel.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_zonel.png new file mode 100644 index 000000000..40f75828b Binary files /dev/null and b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/icons/ic_nel_zonel.png differ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor.qrc b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor.qrc new file mode 100644 index 000000000..5dba9074b --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor.qrc @@ -0,0 +1,9 @@ + + + icons/ic_nel_landscape_item.png + icons/ic_nel_landscape_settings.png + icons/ic_nel_world_editor.png + icons/ic_nel_zone.png + icons/ic_nel_zonel.png + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_constants.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_constants.h new file mode 100644 index 000000000..52775f4c4 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_constants.h @@ -0,0 +1,37 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef LANDSCAPE_EDITOR_CONSTANTS_H +#define LANDSCAPE_EDITOR_CONSTANTS_H + +namespace LandscapeEditor +{ +namespace Constants +{ +const char * const LANDSCAPE_EDITOR_PLUGIN = "LandscapeEditor"; + +//settings +const char * const LANDSCAPE_EDITOR_SECTION = "LandscapeEditor"; + +//resources +const char * const ICON_LANDSCAPE_ITEM = ":/icons/ic_nel_landscape_item.png"; + + +} // namespace Constants +} // namespace LandscapeEditor + +#endif // LANDSCAPE_EDITOR_CONSTANTS_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_global.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_global.h new file mode 100644 index 000000000..167c8e24f --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_global.h @@ -0,0 +1,30 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. +// +// 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 LANDSCAPE_EDITOR_GLOBAL_H +#define LANDSCAPE_EDITOR_GLOBAL_H + +#include + +#if defined(LANDSCAPE_EDITOR_LIBRARY) +# define LANDSCAPE_EDITOR_EXPORT Q_DECL_EXPORT +#else +# define LANDSCAPE_EDITOR_EXPORT Q_DECL_IMPORT +#endif + +#endif // LANDSCAPE_EDITOR_GLOBAL_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_plugin.cpp new file mode 100644 index 000000000..ac7782343 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_plugin.cpp @@ -0,0 +1,128 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +// Project includes +#include "landscape_editor_plugin.h" +#include "landscape_editor_window.h" + +#include "../core/icore.h" +#include "../core/core_constants.h" + +// NeL includes +#include "nel/misc/debug.h" + +// Qt includes +#include + +namespace LandscapeEditor +{ + +LandscapeEditorPlugin::~LandscapeEditorPlugin() +{ + Q_FOREACH(QObject *obj, m_autoReleaseObjects) + { + m_plugMan->removeObject(obj); + } + qDeleteAll(m_autoReleaseObjects); + m_autoReleaseObjects.clear(); +} + +bool LandscapeEditorPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) +{ + Q_UNUSED(errorString); + m_plugMan = pluginManager; + + addAutoReleasedObject(new LandscapeEditorContext(this)); + return true; +} + +void LandscapeEditorPlugin::extensionsInitialized() +{ +} + +void LandscapeEditorPlugin::shutdown() +{ +} + +void LandscapeEditorPlugin::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); +} + +QString LandscapeEditorPlugin::name() const +{ + return tr("LandscapeEditor"); +} + +QString LandscapeEditorPlugin::version() const +{ + return "0.0.1"; +} + +QString LandscapeEditorPlugin::vendor() const +{ + return "GSoC2011_dnk-88"; +} + +QString LandscapeEditorPlugin::description() const +{ + return "Landscape editor ovqt plugin."; +} + +QStringList LandscapeEditorPlugin::dependencies() const +{ + QStringList list; + list.append(Core::Constants::OVQT_CORE_PLUGIN); + return list; +} + +void LandscapeEditorPlugin::addAutoReleasedObject(QObject *obj) +{ + m_plugMan->addObject(obj); + m_autoReleaseObjects.prepend(obj); +} + +LandscapeEditorContext::LandscapeEditorContext(QObject *parent) + : IContext(parent), + m_landEditorWindow(0) +{ + m_landEditorWindow = new LandscapeEditorWindow(); +} + +QUndoStack *LandscapeEditorContext::undoStack() +{ + return m_landEditorWindow->undoStack(); +} + +void LandscapeEditorContext::open() +{ + m_landEditorWindow->open(); +} + +QWidget *LandscapeEditorContext::widget() +{ + return m_landEditorWindow; +} + +} + +Q_EXPORT_PLUGIN(LandscapeEditor::LandscapeEditorPlugin) \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_plugin.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_plugin.h new file mode 100644 index 000000000..67a3172ee --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_plugin.h @@ -0,0 +1,108 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef LANDSCAPE_EDITOR_PLUGIN_H +#define LANDSCAPE_EDITOR_PLUGIN_H + +// Project includes +#include "landscape_editor_constants.h" +#include "../../extension_system/iplugin.h" +#include "../core/icontext.h" + +// NeL includes +#include "nel/misc/app_context.h" + +// Qt includes +#include +#include + +namespace NLMISC +{ +class CLibraryContext; +} + +namespace ExtensionSystem +{ +class IPluginSpec; +} + +namespace LandscapeEditor +{ +class LandscapeEditorWindow; + +class LandscapeEditorPlugin : public QObject, public ExtensionSystem::IPlugin +{ + Q_OBJECT + Q_INTERFACES(ExtensionSystem::IPlugin) +public: + + virtual ~LandscapeEditorPlugin(); + + bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString); + void extensionsInitialized(); + void shutdown(); + + void setNelContext(NLMISC::INelContext *nelContext); + + QString name() const; + QString version() const; + QString vendor() const; + QString description() const; + QStringList dependencies() const; + + void addAutoReleasedObject(QObject *obj); + +protected: + NLMISC::CLibraryContext *m_libContext; + +private: + ExtensionSystem::IPluginManager *m_plugMan; + QList m_autoReleaseObjects; +}; + +class LandscapeEditorContext: public Core::IContext +{ + Q_OBJECT +public: + LandscapeEditorContext(QObject *parent = 0); + virtual ~LandscapeEditorContext() {} + + virtual QString id() const + { + return QLatin1String("LandscapeEditorContext"); + } + virtual QString trName() const + { + return tr("Landscape Editor"); + } + virtual QIcon icon() const + { + return QIcon(); + } + + virtual void open(); + + virtual QUndoStack *undoStack(); + + virtual QWidget *widget(); + + LandscapeEditorWindow *m_landEditorWindow; +}; + +} // namespace LandscapeEditor + +#endif // LANDSCAPE_EDITOR_PLUGIN_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.cpp new file mode 100644 index 000000000..4b075adfc --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.cpp @@ -0,0 +1,93 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +// Project includes +#include "landscape_editor_window.h" +#include "landscape_editor_constants.h" + +#include "../core/icore.h" +#include "../core/imenu_manager.h" +#include "../core/core_constants.h" + +// NeL includes +#include + +// Qt includes +#include +#include + +namespace LandscapeEditor +{ +QString _lastDir; + +LandscapeEditorWindow::LandscapeEditorWindow(QWidget *parent) + : QMainWindow(parent) +{ + m_ui.setupUi(this); + + m_undoStack = new QUndoStack(this); + + createMenus(); + readSettings(); +} + +LandscapeEditorWindow::~LandscapeEditorWindow() +{ + writeSettings(); +} + +QUndoStack *LandscapeEditorWindow::undoStack() const +{ + return m_undoStack; +} + +void LandscapeEditorWindow::open() +{ + QStringList fileNames = QFileDialog::getOpenFileNames(this, + tr("Open NeL Ligo land file"), _lastDir, + tr("All NeL Ligo land files (*.land)")); + + setCursor(Qt::WaitCursor); + if (!fileNames.isEmpty()) + { + QStringList list = fileNames; + _lastDir = QFileInfo(list.front()).absolutePath(); + } + setCursor(Qt::ArrowCursor); +} + +void LandscapeEditorWindow::createMenus() +{ + Core::IMenuManager *menuManager = Core::ICore::instance()->menuManager(); +} + +void LandscapeEditorWindow::readSettings() +{ + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Constants::LANDSCAPE_EDITOR_SECTION); + settings->endGroup(); +} + +void LandscapeEditorWindow::writeSettings() +{ + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Constants::LANDSCAPE_EDITOR_SECTION); + settings->endGroup(); + settings->sync(); +} + +} /* namespace LandscapeEditor */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.h new file mode 100644 index 000000000..cc17e6cbc --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.h @@ -0,0 +1,56 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef LANDSCAPE_EDITOR_WINDOW_H +#define LANDSCAPE_EDITOR_WINDOW_H + +// Project includes +#include "ui_landscape_editor_window.h" + +// Qt includes +#include + +namespace LandscapeEditor +{ + +class LandscapeEditorWindow: public QMainWindow +{ + Q_OBJECT + +public: + LandscapeEditorWindow(QWidget *parent = 0); + ~LandscapeEditorWindow(); + + QUndoStack *undoStack() const; + +Q_SIGNALS: +public Q_SLOTS: + void open(); + +private Q_SLOTS: +private: + void createMenus(); + void readSettings(); + void writeSettings(); + + QUndoStack *m_undoStack; + Ui::LandscapeEditorWindow m_ui; +}; /* class LandscapeEditorWindow */ + +} /* namespace LandscapeEditor */ + +#endif // LANDSCAPE_EDITOR_WINDOW_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.ui new file mode 100644 index 000000000..5d9606ddf --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.ui @@ -0,0 +1,43 @@ + + + LandscapeEditorWindow + + + + 0 + 0 + 800 + 600 + + + + MainWindow + + + + :/icons/ic_nel_landscape_item.png:/icons/ic_nel_landscape_item.png + + + + + + + + + + + toolBar + + + TopToolBarArea + + + false + + + + + + + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/CMakeLists.txt index 555eac232..b497e3332 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/CMakeLists.txt @@ -1,7 +1,7 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} - ${LIBXML2_INCLUDE_DIR} - ${QT_INCLUDES}) + ${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 diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.cpp index 439cce7d9..2f88200ec 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.cpp @@ -1,24 +1,28 @@ -/* -Log Plugin Qt -Copyright (C) 2010 Adrian Jaekel - -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 . - -*/ +// Object Viewer Qt - Log 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 "log_plugin.h" #include "log_settings_page.h" +#include "qt_displayer.h" + +#include "../core/icore.h" +#include "../core/core_constants.h" +#include "../core/imenu_manager.h" +#include "../../extension_system/iplugin_spec.h" // Qt includes #include @@ -35,103 +39,153 @@ along with this program. If not, see . // NeL includes #include -// Project includes -#include "../core/icore.h" -#include "../core/core_constants.h" -#include "../core/imenu_manager.h" -#include "qt_displayer.h" - -using namespace Plugin; - -namespace ExtensionSystem +namespace Plugin { - class IPluginSpec; -} -CLogPlugin::CLogPlugin(QWidget *parent): QDockWidget(parent) -{ - _ui.setupUi(this); -} + CLogPlugin::CLogPlugin(QWidget *parent): QDockWidget(parent) + { + m_ui.setupUi(this); + } -CLogPlugin::~CLogPlugin() -{ - _plugMan->removeObject(_logSettingsPage); - delete _logSettingsPage; + CLogPlugin::~CLogPlugin() + { + Q_FOREACH(QObject *obj, m_autoReleaseObjects) + { + m_plugMan->removeObject(obj); + } + qDeleteAll(m_autoReleaseObjects); + m_autoReleaseObjects.clear(); - NLMISC::ErrorLog->removeDisplayer(_displayer); - NLMISC::WarningLog->removeDisplayer(_displayer); - NLMISC::DebugLog->removeDisplayer(_displayer); - NLMISC::AssertLog->removeDisplayer(_displayer); - NLMISC::InfoLog->removeDisplayer(_displayer); - delete _displayer; -} + NLMISC::ErrorLog->removeDisplayer(m_displayer); + NLMISC::WarningLog->removeDisplayer(m_displayer); + NLMISC::DebugLog->removeDisplayer(m_displayer); + NLMISC::AssertLog->removeDisplayer(m_displayer); + NLMISC::InfoLog->removeDisplayer(m_displayer); + delete m_displayer; + } -bool CLogPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) -{ - Q_UNUSED(errorString); - _plugMan = pluginManager; - _logSettingsPage = new CLogSettingsPage(this); - _plugMan->addObject(_logSettingsPage); - return true; -} + bool CLogPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) + { + Q_UNUSED(errorString); + m_plugMan = pluginManager; + m_logSettingsPage = new CLogSettingsPage(this); + addAutoReleasedObject(m_logSettingsPage); + return true; + } -void CLogPlugin::extensionsInitialized() -{ - NLMISC::ErrorLog->addDisplayer(_displayer); - NLMISC::WarningLog->addDisplayer(_displayer); - NLMISC::DebugLog->addDisplayer(_displayer); - NLMISC::AssertLog->addDisplayer(_displayer); - NLMISC::InfoLog->addDisplayer(_displayer); + void CLogPlugin::extensionsInitialized() + { + setDisplayers(); - Core::ICore *core = Core::ICore::instance(); - Core::IMenuManager *menuManager = core->menuManager(); - QMenu *viewMenu = menuManager->menu(Core::Constants::M_VIEW); + Core::ICore *core = Core::ICore::instance(); + Core::IMenuManager *menuManager = core->menuManager(); + QMenu *viewMenu = menuManager->menu(Core::Constants::M_VIEW); - QMainWindow *wnd = Core::ICore::instance()->mainWindow(); - wnd->addDockWidget(Qt::RightDockWidgetArea, this); - hide(); + QMainWindow *wnd = Core::ICore::instance()->mainWindow(); + wnd->addDockWidget(Qt::RightDockWidgetArea, this); + hide(); - viewMenu->addAction(this->toggleViewAction()); -} + viewMenu->addAction(this->toggleViewAction()); + } -void CLogPlugin::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()); + void CLogPlugin::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 // fdef NL_OS_WINDOWS^M - _LibContext = new NLMISC::CLibraryContext(*nelContext); + m_libContext = new NLMISC::CLibraryContext(*nelContext); - _displayer = new NLQT::CQtDisplayer(_ui.plainTextEdit); + m_displayer = new NLQT::CQtDisplayer(m_ui.plainTextEdit); + } + + QString CLogPlugin::name() const + { + return "NeL Log"; + } + + QString CLogPlugin::version() const + { + return "1.1"; + } + + QString CLogPlugin::vendor() const + { + return "aquiles"; + } + + QString CLogPlugin::description() const + { + return tr("DockWidget to display all log messages from NeL."); + } + + QStringList CLogPlugin::dependencies() const + { + QStringList list; + list.append(Core::Constants::OVQT_CORE_PLUGIN); + return list; + } + + void CLogPlugin::addAutoReleasedObject(QObject *obj) + { + m_plugMan->addObject(obj); + m_autoReleaseObjects.prepend(obj); + } + + void CLogPlugin::setDisplayers() + { + QSettings *settings = Core::ICore::instance()->settings(); + + settings->beginGroup(Core::Constants::LOG_SECTION); + bool error = settings->value(Core::Constants::LOG_ERROR, true).toBool(); + bool warning = settings->value(Core::Constants::LOG_WARNING, true).toBool(); + bool debug = settings->value(Core::Constants::LOG_DEBUG, true).toBool(); + bool assert = settings->value(Core::Constants::LOG_ASSERT, true).toBool(); + bool info = settings->value(Core::Constants::LOG_INFO, true).toBool(); + settings->endGroup(); + + if (error) { + if (!NLMISC::ErrorLog->attached(m_displayer)) + NLMISC::ErrorLog->addDisplayer(m_displayer); + } else { + if (m_displayer) { + NLMISC::ErrorLog->removeDisplayer(m_displayer); + } + } + if (warning) { + if (!NLMISC::WarningLog->attached(m_displayer)) + NLMISC::WarningLog->addDisplayer(m_displayer); + } else { + if (m_displayer) { + NLMISC::WarningLog->removeDisplayer(m_displayer); + } + } + if (debug) { + if (!NLMISC::DebugLog->attached(m_displayer)) + NLMISC::DebugLog->addDisplayer(m_displayer); + } else { + if (m_displayer) { + NLMISC::DebugLog->removeDisplayer(m_displayer); + } + } + if (assert) { + if (!NLMISC::AssertLog->attached(m_displayer)) + NLMISC::AssertLog->addDisplayer(m_displayer); + } else { + if (m_displayer) { + NLMISC::AssertLog->removeDisplayer(m_displayer); + } + } + if (info) { + if (!NLMISC::InfoLog->attached(m_displayer)) + NLMISC::InfoLog->addDisplayer(m_displayer); + } else { + if (m_displayer) { + NLMISC::InfoLog->removeDisplayer(m_displayer); + } + } + } } - -QString CLogPlugin::name() const -{ - return "LogPlugin"; -} - -QString CLogPlugin::version() const -{ - return "1.0"; -} - -QString CLogPlugin::vendor() const -{ - return "aquiles"; -} - -QString CLogPlugin::description() const -{ - return "DockWidget to display all log messages from NeL."; -} - -QStringList CLogPlugin::dependencies() const -{ - QStringList list; - list.append(Core::Constants::OVQT_CORE_PLUGIN); - return list; -} - -Q_EXPORT_PLUGIN(CLogPlugin) +Q_EXPORT_PLUGIN(Plugin::CLogPlugin) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.h index d07469541..6a2d78f79 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.h @@ -1,6 +1,6 @@ /* Log Plugin Qt -Copyright (C) 2010 Adrian Jaekel +Copyright (C) 2011 Adrian Jaekel 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 @@ -20,16 +20,16 @@ along with this program. If not, see . #ifndef LOG_PLUGIN_H #define LOG_PLUGIN_H +// Project includes +#include "ui_log_form.h" #include "../../extension_system/iplugin.h" +// NeL includes #include "nel/misc/app_context.h" // Qt includes #include -// Project includes -#include "ui_log_form.h" - namespace NLMISC { class CLibraryContext; @@ -52,7 +52,7 @@ namespace Plugin class CLogPlugin : public QDockWidget, public ExtensionSystem::IPlugin { Q_OBJECT - Q_INTERFACES(ExtensionSystem::IPlugin) + Q_INTERFACES(ExtensionSystem::IPlugin) public: CLogPlugin(QWidget *parent = 0); ~CLogPlugin(); @@ -61,7 +61,7 @@ namespace Plugin void extensionsInitialized(); void setNelContext(NLMISC::INelContext *nelContext); - NLQT::CQtDisplayer* displayer() { return _displayer; } + NLQT::CQtDisplayer* displayer() { return m_displayer; } QString name() const; QString version() const; @@ -69,16 +69,21 @@ namespace Plugin QString description() const; QStringList dependencies() const; + void addAutoReleasedObject(QObject *obj); + + void setDisplayers(); + protected: - NLMISC::CLibraryContext *_LibContext; + NLMISC::CLibraryContext *m_libContext; private: - ExtensionSystem::IPluginManager *_plugMan; - CLogSettingsPage *_logSettingsPage; + ExtensionSystem::IPluginManager *m_plugMan; + QList m_autoReleaseObjects; + CLogSettingsPage *m_logSettingsPage; - Ui::CLogPlugin _ui; + Ui::CLogPlugin m_ui; - NLQT::CQtDisplayer *_displayer; + NLQT::CQtDisplayer *m_displayer; }; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_settings_page.cpp index 83cfdc979..f75d6ab37 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_settings_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_settings_page.cpp @@ -1,6 +1,6 @@ // Object Viewer Qt - MMORPG Framework // Copyright (C) 2010 Winch Gate Property Limited -// Copyright (C) 2011 Dzmitry Kamiahin +// 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 @@ -15,31 +15,43 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +// Project includes #include "log_settings_page.h" - -// Qt includes -#include +#include "log_plugin.h" +#include "../core/core_constants.h" +#include "../core/icore.h" +#include "../../extension_system/plugin_manager.h" // NeL includes -// Project includes +// Qt includes +#include +#include + namespace ExtensionSystem { - class IPluginManager; + class IPluginManager; } namespace Plugin { + class CLogPlugin; + CLogSettingsPage::CLogSettingsPage(QObject *parent) : IOptionsPage(parent), - _currentPage(NULL) + m_currentPage(NULL), + m_error(true), + m_warning(true), + m_debug(true), + m_assert(true), + m_info(true) { } QString CLogSettingsPage::id() const { - return QLatin1String("Log"); + return QLatin1String("log"); } QString CLogSettingsPage::trName() const @@ -49,32 +61,78 @@ namespace Plugin QString CLogSettingsPage::category() const { - return QLatin1String("General"); + return QLatin1String(Core::Constants::SETTINGS_CATEGORY_GENERAL); } QString CLogSettingsPage::trCategory() const { - return tr("General"); + return tr(Core::Constants::SETTINGS_TR_CATEGORY_GENERAL); + } + + QIcon CLogSettingsPage::categoryIcon() const + { + return QIcon(); } QWidget *CLogSettingsPage::createPage(QWidget *parent) { - _currentPage = new QWidget(parent); - _ui.setupUi(_currentPage); - return _currentPage; + m_currentPage = new QWidget(parent); + m_ui.setupUi(m_currentPage); + + readSettings(); + m_ui.errorCheck->setChecked(m_error); + m_ui.warningCheck->setChecked(m_warning); + m_ui.debugCheck->setChecked(m_debug); + m_ui.assertCheck->setChecked(m_assert); + m_ui.infoCheck->setChecked(m_info); + + return m_currentPage; } void CLogSettingsPage::apply() { - //ExtensionSystem::IPluginSpec *spec, _plugMan->plugins() - //ExtensionSystem::IPluginManager; - //if (_ui.errorCheck->isChecked()) { - //displayer(); - //} - //if (_ui.warningCheck->isChecked()); - //if (_ui.debugCheck->isChecked()); - //if (_ui.assertCheck->isChecked()); - //if (_ui.infoCheck->isChecked()); + m_error = m_ui.errorCheck->isChecked(); + m_warning = m_ui.warningCheck->isChecked(); + m_debug = m_ui.debugCheck->isChecked(); + m_assert = m_ui.assertCheck->isChecked(); + m_info = m_ui.infoCheck->isChecked(); + + writeSettings(); + ExtensionSystem::IPluginManager *p = Core::ICore::instance()->pluginManager(); + ExtensionSystem::IPlugin *plugin = p->pluginByName("LogPlugin")->plugin(); + CLogPlugin* lp = dynamic_cast(plugin); + if (lp) + { + lp->setDisplayers(); + } + } + + void CLogSettingsPage::readSettings() + { + QSettings *settings = Core::ICore::instance()->settings(); + + settings->beginGroup(Core::Constants::LOG_SECTION); + m_error = settings->value(Core::Constants::LOG_ERROR, true).toBool(); + m_warning = settings->value(Core::Constants::LOG_WARNING, true).toBool(); + m_debug = settings->value(Core::Constants::LOG_DEBUG, true).toBool(); + m_assert = settings->value(Core::Constants::LOG_ASSERT, true).toBool(); + m_info = settings->value(Core::Constants::LOG_INFO, true).toBool(); + settings->endGroup(); + } + + void CLogSettingsPage::writeSettings() + { + QSettings *settings = Core::ICore::instance()->settings(); + + settings->beginGroup(Core::Constants::LOG_SECTION); + settings->setValue(Core::Constants::LOG_ERROR, m_error); + settings->setValue(Core::Constants::LOG_WARNING, m_warning); + settings->setValue(Core::Constants::LOG_DEBUG, m_debug); + settings->setValue(Core::Constants::LOG_ASSERT, m_assert); + settings->setValue(Core::Constants::LOG_INFO, m_info); + settings->endGroup(); + + settings->sync(); } } /* namespace Plugin */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_settings_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_settings_page.h index 396afcdd3..2c0c5ed98 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_settings_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_settings_page.h @@ -29,29 +29,39 @@ class QWidget; namespace Plugin { -/** -@class CLogSettingsPage -*/ -class CLogSettingsPage : public Core::IOptionsPage -{ - Q_OBJECT -public: - CLogSettingsPage(QObject *parent = 0); - virtual ~CLogSettingsPage() {} + /** + @class CLogSettingsPage + */ + class CLogSettingsPage : public Core::IOptionsPage + { + Q_OBJECT + public: + CLogSettingsPage(QObject *parent = 0); + virtual ~CLogSettingsPage() {} - virtual QString id() const; - virtual QString trName() const; - virtual QString category() const; - virtual QString trCategory() const; - virtual QWidget *createPage(QWidget *parent); + virtual QString id() const; + virtual QString trName() const; + virtual QString category() const; + virtual QString trCategory() const; + QIcon categoryIcon() const; + virtual QWidget *createPage(QWidget *parent); - virtual void apply(); - virtual void finish() {} + virtual void apply(); + virtual void finish() {} -private: - QWidget *_currentPage; - Ui::CLogSettingsPage _ui; -}; + private: + void readSettings(); + void writeSettings(); + + QWidget *m_currentPage; + Ui::CLogSettingsPage m_ui; + + bool m_error; + bool m_warning; + bool m_debug; + bool m_assert; + bool m_info; + }; } // namespace Core diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/qt_displayer.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/qt_displayer.cpp index aaeae9a1a..fc694d779 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/qt_displayer.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/qt_displayer.cpp @@ -1,24 +1,21 @@ -/* -Georges Editor Qt -Copyright (C) 2010 Adrian Jaekel - -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 . - -*/ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// 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 . // Nel includes - #include "qt_displayer.h" #include #include diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/animation_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/animation_form.ui index 90d496d17..3660afe45 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/animation_form.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/animation_form.ui @@ -193,7 +193,7 @@ - :/images/animset.png:/images/animset.png + :/icons/ic_nel_animset.png:/icons/ic_nel_animset.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/attrib_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/attrib_form.ui index 404444fc0..77c4b895f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/attrib_form.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/attrib_form.ui @@ -91,7 +91,7 @@ - true + false diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/global_wind_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/global_wind_form.ui index 971d16c60..bb266f650 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/global_wind_form.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/global_wind_form.ui @@ -6,8 +6,8 @@ 0 0 - 195 - 64 + 192 + 52 @@ -21,6 +21,12 @@ + + 3 + + + 3 + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.cpp index 4e11ee15c..6c2736895 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.cpp @@ -25,8 +25,6 @@ // Qt includes #include #include -#include -#include // NeL includes #include @@ -60,6 +58,11 @@ QString GraphicsSettingsPage::trCategory() const return tr("Object Viewer"); } +QIcon GraphicsSettingsPage::categoryIcon() const +{ + return QIcon(); +} + QWidget *GraphicsSettingsPage::createPage(QWidget *parent) { m_page = new QWidget(parent); @@ -75,11 +78,6 @@ QWidget *GraphicsSettingsPage::createPage(QWidget *parent) m_ui.squareBloomCheckBox->setChecked(NL3D::CBloomEffect::instance().getSquareBloom()); m_ui.bloomDensityHorizontalSlider->setValue(NL3D::CBloomEffect::instance().getDensityBloom()); - m_ui.styleComboBox->addItems(QStyleFactory::keys()); - QString style = settings->value(Constants::QT_STYLE, "").toString(); - m_ui.styleComboBox->setCurrentIndex(m_ui.styleComboBox->findText(style)); - m_ui.paletteCheckBox->setChecked(settings->value(Constants::QT_PALETTE, true).toBool()); - settings->endGroup(); connect(m_ui.enableBloomCheckBox, SIGNAL(toggled(bool)), this, SLOT(setEnableBloom(bool))); @@ -103,16 +101,6 @@ void GraphicsSettingsPage::apply() settings->setValue(Constants::ENABLE_BLOOM, m_ui.enableBloomCheckBox->isChecked()); settings->setValue(Constants::ENABLE_SQUARE_BLOOM, m_ui.squareBloomCheckBox->isChecked()); settings->setValue(Constants::BLOOM_DENSITY, m_ui.bloomDensityHorizontalSlider->value()); - settings->setValue(Constants::QT_STYLE, m_ui.styleComboBox->currentText()); - settings->setValue(Constants::QT_PALETTE, m_ui.paletteCheckBox->isChecked()); - - // apply qt style and palette - QApplication::setStyle(QStyleFactory::create(m_ui.styleComboBox->currentText())); - - if (m_ui.paletteCheckBox->isChecked()) - QApplication::setPalette(QApplication::style()->standardPalette()); - else - QApplication::setPalette(Modules::mainWin().getOriginalPalette()); settings->endGroup(); settings->sync(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.h index e1402939f..74df1b140 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.h @@ -42,6 +42,7 @@ public: virtual QString trName() const; virtual QString category() const; virtual QString trCategory() const; + QIcon categoryIcon() const; virtual QWidget *createPage(QWidget *parent); virtual void apply(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.ui index 24058d3d3..e6b4952a5 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_settings_page.ui @@ -117,50 +117,7 @@ - - - - Qt Style - - - - - - - - Style - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - Use style's standard palette - - - - - - - + false @@ -170,14 +127,14 @@ - + false - + false @@ -187,7 +144,7 @@ - + Qt::Vertical 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 index 2a15932b7..93bc1043e 100644 --- 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 @@ -49,6 +49,9 @@ namespace NLQT CGraphicsViewport::CGraphicsViewport(QWidget *parent) : QNLWidget(parent) { + setAttribute(Qt::WA_OpaquePaintEvent); + setAttribute(Qt::WA_NoSystemBackground); + setAttribute(Qt::WA_PaintOnScreen); } CGraphicsViewport::~CGraphicsViewport() @@ -77,7 +80,7 @@ void CGraphicsViewport::release() { //H_AUTO2 nldebug("CGraphicsViewport::release"); - + Modules::veget().release(); Modules::psEdit().release(); Modules::objView().release(); @@ -119,39 +122,6 @@ void CGraphicsViewport::resizeEvent(QResizeEvent *resizeEvent) Modules::objView().setSizeViewport(resizeEvent->size().width(), resizeEvent->size().height()); } -#if defined(NL_OS_MAC) -// Qt does not provide wheel events through winEvent() and macEvent() (but it -// does through x11Event(), which is inconsistent...) -// Workaround is to handle wheel events like implemented below. -// -// TODO: this is not a clean solution, because all but wheel events are -// handled using winEvent(), x11Event(), macEvent(). But this seems to be a -// limitation of current (4.7.1) Qt versions. (see e.g. qapplication_mac.mm) -void CGraphicsViewport::wheelEvent(QWheelEvent *event) -{ - // Get relative positions. - float fX = 1.0f - (float)event->pos().x() / this->width(); - float fY = 1.0f - (float)event->pos().y() / this->height(); - - // Get the buttons currently pressed. - uint32 buttons = NLMISC::noButton; - if(event->buttons() & Qt::LeftButton) buttons |= NLMISC::leftButton; - if(event->buttons() & Qt::RightButton) buttons |= NLMISC::rightButton; - if(event->buttons() & Qt::MidButton) buttons |= NLMISC::middleButton; - if(event->modifiers() & Qt::ControlModifier) buttons |= NLMISC::ctrlButton; - if(event->modifiers() & Qt::ShiftModifier) buttons |= NLMISC::shiftButton; - if(event->modifiers() & Qt::AltModifier) buttons |= NLMISC::altButton; - - if(event->delta() > 0) - Modules::objView().getDriver()->EventServer.postEvent( - new NLMISC::CEventMouseWheel(-fX, fY, (NLMISC::TMouseButton)buttons, true, NULL)); - else - Modules::objView().getDriver()->EventServer.postEvent( - new NLMISC::CEventMouseWheel(-fX, fY, (NLMISC::TMouseButton)buttons, false, NULL)); -} -#endif // defined(NL_OS_MAC) - - #if defined(NL_OS_WINDOWS) typedef bool (*winProc)(NL3D::IDriver *driver, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); @@ -164,6 +134,9 @@ bool CGraphicsViewport::winEvent(MSG *message, long *result) 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); } } @@ -186,10 +159,12 @@ bool CGraphicsViewport::macEvent(EventHandlerCallRef caller, EventRef event) if (driver) { cocoaProc proc = (cocoaProc)driver->getWindowProc(); - return proc(driver, event); + proc(driver, event); } } + // return false to let Qt handle the event as well, + // else the widget would never get focus return false; } @@ -205,10 +180,13 @@ bool CGraphicsViewport::x11Event(XEvent *event) if (driver) { x11Proc proc = (x11Proc)driver->getWindowProc(); - return proc(driver, event); + 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 diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_viewport.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_viewport.h index 00b2c80d2..d810d8c01 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_viewport.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/graphics_viewport.h @@ -80,10 +80,6 @@ private Q_SLOTS: protected: virtual void resizeEvent(QResizeEvent *resizeEvent); -#if defined(NL_OS_MAC) - virtual void wheelEvent(QWheelEvent *event); -#endif - #if defined(NL_OS_WINDOWS) virtual bool winEvent(MSG *message, long *result); #elif defined(NL_OS_MAC) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.cpp index fa077cfed..e1962cf5b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.cpp @@ -66,7 +66,7 @@ CMainWindow::CMainWindow(QWidget *parent) _isGraphicsInitialized(false), _isGraphicsEnabled(false), _isSoundInitialized(false), - _isSoundEnabled(false), + _isSoundEnabled(true), _GraphicsViewport(NULL), _lastDir("."), _mouseMode(NL3D::U3dMouseListener::edit3d) @@ -80,19 +80,6 @@ CMainWindow::CMainWindow(QWidget *parent) setDockNestingEnabled(true); - QSettings *settings = Core::ICore::instance()->settings(); - settings->beginGroup(Constants::OBJECT_VIEWER_SECTION); - - // setup Qt style and palette from config file - _originalPalette = QApplication::palette(); - - QApplication::setStyle(QStyleFactory::create(settings->value(Constants::QT_STYLE, "").toString())); - - if (settings->value(Constants::QT_PALETTE, true).toBool()) - QApplication::setPalette(QApplication::style()->standardPalette()); - else - QApplication::setPalette(_originalPalette); - _GraphicsViewport->init(); _isGraphicsInitialized = true; @@ -102,6 +89,7 @@ CMainWindow::CMainWindow(QWidget *parent) _isSoundInitialized = true; } + _undoStack = new QUndoStack(this); _SkeletonTreeModel = new CSkeletonTreeModel(this); createDialogs(); @@ -111,6 +99,9 @@ CMainWindow::CMainWindow(QWidget *parent) setWindowIcon(QIcon(":/images/nel.png")); + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Constants::OBJECT_VIEWER_SECTION); + restoreState(settings->value("QtWindowState").toByteArray()); restoreGeometry(settings->value("QtWindowGeometry").toByteArray()); @@ -248,12 +239,6 @@ void CMainWindow::updateStatusBar() void CMainWindow::createActions() { - _openAction = new QAction(tr("&Open..."), this); - _openAction->setIcon(QIcon(Core::Constants::ICON_OPEN)); - _openAction->setShortcut(QKeySequence::Open); - _openAction->setStatusTip(tr("Open an existing file")); - connect(_openAction, SIGNAL(triggered()), this, SLOT(open())); - _setBackColorAction = _GraphicsViewport->createSetBackgroundColor(this); _setBackColorAction->setText(tr("Set &background color")); _setBackColorAction->setIcon(QIcon(Constants::ICON_BGCOLOR)); @@ -268,7 +253,7 @@ void CMainWindow::createActions() connect(_reloadTexturesAction, SIGNAL(triggered()), this, SLOT(reloadTextures())); _saveScreenshotAction = _GraphicsViewport->createSaveScreenshotAction(this); - _saveScreenshotAction->setText(tr("Save &Screenshot")); + _saveScreenshotAction->setText(tr("Save Screenshot")); _saveScreenshotAction->setStatusTip(tr("Make a screenshot of the current viewport and save")); } @@ -276,14 +261,7 @@ void CMainWindow::createMenus() { Core::IMenuManager *menuManager = Core::ICore::instance()->menuManager(); - // register actions for file menu - menuManager->registerAction(_openAction, "ObjectViewer.File.Open"); - - // add actions in file menu - QMenu *fileMenu = menuManager->menu(Core::Constants::M_FILE); - QAction *exitAction = menuManager->action(Core::Constants::EXIT); - fileMenu->insertAction(exitAction, _openAction); - fileMenu->insertSeparator(exitAction); + _openAction = menuManager->action(Core::Constants::OPEN); // register actions for view menu menuManager->registerAction(_setBackColorAction, "ObjectViewer.View.SetBackgroundColor"); @@ -484,22 +462,6 @@ bool CMainWindow::loadFile(const QString &fileName, const QString &skelName) return true; } -void CMainWindow::cfcbQtStyle(NLMISC::CConfigFile::CVar &var) -{ - QApplication::setStyle(QStyleFactory::create(var.asString().c_str())); -} - -void CMainWindow::cfcbQtPalette(NLMISC::CConfigFile::CVar &var) -{ - if (var.asBool()) QApplication::setPalette(QApplication::style()->standardPalette()); - else QApplication::setPalette(_originalPalette); -} - -void CMainWindow::cfcbSoundEnabled(NLMISC::CConfigFile::CVar &var) -{ - _isSoundEnabled = var.asBool(); // update loop inits -} - void CMainWindow::updateRender() { if (isVisible()) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.h index 3a6411df2..5a392c191 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.h @@ -25,6 +25,7 @@ // Qt includes #include #include +#include // NeL includes #include @@ -71,15 +72,18 @@ public: { return _SkeletonTreeModel; } - QPalette getOriginalPalette() const + + QUndoStack *getUndoStack() const { - return _originalPalette; + return _undoStack; } -private Q_SLOTS: +public Q_SLOTS: void open(); void resetScene(); void reloadTextures(); + +private Q_SLOTS: void updateStatusBar(); void updateRender(); void setInterval(int value); @@ -96,10 +100,6 @@ private: bool loadFile(const QString &fileName, const QString &skelName); - void cfcbQtStyle(NLMISC::CConfigFile::CVar &var); - void cfcbQtPalette(NLMISC::CConfigFile::CVar &var); - void cfcbSoundEnabled(NLMISC::CConfigFile::CVar &var); - bool _isGraphicsInitialized, _isGraphicsEnabled; bool _isSoundInitialized, _isSoundEnabled; @@ -122,7 +122,6 @@ private: CCameraControl *_cameraControl; - QPalette _originalPalette; QString _lastDir; QTimer *_mainTimer; @@ -139,6 +138,7 @@ private: QAction *_resetSceneAction; QAction *_saveScreenshotAction; QLabel *_statusInfo; + QUndoStack *_undoStack; float _fps; uint _numTri; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/modules.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/modules.cpp index 76afed779..605f484f7 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/modules.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/modules.cpp @@ -37,7 +37,7 @@ void Modules::init() void Modules::release() { - delete _mainWindow; +// delete _mainWindow; _mainWindow = NULL; delete _particleEditor; _particleEditor = NULL; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_plugin.cpp index b48eb82cc..f82789e66 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_plugin.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_plugin.cpp @@ -22,7 +22,7 @@ ObjectViewerPlugin::~ObjectViewerPlugin() } qDeleteAll(_autoReleaseObjects); _autoReleaseObjects.clear(); - //Modules::release(); + Modules::release(); } bool ObjectViewerPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) @@ -43,7 +43,7 @@ void ObjectViewerPlugin::extensionsInitialized() void ObjectViewerPlugin::shutdown() { - Modules::release(); +// Modules::release(); } void ObjectViewerPlugin::setNelContext(NLMISC::INelContext *nelContext) @@ -89,6 +89,16 @@ void ObjectViewerPlugin::addAutoReleasedObject(QObject *obj) _autoReleaseObjects.prepend(obj); } +void CObjectViewerContext::open() +{ + Modules::mainWin().open(); +} + +QUndoStack *CObjectViewerContext::undoStack() +{ + return Modules::mainWin().getUndoStack(); +} + QWidget *CObjectViewerContext::widget() { return &Modules::mainWin(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_plugin.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_plugin.h index dae298fce..b5f9c2881 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_plugin.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/object_viewer_plugin.h @@ -66,14 +66,21 @@ public: { return QLatin1String("ObjectViewer"); } + virtual QString trName() const { return tr("Object Viewer"); } + virtual QIcon icon() const { return QIcon(); } + + virtual QUndoStack *undoStack(); + + virtual void open(); + virtual QWidget *widget(); }; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_editor.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_editor.h index da191705f..e4d1605e3 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_editor.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_editor.h @@ -214,7 +214,7 @@ public: { return _FontGen; } - + CSchemeManager *getSchemeManager () const { return _SchemeManager; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system_page.cpp index b9c07db1a..072297437 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_system_page.cpp @@ -605,25 +605,21 @@ void CParticleSystemPage::setMaxSteps(uint32 value) void CParticleSystemPage::setUserParam1(float value) { _Node->getPSPointer()->setUserParam(0, value); - updateModifiedFlag(); } void CParticleSystemPage::setUserParam2(float value) { _Node->getPSPointer()->setUserParam(1, value); - updateModifiedFlag(); } void CParticleSystemPage::setUserParam3(float value) { _Node->getPSPointer()->setUserParam(2, value); - updateModifiedFlag(); } void CParticleSystemPage::setUserParam4(float value) { _Node->getPSPointer()->setUserParam(3, value); - updateModifiedFlag(); } void CParticleSystemPage::setMaxViewDist(float value) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_tree_model.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_tree_model.cpp index 155e6ad4c..77286ed32 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_tree_model.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_tree_model.cpp @@ -177,7 +177,7 @@ CParticleTreeModel::~CParticleTreeModel() int CParticleTreeModel::columnCount(const QModelIndex &parent) const { if (parent.isValid()) - return static_cast(parent.internalPointer())->columnCount(); + return static_cast(parent.internalPointer())->columnCount(); else return _rootItem->columnCount(); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_dialog.cpp index 50698198b..858922af1 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_dialog.cpp @@ -222,24 +222,27 @@ void CParticleWorkspaceDialog::touchPSState(CParticleTreeItem *item) void CParticleWorkspaceDialog::clickedItem(const QModelIndex & index) { - if (_currentItem != NULL) + if (_currentItem != 0) _treeModel->getOwnerNode(_currentItem)->getPSPointer()->setCurrentEditedElement(NULL); _currentItem = static_cast(index.internalPointer()); + if (_currentItem == 0) + return; + if (index.flags() != Qt::NoItemFlags) _PropertyDialog->setCurrentEditedElement(_currentItem); if ((_currentItem->itemType() == ItemType::Workspace) || (_currentItem->itemType() == ItemType::ParticleSystemNotLoaded)) - _currentItem = NULL; + _currentItem = 0; } void CParticleWorkspaceDialog::customContextMenu() { if (!Modules::psEdit().getParticleWorkspace()) return; clickedItem(_ui.treeView->currentIndex()); - if (_currentItem == NULL) return; + if (_currentItem == 0) return; QMenu *popurMenu = new QMenu(this); switch (_currentItem->itemType()) { diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scheme_manager.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scheme_manager.h index 01a2abb35..8348fae0c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scheme_manager.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/scheme_manager.h @@ -25,10 +25,10 @@ namespace NL3D { - class CPSAttribMakerBase; +class CPSAttribMakerBase; } - -namespace NLQT + +namespace NLQT { class CSchemeManager @@ -50,10 +50,9 @@ public: void remove(NL3D::CPSAttribMakerBase *am); // rename a scheme, given a pointer on it void rename(NL3D::CPSAttribMakerBase *am, const std::string &newName); -protected: - typedef std::pair TSchemeInfo; +protected: typedef std::multimap TSchemeMap; - TSchemeMap _SchemeMap; + TSchemeMap _SchemeMap; }; } /* namespace NLQT */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.cpp index 4c677f4bf..1bceeb80b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.cpp @@ -56,6 +56,11 @@ QString SoundSettingsPage::trCategory() const return tr("Object Viewer"); } +QIcon SoundSettingsPage::categoryIcon() const +{ + return QIcon(); +} + QWidget *SoundSettingsPage::createPage(QWidget *parent) { m_page = new QWidget(parent); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.h index c27a82e1f..0e5361f54 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/sound_settings_page.h @@ -44,6 +44,7 @@ public: virtual QString trName() const; virtual QString category() const; virtual QString trCategory() const; + QIcon categoryIcon() const; virtual QWidget *createPage(QWidget *parent); virtual void apply(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/tune_timer_form.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/tune_timer_form.ui index f2f883263..8288747ce 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/tune_timer_form.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/tune_timer_form.ui @@ -6,14 +6,14 @@ 0 0 - 460 - 64 + 452 + 52 - 86 - 64 + 0 + 0 @@ -24,6 +24,12 @@ + + 3 + + + 3 + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/value_gradient_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/value_gradient_dialog.cpp index adf91c598..544ceec98 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/value_gradient_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/value_gradient_dialog.cpp @@ -1,18 +1,18 @@ -// Object Viewer Qt - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// Copyright (C) 2011 Dzmitry Kamiahin -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . // Projects include @@ -154,6 +154,9 @@ void CGradientDialog::valueDown() m_ui.listWidget->setCurrentRow(currentRow); } m_ui.listWidget->setCurrentRow(currentRow); + --currentRow; + QListWidgetItem *item = m_ui.listWidget->item(currentRow); + m_clientInterface->displayValue(currentRow, item); } void CGradientDialog::valueUp() diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/value_gradient_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/value_gradient_dialog.h index 48da2f600..dc2b366d8 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/value_gradient_dialog.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/value_gradient_dialog.h @@ -1,18 +1,18 @@ -// Object Viewer Qt - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// Copyright (C) 2011 Dzmitry Kamiahin -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . #ifndef VALUE_GRADIENT_DIALOG_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.cpp index f794e0b73..68a1f4b98 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.cpp @@ -59,6 +59,11 @@ QString VegetableSettingsPage::trCategory() const return tr("Object Viewer"); } +QIcon VegetableSettingsPage::categoryIcon() const +{ + return QIcon(); +} + QWidget *VegetableSettingsPage::createPage(QWidget *parent) { m_page = new QWidget(parent); @@ -81,6 +86,7 @@ QWidget *VegetableSettingsPage::createPage(QWidget *parent) connect(m_ui.coarseToolButton, SIGNAL(clicked()), this, SLOT(setCoarseMeshTexture())); connect(m_ui.addZoneToolButton, SIGNAL(clicked()), this, SLOT(addZone())); connect(m_ui.removeZoneToolButton, SIGNAL(clicked()), this, SLOT(removeZone())); + connect(m_ui.clearButton, SIGNAL(clicked()), m_ui.zonesListWidget, SLOT(clear())); return m_page; } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.h index bf49e2d2c..b66d070ba 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.h @@ -43,6 +43,7 @@ public: virtual QString trName() const; virtual QString category() const; virtual QString trCategory() const; + QIcon categoryIcon() const; virtual QWidget *createPage(QWidget *parent); virtual void apply(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.ui index 0d4a41cf2..13deb2d4e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/vegetable_settings_page.ui @@ -181,6 +181,17 @@ + + + + + + + + :/icons/ic_nel_reset_all.png:/icons/ic_nel_reset_all.png + + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/README b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/README new file mode 100644 index 000000000..c5c895519 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/README @@ -0,0 +1,3 @@ +OVQT Translation Manager plugin +-------------------------------- +http://dev.ryzom.com/wiki/ryzom/OVQTTranslationPluginGSoc2011 diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_main_window.cpp index 1bd91f667..01086f231 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_main_window.cpp @@ -77,7 +77,7 @@ ZonePainterMainWindow::ZonePainterMainWindow(QWidget *parent) : Core::ICore::instance()->mainWindow()->statusBar()->addPermanentWidget(m_statusInfo); - + m_undoStack = new QUndoStack(this); } void ZonePainterMainWindow::showEvent(QShowEvent *showEvent) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_main_window.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_main_window.h index d55eb39e5..0dbfd9948 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_main_window.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_main_window.h @@ -5,6 +5,7 @@ #include #include #include +#include namespace NLQT { class QNLWidget; @@ -26,7 +27,7 @@ public: void loadConfig(); void saveConfig(); - + QUndoStack *getUndoStack() { return m_undoStack; } public Q_SLOTS: void setToolMode(int value); void setToolMode(); @@ -49,7 +50,7 @@ private: QAction *_toolSelectModeAction; QAction *_toolPickModeAction; QMenu *_toolModeMenu; - + QUndoStack *m_undoStack; //QAction *m_setBackColorAction; }; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_plugin.cpp index 7b8237ccb..9ccfb9053 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_plugin.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_plugin.cpp @@ -19,6 +19,8 @@ namespace Plugin { + NLMISC_SAFE_SINGLETON_IMPL(CZoneManager) + ZonePainterPlugin::~ZonePainterPlugin() { Q_FOREACH(QObject *obj, _autoReleaseObjects) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_plugin.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_plugin.h index aeae39ba6..2c1dff53e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_plugin.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_plugin.h @@ -7,10 +7,12 @@ #include "zone_painter_main_window.h" // NeL includes -#include "nel/misc/app_context.h" +#include +#include #include #include #include +#include // Qt includes #include @@ -29,16 +31,15 @@ class IPluginSpec; namespace Plugin { - class CZoneManager { + class CZoneManager + { + NLMISC_SAFE_SINGLETON_DECL(CZoneManager) public: - NL3D::CZone zone; - - std::string getZoneInfo() { - NL3D::CZone zone; - zone.getNumPatchs(); - - return ""; - } + //m_painterLandscape = static_cast + + private: + NL3D::CLandscapeModel *m_painterLandscape; + NL3D::CZone *m_currentZone; }; class ZonePainterPlugin : public QObject, public ExtensionSystem::IPlugin @@ -79,28 +80,38 @@ class CZonePainterContext: public Core::IContext { Q_OBJECT public: - CZonePainterContext(QObject *parent = 0): IContext(parent) - { - m_zonePainterMainWindow = new ZonePainterMainWindow(); - } - virtual ~CZonePainterContext() {} - - virtual QString id() const - { - return QLatin1String("ZonePainterContext"); - } - virtual QString trName() const - { - return tr("Zone Painter"); - } - virtual QIcon icon() const - { - return QIcon(); - } - virtual QWidget *widget() - { - return m_zonePainterMainWindow; - } + CZonePainterContext(QObject *parent = 0): IContext(parent) + { + m_zonePainterMainWindow = new ZonePainterMainWindow(); + } + virtual ~CZonePainterContext() {} + + virtual QString id() const + { + return QLatin1String("ZonePainterContext"); + } + virtual QString trName() const + { + return tr("Zone Painter"); + } + virtual QIcon icon() const + { + return QIcon(); + } + virtual QWidget *widget() + { + return m_zonePainterMainWindow; + } + + virtual QUndoStack *undoStack() + { + return m_zonePainterMainWindow->getUndoStack(); + } + virtual void open() + { + } + + ZonePainterMainWindow *m_zonePainterMainWindow; }; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_settings_page.cpp index 69c4e7525..e59f76da1 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_settings_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_settings_page.cpp @@ -53,6 +53,11 @@ QString CZonePainterSettingsPage::trCategory() const return tr("General"); } +QIcon CZonePainterSettingsPage::categoryIcon() const +{ + return QIcon(); +} + QWidget *CZonePainterSettingsPage::createPage(QWidget *parent) { _currentPage = new QWidget(parent); @@ -64,4 +69,4 @@ void CZonePainterSettingsPage::apply() { } -} /* namespace Plugin */ \ No newline at end of file +} /* namespace Plugin */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_settings_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_settings_page.h index 8e4b3f3d6..d84b117eb 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_settings_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/zone_painter/zone_painter_settings_page.h @@ -43,6 +43,7 @@ public: virtual QString trName() const; virtual QString category() const; virtual QString trCategory() const; + QIcon categoryIcon() const; virtual QWidget *createPage(QWidget *parent); virtual void apply(); 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 4c6d25b3a..70bf51f81 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 @@ -62,7 +62,8 @@ namespace NLQT _CameraFocal(75), _CurrentInstance(""), _BloomEffect(false), _Scene(0), QWidget(parent) { - + setMouseTracking(true); + setFocusPolicy(Qt::StrongFocus); _objectViewerWidget = this; _isGraphicsEnabled = true; @@ -78,7 +79,7 @@ namespace NLQT CObjectViewerWidget::~CObjectViewerWidget() { - + release(); } void CObjectViewerWidget::showEvent ( QShowEvent * event ) @@ -261,7 +262,7 @@ namespace NLQT //updateAnimation(_AnimationDialog->getTime()); - + updateAnimatePS(); // 10. Update Camera (depends on entities) // ... @@ -718,6 +719,19 @@ namespace NLQT //CFile::deleteFile(filename); return icon; } + + void CObjectViewerWidget::updateAnimatePS(uint64 deltaTime) + { + static sint64 firstTime = NLMISC::CTime::getLocalTime(); + static sint64 lastTime = NLMISC::CTime::getLocalTime(); + if (deltaTime == 0) + { + deltaTime = NLMISC::CTime::getLocalTime() - lastTime; + } + lastTime += deltaTime; + float fdelta = 0.001f * (float) (lastTime - firstTime); + _Scene->animate ( fdelta); + } #if defined(NL_OS_WINDOWS) diff --git a/code/nel/tools/3d/object_viewer_widget/src/object_viewer_widget.h b/code/nel/tools/3d/object_viewer_widget/src/object_viewer_widget.h index 82bf26f92..15c9b0fa9 100644 --- a/code/nel/tools/3d/object_viewer_widget/src/object_viewer_widget.h +++ b/code/nel/tools/3d/object_viewer_widget/src/object_viewer_widget.h @@ -178,6 +178,10 @@ namespace NLQT void updateRender(); private: + + /// Update the animation time for Particle System animation. + /// @param deltaTime - set the manual animation time. + void updateAnimatePS(uint64 deltaTime = 0); static CObjectViewerWidget *_objectViewerWidget; diff --git a/code/nel/tools/3d/panoply_maker/panoply_maker.cpp b/code/nel/tools/3d/panoply_maker/panoply_maker.cpp index 9f51d86f7..6be9590c2 100644 --- a/code/nel/tools/3d/panoply_maker/panoply_maker.cpp +++ b/code/nel/tools/3d/panoply_maker/panoply_maker.cpp @@ -140,7 +140,7 @@ int main(int argc, char* argv[]) NLMISC::CPath::addSearchPath(NLMISC::CPath::standardizePath(additionnal_paths.asString(k)),true, false); } } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { } @@ -149,7 +149,7 @@ int main(int argc, char* argv[]) { _Path_Input_TexBases = NLMISC::CPath::standardizePath(cf.getVar ("input_path_texbase").asString()); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { } @@ -158,7 +158,7 @@ int main(int argc, char* argv[]) { _Path_Input_Masks = NLMISC::CPath::standardizePath(cf.getVar ("input_path_mask").asString()); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { } @@ -167,7 +167,7 @@ int main(int argc, char* argv[]) { _Path_Output_MaksOptimized = NLMISC::CPath::standardizePath(cf.getVar ("output_path_mask_optimized").asString()); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { } @@ -176,7 +176,7 @@ int main(int argc, char* argv[]) { _Path_Output_Cgi = NLMISC::CPath::standardizePath(cf.getVar ("output_path_cgi").asString()); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { } @@ -185,12 +185,12 @@ int main(int argc, char* argv[]) { _Path_Output_Gtm = NLMISC::CPath::standardizePath(cf.getVar ("output_path_gtm").asString()); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { } } - catch (std::exception &e) + catch (const std::exception &e) { nlwarning("Panoply building failed."); nlwarning(e.what()); @@ -256,7 +256,7 @@ int main(int argc, char* argv[]) NLMISC::CPath::addSearchPath(NLMISC::CPath::standardizePath(additionnal_paths.asString(k))); } } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { } @@ -265,7 +265,7 @@ int main(int argc, char* argv[]) { bi.InputPath = NLMISC::CPath::standardizePath(cf.getVar ("input_path").asString()); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { } @@ -274,7 +274,7 @@ int main(int argc, char* argv[]) { bi.OutputPath = NLMISC::CPath::standardizePath(cf.getVar ("output_path").asString()); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { } @@ -283,7 +283,7 @@ int main(int argc, char* argv[]) { bi.HlsInfoPath = NLMISC::CPath::standardizePath(cf.getVar("hls_info_path").asString()); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { bi.HlsInfoPath = "hlsInfo/"; } @@ -293,7 +293,7 @@ int main(int argc, char* argv[]) { bi.CachePath = NLMISC::CPath::standardizePath(cf.getVar ("cache_path").asString()); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { } @@ -302,7 +302,7 @@ int main(int argc, char* argv[]) { bi.OutputFormat = "." + cf.getVar ("output_format").asString(); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { bi.OutputFormat = ".tga"; } @@ -312,7 +312,7 @@ int main(int argc, char* argv[]) { bi.DefaultSeparator = cf.getVar ("default_separator").asString(); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { bi.DefaultSeparator = '_'; } @@ -330,7 +330,7 @@ int main(int argc, char* argv[]) } } } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { bi.BitmapExtensions[0].resize(1); bi.BitmapExtensions[0] = bi.OutputFormat; @@ -340,14 +340,14 @@ int main(int argc, char* argv[]) { bi.LowDefShift = cf.getVar ("low_def_shift").asInt(); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { // tranform 512*512 to 64*64 by default bi.LowDefShift= 3; } } - catch (std::exception &e) + catch (const std::exception &e) { nlwarning("Panoply building failed."); nlwarning(e.what()); @@ -361,7 +361,7 @@ int main(int argc, char* argv[]) { BuildColoredVersions(bi); } - catch (std::exception &e) + catch (const std::exception &e) { nlwarning("Something went wrong while building bitmap : %s", e.what()); return -1; @@ -389,7 +389,7 @@ static void validateCgiInfo() f.serialCont(temp); } - catch(std::exception &e) + catch(const std::exception &e) { nlwarning("Panoply building failed."); } @@ -491,7 +491,7 @@ static void BuildColoredVersions(const CBuildInfo &bi) //nlwarning(("No need to rebuild " + NLMISC::CFile::getFilename(files[k])).c_str()); } } - catch (std::exception &e) + catch (const std::exception &e) { nlwarning("Processing of %s failed : %s \n", files[k].c_str(), e.what()); } @@ -662,7 +662,7 @@ static void BuildColoredVersionForOneBitmap(const CBuildInfo &bi, const std::str return; } } - catch (NLMISC::Exception &) + catch (const NLMISC::Exception &) { nlwarning("File or format error with : %s. Processing next...", fileNameWithExtension.c_str()); return; @@ -743,7 +743,7 @@ static void BuildColoredVersionForOneBitmap(const CBuildInfo &bi, const std::str return; } } - catch (std::exception &e) + catch (const std::exception &e) { nlwarning("Error with : %s : %s. Aborting this bitmap processing", maskFileName.c_str(), e.what()); return; @@ -827,7 +827,7 @@ static void BuildColoredVersionForOneBitmap(const CBuildInfo &bi, const std::str nlwarning(("Couldn't open " + bi.OutputPath + outputFileName + bi.OutputFormat + " for writing").c_str()); } } - catch(NLMISC::EStream &e) + catch(const NLMISC::EStream &e) { nlwarning(("Couldn't write " + bi.OutputPath + outputFileName + bi.OutputFormat + " : " + e.what()).c_str()); } diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/nel_patch_paint.h b/code/nel/tools/3d/plugin_max/nel_patch_paint/nel_patch_paint.h index 11b8c8ff2..944807aca 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/nel_patch_paint.h +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/nel_patch_paint.h @@ -578,13 +578,16 @@ class PaintPatchData : public LocalModData { LocalModData *Clone() { return new PaintPatchData(*this); } void SetFlag(DWORD f,BOOL on) - { - if ( on ) { + { + if ( on ) + { flags|=f; - } else { - flags&=~f; - } } + else + { + flags&=~f; + } + } DWORD GetFlag(DWORD f) { return flags&f; } EPTempData *TempData(PaintPatchMod *mod); diff --git a/code/nel/tools/3d/shapes_exporter/shapes_exporter.cpp b/code/nel/tools/3d/shapes_exporter/shapes_exporter.cpp index a9cff1fc1..ad8e8ec3f 100644 --- a/code/nel/tools/3d/shapes_exporter/shapes_exporter.cpp +++ b/code/nel/tools/3d/shapes_exporter/shapes_exporter.cpp @@ -99,7 +99,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) // load the config file cf.load(filename); } - catch(exception &e) + catch(const exception &e) { nlwarning("can't parse config file : %s", filename.c_str()); nlwarning(e.what()); @@ -111,7 +111,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) { settings.input_path = CPath::standardizePath(cf.getVar("input_path").asString()); } - catch (EUnknownVar &) + catch (const EUnknownVar &) { } @@ -120,7 +120,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) { settings.output_path = CPath::standardizePath(cf.getVar("output_path").asString()); } - catch (EUnknownVar &) + catch (const EUnknownVar &) { } @@ -129,7 +129,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) { settings.output_format = cf.getVar("output_format").asString(); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { settings.output_format = "jpg"; } @@ -141,7 +141,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) for (uint i=0; i < (uint)search_pathes.size(); ++i) CPath::addSearchPath(CPath::standardizePath(search_pathes.asString(i))); } - catch(EUnknownVar &) + catch(const EUnknownVar &) { } @@ -152,7 +152,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) for (uint i=0; i< (uint)recursive_search_pathes.size(); ++i) CPath::addSearchPath(CPath::standardizePath(recursive_search_pathes.asString(i)), true, false); } - catch(EUnknownVar &) + catch(const EUnknownVar &) { } @@ -171,7 +171,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) CPath::remapExtension(extensions_remapping.asString(i), extensions_remapping.asString(i+1), true); } } - catch (EUnknownVar &) + catch (const EUnknownVar &) { } @@ -180,7 +180,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) { settings.preview_format = cf.getVar("preview_format").asString(); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { settings.preview_format = "jpg"; } @@ -190,7 +190,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) { settings.preview_width = cf.getVar("preview_width").asInt(); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { settings.preview_width = 256; } @@ -200,7 +200,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) { settings.preview_height = cf.getVar("preview_height").asInt(); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { settings.preview_height = 256; } @@ -210,7 +210,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) { settings.preview_quality = (uint8)cf.getVar("preview_quality").asInt(); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { settings.preview_quality = 90; } @@ -223,7 +223,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) settings.output_background.G = (uint8)var.asInt(1); settings.output_background.B = (uint8)var.asInt(2); } - catch (EUnknownVar &) + catch (const EUnknownVar &) { settings.output_background = CRGBA::Black; } @@ -236,7 +236,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) settings.light_ambiant.G = (uint8)var.asInt(1); settings.light_ambiant.B = (uint8)var.asInt(2); } - catch (EUnknownVar &) + catch (const EUnknownVar &) { settings.light_ambiant = CRGBA::White; } @@ -249,7 +249,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) settings.light_diffuse.G = (uint8)var.asInt(1); settings.light_diffuse.B = (uint8)var.asInt(2); } - catch (EUnknownVar &) + catch (const EUnknownVar &) { settings.light_diffuse = CRGBA::White; } @@ -262,7 +262,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) settings.light_specular.G = (uint8)var.asInt(1); settings.light_specular.B = (uint8)var.asInt(2); } - catch (EUnknownVar &) + catch (const EUnknownVar &) { settings.light_specular = CRGBA::White; } @@ -273,7 +273,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) CConfigFile::CVar &var = cf.getVar("light_direction"); settings.light_direction = CVector(var.asFloat(0), var.asFloat(1), var.asFloat(2)); } - catch (EUnknownVar &) + catch (const EUnknownVar &) { settings.light_direction = CVector(0.f, 1.f, 0.f); } @@ -283,7 +283,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) { settings.output_steps_z = cf.getVar("output_steps_z").asInt(); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { settings.output_steps_z = 10; } @@ -293,7 +293,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) { settings.output_steps_x = cf.getVar("output_steps_x").asInt(); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { settings.output_steps_x = 10; } @@ -303,7 +303,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) { settings.output_width = cf.getVar("output_width").asInt(); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { settings.output_width = 256; } @@ -313,7 +313,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) { settings.output_height = cf.getVar("output_height").asInt(); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { settings.output_height = 256; } @@ -323,7 +323,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) { settings.output_antialiasing = (uint8)cf.getVar("output_antialiasing").asInt(); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { settings.output_antialiasing = 2; } @@ -333,7 +333,7 @@ bool ShapesExporter::parseConfigFile(const string &filename) { settings.output_quality = (uint8)cf.getVar("output_quality").asInt(); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { settings.output_quality = 90; } diff --git a/code/nel/tools/3d/tga_2_dds/tga2dds.cpp b/code/nel/tools/3d/tga_2_dds/tga2dds.cpp index 4328c48fb..27e7b1603 100644 --- a/code/nel/tools/3d/tga_2_dds/tga2dds.cpp +++ b/code/nel/tools/3d/tga_2_dds/tga2dds.cpp @@ -629,7 +629,7 @@ int main(int argc, char **argv) picSrc.writePNG (output, 8); } } - catch(NLMISC::EWriteError &e) + catch(const NLMISC::EWriteError &e) { cerr<Name.c_str(), e.what()); } @@ -734,7 +734,7 @@ static void computeZoneIGBBox(const char *zoneName, CLightingBBox &result, TShap { ig.serial(igFile); } - catch (NLMISC::Exception &e) + catch (const NLMISC::Exception &e) { nlwarning("Error while reading an instance group file : %s \n reason : %s", pathName.c_str(), e.what()); return; @@ -803,7 +803,7 @@ static void computeBBoxFromVillage(const NLGEORGES::UFormElm *villageItem, computeIGBBox(group, currBBox, shapeMap); result.makeUnion(currBBox); } - catch(NLMISC::Exception &) + catch(const NLMISC::Exception &) { nlwarning ("Error while loading instance group %s\n", igName.c_str()); continue; @@ -909,7 +909,7 @@ static void computeIGBBoxFromContinent(NLMISC::CConfigFile ¶meter, nlwarning("Can't load continent form : %s", continentName.c_str()); } } - catch (NLMISC::EUnknownVar &e) + catch (const NLMISC::EUnknownVar &e) { nlinfo(e.what()); } diff --git a/code/nel/tools/3d/zone_dump/zone_dump.cpp b/code/nel/tools/3d/zone_dump/zone_dump.cpp index 9e37aa0b3..b03accdc4 100644 --- a/code/nel/tools/3d/zone_dump/zone_dump.cpp +++ b/code/nel/tools/3d/zone_dump/zone_dump.cpp @@ -211,7 +211,7 @@ int main(int argc, char* argv[]) } } } - catch (Exception& e) + catch (const Exception& e) { fprintf (stderr, "FATAL: %s", e.what()); } 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 bdf564a66..1c074fd77 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 @@ -241,7 +241,7 @@ int main(int argc, char* argv[]) landscape->TileBank.serial (inputFile); landscape->initTileBanks(); } - catch (Exception &e) + catch (const Exception &e) { // Error nlwarning ("ERROR error loading tile bank %s\n%s\n", bank_name.c_str(), e.what()); @@ -305,7 +305,7 @@ int main(int argc, char* argv[]) } } } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { nlinfo("No additionnal ig's to load"); } @@ -515,7 +515,7 @@ int main(int argc, char* argv[]) // Save the new ig outputFile.serial(output); } - catch (Exception& except) + catch (const Exception& except) { // Error message nlwarning ("ERROR writing %s: %s\n", argv[2], except.what()); @@ -533,7 +533,7 @@ int main(int argc, char* argv[]) nlwarning ("ERROR Abort: files are missing.\n"); } } - catch (Exception& except) + catch (const Exception& except) { // Error message nlwarning ("ERROR %s\n", except.what()); diff --git a/code/nel/tools/3d/zone_lighter/zone_lighter.cpp b/code/nel/tools/3d/zone_lighter/zone_lighter.cpp index 8608958e0..d00db9438 100644 --- a/code/nel/tools/3d/zone_lighter/zone_lighter.cpp +++ b/code/nel/tools/3d/zone_lighter/zone_lighter.cpp @@ -158,7 +158,7 @@ static void loadIGFromVillage(const NLGEORGES::UFormElm *villageItem, const std: { group->serial (inputFile); } - catch(NLMISC::Exception &) + catch(const NLMISC::Exception &) { nlwarning ("Error while loading instance group %s\n", igName.c_str()); continue; @@ -266,7 +266,7 @@ static void loadIGFromContinent(NLMISC::CConfigFile ¶meter, std::listTileBank.serial (inputFile); landscape->initTileBanks(); } - catch (Exception &e) + catch (const Exception &e) { // Error nlwarning ("ERROR error loading tile bank %s\n%s\n", bankName.c_str(), e.what()); @@ -581,7 +581,7 @@ int main(int argc, char* argv[]) } } } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { nlinfo("No additionnal ig's to load"); } @@ -835,7 +835,7 @@ int main(int argc, char* argv[]) // load it output.serial (zonelFile); } - catch (Exception& except) + catch (const Exception& except) { // Error message nlwarning ("ERROR reading %s: %s\n", argv[2], except.what()); @@ -860,7 +860,7 @@ int main(int argc, char* argv[]) { output.serial (outputFile); } - catch (Exception& except) + catch (const Exception& except) { nlwarning ("ERROR backuping %s: %s\n", bkupFile.c_str(), except.what()); } @@ -886,7 +886,7 @@ int main(int argc, char* argv[]) // Save it output.serial (outputFile); } - catch (Exception& except) + catch (const Exception& except) { // Error message nlwarning ("ERROR writing %s: %s\n", argv[2], except.what()); @@ -909,7 +909,7 @@ int main(int argc, char* argv[]) nlwarning ("ERROR Abort: files are missing.\n"); } } - catch (Exception& except) + catch (const Exception& except) { // Error message nlwarning ("ERROR %s\n", except.what()); diff --git a/code/nel/tools/3d/zone_welder/zone_welder.cpp b/code/nel/tools/3d/zone_welder/zone_welder.cpp index 9e0d94e37..e2b345e9e 100644 --- a/code/nel/tools/3d/zone_welder/zone_welder.cpp +++ b/code/nel/tools/3d/zone_welder/zone_welder.cpp @@ -270,7 +270,7 @@ void weldZones(const char *center) adjZonesName[i]="empty"; } } - catch(exception &e) + catch(const exception &e) { nlwarning ("ERROR %s\n", e.what ()); adjZoneFileFound[i] = false; diff --git a/code/nel/tools/3d/zviewer/zviewer.cpp b/code/nel/tools/3d/zviewer/zviewer.cpp index 6cd17e7df..da966b420 100644 --- a/code/nel/tools/3d/zviewer/zviewer.cpp +++ b/code/nel/tools/3d/zviewer/zviewer.cpp @@ -364,7 +364,7 @@ void displayZones() CIFile bankFile (ViewerCfg.BanksPath + "/" + ViewerCfg.Bank); Landscape->Landscape.TileBank.serial(bankFile); } - catch(Exception) + catch(const Exception &) { string tmp = string("Cant load bankfile ")+ViewerCfg.BanksPath + "/" + ViewerCfg.Bank; nlerror (tmp.c_str()); @@ -390,7 +390,7 @@ void displayZones() CIFile farbankFile(ViewerCfg.BanksPath + "/" + farBank); Landscape->Landscape.TileFarBank.serial(farbankFile); } - catch(Exception) + catch(const Exception &) { string tmp = string("Cant load bankfile ")+ViewerCfg.BanksPath + "/" + farBank; nlerror (tmp.c_str()); @@ -450,7 +450,7 @@ void displayZones() // Add it to collision manager. CollisionManager.addZone(zone.getZoneId()); } - catch(Exception &e) + catch(const Exception &e) { printf("%s\n", e.what ()); } @@ -472,7 +472,7 @@ void displayZones() // Add it to the scene. group->addToScene (*CNELU::Scene); } - catch(Exception &e) + catch(const Exception &e) { printf("%s\n", e.what ()); } @@ -940,7 +940,7 @@ void initViewerConfig(const char * configFileName) } } - catch (EConfigFile &e) + catch (const EConfigFile &e) { nlerror("Problem in config file : %s\n", e.what ()); } @@ -970,7 +970,7 @@ int main(int /* argc */, char ** /* argv */) initViewerConfig("zviewer.cfg"); // Init NELU - NL3D::CNELU::init(ViewerCfg.Width, ViewerCfg.Height, CViewport(), ViewerCfg.Depth, ViewerCfg.Windowed, NULL, false, false); + NL3D::CNELU::init(ViewerCfg.Width, ViewerCfg.Height, CViewport(), ViewerCfg.Depth, ViewerCfg.Windowed, EmptyWindow, false, false); NL3D::CNELU::Driver->setWindowTitle(ucstring("NeL ZViewer")); NL3D::CNELU::Camera->setTransformMode(ITransformable::DirectMatrix); @@ -985,7 +985,7 @@ int main(int /* argc */, char ** /* argv */) // release nelu NL3D::CNELU::release(); } - catch (Exception &e) + catch (const Exception &e) { nlerror("main trapped an exception: '%s'", e.what ()); } diff --git a/code/nel/tools/georges/georges2csv/georges2csv.cpp b/code/nel/tools/georges/georges2csv/georges2csv.cpp index b5785159a..e10d06bf5 100644 --- a/code/nel/tools/georges/georges2csv/georges2csv.cpp +++ b/code/nel/tools/georges/georges2csv/georges2csv.cpp @@ -838,7 +838,7 @@ void convertCsvFile( const string &file, bool generate, const string& sheetType ForceInsertParents = (fiparents->asInt() == 1); nlinfo( "Force insert parents mode: %s", ForceInsertParents ? "ON" : "OFF" ); } - catch ( EConfigFile& e ) + catch (const EConfigFile &e) { nlwarning( "Problem in directory mapping: %s", e.what() ); } diff --git a/code/nel/tools/misc/bnp_make/main.cpp b/code/nel/tools/misc/bnp_make/main.cpp index cf0332d2a..6f0c6a235 100644 --- a/code/nel/tools/misc/bnp_make/main.cpp +++ b/code/nel/tools/misc/bnp_make/main.cpp @@ -99,6 +99,7 @@ struct BNPHeader fclose(f); return false; } + for (uint32 i = 0; i < nNbFile; ++i) { uint8 nStringSize = (uint8)Files[i].Name.size(); @@ -424,13 +425,13 @@ int main (int nNbArg, char **ppArgs) } else { - nlwarning ("ERROR (bnp_make.exe) : can't set current directory to %s", ppArgs[2]); + nlwarning ("ERROR (bnp_make) : can't set current directory to %s", ppArgs[2]); return -1; } } else { - nlwarning ("ERROR (bnp_make.exe) : can't set current directory to %s", ppArgs[3]); + nlwarning ("ERROR (bnp_make) : can't set current directory to %s", ppArgs[3]); return -1; } } @@ -438,7 +439,7 @@ int main (int nNbArg, char **ppArgs) { if (chdir (ppArgs[2]) == -1) { - nlwarning ("ERROR (bnp_make.exe) : can't set current directory to %s", ppArgs[2]); + nlwarning ("ERROR (bnp_make) : can't set current directory to %s", ppArgs[2]); return -1; } //getcwd (sCurDir, MAX_PATH); @@ -475,7 +476,7 @@ int main (int nNbArg, char **ppArgs) } else { - nlwarning ("ERROR (bnp_make.exe) : can't set current directory to %s", path.c_str()); + nlwarning ("ERROR (bnp_make) : can't set current directory to %s", path.c_str()); return -1; } } @@ -521,7 +522,7 @@ int main (int nNbArg, char **ppArgs) } else { - nlwarning ("ERROR (bnp_make.exe) : can't set current directory to %s", path.c_str()); + nlwarning ("ERROR (bnp_make) : can't set current directory to %s", path.c_str()); return -1; } } diff --git a/code/nel/tools/misc/extract_filename/extract_filename.cpp b/code/nel/tools/misc/extract_filename/extract_filename.cpp index c8ca13452..39fead0e4 100644 --- a/code/nel/tools/misc/extract_filename/extract_filename.cpp +++ b/code/nel/tools/misc/extract_filename/extract_filename.cpp @@ -23,7 +23,7 @@ using namespace NLMISC; #ifdef NL_DEBUG #define INFO nlinfo #else // NL_DEBUG -# if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) +# if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) # define INFO __noop # else # define INFO 0&& diff --git a/code/nel/tools/misc/lock/lock.cpp b/code/nel/tools/misc/lock/lock.cpp index efdda5d73..616095bb6 100644 --- a/code/nel/tools/misc/lock/lock.cpp +++ b/code/nel/tools/misc/lock/lock.cpp @@ -25,7 +25,7 @@ int main(int argc, char* argv[]) { if (argc <3) { - printf ("lock.exe [filein] [fleout]\n\t"); + printf ("lock [filein] [fleout]\n\t"); } else { diff --git a/code/nel/tools/nel_unit_test/ut_net_module.h b/code/nel/tools/nel_unit_test/ut_net_module.h index 871901f8d..15d526075 100644 --- a/code/nel/tools/nel_unit_test/ut_net_module.h +++ b/code/nel/tools/nel_unit_test/ut_net_module.h @@ -193,7 +193,7 @@ public: { invokeModuleOperation(proxy, msg, resp); } - catch(IModule::EInvokeFailed) + catch(const IModule::EInvokeFailed &) { ResponseReceived++; } diff --git a/code/nel/tools/pacs/build_ig_boxes/main.cpp b/code/nel/tools/pacs/build_ig_boxes/main.cpp index 046e5ee74..7e917d85e 100644 --- a/code/nel/tools/pacs/build_ig_boxes/main.cpp +++ b/code/nel/tools/pacs/build_ig_boxes/main.cpp @@ -112,7 +112,7 @@ void init() CPath::addSearchPath(cvPathes.asString(i)); } } - catch (EConfigFile &e) + catch (const EConfigFile &e) { printf ("Problem in config file : %s\n", e.what ()); } @@ -219,7 +219,7 @@ int main(int argc, char **argv) COFile output(Output); output.serialCont(Boxes); } - catch (Exception &e) + catch (const Exception &e) { fprintf (stderr,"main trapped an exception: '%s'\n", e.what ()); } diff --git a/code/nel/tools/pacs/build_indoor_rbank/main.cpp b/code/nel/tools/pacs/build_indoor_rbank/main.cpp index 1d459e2ee..b432f372a 100644 --- a/code/nel/tools/pacs/build_indoor_rbank/main.cpp +++ b/code/nel/tools/pacs/build_indoor_rbank/main.cpp @@ -146,7 +146,7 @@ void initConfig() for (i=0; i<(uint)meshes.size(); i++) Meshes.push_back(meshes.asString(i)); } - catch (EConfigFile &e) + catch (const EConfigFile &e) { printf ("Problem in config file : %s\n", e.what ()); } @@ -195,7 +195,7 @@ void makeGlobalRetriever(vector &translation) ninst.push_back(iid); } } - catch (Exception &e) + catch (const Exception &e) { nlwarning("WARNING: can't merge lr '%s.lr': %s", Meshes[i].c_str(), e.what()); } @@ -303,7 +303,7 @@ void createRetriever(vector &translation) // Save the lr file serialAndSave(lr, OutputPath+meshName+".lr"); } - catch (Exception &e) + catch (const Exception &e) { nlwarning("WARNING: can compute lr '%s.lr': %s", meshName.c_str(), e.what()); } diff --git a/code/nel/tools/pacs/build_rbank/build_rbank.cpp b/code/nel/tools/pacs/build_rbank/build_rbank.cpp index 0a8091a5f..295409508 100644 --- a/code/nel/tools/pacs/build_rbank/build_rbank.cpp +++ b/code/nel/tools/pacs/build_rbank/build_rbank.cpp @@ -215,7 +215,7 @@ void processAllPasses(string &zoneName) retriever.serial(outputRetriever); } } - catch(Exception &e) + catch(const Exception &e) { printf("%s\n", e.what ()); } @@ -264,7 +264,7 @@ void tessellateAndMoulineZone(string &zoneName) nlinfo("WARNING: IG list no found"); } } - catch (Exception &) { nlinfo("WARNING: IG list no found"); } + catch (const Exception &) { nlinfo("WARNING: IG list no found"); } for (i=0; iasString(i)); } } - catch (EConfigFile &e) + catch (const EConfigFile &e) { nlwarning("Problem in config file : %s\n", e.what ()); } @@ -383,7 +383,7 @@ int main(int argc, char **argv) if (Verbose) nlinfo("total computation time: %d days, %d hours, %d minutes and %d seconds", workDay, workHour, workMinute, workSecond); } - catch (Exception &e) + catch (const Exception &e) { nlwarning ("main trapped an exception: '%s'\n", e.what ()); } diff --git a/code/nel/tools/pacs/build_rbank/prim_checker.cpp b/code/nel/tools/pacs/build_rbank/prim_checker.cpp index 678972f91..5273db1da 100644 --- a/code/nel/tools/pacs/build_rbank/prim_checker.cpp +++ b/code/nel/tools/pacs/build_rbank/prim_checker.cpp @@ -171,7 +171,7 @@ bool CPrimChecker::build(const string &primitivesPath, const string &igLandPath, } } } - catch (Exception &e) + catch (const Exception &e) { nlwarning("%s", e.what()); } diff --git a/code/ryzom/client/client_default.cfg b/code/ryzom/client/client_default.cfg index ca6534931..c29ca9b93 100644 --- a/code/ryzom/client/client_default.cfg +++ b/code/ryzom/client/client_default.cfg @@ -385,21 +385,21 @@ SystemInfoColors = }; PrintfCommands = { - "52", "15", "55 55 0 255", "28", "uiChapterIV", "624", + "52", "15", "55 55 0 255", "28", "uiChapterV", "624", "428", "0 0 0 255", "18", "", "624", "378", "0 0 0 255", "14", "", "644", "278", "0 0 0 255", "18", "", "52", "17", "255 255 255 255", "28", - "uiChapterIV", "622", "430", "255 255 255 255", "18", "", + "uiChapterV", "622", "430", "255 255 255 255", "18", "", "622", "380", "255 255 255 255", "14", "", "642", "280", "255 255 255 255", "18", "" }; PrintfCommandsFreeTrial = { - "52", "15", "55 55 0 255", "28", "uiChapterIV", "624", + "52", "15", "55 55 0 255", "28", "uiChapterV", "624", "428", "0 0 0 255", "18", "", "624", "378", "0 0 0 255", "14", "", "644", "278", "0 0 0 255", "18", "", "52", "17", "255 255 255 255", "28", - "uiChapterIV", "622", "430", "255 255 255 255", "18", "", + "uiChapterV", "622", "430", "255 255 255 255", "18", "", "622", "380", "255 255 255 255", "14", "", "642", "280", "255 255 255 255", "18", "" }; diff --git a/code/ryzom/client/data/gamedev/adds/interfaces/color_palette.dds b/code/ryzom/client/data/gamedev/adds/interfaces/color_palette.dds new file mode 100644 index 000000000..86be36532 Binary files /dev/null and b/code/ryzom/client/data/gamedev/adds/interfaces/color_palette.dds differ diff --git a/code/ryzom/client/data/gamedev/adds/interfaces/new_texture_interfaces_dxtc.tga b/code/ryzom/client/data/gamedev/adds/interfaces/new_texture_interfaces_dxtc.tga index 026fada23..bbeeab27b 100644 Binary files a/code/ryzom/client/data/gamedev/adds/interfaces/new_texture_interfaces_dxtc.tga and b/code/ryzom/client/data/gamedev/adds/interfaces/new_texture_interfaces_dxtc.tga differ diff --git a/code/ryzom/client/data/gamedev/adds/interfaces/new_texture_interfaces_dxtc.txt b/code/ryzom/client/data/gamedev/adds/interfaces/new_texture_interfaces_dxtc.txt index 0927a36e8..ec1afb449 100644 --- a/code/ryzom/client/data/gamedev/adds/interfaces/new_texture_interfaces_dxtc.txt +++ b/code/ryzom/client/data/gamedev/adds/interfaces/new_texture_interfaces_dxtc.txt @@ -194,474 +194,481 @@ PA_earring.tga 0.820312500000 0.117187500000 0.859375000000 0.156250000000 PA_pendant.tga 0.859375000000 0.117187500000 0.898437500000 0.156250000000 PA_ring.tga 0.898437500000 0.117187500000 0.937500000000 0.156250000000 protect_amber.tga 0.937500000000 0.117187500000 0.976562500000 0.156250000000 -pw_4.tga 0.468750000000 0.156250000000 0.507812500000 0.195312500000 -pw_5.tga 0.507812500000 0.156250000000 0.546875000000 0.195312500000 -PW_heavy.tga 0.546875000000 0.156250000000 0.585937500000 0.195312500000 -PW_light.tga 0.585937500000 0.156250000000 0.625000000000 0.195312500000 -PW_medium.tga 0.625000000000 0.156250000000 0.664062500000 0.195312500000 -quest_coeur.tga 0.664062500000 0.156250000000 0.703125000000 0.195312500000 -quest_foie.tga 0.703125000000 0.156250000000 0.742187500000 0.195312500000 -quest_jeton.tga 0.742187500000 0.156250000000 0.781250000000 0.195312500000 -quest_langue.tga 0.781250000000 0.156250000000 0.820312500000 0.195312500000 -quest_louche.tga 0.820312500000 0.156250000000 0.859375000000 0.195312500000 -quest_oreille.tga 0.859375000000 0.156250000000 0.898437500000 0.195312500000 -quest_patte.tga 0.898437500000 0.156250000000 0.937500000000 0.195312500000 -quest_poils.tga 0.937500000000 0.156250000000 0.976562500000 0.195312500000 -quest_queue.tga 0.468750000000 0.195312500000 0.507812500000 0.234375000000 -quest_ticket.tga 0.507812500000 0.195312500000 0.546875000000 0.234375000000 -AM_logo.tga 0.546875000000 0.195312500000 0.585937500000 0.234375000000 -AR_armpad.tga 0.585937500000 0.195312500000 0.625000000000 0.234375000000 -ar_armpad_mask.tga 0.625000000000 0.195312500000 0.664062500000 0.234375000000 -requirement.tga 0.664062500000 0.195312500000 0.703125000000 0.234375000000 -rm_f.tga 0.703125000000 0.195312500000 0.742187500000 0.234375000000 -rm_f_upgrade.tga 0.742187500000 0.195312500000 0.781250000000 0.234375000000 -rm_h.tga 0.781250000000 0.195312500000 0.820312500000 0.234375000000 -rm_h_upgrade.tga 0.820312500000 0.195312500000 0.859375000000 0.234375000000 -rm_m.tga 0.859375000000 0.195312500000 0.898437500000 0.234375000000 -rm_m_upgrade.tga 0.898437500000 0.195312500000 0.937500000000 0.234375000000 -rm_r.tga 0.937500000000 0.195312500000 0.976562500000 0.234375000000 -rm_r_upgrade.tga 0.468750000000 0.234375000000 0.507812500000 0.273437500000 -rpjobitem_200_a.tga 0.507812500000 0.234375000000 0.546875000000 0.273437500000 -rpjobitem_200_b.tga 0.546875000000 0.234375000000 0.585937500000 0.273437500000 -rpjobitem_200_c.tga 0.585937500000 0.234375000000 0.625000000000 0.273437500000 -rpjobitem_201_a.tga 0.625000000000 0.234375000000 0.664062500000 0.273437500000 -rpjobitem_201_b.tga 0.664062500000 0.234375000000 0.703125000000 0.273437500000 -rpjobitem_201_c.tga 0.703125000000 0.234375000000 0.742187500000 0.273437500000 -rpjobitem_202_a.tga 0.742187500000 0.234375000000 0.781250000000 0.273437500000 -rpjobitem_202_b.tga 0.781250000000 0.234375000000 0.820312500000 0.273437500000 -rpjobitem_202_c.tga 0.820312500000 0.234375000000 0.859375000000 0.273437500000 -rpjobitem_203_a.tga 0.859375000000 0.234375000000 0.898437500000 0.273437500000 -rpjobitem_203_b.tga 0.898437500000 0.234375000000 0.937500000000 0.273437500000 -rpjobitem_203_c.tga 0.937500000000 0.234375000000 0.976562500000 0.273437500000 -rpjobitem_204_a.tga 0.468750000000 0.273437500000 0.507812500000 0.312500000000 -rpjobitem_204_b.tga 0.507812500000 0.273437500000 0.546875000000 0.312500000000 -rpjobitem_204_c.tga 0.546875000000 0.273437500000 0.585937500000 0.312500000000 -rpjobitem_205_a.tga 0.585937500000 0.273437500000 0.625000000000 0.312500000000 -rpjobitem_205_b.tga 0.625000000000 0.273437500000 0.664062500000 0.312500000000 -rpjobitem_205_c.tga 0.664062500000 0.273437500000 0.703125000000 0.312500000000 -rpjobitem_206_a.tga 0.703125000000 0.273437500000 0.742187500000 0.312500000000 -rpjobitem_206_b.tga 0.742187500000 0.273437500000 0.781250000000 0.312500000000 -rpjobitem_206_c.tga 0.781250000000 0.273437500000 0.820312500000 0.312500000000 -rpjobitem_207_a.tga 0.820312500000 0.273437500000 0.859375000000 0.312500000000 -rpjobitem_207_b.tga 0.859375000000 0.273437500000 0.898437500000 0.312500000000 -rpjobitem_207_c.tga 0.898437500000 0.273437500000 0.937500000000 0.312500000000 -rpjobitem_certifications.tga 0.937500000000 0.273437500000 0.976562500000 0.312500000000 -rpjob_200.tga 0.468750000000 0.312500000000 0.507812500000 0.351562500000 -rpjob_201.tga 0.507812500000 0.312500000000 0.546875000000 0.351562500000 -rpjob_202.tga 0.546875000000 0.312500000000 0.585937500000 0.351562500000 -rpjob_203.tga 0.585937500000 0.312500000000 0.625000000000 0.351562500000 -rpjob_204.tga 0.625000000000 0.312500000000 0.664062500000 0.351562500000 -rpjob_205.tga 0.664062500000 0.312500000000 0.703125000000 0.351562500000 -rpjob_206.tga 0.703125000000 0.312500000000 0.742187500000 0.351562500000 -rpjob_207.tga 0.742187500000 0.312500000000 0.781250000000 0.351562500000 -rpjob_advanced.tga 0.781250000000 0.312500000000 0.820312500000 0.351562500000 -rpjob_elementary.tga 0.820312500000 0.312500000000 0.859375000000 0.351562500000 -rpjob_roleplay.tga 0.859375000000 0.312500000000 0.898437500000 0.351562500000 -rpjob_task.tga 0.898437500000 0.312500000000 0.937500000000 0.351562500000 -rpjob_task_certificats.tga 0.937500000000 0.312500000000 0.976562500000 0.351562500000 -rpjob_task_convert.tga 0.468750000000 0.351562500000 0.507812500000 0.390625000000 -rpjob_task_elementary.tga 0.507812500000 0.351562500000 0.546875000000 0.390625000000 -rpjob_task_generic.tga 0.546875000000 0.351562500000 0.585937500000 0.390625000000 -rpjob_task_upgrade.tga 0.585937500000 0.351562500000 0.625000000000 0.390625000000 -RW_autolaunch.tga 0.625000000000 0.351562500000 0.664062500000 0.390625000000 -RW_bowgun.tga 0.664062500000 0.351562500000 0.703125000000 0.390625000000 -RW_grenade.tga 0.703125000000 0.351562500000 0.742187500000 0.390625000000 -RW_harpoongun.tga 0.742187500000 0.351562500000 0.781250000000 0.390625000000 -RW_launcher.tga 0.781250000000 0.351562500000 0.820312500000 0.390625000000 -RW_pistol.tga 0.820312500000 0.351562500000 0.859375000000 0.390625000000 -RW_pistolarc.tga 0.859375000000 0.351562500000 0.898437500000 0.390625000000 -RW_rifle.tga 0.898437500000 0.351562500000 0.937500000000 0.390625000000 -SH_buckler.tga 0.937500000000 0.351562500000 0.976562500000 0.390625000000 -SH_large_shield.tga 0.468750000000 0.390625000000 0.507812500000 0.429687500000 -spe_beast.tga 0.507812500000 0.390625000000 0.546875000000 0.429687500000 -spe_com.tga 0.546875000000 0.390625000000 0.585937500000 0.429687500000 -spe_inventory.tga 0.585937500000 0.390625000000 0.625000000000 0.429687500000 -spe_labs.tga 0.625000000000 0.390625000000 0.664062500000 0.429687500000 -spe_memory.tga 0.664062500000 0.390625000000 0.703125000000 0.429687500000 -spe_options.tga 0.703125000000 0.390625000000 0.742187500000 0.429687500000 -spe_status.tga 0.742187500000 0.390625000000 0.781250000000 0.429687500000 -stimulating_water.tga 0.781250000000 0.390625000000 0.820312500000 0.429687500000 -tetekitin.tga 0.820312500000 0.390625000000 0.859375000000 0.429687500000 -to_ammo.tga 0.859375000000 0.390625000000 0.898437500000 0.429687500000 -to_armor.tga 0.898437500000 0.390625000000 0.937500000000 0.429687500000 -to_cooking_pot.tga 0.937500000000 0.390625000000 0.976562500000 0.429687500000 -to_fishing_rod.tga 0.468750000000 0.429687500000 0.507812500000 0.468750000000 -to_forage.tga 0.507812500000 0.429687500000 0.546875000000 0.468750000000 -to_hammer.tga 0.546875000000 0.429687500000 0.585937500000 0.468750000000 -to_jewelry_hammer.tga 0.585937500000 0.429687500000 0.625000000000 0.468750000000 -to_jewels.tga 0.625000000000 0.429687500000 0.664062500000 0.468750000000 -to_leathercutter.tga 0.664062500000 0.429687500000 0.703125000000 0.468750000000 -to_melee.tga 0.703125000000 0.429687500000 0.742187500000 0.468750000000 -to_needle.tga 0.742187500000 0.429687500000 0.781250000000 0.468750000000 -to_pestle.tga 0.781250000000 0.429687500000 0.820312500000 0.468750000000 -to_range.tga 0.820312500000 0.429687500000 0.859375000000 0.468750000000 -to_searake.tga 0.859375000000 0.429687500000 0.898437500000 0.468750000000 -to_spade.tga 0.898437500000 0.429687500000 0.937500000000 0.468750000000 -to_stick.tga 0.937500000000 0.429687500000 0.976562500000 0.468750000000 -to_tunneling_knife.tga 0.000000000000 0.468750000000 0.039062500000 0.507812500000 -to_whip.tga 0.039062500000 0.468750000000 0.078125000000 0.507812500000 -to_wrench.tga 0.078125000000 0.468750000000 0.117187500000 0.507812500000 -TP_caravane.tga 0.117187500000 0.468750000000 0.156250000000 0.507812500000 -TP_kami.tga 0.156250000000 0.468750000000 0.195312500000 0.507812500000 -W_AM_logo.tga 0.195312500000 0.468750000000 0.234375000000 0.507812500000 -w_pa_anklet.tga 0.234375000000 0.468750000000 0.273437500000 0.507812500000 -w_pa_bracelet.tga 0.273437500000 0.468750000000 0.312500000000 0.507812500000 -w_pa_diadem.tga 0.312500000000 0.468750000000 0.351562500000 0.507812500000 -w_pa_earring.tga 0.351562500000 0.468750000000 0.390625000000 0.507812500000 -w_pa_pendant.tga 0.390625000000 0.468750000000 0.429687500000 0.507812500000 -w_pa_ring.tga 0.429687500000 0.468750000000 0.468750000000 0.507812500000 -asc_unknown.tga 0.468750000000 0.468750000000 0.500000000000 0.500000000000 -asc_exit.tga 0.500000000000 0.468750000000 0.531250000000 0.500000000000 -asc_rolemastercraft.tga 0.531250000000 0.468750000000 0.562500000000 0.500000000000 -asc_rolemasterfight.tga 0.562500000000 0.468750000000 0.593750000000 0.500000000000 -asc_rolemasterharvest.tga 0.593750000000 0.468750000000 0.625000000000 0.500000000000 -asc_rolemastermagic.tga 0.625000000000 0.468750000000 0.656250000000 0.500000000000 -mail.tga 0.656250000000 0.468750000000 0.687500000000 0.492187500000 -ico_aim_homin_feet.tga 0.976562500000 0.078125000000 1.000000000000 0.101562500000 -ico_aim_homin_feint.tga 0.976562500000 0.101562500000 1.000000000000 0.125000000000 -ico_aim_homin_hands.tga 0.976562500000 0.125000000000 1.000000000000 0.148437500000 -ico_aim_homin_head.tga 0.976562500000 0.148437500000 1.000000000000 0.171875000000 -ico_aim_homin_legs.tga 0.976562500000 0.171875000000 1.000000000000 0.195312500000 -mp3.tga 0.976562500000 0.195312500000 1.000000000000 0.218750000000 -ico_aim_kitin_head.tga 0.976562500000 0.218750000000 1.000000000000 0.242187500000 -mp_back_curative.tga 0.976562500000 0.242187500000 1.000000000000 0.265625000000 -mp_back_offensive.tga 0.976562500000 0.265625000000 1.000000000000 0.289062500000 -mp_back_selfonly.tga 0.976562500000 0.289062500000 1.000000000000 0.312500000000 -building_state_24x24.tga 0.976562500000 0.312500000000 1.000000000000 0.335937500000 -ico_ammo_bullet.tga 0.976562500000 0.335937500000 1.000000000000 0.359375000000 -ico_ammo_jacket.tga 0.976562500000 0.359375000000 1.000000000000 0.382812500000 -ico_angle.tga 0.976562500000 0.382812500000 1.000000000000 0.406250000000 -ico_anti_magic_shield.tga 0.976562500000 0.406250000000 1.000000000000 0.429687500000 -ico_armor.tga 0.976562500000 0.429687500000 1.000000000000 0.453125000000 -ico_armor_clip.tga 0.976562500000 0.453125000000 1.000000000000 0.476562500000 -ico_armor_heavy.tga 0.687500000000 0.468750000000 0.710937500000 0.492187500000 -ico_armor_kitin.tga 0.710937500000 0.468750000000 0.734375000000 0.492187500000 -ico_armor_light.tga 0.734375000000 0.468750000000 0.757812500000 0.492187500000 -ico_armor_medium.tga 0.757812500000 0.468750000000 0.781250000000 0.492187500000 -ico_armor_penalty.tga 0.781250000000 0.468750000000 0.804687500000 0.492187500000 -ico_armor_shell.tga 0.804687500000 0.468750000000 0.828125000000 0.492187500000 -ico_atys.tga 0.828125000000 0.468750000000 0.851562500000 0.492187500000 -ico_atysian.tga 0.851562500000 0.468750000000 0.875000000000 0.492187500000 -ico_balance_hp.tga 0.875000000000 0.468750000000 0.898437500000 0.492187500000 -ico_barrel.tga 0.898437500000 0.468750000000 0.921875000000 0.492187500000 -ico_bash.tga 0.921875000000 0.468750000000 0.945312500000 0.492187500000 -ico_berserk.tga 0.945312500000 0.468750000000 0.968750000000 0.492187500000 -ico_blade.tga 0.968750000000 0.476562500000 0.992187500000 0.500000000000 -ico_bleeding.tga 0.656250000000 0.492187500000 0.679687500000 0.515625000000 -ico_blind.tga 0.679687500000 0.492187500000 0.703125000000 0.515625000000 -ico_blunt.tga 0.703125000000 0.492187500000 0.726562500000 0.515625000000 -ico_bomb.tga 0.726562500000 0.492187500000 0.750000000000 0.515625000000 -cb_main_nue.tga 0.750000000000 0.492187500000 0.773437500000 0.515625000000 -ico_celestial.tga 0.773437500000 0.492187500000 0.796875000000 0.515625000000 -ico_circular_attack.tga 0.796875000000 0.492187500000 0.820312500000 0.515625000000 -ico_clothes.tga 0.820312500000 0.492187500000 0.843750000000 0.515625000000 -ico_cold.tga 0.843750000000 0.492187500000 0.867187500000 0.515625000000 -ico_concentration.tga 0.867187500000 0.492187500000 0.890625000000 0.515625000000 -BK_matis_brick.tga 0.890625000000 0.492187500000 0.914062500000 0.515625000000 -ico_constitution.tga 0.914062500000 0.492187500000 0.937500000000 0.515625000000 -ico_counterweight.tga 0.937500000000 0.492187500000 0.960937500000 0.515625000000 -ico_craft_buff.tga 0.468750000000 0.500000000000 0.492187500000 0.523437500000 -ico_create_sapload.tga 0.492187500000 0.500000000000 0.515625000000 0.523437500000 -ico_curse.tga 0.515625000000 0.500000000000 0.539062500000 0.523437500000 -ico_debuff.tga 0.539062500000 0.500000000000 0.562500000000 0.523437500000 -ico_debuff_resist.tga 0.562500000000 0.500000000000 0.585937500000 0.523437500000 -ico_debuff_skill.tga 0.585937500000 0.500000000000 0.609375000000 0.523437500000 -ico_desert.tga 0.609375000000 0.500000000000 0.632812500000 0.523437500000 -ico_dexterity.tga 0.632812500000 0.500000000000 0.656250000000 0.523437500000 -ico_disarm.tga 0.960937500000 0.500000000000 0.984375000000 0.523437500000 -ico_dodge.tga 0.000000000000 0.507812500000 0.023437500000 0.531250000000 -ico_dot.tga 0.023437500000 0.507812500000 0.046875000000 0.531250000000 -ico_durability.tga 0.046875000000 0.507812500000 0.070312500000 0.531250000000 -ico_electric.tga 0.070312500000 0.507812500000 0.093750000000 0.531250000000 -ico_explosif.tga 0.093750000000 0.507812500000 0.117187500000 0.531250000000 -ico_extracting.tga 0.117187500000 0.507812500000 0.140625000000 0.531250000000 -ico_fear.tga 0.140625000000 0.507812500000 0.164062500000 0.531250000000 -ico_feint.tga 0.164062500000 0.507812500000 0.187500000000 0.531250000000 -ico_fire.tga 0.187500000000 0.507812500000 0.210937500000 0.531250000000 -ico_firing_pin.tga 0.210937500000 0.507812500000 0.234375000000 0.531250000000 -ch_back.tga 0.234375000000 0.507812500000 0.257812500000 0.531250000000 -BK_generic_brick.tga 0.257812500000 0.507812500000 0.281250000000 0.531250000000 -mp_over_link.tga 0.281250000000 0.507812500000 0.304687500000 0.531250000000 -bk_aura.tga 0.304687500000 0.507812500000 0.328125000000 0.531250000000 -bk_conso.tga 0.328125000000 0.507812500000 0.351562500000 0.531250000000 -bk_outpost_brick.tga 0.351562500000 0.507812500000 0.375000000000 0.531250000000 -bk_power.tga 0.375000000000 0.507812500000 0.398437500000 0.531250000000 -ico_focus.tga 0.398437500000 0.507812500000 0.421875000000 0.531250000000 -ico_forage_buff.tga 0.421875000000 0.507812500000 0.445312500000 0.531250000000 -ico_forbid_item.tga 0.445312500000 0.507812500000 0.468750000000 0.531250000000 -ico_forest.tga 0.656250000000 0.515625000000 0.679687500000 0.539062500000 -2h_over.tga 0.679687500000 0.515625000000 0.703125000000 0.539062500000 -ico_gardening.tga 0.703125000000 0.515625000000 0.726562500000 0.539062500000 -ico_gentle.tga 0.726562500000 0.515625000000 0.750000000000 0.539062500000 -ico_goo.tga 0.750000000000 0.515625000000 0.773437500000 0.539062500000 -ico_gripp.tga 0.773437500000 0.515625000000 0.796875000000 0.539062500000 -1h_over.tga 0.796875000000 0.515625000000 0.820312500000 0.539062500000 -BK_fyros_brick.tga 0.820312500000 0.515625000000 0.843750000000 0.539062500000 -ico_hammer.tga 0.843750000000 0.515625000000 0.867187500000 0.539062500000 -ico_harmful.tga 0.867187500000 0.515625000000 0.890625000000 0.539062500000 -ico_hatred.tga 0.890625000000 0.515625000000 0.914062500000 0.539062500000 -ico_heal.tga 0.914062500000 0.515625000000 0.937500000000 0.539062500000 -ico_hit_rate.tga 0.937500000000 0.515625000000 0.960937500000 0.539062500000 -ico_incapacity.tga 0.468750000000 0.523437500000 0.492187500000 0.546875000000 -ico_intelligence.tga 0.492187500000 0.523437500000 0.515625000000 0.546875000000 -ico_interrupt.tga 0.515625000000 0.523437500000 0.539062500000 0.546875000000 -ico_invulnerability.tga 0.539062500000 0.523437500000 0.562500000000 0.546875000000 -ico_jewel_stone.tga 0.562500000000 0.523437500000 0.585937500000 0.546875000000 -ico_jewel_stone_support.tga 0.585937500000 0.523437500000 0.609375000000 0.546875000000 -ico_jungle.tga 0.609375000000 0.523437500000 0.632812500000 0.546875000000 -ico_lacustre.tga 0.632812500000 0.523437500000 0.656250000000 0.546875000000 -ico_landmark_bonus.tga 0.960937500000 0.523437500000 0.984375000000 0.546875000000 -ico_level.tga 0.000000000000 0.531250000000 0.023437500000 0.554687500000 -ico_lining.tga 0.023437500000 0.531250000000 0.046875000000 0.554687500000 -ico_location.tga 0.046875000000 0.531250000000 0.070312500000 0.554687500000 -ico_madness.tga 0.070312500000 0.531250000000 0.093750000000 0.554687500000 -ico_magic.tga 0.093750000000 0.531250000000 0.117187500000 0.554687500000 -ico_magic_action_buff.tga 0.117187500000 0.531250000000 0.140625000000 0.554687500000 -ico_magic_focus.tga 0.140625000000 0.531250000000 0.164062500000 0.554687500000 -ico_magic_target_buff.tga 0.164062500000 0.531250000000 0.187500000000 0.554687500000 -ico_melee_action_buff.tga 0.187500000000 0.531250000000 0.210937500000 0.554687500000 -ico_melee_target_buff.tga 0.210937500000 0.531250000000 0.234375000000 0.554687500000 -ico_mental.tga 0.234375000000 0.531250000000 0.257812500000 0.554687500000 -no_action.tga 0.257812500000 0.531250000000 0.281250000000 0.554687500000 -op_back.tga 0.281250000000 0.531250000000 0.304687500000 0.554687500000 -op_over_break.tga 0.304687500000 0.531250000000 0.328125000000 0.554687500000 -op_over_less.tga 0.328125000000 0.531250000000 0.351562500000 0.554687500000 -op_over_more.tga 0.351562500000 0.531250000000 0.375000000000 0.554687500000 -ico_metabolism.tga 0.375000000000 0.531250000000 0.398437500000 0.554687500000 -pa_back.tga 0.398437500000 0.531250000000 0.421875000000 0.554687500000 -ico_mezz.tga 0.421875000000 0.531250000000 0.445312500000 0.554687500000 -ico_misfortune.tga 0.445312500000 0.531250000000 0.468750000000 0.554687500000 -BK_magie_noire_brick.tga 0.656250000000 0.539062500000 0.679687500000 0.562500000000 -pa_over_break.tga 0.679687500000 0.539062500000 0.703125000000 0.562500000000 -pa_over_less.tga 0.703125000000 0.539062500000 0.726562500000 0.562500000000 -pa_over_more.tga 0.726562500000 0.539062500000 0.750000000000 0.562500000000 -BK_tryker_brick.tga 0.750000000000 0.539062500000 0.773437500000 0.562500000000 -cp_back.tga 0.773437500000 0.539062500000 0.796875000000 0.562500000000 -cp_over_break.tga 0.796875000000 0.539062500000 0.820312500000 0.562500000000 -pvp_ally_0.tga 0.820312500000 0.539062500000 0.843750000000 0.562500000000 -pvp_ally_1.tga 0.843750000000 0.539062500000 0.867187500000 0.562500000000 -pvp_ally_2.tga 0.867187500000 0.539062500000 0.890625000000 0.562500000000 -pvp_ally_3.tga 0.890625000000 0.539062500000 0.914062500000 0.562500000000 -pvp_ally_4.tga 0.914062500000 0.539062500000 0.937500000000 0.562500000000 -pvp_ally_6.tga 0.937500000000 0.539062500000 0.960937500000 0.562500000000 -pvp_ally_primas.tga 0.468750000000 0.546875000000 0.492187500000 0.570312500000 -pvp_ally_ranger.tga 0.492187500000 0.546875000000 0.515625000000 0.570312500000 -pvp_enemy_0.tga 0.515625000000 0.546875000000 0.539062500000 0.570312500000 -pvp_enemy_1.tga 0.539062500000 0.546875000000 0.562500000000 0.570312500000 -pvp_enemy_2.tga 0.562500000000 0.546875000000 0.585937500000 0.570312500000 -pvp_enemy_3.tga 0.585937500000 0.546875000000 0.609375000000 0.570312500000 -pvp_enemy_4.tga 0.609375000000 0.546875000000 0.632812500000 0.570312500000 -pvp_enemy_6.tga 0.632812500000 0.546875000000 0.656250000000 0.570312500000 -pvp_enemy_marauder.tga 0.960937500000 0.546875000000 0.984375000000 0.570312500000 -pvp_enemy_trytonist.tga 0.000000000000 0.554687500000 0.023437500000 0.578125000000 -cp_over_less.tga 0.023437500000 0.554687500000 0.046875000000 0.578125000000 -cp_over_more.tga 0.046875000000 0.554687500000 0.070312500000 0.578125000000 -cp_over_opening.tga 0.070312500000 0.554687500000 0.093750000000 0.578125000000 -cp_over_opening_2.tga 0.093750000000 0.554687500000 0.117187500000 0.578125000000 -bg_downloader.tga 0.117187500000 0.554687500000 0.140625000000 0.578125000000 -BK_zorai_brick.tga 0.140625000000 0.554687500000 0.164062500000 0.578125000000 -ef_back.tga 0.164062500000 0.554687500000 0.187500000000 0.578125000000 -ef_over_break.tga 0.187500000000 0.554687500000 0.210937500000 0.578125000000 -ico_move.tga 0.210937500000 0.554687500000 0.234375000000 0.578125000000 -ico_multiple_spots.tga 0.234375000000 0.554687500000 0.257812500000 0.578125000000 -ico_multi_fight.tga 0.257812500000 0.554687500000 0.281250000000 0.578125000000 -ef_over_less.tga 0.281250000000 0.554687500000 0.304687500000 0.578125000000 -ico_opening_hit.tga 0.304687500000 0.554687500000 0.328125000000 0.578125000000 -ico_over_autumn.tga 0.328125000000 0.554687500000 0.351562500000 0.578125000000 -ico_over_degenerated.tga 0.351562500000 0.554687500000 0.375000000000 0.578125000000 -ico_over_fauna.tga 0.375000000000 0.554687500000 0.398437500000 0.578125000000 -ico_over_flora.tga 0.398437500000 0.554687500000 0.421875000000 0.578125000000 -ico_over_hit_arms.tga 0.421875000000 0.554687500000 0.445312500000 0.578125000000 -ico_over_hit_chest.tga 0.445312500000 0.554687500000 0.468750000000 0.578125000000 -ico_over_hit_feet.tga 0.656250000000 0.562500000000 0.679687500000 0.585937500000 -ico_over_hit_feet_hands.tga 0.679687500000 0.562500000000 0.703125000000 0.585937500000 -ico_over_hit_feet_head.tga 0.703125000000 0.562500000000 0.726562500000 0.585937500000 -ico_over_hit_feet_x2.tga 0.726562500000 0.562500000000 0.750000000000 0.585937500000 -ico_over_hit_feint_x3.tga 0.750000000000 0.562500000000 0.773437500000 0.585937500000 -ico_over_hit_hands.tga 0.773437500000 0.562500000000 0.796875000000 0.585937500000 -ico_over_hit_hands_chest.tga 0.796875000000 0.562500000000 0.820312500000 0.585937500000 -ico_over_hit_hands_head.tga 0.820312500000 0.562500000000 0.843750000000 0.585937500000 -ico_over_hit_head.tga 0.843750000000 0.562500000000 0.867187500000 0.585937500000 -ico_over_hit_head_x3.tga 0.867187500000 0.562500000000 0.890625000000 0.585937500000 -ico_over_hit_legs.tga 0.890625000000 0.562500000000 0.914062500000 0.585937500000 -ico_over_homin.tga 0.914062500000 0.562500000000 0.937500000000 0.585937500000 -ico_over_kitin.tga 0.937500000000 0.562500000000 0.960937500000 0.585937500000 -ico_over_magic.tga 0.468750000000 0.570312500000 0.492187500000 0.593750000000 -ico_over_melee.tga 0.492187500000 0.570312500000 0.515625000000 0.593750000000 -ico_over_racial.tga 0.515625000000 0.570312500000 0.539062500000 0.593750000000 -ico_over_range.tga 0.539062500000 0.570312500000 0.562500000000 0.593750000000 -ico_over_special.tga 0.562500000000 0.570312500000 0.585937500000 0.593750000000 -ico_over_spring.tga 0.585937500000 0.570312500000 0.609375000000 0.593750000000 -ico_over_summer.tga 0.609375000000 0.570312500000 0.632812500000 0.593750000000 -ico_over_winter.tga 0.632812500000 0.570312500000 0.656250000000 0.593750000000 -ico_parry.tga 0.960937500000 0.570312500000 0.984375000000 0.593750000000 -ico_piercing.tga 0.000000000000 0.578125000000 0.023437500000 0.601562500000 -ico_pointe.tga 0.023437500000 0.578125000000 0.046875000000 0.601562500000 -ico_poison.tga 0.046875000000 0.578125000000 0.070312500000 0.601562500000 -ico_power.tga 0.070312500000 0.578125000000 0.093750000000 0.601562500000 -ico_preservation.tga 0.093750000000 0.578125000000 0.117187500000 0.601562500000 -ico_primal.tga 0.117187500000 0.578125000000 0.140625000000 0.601562500000 -ico_prime_roots.tga 0.140625000000 0.578125000000 0.164062500000 0.601562500000 -ico_private.tga 0.164062500000 0.578125000000 0.187500000000 0.601562500000 -ico_prospecting.tga 0.187500000000 0.578125000000 0.210937500000 0.601562500000 -ico_quality.tga 0.210937500000 0.578125000000 0.234375000000 0.601562500000 -ef_over_more.tga 0.234375000000 0.578125000000 0.257812500000 0.601562500000 -ico_range.tga 0.257812500000 0.578125000000 0.281250000000 0.601562500000 -ico_range_action_buff.tga 0.281250000000 0.578125000000 0.304687500000 0.601562500000 -ico_range_target_buff.tga 0.304687500000 0.578125000000 0.328125000000 0.601562500000 -ico_ricochet.tga 0.328125000000 0.578125000000 0.351562500000 0.601562500000 -ico_root.tga 0.351562500000 0.578125000000 0.375000000000 0.601562500000 -ico_rot.tga 0.375000000000 0.578125000000 0.398437500000 0.601562500000 -ico_safe.tga 0.398437500000 0.578125000000 0.421875000000 0.601562500000 -ico_sap.tga 0.421875000000 0.578125000000 0.445312500000 0.601562500000 -ico_self_damage.tga 0.445312500000 0.578125000000 0.468750000000 0.601562500000 -ico_shaft.tga 0.656250000000 0.585937500000 0.679687500000 0.609375000000 -ico_shielding.tga 0.679687500000 0.585937500000 0.703125000000 0.609375000000 -ico_shield_buff.tga 0.703125000000 0.585937500000 0.726562500000 0.609375000000 -ico_shield_up.tga 0.726562500000 0.585937500000 0.750000000000 0.609375000000 -ico_shockwave.tga 0.750000000000 0.585937500000 0.773437500000 0.609375000000 -ico_sickness.tga 0.773437500000 0.585937500000 0.796875000000 0.609375000000 -ico_slashing.tga 0.796875000000 0.585937500000 0.820312500000 0.609375000000 -ico_slow.tga 0.820312500000 0.585937500000 0.843750000000 0.609375000000 -ico_soft_spot.tga 0.843750000000 0.585937500000 0.867187500000 0.609375000000 -ico_source_time.tga 0.867187500000 0.585937500000 0.890625000000 0.609375000000 -ico_speed.tga 0.890625000000 0.585937500000 0.914062500000 0.609375000000 -ico_speeding_up.tga 0.914062500000 0.585937500000 0.937500000000 0.609375000000 -ico_spell_break.tga 0.937500000000 0.585937500000 0.960937500000 0.609375000000 -fo_back.tga 0.468750000000 0.593750000000 0.492187500000 0.617187500000 -ico_spray.tga 0.492187500000 0.593750000000 0.515625000000 0.617187500000 -ico_spying.tga 0.515625000000 0.593750000000 0.539062500000 0.617187500000 -ico_stamina.tga 0.539062500000 0.593750000000 0.562500000000 0.617187500000 -ico_strength.tga 0.562500000000 0.593750000000 0.585937500000 0.617187500000 -ico_stuffing.tga 0.585937500000 0.593750000000 0.609375000000 0.617187500000 -ico_stunn.tga 0.609375000000 0.593750000000 0.632812500000 0.617187500000 -fo_over.tga 0.632812500000 0.593750000000 0.656250000000 0.617187500000 -fp_ammo.tga 0.960937500000 0.593750000000 0.984375000000 0.617187500000 -fp_armor.tga 0.000000000000 0.601562500000 0.023437500000 0.625000000000 -fp_building.tga 0.023437500000 0.601562500000 0.046875000000 0.625000000000 -fp_jewel.tga 0.046875000000 0.601562500000 0.070312500000 0.625000000000 -fp_melee.tga 0.070312500000 0.601562500000 0.093750000000 0.625000000000 -tb_action_attack.tga 0.093750000000 0.601562500000 0.117187500000 0.625000000000 -tb_action_config.tga 0.117187500000 0.601562500000 0.140625000000 0.625000000000 -tb_action_disband.tga 0.140625000000 0.601562500000 0.164062500000 0.625000000000 -tb_action_disengage.tga 0.164062500000 0.601562500000 0.187500000000 0.625000000000 -tb_action_extract.tga 0.187500000000 0.601562500000 0.210937500000 0.625000000000 -tb_action_invite.tga 0.210937500000 0.601562500000 0.234375000000 0.625000000000 -tb_action_kick.tga 0.234375000000 0.601562500000 0.257812500000 0.625000000000 -tb_action_move.tga 0.257812500000 0.601562500000 0.281250000000 0.625000000000 -tb_action_run.tga 0.281250000000 0.601562500000 0.304687500000 0.625000000000 -tb_action_sit.tga 0.304687500000 0.601562500000 0.328125000000 0.625000000000 -tb_action_stand.tga 0.328125000000 0.601562500000 0.351562500000 0.625000000000 -tb_action_stop.tga 0.351562500000 0.601562500000 0.375000000000 0.625000000000 -tb_action_talk.tga 0.375000000000 0.601562500000 0.398437500000 0.625000000000 -tb_action_walk.tga 0.398437500000 0.601562500000 0.421875000000 0.625000000000 -tb_animals.tga 0.421875000000 0.601562500000 0.445312500000 0.625000000000 -tb_config.tga 0.445312500000 0.601562500000 0.468750000000 0.625000000000 -tb_connection.tga 0.656250000000 0.609375000000 0.679687500000 0.632812500000 -tb_contacts.tga 0.679687500000 0.609375000000 0.703125000000 0.632812500000 -tb_desk_1.tga 0.703125000000 0.609375000000 0.726562500000 0.632812500000 -tb_desk_2.tga 0.726562500000 0.609375000000 0.750000000000 0.632812500000 -tb_desk_3.tga 0.750000000000 0.609375000000 0.773437500000 0.632812500000 -tb_desk_4.tga 0.773437500000 0.609375000000 0.796875000000 0.632812500000 -tb_faction.tga 0.796875000000 0.609375000000 0.820312500000 0.632812500000 -tb_forum.tga 0.820312500000 0.609375000000 0.843750000000 0.632812500000 -tb_guild.tga 0.843750000000 0.609375000000 0.867187500000 0.632812500000 -tb_keys.tga 0.867187500000 0.609375000000 0.890625000000 0.632812500000 -tb_macros.tga 0.890625000000 0.609375000000 0.914062500000 0.632812500000 -tb_mail.tga 0.914062500000 0.609375000000 0.937500000000 0.632812500000 -tb_mode_dodge.tga 0.937500000000 0.609375000000 0.960937500000 0.632812500000 -tb_mode_parry.tga 0.468750000000 0.617187500000 0.492187500000 0.640625000000 -tb_over.tga 0.492187500000 0.617187500000 0.515625000000 0.640625000000 -tb_support.tga 0.515625000000 0.617187500000 0.539062500000 0.640625000000 -tb_team.tga 0.539062500000 0.617187500000 0.562500000000 0.640625000000 -tb_windows.tga 0.562500000000 0.617187500000 0.585937500000 0.640625000000 -fp_over.tga 0.585937500000 0.617187500000 0.609375000000 0.640625000000 -fp_range.tga 0.609375000000 0.617187500000 0.632812500000 0.640625000000 -fp_shield.tga 0.632812500000 0.617187500000 0.656250000000 0.640625000000 -fp_tools.tga 0.960937500000 0.617187500000 0.984375000000 0.640625000000 -brick_default.tga 0.000000000000 0.625000000000 0.023437500000 0.648437500000 -ico_taunt.tga 0.023437500000 0.625000000000 0.046875000000 0.648437500000 -ico_time.tga 0.046875000000 0.625000000000 0.070312500000 0.648437500000 -ico_time_bonus.tga 0.070312500000 0.625000000000 0.093750000000 0.648437500000 -ico_absorb_damage.tga 0.093750000000 0.625000000000 0.117187500000 0.648437500000 -ico_trigger.tga 0.117187500000 0.625000000000 0.140625000000 0.648437500000 -ico_umbrella.tga 0.140625000000 0.625000000000 0.164062500000 0.648437500000 -ico_use_enchantement.tga 0.164062500000 0.625000000000 0.187500000000 0.648437500000 -ico_vampire.tga 0.187500000000 0.625000000000 0.210937500000 0.648437500000 -ico_visibility.tga 0.210937500000 0.625000000000 0.234375000000 0.648437500000 -ico_war_cry.tga 0.234375000000 0.625000000000 0.257812500000 0.648437500000 -ico_weight.tga 0.257812500000 0.625000000000 0.281250000000 0.648437500000 -ico_wellbalanced.tga 0.281250000000 0.625000000000 0.304687500000 0.648437500000 -ico_will.tga 0.304687500000 0.625000000000 0.328125000000 0.648437500000 -ico_windding.tga 0.328125000000 0.625000000000 0.351562500000 0.648437500000 -ico_wisdom.tga 0.351562500000 0.625000000000 0.375000000000 0.648437500000 -ico_accurate.tga 0.375000000000 0.625000000000 0.398437500000 0.648437500000 -ico_acid.tga 0.398437500000 0.625000000000 0.421875000000 0.648437500000 -us_back_0.tga 0.421875000000 0.625000000000 0.445312500000 0.648437500000 -us_back_1.tga 0.445312500000 0.625000000000 0.468750000000 0.648437500000 -us_back_2.tga 0.656250000000 0.632812500000 0.679687500000 0.656250000000 -us_back_3.tga 0.679687500000 0.632812500000 0.703125000000 0.656250000000 -us_back_4.tga 0.703125000000 0.632812500000 0.726562500000 0.656250000000 -us_back_5.tga 0.726562500000 0.632812500000 0.750000000000 0.656250000000 -us_back_6.tga 0.750000000000 0.632812500000 0.773437500000 0.656250000000 -us_back_7.tga 0.773437500000 0.632812500000 0.796875000000 0.656250000000 -us_back_8.tga 0.796875000000 0.632812500000 0.820312500000 0.656250000000 -us_back_9.tga 0.820312500000 0.632812500000 0.843750000000 0.656250000000 -us_ico_0.tga 0.843750000000 0.632812500000 0.867187500000 0.656250000000 -us_ico_1.tga 0.867187500000 0.632812500000 0.890625000000 0.656250000000 -us_ico_2.tga 0.890625000000 0.632812500000 0.914062500000 0.656250000000 -us_ico_3.tga 0.914062500000 0.632812500000 0.937500000000 0.656250000000 -us_ico_4.tga 0.937500000000 0.632812500000 0.960937500000 0.656250000000 -us_ico_5.tga 0.468750000000 0.640625000000 0.492187500000 0.664062500000 -us_ico_6.tga 0.492187500000 0.640625000000 0.515625000000 0.664062500000 -us_ico_7.tga 0.515625000000 0.640625000000 0.539062500000 0.664062500000 -us_ico_8.tga 0.539062500000 0.640625000000 0.562500000000 0.664062500000 -us_ico_9.tga 0.562500000000 0.640625000000 0.585937500000 0.664062500000 -us_over_0.tga 0.585937500000 0.640625000000 0.609375000000 0.664062500000 -us_over_1.tga 0.609375000000 0.640625000000 0.632812500000 0.664062500000 -us_over_2.tga 0.632812500000 0.640625000000 0.656250000000 0.664062500000 -us_over_3.tga 0.960937500000 0.640625000000 0.984375000000 0.664062500000 -us_over_4.tga 0.000000000000 0.648437500000 0.023437500000 0.671875000000 -ico_aim.tga 0.023437500000 0.648437500000 0.046875000000 0.671875000000 -ico_aim_bird_wings.tga 0.046875000000 0.648437500000 0.070312500000 0.671875000000 -ico_aim_flying_kitin_abdomen.tga 0.070312500000 0.648437500000 0.093750000000 0.671875000000 -ico_aim_homin_arms.tga 0.093750000000 0.648437500000 0.117187500000 0.671875000000 -ico_aim_homin_chest.tga 0.117187500000 0.648437500000 0.140625000000 0.671875000000 -mf_back.tga 0.140625000000 0.648437500000 0.164062500000 0.671875000000 -mf_over.tga 0.164062500000 0.648437500000 0.187500000000 0.671875000000 -W_slot_shortcut_id0.tga 0.187500000000 0.648437500000 0.210937500000 0.671875000000 -W_slot_shortcut_id1.tga 0.210937500000 0.648437500000 0.234375000000 0.671875000000 -W_slot_shortcut_id2.tga 0.234375000000 0.648437500000 0.257812500000 0.671875000000 -W_slot_shortcut_id3.tga 0.257812500000 0.648437500000 0.281250000000 0.671875000000 -W_slot_shortcut_id4.tga 0.281250000000 0.648437500000 0.304687500000 0.671875000000 -W_slot_shortcut_id5.tga 0.304687500000 0.648437500000 0.328125000000 0.671875000000 -W_slot_shortcut_id6.tga 0.328125000000 0.648437500000 0.351562500000 0.671875000000 -W_slot_shortcut_id7.tga 0.351562500000 0.648437500000 0.375000000000 0.671875000000 -W_slot_shortcut_id8.tga 0.375000000000 0.648437500000 0.398437500000 0.671875000000 -W_slot_shortcut_id9.tga 0.398437500000 0.648437500000 0.421875000000 0.671875000000 -w_slot_shortcut_shift_id0.tga 0.421875000000 0.648437500000 0.445312500000 0.671875000000 -w_slot_shortcut_shift_id1.tga 0.445312500000 0.648437500000 0.468750000000 0.671875000000 -w_slot_shortcut_shift_id2.tga 0.656250000000 0.656250000000 0.679687500000 0.679687500000 -w_slot_shortcut_shift_id3.tga 0.679687500000 0.656250000000 0.703125000000 0.679687500000 -w_slot_shortcut_shift_id4.tga 0.703125000000 0.656250000000 0.726562500000 0.679687500000 -w_slot_shortcut_shift_id5.tga 0.726562500000 0.656250000000 0.750000000000 0.679687500000 -w_slot_shortcut_shift_id6.tga 0.750000000000 0.656250000000 0.773437500000 0.679687500000 -w_slot_shortcut_shift_id7.tga 0.773437500000 0.656250000000 0.796875000000 0.679687500000 -w_slot_shortcut_shift_id8.tga 0.796875000000 0.656250000000 0.820312500000 0.679687500000 -w_slot_shortcut_shift_id9.tga 0.820312500000 0.656250000000 0.843750000000 0.679687500000 -ico_source_knowledge.tga 0.843750000000 0.656250000000 0.865234375000 0.679687500000 -small_task_travel.tga 0.984375000000 0.000000000000 1.000000000000 0.015625000000 -small_task_craft.tga 0.984375000000 0.015625000000 1.000000000000 0.031250000000 -small_task_done.tga 0.984375000000 0.031250000000 1.000000000000 0.046875000000 -small_task_failed.tga 0.980468750000 0.046875000000 0.996093750000 0.062500000000 -small_task_fight.tga 0.980468750000 0.062500000000 0.996093750000 0.078125000000 -small_task_forage.tga 0.984375000000 0.500000000000 1.000000000000 0.515625000000 -small_task_generic.tga 0.984375000000 0.515625000000 1.000000000000 0.531250000000 -small_task_guild.tga 0.984375000000 0.531250000000 1.000000000000 0.546875000000 -small_task_rite.tga 0.984375000000 0.546875000000 1.000000000000 0.562500000000 -W_leader.tga 0.984375000000 0.562500000000 0.997070312500 0.574218750000 -w_major.tga 0.984375000000 0.574218750000 0.996093750000 0.585937500000 -tb_mode.tga 0.984375000000 0.585937500000 0.996093750000 0.597656250000 -profile.tga 0.984375000000 0.597656250000 0.996093750000 0.609375000000 -ge_acc_baniere_em - Copie.ps 0.000000000000 0.000000000000 0.000000000000 0.000000000000 -ge_acc_baniere_em.ps 0.000000000000 0.000000000000 0.000000000000 0.000000000000 +pvp_aura.tga 0.468750000000 0.156250000000 0.507812500000 0.195312500000 +pvp_aura_mask.tga 0.507812500000 0.156250000000 0.546875000000 0.195312500000 +pvp_boost.tga 0.546875000000 0.156250000000 0.585937500000 0.195312500000 +pvp_boost_mask.tga 0.585937500000 0.156250000000 0.625000000000 0.195312500000 +pw_4.tga 0.625000000000 0.156250000000 0.664062500000 0.195312500000 +pw_5.tga 0.664062500000 0.156250000000 0.703125000000 0.195312500000 +pw_6.tga 0.703125000000 0.156250000000 0.742187500000 0.195312500000 +pw_7.tga 0.742187500000 0.156250000000 0.781250000000 0.195312500000 +PW_heavy.tga 0.781250000000 0.156250000000 0.820312500000 0.195312500000 +PW_light.tga 0.820312500000 0.156250000000 0.859375000000 0.195312500000 +PW_medium.tga 0.859375000000 0.156250000000 0.898437500000 0.195312500000 +quest_coeur.tga 0.898437500000 0.156250000000 0.937500000000 0.195312500000 +quest_foie.tga 0.937500000000 0.156250000000 0.976562500000 0.195312500000 +quest_jeton.tga 0.468750000000 0.195312500000 0.507812500000 0.234375000000 +quest_langue.tga 0.507812500000 0.195312500000 0.546875000000 0.234375000000 +quest_louche.tga 0.546875000000 0.195312500000 0.585937500000 0.234375000000 +quest_oreille.tga 0.585937500000 0.195312500000 0.625000000000 0.234375000000 +quest_patte.tga 0.625000000000 0.195312500000 0.664062500000 0.234375000000 +quest_poils.tga 0.664062500000 0.195312500000 0.703125000000 0.234375000000 +quest_queue.tga 0.703125000000 0.195312500000 0.742187500000 0.234375000000 +quest_ticket.tga 0.742187500000 0.195312500000 0.781250000000 0.234375000000 +AM_logo.tga 0.781250000000 0.195312500000 0.820312500000 0.234375000000 +AR_armpad.tga 0.820312500000 0.195312500000 0.859375000000 0.234375000000 +ar_armpad_mask.tga 0.859375000000 0.195312500000 0.898437500000 0.234375000000 +requirement.tga 0.898437500000 0.195312500000 0.937500000000 0.234375000000 +rm_f.tga 0.937500000000 0.195312500000 0.976562500000 0.234375000000 +rm_f_upgrade.tga 0.468750000000 0.234375000000 0.507812500000 0.273437500000 +rm_h.tga 0.507812500000 0.234375000000 0.546875000000 0.273437500000 +rm_h_upgrade.tga 0.546875000000 0.234375000000 0.585937500000 0.273437500000 +rm_m.tga 0.585937500000 0.234375000000 0.625000000000 0.273437500000 +rm_m_upgrade.tga 0.625000000000 0.234375000000 0.664062500000 0.273437500000 +rm_r.tga 0.664062500000 0.234375000000 0.703125000000 0.273437500000 +rm_r_upgrade.tga 0.703125000000 0.234375000000 0.742187500000 0.273437500000 +rpjobitem_200_a.tga 0.742187500000 0.234375000000 0.781250000000 0.273437500000 +rpjobitem_200_b.tga 0.781250000000 0.234375000000 0.820312500000 0.273437500000 +rpjobitem_200_c.tga 0.820312500000 0.234375000000 0.859375000000 0.273437500000 +rpjobitem_201_a.tga 0.859375000000 0.234375000000 0.898437500000 0.273437500000 +rpjobitem_201_b.tga 0.898437500000 0.234375000000 0.937500000000 0.273437500000 +rpjobitem_201_c.tga 0.937500000000 0.234375000000 0.976562500000 0.273437500000 +rpjobitem_202_a.tga 0.468750000000 0.273437500000 0.507812500000 0.312500000000 +rpjobitem_202_b.tga 0.507812500000 0.273437500000 0.546875000000 0.312500000000 +rpjobitem_202_c.tga 0.546875000000 0.273437500000 0.585937500000 0.312500000000 +rpjobitem_203_a.tga 0.585937500000 0.273437500000 0.625000000000 0.312500000000 +rpjobitem_203_b.tga 0.625000000000 0.273437500000 0.664062500000 0.312500000000 +rpjobitem_203_c.tga 0.664062500000 0.273437500000 0.703125000000 0.312500000000 +rpjobitem_204_a.tga 0.703125000000 0.273437500000 0.742187500000 0.312500000000 +rpjobitem_204_b.tga 0.742187500000 0.273437500000 0.781250000000 0.312500000000 +rpjobitem_204_c.tga 0.781250000000 0.273437500000 0.820312500000 0.312500000000 +rpjobitem_205_a.tga 0.820312500000 0.273437500000 0.859375000000 0.312500000000 +rpjobitem_205_b.tga 0.859375000000 0.273437500000 0.898437500000 0.312500000000 +rpjobitem_205_c.tga 0.898437500000 0.273437500000 0.937500000000 0.312500000000 +rpjobitem_206_a.tga 0.937500000000 0.273437500000 0.976562500000 0.312500000000 +rpjobitem_206_b.tga 0.468750000000 0.312500000000 0.507812500000 0.351562500000 +rpjobitem_206_c.tga 0.507812500000 0.312500000000 0.546875000000 0.351562500000 +rpjobitem_207_a.tga 0.546875000000 0.312500000000 0.585937500000 0.351562500000 +rpjobitem_207_b.tga 0.585937500000 0.312500000000 0.625000000000 0.351562500000 +rpjobitem_207_c.tga 0.625000000000 0.312500000000 0.664062500000 0.351562500000 +rpjobitem_certifications.tga 0.664062500000 0.312500000000 0.703125000000 0.351562500000 +rpjob_200.tga 0.703125000000 0.312500000000 0.742187500000 0.351562500000 +rpjob_201.tga 0.742187500000 0.312500000000 0.781250000000 0.351562500000 +rpjob_202.tga 0.781250000000 0.312500000000 0.820312500000 0.351562500000 +rpjob_203.tga 0.820312500000 0.312500000000 0.859375000000 0.351562500000 +rpjob_204.tga 0.859375000000 0.312500000000 0.898437500000 0.351562500000 +rpjob_205.tga 0.898437500000 0.312500000000 0.937500000000 0.351562500000 +rpjob_206.tga 0.937500000000 0.312500000000 0.976562500000 0.351562500000 +rpjob_207.tga 0.468750000000 0.351562500000 0.507812500000 0.390625000000 +rpjob_advanced.tga 0.507812500000 0.351562500000 0.546875000000 0.390625000000 +rpjob_elementary.tga 0.546875000000 0.351562500000 0.585937500000 0.390625000000 +rpjob_roleplay.tga 0.585937500000 0.351562500000 0.625000000000 0.390625000000 +rpjob_task.tga 0.625000000000 0.351562500000 0.664062500000 0.390625000000 +rpjob_task_certificats.tga 0.664062500000 0.351562500000 0.703125000000 0.390625000000 +rpjob_task_convert.tga 0.703125000000 0.351562500000 0.742187500000 0.390625000000 +rpjob_task_elementary.tga 0.742187500000 0.351562500000 0.781250000000 0.390625000000 +rpjob_task_generic.tga 0.781250000000 0.351562500000 0.820312500000 0.390625000000 +rpjob_task_upgrade.tga 0.820312500000 0.351562500000 0.859375000000 0.390625000000 +RW_autolaunch.tga 0.859375000000 0.351562500000 0.898437500000 0.390625000000 +RW_bowgun.tga 0.898437500000 0.351562500000 0.937500000000 0.390625000000 +RW_grenade.tga 0.937500000000 0.351562500000 0.976562500000 0.390625000000 +RW_harpoongun.tga 0.468750000000 0.390625000000 0.507812500000 0.429687500000 +RW_launcher.tga 0.507812500000 0.390625000000 0.546875000000 0.429687500000 +RW_pistol.tga 0.546875000000 0.390625000000 0.585937500000 0.429687500000 +RW_pistolarc.tga 0.585937500000 0.390625000000 0.625000000000 0.429687500000 +RW_rifle.tga 0.625000000000 0.390625000000 0.664062500000 0.429687500000 +SH_buckler.tga 0.664062500000 0.390625000000 0.703125000000 0.429687500000 +SH_large_shield.tga 0.703125000000 0.390625000000 0.742187500000 0.429687500000 +spe_beast.tga 0.742187500000 0.390625000000 0.781250000000 0.429687500000 +spe_com.tga 0.781250000000 0.390625000000 0.820312500000 0.429687500000 +spe_inventory.tga 0.820312500000 0.390625000000 0.859375000000 0.429687500000 +spe_labs.tga 0.859375000000 0.390625000000 0.898437500000 0.429687500000 +spe_memory.tga 0.898437500000 0.390625000000 0.937500000000 0.429687500000 +spe_options.tga 0.937500000000 0.390625000000 0.976562500000 0.429687500000 +spe_status.tga 0.468750000000 0.429687500000 0.507812500000 0.468750000000 +stimulating_water.tga 0.507812500000 0.429687500000 0.546875000000 0.468750000000 +tetekitin.tga 0.546875000000 0.429687500000 0.585937500000 0.468750000000 +to_ammo.tga 0.585937500000 0.429687500000 0.625000000000 0.468750000000 +to_armor.tga 0.625000000000 0.429687500000 0.664062500000 0.468750000000 +to_cooking_pot.tga 0.664062500000 0.429687500000 0.703125000000 0.468750000000 +to_fishing_rod.tga 0.703125000000 0.429687500000 0.742187500000 0.468750000000 +to_forage.tga 0.742187500000 0.429687500000 0.781250000000 0.468750000000 +to_hammer.tga 0.781250000000 0.429687500000 0.820312500000 0.468750000000 +to_jewelry_hammer.tga 0.820312500000 0.429687500000 0.859375000000 0.468750000000 +to_jewels.tga 0.859375000000 0.429687500000 0.898437500000 0.468750000000 +to_leathercutter.tga 0.898437500000 0.429687500000 0.937500000000 0.468750000000 +to_melee.tga 0.937500000000 0.429687500000 0.976562500000 0.468750000000 +to_needle.tga 0.000000000000 0.468750000000 0.039062500000 0.507812500000 +to_pestle.tga 0.039062500000 0.468750000000 0.078125000000 0.507812500000 +to_range.tga 0.078125000000 0.468750000000 0.117187500000 0.507812500000 +to_searake.tga 0.117187500000 0.468750000000 0.156250000000 0.507812500000 +to_spade.tga 0.156250000000 0.468750000000 0.195312500000 0.507812500000 +to_stick.tga 0.195312500000 0.468750000000 0.234375000000 0.507812500000 +to_tunneling_knife.tga 0.234375000000 0.468750000000 0.273437500000 0.507812500000 +to_whip.tga 0.273437500000 0.468750000000 0.312500000000 0.507812500000 +to_wrench.tga 0.312500000000 0.468750000000 0.351562500000 0.507812500000 +TP_caravane.tga 0.351562500000 0.468750000000 0.390625000000 0.507812500000 +TP_kami.tga 0.390625000000 0.468750000000 0.429687500000 0.507812500000 +W_AM_logo.tga 0.429687500000 0.468750000000 0.468750000000 0.507812500000 +w_pa_anklet.tga 0.468750000000 0.468750000000 0.507812500000 0.507812500000 +w_pa_bracelet.tga 0.507812500000 0.468750000000 0.546875000000 0.507812500000 +w_pa_diadem.tga 0.546875000000 0.468750000000 0.585937500000 0.507812500000 +w_pa_earring.tga 0.585937500000 0.468750000000 0.625000000000 0.507812500000 +w_pa_pendant.tga 0.625000000000 0.468750000000 0.664062500000 0.507812500000 +w_pa_ring.tga 0.664062500000 0.468750000000 0.703125000000 0.507812500000 +xp_cat_green.tga 0.703125000000 0.468750000000 0.742187500000 0.507812500000 +asc_exit.tga 0.742187500000 0.468750000000 0.773437500000 0.500000000000 +asc_rolemastercraft.tga 0.773437500000 0.468750000000 0.804687500000 0.500000000000 +asc_rolemasterfight.tga 0.804687500000 0.468750000000 0.835937500000 0.500000000000 +asc_rolemasterharvest.tga 0.835937500000 0.468750000000 0.867187500000 0.500000000000 +asc_rolemastermagic.tga 0.867187500000 0.468750000000 0.898437500000 0.500000000000 +asc_unknown.tga 0.898437500000 0.468750000000 0.929687500000 0.500000000000 +mail.tga 0.929687500000 0.468750000000 0.960937500000 0.492187500000 +mp_back_curative.tga 0.976562500000 0.078125000000 1.000000000000 0.101562500000 +mp_back_offensive.tga 0.976562500000 0.101562500000 1.000000000000 0.125000000000 +mp_back_selfonly.tga 0.976562500000 0.125000000000 1.000000000000 0.148437500000 +building_state_24x24.tga 0.976562500000 0.148437500000 1.000000000000 0.171875000000 +ico_ammo_bullet.tga 0.976562500000 0.171875000000 1.000000000000 0.195312500000 +ico_ammo_jacket.tga 0.976562500000 0.195312500000 1.000000000000 0.218750000000 +ico_angle.tga 0.976562500000 0.218750000000 1.000000000000 0.242187500000 +ico_anti_magic_shield.tga 0.976562500000 0.242187500000 1.000000000000 0.265625000000 +ico_armor.tga 0.976562500000 0.265625000000 1.000000000000 0.289062500000 +ico_armor_clip.tga 0.976562500000 0.289062500000 1.000000000000 0.312500000000 +ico_armor_heavy.tga 0.976562500000 0.312500000000 1.000000000000 0.335937500000 +ico_armor_kitin.tga 0.976562500000 0.335937500000 1.000000000000 0.359375000000 +ico_armor_light.tga 0.976562500000 0.359375000000 1.000000000000 0.382812500000 +ico_armor_medium.tga 0.976562500000 0.382812500000 1.000000000000 0.406250000000 +ico_armor_penalty.tga 0.976562500000 0.406250000000 1.000000000000 0.429687500000 +ico_armor_shell.tga 0.976562500000 0.429687500000 1.000000000000 0.453125000000 +ico_atys.tga 0.976562500000 0.453125000000 1.000000000000 0.476562500000 +ico_atysian.tga 0.960937500000 0.476562500000 0.984375000000 0.500000000000 +ico_balance_hp.tga 0.929687500000 0.492187500000 0.953125000000 0.515625000000 +ico_barrel.tga 0.742187500000 0.500000000000 0.765625000000 0.523437500000 +ico_bash.tga 0.765625000000 0.500000000000 0.789062500000 0.523437500000 +ico_berserk.tga 0.789062500000 0.500000000000 0.812500000000 0.523437500000 +ico_blade.tga 0.812500000000 0.500000000000 0.835937500000 0.523437500000 +ico_bleeding.tga 0.835937500000 0.500000000000 0.859375000000 0.523437500000 +ico_blind.tga 0.859375000000 0.500000000000 0.882812500000 0.523437500000 +ico_blunt.tga 0.882812500000 0.500000000000 0.906250000000 0.523437500000 +ico_bomb.tga 0.906250000000 0.500000000000 0.929687500000 0.523437500000 +cb_main_nue.tga 0.953125000000 0.500000000000 0.976562500000 0.523437500000 +ico_celestial.tga 0.976562500000 0.500000000000 1.000000000000 0.523437500000 +ico_circular_attack.tga 0.000000000000 0.507812500000 0.023437500000 0.531250000000 +ico_clothes.tga 0.023437500000 0.507812500000 0.046875000000 0.531250000000 +ico_cold.tga 0.046875000000 0.507812500000 0.070312500000 0.531250000000 +ico_concentration.tga 0.070312500000 0.507812500000 0.093750000000 0.531250000000 +BK_matis_brick.tga 0.093750000000 0.507812500000 0.117187500000 0.531250000000 +ico_constitution.tga 0.117187500000 0.507812500000 0.140625000000 0.531250000000 +ico_counterweight.tga 0.140625000000 0.507812500000 0.164062500000 0.531250000000 +ico_craft_buff.tga 0.164062500000 0.507812500000 0.187500000000 0.531250000000 +ico_create_sapload.tga 0.187500000000 0.507812500000 0.210937500000 0.531250000000 +ico_curse.tga 0.210937500000 0.507812500000 0.234375000000 0.531250000000 +ico_debuff.tga 0.234375000000 0.507812500000 0.257812500000 0.531250000000 +ico_debuff_resist.tga 0.257812500000 0.507812500000 0.281250000000 0.531250000000 +ico_debuff_skill.tga 0.281250000000 0.507812500000 0.304687500000 0.531250000000 +ico_desert.tga 0.304687500000 0.507812500000 0.328125000000 0.531250000000 +ico_dexterity.tga 0.328125000000 0.507812500000 0.351562500000 0.531250000000 +ico_disarm.tga 0.351562500000 0.507812500000 0.375000000000 0.531250000000 +ico_dodge.tga 0.375000000000 0.507812500000 0.398437500000 0.531250000000 +ico_dot.tga 0.398437500000 0.507812500000 0.421875000000 0.531250000000 +ico_durability.tga 0.421875000000 0.507812500000 0.445312500000 0.531250000000 +ico_electric.tga 0.445312500000 0.507812500000 0.468750000000 0.531250000000 +ico_explosif.tga 0.468750000000 0.507812500000 0.492187500000 0.531250000000 +ico_extracting.tga 0.492187500000 0.507812500000 0.515625000000 0.531250000000 +ico_fear.tga 0.515625000000 0.507812500000 0.539062500000 0.531250000000 +ico_feint.tga 0.539062500000 0.507812500000 0.562500000000 0.531250000000 +ico_fire.tga 0.562500000000 0.507812500000 0.585937500000 0.531250000000 +ico_firing_pin.tga 0.585937500000 0.507812500000 0.609375000000 0.531250000000 +ch_back.tga 0.609375000000 0.507812500000 0.632812500000 0.531250000000 +BK_generic_brick.tga 0.632812500000 0.507812500000 0.656250000000 0.531250000000 +mp_over_link.tga 0.656250000000 0.507812500000 0.679687500000 0.531250000000 +bk_aura.tga 0.679687500000 0.507812500000 0.703125000000 0.531250000000 +bk_conso.tga 0.703125000000 0.507812500000 0.726562500000 0.531250000000 +bk_outpost_brick.tga 0.929687500000 0.515625000000 0.953125000000 0.539062500000 +bk_power.tga 0.726562500000 0.523437500000 0.750000000000 0.546875000000 +ico_focus.tga 0.750000000000 0.523437500000 0.773437500000 0.546875000000 +ico_forage_buff.tga 0.773437500000 0.523437500000 0.796875000000 0.546875000000 +ico_forbid_item.tga 0.796875000000 0.523437500000 0.820312500000 0.546875000000 +ico_forest.tga 0.820312500000 0.523437500000 0.843750000000 0.546875000000 +2h_over.tga 0.843750000000 0.523437500000 0.867187500000 0.546875000000 +ico_gardening.tga 0.867187500000 0.523437500000 0.890625000000 0.546875000000 +ico_gentle.tga 0.890625000000 0.523437500000 0.914062500000 0.546875000000 +ico_goo.tga 0.953125000000 0.523437500000 0.976562500000 0.546875000000 +ico_gripp.tga 0.976562500000 0.523437500000 1.000000000000 0.546875000000 +1h_over.tga 0.000000000000 0.531250000000 0.023437500000 0.554687500000 +BK_fyros_brick.tga 0.023437500000 0.531250000000 0.046875000000 0.554687500000 +ico_hammer.tga 0.046875000000 0.531250000000 0.070312500000 0.554687500000 +ico_harmful.tga 0.070312500000 0.531250000000 0.093750000000 0.554687500000 +ico_hatred.tga 0.093750000000 0.531250000000 0.117187500000 0.554687500000 +ico_heal.tga 0.117187500000 0.531250000000 0.140625000000 0.554687500000 +ico_hit_rate.tga 0.140625000000 0.531250000000 0.164062500000 0.554687500000 +ico_incapacity.tga 0.164062500000 0.531250000000 0.187500000000 0.554687500000 +ico_intelligence.tga 0.187500000000 0.531250000000 0.210937500000 0.554687500000 +ico_interrupt.tga 0.210937500000 0.531250000000 0.234375000000 0.554687500000 +ico_invulnerability.tga 0.234375000000 0.531250000000 0.257812500000 0.554687500000 +ico_jewel_stone.tga 0.257812500000 0.531250000000 0.281250000000 0.554687500000 +ico_jewel_stone_support.tga 0.281250000000 0.531250000000 0.304687500000 0.554687500000 +ico_jungle.tga 0.304687500000 0.531250000000 0.328125000000 0.554687500000 +ico_lacustre.tga 0.328125000000 0.531250000000 0.351562500000 0.554687500000 +ico_landmark_bonus.tga 0.351562500000 0.531250000000 0.375000000000 0.554687500000 +ico_level.tga 0.375000000000 0.531250000000 0.398437500000 0.554687500000 +ico_lining.tga 0.398437500000 0.531250000000 0.421875000000 0.554687500000 +ico_location.tga 0.421875000000 0.531250000000 0.445312500000 0.554687500000 +ico_madness.tga 0.445312500000 0.531250000000 0.468750000000 0.554687500000 +ico_magic.tga 0.468750000000 0.531250000000 0.492187500000 0.554687500000 +ico_magic_action_buff.tga 0.492187500000 0.531250000000 0.515625000000 0.554687500000 +ico_magic_focus.tga 0.515625000000 0.531250000000 0.539062500000 0.554687500000 +ico_magic_target_buff.tga 0.539062500000 0.531250000000 0.562500000000 0.554687500000 +ico_melee_action_buff.tga 0.562500000000 0.531250000000 0.585937500000 0.554687500000 +ico_melee_target_buff.tga 0.585937500000 0.531250000000 0.609375000000 0.554687500000 +ico_mental.tga 0.609375000000 0.531250000000 0.632812500000 0.554687500000 +no_action.tga 0.632812500000 0.531250000000 0.656250000000 0.554687500000 +op_back.tga 0.656250000000 0.531250000000 0.679687500000 0.554687500000 +op_over_break.tga 0.679687500000 0.531250000000 0.703125000000 0.554687500000 +op_over_less.tga 0.703125000000 0.531250000000 0.726562500000 0.554687500000 +op_over_more.tga 0.914062500000 0.539062500000 0.937500000000 0.562500000000 +ico_metabolism.tga 0.726562500000 0.546875000000 0.750000000000 0.570312500000 +pa_back.tga 0.750000000000 0.546875000000 0.773437500000 0.570312500000 +ico_mezz.tga 0.773437500000 0.546875000000 0.796875000000 0.570312500000 +ico_misfortune.tga 0.796875000000 0.546875000000 0.820312500000 0.570312500000 +BK_magie_noire_brick.tga 0.820312500000 0.546875000000 0.843750000000 0.570312500000 +pa_over_break.tga 0.843750000000 0.546875000000 0.867187500000 0.570312500000 +pa_over_less.tga 0.867187500000 0.546875000000 0.890625000000 0.570312500000 +pa_over_more.tga 0.890625000000 0.546875000000 0.914062500000 0.570312500000 +BK_tryker_brick.tga 0.937500000000 0.546875000000 0.960937500000 0.570312500000 +cp_back.tga 0.960937500000 0.546875000000 0.984375000000 0.570312500000 +cp_over_break.tga 0.000000000000 0.554687500000 0.023437500000 0.578125000000 +pvp_ally_0.tga 0.023437500000 0.554687500000 0.046875000000 0.578125000000 +pvp_ally_1.tga 0.046875000000 0.554687500000 0.070312500000 0.578125000000 +pvp_ally_2.tga 0.070312500000 0.554687500000 0.093750000000 0.578125000000 +pvp_ally_3.tga 0.093750000000 0.554687500000 0.117187500000 0.578125000000 +pvp_ally_4.tga 0.117187500000 0.554687500000 0.140625000000 0.578125000000 +pvp_ally_6.tga 0.140625000000 0.554687500000 0.164062500000 0.578125000000 +pvp_ally_primas.tga 0.164062500000 0.554687500000 0.187500000000 0.578125000000 +pvp_ally_ranger.tga 0.187500000000 0.554687500000 0.210937500000 0.578125000000 +cp_over_less.tga 0.210937500000 0.554687500000 0.234375000000 0.578125000000 +cp_over_more.tga 0.234375000000 0.554687500000 0.257812500000 0.578125000000 +cp_over_opening.tga 0.257812500000 0.554687500000 0.281250000000 0.578125000000 +cp_over_opening_2.tga 0.281250000000 0.554687500000 0.304687500000 0.578125000000 +pvp_enemy_0.tga 0.304687500000 0.554687500000 0.328125000000 0.578125000000 +pvp_enemy_1.tga 0.328125000000 0.554687500000 0.351562500000 0.578125000000 +pvp_enemy_2.tga 0.351562500000 0.554687500000 0.375000000000 0.578125000000 +pvp_enemy_3.tga 0.375000000000 0.554687500000 0.398437500000 0.578125000000 +pvp_enemy_4.tga 0.398437500000 0.554687500000 0.421875000000 0.578125000000 +pvp_enemy_6.tga 0.421875000000 0.554687500000 0.445312500000 0.578125000000 +pvp_enemy_marauder.tga 0.445312500000 0.554687500000 0.468750000000 0.578125000000 +pvp_enemy_trytonist.tga 0.468750000000 0.554687500000 0.492187500000 0.578125000000 +bg_downloader.tga 0.492187500000 0.554687500000 0.515625000000 0.578125000000 +BK_zorai_brick.tga 0.515625000000 0.554687500000 0.539062500000 0.578125000000 +ef_back.tga 0.539062500000 0.554687500000 0.562500000000 0.578125000000 +ef_over_break.tga 0.562500000000 0.554687500000 0.585937500000 0.578125000000 +ico_move.tga 0.585937500000 0.554687500000 0.609375000000 0.578125000000 +ico_multiple_spots.tga 0.609375000000 0.554687500000 0.632812500000 0.578125000000 +ico_multi_fight.tga 0.632812500000 0.554687500000 0.656250000000 0.578125000000 +ef_over_less.tga 0.656250000000 0.554687500000 0.679687500000 0.578125000000 +ico_opening_hit.tga 0.679687500000 0.554687500000 0.703125000000 0.578125000000 +ico_over_autumn.tga 0.703125000000 0.554687500000 0.726562500000 0.578125000000 +ico_over_degenerated.tga 0.914062500000 0.562500000000 0.937500000000 0.585937500000 +ico_over_fauna.tga 0.726562500000 0.570312500000 0.750000000000 0.593750000000 +ico_over_flora.tga 0.750000000000 0.570312500000 0.773437500000 0.593750000000 +ico_over_hit_arms.tga 0.773437500000 0.570312500000 0.796875000000 0.593750000000 +ico_over_hit_chest.tga 0.796875000000 0.570312500000 0.820312500000 0.593750000000 +ico_over_hit_feet.tga 0.820312500000 0.570312500000 0.843750000000 0.593750000000 +ico_over_hit_feet_hands.tga 0.843750000000 0.570312500000 0.867187500000 0.593750000000 +ico_over_hit_feet_head.tga 0.867187500000 0.570312500000 0.890625000000 0.593750000000 +ico_over_hit_feet_x2.tga 0.890625000000 0.570312500000 0.914062500000 0.593750000000 +ico_over_hit_feint_x3.tga 0.937500000000 0.570312500000 0.960937500000 0.593750000000 +ico_over_hit_hands.tga 0.960937500000 0.570312500000 0.984375000000 0.593750000000 +ico_over_hit_hands_chest.tga 0.000000000000 0.578125000000 0.023437500000 0.601562500000 +ico_over_hit_hands_head.tga 0.023437500000 0.578125000000 0.046875000000 0.601562500000 +ico_over_hit_head.tga 0.046875000000 0.578125000000 0.070312500000 0.601562500000 +ico_over_hit_head_x3.tga 0.070312500000 0.578125000000 0.093750000000 0.601562500000 +ico_over_hit_legs.tga 0.093750000000 0.578125000000 0.117187500000 0.601562500000 +ico_over_homin.tga 0.117187500000 0.578125000000 0.140625000000 0.601562500000 +ico_over_kitin.tga 0.140625000000 0.578125000000 0.164062500000 0.601562500000 +ico_over_magic.tga 0.164062500000 0.578125000000 0.187500000000 0.601562500000 +ico_over_melee.tga 0.187500000000 0.578125000000 0.210937500000 0.601562500000 +ico_over_racial.tga 0.210937500000 0.578125000000 0.234375000000 0.601562500000 +ico_over_range.tga 0.234375000000 0.578125000000 0.257812500000 0.601562500000 +ico_over_special.tga 0.257812500000 0.578125000000 0.281250000000 0.601562500000 +ico_over_spring.tga 0.281250000000 0.578125000000 0.304687500000 0.601562500000 +ico_over_summer.tga 0.304687500000 0.578125000000 0.328125000000 0.601562500000 +ico_over_winter.tga 0.328125000000 0.578125000000 0.351562500000 0.601562500000 +ico_parry.tga 0.351562500000 0.578125000000 0.375000000000 0.601562500000 +ico_piercing.tga 0.375000000000 0.578125000000 0.398437500000 0.601562500000 +ico_pointe.tga 0.398437500000 0.578125000000 0.421875000000 0.601562500000 +ico_poison.tga 0.421875000000 0.578125000000 0.445312500000 0.601562500000 +ico_power.tga 0.445312500000 0.578125000000 0.468750000000 0.601562500000 +ico_preservation.tga 0.468750000000 0.578125000000 0.492187500000 0.601562500000 +ico_primal.tga 0.492187500000 0.578125000000 0.515625000000 0.601562500000 +ico_prime_roots.tga 0.515625000000 0.578125000000 0.539062500000 0.601562500000 +ico_private.tga 0.539062500000 0.578125000000 0.562500000000 0.601562500000 +ico_prospecting.tga 0.562500000000 0.578125000000 0.585937500000 0.601562500000 +ico_quality.tga 0.585937500000 0.578125000000 0.609375000000 0.601562500000 +ef_over_more.tga 0.609375000000 0.578125000000 0.632812500000 0.601562500000 +ico_range.tga 0.632812500000 0.578125000000 0.656250000000 0.601562500000 +ico_range_action_buff.tga 0.656250000000 0.578125000000 0.679687500000 0.601562500000 +ico_range_target_buff.tga 0.679687500000 0.578125000000 0.703125000000 0.601562500000 +ico_ricochet.tga 0.703125000000 0.578125000000 0.726562500000 0.601562500000 +ico_root.tga 0.914062500000 0.585937500000 0.937500000000 0.609375000000 +ico_rot.tga 0.726562500000 0.593750000000 0.750000000000 0.617187500000 +ico_safe.tga 0.750000000000 0.593750000000 0.773437500000 0.617187500000 +ico_sap.tga 0.773437500000 0.593750000000 0.796875000000 0.617187500000 +ico_self_damage.tga 0.796875000000 0.593750000000 0.820312500000 0.617187500000 +ico_shaft.tga 0.820312500000 0.593750000000 0.843750000000 0.617187500000 +ico_shielding.tga 0.843750000000 0.593750000000 0.867187500000 0.617187500000 +ico_shield_buff.tga 0.867187500000 0.593750000000 0.890625000000 0.617187500000 +ico_shield_up.tga 0.890625000000 0.593750000000 0.914062500000 0.617187500000 +ico_shockwave.tga 0.937500000000 0.593750000000 0.960937500000 0.617187500000 +ico_sickness.tga 0.960937500000 0.593750000000 0.984375000000 0.617187500000 +ico_slashing.tga 0.000000000000 0.601562500000 0.023437500000 0.625000000000 +ico_slow.tga 0.023437500000 0.601562500000 0.046875000000 0.625000000000 +ico_soft_spot.tga 0.046875000000 0.601562500000 0.070312500000 0.625000000000 +ico_source_time.tga 0.070312500000 0.601562500000 0.093750000000 0.625000000000 +ico_speed.tga 0.093750000000 0.601562500000 0.117187500000 0.625000000000 +ico_speeding_up.tga 0.117187500000 0.601562500000 0.140625000000 0.625000000000 +ico_spell_break.tga 0.140625000000 0.601562500000 0.164062500000 0.625000000000 +fo_back.tga 0.164062500000 0.601562500000 0.187500000000 0.625000000000 +ico_spray.tga 0.187500000000 0.601562500000 0.210937500000 0.625000000000 +ico_spying.tga 0.210937500000 0.601562500000 0.234375000000 0.625000000000 +ico_stamina.tga 0.234375000000 0.601562500000 0.257812500000 0.625000000000 +ico_strength.tga 0.257812500000 0.601562500000 0.281250000000 0.625000000000 +ico_stuffing.tga 0.281250000000 0.601562500000 0.304687500000 0.625000000000 +ico_stunn.tga 0.304687500000 0.601562500000 0.328125000000 0.625000000000 +fo_over.tga 0.328125000000 0.601562500000 0.351562500000 0.625000000000 +fp_ammo.tga 0.351562500000 0.601562500000 0.375000000000 0.625000000000 +fp_armor.tga 0.375000000000 0.601562500000 0.398437500000 0.625000000000 +fp_building.tga 0.398437500000 0.601562500000 0.421875000000 0.625000000000 +fp_jewel.tga 0.421875000000 0.601562500000 0.445312500000 0.625000000000 +fp_melee.tga 0.445312500000 0.601562500000 0.468750000000 0.625000000000 +fp_over.tga 0.468750000000 0.601562500000 0.492187500000 0.625000000000 +fp_range.tga 0.492187500000 0.601562500000 0.515625000000 0.625000000000 +fp_shield.tga 0.515625000000 0.601562500000 0.539062500000 0.625000000000 +fp_tools.tga 0.539062500000 0.601562500000 0.562500000000 0.625000000000 +brick_default.tga 0.562500000000 0.601562500000 0.585937500000 0.625000000000 +ico_taunt.tga 0.585937500000 0.601562500000 0.609375000000 0.625000000000 +tb_action_attack.tga 0.609375000000 0.601562500000 0.632812500000 0.625000000000 +tb_action_config.tga 0.632812500000 0.601562500000 0.656250000000 0.625000000000 +tb_action_disband.tga 0.656250000000 0.601562500000 0.679687500000 0.625000000000 +tb_action_disengage.tga 0.679687500000 0.601562500000 0.703125000000 0.625000000000 +tb_action_extract.tga 0.703125000000 0.601562500000 0.726562500000 0.625000000000 +tb_action_invite.tga 0.914062500000 0.609375000000 0.937500000000 0.632812500000 +tb_action_kick.tga 0.726562500000 0.617187500000 0.750000000000 0.640625000000 +tb_action_move.tga 0.750000000000 0.617187500000 0.773437500000 0.640625000000 +tb_action_run.tga 0.773437500000 0.617187500000 0.796875000000 0.640625000000 +tb_action_sit.tga 0.796875000000 0.617187500000 0.820312500000 0.640625000000 +tb_action_stand.tga 0.820312500000 0.617187500000 0.843750000000 0.640625000000 +tb_action_stop.tga 0.843750000000 0.617187500000 0.867187500000 0.640625000000 +tb_action_talk.tga 0.867187500000 0.617187500000 0.890625000000 0.640625000000 +tb_action_walk.tga 0.890625000000 0.617187500000 0.914062500000 0.640625000000 +tb_animals.tga 0.937500000000 0.617187500000 0.960937500000 0.640625000000 +tb_config.tga 0.960937500000 0.617187500000 0.984375000000 0.640625000000 +tb_connection.tga 0.000000000000 0.625000000000 0.023437500000 0.648437500000 +tb_contacts.tga 0.023437500000 0.625000000000 0.046875000000 0.648437500000 +tb_desk_1.tga 0.046875000000 0.625000000000 0.070312500000 0.648437500000 +tb_desk_2.tga 0.070312500000 0.625000000000 0.093750000000 0.648437500000 +tb_desk_3.tga 0.093750000000 0.625000000000 0.117187500000 0.648437500000 +tb_desk_4.tga 0.117187500000 0.625000000000 0.140625000000 0.648437500000 +tb_faction.tga 0.140625000000 0.625000000000 0.164062500000 0.648437500000 +tb_forum.tga 0.164062500000 0.625000000000 0.187500000000 0.648437500000 +tb_guild.tga 0.187500000000 0.625000000000 0.210937500000 0.648437500000 +TB_help2.tga 0.210937500000 0.625000000000 0.234375000000 0.648437500000 +tb_keys.tga 0.234375000000 0.625000000000 0.257812500000 0.648437500000 +tb_macros.tga 0.257812500000 0.625000000000 0.281250000000 0.648437500000 +tb_mail.tga 0.281250000000 0.625000000000 0.304687500000 0.648437500000 +tb_mode_dodge.tga 0.304687500000 0.625000000000 0.328125000000 0.648437500000 +tb_mode_parry.tga 0.328125000000 0.625000000000 0.351562500000 0.648437500000 +tb_over.tga 0.351562500000 0.625000000000 0.375000000000 0.648437500000 +tb_support.tga 0.375000000000 0.625000000000 0.398437500000 0.648437500000 +tb_team.tga 0.398437500000 0.625000000000 0.421875000000 0.648437500000 +tb_windows.tga 0.421875000000 0.625000000000 0.445312500000 0.648437500000 +ico_time.tga 0.445312500000 0.625000000000 0.468750000000 0.648437500000 +ico_time_bonus.tga 0.468750000000 0.625000000000 0.492187500000 0.648437500000 +ico_absorb_damage.tga 0.492187500000 0.625000000000 0.515625000000 0.648437500000 +ico_trigger.tga 0.515625000000 0.625000000000 0.539062500000 0.648437500000 +ico_umbrella.tga 0.539062500000 0.625000000000 0.562500000000 0.648437500000 +ico_use_enchantement.tga 0.562500000000 0.625000000000 0.585937500000 0.648437500000 +ico_vampire.tga 0.585937500000 0.625000000000 0.609375000000 0.648437500000 +ico_visibility.tga 0.609375000000 0.625000000000 0.632812500000 0.648437500000 +ico_war_cry.tga 0.632812500000 0.625000000000 0.656250000000 0.648437500000 +ico_weight.tga 0.656250000000 0.625000000000 0.679687500000 0.648437500000 +ico_wellbalanced.tga 0.679687500000 0.625000000000 0.703125000000 0.648437500000 +ico_will.tga 0.703125000000 0.625000000000 0.726562500000 0.648437500000 +ico_windding.tga 0.914062500000 0.632812500000 0.937500000000 0.656250000000 +ico_wisdom.tga 0.726562500000 0.640625000000 0.750000000000 0.664062500000 +ico_accurate.tga 0.750000000000 0.640625000000 0.773437500000 0.664062500000 +ico_acid.tga 0.773437500000 0.640625000000 0.796875000000 0.664062500000 +ico_aim.tga 0.796875000000 0.640625000000 0.820312500000 0.664062500000 +ico_aim_bird_wings.tga 0.820312500000 0.640625000000 0.843750000000 0.664062500000 +ico_aim_flying_kitin_abdomen.tga 0.843750000000 0.640625000000 0.867187500000 0.664062500000 +ico_aim_homin_arms.tga 0.867187500000 0.640625000000 0.890625000000 0.664062500000 +ico_aim_homin_chest.tga 0.890625000000 0.640625000000 0.914062500000 0.664062500000 +mf_back.tga 0.937500000000 0.640625000000 0.960937500000 0.664062500000 +us_back_0.tga 0.960937500000 0.640625000000 0.984375000000 0.664062500000 +us_back_1.tga 0.000000000000 0.648437500000 0.023437500000 0.671875000000 +us_back_2.tga 0.023437500000 0.648437500000 0.046875000000 0.671875000000 +us_back_3.tga 0.046875000000 0.648437500000 0.070312500000 0.671875000000 +us_back_4.tga 0.070312500000 0.648437500000 0.093750000000 0.671875000000 +us_back_5.tga 0.093750000000 0.648437500000 0.117187500000 0.671875000000 +us_back_6.tga 0.117187500000 0.648437500000 0.140625000000 0.671875000000 +us_back_7.tga 0.140625000000 0.648437500000 0.164062500000 0.671875000000 +us_back_8.tga 0.164062500000 0.648437500000 0.187500000000 0.671875000000 +us_back_9.tga 0.187500000000 0.648437500000 0.210937500000 0.671875000000 +us_ico_0.tga 0.210937500000 0.648437500000 0.234375000000 0.671875000000 +us_ico_1.tga 0.234375000000 0.648437500000 0.257812500000 0.671875000000 +us_ico_2.tga 0.257812500000 0.648437500000 0.281250000000 0.671875000000 +us_ico_3.tga 0.281250000000 0.648437500000 0.304687500000 0.671875000000 +us_ico_4.tga 0.304687500000 0.648437500000 0.328125000000 0.671875000000 +us_ico_5.tga 0.328125000000 0.648437500000 0.351562500000 0.671875000000 +us_ico_6.tga 0.351562500000 0.648437500000 0.375000000000 0.671875000000 +us_ico_7.tga 0.375000000000 0.648437500000 0.398437500000 0.671875000000 +us_ico_8.tga 0.398437500000 0.648437500000 0.421875000000 0.671875000000 +us_ico_9.tga 0.421875000000 0.648437500000 0.445312500000 0.671875000000 +us_over_0.tga 0.445312500000 0.648437500000 0.468750000000 0.671875000000 +us_over_1.tga 0.468750000000 0.648437500000 0.492187500000 0.671875000000 +us_over_2.tga 0.492187500000 0.648437500000 0.515625000000 0.671875000000 +us_over_3.tga 0.515625000000 0.648437500000 0.539062500000 0.671875000000 +us_over_4.tga 0.539062500000 0.648437500000 0.562500000000 0.671875000000 +mf_over.tga 0.562500000000 0.648437500000 0.585937500000 0.671875000000 +ico_aim_homin_feet.tga 0.585937500000 0.648437500000 0.609375000000 0.671875000000 +ico_aim_homin_feint.tga 0.609375000000 0.648437500000 0.632812500000 0.671875000000 +ico_aim_homin_hands.tga 0.632812500000 0.648437500000 0.656250000000 0.671875000000 +ico_aim_homin_head.tga 0.656250000000 0.648437500000 0.679687500000 0.671875000000 +ico_aim_homin_legs.tga 0.679687500000 0.648437500000 0.703125000000 0.671875000000 +mp3.tga 0.703125000000 0.648437500000 0.726562500000 0.671875000000 +W_slot_shortcut_id0.tga 0.914062500000 0.656250000000 0.937500000000 0.679687500000 +W_slot_shortcut_id1.tga 0.726562500000 0.664062500000 0.750000000000 0.687500000000 +W_slot_shortcut_id2.tga 0.750000000000 0.664062500000 0.773437500000 0.687500000000 +W_slot_shortcut_id3.tga 0.773437500000 0.664062500000 0.796875000000 0.687500000000 +W_slot_shortcut_id4.tga 0.796875000000 0.664062500000 0.820312500000 0.687500000000 +W_slot_shortcut_id5.tga 0.820312500000 0.664062500000 0.843750000000 0.687500000000 +W_slot_shortcut_id6.tga 0.843750000000 0.664062500000 0.867187500000 0.687500000000 +W_slot_shortcut_id7.tga 0.867187500000 0.664062500000 0.890625000000 0.687500000000 +W_slot_shortcut_id8.tga 0.890625000000 0.664062500000 0.914062500000 0.687500000000 +W_slot_shortcut_id9.tga 0.937500000000 0.664062500000 0.960937500000 0.687500000000 +w_slot_shortcut_shift_id0.tga 0.960937500000 0.664062500000 0.984375000000 0.687500000000 +w_slot_shortcut_shift_id1.tga 0.000000000000 0.671875000000 0.023437500000 0.695312500000 +w_slot_shortcut_shift_id2.tga 0.023437500000 0.671875000000 0.046875000000 0.695312500000 +w_slot_shortcut_shift_id3.tga 0.046875000000 0.671875000000 0.070312500000 0.695312500000 +w_slot_shortcut_shift_id4.tga 0.070312500000 0.671875000000 0.093750000000 0.695312500000 +w_slot_shortcut_shift_id5.tga 0.093750000000 0.671875000000 0.117187500000 0.695312500000 +w_slot_shortcut_shift_id6.tga 0.117187500000 0.671875000000 0.140625000000 0.695312500000 +w_slot_shortcut_shift_id7.tga 0.140625000000 0.671875000000 0.164062500000 0.695312500000 +w_slot_shortcut_shift_id8.tga 0.164062500000 0.671875000000 0.187500000000 0.695312500000 +w_slot_shortcut_shift_id9.tga 0.187500000000 0.671875000000 0.210937500000 0.695312500000 +ico_aim_kitin_head.tga 0.210937500000 0.671875000000 0.234375000000 0.695312500000 +ico_source_knowledge.tga 0.234375000000 0.671875000000 0.255859375000 0.695312500000 +small_task_done.tga 0.984375000000 0.000000000000 1.000000000000 0.015625000000 +small_task_failed.tga 0.984375000000 0.015625000000 1.000000000000 0.031250000000 +small_task_fight.tga 0.984375000000 0.031250000000 1.000000000000 0.046875000000 +small_task_forage.tga 0.980468750000 0.046875000000 0.996093750000 0.062500000000 +small_task_generic.tga 0.980468750000 0.062500000000 0.996093750000 0.078125000000 +small_task_guild.tga 0.984375000000 0.476562500000 1.000000000000 0.492187500000 +small_task_rite.tga 0.726562500000 0.507812500000 0.742187500000 0.523437500000 +small_task_travel.tga 0.914062500000 0.523437500000 0.929687500000 0.539062500000 +small_task_craft.tga 0.984375000000 0.546875000000 1.000000000000 0.562500000000 +num_slash.tga 0.984375000000 0.562500000000 0.996093750000 0.576171875000 +W_leader.tga 0.984375000000 0.578125000000 0.997070312500 0.589843750000 +tb_mode.tga 0.984375000000 0.589843750000 0.996093750000 0.601562500000 +profile.tga 0.984375000000 0.601562500000 0.996093750000 0.613281250000 +w_major.tga 0.984375000000 0.613281250000 0.996093750000 0.625000000000 diff --git a/code/ryzom/client/data/gamedev/adds/sfx/ul_mission_hall_of_fame.ps b/code/ryzom/client/data/gamedev/adds/sfx/ul_mission_hall_of_fame.ps new file mode 100644 index 000000000..22e53f98d Binary files /dev/null and b/code/ryzom/client/data/gamedev/adds/sfx/ul_mission_hall_of_fame.ps differ diff --git a/code/ryzom/client/data/gamedev/adds/shapes/Ge_gift_blue.shape b/code/ryzom/client/data/gamedev/adds/shapes/Ge_gift_blue.shape new file mode 100644 index 000000000..d00ceca2d Binary files /dev/null and b/code/ryzom/client/data/gamedev/adds/shapes/Ge_gift_blue.shape differ diff --git a/code/ryzom/client/data/gamedev/adds/shapes/Ge_gift_blue_yubo.shape b/code/ryzom/client/data/gamedev/adds/shapes/Ge_gift_blue_yubo.shape new file mode 100644 index 000000000..c1c313e80 Binary files /dev/null and b/code/ryzom/client/data/gamedev/adds/shapes/Ge_gift_blue_yubo.shape differ diff --git a/code/ryzom/client/data/gamedev/adds/shapes/Ge_gift_green.shape b/code/ryzom/client/data/gamedev/adds/shapes/Ge_gift_green.shape new file mode 100644 index 000000000..4b2cf8e92 Binary files /dev/null and b/code/ryzom/client/data/gamedev/adds/shapes/Ge_gift_green.shape differ diff --git a/code/ryzom/client/data/gamedev/adds/shapes/Ge_gift_green_yubo.shape b/code/ryzom/client/data/gamedev/adds/shapes/Ge_gift_green_yubo.shape new file mode 100644 index 000000000..dd29554ae Binary files /dev/null and b/code/ryzom/client/data/gamedev/adds/shapes/Ge_gift_green_yubo.shape differ diff --git a/code/ryzom/client/data/gamedev/adds/shapes/Ge_gift_red.shape b/code/ryzom/client/data/gamedev/adds/shapes/Ge_gift_red.shape new file mode 100644 index 000000000..6ab854bd5 Binary files /dev/null and b/code/ryzom/client/data/gamedev/adds/shapes/Ge_gift_red.shape differ diff --git a/code/ryzom/client/data/gamedev/adds/shapes/Ge_gift_red_yubo.shape b/code/ryzom/client/data/gamedev/adds/shapes/Ge_gift_red_yubo.shape new file mode 100644 index 000000000..8d486cf68 Binary files /dev/null and b/code/ryzom/client/data/gamedev/adds/shapes/Ge_gift_red_yubo.shape differ diff --git a/code/ryzom/client/data/gamedev/adds/shapes/Ge_gift_yellow.shape b/code/ryzom/client/data/gamedev/adds/shapes/Ge_gift_yellow.shape new file mode 100644 index 000000000..34abdc414 Binary files /dev/null and b/code/ryzom/client/data/gamedev/adds/shapes/Ge_gift_yellow.shape differ diff --git a/code/ryzom/client/data/gamedev/adds/shapes/Ge_gift_yellow_yubo.shape b/code/ryzom/client/data/gamedev/adds/shapes/Ge_gift_yellow_yubo.shape new file mode 100644 index 000000000..32aba921d Binary files /dev/null and b/code/ryzom/client/data/gamedev/adds/shapes/Ge_gift_yellow_yubo.shape differ diff --git a/code/ryzom/client/data/gamedev/adds/shapes/UL_Mission_Hall_Of_Fame.shape b/code/ryzom/client/data/gamedev/adds/shapes/UL_Mission_Hall_Of_Fame.shape new file mode 100644 index 000000000..21773da12 Binary files /dev/null and b/code/ryzom/client/data/gamedev/adds/shapes/UL_Mission_Hall_Of_Fame.shape differ diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/actions.xml b/code/ryzom/client/data/gamedev/interfaces_v3/actions.xml index 3b0395826..06cbac804 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/actions.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/actions.xml @@ -27,6 +27,7 @@ + @@ -165,6 +166,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -262,6 +287,8 @@ + + diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/bot_chat_v4.xml b/code/ryzom/client/data/gamedev/interfaces_v3/bot_chat_v4.xml index 4efed8d2f..caf7394f8 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/bot_chat_v4.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/bot_chat_v4.xml @@ -4454,6 +4454,10 @@ + + + + + diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/guild.xml b/code/ryzom/client/data/gamedev/interfaces_v3/guild.xml index 3ecd0f746..8bcf456e9 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/guild.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/guild.xml @@ -1088,7 +1088,8 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/hierarchy.xml b/code/ryzom/client/data/gamedev/interfaces_v3/hierarchy.xml index d3fe32848..4bdd0c761 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/hierarchy.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/hierarchy.xml @@ -16,6 +16,7 @@ + diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/info_player.xml b/code/ryzom/client/data/gamedev/interfaces_v3/info_player.xml index f9d129789..cc76e5f80 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/info_player.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/info_player.xml @@ -640,6 +640,13 @@ posparent="tab1" group="content:rpjobs" hardtext="uiRpJobs" + onclick_r="" + params_r="" /> + - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + @@ -3277,7 +3391,7 @@ action="lua:game:onMissionJournalOpened()" /> - + diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/inventory.xml b/code/ryzom/client/data/gamedev/interfaces_v3/inventory.xml index 8fbd69efe..b3817ce12 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/inventory.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/inventory.xml @@ -985,7 +985,31 @@ tooltip_posref="TR TL" tooltip_posref_alt="TL TR" /> - + + @@ -1290,6 +1314,143 @@ params="value=add(@UI:PHRASE:SELECT_MEMORY,-1)" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/keys.xml b/code/ryzom/client/data/gamedev/interfaces_v3/keys.xml index 5632f3c86..5cad940bd 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/keys.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/keys.xml @@ -26,6 +26,8 @@ + + @@ -82,6 +84,26 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/reset.xml b/code/ryzom/client/data/gamedev/interfaces_v3/reset.xml index 684d9e85a..6c920a76c 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/reset.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/reset.xml @@ -95,11 +95,233 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/taskbar.xml b/code/ryzom/client/data/gamedev/interfaces_v3/taskbar.xml index a828dc08b..5ad82b280 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/taskbar.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/taskbar.xml @@ -1004,7 +1004,10 @@ - + + - + diff --git a/code/ryzom/client/src/attached_fx.h b/code/ryzom/client/src/attached_fx.h index c58a9e92c..6cd8d2ef7 100644 --- a/code/ryzom/client/src/attached_fx.h +++ b/code/ryzom/client/src/attached_fx.h @@ -71,6 +71,8 @@ public: const NLMISC::CMatrix *StaticMatrix; // Useful if stick mode is "StaticMatrix" uint MaxNumAnimCount; // Number of frame on which the fx can overlap when it is being shutdown float TimeOut; + double StartTime; + float DelayBeforeStart; public: CBuildInfo() { @@ -80,6 +82,8 @@ public: StaticMatrix = NULL; MaxNumAnimCount = 0; TimeOut = FX_MANAGER_DEFAULT_TIMEOUT; + StartTime = 0.0; + DelayBeforeStart = 0.f; } }; CAttachedFX(); diff --git a/code/ryzom/client/src/bg_downloader_access.cpp b/code/ryzom/client/src/bg_downloader_access.cpp index df95c6454..699f01f3a 100644 --- a/code/ryzom/client/src/bg_downloader_access.cpp +++ b/code/ryzom/client/src/bg_downloader_access.cpp @@ -336,21 +336,21 @@ void CBGDownloaderAccess::CDownloadCoTask::run() } } } - catch(EDownloadException &e) + catch(const EDownloadException &e) { //shutdownDownloader(); Parent->_TaskResult = TaskResult_Error; Parent->_ErrorMsg.fromUtf8(e.what()); Parent->_DownloadThreadPriority = ThreadPriority_DownloaderError; } - catch(EDownloadTerminationRequested &e) + catch(const EDownloadTerminationRequested &e) { shutdownDownloader(); Parent->_TaskResult = TaskResult_Error; Parent->_ErrorMsg = ucstring(e.what()); Parent->_DownloadThreadPriority = ThreadPriority_DownloaderError; } - catch(NLMISC::EStream &e) + catch(const NLMISC::EStream &e) { shutdownDownloader(); Parent->_TaskResult = TaskResult_Error; @@ -358,7 +358,7 @@ void CBGDownloaderAccess::CDownloadCoTask::run() Parent->_ErrorMsg = CI18N::get("uiBGD_ProtocolError") + ucstring(" : ") + ucstring(e.what()); Parent->_DownloadThreadPriority = ThreadPriority_DownloaderError; } - catch (EWaitMessageTimeoutException &e) + catch (const EWaitMessageTimeoutException &e) { shutdownDownloader(); Parent->_TaskResult = TaskResult_Error; @@ -517,7 +517,7 @@ void CBGDownloaderAccess::CDownloadCoTask::restartDownloader() ok = true; break; } - catch (EWaitMessageTimeoutException &) + catch (const EWaitMessageTimeoutException &) { // no-op, just continue the loop for another try } diff --git a/code/ryzom/client/src/camera_recorder.cpp b/code/ryzom/client/src/camera_recorder.cpp index 9ef556b06..309eee039 100644 --- a/code/ryzom/client/src/camera_recorder.cpp +++ b/code/ryzom/client/src/camera_recorder.cpp @@ -239,7 +239,7 @@ class CAHSaveCameraRecord : public IActionHandler nlwarning("Couldn't compute camera recorder next filename"); } } - catch(EStream &e) + catch(const EStream &e) { nlwarning(e.what()); } @@ -283,7 +283,7 @@ NLMISC_COMMAND(loadCamRec, "Load a camera path record file (.cr)", "") f.serialCont(Track); State = Idle; } - catch(EStream &e) + catch(const EStream &e) { nlwarning(e.what()); } diff --git a/code/ryzom/client/src/cdb_branch.cpp b/code/ryzom/client/src/cdb_branch.cpp index 06501e940..60c6b63f4 100644 --- a/code/ryzom/client/src/cdb_branch.cpp +++ b/code/ryzom/client/src/cdb_branch.cpp @@ -87,7 +87,7 @@ extern const char *CDBBankNames[INVALID_CDB_BANK+1]; // reset all static data void CCDBNodeBranch::reset() { - for ( uint b=0; b!=INVALID_CDB_BANK; ++b ) + for ( uint b=0; binit( read.getRootNode (), progressCallBack, true ); } } - catch (Exception &e) + catch (const Exception &e) { // Output error nlwarning ("CFormLoader: Error while loading the form %s: %s", fileName.c_str(), e.what()); diff --git a/code/ryzom/client/src/character_cl.cpp b/code/ryzom/client/src/character_cl.cpp index 9a651e331..6130f2b60 100644 --- a/code/ryzom/client/src/character_cl.cpp +++ b/code/ryzom/client/src/character_cl.cpp @@ -4521,6 +4521,10 @@ void CCharacterCL::applyBehaviourFlyingHPs(const CBehaviourContext &bc, const MB else deltaHPColor = ClientCfg.SystemInfoParams["dg"].Color; } + else + { + deltaHPColor = CRGBA(127,127,127); + } } else { @@ -5874,6 +5878,27 @@ void CCharacterCL::updateAttachedFX() CMatrix alignMatrix; buildAlignMatrix(alignMatrix); + std::list::iterator itAttachedFxToStart = _AttachedFXListToStart.begin(); + while(itAttachedFxToStart != _AttachedFXListToStart.end()) + { + if ((*itAttachedFxToStart).DelayBeforeStart < (float)(TimeInSec - (*itAttachedFxToStart).StartTime)) + { + uint index = (*itAttachedFxToStart).MaxNumAnimCount; + (*itAttachedFxToStart).MaxNumAnimCount = 0; + CAttachedFX::TSmartPtr fx = new CAttachedFX; + fx->create(*this, (*itAttachedFxToStart), CAttachedFX::CTargeterInfo()); + if (!fx->FX.empty()) + { + _AuraFX[index] = fx; + } + itAttachedFxToStart = _AttachedFXListToStart.erase(itAttachedFxToStart); + } + else + { + ++itAttachedFxToStart; + } + } + // update tracks & pos for anim attachedfxs std::list::iterator itAttachedFx = _AttachedFXListForCurrentAnim.begin(); while(itAttachedFx != _AttachedFXListForCurrentAnim.end()) @@ -8312,7 +8337,7 @@ ADD_METHOD(void CCharacterCL::displayDebug(float x, float &y, float lineStep)) / TextContext->printfAt(x, y, "(Walk)Run Factor: %f", runFactor()); y += lineStep; // Display the current animation name(id)(offset)(nbloop) pour le channel MOVE. - TextContext->printfAt(x, y, "Current Animation: %s(%u)(%f)(%u loops)", animId(MOVE)==-1?"[NONE]":currentAnimationName().c_str(), animId(MOVE), animOffset(MOVE), _NbLoopAnim); + TextContext->printfAt(x, y, "Current Animation: %s(%u)(%lf)(%u loops)", animId(MOVE)==std::numeric_limits::max()?"[NONE]":currentAnimationName().c_str(), animId(MOVE), animOffset(MOVE), _NbLoopAnim); y += lineStep; // First Pos if(_First_Pos) @@ -8985,6 +9010,14 @@ void CCharacterCL::setAuraFX(uint index, const CAnimationFX *sheet) if (sheet == NULL) { + std::list::iterator itAttachedFxToStart = _AttachedFXListToStart.begin(); + while(itAttachedFxToStart != _AttachedFXListToStart.end()) + { + if ((*itAttachedFxToStart).MaxNumAnimCount == index) + itAttachedFxToStart = _AttachedFXListToStart.erase(itAttachedFxToStart); + else + ++itAttachedFxToStart; + } // if there's already an aura attached, and if it is not already shutting down if (_AuraFX[index] && _AuraFX[index]->TimeOutDate == 0.f) { @@ -8993,16 +9026,40 @@ void CCharacterCL::setAuraFX(uint index, const CAnimationFX *sheet) } else { + std::list::iterator itAttachedFxToStart = _AttachedFXListToStart.begin(); + while(itAttachedFxToStart != _AttachedFXListToStart.end()) + { + if ((*itAttachedFxToStart).MaxNumAnimCount == index) + return; + } // remove previous aura _AuraFX[index] = NULL; - CAttachedFX::TSmartPtr fx = new CAttachedFX; CAttachedFX::CBuildInfo bi; bi.Sheet = sheet; bi.TimeOut = 0.f; - fx->create(*this, bi, CAttachedFX::CTargeterInfo()); - if (!fx->FX.empty()) + + if (sheet->Sheet->PSName == "misc_caravan_teleportout.ps") { - _AuraFX[index] = fx; + bi.MaxNumAnimCount = index; + bi.StartTime = TimeInSec; + bi.DelayBeforeStart = 12.5f; + _AttachedFXListToStart.push_front(bi); + } + else if (sheet->Sheet->PSName == "misc_kami_teleportout.ps") + { + bi.MaxNumAnimCount = index; + bi.StartTime = TimeInSec; + bi.DelayBeforeStart = 11.5f; + _AttachedFXListToStart.push_front(bi); + } + else + { + CAttachedFX::TSmartPtr fx = new CAttachedFX; + fx->create(*this, bi, CAttachedFX::CTargeterInfo()); + if (!fx->FX.empty()) + { + _AuraFX[index] = fx; + } } } } diff --git a/code/ryzom/client/src/character_cl.h b/code/ryzom/client/src/character_cl.h index 1a0e864d0..a5d7ba880 100644 --- a/code/ryzom/client/src/character_cl.h +++ b/code/ryzom/client/src/character_cl.h @@ -675,6 +675,7 @@ protected: /// List of attached to remove as soon as possible (when there are no particles left) std::list _AttachedFXListToRemove; + std::list _AttachedFXListToStart; CAttachedFX::TSmartPtr _AuraFX[MaxNumAura]; // special case for aura CAttachedFX::TSmartPtr _LinkFX; // special case for link diff --git a/code/ryzom/client/src/client.cpp b/code/ryzom/client/src/client.cpp index 8eea73241..72fe1c0b1 100644 --- a/code/ryzom/client/src/client.cpp +++ b/code/ryzom/client/src/client.cpp @@ -85,7 +85,7 @@ using namespace NLNET; // We don't catch(...) because these exception are already trapped with the se_translation that generate the NeL message box #define RYZOM_TRY(_block) try { nlinfo(_block" of Ryzom..."); -#define RYZOM_CATCH(_block) nlinfo(_block" of Ryzom success"); } catch(EFatalError &) { return EXIT_FAILURE; } +#define RYZOM_CATCH(_block) nlinfo(_block" of Ryzom success"); } catch(const EFatalError &) { return EXIT_FAILURE; } ///////////// // GLOBALS // @@ -168,7 +168,7 @@ static bool connect() goto end; } } - catch(Exception &e) + catch(const Exception &e) { nlwarning("Can't connect to web server '%s': %s", server.c_str(), e.what()); goto end; diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index 8a73510e1..9b60a4c5f 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -1942,7 +1942,7 @@ void CClientConfig::init(const string &configFileName) // save the updated config file NLMISC::COFile configFile(configFileName, false, true, false); - configFile.serialBuffer((uint8*)contentUtf8.c_str(), contentUtf8.size()); + configFile.serialBuffer((uint8*)contentUtf8.c_str(), (uint)contentUtf8.size()); configFile.close(); // now we can continue loading and parsing the config file @@ -2017,7 +2017,7 @@ void CClientConfig::release () // Save the camera distance writeDouble("CameraDistance", ClientCfg.CameraDistance); } - catch (Exception &e) + catch (const Exception &e) { nlwarning ("Error while set config file variables : %s", e.what ()); } diff --git a/code/ryzom/client/src/client_chat_manager.cpp b/code/ryzom/client/src/client_chat_manager.cpp index 184c3fac3..fa4159b1f 100644 --- a/code/ryzom/client/src/client_chat_manager.cpp +++ b/code/ryzom/client/src/client_chat_manager.cpp @@ -963,7 +963,7 @@ void CClientChatManager::buildTellSentence(const ucstring &sender, const ucstrin else { // Does the char have a CSR title? - csr = CHARACTER_TITLE::isCsrTitle(CEntityCL::getTitleFromName(sender)) ? ucstring("(CSR) ") : ucstring(""); + if (CHARACTER_TITLE::isCsrTitle(CEntityCL::getTitleFromName(sender))) csr = ucstring("(CSR) "); } ucstring cur_time; @@ -1018,7 +1018,7 @@ void CClientChatManager::buildChatSentence(TDataSetIndex /* compressedSenderInde ucstring csr; // Does the char have a CSR title? - csr = CHARACTER_TITLE::isCsrTitle(CEntityCL::getTitleFromName(sender)) ? ucstring("(CSR) ") : ucstring(""); + if (CHARACTER_TITLE::isCsrTitle(CEntityCL::getTitleFromName(sender))) csr = ucstring("(CSR) "); if (UserEntity && senderName == UserEntity->getDisplayName()) { @@ -1199,6 +1199,11 @@ class CHandlerTell : public IActionHandler // display msg with good color // TDataSetIndex dsi; // not used .... PeopleInterraction.ChatInput.Tell.displayTellMessage(/*dsi, */finalMsg, receiver, prop.getRGBA()); + + ucstring s = CI18N::get("youTellPlayer"); + strFindReplace(s, "%name", receiver); + strFindReplace(finalMsg, CI18N::get("youTell"), s); + CInterfaceManager::getInstance()->log(finalMsg); } }; REGISTER_ACTION_HANDLER( CHandlerTell, "tell"); @@ -1262,6 +1267,12 @@ void CClientChatManager::updateChatModeAndButton(uint mode, uint32 dynamicChanne const bool teamActive = pIM->getDbProp("SERVER:GROUP:0:PRESENT")->getValueBool(); const bool guildActive = pIM->getDbProp("SERVER:GUILD:NAME")->getValueBool(); + if (m == CChatGroup::team && ! teamActive) + m = PeopleInterraction.TheUserChat.Filter.getTargetGroup(); + + if (m == CChatGroup::guild && ! guildActive) + m = PeopleInterraction.TheUserChat.Filter.getTargetGroup(); + if (pUserBut) { switch(m) diff --git a/code/ryzom/client/src/color_slot_manager.cpp b/code/ryzom/client/src/color_slot_manager.cpp index 996d256a5..f7c059171 100644 --- a/code/ryzom/client/src/color_slot_manager.cpp +++ b/code/ryzom/client/src/color_slot_manager.cpp @@ -323,7 +323,7 @@ bool CColorSlotManager::addSlotsFromConfigFile(NLMISC::CConfigFile &cf, uint &st { mask_extensions = &cf.getVar("mask_extensions"); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { return false; } @@ -343,7 +343,7 @@ bool CColorSlotManager::addSlotsFromConfigFile(NLMISC::CConfigFile &cf, uint &st _Slots[k + startSlot][l] = extensions.asString(l); } } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { _Slots.resize(startSlot); nlwarning(("CColorSlotManager::addSlotsFromConfigFile : invalid config file, variable not found :" + mask_extensions->asString(k) + "_color_id").c_str()); @@ -355,7 +355,7 @@ bool CColorSlotManager::addSlotsFromConfigFile(NLMISC::CConfigFile &cf, uint &st { _Separator = cf.getVar("default_separator").asString(); } - catch (NLMISC::EUnknownVar &) + catch (const NLMISC::EUnknownVar &) { _Separator = "_"; } diff --git a/code/ryzom/client/src/commands.cpp b/code/ryzom/client/src/commands.cpp index 0e27ff487..877f80429 100644 --- a/code/ryzom/client/src/commands.cpp +++ b/code/ryzom/client/src/commands.cpp @@ -1096,7 +1096,7 @@ NLMISC_COMMAND(execScript, "Execute a script file (.cmd)","") // read one byte iFile.serialBuffer ((uint8 *)buffer, 1); } - catch (EFile &) + catch (const EFile &) { *buffer = '\0'; eof = true; @@ -1271,6 +1271,30 @@ NLMISC_COMMAND(7,"talk in 7th dynamic chat channel"," ") { return talkInChan(7,args); } + + +NLMISC_COMMAND(setItemName, "set name of items, sbrick, etc.."," ") +{ + if (args.size() < 2) return false; + CSheetId id(args[0]); + ucstring name; + name.fromUtf8(args[1]); + ucstring desc; + ucstring desc2; + if (args.size() > 2) + desc.fromUtf8(args[2]); + if (args.size() > 2) + desc2.fromUtf8(args[3]); + + STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); + if (pSMC) + pSMC->replaceSBrickName(id, name, desc, desc2); + else + return false; + return true; +} + + ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// @@ -5113,7 +5137,7 @@ NLMISC_COMMAND(luaObject, "Dump the content of a lua object", " [max // make a reference to the table to be inspected (is this this a primitive type, just make a copy) luaState->executeScript(std::string(inspectedTable) + " = " + args[0]); } - catch(ELuaError &e) + catch(const ELuaError &e) { CLuaIHM::debugInfo(e.what()); return false; @@ -5383,7 +5407,7 @@ NLMISC_COMMAND(dumpPosAsPrim, "ld helper : add current position to pos.primitive stream.open(path); stream.serialBuffer((uint8 *) &srcFile[0], fileSize); } - catch(NLMISC::EStream &e) + catch(const NLMISC::EStream &e) { nlinfo(e.what()); srcFile.clear(); @@ -5431,7 +5455,7 @@ NLMISC_COMMAND(dumpPosAsPrim, "ld helper : add current position to pos.primitive stream.open(path); stream.serialBuffer((uint8 *) &srcFile[0], (uint)srcFile.size()); } - catch(NLMISC::EStream &e) + catch(const NLMISC::EStream &e) { nlinfo(e.what()); } diff --git a/code/ryzom/client/src/connection.cpp b/code/ryzom/client/src/connection.cpp index 4fafcdd07..1750d253b 100644 --- a/code/ryzom/client/src/connection.cpp +++ b/code/ryzom/client/src/connection.cpp @@ -1011,7 +1011,7 @@ TInterfaceState globalMenu() if ( ! firewallTimeout ) NetMngr.update(); } - catch ( EBlockedByFirewall& ) + catch (const EBlockedByFirewall&) { if ( NetMngr.getConnectionState() == CNetManager::Disconnect ) { @@ -1811,13 +1811,13 @@ string getTarget(CCtrlBase * /* ctrl */, const string &targetName) if (!elem) { nlwarning(" : Element is NULL"); - return false; + return ""; } const CReflectedProperty *pRP = CReflectSystem ::getProperty(elem->getReflectedClassName(), rTI.PropertyName); if (pRP->Type == CReflectedProperty::String) return ((elem->*(pRP->GetMethod.GetString))()); - return string(""); + return ""; } // ------------------------------------------------------------------------------------------------ diff --git a/code/ryzom/client/src/continent.cpp b/code/ryzom/client/src/continent.cpp index dc1d0fdaf..eb5a4dbe6 100644 --- a/code/ryzom/client/src/continent.cpp +++ b/code/ryzom/client/src/continent.cpp @@ -473,7 +473,7 @@ void CContinent::select(const CVectorD &pos, NLMISC::IProgressCallback &progress // Set the texture for the coarse mesh manager Scene->setCoarseMeshManagerTexture (CPath::lookup(seasonname).c_str()); } - catch (Exception &e) + catch (const Exception &e) { nlwarning (e.what()); } @@ -509,7 +509,7 @@ void CContinent::select(const CVectorD &pos, NLMISC::IProgressCallback &progress { LandscapeIGManager.initIG (Scene, CPath::lookup(LandscapeIG).c_str(), Driver, Season, &progress); } - catch (Exception &e) + catch (const Exception &e) { nlwarning (e.what()); } @@ -641,7 +641,7 @@ void CContinent::select(const CVectorD &pos, NLMISC::IProgressCallback &progress BackgroundIG = UInstanceGroup::createInstanceGroup(BackgroundIGName); } } - catch (Exception &e) + catch (const Exception &e) { nlwarning (e.what()); } @@ -1266,7 +1266,7 @@ void CContinent::dumpVillagesLoadingZones(const std::string &filename) { outBitmap.writeTGA(outFile, 24, true); } - catch(EStream &) + catch(const EStream &) { } } @@ -1327,7 +1327,7 @@ void CContinent::dumpFogMap(CFogMapBuild::TMapType mapType, const std::string &f { outBitmap.writeTGA(outFile, 24); } - catch(EStream &) + catch(const EStream &) { } } diff --git a/code/ryzom/client/src/cursor_functions.cpp b/code/ryzom/client/src/cursor_functions.cpp index 437624a86..c212dbb0d 100644 --- a/code/ryzom/client/src/cursor_functions.cpp +++ b/code/ryzom/client/src/cursor_functions.cpp @@ -550,7 +550,9 @@ void checkUnderCursor() if (!instref.ContextText.empty()) { selectedInstanceURL = instref.ContextURL; - if(ContextCur.context("WEBIG", 0.f, ucstring(instref.ContextText))) + ucstring contextText; + contextText.fromUtf8(instref.ContextText); + if(ContextCur.context("WEBIG", 0.f, contextText)) return; } } diff --git a/code/ryzom/client/src/entity_cl.cpp b/code/ryzom/client/src/entity_cl.cpp index bc63d9d85..fbbe0c041 100644 --- a/code/ryzom/client/src/entity_cl.cpp +++ b/code/ryzom/client/src/entity_cl.cpp @@ -3064,7 +3064,8 @@ void CEntityCL::updateVisiblePostPos(const NLMISC::TTime &/* currentTimeInMs */, } } - if (!_StateFX.empty()) { + if (!_StateFX.empty()) + { // Build a matrix for the fx NLMISC::CMatrix mat; mat.identity(); @@ -3529,8 +3530,10 @@ CVector CEntityCL::dirToTarget() const //---------------------------------------------------------------------- void CEntityCL::setStateFx(const std::string &fxName) { - if (fxName != _StateFXName) { - if (!_StateFX.empty() && Scene) { + if (fxName != _StateFXName) + { + if (!_StateFX.empty() && Scene) + { Scene->deleteInstance(_StateFX); } @@ -3556,7 +3559,8 @@ void CEntityCL::setStateFx(const std::string &fxName) //---------------------------------------------------------------------- void CEntityCL::removeStateFx() { - if (!_StateFX.empty() && Scene) { + if (!_StateFX.empty() && Scene) + { Scene->deleteInstance(_StateFX); _StateFXName = ""; } diff --git a/code/ryzom/client/src/far_tp.cpp b/code/ryzom/client/src/far_tp.cpp index b6fceac51..fb23b5810 100644 --- a/code/ryzom/client/src/far_tp.cpp +++ b/code/ryzom/client/src/far_tp.cpp @@ -174,7 +174,7 @@ const std::string& CLoginStateMachine::toString(CLoginStateMachine::TEvent event outputF.close(); \ } \ } \ - catch ( Exception & ) \ + catch (const Exception &) \ {} \ _CurrentState = stateId; \ break; \ @@ -912,7 +912,7 @@ retryJoinEdit: outputF.close(); } } - catch ( Exception & ) + catch (const Exception &) {} // If the session is not a permanent session and has vanished, pop the position diff --git a/code/ryzom/client/src/fog_map.cpp b/code/ryzom/client/src/fog_map.cpp index bd1e47978..78cd7ecda 100644 --- a/code/ryzom/client/src/fog_map.cpp +++ b/code/ryzom/client/src/fog_map.cpp @@ -224,7 +224,7 @@ void CFogMap::load(NLMISC::CBitmap &bm, const std::string &filename) inputFile.close(); } } - catch(NLMISC::EStream &e) + catch(const NLMISC::EStream &e) { nlwarning(e.what()); inputFile.close(); diff --git a/code/ryzom/client/src/http_client.cpp b/code/ryzom/client/src/http_client.cpp index 6a10034cd..4c5f03d6d 100644 --- a/code/ryzom/client/src/http_client.cpp +++ b/code/ryzom/client/src/http_client.cpp @@ -57,7 +57,7 @@ bool CHttpClient::connect(std::string server) nldebug("Connected to web server '%s'", server.c_str()); } } - catch(Exception &e) + catch(const Exception &e) { nlwarning("Can't connect to web server '%s': %s", server.c_str(), e.what()); goto end; diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index 7ae13500c..55d09c69e 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -1105,7 +1105,7 @@ void prelogInit() FPU_CHECKER_ONCE } - catch (Exception &e) + catch (const Exception &e) { ExitClientError (e.what()); } @@ -1264,7 +1264,7 @@ void postlogInit() { SoundMngr->init(&ProgressBar); } - catch(Exception &e) + catch(const Exception &e) { nlwarning("init : Error when creating 'SoundMngr' : %s", e.what()); // leak the alocated sound manager... @@ -1326,7 +1326,7 @@ void postlogInit() ProgressBar.newMessage ( ClientCfg.buildLoadingString(nmsg) ); CSBrickManager::getInstance()->init(); // Must be done after sheet loading - STRING_MANAGER::CStringManagerClient::specialWordsMemoryCompress(); // Must be done after brick manager init + //STRING_MANAGER::CStringManagerClient::specialWordsMemoryCompress(); // Must be done after brick manager init initLast = initCurrent; initCurrent = ryzomGetLocalTime(); @@ -1433,7 +1433,7 @@ void postlogInit() nlinfo ("PROFILE: %d seconds for postlogInit", (uint32)(ryzomGetLocalTime ()-initStart)/1000); } - catch (Exception &e) + catch (const Exception &e) { ExitClientError (e.what()); } diff --git a/code/ryzom/client/src/init_main_loop.cpp b/code/ryzom/client/src/init_main_loop.cpp index 9b37a1a53..2610b5882 100644 --- a/code/ryzom/client/src/init_main_loop.cpp +++ b/code/ryzom/client/src/init_main_loop.cpp @@ -187,7 +187,8 @@ struct CStatThread : public NLMISC::IRunnable { std::string chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; std::string s; - for (int i = 0; i < 32; i++) { + for (int i = 0; i < 32; i++) + { s += chars[uint(frand(float(chars.size())))]; } return s; @@ -864,7 +865,7 @@ void initMainLoop() // load hlsBank Driver->loadHLSBank("characters.hlsbank"); } - catch(Exception &e) + catch(const Exception &e) { nlwarning("Can't load HLSBank: %s", e.what()); } diff --git a/code/ryzom/client/src/interface_v3/action_handler.cpp b/code/ryzom/client/src/interface_v3/action_handler.cpp index 529c7f1c2..242543531 100644 --- a/code/ryzom/client/src/interface_v3/action_handler.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler.cpp @@ -77,7 +77,7 @@ std::string IActionHandler::getParam (const string &Params, const string &ParamN std::string::size_type e = allparam.find('='); if (e == std::string::npos || e == 0) break; std::string::size_type p = allparam.find('|'); - string tmp = strlwr(allparam.substr(0,e)); + string tmp = NLMISC::toLower(allparam.substr(0,e)); skipBlankAtEnd(tmp); if (tmp == param) { @@ -103,7 +103,7 @@ void IActionHandler::getAllParams (const string &Params, vector< pairConsumable.ConsumptionTime)); - strFindReplace(itemText, "%overdose_timer", toString(pIS->Consumable.OverdoseTimer/60)); + strFindReplace(itemText, "%overdose_timer_min", toString(pIS->Consumable.OverdoseTimer/60)); + strFindReplace(itemText, "%overdose_timer_sec", toString(pIS->Consumable.OverdoseTimer % 60)); // Get Item Consumable infos CItemConsumableEffectHelper::getInstance()->getItemConsumableEffectText(pIS, itemText, item->getQuality()); } 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 f6e397c26..819b8c0d4 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_item.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_item.cpp @@ -1761,7 +1761,7 @@ class CHandlerItemMenuCheck : public IActionHandler if (pCS->getInventoryIndex()==INVENTORIES::bag) { bool isTextEditionActive = false; - static const string itemTextEditionPriv = ":DEV:SGM:EM:"; + static const string itemTextEditionPriv = ":DEV:SGM:GM:EM:"; if (!UserPrivileges.empty() && itemTextEditionPriv.find(UserPrivileges)!=std::string::npos) { isTextEditionActive = true; 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 4c7c081f8..a24c49ad0 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_phrase.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_phrase.cpp @@ -60,6 +60,7 @@ void launchPhraseComposition(bool creation); const std::string PhraseComposition="ui:interface:phrase_composition"; const std::string PhraseCompositionGroup="ui:interface:phrase_composition:header_opened"; const std::string PhraseMemoryCtrlBase= "ui:interface:gestionsets:shortcuts:s"; +const std::string PhraseMemoryAltCtrlBase= "ui:interface:gestionsets2:header_closed:shortcuts:s"; // ********************************************************************************************************** @@ -129,7 +130,11 @@ public: if(pCSDst && pCSDst->isSPhraseId() && pCSDst->isSPhraseIdMemory()) { // then will auto-memorize it in this slot - pPM->CompositionPhraseMemoryLineDest= pPM->getSelectedMemoryLineDB(); + if (pCSDst->isShortCut()) + pPM->CompositionPhraseMemoryLineDest= pPM->getSelectedMemoryLineDB(); + else + pPM->CompositionPhraseMemoryLineDest= 0; + pPM->CompositionPhraseMemorySlotDest= pCSDst->getIndexInDB(); } // else no auto memorize @@ -1110,7 +1115,11 @@ public: return; // Ok, the user try to cast a phrase slot. - sint32 memoryLine= pPM->getSelectedMemoryLineDB(); + sint32 memoryLine; + if (pCSDst->isShortCut()) + memoryLine = pPM->getSelectedMemoryLineDB(); + else + memoryLine = 0; if(memoryLine<0) return; @@ -1249,12 +1258,16 @@ public: { sint shortcut; fromString(Params, shortcut); - if (shortcut>=0 && shortcut <= RYZOM_MAX_SHORTCUT) + if (shortcut>=0 && shortcut <= 2*RYZOM_MAX_SHORTCUT) { CInterfaceManager *pIM= CInterfaceManager::getInstance(); // get the control - CInterfaceElement *elm= pIM->getElementFromId(PhraseMemoryCtrlBase + toString(shortcut) ); + CInterfaceElement *elm; + if (shortcut < RYZOM_MAX_SHORTCUT) + elm = pIM->getElementFromId(PhraseMemoryCtrlBase + toString(shortcut) ); + else + elm = pIM->getElementFromId(PhraseMemoryAltCtrlBase + toString(shortcut-RYZOM_MAX_SHORTCUT) ); CDBCtrlSheet *ctrl= dynamic_cast(elm); if(ctrl) { @@ -1491,7 +1504,11 @@ public: return; // Ok, the user try to cast a phrase slot. - sint32 memoryLine= pPM->getSelectedMemoryLineDB(); + sint32 memoryLine; + if (pCSDst->isShortCut()) + memoryLine = pPM->getSelectedMemoryLineDB(); + else + memoryLine = 0; if(memoryLine<0) return; 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 76b60ade1..53a1258bc 100644 --- a/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp +++ b/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp @@ -1799,7 +1799,8 @@ void CActionPhraseFaber::updateItemResult() } /* Handle change of skill -> recompute success rate */ -void CActionPhraseFaber::CSkillObserver::onSkillChange() { +void CActionPhraseFaber::CSkillObserver::onSkillChange() +{ if (ActionPhraseFaber == NULL) ActionPhraseFaber = new CActionPhraseFaber; // Dont update if the plan has not yet been selected if(ActionPhraseFaber->_ExecuteFromItemPlanBrick==NULL) 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 c09c2b16a..dcebe792d 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 @@ -1684,7 +1684,7 @@ void CBotChatPageTrade::setupFactionPointPrice(bool /* sellMode */, uint default // setup icon according to pvp clan CInterfaceManager *pIM= CInterfaceManager::getInstance(); - strlwr(factionName); + factionName = NLMISC::toLower(factionName); string factionIcon= pIM->getDefine(toString("faction_icon_%s", factionName.c_str())); CViewBitmap *vBmp= dynamic_cast(fpGroup->getView("unit_price:item_price:icone")); if(vBmp) vBmp->setTexture(factionIcon); diff --git a/code/ryzom/client/src/interface_v3/chat_filter.cpp b/code/ryzom/client/src/interface_v3/chat_filter.cpp index 8f5db8f20..fc2e6c9c3 100644 --- a/code/ryzom/client/src/interface_v3/chat_filter.cpp +++ b/code/ryzom/client/src/interface_v3/chat_filter.cpp @@ -313,7 +313,7 @@ void CChatTargetFilter::msgEntered(const ucstring &msg, CChatWindow *chatWindow) // the target must be a player, make a tell on him ChatMngr.tell(_TargetPlayer.toString(), msg); // direct output in the chat - chatWindow->displayLocalPlayerTell(msg); + chatWindow->displayLocalPlayerTell(_TargetPlayer.toString(), msg); } else { @@ -382,7 +382,7 @@ void CChatTargetFilter::setTargetGroup(CChatGroup::TGroupType groupType, uint32 case CChatGroup::say: entry+="SAY"; break; case CChatGroup::shout: entry+="SHOUT"; break; case CChatGroup::team: if(!teamActive) return; entry+="GROUP"; break; - case CChatGroup::guild: if(!guildActive) return; entry+="CLADE"; break; + case CChatGroup::guild: entry+="CLADE"; break; case CChatGroup::civilization: entry+="CIVILIZATION"; break; case CChatGroup::territory: entry+="TERRITORY"; break; case CChatGroup::universe: diff --git a/code/ryzom/client/src/interface_v3/chat_window.cpp b/code/ryzom/client/src/interface_v3/chat_window.cpp index d58ccde77..6f13b1bed 100644 --- a/code/ryzom/client/src/interface_v3/chat_window.cpp +++ b/code/ryzom/client/src/interface_v3/chat_window.cpp @@ -199,7 +199,7 @@ bool CChatWindow::isVisible() const } //================================================================================= -void CChatWindow::displayMessage(const ucstring &msg, NLMISC::CRGBA col, CChatGroup::TGroupType /* gt */, uint32 /* dynamicChatDbIndex */, uint numBlinks /* = 0*/, bool *windowVisible /*= NULL*/) +void CChatWindow::displayMessage(const ucstring &msg, NLMISC::CRGBA col, CChatGroup::TGroupType gt, uint32 dynamicChatDbIndex, uint numBlinks /* = 0*/, bool *windowVisible /*= NULL*/) { if (!_Chat) { @@ -466,7 +466,7 @@ void CChatWindow::setHeaderColor(const std::string &n) } //================================================================================= -void CChatWindow::displayLocalPlayerTell(const ucstring &msg, uint numBlinks /*= 0*/) +void CChatWindow::displayLocalPlayerTell(const ucstring &receiver, const ucstring &msg, uint numBlinks /*= 0*/) { ucstring finalMsg; CInterfaceProperty prop; @@ -484,7 +484,12 @@ void CChatWindow::displayLocalPlayerTell(const ucstring &msg, uint numBlinks /*= prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," "); encodeColorTag(prop.getRGBA(), finalMsg, true); finalMsg += msg; + + ucstring s = CI18N::get("youTellPlayer"); + strFindReplace(s, "%name", receiver); + strFindReplace(finalMsg, CI18N::get("youTell"), s); displayMessage(finalMsg, prop.getRGBA(), CChatGroup::tell, 0, numBlinks); + CInterfaceManager::getInstance()->log(finalMsg); } void CChatWindow::encodeColorTag(const NLMISC::CRGBA &color, ucstring &text, bool append) @@ -797,14 +802,6 @@ CGroupContainer *CChatGroupWindow::createFreeTeller(const ucstring &winNameIn, c } } - // Create the free teller in all the desktops - uint8 nMode = pIM->getMode(); - pGC->setActive(false); - for (uint8 m = 0; m < MAX_NUM_MODES; ++m) - { - if (m != nMode) - pIM->updateGroupContainerImage(*pGC, m); - } // the group is only active on the current desktop pGC->setActive(true); } @@ -812,7 +809,7 @@ CGroupContainer *CChatGroupWindow::createFreeTeller(const ucstring &winNameIn, c if (!winColor.empty()) _FreeTellers[i]->setHeaderColor(winColor); - updateFreeTellerHeader(*_FreeTellers[i]); +// updateFreeTellerHeader(*_FreeTellers[i]); return _FreeTellers[i]; } diff --git a/code/ryzom/client/src/interface_v3/chat_window.h b/code/ryzom/client/src/interface_v3/chat_window.h index a18b950f6..5daf24c36 100644 --- a/code/ryzom/client/src/interface_v3/chat_window.h +++ b/code/ryzom/client/src/interface_v3/chat_window.h @@ -143,7 +143,7 @@ public: void setAHOnCloseButtonParams(const std::string &n); void setHeaderColor(const std::string &n); // - void displayLocalPlayerTell(const ucstring &msg, uint numBlinks = 0); + void displayLocalPlayerTell(const ucstring &receiver, const ucstring &msg, uint numBlinks = 0); /// Encode a color tag '@{RGBA}' in the text. If append is true, append at end of text, otherwise, replace the text static void encodeColorTag(const NLMISC::CRGBA &color, ucstring &text, bool append=true); diff --git a/code/ryzom/client/src/interface_v3/ctrl_base.cpp b/code/ryzom/client/src/interface_v3/ctrl_base.cpp index 85414ba6e..151d2be6f 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_base.cpp +++ b/code/ryzom/client/src/interface_v3/ctrl_base.cpp @@ -93,7 +93,6 @@ bool CCtrlBase::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup) if (prop) { _OnContextHelp= (const char*)prop; - NLMISC::strlwr(_OnContextHelp); } prop = (char*) xmlGetProp( cur, (xmlChar*)"on_tooltip_params" ); if (prop) diff --git a/code/ryzom/client/src/interface_v3/ctrl_base_button.cpp b/code/ryzom/client/src/interface_v3/ctrl_base_button.cpp index a25bbf56d..b2f03b98b 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_base_button.cpp +++ b/code/ryzom/client/src/interface_v3/ctrl_base_button.cpp @@ -160,21 +160,18 @@ bool CCtrlBaseButton::parse (xmlNodePtr cur,CInterfaceGroup * parentGroup) prop = (char*) xmlGetProp( cur, (xmlChar*)"menu_l" ); if (prop) { - string tmp = (const char *) prop; - _ListMenuLeft = strlwr(tmp); + _ListMenuLeft = NLMISC::toLower(std::string((const char *) prop)); } prop = (char*) xmlGetProp( cur, (xmlChar*)"menu_r" ); if (prop) { - string tmp = (const char *) prop; - _ListMenuRight = strlwr(tmp); + _ListMenuRight = NLMISC::toLower(std::string((const char *) prop)); } // list menu on both clicks prop = (char*) xmlGetProp( cur, (xmlChar*)"menu_b" ); if (prop) { - string tmp = (const char *) prop; - setListMenuBoth(strlwr(tmp)); + setListMenuBoth(NLMISC::toLower(std::string((const char *) prop))); } prop= (char*) xmlGetProp (cur, (xmlChar*)"frozen"); diff --git a/code/ryzom/client/src/interface_v3/ctrl_base_button.h b/code/ryzom/client/src/interface_v3/ctrl_base_button.h index c1d993aec..06a27b276 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_base_button.h +++ b/code/ryzom/client/src/interface_v3/ctrl_base_button.h @@ -114,7 +114,7 @@ public: /// \name Handlers // @{ // Event part - void setActionOnLeftClick (const std::string &actionHandlerName) { _AHOnLeftClick = getAH(actionHandlerName, _AHLeftClickParams); } + void setActionOnLeftClick (const std::string &actionHandlerName) { _AHOnLeftClickString = actionHandlerName; _AHOnLeftClick = getAH(actionHandlerName, _AHLeftClickParams); } void setActionOnRightClick (const std::string &actionHandlerName) { _AHOnRightClick = getAH(actionHandlerName, _AHRightClickParams); } void setActionOnClockTick (const std::string &ahName) { _AHOnClockTick = getAH(ahName, _AHClockTickParams); } void setParamsOnLeftClick (const std::string ¶msHandlerName) { _AHLeftClickParams = paramsHandlerName; } @@ -203,6 +203,7 @@ protected: //@{ IActionHandler *_AHOnOver; CStringShared _AHOverParams; + std::string _AHOnLeftClickString; IActionHandler *_AHOnLeftClick; CStringShared _AHLeftClickParams; IActionHandler *_AHOnLeftDblClick; diff --git a/code/ryzom/client/src/interface_v3/ctrl_button.cpp b/code/ryzom/client/src/interface_v3/ctrl_button.cpp index 17d89e900..fd1ba049b 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_button.cpp +++ b/code/ryzom/client/src/interface_v3/ctrl_button.cpp @@ -333,4 +333,16 @@ void CCtrlButton::fitTexture() setH(h); } - +// *************************************************************************** +bool CCtrlButton::getMouseOverShape(string &texName, uint8 &rot, CRGBA &col) +{ + if (_AHOnLeftClickString == "browse") + { + texName = "curs_pick.tga"; + rot= 0; + col = CRGBA::White; + return true; + } + + return false; +} diff --git a/code/ryzom/client/src/interface_v3/ctrl_button.h b/code/ryzom/client/src/interface_v3/ctrl_button.h index 3dcb0f896..ff769e6c4 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_button.h +++ b/code/ryzom/client/src/interface_v3/ctrl_button.h @@ -50,6 +50,8 @@ public: virtual uint32 getMemory() { return (uint32)(sizeof(*this)+_Id.size()); } + virtual bool getMouseOverShape(std::string &/* texName */, uint8 &/* rot */, NLMISC::CRGBA &/* col */); + // Display part virtual void draw(); diff --git a/code/ryzom/client/src/interface_v3/ctrl_text_button.cpp b/code/ryzom/client/src/interface_v3/ctrl_text_button.cpp index d2191a4eb..1e8c7c07b 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_text_button.cpp +++ b/code/ryzom/client/src/interface_v3/ctrl_text_button.cpp @@ -86,8 +86,7 @@ bool CCtrlTextButton::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup) prop = (char*) xmlGetProp( cur, (xmlChar*)"tx_normal" ); if (prop) { - string TxName = (const char *) prop; - TxName = strlwr(TxName); + string TxName = toLower(std::string((const char *) prop)); _TextureIdNormal[0].setTexture((TxName+"_l.tga").c_str()); _TextureIdNormal[1].setTexture((TxName+"_m.tga").c_str()); _TextureIdNormal[2].setTexture((TxName+"_r.tga").c_str()); @@ -96,8 +95,7 @@ bool CCtrlTextButton::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup) prop = (char*) xmlGetProp( cur, (xmlChar*)"tx_pushed" ); if (prop) { - string TxName = (const char *) prop; - TxName = strlwr(TxName); + string TxName = toLower(std::string((const char *) prop)); _TextureIdPushed[0].setTexture((TxName+"_l.tga").c_str()); _TextureIdPushed[1].setTexture((TxName+"_m.tga").c_str()); _TextureIdPushed[2].setTexture((TxName+"_r.tga").c_str()); @@ -106,8 +104,7 @@ bool CCtrlTextButton::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup) prop = (char*) xmlGetProp( cur, (xmlChar*)"tx_over" ); if (prop) { - string TxName = (const char *) prop; - TxName = strlwr(TxName); + string TxName = toLower(std::string((const char *) prop)); _TextureIdOver[0].setTexture((TxName+"_l.tga").c_str()); _TextureIdOver[1].setTexture((TxName+"_m.tga").c_str()); _TextureIdOver[2].setTexture((TxName+"_r.tga").c_str()); diff --git a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp index e328816a9..42f438202 100644 --- a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp +++ b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp @@ -2095,13 +2095,13 @@ void CDBCtrlSheet::drawSheet (sint32 x, sint32 y, bool draging, bool showSelecti rVR.draw11RotFlipBitmap (_RenderLayer, x, y, 0, false, _DispOverBmpId, armourCol); // decal layer because must drawn after Items/Brick in DXTC // NB: use OverColor, not Over2Color here. Because of hack in updateArmourColor() - rVR.draw11RotFlipBitmap (_RenderLayer+2, x, y, 0, false, _DispOver2BmpId, fastMulRGB(curSheetColor, _IconOverColor)); + rVR.draw11RotFlipBitmap (_RenderLayer+1, x, y, 0, false, _DispOver2BmpId, fastMulRGB(curSheetColor, _IconOverColor)); } else { // decal layer because must drawn after Items/Brick in DXTC - rVR.draw11RotFlipBitmap (_RenderLayer+2, x, y, 0, false, _DispOverBmpId, fastMulRGB(curSheetColor, _IconOverColor)); - rVR.draw11RotFlipBitmap (_RenderLayer+2, x, y, 0, false, _DispOver2BmpId, fastMulRGB(curSheetColor, _IconOver2Color)); + rVR.draw11RotFlipBitmap (_RenderLayer+1, x, y, 0, false, _DispOverBmpId, fastMulRGB(curSheetColor, _IconOverColor)); + rVR.draw11RotFlipBitmap (_RenderLayer+1, x, y, 0, false, _DispOver2BmpId, fastMulRGB(curSheetColor, _IconOver2Color)); } // Draw Quality. -1 for lookandfeel. Draw it with global color diff --git a/code/ryzom/client/src/interface_v3/group_editbox.cpp b/code/ryzom/client/src/interface_v3/group_editbox.cpp index b87d95f2d..5bc516f47 100644 --- a/code/ryzom/client/src/interface_v3/group_editbox.cpp +++ b/code/ryzom/client/src/interface_v3/group_editbox.cpp @@ -21,6 +21,7 @@ #include "group_editbox.h" #include "interface_manager.h" #include "input_handler_manager.h" +#include "nel/misc/command.h" #include "view_text.h" #include "game_share/xml_auto_ptr.h" #include "interface_options.h" @@ -56,6 +57,7 @@ CGroupEditBox::CGroupEditBox(const TCtorParam ¶m) : _MaxCharsSize(32768), _FirstVisibleChar(0), _LastVisibleChar(0), + _SelectingText(false), _ViewText(NULL), _MaxHistoric(0), _CurrentHistoricIndex(-1), @@ -354,16 +356,27 @@ void CGroupEditBox::paste() if (Driver->pasteTextFromClipboard(sString)) { // append string now - appendString(sString); + appendStringFromClipboard(sString); } } // ---------------------------------------------------------------------------- -void CGroupEditBox::appendString(const ucstring &str) +void CGroupEditBox::appendStringFromClipboard(const ucstring &str) { stopParentBlink(); makeTopWindow(); + writeString(str, true, false); + nlinfo ("Chat input was pasted from the clipboard"); + + triggerOnChangeAH(); + + _CursorAtPreviousLineEnd = false; +} + +// ---------------------------------------------------------------------------- +void CGroupEditBox::writeString(const ucstring &str, bool replace, bool atEnd) +{ sint length = (sint)str.length(); ucstring toAppend; @@ -500,13 +513,41 @@ void CGroupEditBox::appendString(const ucstring &str) length = _MaxNumChar - (sint)_InputString.length(); } ucstring toAdd = toAppend.substr(0, length); - _InputString = _InputString.substr(0, _CursorPos) + toAdd + _InputString.substr(_CursorPos); - _CursorPos += (sint32)toAdd.length(); - nlinfo ("Chat input was pasted from the clipboard"); + sint32 minPos; + sint32 maxPos; + if (_CurrSelection == this) + { + minPos = min(_CursorPos, _SelectCursorPos); + maxPos = max(_CursorPos, _SelectCursorPos); + } + else + { + minPos = _CursorPos; + maxPos = _CursorPos; + } - triggerOnChangeAH(); + nlinfo("%d, %d", minPos, maxPos); + if (replace) + { + _InputString = _InputString.substr(0, minPos) + toAdd + _InputString.substr(maxPos); + _CursorPos = minPos+(sint32)toAdd.length(); + } + else + { + if (atEnd) + { + _InputString = _InputString.substr(0, maxPos) + toAdd + _InputString.substr(maxPos); + _CursorPos = maxPos; + _SelectCursorPos = _CursorPos; - _CursorAtPreviousLineEnd = false; + } + else + { + _InputString = _InputString.substr(0, minPos) + toAdd + _InputString.substr(minPos); + _CursorPos = minPos+(sint32)toAdd.length(); + _SelectCursorPos = maxPos+(sint32)toAdd.length(); + } + } } // ---------------------------------------------------------------------------- @@ -672,7 +713,7 @@ void CGroupEditBox::handleEventChar(const CEventDescriptorKey &rEDK) // ---------------------------------------------------------------------------- void CGroupEditBox::handleEventString(const CEventDescriptorKey &rEDK) { - appendString(rEDK.getString()); + appendStringFromClipboard(rEDK.getString()); } // ---------------------------------------------------------------------------- @@ -862,6 +903,7 @@ bool CGroupEditBox::handleEvent (const CEventDescriptor& event) // if click, and not frozen, then get the focus if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftdown && !_Frozen) { + _SelectingText = true; stopParentBlink(); pIM->setCaptureKeyboard (this); // set the right cursor position @@ -872,9 +914,34 @@ bool CGroupEditBox::handleEvent (const CEventDescriptor& event) _CursorPos = newCurPos; _CursorPos -= (sint32)_Prompt.length(); _CursorPos = std::max(_CursorPos, sint32(0)); + _SelectCursorPos = _CursorPos; + _CurrSelection = NULL; return true; } + // if click, and not frozen, then get the focus + if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mousemove && !_Frozen && _SelectingText) + { + // set the right cursor position + uint newCurPos; + bool cursorAtPreviousLineEnd; + _CurrSelection = this; + _ViewText->getCharacterIndexFromPosition(eventDesc.getX() - _ViewText->getXReal(), eventDesc.getY() - _ViewText->getYReal(), newCurPos, cursorAtPreviousLineEnd); + _SelectCursorPos = newCurPos; + _SelectCursorPos -= (sint32)_Prompt.length(); + _SelectCursorPos = std::max(_SelectCursorPos, sint32(0)); + return true; + } + + // if click, and not frozen, then get the focus + if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouseleftup && !_Frozen) + { + _SelectingText = false; + if (_SelectCursorPos == _CursorPos) + _CurrSelection = NULL; + + return true; + } if (eventDesc.getEventTypeExtended() == CEventDescriptorMouse::mouserightdown) { diff --git a/code/ryzom/client/src/interface_v3/group_editbox.h b/code/ryzom/client/src/interface_v3/group_editbox.h index 3a067cf25..f2856709a 100644 --- a/code/ryzom/client/src/interface_v3/group_editbox.h +++ b/code/ryzom/client/src/interface_v3/group_editbox.h @@ -125,6 +125,8 @@ public: void copy(); // Paste the selection into buffer void paste(); + // Write the string into buffer + void writeString(const ucstring &str, bool replace = true, bool atEnd = true); // Expand the expression (true if there was a '/' at the start of the line) bool expand(); @@ -217,6 +219,7 @@ protected: // Text selection static sint32 _SelectCursorPos; static CGroupEditBox *_CurrSelection; // the edit box for which the selection is currently active, or NULL if there's none + bool _SelectingText; NLMISC::CRGBA _TextSelectColor; NLMISC::CRGBA _BackSelectColor; @@ -291,7 +294,7 @@ private: void handleEventString(const CEventDescriptorKey &event); void setup(); void triggerOnChangeAH(); - void appendString(const ucstring &str); + void appendStringFromClipboard(const ucstring &str); ucstring getSelection(); diff --git a/code/ryzom/client/src/interface_v3/group_html.cpp b/code/ryzom/client/src/interface_v3/group_html.cpp index 43ff1ca75..30c089aae 100644 --- a/code/ryzom/client/src/interface_v3/group_html.cpp +++ b/code/ryzom/client/src/interface_v3/group_html.cpp @@ -442,6 +442,9 @@ void CGroupHTML::addText (const char * buf, int len) { if (_Browsing) { + if (_IgnoreText) + return; + // Build a UTF8 string string inputString(buf, buf+len); // inputString.resize (len); @@ -525,6 +528,11 @@ void CGroupHTML::addLink (uint element_number, uint /* attribute_number */, HTCh // in ah: command we don't respect the uri standard so the HTAnchor_address doesn't work correctly _Link.push_back (suri); } + else if (suri[0] == '#') + { + // Direct url (hack for lua beginElement) + _Link.push_back (suri.substr(1)); + } else { HTAnchor * dest = HTAnchor_followMainLink((HTAnchor *) anchor); @@ -839,6 +847,14 @@ void CGroupHTML::beginElement (uint element_number, const BOOL *present, const c } } break; + case HTML_DIV: + { + if (present[MY_HTML_DIV_NAME] && value[MY_HTML_DIV_NAME]) + { + _DivName = value[MY_HTML_DIV_NAME]; + } + } + break; case HTML_FONT: { bool found = false; @@ -855,8 +871,19 @@ void CGroupHTML::beginElement (uint element_number, const BOOL *present, const c { _TextColor.push_back(_TextColor.empty() ? CRGBA::White : _TextColor.back()); } + + if (present[HTML_FONT_SIZE] && value[HTML_FONT_SIZE]) + { + uint fontsize; + fromString(value[HTML_FONT_SIZE], fontsize); + _FontSize.push_back(fontsize); + } + else + { + _FontSize.push_back(_FontSize.empty() ? TextFontSize : _FontSize.back()); + } } - break; + break; case HTML_BR: addString(ucstring ("\n")); break; @@ -1372,6 +1399,9 @@ void CGroupHTML::beginElement (uint element_number, const BOOL *present, const c _ObjectAction = value[HTML_OBJECT_STANDBY]; _Object = true; + break; + case HTML_STYLE: + _IgnoreText = true; break; } } @@ -1388,6 +1418,7 @@ void CGroupHTML::endElement (uint element_number) { case HTML_FONT: popIfNotEmpty (_TextColor); + popIfNotEmpty (_FontSize); break; case HTML_A: popIfNotEmpty (_TextColor); @@ -1409,6 +1440,10 @@ void CGroupHTML::endElement (uint element_number) case HTML_PRE: popIfNotEmpty (_PRE); break; + case HTML_DIV: + _DivName = ""; + break; + case HTML_TABLE: popIfNotEmpty (_CellParams); popIfNotEmpty (_TR); @@ -1493,6 +1528,9 @@ void CGroupHTML::endElement (uint element_number) popIfNotEmpty (_UL); } break; + case HTML_STYLE: + _IgnoreText = false; + break; case HTML_OBJECT: if (_ObjectType=="application/ryzom-data") { @@ -1560,6 +1598,7 @@ CGroupHTML::CGroupHTML(const TCtorParam ¶m) // init _ParsingLua = false; + _IgnoreText = false; _BrowseNextTime = false; _PostNextTime = false; _Browsing = false; @@ -2224,8 +2263,9 @@ void CGroupHTML::addImage(const char *img, bool globalColor) else*/ getParagraph()->addChild(newImage); paragraphChange (); - } else { - + } + else + { // // 2/ if it doesn't work, try to load the image in cache // @@ -2506,6 +2546,7 @@ void CGroupHTML::clearContext() _Cells.clear(); _TR.clear(); _Forms.clear(); + _Groups.clear(); _CellParams.clear(); _Title = false; _TextArea = false; @@ -2584,6 +2625,12 @@ void CGroupHTML::addGroup (CInterfaceGroup *group, uint beginSpace) _Paragraph = NULL; } + if (!_DivName.empty()) + { + group->setName(_DivName); + _Groups.push_back(group); + } + group->setSizeRef(CInterfaceElement::width); // Compute begin space between paragraph and tables @@ -3337,6 +3384,175 @@ int CGroupHTML::luaRefresh(CLuaState &ls) return 0; } +// *************************************************************************** +int CGroupHTML::luaRemoveContent(CLuaState &ls) +{ + const char *funcName = "refresh"; + CLuaIHM::checkArgCount(ls, funcName, 0); + removeContent(); + return 0; +} + +// *************************************************************************** +int CGroupHTML::luaInsertText(CLuaState &ls) +{ + const char *funcName = "insertText"; + CLuaIHM::checkArgCount(ls, funcName, 3); + CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING); + CLuaIHM::checkArgType(ls, funcName, 2, LUA_TSTRING); + CLuaIHM::checkArgType(ls, funcName, 3, LUA_TBOOLEAN); + + string name = ls.toString(1); + + ucstring text; + text.fromUtf8(ls.toString(2)); + + if (!_Forms.empty()) + { + for (uint i=0; i<_Forms.back().Entries.size(); i++) + { + if (_Forms.back().Entries[i].TextArea && _Forms.back().Entries[i].Name == name) + { + // Get the edit box view + CInterfaceGroup *group = _Forms.back().Entries[i].TextArea->getGroup ("eb"); + if (group) + { + // Should be a CGroupEditBox + CGroupEditBox *editBox = dynamic_cast(group); + if (editBox) + editBox->writeString(text, false, ls.toBoolean(3)); + } + } + } + } + + return 0; +} + +// *************************************************************************** +int CGroupHTML::luaAddString(CLuaState &ls) +{ + const char *funcName = "addString"; + CLuaIHM::checkArgCount(ls, funcName, 1); + CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING); + addString(ucstring(ls.toString(1))); + return 0; +} + +// *************************************************************************** +int CGroupHTML::luaAddImage(CLuaState &ls) +{ + const char *funcName = "addImage"; + CLuaIHM::checkArgCount(ls, funcName, 2); + CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING); + CLuaIHM::checkArgType(ls, funcName, 2, LUA_TBOOLEAN); + if (!_Paragraph) + { + newParagraph(0); + paragraphChange(); + } + string url = getLink(); + if (!url.empty()) + { + string params = "name=" + getId() + "|url=" + getLink (); + addButton(CCtrlButton::PushButton, ls.toString(1), ls.toString(1), ls.toString(1), + "", ls.toBoolean(2), "browse", params.c_str(), ""); + } + else + { + addImage(ls.toString(1), ls.toBoolean(2)); + } + + + return 0; +} + +// *************************************************************************** +int CGroupHTML::luaBeginElement(CLuaState &ls) +{ + const char *funcName = "beginElement"; + CLuaIHM::checkArgCount(ls, funcName, 2); + CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); + CLuaIHM::checkArgType(ls, funcName, 2, LUA_TTABLE); + + uint element_number = (uint)ls.toNumber(1); + std::vector present; + std::vector value; + present.resize(30, false); + value.resize(30); + + CLuaObject params; + params.pop(ls); + uint max_idx = 0; + + + ENUM_LUA_TABLE(params, it) + { + if (!it.nextKey().isNumber()) + { + nlwarning("%s : bad key encountered with type %s, number expected.", funcName, it.nextKey().getTypename()); + continue; + } + if (!it.nextValue().isString()) + { + nlwarning("%s : bad value encountered with type %s for key %s, string expected.", funcName, it.nextValue().getTypename(), it.nextKey().toString().c_str()); + continue; + } + uint idx = (uint)it.nextKey().toNumber(); + + present.insert(present.begin() + (uint)it.nextKey().toNumber(), true); + + string str = it.nextValue().toString(); + size_t size = str.size() + 1; + char * buffer = new char[ size ]; + strncpy(buffer, str.c_str(), size ); + + value.insert(value.begin() + (uint)it.nextKey().toNumber(), buffer); + } + + beginElement(element_number, &present[0], &value[0]); + if (element_number == HTML_A) + addLink(element_number, 0, NULL, &present[0], &value[0]); + + return 0; +} + + +// *************************************************************************** +int CGroupHTML::luaEndElement(CLuaState &ls) +{ + const char *funcName = "endElement"; + CLuaIHM::checkArgCount(ls, funcName, 1); + CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); + + uint element_number = (uint)ls.toNumber(1); + endElement(element_number); + + return 0; +} + + +// *************************************************************************** +int CGroupHTML::luaShowDiv(CLuaState &ls) +{ + const char *funcName = "showDiv"; + CLuaIHM::checkArgCount(ls, funcName, 2); + CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING); + CLuaIHM::checkArgType(ls, funcName, 2, LUA_TBOOLEAN); + + if (!_Groups.empty()) { + for (uint i=0; i<_Groups.size(); i++) + { + CInterfaceGroup *group = _Groups[i]; + if (group->getName() == ls.toString(1)) + { + group->setActive(ls.toBoolean(2)); + } + } + } + return 0; +} + // *************************************************************************** void CGroupHTML::setURL(const std::string &url) { diff --git a/code/ryzom/client/src/interface_v3/group_html.h b/code/ryzom/client/src/interface_v3/group_html.h index b4f4ee00b..92cb81e6e 100644 --- a/code/ryzom/client/src/interface_v3/group_html.h +++ b/code/ryzom/client/src/interface_v3/group_html.h @@ -165,10 +165,24 @@ public: int luaBrowse(CLuaState &ls); int luaRefresh(CLuaState &ls); + int luaRemoveContent(CLuaState &ls); + int luaInsertText(CLuaState &ls); + int luaAddString(CLuaState &ls); + int luaAddImage(CLuaState &ls); + int luaBeginElement(CLuaState &ls); + int luaEndElement(CLuaState &ls); + int luaShowDiv(CLuaState &ls); REFLECT_EXPORT_START(CGroupHTML, CGroupScrollText) REFLECT_LUA_METHOD("browse", luaBrowse) REFLECT_LUA_METHOD("refresh", luaRefresh) + REFLECT_LUA_METHOD("removeContent", luaRemoveContent) + REFLECT_LUA_METHOD("insertText", luaInsertText) + REFLECT_LUA_METHOD("addString", luaAddString) + REFLECT_LUA_METHOD("addImage", luaAddImage) + REFLECT_LUA_METHOD("beginElement", luaBeginElement) + REFLECT_LUA_METHOD("endElement", luaEndElement) + REFLECT_LUA_METHOD("showDiv", luaShowDiv) REFLECT_STRING("url", getURL, setURL) REFLECT_FLOAT("timeout", getTimeout, setTimeout) REFLECT_EXPORT_END @@ -290,6 +304,7 @@ protected : // element has been found // True when the element has been encountered bool _ParsingLua; + bool _IgnoreText; // the script to execute std::string _LuaScript; @@ -303,6 +318,7 @@ protected : class CLibWWWData *_LibWWW; // Current paragraph + std::string _DivName; CGroupParagraph* _Paragraph; inline CGroupParagraph *getParagraph() { @@ -442,6 +458,7 @@ protected : std::vector Entries; }; std::vector _Forms; + std::vector _Groups; // Cells parameters class CCellParams 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 ac866830b..7e1781289 100644 --- a/code/ryzom/client/src/interface_v3/group_html_webig.cpp +++ b/code/ryzom/client/src/interface_v3/group_html_webig.cpp @@ -277,7 +277,7 @@ string CGroupHTMLWebIG::home () void CGroupHTMLWebIG::handle () { - Home = "http://atys.ryzom.com/start/index.php"; +// Home = "http://atys.ryzom.com/start/index.php"; CGroupHTML::handle (); } diff --git a/code/ryzom/client/src/interface_v3/group_map.cpp b/code/ryzom/client/src/interface_v3/group_map.cpp index 43021767c..51d07bb88 100644 --- a/code/ryzom/client/src/interface_v3/group_map.cpp +++ b/code/ryzom/client/src/interface_v3/group_map.cpp @@ -775,7 +775,7 @@ bool CGroupMap::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup) _Islands.push_back(island); } } - catch(NLMISC::EFile &e) + catch(const NLMISC::EFile &e) { nlwarning(e.what()); } diff --git a/code/ryzom/client/src/interface_v3/group_menu.cpp b/code/ryzom/client/src/interface_v3/group_menu.cpp index 93d2ee4bb..22ff2b07c 100644 --- a/code/ryzom/client/src/interface_v3/group_menu.cpp +++ b/code/ryzom/client/src/interface_v3/group_menu.cpp @@ -1156,7 +1156,7 @@ void CGroupSubMenu::addSeparatorAtIndex(uint index, const std::string &id) tmp.CheckBox = NULL; tmp.RightArrow = NULL; _Lines.insert(_Lines.begin() + index, tmp); - _SubMenus.insert(_SubMenus.begin() + index, NULL); + _SubMenus.insert(_SubMenus.begin() + index, (CGroupSubMenu*)NULL); _GroupMenu->invalidateCoords(); } @@ -1304,7 +1304,7 @@ CViewTextMenu* CGroupSubMenu::addLineAtIndex(uint index, const ucstring &name, _Lines.insert(_Lines.begin() + index, tmp); // Add an empty sub menu by default - _SubMenus.insert(_SubMenus.begin() + index, NULL); + _SubMenus.insert(_SubMenus.begin() + index, (CGroupSubMenu*)NULL); _GroupMenu->invalidateCoords(); diff --git a/code/ryzom/client/src/interface_v3/group_quick_help.cpp b/code/ryzom/client/src/interface_v3/group_quick_help.cpp index 9df6c343e..210c7110e 100644 --- a/code/ryzom/client/src/interface_v3/group_quick_help.cpp +++ b/code/ryzom/client/src/interface_v3/group_quick_help.cpp @@ -278,8 +278,11 @@ void CGroupQuickHelp::browse (const char *url) _IsQuickHelp = false; string completeURL = url; - completeURL = completeURL.substr(0, completeURL.size()-5); // Substract the ".html" - completeURL += "_" + ClientCfg.getHtmlLanguageCode() + ".html"; + if (completeURL.substr(completeURL.size()-5, 5) == ".html") + { + completeURL = completeURL.substr(0, completeURL.size()-5); // Substract the ".html" + completeURL += "_" + ClientCfg.getHtmlLanguageCode() + ".html"; + } CGroupHTML::browse (completeURL.c_str()); } diff --git a/code/ryzom/client/src/interface_v3/group_tab.cpp b/code/ryzom/client/src/interface_v3/group_tab.cpp index 33588cbb9..27e6aa3a4 100644 --- a/code/ryzom/client/src/interface_v3/group_tab.cpp +++ b/code/ryzom/client/src/interface_v3/group_tab.cpp @@ -155,7 +155,7 @@ void CGroupTab::addTab(CCtrlTabButton * tabB, sint index) { if(i==index) { - tabB->setId(string("tab") + count); + tabB->setId("tab" + NLMISC::toString(count)); tabB->setParentPos(lastTab); if(i==0) tabB->setParentPosRef(Hotspot_TL); @@ -168,7 +168,7 @@ void CGroupTab::addTab(CCtrlTabButton * tabB, sint index) count++; } - buttons[i]->setId(string("tab") + count); + buttons[i]->setId("tab" + NLMISC::toString(count)); buttons[i]->setParentPos(lastTab); if(i==0 && index!=0) buttons[i]->setParentPosRef(Hotspot_TL); @@ -297,7 +297,7 @@ void CGroupTab::removeTab(sint index) { if(i!=index) { - buttons[i]->setId(string("tab")+count); + buttons[i]->setId("tab"+NLMISC::toString(count)); buttons[i]->setParentPos(lastTab); if((i==0) || (index==0 && i==1)) buttons[i]->setParentPosRef(Hotspot_TL); diff --git a/code/ryzom/client/src/interface_v3/group_tree.h b/code/ryzom/client/src/interface_v3/group_tree.h index 556abab99..c2a299c01 100644 --- a/code/ryzom/client/src/interface_v3/group_tree.h +++ b/code/ryzom/client/src/interface_v3/group_tree.h @@ -106,7 +106,7 @@ public: void setOpened(bool opened) { Opened = opened; } bool getOpened() const { return Opened; } void setText(const ucstring &text) { Text = text; } - ucstring getText() const { return Text; } + const ucstring& getText() const { return Text; } sint32 getFontSize() const { return FontSize; } void setFontSize(sint32 value) { FontSize = value; } sint32 getYDecal() const { return YDecal; } diff --git a/code/ryzom/client/src/interface_v3/guild_manager.cpp b/code/ryzom/client/src/interface_v3/guild_manager.cpp index c9bb4ec01..6abd0c029 100644 --- a/code/ryzom/client/src/interface_v3/guild_manager.cpp +++ b/code/ryzom/client/src/interface_v3/guild_manager.cpp @@ -29,6 +29,7 @@ #include "group_html.h" #include "../init_main_loop.h" #include "inventory_manager.h" +#include "../client_chat_manager.h" #include "../connection.h" #include "../entity_cl.h" @@ -48,6 +49,7 @@ using namespace std; using namespace NLMISC; extern CPeopleInterraction PeopleInterraction; +extern CClientChatManager ChatMngr; NLMISC_REGISTER_OBJECT(CViewBase, CDBGroupListAscensor, std::string, "list_sheet_guild"); @@ -539,6 +541,10 @@ void CGuildManager::closeAllInterfaces() CGroupContainer *pGuildChat = dynamic_cast(pIM->getElementFromId(WIN_GUILD_CHAT)); if (pGuildChat != NULL) pGuildChat->setActive(false); + + if (PeopleInterraction.TheUserChat.Filter.getTargetGroup() == CChatGroup::guild) + ChatMngr.updateChatModeAndButton(CChatGroup::say); + } // *************************************************************************** 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 1d755dd56..3ece9f125 100644 --- a/code/ryzom/client/src/interface_v3/input_handler_manager.cpp +++ b/code/ryzom/client/src/interface_v3/input_handler_manager.cpp @@ -518,7 +518,7 @@ bool CInputHandlerManager::readInputConfigFile(const std::string & fileName) root = read.getRootNode(); } - catch (Exception &e) + catch (const Exception &e) { // Output error root = NULL; diff --git a/code/ryzom/client/src/interface_v3/interface_element.cpp b/code/ryzom/client/src/interface_v3/interface_element.cpp index f937a34e9..6db901b10 100644 --- a/code/ryzom/client/src/interface_v3/interface_element.cpp +++ b/code/ryzom/client/src/interface_v3/interface_element.cpp @@ -1235,7 +1235,7 @@ CInterfaceElement *CInterfaceElement::clone() dupStream.fill(&datas[0], (uint32)datas.size()); dupStream.serialPolyPtr(begunThisCloneWarHas); } - catch(NLMISC::EStream &) + catch(const NLMISC::EStream &) { // no-op -> caller has to handle the failure because NULL will be returned } diff --git a/code/ryzom/client/src/interface_v3/interface_element.h b/code/ryzom/client/src/interface_v3/interface_element.h index c77fc41b6..24982cad2 100644 --- a/code/ryzom/client/src/interface_v3/interface_element.h +++ b/code/ryzom/client/src/interface_v3/interface_element.h @@ -250,6 +250,9 @@ public: /// Accessors : SET void setId (const std::string &newID) { _Id = newID; } + inline void setName(const std::string &name) { _Name = name; } + inline const std::string& getName() { return _Name; } + virtual void setIdRecurse(const std::string &newID); void setParent (CInterfaceGroup *pIG) { _Parent = pIG; } @@ -510,6 +513,8 @@ protected: ///the id of the element std::string _Id; + std::string _Name; + ///is the element active? bool _Active; diff --git a/code/ryzom/client/src/interface_v3/interface_manager.cpp b/code/ryzom/client/src/interface_v3/interface_manager.cpp index 45514f3c5..c4e238141 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.cpp +++ b/code/ryzom/client/src/interface_v3/interface_manager.cpp @@ -524,12 +524,12 @@ void CInterfaceManager::initOutGame() ActionsContext.addActionsManager(&Actions, ""); ActionsContext.addActionsManager(&EditActions, RZ_CATEGORY_EDIT); - - if (ClientCfg.SelectCharacter != -1) return; - // Init LUA Scripting initLUA(); + if (ClientCfg.SelectCharacter != -1) + return; + { if (SoundMngr != NULL) { @@ -1659,7 +1659,7 @@ bool CInterfaceManager::loadConfig (const string &filename) } } } - catch(NLMISC::EStream &) + catch(const NLMISC::EStream &) { f.close(); string sFileNameBackup = sFileName+"backup"; @@ -1846,7 +1846,7 @@ bool CInterfaceManager::saveConfig (const string &filename) return false; } } - catch(NLMISC::EStream &) + catch(const NLMISC::EStream &) { f.close(); nlwarning("Config saving failed."); @@ -4790,7 +4790,7 @@ bool CInterfaceManager::saveKeys(const std::string &filename) nlwarning ("Can't open the file %s", filename.c_str()); } } - catch (Exception &e) + catch (const Exception &e) { nlwarning ("Error while writing the file %s : %s. Remove it.", filename.c_str(), e.what ()); CFile::deleteFile(filename); @@ -5754,7 +5754,7 @@ bool CInterfaceManager::executeLuaScript(const std::string &luaScript, bool smal else _LuaState->executeScript(luaScript); } - catch(ELuaError &e) + catch(const ELuaError &e) { std::string msg = e.luaWhat(); char filename[MAX_PATH]; @@ -6079,7 +6079,7 @@ void CInterfaceManager::createLocalBranch(const std::string &fileName, NLMISC::I ServerToLocalAutoCopySkillPoints.init("USER"); } } - catch (Exception &e) + catch (const Exception &e) { // Output error nlwarning ("CFormLoader: Error while loading the form %s: %s", fileName.c_str(), e.what()); diff --git a/code/ryzom/client/src/interface_v3/interface_options.cpp b/code/ryzom/client/src/interface_v3/interface_options.cpp index ae70f1460..0a8135f71 100644 --- a/code/ryzom/client/src/interface_v3/interface_options.cpp +++ b/code/ryzom/client/src/interface_v3/interface_options.cpp @@ -78,14 +78,14 @@ bool CInterfaceOptions::parse (xmlNodePtr cur) CXMLAutoPtr ptr, val; ptr = xmlGetProp (cur, (xmlChar*)"name"); val = xmlGetProp (cur, (xmlChar*)"value"); - if ((ptr == NULL) || (val == NULL)) + if (!ptr || !val) { nlinfo("param with no name or no value"); ok = false; } else { - string name = strlwr (string((const char*)ptr)); + string name = NLMISC::toLower(string((const char*)ptr)); string value = (string((const char*)val)); _ParamValue[name].init(value); } @@ -321,7 +321,7 @@ bool COptionsList::parse (xmlNodePtr cur) { CXMLAutoPtr ptr, val; val = xmlGetProp (cur, (xmlChar*)"value"); - if (val == NULL) + if (!val) { nlinfo("param with no name or no value"); ok = false; diff --git a/code/ryzom/client/src/interface_v3/interface_parser.cpp b/code/ryzom/client/src/interface_v3/interface_parser.cpp index 90f307316..56b95be88 100644 --- a/code/ryzom/client/src/interface_v3/interface_parser.cpp +++ b/code/ryzom/client/src/interface_v3/interface_parser.cpp @@ -685,7 +685,7 @@ bool CInterfaceParser::parseInterface (const std::vector & strings, i++; } } - catch (Exception &e) + catch (const Exception &e) { // Output error // todo hulud interface syntax error @@ -4721,7 +4721,7 @@ bool CInterfaceParser::loadLUA(const std::string &fileName, std::string &error) { _LuaState->executeFile(pathName); } - catch(ELuaError &e) + catch(const ELuaError &e) { nlwarning(e.luaWhat().c_str()); error= e.luaWhat(); diff --git a/code/ryzom/client/src/interface_v3/item_consumable_effect.cpp b/code/ryzom/client/src/interface_v3/item_consumable_effect.cpp index bbd664ad5..3c1e958f8 100644 --- a/code/ryzom/client/src/interface_v3/item_consumable_effect.cpp +++ b/code/ryzom/client/src/interface_v3/item_consumable_effect.cpp @@ -113,6 +113,33 @@ void CItemConsumableEffectHelper::getItemConsumableEffectText(const CItemSheet * effects += "\n"; } + if ( name == "SP_LIFE_AURA2" ) + { + + uint16 regenMod; + fromString(params[0].c_str(), regenMod); + uint32 bonus = regenMod * itemQuality; + uint32 duration; + fromString(params[1].c_str(), duration); + uint32 radius; + fromString(params[2].c_str(), radius); + uint32 targetDisableTime; + fromString(params[3].c_str(), targetDisableTime); + uint32 userDisableTime; + fromString(params[4].c_str(), userDisableTime); + + ucstring result = CI18N::get("uiItemConsumableEffectLifeAura"); + strFindReplace(result, "%modifier", toString(bonus)); + strFindReplace(result, "%minutes", toString(duration/60)); + strFindReplace(result, "%secondes", toString(duration%60)); + strFindReplace(result, "%radius", toString(radius)); + strFindReplace(result, "%targetDisableTime", "0"); + strFindReplace(result, "%userDisableTime", "0"); + + effects += result; + effects += "\n"; + } + if ( name == "SP_STAMINA_AURA" ) { @@ -139,6 +166,34 @@ void CItemConsumableEffectHelper::getItemConsumableEffectText(const CItemSheet * effects += "\n"; } + + if ( name == "SP_STAMINA_AURA2" ) + { + + uint16 regenMod; + fromString(params[0].c_str(), regenMod); + uint32 bonus = regenMod * itemQuality; + uint32 duration; + fromString(params[1].c_str(), duration); + uint32 radius; + fromString(params[2].c_str(), radius); + uint32 targetDisableTime; + fromString(params[3].c_str(), targetDisableTime); + uint32 userDisableTime; + fromString(params[4].c_str(), userDisableTime); + + ucstring result = CI18N::get("uiItemConsumableEffectStaminaAura"); + strFindReplace(result, "%modifier", toString(bonus)); + strFindReplace(result, "%minutes", toString(duration/60)); + strFindReplace(result, "%secondes", toString(duration%60)); + strFindReplace(result, "%radius", toString(radius)); + strFindReplace(result, "%targetDisableTime", "0"); + strFindReplace(result, "%userDisableTime", "0"); + + effects += result; + effects += "\n"; + } + if ( name == "SP_SAP_AURA" ) { @@ -165,6 +220,33 @@ void CItemConsumableEffectHelper::getItemConsumableEffectText(const CItemSheet * effects += "\n"; } + if ( name == "SP_SAP_AURA2" ) + { + + uint16 regenMod; + fromString(params[0].c_str(), regenMod); + uint32 bonus = regenMod * itemQuality; + uint32 duration; + fromString(params[1].c_str(), duration); + uint32 radius; + fromString(params[2].c_str(), radius); + uint32 targetDisableTime; + fromString(params[3].c_str(), targetDisableTime); + uint32 userDisableTime; + fromString(params[4].c_str(), userDisableTime); + + ucstring result = CI18N::get("uiItemConsumableEffectSapAura"); + strFindReplace(result, "%modifier", toString(bonus)); + strFindReplace(result, "%minutes", toString(duration/60)); + strFindReplace(result, "%secondes", toString(duration%60)); + strFindReplace(result, "%radius", toString(radius)); + strFindReplace(result, "%targetDisableTime", "0"); + strFindReplace(result, "%userDisableTime", "0"); + + effects += result; + effects += "\n"; + } + // skill modifier consumables //--------------------------- ucstring result(""); diff --git a/code/ryzom/client/src/interface_v3/lua_helper.cpp b/code/ryzom/client/src/interface_v3/lua_helper.cpp index 0ec99d5a4..9fa942d41 100644 --- a/code/ryzom/client/src/interface_v3/lua_helper.cpp +++ b/code/ryzom/client/src/interface_v3/lua_helper.cpp @@ -378,7 +378,7 @@ bool CLuaState::executeScriptNoThrow(const std::string &code, int numRet) { executeScript(code, numRet); } - catch (ELuaError &e) + catch (const ELuaError &e) { nlwarning(e.what()); return false; diff --git a/code/ryzom/client/src/interface_v3/lua_ihm.cpp b/code/ryzom/client/src/interface_v3/lua_ihm.cpp index 6fee6811a..15dd9872a 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm.cpp @@ -115,6 +115,7 @@ #include "game_share/scenario_entry_points.h" #include "game_share/bg_downloader_msg.h" #include "game_share/constants.h" +#include "game_share/visual_slot_manager.h" #ifdef LUA_NEVRAX_VERSION #include "lua_ide_dll_nevrax/include/lua_ide_dll/ide_interface.h" // external debugger @@ -232,7 +233,7 @@ bool CLuaIHM::pop(CLuaState &ls, NLMISC::CRGBA &dest) #endif dest = luabind::object_cast(obj); } - catch(luabind::cast_failed &) + catch(const luabind::cast_failed &) { return false; } @@ -255,7 +256,7 @@ bool CLuaIHM::pop(CLuaState &ls,NLMISC::CVector2f &dest) #endif dest = luabind::object_cast(obj); } - catch(luabind::cast_failed &) + catch(const luabind::cast_failed &) { return false; } @@ -278,7 +279,7 @@ bool CLuaIHM::pop(CLuaState &ls, ucstring &dest) #endif dest = luabind::object_cast(obj); } - catch(luabind::cast_failed &) + catch(const luabind::cast_failed &) { return false; } @@ -1368,6 +1369,8 @@ void CLuaIHM::registerIHM(CLuaState &ls) ls.registerFunc("isPlayerNewbie", isPlayerNewbie); ls.registerFunc("isInRingMode", isInRingMode); ls.registerFunc("getUserRace", getUserRace); + ls.registerFunc("getSheet2idx", getSheet2idx); + // Through LUABind API lua_State *L= ls.getStatePointer(); @@ -3351,7 +3354,7 @@ bool CLuaIHM::popString(CLuaState &ls, std::string & dest) #endif dest = luabind::object_cast(obj); } - catch(luabind::cast_failed &) + catch(const luabind::cast_failed &) { return false; } @@ -3373,7 +3376,7 @@ bool CLuaIHM::popSINT32(CLuaState &ls, sint32 & dest) #endif dest = luabind::object_cast(obj); } - catch(luabind::cast_failed &) + catch(const luabind::cast_failed &) { return false; } @@ -4412,3 +4415,25 @@ int CLuaIHM::getUserRace(CLuaState &ls) return 1; } +// *************************************************************************** +int CLuaIHM::getSheet2idx(CLuaState &ls) +{ + CLuaIHM::checkArgCount(ls, "getSheet2idx", 2); + CLuaIHM::checkArgType(ls, "getSheet2idx", 1, LUA_TSTRING); + CLuaIHM::checkArgType(ls, "getSheet2idx", 2, LUA_TNUMBER); + + const std::string & sheedtName = ls.toString(1); + uint32 slotId = (uint32)ls.toNumber(2); + + NLMISC::CSheetId sheetId; + + if (sheetId.buildSheetId(sheedtName)) + { + uint32 idx = CVisualSlotManager::getInstance()->sheet2Index(sheetId, (SLOTTYPE::EVisualSlot)slotId); + ls.push((lua_Number)idx); + } + else + return 0; + return 1; +} + diff --git a/code/ryzom/client/src/interface_v3/lua_ihm.h b/code/ryzom/client/src/interface_v3/lua_ihm.h index f2a0e2628..6a11a5c91 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm.h +++ b/code/ryzom/client/src/interface_v3/lua_ihm.h @@ -351,6 +351,7 @@ private: static int isPlayerNewbie(CLuaState &ls); static int isInRingMode(CLuaState &ls); static int getUserRace(CLuaState &ls); + static int getSheet2idx(CLuaState &ls); // LUA functions exported for Dev only (debug) diff --git a/code/ryzom/client/src/interface_v3/lua_object.cpp b/code/ryzom/client/src/interface_v3/lua_object.cpp index 86b91af73..eb5f76c4f 100644 --- a/code/ryzom/client/src/interface_v3/lua_object.cpp +++ b/code/ryzom/client/src/interface_v3/lua_object.cpp @@ -613,7 +613,7 @@ void CLuaObject::dump(uint maxDepth /*= 20*/, std::set *alreadySee NLMISC::InfoLog->forceDisplayRaw((res[k] + "\n") .c_str()); } } - catch(std::exception &e) + catch(const std::exception &e) { CLuaIHM::dumpCallStack(); nlwarning(e.what()); diff --git a/code/ryzom/client/src/interface_v3/people_interraction.cpp b/code/ryzom/client/src/interface_v3/people_interraction.cpp index 3b5a4fb43..e98013f9a 100644 --- a/code/ryzom/client/src/interface_v3/people_interraction.cpp +++ b/code/ryzom/client/src/interface_v3/people_interraction.cpp @@ -999,7 +999,7 @@ class CHandlerChatGroupFilter : public IActionHandler } - rCTF.setTargetGroup(PeopleInterraction.TheUserChat.Filter.getTargetGroup()); + rCTF.setTargetGroup(PeopleInterraction.TheUserChat.Filter.getTargetGroup(), PeopleInterraction.TheUserChat.Filter.getTargetDynamicChannelDbIndex()); } else { @@ -1670,7 +1670,7 @@ bool CPeopleInterraction::saveUserChatsInfos(NLMISC::IStream &f) pCGW->saveFreeTeller(f); } } - catch(NLMISC::EStream &e) + catch(const NLMISC::EStream &e) { nlwarning("Error while saving user chat infos : %s", e.what()); return false; @@ -1691,7 +1691,7 @@ bool CPeopleInterraction::saveUserDynChatsInfos(NLMISC::IStream &f) saveFilteredDynChat(f, TheUserChat); } } - catch(NLMISC::EStream &e) + catch(const NLMISC::EStream &e) { nlwarning("Error while saving user dyn chat infos : %s", e.what()); return false; @@ -1756,7 +1756,7 @@ bool CPeopleInterraction::loadUserChatsInfos(NLMISC::IStream &f) if (pCGW) pCGW->loadFreeTeller(f); } } - catch(NLMISC::EStream &e) + catch(const NLMISC::EStream &e) { nlwarning("Error while loading user chat infos : %s", e.what()); return false; @@ -1786,7 +1786,7 @@ bool CPeopleInterraction::loadUserDynChatsInfos(NLMISC::IStream &f) setupUserDynChatFromSummary(fcs, TheUserChat); } } - catch(NLMISC::EStream &e) + catch(const NLMISC::EStream &e) { nlwarning("Error while loading user dyn chat infos : %s", e.what()); return false; @@ -1813,8 +1813,6 @@ void CPeopleInterraction::setupUserChatFromSummary(const CFilteredChatSummary &s //================================================================================================================= void CPeopleInterraction::setupUserDynChatFromSummary(const CFilteredDynChatSummary &summary, CFilteredChat &dest) { - // User Dest - dest.Filter.setTargetGroup(summary.Target, 0, false); // src for (uint8 i = 0; i < CChatGroup::MaxDynChanPerPlayer; i++) { @@ -2279,7 +2277,8 @@ public: CPeopleList::TSortOrder order = (CPeopleList::TSortOrder)(pIM->getDbProp("UI:SAVE:CONTACT_LIST:SORT_ORDER")->getValue32()); order = (CPeopleList::TSortOrder)(order + 1); - if (order == CPeopleList::END_SORT_ORDER) { + if (order == CPeopleList::END_SORT_ORDER) + { order = CPeopleList::START_SORT_ORDER; } @@ -2656,8 +2655,10 @@ class CHandlerChatTargetSelected : public IActionHandler } else { - for (uint i = 0; i < CChatGroup::MaxDynChanPerPlayer; i++) { - if (nlstricmp(sParams, "dyn"+toString("%d", i)) == 0) { + for (uint i = 0; i < CChatGroup::MaxDynChanPerPlayer; i++) + { + if (nlstricmp(sParams, "dyn"+toString("%d", i)) == 0) + { cf.setTargetGroup(CChatGroup::dyn_chat, i); } } @@ -2666,12 +2667,12 @@ class CHandlerChatTargetSelected : public IActionHandler // Case of user chat in grouped chat window if (cw == PeopleInterraction.ChatGroup.Window) { - PeopleInterraction.TheUserChat.Filter.setTargetGroup(cf.getTargetGroup()); + PeopleInterraction.TheUserChat.Filter.setTargetGroup(cf.getTargetGroup(), cf.getTargetDynamicChannelDbIndex()); CInterfaceManager::getInstance()->runActionHandler("chat_group_filter", NULL, "user"); } if (cw == PeopleInterraction.TheUserChat.Window) { - PeopleInterraction.TheUserChat.Filter.setTargetGroup(cf.getTargetGroup()); + PeopleInterraction.TheUserChat.Filter.setTargetGroup(cf.getTargetGroup(), cf.getTargetDynamicChannelDbIndex()); CInterfaceManager::getInstance()->runActionHandler("user_chat_active", NULL, ""); } diff --git a/code/ryzom/client/src/interface_v3/people_list.cpp b/code/ryzom/client/src/interface_v3/people_list.cpp index 66ce8a2a8..ac4764e15 100644 --- a/code/ryzom/client/src/interface_v3/people_list.cpp +++ b/code/ryzom/client/src/interface_v3/people_list.cpp @@ -207,12 +207,14 @@ bool CPeopleList::sortExByOnline(const CPeople& a, const CPeople& b) ucstring name_b = toUpper(b.getName()); // We want order: online/alpha, offworld/alpha, offline/alpha - if (a.Online == b.Online) { + if (a.Online == b.Online) + { return (name_a < name_b); } else { // Compare online status - switch (a.Online) { + switch (a.Online) + { case ccs_online: // a is > if a is online return true; @@ -244,7 +246,8 @@ void CPeopleList::sortEx(TSortOrder order) _BaseContainer->detachContainer(_Peoples[k].Container); } - switch (order) { + switch (order) + { default: case sort_index: std::sort(_Peoples.begin(), _Peoples.end(), CPeopleList::sortExByContactId); @@ -441,7 +444,7 @@ void CPeopleList::setContactId(uint index, uint32 contactId) } //================================================================== -void CPeopleList::displayLocalPlayerTell(uint index,const ucstring &msg,uint numBlinks /*=0*/) +void CPeopleList::displayLocalPlayerTell(const ucstring &receiver, uint index, const ucstring &msg,uint numBlinks /*=0*/) { if (_ContactType == CPeopleListDesc::Ignore) { @@ -475,7 +478,12 @@ void CPeopleList::displayLocalPlayerTell(uint index,const ucstring &msg,uint num // display msg with good color CInterfaceProperty prop; prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," "); + + ucstring s = CI18N::get("youTellPlayer"); + strFindReplace(s, "%name", receiver); + strFindReplace(finalMsg, CI18N::get("youTell"), s); gl->addChild(getChatTextMngr().createMsgText(finalMsg, prop.getRGBA())); + CInterfaceManager::getInstance()->log(finalMsg); // if the group is closed, make it blink if (!gc->isOpen()) @@ -924,7 +932,7 @@ class CHandlerContactEntry : public IActionHandler uint index; if (PeopleInterraction.getPeopleFromContainerID(str, peopleList, index)) { - peopleList->displayLocalPlayerTell(index, text); + peopleList->displayLocalPlayerTell(str2, index, text); } } else @@ -948,6 +956,11 @@ class CHandlerContactEntry : public IActionHandler CChatWindow::encodeColorTag(prop.getRGBA(), final, true); final += text; pWin->displayTellMessage(final, prop.getRGBA(), pWin->getFreeTellerName(str)); + + ucstring s = CI18N::get("youTellPlayer"); + strFindReplace(s, "%name", pWin->getFreeTellerName(str)); + strFindReplace(final, CI18N::get("youTell"), s); + CInterfaceManager::getInstance()->log(final); } } diff --git a/code/ryzom/client/src/interface_v3/people_list.h b/code/ryzom/client/src/interface_v3/people_list.h index 0ab0f3508..a3748c01a 100644 --- a/code/ryzom/client/src/interface_v3/people_list.h +++ b/code/ryzom/client/src/interface_v3/people_list.h @@ -111,7 +111,7 @@ public: * If the window is closed, it causes it to blink (and also the parent window) */ void displayMessage(uint index, const ucstring &msg, NLMISC::CRGBA col, uint numBlinks = 0); - void displayLocalPlayerTell(uint index, const ucstring &msg, uint numBlinks = 0); + void displayLocalPlayerTell(const ucstring &receiver, uint index, const ucstring &msg, uint numBlinks = 0); // Is the given people window visible ? bool isPeopleChatVisible(uint index) const; // reset remove everything from the interface diff --git a/code/ryzom/client/src/interface_v3/player_trade.cpp b/code/ryzom/client/src/interface_v3/player_trade.cpp index 671d0047a..7307110d9 100644 --- a/code/ryzom/client/src/interface_v3/player_trade.cpp +++ b/code/ryzom/client/src/interface_v3/player_trade.cpp @@ -78,9 +78,9 @@ void CPlayerTrade::restoreItem(CDBCtrlSheet *exchangeSlot) // *** If not an AMMO, try to 'auto-stack', as server does bool canAutoStack= false; - uint32 autoStackSheetId; - sint32 autoStackQuality; - sint32 autoStackMaxQuantity; + uint32 autoStackSheetId = 0; + sint32 autoStackQuality = 0; + sint32 autoStackMaxQuantity = 0; const CItemSheet *itemSheet= exchangeSlot->asItemSheet(); // NB: cannot auto stack ammo because their full props (dammage etc...) are not sent to client if(itemSheet) diff --git a/code/ryzom/client/src/interface_v3/sphrase_manager.cpp b/code/ryzom/client/src/interface_v3/sphrase_manager.cpp index 8058e41da..dc12a391f 100644 --- a/code/ryzom/client/src/interface_v3/sphrase_manager.cpp +++ b/code/ryzom/client/src/interface_v3/sphrase_manager.cpp @@ -57,6 +57,7 @@ const std::string PhraseMemoryViewNextAction= "ui:interface:gestionsets:shortcu const std::string PhraseMemoryViewCycleAction= "ui:interface:gestionsets:shortcuts:view_cycle_action"; const std::string PhraseMemoryViewSlotBase= "ui:interface:gestionsets:shortcuts:s"; const std::string PhraseMemoryCtrlBase= "ui:interface:gestionsets:shortcuts:s"; +const std::string PhraseMemoryAltCtrlBase= "ui:interface:gestionsets2:header_closed:shortcuts:s"; const std::string PhraseMemoryPhraseMenu= "ui:interface:cm_memory_phrase"; const std::string PhraseMemoryPhraseAction= "cast_phrase_or_create_new"; @@ -118,11 +119,16 @@ void CSPhraseManager::initInGame() _BookDbLeaves[i]= node; } _MemoryDbLeaves.resize(PHRASE_MAX_MEMORY_SLOT, NULL); + _MemoryAltDbLeaves.resize(PHRASE_MAX_MEMORY_SLOT, NULL); + for(i=0;igetDbProp(PHRASE_DB_MEMORY + ":" + toString(i) + ":PHRASE"); node->setValue32(0); _MemoryDbLeaves[i]= node; + CCDBNodeLeaf *node_alt= pIM->getDbProp(PHRASE_DB_MEMORY_ALT + ":" + toString(i) + ":PHRASE"); + node_alt->setValue32(0); + _MemoryAltDbLeaves[i]= node_alt; } // Progression Db leaves @@ -510,6 +516,19 @@ void CSPhraseManager::updateMemoryDBAll() _MemoryDbLeaves[i]->setValue32(slot.Id); } } + + if(_SelectedMemoryDB != -1 && (sint32)_Memories.size() > 0) + { + // Always update alt gestionsets + for(uint i=0;isetValue32(0); + else + _MemoryAltDbLeaves[i]->setValue32(slotAlt.Id); + } + } } // *************************************************************************** @@ -530,6 +549,15 @@ void CSPhraseManager::updateMemoryDBSlot(uint32 memorySlot) else _MemoryDbLeaves[memorySlot]->setValue32(slot.Id); } + + if (_SelectedMemoryDB == 0) + { + CMemorySlot &slotAlt= _Memories[0].Slot[memorySlot]; + if(!slotAlt.isPhrase()) + _MemoryAltDbLeaves[memorySlot]->setValue32(0); + else + _MemoryAltDbLeaves[memorySlot]->setValue32(slotAlt.Id); + } } // *************************************************************************** @@ -873,6 +901,7 @@ void CSPhraseManager::reset() _LastProgressionNumDbFill[i]= 0; } _MemoryDbLeaves.clear(); + _MemoryAltDbLeaves.clear(); _NextExecuteLeaf= NULL; _NextExecuteIsCyclicLeaf= NULL; @@ -2645,7 +2674,13 @@ static sint getRightHandEnchantValue() void CSPhraseManager::updateMemoryCtrlRegenTickRange(uint memorySlot, CDBCtrlSheet *ctrl) { // - uint memoryLine= getSelectedMemoryLineDB(); + sint32 memoryLine; + if (ctrl->isShortCut()) + memoryLine = getSelectedMemoryLineDB(); + else + memoryLine = 0; + if (memoryLine < 0) + return; sint32 phraseId= getMemorizedPhrase(memoryLine, memorySlot); // if(phraseId) @@ -2780,8 +2815,12 @@ void CSPhraseManager::updateMemoryCtrlState(uint memorySlot, CDBCtrlSheet *ctrl, CSBrickManager *pBM = CSBrickManager::getInstance(); CSkillManager *pSM = CSkillManager::getInstance(); + uint memoryLine; // get the slot info - uint memoryLine= getSelectedMemoryLineDB(); + if (ctrl->isShortCut()) // No memoryLine defined + memoryLine= getSelectedMemoryLineDB(); + else + memoryLine= 0; bool newIsMacro= isMemorizedMacro(memoryLine, memorySlot); sint32 macroId= getMemorizedMacro(memoryLine, memorySlot); sint32 phraseId= getMemorizedPhrase(memoryLine, memorySlot); @@ -3004,6 +3043,9 @@ void CSPhraseManager::updateAllMemoryCtrlState() // update the valid state. updateMemoryCtrlState(i, ctrl, itemSkill); } + CDBCtrlSheet *ctrlAlt= dynamic_cast(pIM->getElementFromId(PhraseMemoryAltCtrlBase + toString(i)) ); + if(ctrlAlt) + updateMemoryCtrlState(i, ctrlAlt, itemSkill); } TTicks endTime = CTime::getPerformanceTime(); //nldebug("***** %d ms for CSPhraseManager::updateAllMemoryCtrlState", (int) (1000 * CTime::ticksToSecond(endTime - startTime))); @@ -3030,26 +3072,49 @@ CDBCtrlSheet *CSPhraseManager::getMemorySlotCtrl(uint memorySlot) return dynamic_cast(pIM->getElementFromId(PhraseMemoryCtrlBase + toString(memorySlot))); } +// *************************************************************************** +CDBCtrlSheet *CSPhraseManager::getMemoryAltSlotCtrl(uint memorySlot) +{ + if(memorySlot>=PHRASE_MAX_MEMORY_SLOT) + return NULL; + + // Get the ctrl + CInterfaceManager *pIM= CInterfaceManager::getInstance(); + return dynamic_cast(pIM->getElementFromId(PhraseMemoryAltCtrlBase + toString(memorySlot))); +} + // *************************************************************************** void CSPhraseManager::updateMemoryCtrlState(uint memorySlot) { CDBCtrlSheet *ctrl= getMemorySlotCtrl(memorySlot); + CDBCtrlSheet *ctrlAlt= getMemoryAltSlotCtrl(memorySlot); if(ctrl) { // update the valid state. updateMemoryCtrlState(memorySlot, ctrl, getRightHandItemSkill()); } + if(ctrlAlt) + { + // update the valid state. + updateMemoryCtrlState(memorySlot, ctrlAlt, getRightHandItemSkill()); + } } // *************************************************************************** void CSPhraseManager::updateMemoryCtrlRegenTickRange(uint memorySlot) { CDBCtrlSheet *ctrl= getMemorySlotCtrl(memorySlot); + CDBCtrlSheet *ctrlAlt= getMemoryAltSlotCtrl(memorySlot); if(ctrl) { // update the valid state. updateMemoryCtrlRegenTickRange(memorySlot, ctrl); } + if(ctrlAlt) + { + // update the valid state. + updateMemoryCtrlRegenTickRange(memorySlot, ctrlAlt); + } } // *************************************************************************** diff --git a/code/ryzom/client/src/interface_v3/sphrase_manager.h b/code/ryzom/client/src/interface_v3/sphrase_manager.h index 0a934f4e2..bf40dcc35 100644 --- a/code/ryzom/client/src/interface_v3/sphrase_manager.h +++ b/code/ryzom/client/src/interface_v3/sphrase_manager.h @@ -34,6 +34,7 @@ const std::string PHRASE_DB_BOOK="UI:PHRASE:BOOK"; const std::string PHRASE_DB_PROGRESSION[2]= {"UI:PHRASE:PROGRESS_ACTIONS", "UI:PHRASE:PROGRESS_UPGRADES"}; const std::string PHRASE_DB_MEMORY="UI:PHRASE:MEMORY"; +const std::string PHRASE_DB_MEMORY_ALT="UI:PHRASE:MEMORY_ALT"; const std::string PHRASE_DB_EXECUTE_NEXT="UI:PHRASE:EXECUTE_NEXT:PHRASE"; const std::string PHRASE_DB_EXECUTE_NEXT_IS_CYCLIC="UI:PHRASE:EXECUTE_NEXT:ISCYCLIC"; const std::string PHRASE_DB_BOTCHAT="LOCAL:TRADING"; @@ -458,6 +459,7 @@ private: // Shortcut To Phrases Leaves std::vector _BookDbLeaves; std::vector _MemoryDbLeaves; + std::vector _MemoryAltDbLeaves; CCDBNodeLeaf *_NextExecuteLeaf; CCDBNodeLeaf *_NextExecuteIsCyclicLeaf; @@ -698,6 +700,7 @@ private: void updateMemoryCtrlRegenTickRange(uint memorySlot); CDBCtrlSheet *getMemorySlotCtrl(uint memorySlot); + CDBCtrlSheet *getMemoryAltSlotCtrl(uint memorySlot); CTickRange getRegenTickRange(const CSPhraseCom &phrase) const; diff --git a/code/ryzom/client/src/interface_v3/yubo_chat.cpp b/code/ryzom/client/src/interface_v3/yubo_chat.cpp index d24ae8bea..55bc17922 100644 --- a/code/ryzom/client/src/interface_v3/yubo_chat.cpp +++ b/code/ryzom/client/src/interface_v3/yubo_chat.cpp @@ -59,7 +59,7 @@ void CYuboChat::connect(const string &url, const std::string &login, const std:: return; } } - catch(Exception &e) + catch(const Exception &e) { addStringReceived(toString("ERROR: exception with server %s: %s", _URL.c_str(), e.what())); } @@ -78,7 +78,7 @@ void CYuboChat::disconnect() { _Sock.disconnect(); } - catch(Exception &e) + catch(const Exception &e) { addStringReceived(toString("ERROR: exception with server %s: %s", _URL.c_str(), e.what())); } @@ -265,7 +265,7 @@ void CYuboChat::sendInternal(const ucstring &msg) size= (uint32)toSend.size()-off; } } - catch(Exception &e) + catch(const Exception &e) { addStringReceived(toString("ERROR: exception with server %s: %s", _URL.c_str(), e.what())); } diff --git a/code/ryzom/client/src/libwww.cpp b/code/ryzom/client/src/libwww.cpp index dc5c151bd..c4695840d 100644 --- a/code/ryzom/client/src/libwww.cpp +++ b/code/ryzom/client/src/libwww.cpp @@ -218,6 +218,14 @@ HTAttr p_attr[] = HTML_ATTR(P,QUICK_HELP_CONDITION), HTML_ATTR(P,QUICK_HELP_EVENTS), HTML_ATTR(P,QUICK_HELP_LINK), + HTML_ATTR(P,NAME), + { 0 } +}; + + +HTAttr div_attr[] = +{ + HTML_ATTR(DIV,NAME), { 0 } }; @@ -684,6 +692,8 @@ void initLibWWW() HTML_DTD->tags[HTML_A].number_of_attributes = sizeof(a_attr) / sizeof(HTAttr) - 1; //HTML_DTD->tags[HTML_I].attributes = a_attr; HTML_DTD->tags[HTML_I].number_of_attributes = 0; + HTML_DTD->tags[HTML_DIV].attributes = div_attr; + HTML_DTD->tags[HTML_DIV].number_of_attributes = sizeof(div_attr) / sizeof(HTAttr) - 1; // Set a request timeout // HTHost_setEventTimeout (30000); diff --git a/code/ryzom/client/src/libwww.h b/code/ryzom/client/src/libwww.h index f3f681268..5c686e39b 100644 --- a/code/ryzom/client/src/libwww.h +++ b/code/ryzom/client/src/libwww.h @@ -201,8 +201,15 @@ enum HTML_ATTR(P,QUICK_HELP_CONDITION) = 0, HTML_ATTR(P,QUICK_HELP_EVENTS), HTML_ATTR(P,QUICK_HELP_LINK), + HTML_ATTR(P,NAME), }; +enum +{ + HTML_ATTR(DIV,NAME) = 0, +}; + + #undef HTML_ATTR // *************************************************************************** diff --git a/code/ryzom/client/src/light_cycle_manager.cpp b/code/ryzom/client/src/light_cycle_manager.cpp index cb34c0dd0..4b0488dd5 100644 --- a/code/ryzom/client/src/light_cycle_manager.cpp +++ b/code/ryzom/client/src/light_cycle_manager.cpp @@ -442,7 +442,7 @@ bool CLightCycleManager::isInDayInterval(float startHour, float endHour, float d float CLightCycleManager::getLightLevel(float hour) const { H_AUTO_USE(RZ_LightCycleManager) - float lightValue; + float lightValue = 0.f; if (isInDayInterval(_Desc.NightTransitionStartHour, _Desc.NightTransitionEndHour, _Desc.NumHours, hour, lightValue)) return lightValue; if (isInDayInterval(_Desc.DawnTransitionStartHour, _Desc.DawnTransitionEndHour, _Desc.NumHours, hour, lightValue)) diff --git a/code/ryzom/client/src/lod_character_user_manager.cpp b/code/ryzom/client/src/lod_character_user_manager.cpp index 871f6fc30..5ba9d4a46 100644 --- a/code/ryzom/client/src/lod_character_user_manager.cpp +++ b/code/ryzom/client/src/lod_character_user_manager.cpp @@ -69,7 +69,7 @@ bool CLodCharacterUserManager::addLodShapeBank(const std::string &filename) // load and add the file to the main scene Scene->loadCLodShapeBank(filename); } - catch(Exception &e) + catch(const Exception &e) { nlwarning(e.what()); return false; diff --git a/code/ryzom/client/src/login.cpp b/code/ryzom/client/src/login.cpp index 6f06d1b5f..d1dee738d 100644 --- a/code/ryzom/client/src/login.cpp +++ b/code/ryzom/client/src/login.cpp @@ -1721,15 +1721,15 @@ class CAHReboot : public IActionHandler } LoginSM.pushEvent(CLoginStateMachine::ev_reboot); } - catch (NLMISC::EDiskFullError &) + catch (const NLMISC::EDiskFullError &) { im->messageBoxWithHelp(CI18N::get("uiPatchDiskFull"), "ui:login"); } - catch (NLMISC::EWriteError &) + catch (const NLMISC::EWriteError &) { im->messageBoxWithHelp(CI18N::get("uiPatchWriteError"), "ui:login"); } - catch (std::exception &e) + catch (const std::exception &e) { im->messageBoxWithHelp(ucstring(e.what()), "ui:login", "login_quit"); } diff --git a/code/ryzom/client/src/login_patch.cpp b/code/ryzom/client/src/login_patch.cpp index fa0ef7f57..762cee9c7 100644 --- a/code/ryzom/client/src/login_patch.cpp +++ b/code/ryzom/client/src/login_patch.cpp @@ -386,7 +386,7 @@ void CPatchManager::readClientVersionAndDescFile() DescFilename = "unknown"; ValidDescFile = true; } - catch(Exception &) + catch(const Exception &) { nlwarning("EXCEPTION CATCH: readClientVersionAndDescFile() failed - not important"); // Not important that there is no desc file @@ -1203,7 +1203,7 @@ void CPatchManager::getServerFile (const std::string &name, bool bZipped, const downloadSuccess = true; } - catch (EPatchDownloadException& e) + catch (const EPatchDownloadException& e) { //nlwarning("EXCEPTION CATCH: getServerFile() failed - try to find an alternative: %i: %s",UsedServer,PatchServers[UsedServer].DisplayedServerPath.c_str()); @@ -2492,7 +2492,7 @@ void CCheckThread::run () CheckOk = true; Ended = true; } - catch (NLMISC::EDiskFullError) + catch (const NLMISC::EDiskFullError &) { // more explicit message for this common error case nlwarning("EXCEPTION CATCH: disk full"); @@ -2501,7 +2501,7 @@ void CCheckThread::run () CheckOk = false; Ended = true; } - catch (Exception &e) + catch (const Exception &e) { nlwarning("EXCEPTION CATCH: CCheckThread::run() failed"); ucstring sTranslate = CI18N::get("uiCheckEndWithErr") + " " + e.what(); @@ -2622,7 +2622,7 @@ void CPatchThread::run() } } - catch (NLMISC::EDiskFullError) + catch (const NLMISC::EDiskFullError &) { // more explicit message for this common error case nlwarning("EXCEPTION CATCH: CPatchThread::run() Disk Full"); @@ -2630,7 +2630,7 @@ void CPatchThread::run() sTranslate = CI18N::get("uiPatchDiskFull"); bErr = true; } - catch(Exception &e) + catch(const Exception &e) { nlwarning("EXCEPTION CATCH: CPatchThread::run() failed"); pPM->setState(true, ucstring(e.what())); @@ -2803,7 +2803,7 @@ void CPatchThread::processFile (CPatchManager::SFileToPatch &rFTP) // else -> file comes from a previous download (with .tmp extension, and is up to date) // the remaining code will just rename it with good name and exit } - catch (NLMISC::EWriteError) + catch (const NLMISC::EWriteError &) { // this is a local error, rethrow ... throw; @@ -2814,7 +2814,7 @@ void CPatchThread::processFile (CPatchManager::SFileToPatch &rFTP) pPM->getServerFile(lzmaFile, false, "", &progress); } } - catch (NLMISC::EWriteError) + catch (const NLMISC::EWriteError &) { // this is a local error, rethrow ... throw; @@ -2837,7 +2837,7 @@ void CPatchThread::processFile (CPatchManager::SFileToPatch &rFTP) break; } } - catch (NLMISC::EWriteError) + catch (const NLMISC::EWriteError&) { throw; } @@ -2880,7 +2880,7 @@ void CPatchThread::processFile (CPatchManager::SFileToPatch &rFTP) // remove the subfolder name PatchName = NLMISC::CFile::getFilename(PatchName); } - catch (NLMISC::EWriteError) + catch (const NLMISC::EWriteError &) { throw; } @@ -3027,7 +3027,7 @@ void CPatchThread::xDeltaPatch(const string &patch, const string &src, const str } - // Launching xdelta.exe + // Launching xdelta /* STARTUPINFO si; PROCESS_INFORMATION pi; @@ -3139,7 +3139,7 @@ void CScanDataThread::run () CheckOk = true; Ended = true; } - catch (Exception &e) + catch (const Exception &e) { nlwarning("EXCEPTION CATCH: CScanDataThread::run() failed"); ucstring sTranslate = CI18N::get("uiCheckEndWithErr") + " " + e.what(); diff --git a/code/ryzom/client/src/login_progress_post_thread.cpp b/code/ryzom/client/src/login_progress_post_thread.cpp index 1c38fdd88..ad39de60d 100644 --- a/code/ryzom/client/src/login_progress_post_thread.cpp +++ b/code/ryzom/client/src/login_progress_post_thread.cpp @@ -220,7 +220,7 @@ public: if (StopWanted) break; } } - catch (std::exception &e) + catch (const std::exception &e) { nlwarning(e.what()); } diff --git a/code/ryzom/client/src/lua_ide_dll_nevrax/include/cj60/CJOutlookBar.h b/code/ryzom/client/src/lua_ide_dll_nevrax/include/cj60/CJOutlookBar.h index 0e1434c3b..69eed259a 100644 --- a/code/ryzom/client/src/lua_ide_dll_nevrax/include/cj60/CJOutlookBar.h +++ b/code/ryzom/client/src/lua_ide_dll_nevrax/include/cj60/CJOutlookBar.h @@ -76,10 +76,12 @@ protected: public: CContentItems( UINT nID, CString str ) : - m_nImageID( nID ), m_csText( str ) { + m_nImageID( nID ), m_csText( str ) + { } - void operator = ( CContentItems& pItems ) { + void operator = ( CContentItems& pItems ) + { m_nImageID = pItems.m_nImageID; m_csText = pItems.m_csText; } diff --git a/code/ryzom/client/src/main_loop.cpp b/code/ryzom/client/src/main_loop.cpp index f8ff5ae89..81a63ae60 100644 --- a/code/ryzom/client/src/main_loop.cpp +++ b/code/ryzom/client/src/main_loop.cpp @@ -700,9 +700,6 @@ void updateFromClientCfg() //--------------------------------------------------- if (Landscape) { -#ifdef NL_OS_MAC - Landscape->enableVegetable(false); -#else if (ClientCfg.MicroVeget != LastClientCfg.MicroVeget) { if(ClientCfg.MicroVeget) @@ -722,7 +719,6 @@ void updateFromClientCfg() Landscape->enableVegetable(false); } } -#endif } //--------------------------------------------------- @@ -854,7 +850,7 @@ void updateFromClientCfg() { SoundMngr->init(NULL); } - catch(Exception &e) + catch(const Exception &e) { nlwarning("init : Error when creating 'SoundMngr' : %s", e.what()); SoundMngr = 0; @@ -3781,7 +3777,7 @@ void updateMovieShooting() { MovieShooter.replayMovie(Driver, TextContext); } - catch (Exception &e) + catch (const Exception &e) { Driver->systemMessageBox(e.what(), "MovieShooter"); } @@ -3819,7 +3815,7 @@ void updateMovieShooting() // Save the movie. MovieShooter.saveMovie(Driver, TextContext, theDir.c_str(), ClientCfg.MovieShooterFramePeriod, ClientCfg.MovieShooterBlend, ClientCfg.MovieShooterPrefix.c_str()); } - catch (Exception &e) + catch (const Exception &e) { Driver->systemMessageBox(e.what(), "MovieShooter"); } diff --git a/code/ryzom/client/src/motion/user_controls.cpp b/code/ryzom/client/src/motion/user_controls.cpp index 8b20ae026..7ce5523b2 100644 --- a/code/ryzom/client/src/motion/user_controls.cpp +++ b/code/ryzom/client/src/motion/user_controls.cpp @@ -619,6 +619,7 @@ void CUserControls::commonMove() // MOUSE WHEEL // CEventsListener::TWheelState wheelState = EventsListener.getWheelState(); // Done all the time, to reset the state View.changeCameraDist((wheelState == CEventsListener::foreward), (wheelState == CEventsListener::backward)); + View.changeCameraDist(Actions.valide("camera_foreward"), Actions.valide("camera_backward")); // Camera Up/Down. View.changeCameraHeight(Actions.valide("camera_up"), Actions.valide("camera_down")); ////////////////// diff --git a/code/ryzom/client/src/net_manager.cpp b/code/ryzom/client/src/net_manager.cpp index 608eae45b..29a5a0e37 100644 --- a/code/ryzom/client/src/net_manager.cpp +++ b/code/ryzom/client/src/net_manager.cpp @@ -168,7 +168,7 @@ void impulseDatabaseInitPlayer(NLMISC::CBitMemStream &impulse) IngameDbMngr.setInitPacketReceived(); nlinfo( "DB_INIT:PLR done (%u bytes)", impulse.getPos()-p ); } - catch (Exception &e) + catch (const Exception &e) { BOMB( NLMISC::toString( "Problem while decoding a DB_INIT:PLR msg, skipped: %s", e.what() ), return ); } @@ -185,7 +185,7 @@ void impulseDatabaseUpdatePlayer(NLMISC::CBitMemStream &impulse) // read delta IngameDbMngr.readDelta( serverTick, impulse, CDBPlayer ); // unlike on the server, here there is only one unified CCDBSynchronized object } - catch (Exception &e) + catch (const Exception &e) { BOMB( NLMISC::toString( "Problem while decoding a DB_UPDATE_PLR msg, skipped: %s", e.what() ), return ); @@ -218,7 +218,7 @@ void impulseDatabaseUpdateBank(NLMISC::CBitMemStream &impulse) updateInventoryFromStream( impulse, (INVENTORIES::CInventoryCategoryForGuild*)NULL, false ); } } - catch (Exception &e) + catch (const Exception &e) { BOMB( NLMISC::toString( "Problem while decoding a DB_GROUP:UPDATE_BANK %s msg, skipped: %s", CDBBankNames[bank], e.what() ), return ); } @@ -248,7 +248,7 @@ void impulseDatabaseInitBank(NLMISC::CBitMemStream &impulse) updateInventoryFromStream( impulse, (INVENTORIES::CInventoryCategoryForGuild*)NULL, false ); } } - catch (Exception &e) + catch (const Exception &e) { BOMB( NLMISC::toString( "Problem while decoding a DB_GROUP:INIT_BANK %s msg, skipped: %s", CDBBankNames[bank], e.what() ), return ); } @@ -272,7 +272,7 @@ void impulseDatabaseResetBank(NLMISC::CBitMemStream &impulse) IngameDbMngr.getNodePtr()->resetBank( serverTick, (TCDBBank)bank ); nldebug( "CDB: DB_GROUP:RESET_BANK %s", CDBBankNames[bank] ); } - catch (Exception &e) + catch (const Exception &e) { BOMB( NLMISC::toString( "Problem while decoding a DB_GROUP:RESET_BANK %s msg, skipped: %s", CDBBankNames[bank], e.what() ), return ); } @@ -286,7 +286,7 @@ static void readPrivileges(NLMISC::CBitMemStream &impulse) { impulse.serial(UserPrivileges); } - catch(EStreamOverflow &) + catch(const EStreamOverflow &) { nlwarning("User privileges not serialised, assuming none"); UserPrivileges = ""; @@ -345,7 +345,7 @@ void copyKeySet(const std::string &srcPath, const std::string &destPath) COFile ofile(destPath); ofile.serialBuffer((uint8 *) &srcStr[0], (uint)srcStr.size()); } - catch(EStream &) + catch(const EStream &) { nlwarning("Couldn't copy %s to %s to create new character keyset", srcPath.c_str(), destPath.c_str()); } @@ -805,27 +805,35 @@ void CInterfaceChatDisplayer::displayChat(TDataSetIndex compressedSenderIndex, c else { ucstring::size_type index = finalString.find(ucstring("")); - if (index != ucstring::npos) { + if (index != ucstring::npos) + { bubbleWanted = false; finalString = finalString.substr(index+6,finalString.size()); ucstring::size_type index2 = finalString.find(ucstring(" ")); ucstring playerName; - if (index2 < (finalString.size()-3)) { + if (index2 < (finalString.size()-3)) + { playerName = finalString.substr(0,index2); finalString = finalString.substr(index2+1,finalString.size()); } if (!senderName.empty()) { CEntityCL *senderEntity = EntitiesMngr.getEntityByName (CEntityCL::removeTitleAndShardFromName(senderName), true, true); - if (senderEntity) { - if (senderEntity->Type != CEntityCL::Player) { - if (playerName.empty()) { + if (senderEntity) + { + if (senderEntity->Type != CEntityCL::Player) + { + if (playerName.empty()) + { senderEntity->removeStateFx(); senderEntity->setStateFx(finalString.toString()); nlinfo("empty"); - } else { + } + else + { CEntityCL *destEntity = EntitiesMngr.getEntityByName (CEntityCL::removeTitleAndShardFromName(playerName), false, true); - if (destEntity) { + if (destEntity) + { destEntity->removeStateFx(); destEntity->setStateFx(finalString.toString()); nlinfo("no empty"); @@ -895,6 +903,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); // Open the free teller window CChatGroupWindow *pCGW = PeopleInterraction.getChatGroupWindow(); @@ -1559,7 +1568,7 @@ void impulseTPCommon2(NLMISC::CBitMemStream &impulse, bool hasSeason) } } - catch (EStream &) + catch (const EStream &) { tpReason = ucstring("TP Reason"); tpCancelText = ucstring("Cancel TP"); // for test @@ -2227,7 +2236,7 @@ void impulseCounter(NLMISC::CBitMemStream &impulse) } } } - catch (Exception &e) + catch (const Exception &e) { nlwarning ("Problem while decoding a COUTNER msg, skipped: %s", e.what()); } @@ -2812,7 +2821,7 @@ void updateInventoryFromStream (NLMISC::CBitMemStream &impulse, const CInventory CInventoryManager::getInstance()->sortBag(); } - catch ( Exception &e ) + catch (const Exception &e) { nlwarning ("Problem while decoding a DB_UPD_INV msg, skipped: %s", e.what()); } @@ -3216,9 +3225,13 @@ private: // get the content string (should have been received!) ucstring contentStr; + ucstring titleStr; if(!pSMC->getDynString(_TextId[ContentType], contentStr)) return; + if(!pSMC->getDynString(_TextId[TitleType], titleStr)) + return; + // if the string start with a @{Wxxxx} code, remove it and get the wanted window size sint w = 256; // default size to 256 !! bool is_webig = false; @@ -3273,23 +3286,36 @@ private: if (is_webig) { - CGroupHTML *groupHtml = dynamic_cast(pIM->getElementFromId("ui:interface:webig:content:html")); + CGroupHTML *groupHtml; + string group = titleStr.toString(); + // + group = group.substr(9, group.size()-10); + nlinfo("group = %s", group.c_str()); + groupHtml = dynamic_cast(pIM->getElementFromId("ui:interface:"+group+":content:html")); + if (!groupHtml) + { + groupHtml = dynamic_cast(pIM->getElementFromId("ui:interface:webig:content:html")); + group = "webig"; + } + if (groupHtml) { - - CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId("ui:interface:webig")); - - if (contentStr.empty()) + CGroupContainer *pGC = dynamic_cast(pIM->getElementFromId("ui:interface:"+group)); + if (pGC) { - pGC->setActive(false); - } - else - { - pGC->setActive(true); - string url = contentStr.toString(); - addWebIGParams(url); - groupHtml->browse(url.c_str()); - pIM->setTopWindow(pGC); + if (contentStr.empty()) + { + pGC->setActive(false); + } + else + { + if (group == "webig") + pGC->setActive(true); + string url = contentStr.toString(); + addWebIGParams(url); + groupHtml->browse(url.c_str()); + pIM->setTopWindow(pGC); + } } } } diff --git a/code/ryzom/client/src/network_connection.cpp b/code/ryzom/client/src/network_connection.cpp index fe1216b64..f633126e5 100644 --- a/code/ryzom/client/src/network_connection.cpp +++ b/code/ryzom/client/src/network_connection.cpp @@ -141,7 +141,7 @@ void initReceiveLog() ReceiveLogger.displayNL( "LogReceive is on" ); // only when enabled } } - catch ( EConfigFile& ) + catch (const EConfigFile&) {} } @@ -616,7 +616,7 @@ bool CNetworkConnection::connect(string &result) nlinfo ("Can't copy, same path '%s'", arg1.c_str()); } } - catch (Exception &) + catch (const Exception &) { nlwarning ("Can't copy '%s' '%s', try the next file", arg1.c_str(), dstPath.c_str()); } @@ -624,7 +624,7 @@ bool CNetworkConnection::connect(string &result) break; } } - catch (Exception &e) + catch (const Exception &e) { nlwarning (e.what ()); } @@ -635,7 +635,7 @@ bool CNetworkConnection::connect(string &result) } } } - catch (Exception &) + catch (const Exception &) { nlinfo ("There's no shards.cfg, or bad file format, can't copy common files"); } @@ -654,7 +654,7 @@ bool CNetworkConnection::connect(string &result) // _Connection.connect (CInetAddress(_FrontendAddress)); } - catch (ESocket &e) + catch (const ESocket &e) { result = toString ("FS refused the connection (%s)", e.what()); return false; @@ -847,7 +847,7 @@ bool CNetworkConnection::update() } while (stateBroke);// && _TotalMessages<5); } - catch (ESocket &) + catch (const ESocket &) { _ConnectionState = Disconnect; } @@ -968,7 +968,7 @@ void CNetworkConnection::sendSystemLogin() //sendUDP (&(_Connection), message.buffer(), length); _Connection.send( message.buffer(), length ); } - catch ( ESocket& e ) + catch (const ESocket &e) { #ifdef NL_OS_WINDOWS // An exception (10004: Blocking operation interrupted) may occur if a firewall such as Kerio is @@ -1123,7 +1123,7 @@ void CNetworkConnection::receiveSystemSync(CBitMemStream &msgin) if(xmlInvalid) xmlInvalid = (checkMsgXml != _AltMsgXmlMD5 || checkDatabaseXml != _AltDatabaseXmlMD5); } - catch (NLMISC::Exception&) + catch (const NLMISC::Exception&) { } @@ -1720,7 +1720,7 @@ void CNetworkConnection::decodeVisualProperties( CBitMemStream& msgin ) } } } - catch ( EStreamOverflow& ) + catch (const EStreamOverflow&) { // End of stream (saves useless bits) } @@ -2708,7 +2708,7 @@ void CNetworkConnection::send(TGameCycle cycle) sendNormalMessage(); } } - catch (ESocket &/*e*/) + catch (const ESocket &/*e*/) { _ConnectionState = Disconnect; disconnect(); // won't send disconnection message as state is already Disconnect @@ -2732,7 +2732,7 @@ void CNetworkConnection::send() sendNormalMessage(); } } - catch (ESocket &/*e*/) + catch (const ESocket &/*e*/) { _ConnectionState = Disconnect; } diff --git a/code/ryzom/client/src/pacs_client.cpp b/code/ryzom/client/src/pacs_client.cpp index 16147f0f9..4dc7d7535 100644 --- a/code/ryzom/client/src/pacs_client.cpp +++ b/code/ryzom/client/src/pacs_client.cpp @@ -243,7 +243,7 @@ void initPrimitiveBlocks() { addPacsPrim(primFile); } - catch (NLMISC::Exception &) + catch (const NLMISC::Exception &) { nlwarning("Error while loading %s", primFile.c_str()); } diff --git a/code/ryzom/client/src/permanent_ban.cpp b/code/ryzom/client/src/permanent_ban.cpp index 032a5ffaa..ba1ce4188 100644 --- a/code/ryzom/client/src/permanent_ban.cpp +++ b/code/ryzom/client/src/permanent_ban.cpp @@ -87,7 +87,7 @@ static void setPermanentBanFileMarker(const std::string &path, bool on) SetFileAttributes(path.c_str(), FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM); #endif } - catch(EStream &e) + catch(const EStream &e) { nlinfo(e.what()); } diff --git a/code/ryzom/client/src/prim_file.cpp b/code/ryzom/client/src/prim_file.cpp index c9839956e..e1959aabd 100644 --- a/code/ryzom/client/src/prim_file.cpp +++ b/code/ryzom/client/src/prim_file.cpp @@ -167,7 +167,7 @@ void CPrimFileMgr::load (sint primFileIndex) } } - catch (Exception &e) + catch (const Exception &e) { // Error nlwarning ("Error while reading the prim file (%s) : %s", pathName.c_str(), e.what ()); diff --git a/code/ryzom/client/src/r2/displayer_visual_entity.cpp b/code/ryzom/client/src/r2/displayer_visual_entity.cpp index f8f6bfd9d..20f84c90f 100644 --- a/code/ryzom/client/src/r2/displayer_visual_entity.cpp +++ b/code/ryzom/client/src/r2/displayer_visual_entity.cpp @@ -986,7 +986,7 @@ void CDisplayerVisualEntity::updateName() } std::string firstPart = ""; if(actNb>0) - firstPart = CI18N::get("uiR2EDDefaultActTitle").toString() + " " + actNb; + firstPart = CI18N::get("uiR2EDDefaultActTitle").toString() + " " + NLMISC::toString(actNb); if (act->isString("Name")) actName = act->toString("Name"); 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 b4f6de3a4..69223a2ae 100644 --- a/code/ryzom/client/src/r2/dmc/com_lua_module.cpp +++ b/code/ryzom/client/src/r2/dmc/com_lua_module.cpp @@ -1359,7 +1359,7 @@ CObject* CComLuaModule::loadFromBuffer(const std::string& data, const std::strin } } } - catch(ELuaError &e) + catch(const ELuaError &e) { nlwarning("%s", e.what()); } diff --git a/code/ryzom/client/src/r2/editor.cpp b/code/ryzom/client/src/r2/editor.cpp index a068af182..0de8bc626 100644 --- a/code/ryzom/client/src/r2/editor.cpp +++ b/code/ryzom/client/src/r2/editor.cpp @@ -1706,7 +1706,7 @@ void CEditor::waitScenarioScreen() if ( ! firewallTimeout ) NetMngr.update(); } - catch ( EBlockedByFirewall& ) + catch (const EBlockedByFirewall&) { if ( NetMngr.getConnectionState() == CNetManager::Disconnect ) { @@ -4414,11 +4414,11 @@ bool CEditor::doLuaScript(const char *filename, const char *fileDescText) CLuaStackChecker ls(&getLua()); return true; } - catch(NLMISC::EStream &e) + catch(const NLMISC::EStream &e) { nlwarning("Error while loading R2 %s (file = %s) : %s", fileDescText, filename, e.what()); } - catch(ELuaError &e) + catch(const ELuaError &e) { //char filename[MAX_PATH]; std::string msg = e.what(); @@ -5038,7 +5038,7 @@ void CEditor::onErase(CObject *root, bool &foundInBase, std::string &nameInParen { (*inst).getLuaProjection()["User"].setValue("Erased", true); } - catch (ELuaNotATable &e) + catch (const ELuaNotATable &e) { nlwarning(e.what()); } diff --git a/code/ryzom/client/src/r2/island_collision.cpp b/code/ryzom/client/src/r2/island_collision.cpp index eecddb642..b096a4255 100644 --- a/code/ryzom/client/src/r2/island_collision.cpp +++ b/code/ryzom/client/src/r2/island_collision.cpp @@ -419,7 +419,7 @@ CPackedWorld *CIslandCollision::reloadPackedIsland(const CScenarioEntryPoints::C _PackedIslandName = islandDesc.Island; _IslandDesc = islandDesc; } - catch (Exception &) + catch (const Exception &) { _PackedIslandLoadingFailure = true; } @@ -432,7 +432,7 @@ CPackedWorld *CIslandCollision::reloadPackedIsland(const CScenarioEntryPoints::C f.serialCheck((uint32) 'MHSI'); f.serial(_HeightMap); } - catch(Exception &e) + catch(const Exception &e) { nlwarning(e.what()); _HeightMap.clear(); @@ -572,7 +572,7 @@ void CIslandCollision::loadEntryPoints() { sep.loadCompleteIslands(); } - catch (NLMISC::EStream &e) + catch (const NLMISC::EStream &e) { _EntryPointsLoadingFailure = true; nlwarning(e.what()); diff --git a/code/ryzom/client/src/r2/tool_select_move.cpp b/code/ryzom/client/src/r2/tool_select_move.cpp index 1ad9fd797..6bbbe75ee 100644 --- a/code/ryzom/client/src/r2/tool_select_move.cpp +++ b/code/ryzom/client/src/r2/tool_select_move.cpp @@ -369,7 +369,7 @@ void CToolSelectMove::commitAction(CInstance &instance) pos.setValue("y", _FinalPos.y); pos.setValue("z", _FinalPos.z); } - catch(ELuaNotATable &) + catch(const ELuaNotATable &) { nlwarning("Error while setting position of copied object"); } diff --git a/code/ryzom/client/src/session_browser_impl.cpp b/code/ryzom/client/src/session_browser_impl.cpp index 4f39db901..c5ddb8f47 100644 --- a/code/ryzom/client/src/session_browser_impl.cpp +++ b/code/ryzom/client/src/session_browser_impl.cpp @@ -427,7 +427,7 @@ void CSessionBrowserImpl::fill(const std::vector &session // call into lua callRingAccessPointMethod("onSessionListReceived", 1, 0); } - catch(ELuaError &) + catch(const ELuaError &) { // no-op (error msg already printed at exception launch) } @@ -454,7 +454,7 @@ void CSessionBrowserImpl::playerRatingFill(bool scenarioRated, uint32 rateFun, u // call into lua callScenarioScoresMethod("onScenarioScoresReceived", 1, 0); } - catch(ELuaError &) + catch(const ELuaError &) { // no-op (error msg already printed at exception launch) } @@ -482,7 +482,7 @@ void CSessionBrowserImpl::averageScoresFill(bool scenarioRated, uint32 rateFun, // call into lua callScenarioScoresMethod("onAverageScoresReceived", 1, 0); } - catch(ELuaError &) + catch(const ELuaError &) { // no-op (error msg already printed at exception launch) } @@ -573,7 +573,7 @@ void CSessionBrowserImpl::on_scenarioAverageScores(NLNET::TSockId /* from */, bo // call into lua callScenarioScoresMethod("onScenarioAverageScoresReceived", 1, 0); } - catch(ELuaError &) + catch(const ELuaError &) { // no-op (error msg already printed at exception launch) } @@ -647,7 +647,7 @@ void CSessionBrowserImpl::charsFill(const std::vector &chars // call into lua callRingCharTrackingMethod("onCharsListReceived", 1, 0); } - catch(ELuaError &) + catch(const ELuaError &) { // no-op (error msg already printed at exception launch) } @@ -706,7 +706,7 @@ void CSessionBrowserImpl::ringStatsFill() pSM->tryToUnblockTitleFromRingRatings( _LastAuthorRating, _LastAMRating, _LastMasterlessRating ); } } - catch(ELuaError &) + catch(const ELuaError &) { // no-op (error msg already printed at exception launch) } diff --git a/code/ryzom/client/src/sky.cpp b/code/ryzom/client/src/sky.cpp index 560cf7313..aedee24ce 100644 --- a/code/ryzom/client/src/sky.cpp +++ b/code/ryzom/client/src/sky.cpp @@ -305,7 +305,7 @@ CBitmap *buildSharedBitmap(const std::string &filename, // dump bitmap fisrt line return builtBitmaps.back(); } - catch(EStream &) + catch(const EStream &) { return NULL; } diff --git a/code/ryzom/client/src/sound_manager.cpp b/code/ryzom/client/src/sound_manager.cpp index 762eeb298..fb4b3708f 100644 --- a/code/ryzom/client/src/sound_manager.cpp +++ b/code/ryzom/client/src/sound_manager.cpp @@ -512,7 +512,7 @@ void CSoundManager::init(IProgressCallback *progressCallBack) _AudioMixer->enableBackgroundMusicTimeConstraint(ClientCfg.EnableBackgroundMusicTimeConstraint); /* } - catch( Exception& e ) + catch(const Exception &e) { nlwarning( "Error: %s", e.what() ); } @@ -1732,7 +1732,7 @@ void CSoundManager::updateEventAndGameMusicVolume() materials.push_back( cvMaterials.asInt(i) ); } } - catch (EConfigFile &e) + catch (const EConfigFile &e) { nlerror("Problem in the file %s : %s", fileName,e.what ()); } @@ -1786,7 +1786,7 @@ void CSoundManager::updateEventAndGameMusicVolume() } _Sounds.insert( make_pair( make_pair(moveType,soft), sounds) ); } - catch (EConfigFile &e) + catch (const EConfigFile &e) { nlwarning("Problem in the sounds by material config file : %s", e.what ()); } diff --git a/code/ryzom/client/src/stdpch.h b/code/ryzom/client/src/stdpch.h index fdb16ef93..48c1a3c06 100644 --- a/code/ryzom/client/src/stdpch.h +++ b/code/ryzom/client/src/stdpch.h @@ -37,6 +37,7 @@ #include #include #include +#include #include #include diff --git a/code/ryzom/client/src/string_manager_client.cpp b/code/ryzom/client/src/string_manager_client.cpp index e46895368..40886d518 100644 --- a/code/ryzom/client/src/string_manager_client.cpp +++ b/code/ryzom/client/src/string_manager_client.cpp @@ -175,7 +175,7 @@ namespace STRING_MANAGER _CacheLoaded = true; } - catch(NLMISC::Exception &e) + catch(const NLMISC::Exception &e) { nlinfo("SM : loadCache failed, exception : %s", e.what()); nlinfo("SM : cache deactivated"); @@ -620,7 +620,7 @@ restartLoop: { dynInfo.Message.serial(param.StringId); } - catch(Exception &) + catch(const Exception &) { param.StringId = EmptyStringId; } @@ -631,7 +631,7 @@ restartLoop: { dynInfo.Message.serial(param.Integer); } - catch(Exception &) + catch(const Exception &) { param.Integer= 0; } @@ -642,7 +642,7 @@ restartLoop: { dynInfo.Message.serial(param.Time); } - catch(Exception &) + catch(const Exception &) { param.Time= 0; } @@ -653,7 +653,7 @@ restartLoop: { dynInfo.Message.serial(param.Money); } - catch(Exception &) + catch(const Exception &) { param.Money= 0; } @@ -664,7 +664,7 @@ restartLoop: { dynInfo.Message.serial(param.DynStringId); } - catch(Exception &) + catch(const Exception &) { param.DynStringId= EmptyDynStringId; } @@ -1206,15 +1206,15 @@ void CStringManagerClient::initI18NSpecialWords(const std::string &languageCode) continue; // Get the women name index if possible. - uint womenNameColIndex; + uint womenNameColIndex = std::numeric_limits::max(); if( !ws.findCol(womenNameColIdent, womenNameColIndex) ) womenNameColIndex= std::numeric_limits::max(); // Get the description index if possible. - uint descColIndex; + uint descColIndex = std::numeric_limits::max(); if( !ws.findCol(descColIdent, descColIndex) ) descColIndex= std::numeric_limits::max(); - uint descColIndex2; + uint descColIndex2 = std::numeric_limits::max(); if( !ws.findCol(descColIdent2, descColIndex2) ) descColIndex2= std::numeric_limits::max(); @@ -1225,9 +1225,8 @@ void CStringManagerClient::initI18NSpecialWords(const std::string &languageCode) const ucstring &key= ws.getData(j, keyColIndex); const ucstring &name= ws.getData(j, nameColIndex); // Append to the I18N. - string keyStr= key.toString(); // avoid case problems - strlwr(keyStr); + string keyStr= NLMISC::toLower(key.toString()); // append the special key extension. keyStr+= keyExtenstion; @@ -1424,6 +1423,9 @@ const ucchar * CStringManagerClient::getSpecialWord(const std::string &label, bo map::iterator it = _SpecItem_TempMap.find(lwrLabel); if (it != _SpecItem_TempMap.end()) { + if( UseFemaleTitles && women ) + if (!it->second.WomenName.empty()) + return it->second.WomenName.c_str(); return it->second.Name.c_str(); } } @@ -1641,8 +1643,6 @@ const ucchar *CStringManagerClient::getSquadLocalizedDescription(NLMISC::CSheetI // *************************************************************************** void CStringManagerClient::replaceSBrickName(NLMISC::CSheetId id, const ucstring &name, const ucstring &desc, const ucstring &desc2) { - nlassert(!_SpecItem_MemoryCompressed); - std::string label= id.toString(); if (label.empty()) { @@ -1654,14 +1654,57 @@ void CStringManagerClient::replaceSBrickName(NLMISC::CSheetId id, const ucstrin lwrLabel= label; strlwr(lwrLabel); - map::iterator it(_SpecItem_TempMap.find(lwrLabel)); - if (it == _SpecItem_TempMap.end()) - return; + if (_SpecItem_MemoryCompressed) + { + ucchar *strName = (ucchar *)name.c_str(); + ucchar *strDesc = (ucchar *)desc.c_str(); + ucchar *strDesc2 = (ucchar *)desc2.c_str(); + CItemLight tmp; + tmp.Label = (char*)lwrLabel.c_str(); + vector::iterator it = lower_bound(_SpecItems.begin(), _SpecItems.end(), tmp, CItemLightComp()); - // Then replace - it->second.Name= name; - it->second.Desc= desc; - it->second.Desc2= desc2; + if (it != _SpecItems.end()) + { + if (strcmp(it->Label, lwrLabel.c_str()) == 0) + { + it->Name = strName; + it->Desc = strDesc; + it->Desc2 = strDesc2; + } + else + { + it->Label = tmp.Label; + it->Name = strName; + it->Desc = strDesc; + it->Desc2 = strDesc2; + } + } + else + { + tmp.Name = strName; + tmp.Desc = strDesc; + tmp.Desc2 = strDesc2; + _SpecItems.push_back(tmp); + } + } + else + { + map::iterator it(_SpecItem_TempMap.find(lwrLabel)); + if (it != _SpecItem_TempMap.end()) + { + it->second.Name= name; + it->second.Desc= desc; + it->second.Desc2= desc2; + } + else + { + CItem newItem; + newItem.Name = name; + newItem.Desc = desc; + newItem.Desc2 = desc2; + _SpecItem_TempMap.insert(pair(lwrLabel,newItem)); + } + } } diff --git a/code/ryzom/client/src/user_entity.cpp b/code/ryzom/client/src/user_entity.cpp index a5c016f34..64a493d2e 100644 --- a/code/ryzom/client/src/user_entity.cpp +++ b/code/ryzom/client/src/user_entity.cpp @@ -361,7 +361,8 @@ bool CUserEntity::build(const CEntitySheet *sheet) // virtual CInterfaceManager *pIM = CInterfaceManager::getInstance(); { CCDBNodeLeaf *node = pIM->getDbProp("SERVER:USER:IS_INVISIBLE", false); - if (node) { + if (node) + { ICDBNode::CTextId textId; node->addObserver(&_InvisibleObs, textId); } 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 be7ce1beb..1e4f9d723 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 @@ -688,12 +688,15 @@ + + + @@ -835,11 +838,20 @@ + + + + + + + + + @@ -852,6 +864,7 @@ + @@ -1007,6 +1020,7 @@ + @@ -1019,6 +1033,7 @@ + @@ -1093,6 +1108,8 @@ + + @@ -1106,6 +1123,9 @@ + + + @@ -1115,7 +1135,9 @@ - + + + @@ -1124,24 +1146,34 @@ + + + + - + + + - + + + - + + + @@ -1150,20 +1182,27 @@ + + + - + + + - + + + @@ -1173,7 +1212,9 @@ - + + + @@ -1182,7 +1223,9 @@ - + + + @@ -1190,7 +1233,9 @@ - + + + @@ -1198,26 +1243,35 @@ - + + + - + + + - + + + + + + @@ -1250,13 +1304,18 @@ + + + - + + + diff --git a/code/ryzom/common/src/game_share/action_nature.cpp b/code/ryzom/common/src/game_share/action_nature.cpp index 04d8fc132..456cfcbc1 100644 --- a/code/ryzom/common/src/game_share/action_nature.cpp +++ b/code/ryzom/common/src/game_share/action_nature.cpp @@ -38,6 +38,7 @@ namespace ACTNATURE NL_STRING_CONVERSION_TABLE_ENTRY(DODGE) NL_STRING_CONVERSION_TABLE_ENTRY(PARRY) NL_STRING_CONVERSION_TABLE_ENTRY(SHIELD_USE) + NL_STRING_CONVERSION_TABLE_ENTRY(RECHARGE) NL_END_STRING_CONVERSION_TABLE(TActionNature, ActionNatureConversion, UNKNOWN) diff --git a/code/ryzom/common/src/game_share/action_nature.h b/code/ryzom/common/src/game_share/action_nature.h index 36494b1ff..333656101 100644 --- a/code/ryzom/common/src/game_share/action_nature.h +++ b/code/ryzom/common/src/game_share/action_nature.h @@ -35,6 +35,7 @@ namespace ACTNATURE DODGE, PARRY, SHIELD_USE, + RECHARGE, NEUTRAL, //only for multi effect on spell,progression consider it as OFFENSIVE_MAGIC diff --git a/code/ryzom/common/src/game_share/character_sync_itf.h b/code/ryzom/common/src/game_share/character_sync_itf.h index 728104322..459659732 100644 --- a/code/ryzom/common/src/game_share/character_sync_itf.h +++ b/code/ryzom/common/src/game_share/character_sync_itf.h @@ -21,9 +21,7 @@ #ifndef CHARACTER_SYNC_ITF #define CHARACTER_SYNC_ITF #include "nel/misc/types_nl.h" -#if defined(NL_COMP_VC8) || defined(NL_COMP_VC9) -# include -#endif +#include #include "nel/misc/hierarchical_timer.h" #include "nel/misc/string_conversion.h" #include "nel/net/message.h" @@ -1139,12 +1137,12 @@ namespace CHARSYNC } // - ucstring getFullName() const + const ucstring& getFullName() const { return _FullName; } - void setFullName(ucstring value) + void setFullName(const ucstring &value) { _FullName = value; diff --git a/code/ryzom/common/src/game_share/magic_fx.h b/code/ryzom/common/src/game_share/magic_fx.h index df1d927ad..1d1df3bc4 100644 --- a/code/ryzom/common/src/game_share/magic_fx.h +++ b/code/ryzom/common/src/game_share/magic_fx.h @@ -133,6 +133,9 @@ namespace MAGICFX WaterWall = 11, ThornWall = 12, LightningWall = 13, + OtherFireWall = 14, + TeleportKami = 15, // No effect aura + TeleportKara = 16, // No effect aura }; } diff --git a/code/ryzom/common/src/game_share/mirror.cpp b/code/ryzom/common/src/game_share/mirror.cpp index 31304614b..1e025a30d 100644 --- a/code/ryzom/common/src/game_share/mirror.cpp +++ b/code/ryzom/common/src/game_share/mirror.cpp @@ -634,7 +634,7 @@ void CMirror::receiveTracker( bool entitiesOrProp, NLNET::CMessage& msgin ) ++nbSent; } } - catch( EMirror& ) + catch(const EMirror& ) { nlwarning( "MIRROR:ROWMGT:ATE> Invalid dataset name %s for adding tracker", name.c_str() ); } @@ -752,7 +752,7 @@ void CMirror::receiveAcknowledgeAddEntityTracker( NLNET::CMessage& msgin, TSe } } - catch( EMirror& ) + catch(const EMirror& ) { nlwarning( "MIRROR: Invalid dataset name %s for receiving ack of addEntityTracker", datasetname.c_str() ); } @@ -1043,7 +1043,7 @@ void cbAllMirrorsOnline( NLNET::CMessage& msgin, const std::string &/* serviceNa msgin.serial( versionStr ); hasVersion = true; } - catch ( EStreamOverflow& ) + catch (const EStreamOverflow&) {} if ( (! hasVersion) || (MirrorVersion != versionStr) ) nlerror( "Mirror version mismatch! This service: %s; Local MS: %s", MirrorVersion.c_str(), versionStr.c_str() ); @@ -1174,7 +1174,7 @@ void CMirror::receiveServiceHasMirrorReady( const std::string& serviceName, TSer } } } - catch ( EStreamOverflow& ) + catch (const EStreamOverflow&) { nlwarning( "Received SMIRU from old version service %s-%hu", serviceName.c_str(), serviceId.get() ); } @@ -2484,7 +2484,7 @@ NLMISC_CATEGORISED_COMMAND(mirror, displayMirrorRow, "Display the contents of th return true; } } - catch ( EMirror& ) + catch (const EMirror&) { log.displayNL( "Dataset not found" ); return true; @@ -2682,7 +2682,7 @@ NLMISC_CATEGORISED_COMMAND(mirror, displayMirrorEntities, "Display all of part o } } } - catch ( EMirror& ) + catch (const EMirror&) { log.displayNL( "Dataset not found" ); } @@ -2727,7 +2727,7 @@ NLMISC_COMMAND( lookForMirrorValue, "Look for values with criteria (Value can be } MirrorInstance->getDataSet( args[0] ).lookForValue( log, propName, anyValue, valueSearchedStr, onlyEntityType, onlyCreatorId, onlyDynamicId, false, true, false, true ); } - catch ( EMirror& ) + catch (const EMirror&) { log.displayNL( "Dataset not found" ); } @@ -2747,7 +2747,7 @@ NLMISC_CATEGORISED_COMMAND(mirror, displayMirrorTrackers, "Display the trackers { MirrorInstance->getDataSet( args[0] ).displayTrackers( log ); } - catch ( EMirror& ) + catch (const EMirror&) { log.displayNL( "Dataset not found" ); } @@ -2794,7 +2794,7 @@ NLMISC_CATEGORISED_COMMAND(mirror, rescanExistingEntities, "Scan the entities to CMirroredDataSet& dataset = MirrorInstance->getDataSet( args[0] ); MirrorInstance->rescanExistingEntities( dataset, log, true ); } - catch ( EMirror& ) + catch (const EMirror&) { log.displayNL( "Dataset not found" ); } @@ -2815,7 +2815,7 @@ NLMISC_CATEGORISED_COMMAND(mirror, displayUnknownOnlineEntities, "Scan the entit CMirroredDataSet& dataset = MirrorInstance->getDataSet( args[0] ); MirrorInstance->rescanExistingEntities( dataset, log, false ); } - catch ( EMirror& ) + catch (const EMirror&) { log.displayNL( "Dataset not found" ); } @@ -2844,7 +2844,7 @@ NLMISC_CATEGORISED_COMMAND(mirror, monitorMirrorEntity, "Set/unset an entity for else log.displayNL( "Invalid entity index provided" ); } - catch ( EMirror& ) + catch (const EMirror&) { log.displayNL( "Dataset not found" ); } @@ -2867,7 +2867,7 @@ NLMISC_CATEGORISED_DYNVARIABLE(mirror, sint32, MainNbEntities, "Number of online { *pointer = MirrorInstance->getDataSet( "fe_temp" ).getNbOnlineEntities(); } - catch ( EMirror& ) + catch (const EMirror&) { *pointer = -2; // silent } @@ -2888,7 +2888,7 @@ NLMISC_CATEGORISED_DYNVARIABLE(mirror, sint32, LocalEntities, "Number of online { *pointer = MirrorInstance->getDataSet( "fe_temp" ).getNbOwnedEntities(); } - catch ( EMirror& ) + catch (const EMirror&) { *pointer = -2; // silent } 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 553c73b96..08e96761d 100644 --- a/code/ryzom/common/src/game_share/mirror_prop_value.h +++ b/code/ryzom/common/src/game_share/mirror_prop_value.h @@ -1022,14 +1022,14 @@ struct _CMirrorPropValueListIterator CMirrorPropValueList *_ParentList; TSharedListRow _Index; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - typedef size_t size_type; - typedef ptrdiff_t difference_type; - // typedef typename std::forward_iterator_tag iterator_category; + typedef T value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; + typedef size_t size_type; + typedef ptrdiff_t difference_type; + // typedef typename std::forward_iterator_tag iterator_category; }; @@ -1050,15 +1050,14 @@ struct _CCMirrorPropValueListIterator CMirrorPropValueList *_ParentList; TSharedListRow _Index; - typedef T value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - typedef size_t size_type; - typedef ptrdiff_t difference_type; - // typedef typename std::forward_iterator_tag iterator_category; - + typedef T value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; + typedef size_t size_type; + typedef ptrdiff_t difference_type; + // typedef typename std::forward_iterator_tag iterator_category; }; @@ -1232,7 +1231,7 @@ class CMirrorPropValueList { public: - typedef CPropLocationUnpacked CPropLocationClass; + typedef CPropLocationUnpacked CPropLocationClass; typedef uint32 size_type; typedef _CMirrorPropValueListIterator iterator; diff --git a/code/ryzom/common/src/game_share/msg_ais_egs_gen.h b/code/ryzom/common/src/game_share/msg_ais_egs_gen.h index 99de7c001..d7bfc39e7 100644 --- a/code/ryzom/common/src/game_share/msg_ais_egs_gen.h +++ b/code/ryzom/common/src/game_share/msg_ais_egs_gen.h @@ -21,9 +21,7 @@ #ifndef MSG_AIS_EGS_GEN #define MSG_AIS_EGS_GEN #include "nel/misc/types_nl.h" -#if defined(NL_COMP_VC8) || defined(NL_COMP_VC9) -# include -#endif +#include #include "nel/misc/hierarchical_timer.h" #include "nel/misc/string_conversion.h" #include "nel/net/message.h" diff --git a/code/ryzom/common/src/game_share/object.cpp b/code/ryzom/common/src/game_share/object.cpp index d15497ce4..908cc6e2a 100644 --- a/code/ryzom/common/src/game_share/object.cpp +++ b/code/ryzom/common/src/game_share/object.cpp @@ -1288,7 +1288,8 @@ void CObjectTable::clear() CHECK_TABLE_INTEGRITY TContainer::iterator first(_Value.begin()); TContainer::iterator last(_Value.end()); - for (; first != last ;++first) { + for (; first != last ;++first) + { delete first->second; } _Value.clear(); @@ -3044,7 +3045,8 @@ void CObjectSerializerImpl::serialImpl(NLMISC::IStream& stream, CObject*& data, -- (serializer->Level); } uint endLength = stream.getPos(); - if (serializer->Log) { + if (serializer->Log) + { if (className.empty()) { nldebug("R2NET: (%u) Table sent %u bytes",serializer->Level, endLength - initLength); diff --git a/code/ryzom/common/src/game_share/object.h b/code/ryzom/common/src/game_share/object.h index 0f74d70fa..f4b292e2e 100644 --- a/code/ryzom/common/src/game_share/object.h +++ b/code/ryzom/common/src/game_share/object.h @@ -206,9 +206,8 @@ protected: uint32 _Validation; }; -/*inline std::ostream& operator<<( std::ostream& os, - const CObject& c ) { - +/*inline std::ostream& operator<<( std::ostream& os, const CObject& c ) +{ c.serialize(os); return os; }*/ diff --git a/code/ryzom/common/src/game_share/r2_modules_itf.h b/code/ryzom/common/src/game_share/r2_modules_itf.h index e8626cafd..d44f0ea5a 100644 --- a/code/ryzom/common/src/game_share/r2_modules_itf.h +++ b/code/ryzom/common/src/game_share/r2_modules_itf.h @@ -21,9 +21,7 @@ #ifndef R2_MODULES_ITF #define R2_MODULES_ITF #include "nel/misc/types_nl.h" -#if defined(NL_COMP_VC8) || defined(NL_COMP_VC9) -# include -#endif +#include #include "nel/misc/hierarchical_timer.h" #include "nel/misc/string_conversion.h" #include "nel/net/message.h" diff --git a/code/ryzom/common/src/game_share/r2_share_itf.h b/code/ryzom/common/src/game_share/r2_share_itf.h index 0d2956089..4e2abdf10 100644 --- a/code/ryzom/common/src/game_share/r2_share_itf.h +++ b/code/ryzom/common/src/game_share/r2_share_itf.h @@ -21,9 +21,7 @@ #ifndef R2_SHARE_ITF #define R2_SHARE_ITF #include "nel/misc/types_nl.h" -#if defined(NL_COMP_VC8) || defined(NL_COMP_VC9) -# include -#endif +#include #include "nel/misc/hierarchical_timer.h" #include "nel/misc/string_conversion.h" #include "nel/net/message.h" diff --git a/code/ryzom/common/src/game_share/time_weather_season/weather_predict.cpp b/code/ryzom/common/src/game_share/time_weather_season/weather_predict.cpp index 144b06036..6570e2600 100644 --- a/code/ryzom/common/src/game_share/time_weather_season/weather_predict.cpp +++ b/code/ryzom/common/src/game_share/time_weather_season/weather_predict.cpp @@ -580,7 +580,7 @@ void CPredictWeather::generateWeatherStats(const std::string &fileName, const CW outputFile.serial(output[n]); } } - catch (NLMISC::EStream &e) + catch (const NLMISC::EStream &e) { nlwarning(e.what()); } diff --git a/code/ryzom/server/data_shard/client_commands_privileges.txt b/code/ryzom/server/data_shard/client_commands_privileges.txt index 0ab0e8e9f..c61537dfa 100644 --- a/code/ryzom/server/data_shard/client_commands_privileges.txt +++ b/code/ryzom/server/data_shard/client_commands_privileges.txt @@ -15,10 +15,10 @@ addSkillPoints :DEV:SGM:GM:EM: // Add skill points of given type (Fight=0, M addXPToSkill :DEV:SGM:GM:EM: // Gain experience in the given skill: [] broadcast :DEV:SGM:GM:EM:VG: // Broadcast a message: [repeat= or during=