diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index c708b9dda..3824e7640 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -116,6 +116,10 @@ FIND_PACKAGE(OpenSSL REQUIRED) FIND_PACKAGE(GIF) FIND_PACKAGE(Jpeg) +IF(WIN32) + SET(OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} Crypt32.lib) +ENDIF() + IF(WITH_LIBOVR) FIND_PACKAGE(LibOVR) ENDIF() @@ -447,8 +451,6 @@ IF(WITH_NEL) SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${INTL_LIBRARY}) ENDIF() ENDIF() - ELSEIF(WIN32) - SET(CURL_LIBRARIES ${CURL_LIBRARIES} Crypt32.lib) ENDIF() ENDIF() ENDIF() diff --git a/code/CMakeModules/FindMSVC.cmake b/code/CMakeModules/FindMSVC.cmake index af44f6676..9d5fc5cf7 100644 --- a/code/CMakeModules/FindMSVC.cmake +++ b/code/CMakeModules/FindMSVC.cmake @@ -56,16 +56,18 @@ MACRO(DETECT_VC_VERSION_HELPER _ROOT _VERSION) ENDMACRO() MACRO(DETECT_VC_VERSION _VERSION) - SET(VC${_VERSION}_FOUND OFF) - DETECT_VC_VERSION_HELPER("HKEY_CURRENT_USER" ${_VERSION}) + IF(NOT VC_FOUND) + SET(VC${_VERSION}_FOUND OFF) + DETECT_VC_VERSION_HELPER("HKEY_CURRENT_USER" ${_VERSION}) - IF(NOT VC${_VERSION}_FOUND) - DETECT_VC_VERSION_HELPER("HKEY_LOCAL_MACHINE" ${_VERSION}) - ENDIF() + IF(NOT VC${_VERSION}_FOUND) + DETECT_VC_VERSION_HELPER("HKEY_LOCAL_MACHINE" ${_VERSION}) + ENDIF() - IF(VC${_VERSION}_FOUND) - SET(VC_FOUND ON) - SET(VC_DIR "${VC${_VERSION}_DIR}") + IF(VC${_VERSION}_FOUND) + SET(VC_FOUND ON) + SET(VC_DIR "${VC${_VERSION}_DIR}") + ENDIF() ENDIF() ENDMACRO() @@ -77,7 +79,7 @@ MACRO(DETECT_EXPRESS_VERSION _VERSION) ENDIF() ENDMACRO() -IF(MSVC1411 OR MSVC1410) +IF(MSVC_VERSION GREATER 1909) DETECT_VC_VERSION("15.0") SET(MSVC_TOOLSET "140") @@ -98,44 +100,18 @@ IF(MSVC1411 OR MSVC1410) SET(VC_DIR "${VC_DIR}/${MSVC_TOOLCHAIN_VERSION}") SET(VC_INCLUDE_DIR "${VC_DIR}/include") - - IF(NOT MSVC14_REDIST_DIR) - # If you have VC++ 2017 Express, put x64/Microsoft.VC141.CRT/*.dll in ${EXTERNAL_PATH}/redist - # original files whould be in ${VC_DIR}/Redist/MSVC/14.11.25325/x64/Microsoft.VC141.CRT - SET(MSVC14_REDIST_DIR "${EXTERNAL_PATH}/redist") - ENDIF() ELSEIF(MSVC14) DETECT_VC_VERSION("14.0") SET(MSVC_TOOLSET "140") - - IF(NOT MSVC14_REDIST_DIR) - # If you have VC++ 2015 Express, put x64/Microsoft.VC140.CRT/*.dll in ${EXTERNAL_PATH}/redist - SET(MSVC14_REDIST_DIR "${EXTERNAL_PATH}/redist") - ENDIF() ELSEIF(MSVC12) DETECT_VC_VERSION("12.0") SET(MSVC_TOOLSET "120") - - IF(NOT MSVC12_REDIST_DIR) - # If you have VC++ 2013 Express, put x64/Microsoft.VC120.CRT/*.dll in ${EXTERNAL_PATH}/redist - SET(MSVC12_REDIST_DIR "${EXTERNAL_PATH}/redist") - ENDIF() ELSEIF(MSVC11) DETECT_VC_VERSION("11.0") SET(MSVC_TOOLSET "110") - - IF(NOT MSVC11_REDIST_DIR) - # If you have VC++ 2012 Express, put x64/Microsoft.VC110.CRT/*.dll in ${EXTERNAL_PATH}/redist - SET(MSVC11_REDIST_DIR "${EXTERNAL_PATH}/redist") - ENDIF() ELSEIF(MSVC10) DETECT_VC_VERSION("10.0") SET(MSVC_TOOLSET "100") - - IF(NOT MSVC10_REDIST_DIR) - # If you have VC++ 2010 Express, put x64/Microsoft.VC100.CRT/*.dll in ${EXTERNAL_PATH}/redist - SET(MSVC10_REDIST_DIR "${EXTERNAL_PATH}/redist") - ENDIF() ELSEIF(MSVC90) DETECT_VC_VERSION("9.0") SET(MSVC_TOOLSET "90") @@ -147,6 +123,8 @@ ENDIF() # If you plan to use VC++ compilers with WINE, set VC_DIR environment variable IF(NOT VC_DIR) SET(VC_DIR $ENV{VC_DIR}) + # Fix path + FILE(TO_CMAKE_PATH ${VC_DIR} VC_DIR) ENDIF() IF(NOT VC_DIR) @@ -158,8 +136,44 @@ IF(NOT VC_DIR) STRING(REGEX REPLACE "/(bin|BIN|Bin)/.+" "" VC_DIR ${_COMPILER}) ENDIF() -IF(NOT VC_INCLUDE_DIR) +IF(NOT VC_INCLUDE_DIR AND VC_DIR AND EXISTS "${VC_DIR}") SET(VC_INCLUDE_DIR "${VC_DIR}/include") + IF(EXISTS "${VC_INCLUDE_DIR}") + SET(VC_FOUND ON) + ENDIF() +ENDIF() + +SET(MSVC_REDIST_DIR "${EXTERNAL_PATH}/redist") + +IF(NOT EXISTS "${MSVC_REDIST_DIR}") + SET(MSVC_REDIST_DIR "${VC_DIR}/redist") + + IF(NOT EXISTS "${MSVC_REDIST_DIR}") + SET(MSVC_REDIST_DIR) + ENDIF() +ENDIF() + +IF(MSVC_REDIST_DIR) + IF(MSVC1411 OR MSVC1410) + # If you have VC++ 2017 Express, put x64/Microsoft.VC141.CRT/*.dll in ${EXTERNAL_PATH}/redist + # original files whould be in ${VC_DIR}/Redist/MSVC/14.11.25325/x64/Microsoft.VC141.CRT + SET(MSVC14_REDIST_DIR "${MSVC_REDIST_DIR}") + ELSEIF(MSVC14) + SET(MSVC14_REDIST_DIR "${MSVC_REDIST_DIR}") + ELSEIF(MSVC12) + # If you have VC++ 2013 Express, put x64/Microsoft.VC120.CRT/*.dll in ${EXTERNAL_PATH}/redist + SET(MSVC12_REDIST_DIR "${MSVC_REDIST_DIR}") + ELSEIF(MSVC11) + # If you have VC++ 2012 Express, put x64/Microsoft.VC110.CRT/*.dll in ${EXTERNAL_PATH}/redist + SET(MSVC11_REDIST_DIR "${MSVC_REDIST_DIR}") + ELSEIF(MSVC10) + # If you have VC++ 2010 Express, put x64/Microsoft.VC100.CRT/*.dll in ${EXTERNAL_PATH}/redist + SET(MSVC10_REDIST_DIR "${MSVC_REDIST_DIR}") + ELSEIF(MSVC90) + SET(MSVC90_REDIST_DIR "${MSVC_REDIST_DIR}") + ELSEIF(MSVC80) + SET(MSVC80_REDIST_DIR "${MSVC_REDIST_DIR}") + ENDIF() ENDIF() MESSAGE(STATUS "Using headers from ${VC_INCLUDE_DIR}") diff --git a/code/CMakeModules/FindMySQL.cmake b/code/CMakeModules/FindMySQL.cmake index f2b62fc59..8a92cb0c4 100644 --- a/code/CMakeModules/FindMySQL.cmake +++ b/code/CMakeModules/FindMySQL.cmake @@ -69,6 +69,9 @@ ELSE() ENDIF() FIND_PACKAGE(OpenSSL) IF(OPENSSL_FOUND) + IF(WIN32) + SET(OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} Crypt32.lib) + ENDIF() SET(MYSQL_LIBRARIES ${MYSQL_LIBRARIES} ${OPENSSL_LIBRARIES}) ENDIF() ENDIF() diff --git a/code/CMakeModules/FindWindowsSDK.cmake b/code/CMakeModules/FindWindowsSDK.cmake index 0e2735570..3d9c43bd9 100644 --- a/code/CMakeModules/FindWindowsSDK.cmake +++ b/code/CMakeModules/FindWindowsSDK.cmake @@ -240,7 +240,7 @@ MACRO(USE_CURRENT_WINSDK) IF(NOT WINSDK_DIR) # Use Windows SDK versions installed with VC++ when possible - IF(MSVC1411 OR MSVC1410) + IF(MSVC_VERSION GREATER 1909) # Special case, use Kits for SDK SET(WINSDK_VERSION "10.0") SET(WINSDK_DIR ${WINSDK_UCRT_DIR}) @@ -484,7 +484,7 @@ IF(WINSDK_INCLUDE_DIR) SET(CMAKE_LIBRARY_PATH ${WINSDK_LIBRARY_DIR} ${CMAKE_LIBRARY_PATH}) - # Fix for using Windows SDK 7.1 with Visual C++ 2012, 2013 and 2015 + # Fix for using Windows SDK 7.1 with Visual C++ 2012, 2013, 2015 and 2017 IF(WINSDK_VERSION STREQUAL "7.1" AND (MSVC11 OR MSVC12 OR MSVC14)) ADD_DEFINITIONS(-D_USING_V110_SDK71_) ENDIF() diff --git a/code/CMakeModules/Findassimp.cmake b/code/CMakeModules/Findassimp.cmake index 41e53cf94..b4bf0da99 100644 --- a/code/CMakeModules/Findassimp.cmake +++ b/code/CMakeModules/Findassimp.cmake @@ -1,29 +1,63 @@ +IF(assimp_FIND_REQUIRED) + SET(ASSIMP_FIND_REQUIRED ON) +ENDIF() + FIND_PATH( - assimp_INCLUDE_DIRS + ASSIMP_INCLUDE_DIRS NAMES assimp/postprocess.h assimp/scene.h assimp/version.h assimp/config.h assimp/cimport.h PATHS /usr/local/include/ ) FIND_LIBRARY( - assimp_LIBRARIES + ASSIMP_LIBRARY_RELEASE NAMES assimp PATHS /usr/local/lib/ ) -IF (assimp_INCLUDE_DIRS AND assimp_LIBRARIES) - SET(assimp_FOUND TRUE) +FIND_LIBRARY( + IRRXML_LIBRARY_RELEASE + NAMES IrrXML + PATHS /usr/local/lib/ +) + +FIND_LIBRARY( + ASSIMP_LIBRARY_DEBUG + NAMES assimpd + PATHS /usr/local/lib/ +) + +FIND_LIBRARY( + IRRXML_LIBRARY_DEBUG + NAMES IrrXMLd + PATHS /usr/local/lib/ +) + +IF (ASSIMP_INCLUDE_DIRS) + SET(ASSIMP_FOUND TRUE) + IF(ASSIMP_LIBRARY_RELEASE) + SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} optimized ${ASSIMP_LIBRARY_RELEASE}) + ENDIF() + IF(ASSIMP_LIBRARY_DEBUG) + SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} debug ${ASSIMP_LIBRARY_DEBUG}) + ENDIF() FIND_PACKAGE(ZLIB) IF(ZLIB_FOUND) - SET(assimp_LIBRARIES ${assimp_LIBRARIES} ${ZLIB_LIBRARIES}) + SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} ${ZLIB_LIBRARIES}) ENDIF() -ENDIF (assimp_INCLUDE_DIRS AND assimp_LIBRARIES) + IF(IRRXML_LIBRARY_RELEASE) + SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} optimized ${IRRXML_LIBRARY_RELEASE}) + ENDIF() + IF(IRRXML_LIBRARY_DEBUG) + SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} debug ${IRRXML_LIBRARY_DEBUG}) + ENDIF() +ENDIF() -IF (assimp_FOUND) - IF (NOT assimp_FIND_QUIETLY) - MESSAGE(STATUS "Found asset importer library: ${assimp_LIBRARIES}") - ENDIF (NOT assimp_FIND_QUIETLY) -ELSE (assimp_FOUND) - IF (assimp_FIND_REQUIRED) +IF (ASSIMP_FOUND) + IF (NOT ASSIMP_FIND_QUIETLY) + MESSAGE(STATUS "Found asset importer library: ${ASSIMP_LIBRARIES}") + ENDIF () +ELSE (ASSIMP_FOUND) + IF (ASSIMP_FIND_REQUIRED) MESSAGE(FATAL_ERROR "Could not find asset importer library") - ENDIF (assimp_FIND_REQUIRED) -ENDIF (assimp_FOUND) + ENDIF () +ENDIF () diff --git a/code/CMakeModules/OSXToolChain.cmake b/code/CMakeModules/OSXToolChain.cmake index 3036aec01..3169aec78 100644 --- a/code/CMakeModules/OSXToolChain.cmake +++ b/code/CMakeModules/OSXToolChain.cmake @@ -24,9 +24,25 @@ IF(DEFINED CMAKE_CROSSCOMPILING) ENDIF() # Force the compilers to Clang for OS X + +# C SET(CMAKE_C_COMPILER x86_64-apple-darwin15-clang) +SET(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11") +SET(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert") +SET(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") +SET(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") +SET(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") + +# C++ SET(CMAKE_CXX_COMPILER x86_64-apple-darwin15-clang++) -set(CMAKE_CXX_COMPILER_ID "AppleClang") +SET(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17") +SET(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") +SET(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") +SET(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") +SET(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") + +# make +SET(CMAKE_MAKE_PROGRAM make) # Skip the platform compiler checks for cross compiling. SET(CMAKE_CXX_COMPILER_FORCED TRUE) @@ -86,9 +102,10 @@ SET(CMAKE_OSX_SYSROOT ${CMAKE_OSX_SYSROOT}/MacOSX${OSX_SDK}.sdk) # Standard settings SET(CMAKE_SYSTEM_NAME Darwin) -set(CMAKE_SYSTEM "Darwin-15.0.0") -set(CMAKE_SYSTEM_VERSION "15.0.0") -set(CMAKE_SYSTEM_PROCESSOR "x86_64") +SET(CMAKE_SYSTEM "Darwin-15.0.0") +SET(CMAKE_SYSTEM_VERSION "15.0.0") +SET(CMAKE_SYSTEM_PROCESSOR "x86_64") + SET(UNIX ON) SET(APPLE ON) @@ -112,4 +129,3 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) # determinate location for bin utils based on CMAKE_FIND_ROOT_PATH INCLUDE(CMakeFindBinUtils) - diff --git a/code/nel/include/nel/3d/flare_shape.h b/code/nel/include/nel/3d/flare_shape.h index 044c53c11..b0c35257b 100644 --- a/code/nel/include/nel/3d/flare_shape.h +++ b/code/nel/include/nel/3d/flare_shape.h @@ -55,7 +55,7 @@ public: CFlareShape(); /// serial this shape - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); //@} diff --git a/code/nel/include/nel/3d/key.h b/code/nel/include/nel/3d/key.h index d30bfcd6e..6982dc98b 100644 --- a/code/nel/include/nel/3d/key.h +++ b/code/nel/include/nel/3d/key.h @@ -47,7 +47,7 @@ public: public: /// Serial - void serial (NLMISC::IStream& f) throw (NLMISC::EStream) + void serial (NLMISC::IStream& f) { // Version number (void)f.serialVersion (0); @@ -83,7 +83,7 @@ class CKeyTCB : public CKey public: /// Serial - void serial (NLMISC::IStream& f) throw (NLMISC::EStream) + void serial (NLMISC::IStream& f) { // Version number (void)f.serialVersion (0); @@ -130,7 +130,7 @@ class CKeyBezier : public CKey public: /// Serial - void serial (NLMISC::IStream& f) throw (NLMISC::EStream) + void serial (NLMISC::IStream& f) { // Version number (void)f.serialVersion (0); @@ -180,7 +180,7 @@ template<> class CKeyTCB : public CKey public: /// Serial - void serial (NLMISC::IStream& f) throw (NLMISC::EStream) + void serial (NLMISC::IStream& f) { // Version number (void)f.serialVersion (0); @@ -228,7 +228,7 @@ template<> class CKeyBezier : public CKey public: /// Serial - void serial (NLMISC::IStream& f) throw (NLMISC::EStream) + void serial (NLMISC::IStream& f) { // Version number (void)f.serialVersion (0); diff --git a/code/nel/include/nel/3d/mesh.h b/code/nel/include/nel/3d/mesh.h index 780a455aa..25872a063 100644 --- a/code/nel/include/nel/3d/mesh.h +++ b/code/nel/include/nel/3d/mesh.h @@ -85,7 +85,7 @@ public: // This is slow but doesn't matter since used at mesh building.... CCorner(); - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); }; /// A Triangle face. @@ -94,7 +94,7 @@ public: CCorner Corner[3]; sint32 MaterialId; sint32 SmoothGroup; - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); }; @@ -118,7 +118,7 @@ public: } } - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); }; struct CVertLink @@ -203,7 +203,7 @@ public: CMeshBuild(); // Serialization - //void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + //void serial(NLMISC::IStream &f); }; //@} @@ -257,7 +257,7 @@ public: virtual void render(IDriver *drv, CTransformShape *trans, bool opaquePass); /// serial this mesh. - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CMesh); /// get trinagle count. @@ -370,7 +370,7 @@ public: virtual float getNumTriangles (float distance); /// serial this mesh. - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CMeshGeom); // profile diff --git a/code/nel/include/nel/3d/mesh_base.h b/code/nel/include/nel/3d/mesh_base.h index 816d8b7a4..9fb4f9029 100644 --- a/code/nel/include/nel/3d/mesh_base.h +++ b/code/nel/include/nel/3d/mesh_base.h @@ -146,7 +146,7 @@ public: CMeshBaseBuild(); // Serialization is not used - //void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + //void serial(NLMISC::IStream &f); }; //@} @@ -201,7 +201,7 @@ public: // @} /// serial the base Part of this mesh. - void serialMeshBase(NLMISC::IStream &f) throw(NLMISC::EStream); + void serialMeshBase(NLMISC::IStream &f); /// Flush textures void flushTextures (IDriver &driver, uint selectedTexture); diff --git a/code/nel/include/nel/3d/mesh_morpher.h b/code/nel/include/nel/3d/mesh_morpher.h index b9d8879e2..909d60586 100644 --- a/code/nel/include/nel/3d/mesh_morpher.h +++ b/code/nel/include/nel/3d/mesh_morpher.h @@ -43,7 +43,7 @@ public: std::vector VertRefs; // Array of vertices reference - void serial (NLMISC::IStream &f) throw(NLMISC::EStream); + void serial (NLMISC::IStream &f); }; // *************************************************************************** @@ -90,7 +90,7 @@ public: NLMISC::CObjectVector &vertexRemap, std::vector *pBSFactor); - void serial (NLMISC::IStream &f) throw(NLMISC::EStream); + void serial (NLMISC::IStream &f); private: diff --git a/code/nel/include/nel/3d/mesh_mrm.h b/code/nel/include/nel/3d/mesh_mrm.h index d0ce7d952..619908499 100644 --- a/code/nel/include/nel/3d/mesh_mrm.h +++ b/code/nel/include/nel/3d/mesh_mrm.h @@ -115,7 +115,7 @@ public: virtual float getNumTriangles (float distance); /// serial this meshGeom. - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CMeshMRMGeom); /// Scene profile @@ -579,11 +579,11 @@ private: /// load the header of this mesh. return the version of the header. - sint loadHeader(NLMISC::IStream &f) throw(NLMISC::EStream); + sint loadHeader(NLMISC::IStream &f); /// load this mesh. - void load(NLMISC::IStream &f) throw(NLMISC::EStream); + void load(NLMISC::IStream &f); /// save the entire mesh. - void save(NLMISC::IStream &f) throw(NLMISC::EStream); + void save(NLMISC::IStream &f); // Build bone Usage information for serialized mesh <= version 2. void buildBoneUsageVer2 (); @@ -702,7 +702,7 @@ public: virtual float getNumTriangles (float distance); /// serial this mesh. - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CMeshMRM); /// Get bbox. diff --git a/code/nel/include/nel/3d/mesh_multi_lod.h b/code/nel/include/nel/3d/mesh_multi_lod.h index 445941ed6..a79d5a63e 100644 --- a/code/nel/include/nel/3d/mesh_multi_lod.h +++ b/code/nel/include/nel/3d/mesh_multi_lod.h @@ -125,7 +125,7 @@ public: virtual void getAABBox(NLMISC::CAABBox &bbox) const; /// serial this mesh. - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); /// Declare name of the shape NLMISC_DECLARE_CLASS(CMeshMultiLod); @@ -238,7 +238,7 @@ private: std::vector CoarseTriangles; /// Serial - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); /// Is Opaque ? bool isOpaque() { return (Flags&IsOpaque)!=0; } diff --git a/code/nel/include/nel/3d/meshvp_per_pixel_light.h b/code/nel/include/nel/3d/meshvp_per_pixel_light.h index a234feddd..4533464a9 100644 --- a/code/nel/include/nel/3d/meshvp_per_pixel_light.h +++ b/code/nel/include/nel/3d/meshvp_per_pixel_light.h @@ -65,7 +65,7 @@ public: const NLMISC::CMatrix &invertedModelMat, const NLMISC::CVector &viewerPos); virtual void end(IDriver *drv); - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); virtual void setupForMaterial(const CMaterial &mat, IDriver *drv, CScene *scene, diff --git a/code/nel/include/nel/3d/meshvp_wind_tree.h b/code/nel/include/nel/3d/meshvp_wind_tree.h index d8e7598b7..790a2f774 100644 --- a/code/nel/include/nel/3d/meshvp_wind_tree.h +++ b/code/nel/include/nel/3d/meshvp_wind_tree.h @@ -90,7 +90,7 @@ public: virtual float getMaxVertexMove(); // Serial. - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CMeshVPWindTree); // @} diff --git a/code/nel/include/nel/3d/packed_world.h b/code/nel/include/nel/3d/packed_world.h index d76c180ba..a091c61fb 100644 --- a/code/nel/include/nel/3d/packed_world.h +++ b/code/nel/include/nel/3d/packed_world.h @@ -54,9 +54,9 @@ public: void build(std::vector &packesZones); bool raytrace(const NLMISC::CVector &start, const NLMISC::CVector &end, NLMISC::CVector &inter, std::vector *testedTriangles = NULL, NLMISC::CVector *normal = NULL); void getZones(std::vector &zones); - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); // just serialize the header, containing name of the zones this CPackedWorld was built from - void serialZoneNames(NLMISC::IStream &f) throw(NLMISC::EStream); + void serialZoneNames(NLMISC::IStream &f); /** Roughly select triangles that are within a convex 2D polygon (world coordinates) * Selection is not exact, because limited to the resolution of the grid into which is packed each zone. * Triangle that are within are guaranteed to be selected, however. @@ -68,7 +68,7 @@ private: public: TPackedZoneBaseSPtr Zone; uint32 RaytraceCounter; - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + void serial(NLMISC::IStream &f) { f.serialVersion(1); CPackedZoneBase *pz = Zone; @@ -81,7 +81,7 @@ private: { public: std::vector IDs; // make a class from this vector just for serialization - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + void serial(NLMISC::IStream &f) { f.serialCont(IDs); } diff --git a/code/nel/include/nel/3d/packed_zone.h b/code/nel/include/nel/3d/packed_zone.h index 2beb5f5ed..52f76097a 100644 --- a/code/nel/include/nel/3d/packed_zone.h +++ b/code/nel/include/nel/3d/packed_zone.h @@ -52,7 +52,7 @@ class CPackedVertex public: uint16 X, Y, Z; public: - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + void serial(NLMISC::IStream &f) { f.serial(X, Y, Z); } @@ -68,7 +68,7 @@ class CPackedTri public: uint32 V0, V1, V2; public: - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + void serial(NLMISC::IStream &f) { f.serial(V0, V1, V2); } @@ -79,7 +79,7 @@ class CPackedTri16 public: uint16 V0, V1, V2; public: - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + void serial(NLMISC::IStream &f) { f.serial(V0, V1, V2); } @@ -101,7 +101,7 @@ public: sint32 ZoneY; public: virtual ~CPackedZoneBase() {} - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream) = 0; + virtual void serial(NLMISC::IStream &f) = 0; // TMP For debug : render position covered by a frustum virtual void render(CVertexBuffer &vb, IDriver &drv, CMaterial &mat, CMaterial &wiredMaterial, const NLMISC::CMatrix &camMat, uint batchSize, const NLMISC::CVector localFrustCorners[8]) = 0; // raytracing test @@ -138,7 +138,7 @@ public: sint32 zoneX, sint32 zoneY ); - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); // TMP For debug : render porition covered by a frustum void render(CVertexBuffer &vb, IDriver &drv, CMaterial &mat, CMaterial &wiredMaterial, const NLMISC::CMatrix &camMat, uint batchSize, const NLMISC::CVector localFrustCorners[8]); // try to build a 16 bit version of this packed zone to save some more place @@ -183,7 +183,7 @@ public: NLMISC_DECLARE_CLASS(CPackedZone16) CPackedZone16(); // - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); // TMP For debug : render position covered by a frustum void render(CVertexBuffer &vb, IDriver &drv, CMaterial &mat, CMaterial &wiredMaterial, const NLMISC::CMatrix &camMat, uint batchSize, const NLMISC::CVector localFrustCorners[8]); // raytracing test diff --git a/code/nel/include/nel/3d/particle_system.h b/code/nel/include/nel/3d/particle_system.h index 50a8d8269..bd50514fc 100644 --- a/code/nel/include/nel/3d/particle_system.h +++ b/code/nel/include/nel/3d/particle_system.h @@ -84,7 +84,7 @@ public: /// dtor virtual ~CParticleSystem(); /// serialize this particle system - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); /** Merge this system with a system instanciated from the given shape * NB : This is for edition purpose, this is slow * \return true if the operation could be performed. It can fail when this cause the system the system to last forever, diff --git a/code/nel/include/nel/3d/particle_system_process.h b/code/nel/include/nel/3d/particle_system_process.h index 75aa6e0f1..0e52228ee 100644 --- a/code/nel/include/nel/3d/particle_system_process.h +++ b/code/nel/include/nel/3d/particle_system_process.h @@ -102,7 +102,7 @@ class CParticleSystemProcess : public NLMISC::IStreamable * Everything is saved, except for the fontManager and the fontGenerator. * They must be set again if the PSToolRender pass is used. */ - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream) ; + virtual void serial(NLMISC::IStream &f); /// @} diff --git a/code/nel/include/nel/3d/particle_system_shape.h b/code/nel/include/nel/3d/particle_system_shape.h index a1c397975..c8fbc8a17 100644 --- a/code/nel/include/nel/3d/particle_system_shape.h +++ b/code/nel/include/nel/3d/particle_system_shape.h @@ -90,7 +90,7 @@ public: // @} /// serial the shape - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CParticleSystemShape); diff --git a/code/nel/include/nel/3d/ps_attrib.h b/code/nel/include/nel/3d/ps_attrib.h index cd691e719..8a0dcdda6 100644 --- a/code/nel/include/nel/3d/ps_attrib.h +++ b/code/nel/include/nel/3d/ps_attrib.h @@ -202,7 +202,7 @@ public: uint size() const { return _Size; } /// serialization - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + void serial(NLMISC::IStream &f) { if (f.isReading()) { @@ -262,7 +262,7 @@ public: CPSAttrib(); /// Serialization method - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); // swap with another vector void swap(CPSAttrib &other); @@ -429,7 +429,7 @@ void CPSAttrib::remove(uint32 index) } template -void CPSAttrib::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSAttrib::serial(NLMISC::IStream &f) { // version 4 to 5 => bug with size being > capacity sint ver = f.serialVersion(5); diff --git a/code/nel/include/nel/3d/ps_attrib_maker.h b/code/nel/include/nel/3d/ps_attrib_maker.h index 56b393c2e..fb96cb86e 100644 --- a/code/nel/include/nel/3d/ps_attrib_maker.h +++ b/code/nel/include/nel/3d/ps_attrib_maker.h @@ -60,7 +60,7 @@ struct CPSInputType uint32 UserParamNum; }; - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + void serial(NLMISC::IStream &f) { f.serialEnum(InputType); switch(InputType) @@ -124,7 +124,7 @@ public: } /// serialisation of the object. Derivers MUST call this, (if they use the attribute of this class at least) - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + virtual void serial(NLMISC::IStream &f) { f.serialVersion(1); f.serial(_NbCycles); diff --git a/code/nel/include/nel/3d/ps_attrib_maker_bin_op.h b/code/nel/include/nel/3d/ps_attrib_maker_bin_op.h index f59d9c4e4..597b47457 100644 --- a/code/nel/include/nel/3d/ps_attrib_maker_bin_op.h +++ b/code/nel/include/nel/3d/ps_attrib_maker_bin_op.h @@ -103,7 +103,7 @@ public: uint32 srcStep = (1 << 16) ) const; - virtual void serial (NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial (NLMISC::IStream &f); virtual void deleteElement (uint32 index); virtual void newElement (const CPSEmitterInfo &info); virtual void resize (uint32 capacity, uint32 nbPresentElements); diff --git a/code/nel/include/nel/3d/ps_attrib_maker_bin_op_inline.h b/code/nel/include/nel/3d/ps_attrib_maker_bin_op_inline.h index 339a52e7f..00d675e4e 100644 --- a/code/nel/include/nel/3d/ps_attrib_maker_bin_op_inline.h +++ b/code/nel/include/nel/3d/ps_attrib_maker_bin_op_inline.h @@ -729,7 +729,7 @@ inline void CPSAttribMakerBinOp::makeN(CPSLocated *loc, //================================================================================================================= template -inline void CPSAttribMakerBinOp::serial (NLMISC::IStream &f) throw(NLMISC::EStream) +inline void CPSAttribMakerBinOp::serial (NLMISC::IStream &f) { if (f.isReading()) { diff --git a/code/nel/include/nel/3d/ps_attrib_maker_helper.h b/code/nel/include/nel/3d/ps_attrib_maker_helper.h index 73ab32a31..2a4f243b6 100644 --- a/code/nel/include/nel/3d/ps_attrib_maker_helper.h +++ b/code/nel/include/nel/3d/ps_attrib_maker_helper.h @@ -96,7 +96,7 @@ template class CPSAttribMakerT : public CPSAttribMaker /// serialization of the object - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + virtual void serial(NLMISC::IStream &f) { sint ver = f.serialVersion(2); CPSAttribMaker::serial(f); @@ -1624,7 +1624,7 @@ public: } /// serialisation of the object. Derivers MUST call this, (if they use the attribute of this class at least) - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + virtual void serial(NLMISC::IStream &f) { f.serialVersion(1); @@ -1744,7 +1744,7 @@ public: _MaxValue = other._MaxValue; } // serial. Should update min / max when reading - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); virtual uint32 getMinValue(void) const { return _MinValue; } virtual uint32 getMaxValue(void) const { return _MaxValue; } virtual void newElement(const CPSEmitterInfo &info); @@ -1767,7 +1767,7 @@ public: _MaxValue = other._MaxValue; } // serial. Should update min / max when reading - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); virtual sint32 getMinValue(void) const { return _MinValue; } virtual sint32 getMaxValue(void) const { return _MaxValue; } virtual void newElement(const CPSEmitterInfo &info); @@ -1790,7 +1790,7 @@ public: _MaxValue = other._MaxValue; } // serial. Should update min / max when reading - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); virtual float getMinValue(void) const { return _MinValue; } virtual float getMaxValue(void) const { return _MaxValue; } virtual void newElement(const CPSEmitterInfo &info); diff --git a/code/nel/include/nel/3d/ps_attrib_maker_template.h b/code/nel/include/nel/3d/ps_attrib_maker_template.h index c41931ab3..86213880c 100644 --- a/code/nel/include/nel/3d/ps_attrib_maker_template.h +++ b/code/nel/include/nel/3d/ps_attrib_maker_template.h @@ -93,7 +93,7 @@ public: CPSValueBlendFunc() {} /// serialization - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + void serial(NLMISC::IStream &f) { f.serialVersion(1); f.serial(_StartValue, _EndValue); @@ -228,7 +228,7 @@ public: CPSValueBlendSampleFunc() {} /// serialization - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + void serial(NLMISC::IStream &f) { f.serialVersion(1); if (f.isReading()) @@ -353,7 +353,7 @@ public: } /// serialization - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); T getMaxValue(void) const @@ -493,7 +493,7 @@ void CPSValueGradientFunc::setValuesUnpacked(const T *valueTab, uint32 numVal template -void CPSValueGradientFunc::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSValueGradientFunc::serial(NLMISC::IStream &f) { f.serialVersion(1); f.serial(_NbStages); diff --git a/code/nel/include/nel/3d/ps_color.h b/code/nel/include/nel/3d/ps_color.h index d05d9cf11..1be8fb329 100644 --- a/code/nel/include/nel/3d/ps_color.h +++ b/code/nel/include/nel/3d/ps_color.h @@ -66,7 +66,7 @@ public: { CPSValueBlendFunc::setValues(convertVBColor(startValue, _ColorType), convertVBColor(endValue, _ColorType)); } - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + void serial(NLMISC::IStream &f) { setColorType(CVertexBuffer::TRGBA); CPSValueBlendFunc::serial(f); @@ -100,7 +100,7 @@ public: { CPSValueBlendSampleFunc::setValues(convertVBColor(startValue, _ColorType), convertVBColor(endValue, _ColorType)); } - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + void serial(NLMISC::IStream &f) { setColorType(CVertexBuffer::TRGBA); CPSValueBlendSampleFunc::serial(f); @@ -124,7 +124,7 @@ public: NLMISC::CRGBA getValue(uint index) const; void setValues(const NLMISC::CRGBA *valueTab, uint32 numValues, uint32 nbStages); void setValuesUnpacked(const NLMISC::CRGBA *valueTab, uint32 numValues, uint32 nbStages); - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + void serial(NLMISC::IStream &f) { setColorType(CVertexBuffer::TRGBA); CPSValueGradientFunc::serial(f); @@ -153,7 +153,7 @@ public: this->_F.setColorType(colorType); } // serialisation should always be done in RGBA mode, so enforce that - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + virtual void serial(NLMISC::IStream &f) { setColorType(CVertexBuffer::TRGBA); CPSAttribMakerT::serial(f); @@ -229,7 +229,7 @@ public: virtual void setColorType(CVertexBuffer::TVertexColorType colorType); virtual void setDefaultValue(NLMISC::CRGBA defaultValue); virtual NLMISC::CRGBA getDefaultValue(void) const; - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); protected: CVertexBuffer::TVertexColorType _ColorType; }; @@ -244,7 +244,7 @@ public: NLMISC_DECLARE_CLASS(CPSColorBinOp); CPSAttribMakerBase *clone() const { return new CPSColorBinOp(*this); } virtual void setColorType(CVertexBuffer::TVertexColorType colorType); - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); }; diff --git a/code/nel/include/nel/3d/ps_dot.h b/code/nel/include/nel/3d/ps_dot.h index d5201ab3b..2bdb7603a 100644 --- a/code/nel/include/nel/3d/ps_dot.h +++ b/code/nel/include/nel/3d/ps_dot.h @@ -46,7 +46,7 @@ public: NLMISC_DECLARE_CLASS(CPSDot); ///serialisation - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); /// return true if there are transparent faces in the object virtual bool hasTransparentFaces(void); diff --git a/code/nel/include/nel/3d/ps_emitter.h b/code/nel/include/nel/3d/ps_emitter.h index 7170be75a..b8d82bb45 100644 --- a/code/nel/include/nel/3d/ps_emitter.h +++ b/code/nel/include/nel/3d/ps_emitter.h @@ -171,7 +171,7 @@ public: const CPSAttribMaker *getGenNbScheme(void) const { return _GenNbScheme; } /// Serialization - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); ///\name Speed vector options //@{ @@ -424,7 +424,7 @@ class CPSModulatedEmitter bool useEmitteeSpeedScheme(void) const { return _EmitteeSpeedScheme != NULL; } /// serialization - void serialEmitteeSpeedScheme(NLMISC::IStream &f) throw(NLMISC::EStream); + void serialEmitteeSpeedScheme(NLMISC::IStream &f); protected: @@ -470,7 +470,7 @@ public: } /// Serialisation - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CPSEmitterDirectionnal); @@ -506,7 +506,7 @@ class CPSRadialEmitter : public CPSEmitterDirectionnal if (CParticleSystem::getSerializeIdentifierFlag()) _Name = std::string("RadialEmitter"); } /// Serialisation - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CPSRadialEmitter); virtual void emit(const NLMISC::CVector &srcPos, uint32 index, NLMISC::CVector &pos, NLMISC::CVector &speed); }; @@ -527,7 +527,7 @@ public: } /// Serialisation - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CPSEmitterOmni); @@ -561,7 +561,7 @@ class CPSEmitterRectangle : public CPSEmitter, public CPSModulatedEmitter, publi } /// Serialisation - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CPSEmitterRectangle); @@ -636,7 +636,7 @@ public: } /// Serialisation - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CPSEmitterConic); @@ -675,7 +675,7 @@ public: } /// Serialisation - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CPSSphericalEmitter); diff --git a/code/nel/include/nel/3d/ps_face.h b/code/nel/include/nel/3d/ps_face.h index b46299eb1..b62a9d50b 100644 --- a/code/nel/include/nel/3d/ps_face.h +++ b/code/nel/include/nel/3d/ps_face.h @@ -69,7 +69,7 @@ public: */ CPSFace(CSmartPtr tex = NULL); - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CPSFace); /** Tells that all faces are turning in the same manner, and only have a rotationnal bias diff --git a/code/nel/include/nel/3d/ps_face_look_at.h b/code/nel/include/nel/3d/ps_face_look_at.h index 3ae6a59e3..1d9b38a36 100644 --- a/code/nel/include/nel/3d/ps_face_look_at.h +++ b/code/nel/include/nel/3d/ps_face_look_at.h @@ -40,7 +40,7 @@ public: */ CPSFaceLookAt(CSmartPtr tex = NULL); - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CPSFaceLookAt); diff --git a/code/nel/include/nel/3d/ps_fan_light.h b/code/nel/include/nel/3d/ps_fan_light.h index 19f5baaa5..1de8beaa9 100644 --- a/code/nel/include/nel/3d/ps_fan_light.h +++ b/code/nel/include/nel/3d/ps_fan_light.h @@ -47,7 +47,7 @@ public: CPSFanLight(uint32 nbFans = 7); /// Dtor ~CPSFanLight(); - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); //@} // Set the number of fans used for drawing (minimum is 3, maximum is 128) diff --git a/code/nel/include/nel/3d/ps_float.h b/code/nel/include/nel/3d/ps_float.h index da8978af1..be5044d2d 100644 --- a/code/nel/include/nel/3d/ps_float.h +++ b/code/nel/include/nel/3d/ps_float.h @@ -104,7 +104,7 @@ class CPSFloatCurveFunctor CCtrlPoint(float date, float value) : Date(date), Value(value) { nlassert(Date >= 0 && Date <= 1); } float Date; float Value; - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + void serial(NLMISC::IStream &f) { f.serial(Date, Value); } @@ -166,7 +166,7 @@ class CPSFloatCurveFunctor float getValue(float date) const; /// serialization - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); float getMinValue() const { return _MinValue; } float getMaxValue() const { return _MaxValue; } diff --git a/code/nel/include/nel/3d/ps_force.h b/code/nel/include/nel/3d/ps_force.h index e93c21361..14be72150 100644 --- a/code/nel/include/nel/3d/ps_force.h +++ b/code/nel/include/nel/3d/ps_force.h @@ -70,7 +70,7 @@ public: virtual void show() = 0; /// Serial the force definition. MUST be called by deriver during their serialisation - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); /// check whether this force is integrable over time. The default is false virtual bool isIntegrable(void) const { return false; } @@ -175,7 +175,7 @@ public: /// get the attribute maker for a non constant intensity CPSAttribMaker *getIntensityScheme(void) { return _IntensityScheme; } const CPSAttribMaker *getIntensityScheme(void) const { return _IntensityScheme; } - void serialForceIntensity(NLMISC::IStream &f) throw(NLMISC::EStream); + void serialForceIntensity(NLMISC::IStream &f); protected: @@ -209,7 +209,7 @@ protected: class CPSForceIntensityHelper : public CPSForce, public CPSForceIntensity { public: - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) ; + void serial(NLMISC::IStream &f); protected: virtual CPSLocated *getForceIntensityOwner(void) { return _Owner; } @@ -241,7 +241,7 @@ protected: * * // you can provide a serialization method. Note that that if the functor parameters are set before each use, * // it useless to serial something ... - * void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + * void serial(NLMISC::IStream &f) * * protected: * ... @@ -275,7 +275,7 @@ public: /// serialization - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + virtual void serial(NLMISC::IStream &f) { f.serialVersion(1); CPSForce::serial(f); @@ -354,7 +354,7 @@ class CPSDirectionnalForce : public CPSForceIntensityHelper, public CPSDirection } /// serialization - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CPSDirectionnalForce); @@ -397,7 +397,7 @@ public: } /// serialization - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CPSGravity); @@ -443,7 +443,7 @@ public: } /// serialization - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CPSCentralGravity); @@ -464,7 +464,7 @@ public: /// serialization - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); /// Compute the force on the targets @@ -498,7 +498,7 @@ public: speed -= (CParticleSystem::EllapsedTime * _K * invMass * speed); } - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + virtual void serial(NLMISC::IStream &f) { f.serialVersion(1); // we don't save intensity info : it is saved by the owning object (and set before each use of this functor) @@ -539,7 +539,7 @@ public: NLMISC_DECLARE_CLASS(CPSFluidFriction) - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + virtual void serial(NLMISC::IStream &f) { f.serialVersion(1); CIsotropicForceT::serial(f); @@ -571,7 +571,7 @@ public: NLMISC_DECLARE_CLASS(CPSBrownianForce) - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); /// We provide a kind of integration on a predefined sequence virtual bool isIntegrable(void) const; @@ -648,7 +648,7 @@ struct CPSTurbulForceFunc */ } - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + virtual void serial(NLMISC::IStream &f) { f.serialVersion(1); f.serial(_Scale, _NumOctaves); @@ -686,7 +686,7 @@ public: NLMISC_DECLARE_CLASS(CPSTurbul) - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + virtual void serial(NLMISC::IStream &f) { f.serialVersion(1); CIsotropicForceT::serial(f); @@ -758,7 +758,7 @@ public: // serialization - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); @@ -801,7 +801,7 @@ class CPSMagneticForce : public CPSDirectionnalForce } virtual void computeForces(CPSLocated &target); /// serialization - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CPSMagneticForce); }; diff --git a/code/nel/include/nel/3d/ps_light.h b/code/nel/include/nel/3d/ps_light.h index 31e159ae1..016dddaf9 100644 --- a/code/nel/include/nel/3d/ps_light.h +++ b/code/nel/include/nel/3d/ps_light.h @@ -42,7 +42,7 @@ public: ~CPSLight(); NLMISC_DECLARE_CLASS(CPSLight); /// Serialisation. Derivers must override this, and call their parent version - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); //@} virtual uint32 getType(void) const; virtual uint32 getPriority(void) const { return 600; } diff --git a/code/nel/include/nel/3d/ps_located.h b/code/nel/include/nel/3d/ps_located.h index 4245c5c81..e8bd62a20 100644 --- a/code/nel/include/nel/3d/ps_located.h +++ b/code/nel/include/nel/3d/ps_located.h @@ -356,7 +356,7 @@ public: void resize(uint32 newSize); /// serialization - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); /// Shortcut to get an instance of the 3d driver IDriver *getDriver() const; @@ -730,7 +730,7 @@ public: /// ctor CPSLocatedBindable(); /// serialization - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); /** this should be called before to delete any bindable inserted in a system, but this is done * by the system, so you should never need calling it. This has been introduced because calls in dtor are not polymorphic * to derived class (which are already destroyed anyway), and some infos are needed in some dtor. The default behaviour does nothing @@ -1010,7 +1010,7 @@ public: */ virtual void releaseTargetRsc(CPSLocated * /* target */) {} /// Seralization, must be called by derivers - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); /// Finalize this object : the default is to call releaseTargetRsc on targets virtual void finalize(void); virtual ~CPSTargetLocatedBindable(); diff --git a/code/nel/include/nel/3d/ps_mesh.h b/code/nel/include/nel/3d/ps_mesh.h index 6863903f9..7eef01012 100644 --- a/code/nel/include/nel/3d/ps_mesh.h +++ b/code/nel/include/nel/3d/ps_mesh.h @@ -82,7 +82,7 @@ public: std::string getShape(void) const { return _Shape; } /// serialisation. Derivers must override this, and call their parent version - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); virtual ~CPSMesh(); @@ -271,7 +271,7 @@ public: /// serialisation. Derivers must override this, and call their parent version - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CPSConstraintMesh); @@ -334,7 +334,7 @@ public: float WRotSpeed; /* = 0 */ float WRotAccel; /* = 0 */ CGlobalTexAnim(); - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); /// Build a texture matrix from a date and this obj. void buildMatrix(TAnimationTime date, NLMISC::CMatrix &dest); }; @@ -587,7 +587,7 @@ protected: struct CGlobalTexAnims { CGlobalTexAnim Anims[IDRV_MAT_MAXTEXTURES]; - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); }; typedef CUniquePtr PGlobalTexAnims; diff --git a/code/nel/include/nel/3d/ps_particle_basic.h b/code/nel/include/nel/3d/ps_particle_basic.h index 3674e6d9c..c7bdc242a 100644 --- a/code/nel/include/nel/3d/ps_particle_basic.h +++ b/code/nel/include/nel/3d/ps_particle_basic.h @@ -107,7 +107,7 @@ public: virtual uint32 getNumWantedTris() const = 0; /// serialisation. Derivers must override this, and call their parent version - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + virtual void serial(NLMISC::IStream &f) { /// version 3 : global color lighting /// version 2 : auto-lod saved @@ -210,7 +210,7 @@ class CPSColoredParticle virtual ~CPSColoredParticle(); /// serialization. - void serialColorScheme(NLMISC::IStream &f) throw(NLMISC::EStream); + void serialColorScheme(NLMISC::IStream &f); protected: @@ -273,7 +273,7 @@ class CPSSizedParticle virtual ~CPSSizedParticle(); /// serialization. We choose a different name because of multiple-inheritance - void serialSizeScheme(NLMISC::IStream &f) throw(NLMISC::EStream); + void serialSizeScheme(NLMISC::IStream &f); protected: @@ -335,7 +335,7 @@ class CPSRotated2DParticle virtual ~CPSRotated2DParticle(); /// serialization. We choose a different name because of multiple-inheritance - void serialAngle2DScheme(NLMISC::IStream &f) throw(NLMISC::EStream); + void serialAngle2DScheme(NLMISC::IStream &f); @@ -453,7 +453,7 @@ class CPSTexturedParticle virtual ~CPSTexturedParticle(); /// serialization. We choose a different name because of multiple-inheritance - void serialTextureScheme(NLMISC::IStream &f) throw(NLMISC::EStream); + void serialTextureScheme(NLMISC::IStream &f); void enumTexs(std::vector > &dest); @@ -576,7 +576,7 @@ public: } /// serial this object - void serialMultiTex(NLMISC::IStream &f) throw(NLMISC::EStream); + void serialMultiTex(NLMISC::IStream &f); /** setup a material from this object and a primary texture * drv is used to check the device caps. @@ -683,7 +683,7 @@ class CPSRotated3DPlaneParticle virtual ~CPSRotated3DPlaneParticle(); /// serialization. We choose a different name because of multiple-inheritance - void serialPlaneBasisScheme(NLMISC::IStream &f) throw(NLMISC::EStream); + void serialPlaneBasisScheme(NLMISC::IStream &f); protected: /// if this is false, constant size will be used instead of a scheme @@ -806,7 +806,7 @@ public: enum TBlendingMode { add, modulate, alphaBlend, alphaTest }; /// serialization (not named 'serial' because it will be used via multiple-inheritance) - void serialMaterial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serialMaterial(NLMISC::IStream &f); /// set the blending mode. The default is ass void setBlendingMode(CPSMaterial::TBlendingMode mode); diff --git a/code/nel/include/nel/3d/ps_plane_basis.h b/code/nel/include/nel/3d/ps_plane_basis.h index 41882e148..3a36876f7 100644 --- a/code/nel/include/nel/3d/ps_plane_basis.h +++ b/code/nel/include/nel/3d/ps_plane_basis.h @@ -66,7 +66,7 @@ struct CPlaneBasis } - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + void serial(NLMISC::IStream &f) { f.serial(X, Y) ; } diff --git a/code/nel/include/nel/3d/ps_plane_basis_maker.h b/code/nel/include/nel/3d/ps_plane_basis_maker.h index 54770c9c9..e798c9885 100644 --- a/code/nel/include/nel/3d/ps_plane_basis_maker.h +++ b/code/nel/include/nel/3d/ps_plane_basis_maker.h @@ -128,7 +128,7 @@ class CPSPlaneBasisFollowSpeed : public CPSAttribMaker NLMISC_DECLARE_CLASS(CPSPlaneBasisFollowSpeed); /// serialization - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + virtual void serial(NLMISC::IStream &f) { // version 2 : added projection plane // version 1 : nothing to save here @@ -192,7 +192,7 @@ public: /// get the number of samples for the rotation uint32 getNumSamples(void) const; /// serial this object - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); protected: CPSVector::V _PBTab; uint32 _NbSamples; diff --git a/code/nel/include/nel/3d/ps_quad.h b/code/nel/include/nel/3d/ps_quad.h index 000ff32cc..76e9562e2 100644 --- a/code/nel/include/nel/3d/ps_quad.h +++ b/code/nel/include/nel/3d/ps_quad.h @@ -114,7 +114,7 @@ protected: void updateVbColNUVForRender(CVertexBuffer &vb, uint32 startIndex, uint32 numQuad, uint32 srcStep, IDriver &drv); /// DERIVERS MUST CALL this - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); virtual CPSLocated *getColorOwner(void) { return _Owner; } virtual CPSLocated *getSizeOwner(void) { return _Owner; } virtual CPSLocated *getTextureIndexOwner(void) { return _Owner; } diff --git a/code/nel/include/nel/3d/ps_ribbon.h b/code/nel/include/nel/3d/ps_ribbon.h index ccda62021..5383a1b4b 100644 --- a/code/nel/include/nel/3d/ps_ribbon.h +++ b/code/nel/include/nel/3d/ps_ribbon.h @@ -55,7 +55,7 @@ public: /// dtor ~CPSRibbon(); /// serialisation. Derivers must override this, and call their parent version - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); // NLMISC_DECLARE_CLASS(CPSRibbon); ///@} diff --git a/code/nel/include/nel/3d/ps_ribbon_base.h b/code/nel/include/nel/3d/ps_ribbon_base.h index ea3443060..5670a2d31 100644 --- a/code/nel/include/nel/3d/ps_ribbon_base.h +++ b/code/nel/include/nel/3d/ps_ribbon_base.h @@ -52,7 +52,7 @@ public: ///@{ CPSRibbonBase(); /// serialisation. Derivers must override this, and call their parent version - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); ///@} ///\name Behaviour diff --git a/code/nel/include/nel/3d/ps_ribbon_look_at.h b/code/nel/include/nel/3d/ps_ribbon_look_at.h index 2494fe04c..6da38694b 100644 --- a/code/nel/include/nel/3d/ps_ribbon_look_at.h +++ b/code/nel/include/nel/3d/ps_ribbon_look_at.h @@ -38,7 +38,7 @@ public: /// dtor ~CPSRibbonLookAt(); /// serialisation. Derivers must override this, and call their parent version - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); // NLMISC_DECLARE_CLASS(CPSRibbonLookAt); ///@} diff --git a/code/nel/include/nel/3d/ps_shockwave.h b/code/nel/include/nel/3d/ps_shockwave.h index b8329a239..54774c58f 100644 --- a/code/nel/include/nel/3d/ps_shockwave.h +++ b/code/nel/include/nel/3d/ps_shockwave.h @@ -54,7 +54,7 @@ public: float getRadiusCut(void) const { return _RadiusCut; } /// serialisation. Derivers must override this, and call their parent version - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CPSShockWave); diff --git a/code/nel/include/nel/3d/ps_sound.h b/code/nel/include/nel/3d/ps_sound.h index af5a7cc94..d1c990770 100644 --- a/code/nel/include/nel/3d/ps_sound.h +++ b/code/nel/include/nel/3d/ps_sound.h @@ -50,7 +50,7 @@ public: /// dtor ~CPSSound(); /// serialisation. Derivers must override this, and call their parent version - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); //@} /// return this bindable type diff --git a/code/nel/include/nel/3d/ps_tail_dot.h b/code/nel/include/nel/3d/ps_tail_dot.h index 3caf5fa96..a2aae6e83 100644 --- a/code/nel/include/nel/3d/ps_tail_dot.h +++ b/code/nel/include/nel/3d/ps_tail_dot.h @@ -37,7 +37,7 @@ public: /// dtor ~CPSTailDot(); /// serialisation. Derivers must override this, and call their parent version - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); // NLMISC_DECLARE_CLASS(CPSTailDot); ///@} diff --git a/code/nel/include/nel/3d/ps_zone.h b/code/nel/include/nel/3d/ps_zone.h index 0e0ff7274..032d5db62 100644 --- a/code/nel/include/nel/3d/ps_zone.h +++ b/code/nel/include/nel/3d/ps_zone.h @@ -82,7 +82,7 @@ public: /// serialization, DERIVER must override this, and call the parent version - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); /** Inherited from CPSTargetLocatedBindable. It's called when one of the targets has been detroyed or detached @@ -155,7 +155,7 @@ class CPSZonePlane : public CPSZone, public IPSMover virtual NLMISC::CVector getNormal(uint32 index); virtual void setNormal(uint32 index, NLMISC::CVector n); - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); protected: TPSAttribVector _Normal; @@ -176,7 +176,7 @@ struct CRadiusPair { // the adius, and the square radius float R, R2; - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + void serial(NLMISC::IStream &f) { f.serial(R, R2); } @@ -205,7 +205,7 @@ class CPSZoneSphere : public CPSZone, public IPSMover - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); // inherited from IPSMover @@ -257,7 +257,7 @@ class CPSZoneDisc : public CPSZone, public IPSMover virtual NLMISC::CVector getNormal(uint32 index); virtual void setNormal(uint32 index, NLMISC::CVector n); - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); @@ -303,7 +303,7 @@ class CPSZoneCylinder : public CPSZone, public IPSMover virtual NLMISC::CVector getScale(uint32 k) const; // serialization - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); @@ -350,7 +350,7 @@ class CPSZoneRectangle : public CPSZone, public IPSMover // serialization - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); // inherited from IPSMover virtual bool supportUniformScaling(void) const { return true; } diff --git a/code/nel/include/nel/3d/seg_remanence_shape.h b/code/nel/include/nel/3d/seg_remanence_shape.h index 80d54b6ca..2f8a159ff 100644 --- a/code/nel/include/nel/3d/seg_remanence_shape.h +++ b/code/nel/include/nel/3d/seg_remanence_shape.h @@ -70,7 +70,7 @@ public: // assignement CSegRemanenceShape &operator = (const CSegRemanenceShape &other); - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CSegRemanenceShape); //@} diff --git a/code/nel/include/nel/3d/shape.h b/code/nel/include/nel/3d/shape.h index a8038e593..ec359aa7f 100644 --- a/code/nel/include/nel/3d/shape.h +++ b/code/nel/include/nel/3d/shape.h @@ -201,7 +201,7 @@ public: IShape* getShapePointer () const; /// serial the shape. - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); private: IShape* _Shape; }; diff --git a/code/nel/include/nel/3d/skeleton_shape.h b/code/nel/include/nel/3d/skeleton_shape.h index a47be7f17..359a51fd3 100644 --- a/code/nel/include/nel/3d/skeleton_shape.h +++ b/code/nel/include/nel/3d/skeleton_shape.h @@ -49,7 +49,7 @@ public: std::vector ActiveBones; public: - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); }; public: @@ -94,7 +94,7 @@ public: virtual float getNumTriangles (float distance); /// serial this skeletonshape. - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CSkeletonShape); /// flush textures used by this shape. diff --git a/code/nel/include/nel/3d/texture.h b/code/nel/include/nel/3d/texture.h index 88ef247e6..bd71a00fd 100644 --- a/code/nel/include/nel/3d/texture.h +++ b/code/nel/include/nel/3d/texture.h @@ -359,7 +359,7 @@ public: virtual bool allowDegradation() const { return false; } /// serial ITexture basic infos (clamp ...). - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); /** Select a texture among several other (if this texture is a set of texture such as CTextureMultiFile) * The default does nothing diff --git a/code/nel/include/nel/3d/texture_blend.h b/code/nel/include/nel/3d/texture_blend.h index 7a910d91e..5dcc7c6ea 100644 --- a/code/nel/include/nel/3d/texture_blend.h +++ b/code/nel/include/nel/3d/texture_blend.h @@ -74,7 +74,7 @@ public: virtual void release(); // serial this texture datas - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); private: uint16 _BlendFactor; diff --git a/code/nel/include/nel/3d/texture_bump.h b/code/nel/include/nel/3d/texture_bump.h index 7e4a099c9..1fb6152de 100644 --- a/code/nel/include/nel/3d/texture_bump.h +++ b/code/nel/include/nel/3d/texture_bump.h @@ -47,7 +47,7 @@ public: const ITexture *getHeightMap() const { return _HeightMap; }; // serial this texture datas - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); virtual bool supportSharing() const; diff --git a/code/nel/include/nel/3d/texture_cube.h b/code/nel/include/nel/3d/texture_cube.h index 979defa1c..4958f6628 100644 --- a/code/nel/include/nel/3d/texture_cube.h +++ b/code/nel/include/nel/3d/texture_cube.h @@ -77,7 +77,7 @@ public: virtual bool isTextureCube() const { return true; } /// Save the texture file name. - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CTextureCube); /// If the face support multiple texture (such has CTextureMultiFile), this allow to select the active set diff --git a/code/nel/include/nel/3d/texture_dlm.h b/code/nel/include/nel/3d/texture_dlm.h index 18cf125a0..0c16d95f6 100644 --- a/code/nel/include/nel/3d/texture_dlm.h +++ b/code/nel/include/nel/3d/texture_dlm.h @@ -81,7 +81,7 @@ public: /// TextureDLM are system. Do not need to serialize them... // default ctor is required for compilation with NLMISC_DECLARE_CLASS, but never called... CTextureDLM() {nlstop;} - virtual void serial(NLMISC::IStream &/* f */) throw(NLMISC::EStream) {nlstop;} + virtual void serial(NLMISC::IStream &/* f */) {nlstop;} NLMISC_DECLARE_CLASS(CTextureDLM); diff --git a/code/nel/include/nel/3d/texture_emboss.h b/code/nel/include/nel/3d/texture_emboss.h index cdab6d648..fed99f52a 100644 --- a/code/nel/include/nel/3d/texture_emboss.h +++ b/code/nel/include/nel/3d/texture_emboss.h @@ -46,7 +46,7 @@ public: const ITexture *getHeightMap() const { return _HeightMap; }; // serial this texture datas - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); virtual bool supportSharing() const; virtual std::string getShareName() const; // diff --git a/code/nel/include/nel/3d/texture_far.h b/code/nel/include/nel/3d/texture_far.h index a55308b19..6fdb59f30 100644 --- a/code/nel/include/nel/3d/texture_far.h +++ b/code/nel/include/nel/3d/texture_far.h @@ -185,7 +185,7 @@ private: void rebuildPatch (const CVector2s texturePos, const CPatchIdent &pid); /// From IStreamable - virtual void serial(NLMISC::IStream &/* f */) throw(NLMISC::EStream) {} + virtual void serial(NLMISC::IStream &/* f */) {} // Some static buffers static NLMISC::CRGBA _LightmapExpanded[]; diff --git a/code/nel/include/nel/3d/texture_file.h b/code/nel/include/nel/3d/texture_file.h index c758b1d6c..6f3620f47 100644 --- a/code/nel/include/nel/3d/texture_file.h +++ b/code/nel/include/nel/3d/texture_file.h @@ -122,7 +122,7 @@ public: void doGenerate(bool async = false); /// Save the texture file name. - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CTextureFile); diff --git a/code/nel/include/nel/3d/texture_font.h b/code/nel/include/nel/3d/texture_font.h index 20353f236..e743bb137 100644 --- a/code/nel/include/nel/3d/texture_font.h +++ b/code/nel/include/nel/3d/texture_font.h @@ -112,7 +112,7 @@ private: /// Todo: serialize a font texture. public: - virtual void serial(NLMISC::IStream &/* f */) throw(NLMISC::EStream) {nlstop;} + virtual void serial(NLMISC::IStream &/* f */) {nlstop;} NLMISC_DECLARE_CLASS(CTextureFont); }; diff --git a/code/nel/include/nel/3d/texture_grouped.h b/code/nel/include/nel/3d/texture_grouped.h index 247dd455a..f6f9515a0 100644 --- a/code/nel/include/nel/3d/texture_grouped.h +++ b/code/nel/include/nel/3d/texture_grouped.h @@ -111,7 +111,7 @@ public: void doGenerate(bool async = false); /// serialization - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); /// a group of 4 uvs diff --git a/code/nel/include/nel/3d/texture_mem.h b/code/nel/include/nel/3d/texture_mem.h index 01ea393f1..d28218151 100644 --- a/code/nel/include/nel/3d/texture_mem.h +++ b/code/nel/include/nel/3d/texture_mem.h @@ -160,7 +160,7 @@ public: void setAllowDegradation(bool allow); /// Todo: serialize a mem texture. - virtual void serial(NLMISC::IStream &/* f */) throw(NLMISC::EStream) {nlstop;} + virtual void serial(NLMISC::IStream &/* f */) {nlstop;} NLMISC_DECLARE_CLASS(CTextureMem); /** This create a white square texture of 1x1 diff --git a/code/nel/include/nel/3d/texture_multi_file.h b/code/nel/include/nel/3d/texture_multi_file.h index 37549b997..a32207995 100644 --- a/code/nel/include/nel/3d/texture_multi_file.h +++ b/code/nel/include/nel/3d/texture_multi_file.h @@ -70,7 +70,7 @@ public: /// Generate the current selected texture, looking in CPath if necessary. virtual void doGenerate(bool async = false); /// Serial this object - virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + virtual void serial(NLMISC::IStream &f); NLMISC_DECLARE_CLASS(CTextureMultiFile); private: diff --git a/code/nel/include/nel/3d/texture_near.h b/code/nel/include/nel/3d/texture_near.h index 5a124b53b..0c47ecec7 100644 --- a/code/nel/include/nel/3d/texture_near.h +++ b/code/nel/include/nel/3d/texture_near.h @@ -77,7 +77,7 @@ public: /// TextureNear are system. Do not need to serialize them... // default ctor is required for compilation with NLMISC_DECLARE_CLASS, but never called... CTextureNear() {nlstop;} - virtual void serial(NLMISC::IStream &/* f */) throw(NLMISC::EStream) {nlstop;} + virtual void serial(NLMISC::IStream &/* f */) {nlstop;} NLMISC_DECLARE_CLASS(CTextureNear); private: diff --git a/code/nel/include/nel/3d/tile_bank.h b/code/nel/include/nel/3d/tile_bank.h index 1205c5940..7d4eda3a7 100644 --- a/code/nel/include/nel/3d/tile_bank.h +++ b/code/nel/include/nel/3d/tile_bank.h @@ -77,7 +77,7 @@ public: { return (_Flags&NL3D_CTILE_FREE_FLAG)!=0; } - void serial(class NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); void setFileName (TBitmap bitmapType, const std::string& name) { // not free @@ -180,7 +180,7 @@ public: void clear(){ _TileSet.clear(); } - void serial(class NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); private: // internal use @@ -210,7 +210,7 @@ public: { return _Tile; } - void serial(class NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); private: sint32 _Tile; @@ -236,7 +236,7 @@ public: void doubleSize (); bool operator== (const CTileBorder& border) const; void operator= (const CTileBorder& border); - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); bool isSet() const { return _Set; @@ -416,7 +416,7 @@ public: { return _ChildName.find(name)!=_ChildName.end(); } - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); private: static TFlagBorder getComplementaryBorder (TFlagBorder border); @@ -629,7 +629,7 @@ public: /// Postfix tile vegetable desc void postfixTileVegetableDesc (const char *filename); - void serial(class NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); private: sint createTile (); void freeTile (int tileIndex); diff --git a/code/nel/include/nel/3d/tile_far_bank.h b/code/nel/include/nel/3d/tile_far_bank.h index 35c04be8b..52f380439 100644 --- a/code/nel/include/nel/3d/tile_far_bank.h +++ b/code/nel/include/nel/3d/tile_far_bank.h @@ -94,7 +94,7 @@ public: } /// Serial this tile - void serial (class NLMISC::IStream &f) throw(NLMISC::EStream); + void serial (NLMISC::IStream &f); private: /// RGBA Pixels vector @@ -141,7 +141,7 @@ public: } /// Serial this bank - void serial(class NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); /// The far tile vector std::vector _TileVector; diff --git a/code/nel/include/nel/3d/track.h b/code/nel/include/nel/3d/track.h index e3c88f800..1ef8a4f1e 100644 --- a/code/nel/include/nel/3d/track.h +++ b/code/nel/include/nel/3d/track.h @@ -166,7 +166,7 @@ public: /// Serial the template - virtual void serial (NLMISC::IStream& f) throw (NLMISC::EStream) + virtual void serial (NLMISC::IStream& f) { // Serial version (void)f.serialVersion (0); @@ -217,7 +217,7 @@ public: /// Serial the template - virtual void serial (NLMISC::IStream& f) throw (NLMISC::EStream) + virtual void serial (NLMISC::IStream& f) { // Serial version (void)f.serialVersion (0); diff --git a/code/nel/include/nel/3d/track_keyframer.h b/code/nel/include/nel/3d/track_keyframer.h index 6cfb6736a..c49e63404 100644 --- a/code/nel/include/nel/3d/track_keyframer.h +++ b/code/nel/include/nel/3d/track_keyframer.h @@ -237,7 +237,7 @@ public: /// Serial the template - virtual void serial (NLMISC::IStream& f) throw (NLMISC::EStream) + virtual void serial (NLMISC::IStream& f) { // Serial version (void)f.serialVersion (0); diff --git a/code/nel/include/nel/3d/water_height_map.h b/code/nel/include/nel/3d/water_height_map.h index dcd38d90d..003aaac53 100644 --- a/code/nel/include/nel/3d/water_height_map.h +++ b/code/nel/include/nel/3d/water_height_map.h @@ -168,7 +168,7 @@ public: sint64 Date; /// serial the pools data's - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); /// Set this pool name. void setName(const std::string &name) { _Name = name; } diff --git a/code/nel/include/nel/3d/water_pool_manager.h b/code/nel/include/nel/3d/water_pool_manager.h index 569b5d59a..c8a0885c9 100644 --- a/code/nel/include/nel/3d/water_pool_manager.h +++ b/code/nel/include/nel/3d/water_pool_manager.h @@ -97,7 +97,7 @@ public: /// serial the pools data's - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); private: friend class CWaterShape; diff --git a/code/nel/include/nel/3d/water_shape.h b/code/nel/include/nel/3d/water_shape.h index dc7f20426..633da8611 100644 --- a/code/nel/include/nel/3d/water_shape.h +++ b/code/nel/include/nel/3d/water_shape.h @@ -108,7 +108,7 @@ public: /// serial this shape - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); //@} @@ -299,7 +299,7 @@ public: /// serial this shape - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); //@} diff --git a/code/nel/include/nel/logic/logic_condition.h b/code/nel/include/nel/logic/logic_condition.h index bb2af30ce..30c9d7c08 100644 --- a/code/nel/include/nel/logic/logic_condition.h +++ b/code/nel/include/nel/logic/logic_condition.h @@ -79,7 +79,7 @@ public: /** * serial */ - //void serial(class NLMISC::IStream &f) throw(NLMISC::EStream); + //void serial(NLMISC::IStream &f); void write (xmlNodePtr node) const; void read (xmlNodePtr node); @@ -160,7 +160,7 @@ public: /** * serial */ - //void serial(class NLMISC::IStream &f) throw(NLMISC::EStream); + //void serial(NLMISC::IStream &f); void write (xmlNodePtr node) const; void read (xmlNodePtr node); @@ -239,7 +239,7 @@ public: /** * serial */ - //void serial(class NLMISC::IStream &f) throw(NLMISC::EStream); + //void serial(NLMISC::IStream &f); /** * Destructor @@ -323,7 +323,7 @@ public: /** * serial */ - //void serial(class NLMISC::IStream &f) throw(NLMISC::EStream); + //void serial(NLMISC::IStream &f); void write (xmlNodePtr node) const; void read (xmlNodePtr node); diff --git a/code/nel/include/nel/logic/logic_event.h b/code/nel/include/nel/logic/logic_event.h index 66c125260..9f15d2f34 100644 --- a/code/nel/include/nel/logic/logic_event.h +++ b/code/nel/include/nel/logic/logic_event.h @@ -79,7 +79,7 @@ public: /** * serial */ - //void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + //void serial(NLMISC::IStream &f); void write (xmlNodePtr node, const char *subName = "") const; void read (xmlNodePtr node, const char *subName = ""); @@ -122,7 +122,7 @@ public: /** * serial */ - //void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + //void serial(NLMISC::IStream &f); void write (xmlNodePtr node) const; void read (xmlNodePtr node); @@ -181,7 +181,7 @@ public: /** * serial */ - //void serial(class NLMISC::IStream &f) throw(NLMISC::EStream); + //void serial(NLMISC::IStream &f); void write (xmlNodePtr node) const; void read (xmlNodePtr node); diff --git a/code/nel/include/nel/logic/logic_state.h b/code/nel/include/nel/logic/logic_state.h index dd9678f13..75e8572ac 100644 --- a/code/nel/include/nel/logic/logic_state.h +++ b/code/nel/include/nel/logic/logic_state.h @@ -149,7 +149,7 @@ public: /** * serial */ - //void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + //void serial(NLMISC::IStream &f); void write (xmlNodePtr node) const; void read (xmlNodePtr node); diff --git a/code/nel/include/nel/logic/logic_state_machine.h b/code/nel/include/nel/logic/logic_state_machine.h index f976ad405..7e87890b7 100644 --- a/code/nel/include/nel/logic/logic_state_machine.h +++ b/code/nel/include/nel/logic/logic_state_machine.h @@ -182,7 +182,7 @@ public: /** * serial */ - //void serial( NLMISC::IStream &f ) throw(NLMISC::EStream); + //void serial( NLMISC::IStream &f ); /** * Display the variables diff --git a/code/nel/include/nel/logic/logic_variable.h b/code/nel/include/nel/logic/logic_variable.h index 8ccc0923e..f64a9e775 100644 --- a/code/nel/include/nel/logic/logic_variable.h +++ b/code/nel/include/nel/logic/logic_variable.h @@ -104,7 +104,7 @@ public: /** * serial */ - //virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + //virtual void serial(NLMISC::IStream &f); virtual void write (xmlNodePtr node) const; virtual void read (xmlNodePtr node); @@ -186,7 +186,7 @@ public: /** * serial */ - //void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + //void serial(NLMISC::IStream &f); virtual void write (xmlNodePtr node) const; virtual void read (xmlNodePtr node); diff --git a/code/nel/include/nel/misc/algo.h b/code/nel/include/nel/misc/algo.h index 72d9ae3ae..50493538f 100644 --- a/code/nel/include/nel/misc/algo.h +++ b/code/nel/include/nel/misc/algo.h @@ -211,6 +211,14 @@ bool strFindReplace(T &str, const char *strFind, const U &strReplace) return strFindReplace(str, tempStr, strReplace); } +template +T strFindReplaceAll(const T &str, const T &search, const T &replace) +{ + T ret = str; + while (strFindReplace(ret, search, replace)); + return ret; +} + // set flags in a bit set template inline void setFlags(T &dest, U mask, bool on) diff --git a/code/nel/include/nel/misc/array_2d.h b/code/nel/include/nel/misc/array_2d.h index e5492986d..3c65ffa4c 100644 --- a/code/nel/include/nel/misc/array_2d.h +++ b/code/nel/include/nel/misc/array_2d.h @@ -132,7 +132,7 @@ public: // See which parts of array will be discarded if the array is displaced by the given offset void getDiscardRects(sint moveOffsetX, sint moveOffsetY, std::vector &discardedRects); // - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); private: TArrayContainer _Array; uint _Width; @@ -157,7 +157,7 @@ void CArray2D::clear() //********************************************************************************* template -void CArray2D::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CArray2D::serial(NLMISC::IStream &f) { f.serialCont(_Array); uint32 width = _Width; diff --git a/code/nel/include/nel/misc/common.h b/code/nel/include/nel/misc/common.h index 4c2b38cca..eb70fce9e 100644 --- a/code/nel/include/nel/misc/common.h +++ b/code/nel/include/nel/misc/common.h @@ -233,6 +233,26 @@ char toLower ( const char ch ); // convert only one character std::string toUpper ( const std::string &str); void toUpper ( char *str); + +/** + * Convert to an hexadecimal std::string + */ +std::string toHexa(const uint8 &b); +std::string toHexa(const uint8 *data, uint size); +std::string toHexa(const std::string &str); +std::string toHexa(const char *str); + +/** +* Convert from an hexadecimal std::string +*/ +bool fromHexa(const std::string &hexa, uint8 &b); +bool fromHexa(const std::string &hexa, uint8 *data); +bool fromHexa(const std::string &hexa, std::string &str); +bool fromHexa(const char *hexa, uint8 &b); +bool fromHexa(const char *hexa, uint8 *data); +bool fromHexa(const char *hexa, std::string &str); +bool fromHexa(const char hexa, uint8 &b); + // Remove all the characters <= 32 (tab, space, new line, return, vertical tab etc..) at the beginning and at the end of a string template T trim (const T &str) { @@ -394,6 +414,9 @@ std::string expandEnvironmentVariables(const std::string &s); bool explodeArguments(const std::string &str, std::vector &args); std::string joinArguments(const std::vector &args); +/// Escape an argument to not evaluate environment variables or special cases +std::string escapeArgument(const std::string &arg); + /// This function kills a program using his pid (on unix, it uses the kill() POSIX function) bool killProgram(uint32 pid); diff --git a/code/nel/include/nel/misc/entity_id.h b/code/nel/include/nel/misc/entity_id.h index 46561a512..8999b170a 100644 --- a/code/nel/include/nel/misc/entity_id.h +++ b/code/nel/include/nel/misc/entity_id.h @@ -450,8 +450,8 @@ public: } - void serial (NLMISC::IStream &f) throw (NLMISC::EStream) -// virtual void serial (NLMISC::IStream &f) throw (NLMISC::EStream) + void serial (NLMISC::IStream &f) +// virtual void serial (NLMISC::IStream &f) { if (f.isReading ()) { diff --git a/code/nel/include/nel/misc/fixed_size_allocator.h b/code/nel/include/nel/misc/fixed_size_allocator.h index ffc975250..643217f5d 100644 --- a/code/nel/include/nel/misc/fixed_size_allocator.h +++ b/code/nel/include/nel/misc/fixed_size_allocator.h @@ -53,7 +53,7 @@ public: uint getNumAllocatedBlocks() const { return _NumAlloc; } private: class CChunk; - + class NL_ALIGN(NL_DEFAULT_MEMORY_ALIGNMENT) CNode { public: diff --git a/code/nel/include/nel/misc/mouse_smoother.h b/code/nel/include/nel/misc/mouse_smoother.h index f909cde96..18d741996 100644 --- a/code/nel/include/nel/misc/mouse_smoother.h +++ b/code/nel/include/nel/misc/mouse_smoother.h @@ -46,7 +46,7 @@ public: double getSamplingPeriod() const { return _SamplingPeriod; } // Reset smoother. The next returned position will be the exact position of mouse (no smoothing with previous position is done) void reset(); - // \return trueif no sampling has occurred since last resetor construction + // \return true if no sampling has occurred since last resetor construction bool isReseted() const { return !_Init; } // Sample pos, and return smoothed position CVector2f samplePos(const CVector2f &wantedPos, double date); diff --git a/code/nel/include/nel/misc/polygon.h b/code/nel/include/nel/misc/polygon.h index a0183d20d..08889c26d 100644 --- a/code/nel/include/nel/misc/polygon.h +++ b/code/nel/include/nel/misc/polygon.h @@ -66,7 +66,7 @@ public: float computeArea() const; /// Serial this polygon - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); /** * Convert a concave polygon into a list of convex polygons using a 2d projection. @@ -156,7 +156,7 @@ public: void getBestTriplet(uint &index0, uint &index1, uint &index2); /// Serial this polygon - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); typedef std::pair TRaster; typedef std::vector TRasterVect; diff --git a/code/nel/include/nel/misc/rgba.h b/code/nel/include/nel/misc/rgba.h index e4fc6b61e..006b1f102 100644 --- a/code/nel/include/nel/misc/rgba.h +++ b/code/nel/include/nel/misc/rgba.h @@ -86,7 +86,7 @@ public: * Serialisation. * \param f Stream used for serialisation. */ - void serial (class NLMISC::IStream &f); + void serial (NLMISC::IStream &f); /** * Blend two colors. @@ -451,7 +451,7 @@ public: * Serialisation. * \param f Stream used for serialisation. */ - void serial(class NLMISC::IStream &f); + void serial(NLMISC::IStream &f); /** * Blend two colors. @@ -676,7 +676,7 @@ public: * Serialisation. * \param f Stream used for serialisation. */ - void serial(class NLMISC::IStream &f); + void serial(NLMISC::IStream &f); /** * Set colors. diff --git a/code/nel/include/nel/misc/sheet_id.h b/code/nel/include/nel/misc/sheet_id.h index 7a735d3a4..8db0470af 100644 --- a/code/nel/include/nel/misc/sheet_id.h +++ b/code/nel/include/nel/misc/sheet_id.h @@ -146,8 +146,8 @@ public : /** * Serial */ - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); - void serialString(NLMISC::IStream &f, const std::string &defaultType = "") throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); + void serialString(NLMISC::IStream &f, const std::string &defaultType = ""); /** * Display the list of valid sheet ids with their associated file names diff --git a/code/nel/src/3d/driver/opengl/driver_opengl.cpp b/code/nel/src/3d/driver/opengl/driver_opengl.cpp index 80b424cba..023997065 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl.cpp @@ -1195,11 +1195,11 @@ sint CDriverGL::getTotalVideoMemory() const if (_Extensions.ATIMeminfo) { - GLint memoryInKiB = 0; - glGetIntegerv(GL_TEXTURE_FREE_MEMORY_ATI, &memoryInKiB); + GLint params[4]; + glGetIntegerv(GL_TEXTURE_FREE_MEMORY_ATI, params); - nlinfo("3D: GL_TEXTURE_FREE_MEMORY_ATI returned %d KiB", memoryInKiB); - return memoryInKiB; + nlinfo("3D: GL_TEXTURE_FREE_MEMORY_ATI returned %d KiB", params[0]); + return params[0]; } #if defined(NL_OS_WINDOWS) 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 ecadaaac2..b3a3e5194 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp @@ -635,7 +635,7 @@ bool CDriverGL::renderRawQuads(CMaterial& mat, uint32 startIndex, uint32 numQuad 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 indices[QUAD_BATCH_SIZE * 6]; GLint *curr = indices; GLint *end = indices + 6 * numQuadsToDraw; uint32 vertexIndex = currIndex; diff --git a/code/nel/src/3d/driver/opengl/unix_event_emitter.cpp b/code/nel/src/3d/driver/opengl/unix_event_emitter.cpp index 898c9f001..a43a251a9 100644 --- a/code/nel/src/3d/driver/opengl/unix_event_emitter.cpp +++ b/code/nel/src/3d/driver/opengl/unix_event_emitter.cpp @@ -83,8 +83,6 @@ void CUnixEventEmitter::createIM() { #ifdef X_HAVE_UTF8_STRING - XModifierKeymap *g_mod_map = XGetModifierMapping(_dpy); - _im = XOpenIM(_dpy, NULL, NULL, NULL); if (_im == NULL) diff --git a/code/nel/src/3d/flare_shape.cpp b/code/nel/src/3d/flare_shape.cpp index e8f74dc4e..1c4b864cd 100644 --- a/code/nel/src/3d/flare_shape.cpp +++ b/code/nel/src/3d/flare_shape.cpp @@ -63,7 +63,7 @@ CFlareShape::CFlareShape() : _Color(NLMISC::CRGBA::White), // *************************************************************************************************************** -void CFlareShape::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CFlareShape::serial(NLMISC::IStream &f) { // Version 4 : - added occlusion test mesh, size reduction, angle modification when object is occluded // - added lookat mode for first flare diff --git a/code/nel/src/3d/font_generator.cpp b/code/nel/src/3d/font_generator.cpp index 0adf29418..f50b61c5b 100644 --- a/code/nel/src/3d/font_generator.cpp +++ b/code/nel/src/3d/font_generator.cpp @@ -271,7 +271,14 @@ void CFontGenerator::getSizes (ucchar c, uint32 size, uint32 &width, uint32 &hei error = FT_Load_Glyph (_Face, glyph_index, FT_LOAD_DEFAULT); if (error) { - nlerror ("FT_Load_Glyph() failed: %s", getFT2Error(error)); + // use fallback for glyph/character errors (composite char limit for example) + nlwarning ("FT_Load_Glyph() failed: %s", getFT2Error(error)); + + error = FT_Load_Glyph (_Face, 0, FT_LOAD_DEFAULT); + if (error) + { + nlerror("FT_Load_Glyph() fallback failed: %s", getFT2Error(error)); + } } // convert 24.6 fixed point into integer @@ -302,7 +309,14 @@ uint8 *CFontGenerator::getBitmap (ucchar c, uint32 size, bool embolden, bool obl error = FT_Load_Glyph (_Face, glyph_index, FT_LOAD_DEFAULT); if (error) { - nlerror ("FT_Load_Glyph() failed: %s", getFT2Error(error)); + // use fallback for glyph/character errors (composite char limit for example) + nlwarning ("FT_Load_Glyph() failed: %s", getFT2Error(error)); + + error = FT_Load_Glyph (_Face, 0, FT_LOAD_DEFAULT); + if (error) + { + nlerror("FT_Load_Glyph() fallback failed: %s", getFT2Error(error)); + } } if (size == 0) diff --git a/code/nel/src/3d/landscape.cpp b/code/nel/src/3d/landscape.cpp index 8112053d7..4b597fc2d 100644 --- a/code/nel/src/3d/landscape.cpp +++ b/code/nel/src/3d/landscape.cpp @@ -139,7 +139,7 @@ public: } // Dummy serial... - virtual void serial(NLMISC::IStream &/* f */) throw(NLMISC::EStream) {nlstop;} + virtual void serial(NLMISC::IStream &/* f */) { nlstop; } NLMISC_DECLARE_CLASS(CTextureCross); }; diff --git a/code/nel/src/3d/mesh.cpp b/code/nel/src/3d/mesh.cpp index cd3109733..51b07fdec 100644 --- a/code/nel/src/3d/mesh.cpp +++ b/code/nel/src/3d/mesh.cpp @@ -861,7 +861,7 @@ void CMeshGeom::renderSimpleWithMaterial(IDriver *drv, const CMatrix &worldMatri // *************************************************************************** -void CMeshGeom::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CMeshGeom::serial(NLMISC::IStream &f) { /* *********************************************** * WARNING: This Class/Method must be thread-safe (ctor/dtor/serial): no static access for instance @@ -2389,7 +2389,7 @@ CMesh::CCorner::CCorner() // *************************************************************************** -void CMesh::CCorner::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CMesh::CCorner::serial(NLMISC::IStream &f) { nlassert(0); // not used f.serial(Vertex); @@ -2400,7 +2400,7 @@ void CMesh::CCorner::serial(NLMISC::IStream &f) throw(NLMISC::EStream) } // *************************************************************************** -void CMesh::CFace::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CMesh::CFace::serial(NLMISC::IStream &f) { for(int i=0;i<3;++i) f.serial(Corner[i]); @@ -2409,7 +2409,7 @@ void CMesh::CFace::serial(NLMISC::IStream &f) throw(NLMISC::EStream) } // *************************************************************************** -void CMesh::CSkinWeight::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CMesh::CSkinWeight::serial(NLMISC::IStream &f) { for(int i=0;i *pBSFactor) } // *************************************************************************** -void CMeshMorpher::serial (NLMISC::IStream &f) throw(NLMISC::EStream) +void CMeshMorpher::serial (NLMISC::IStream &f) { /* *********************************************** * WARNING: This Class/Method must be thread-safe (ctor/dtor/serial): no static access for instance diff --git a/code/nel/src/3d/mesh_mrm.cpp b/code/nel/src/3d/mesh_mrm.cpp index 407d342b4..f31720f35 100644 --- a/code/nel/src/3d/mesh_mrm.cpp +++ b/code/nel/src/3d/mesh_mrm.cpp @@ -1604,7 +1604,7 @@ void CMeshMRMGeom::updateShiftedTriangleCache(CMeshMRMInstance *mi, sint curLodI // *************************************************************************** -void CMeshMRMGeom::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CMeshMRMGeom::serial(NLMISC::IStream &f) { // because of complexity, serial is separated in save / load. @@ -1618,7 +1618,7 @@ void CMeshMRMGeom::serial(NLMISC::IStream &f) throw(NLMISC::EStream) // *************************************************************************** -sint CMeshMRMGeom::loadHeader(NLMISC::IStream &f) throw(NLMISC::EStream) +sint CMeshMRMGeom::loadHeader(NLMISC::IStream &f) { /* Version 5: @@ -1748,7 +1748,7 @@ sint CMeshMRMGeom::loadHeader(NLMISC::IStream &f) throw(NLMISC::EStream) // *************************************************************************** -void CMeshMRMGeom::load(NLMISC::IStream &f) throw(NLMISC::EStream) +void CMeshMRMGeom::load(NLMISC::IStream &f) { // Load the header of the stream. // ================== @@ -1778,7 +1778,7 @@ void CMeshMRMGeom::load(NLMISC::IStream &f) throw(NLMISC::EStream) // *************************************************************************** -void CMeshMRMGeom::save(NLMISC::IStream &f) throw(NLMISC::EStream) +void CMeshMRMGeom::save(NLMISC::IStream &f) { /* Version 5: @@ -2968,7 +2968,7 @@ void CMeshMRM::render(IDriver *drv, CTransformShape *trans, bool passOpaque) // *************************************************************************** -void CMeshMRM::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CMeshMRM::serial(NLMISC::IStream &f) { /* Version 0: diff --git a/code/nel/src/3d/mesh_multi_lod.cpp b/code/nel/src/3d/mesh_multi_lod.cpp index f200e2bc6..b3d51cc52 100644 --- a/code/nel/src/3d/mesh_multi_lod.cpp +++ b/code/nel/src/3d/mesh_multi_lod.cpp @@ -288,7 +288,7 @@ void CMeshMultiLod::render(IDriver *drv, CTransformShape *trans, bool passOpaque // *************************************************************************** -void CMeshMultiLod::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CMeshMultiLod::serial(NLMISC::IStream &f) { /* *********************************************** * WARNING: This Class/Method must be thread-safe (ctor/dtor/serial): no static access for instance @@ -405,7 +405,7 @@ void CMeshMultiLod::clear () // *************************************************************************** -void CMeshMultiLod::CMeshSlot::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CMeshMultiLod::CMeshSlot::serial(NLMISC::IStream &f) { // Check version (void)f.serialVersion (0); diff --git a/code/nel/src/3d/meshvp_per_pixel_light.cpp b/code/nel/src/3d/meshvp_per_pixel_light.cpp index 6bbcec5c6..3449d57d2 100644 --- a/code/nel/src/3d/meshvp_per_pixel_light.cpp +++ b/code/nel/src/3d/meshvp_per_pixel_light.cpp @@ -573,7 +573,7 @@ void CMeshVPPerPixelLight::end(IDriver *drv) //================================================================================= -void CMeshVPPerPixelLight::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CMeshVPPerPixelLight::serial(NLMISC::IStream &f) { (void)f.serialVersion(0); f.serial(SpecularLighting); diff --git a/code/nel/src/3d/meshvp_wind_tree.cpp b/code/nel/src/3d/meshvp_wind_tree.cpp index ba27216f0..620465a0a 100644 --- a/code/nel/src/3d/meshvp_wind_tree.cpp +++ b/code/nel/src/3d/meshvp_wind_tree.cpp @@ -194,7 +194,7 @@ CMeshVPWindTree::~CMeshVPWindTree() // *************************************************************************** -void CMeshVPWindTree::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CMeshVPWindTree::serial(NLMISC::IStream &f) { (void)f.serialVersion(0); diff --git a/code/nel/src/3d/packed_world.cpp b/code/nel/src/3d/packed_world.cpp index f1ad22ab2..830dc218e 100644 --- a/code/nel/src/3d/packed_world.cpp +++ b/code/nel/src/3d/packed_world.cpp @@ -153,7 +153,7 @@ void CPackedWorld::getZones(std::vector &zones) } // ************************************************************************************************* -void CPackedWorld::serialZoneNames(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPackedWorld::serialZoneNames(NLMISC::IStream &f) { f.serialVersion(1); f.serialCheck(NELID("OWPA")); @@ -161,7 +161,7 @@ void CPackedWorld::serialZoneNames(NLMISC::IStream &f) throw(NLMISC::EStream) } // ************************************************************************************************* -void CPackedWorld::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPackedWorld::serial(NLMISC::IStream &f) { serialZoneNames(f); f.serialCont(_Zones); diff --git a/code/nel/src/3d/packed_zone.cpp b/code/nel/src/3d/packed_zone.cpp index dbc9b2d1d..aa3eff11f 100644 --- a/code/nel/src/3d/packed_zone.cpp +++ b/code/nel/src/3d/packed_zone.cpp @@ -590,7 +590,7 @@ CPackedZone32::CPackedZone32() } // *************************************************************************************** -void CPackedZone32::serial(NLMISC::IStream &f) throw (NLMISC::EStream) +void CPackedZone32::serial(NLMISC::IStream &f) { f.serialVersion(0); f.serial(Box); @@ -1086,7 +1086,7 @@ CSmartPtr CPackedZone32::buildPackedZone16() } // *************************************************************************************** -void CPackedZone16::serial(NLMISC::IStream &f) throw (NLMISC::EStream) +void CPackedZone16::serial(NLMISC::IStream &f) { f.serialVersion(0); f.serial(Box); diff --git a/code/nel/src/3d/particle_system.cpp b/code/nel/src/3d/particle_system.cpp index 477739e98..2c10f279b 100644 --- a/code/nel/src/3d/particle_system.cpp +++ b/code/nel/src/3d/particle_system.cpp @@ -752,7 +752,7 @@ void CParticleSystem::step(TPass pass, TAnimationTime ellapsedTime, CParticleSys ///======================================================================================= -void CParticleSystem::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CParticleSystem::serial(NLMISC::IStream &f) { CHECK_INTEGRITY NL_PS_FUNC_MAIN(CParticleSystem_serial) diff --git a/code/nel/src/3d/particle_system_process.cpp b/code/nel/src/3d/particle_system_process.cpp index 8150d56d1..9317f6a6b 100644 --- a/code/nel/src/3d/particle_system_process.cpp +++ b/code/nel/src/3d/particle_system_process.cpp @@ -129,7 +129,7 @@ const CFontManager *CParticleSystemProcess::getFontManager(void) const // *********************************************************************************************************** -void CParticleSystemProcess::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CParticleSystemProcess::serial(NLMISC::IStream &f) { NL_PS_FUNC(CParticleSystemProcess_serial) // version 2 : added matrix mode (just not fx world matrix or identity) diff --git a/code/nel/src/3d/particle_system_shape.cpp b/code/nel/src/3d/particle_system_shape.cpp index 94851c3eb..7da2e85f1 100644 --- a/code/nel/src/3d/particle_system_shape.cpp +++ b/code/nel/src/3d/particle_system_shape.cpp @@ -117,7 +117,7 @@ CParticleSystemShape::CParticleSystemShape() : _MaxViewDist(100.f), } ///=========================================================================== -void CParticleSystemShape::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CParticleSystemShape::serial(NLMISC::IStream &f) { /* *********************************************** * WARNING: This Class/Method must be thread-safe (ctor/dtor/serial): no static access for instance diff --git a/code/nel/src/3d/ps_attrib_maker_helper.cpp b/code/nel/src/3d/ps_attrib_maker_helper.cpp index 56dd0ec84..aaa6b5a4d 100644 --- a/code/nel/src/3d/ps_attrib_maker_helper.cpp +++ b/code/nel/src/3d/ps_attrib_maker_helper.cpp @@ -26,7 +26,7 @@ namespace NL3D // *********************************************************************************** -void CPSAttribMakerMemory::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSAttribMakerMemory::serial(NLMISC::IStream &f) { CPSAttribMakerMemoryBase::serial(f); if (f.isReading()) @@ -59,7 +59,7 @@ void CPSAttribMakerMemory::newElement(const CPSEmitterInfo &info) } // *********************************************************************************** -void CPSAttribMakerMemory::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSAttribMakerMemory::serial(NLMISC::IStream &f) { CPSAttribMakerMemoryBase::serial(f); if (f.isReading()) @@ -92,7 +92,7 @@ void CPSAttribMakerMemory::newElement(const CPSEmitterInfo &info) } // *********************************************************************************** -void CPSAttribMakerMemory::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSAttribMakerMemory::serial(NLMISC::IStream &f) { CPSAttribMakerMemoryBase::serial(f); if (f.isReading()) diff --git a/code/nel/src/3d/ps_color.cpp b/code/nel/src/3d/ps_color.cpp index 4fbda508a..e93a85e4e 100644 --- a/code/nel/src/3d/ps_color.cpp +++ b/code/nel/src/3d/ps_color.cpp @@ -76,7 +76,7 @@ NLMISC::CRGBA CPSColorMemory::getDefaultValue(void) const } ///====================================================================================== -void CPSColorMemory::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSColorMemory::serial(NLMISC::IStream &f) { setColorType(CVertexBuffer::TRGBA); CPSAttribMakerMemory::serial(f); @@ -90,7 +90,7 @@ void CPSColorBinOp::setColorType(CVertexBuffer::TVertexColorType colorType) } ///====================================================================================== -void CPSColorBinOp::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSColorBinOp::serial(NLMISC::IStream &f) { setColorType(CVertexBuffer::TRGBA); CPSAttribMakerBinOp::serial(f); diff --git a/code/nel/src/3d/ps_dot.cpp b/code/nel/src/3d/ps_dot.cpp index bf1f51b4d..3082e506b 100644 --- a/code/nel/src/3d/ps_dot.cpp +++ b/code/nel/src/3d/ps_dot.cpp @@ -290,7 +290,7 @@ void CPSDot::resize(uint32 size) } ///=================================================================== -void CPSDot::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSDot::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSDot_IStream ) diff --git a/code/nel/src/3d/ps_emitter.cpp b/code/nel/src/3d/ps_emitter.cpp index 7fb5a6516..240be6f51 100644 --- a/code/nel/src/3d/ps_emitter.cpp +++ b/code/nel/src/3d/ps_emitter.cpp @@ -1917,7 +1917,7 @@ void CPSEmitter::bounceOccurred(uint32 index, TAnimationTime timeToNextSimStep) } ///========================================================================== -void CPSEmitter::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSEmitter::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSEmitter_serial) /// version 6 : the flag _EmitDirBasis no longer exist, it has been replaced by _UserMatrixModeForEmissionDirection @@ -2184,7 +2184,7 @@ bool CPSEmitter::testEmitForever() const // implementation of CPSModulatedEmitter // //////////////////////////////////////////// -void CPSModulatedEmitter::serialEmitteeSpeedScheme(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSModulatedEmitter::serialEmitteeSpeedScheme(NLMISC::IStream &f) { NL_PS_FUNC(CPSModulatedEmitter_IStream ) bool useScheme; @@ -2228,7 +2228,7 @@ void CPSEmitterOmni::emit(const NLMISC::CVector &srcPos, uint32 index, CVector & } ///========================================================================== -void CPSEmitterOmni::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSEmitterOmni::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSEmitterOmni_serial) f.serialVersion(1); @@ -2332,7 +2332,7 @@ void CPSEmitterDirectionnal::resize(uint32 capacity) } ///========================================================================== -void CPSEmitterDirectionnal::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSEmitterDirectionnal::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSEmitterDirectionnal_IStream ) f.serialVersion(1); @@ -2346,7 +2346,7 @@ void CPSEmitterDirectionnal::serial(NLMISC::IStream &f) throw(NLMISC::EStream) //////////////////////////////////////////// ///========================================================================== -void CPSEmitterRectangle::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSEmitterRectangle::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSEmitterRectangle_IStream ) f.serialVersion(1); @@ -2506,7 +2506,7 @@ void CPSEmitterRectangle::showTool(void) //////////////////////////////////// ///========================================================================== -void CPSEmitterConic::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSEmitterConic::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSEmitterConic_serial) f.serialVersion(1); @@ -2611,7 +2611,7 @@ CMatrix CPSSphericalEmitter::getMatrix(uint32 index) const } ///========================================================================== -void CPSSphericalEmitter::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSSphericalEmitter::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSSphericalEmitter_serial) f.serialVersion(1); @@ -2668,7 +2668,7 @@ void CPSSphericalEmitter::resize(uint32 size) ///////////////////////////////////// ///========================================================================== -void CPSRadialEmitter::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSRadialEmitter::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSRadialEmitter_serial) f.serialVersion(1); diff --git a/code/nel/src/3d/ps_face.cpp b/code/nel/src/3d/ps_face.cpp index 0d3ce6482..43bd921ab 100644 --- a/code/nel/src/3d/ps_face.cpp +++ b/code/nel/src/3d/ps_face.cpp @@ -293,7 +293,7 @@ void CPSFace::step(TPSProcessPass pass) ///====================================================================================== -void CPSFace::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSFace::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSFace_IStream ) f.serialVersion(1); diff --git a/code/nel/src/3d/ps_face_look_at.cpp b/code/nel/src/3d/ps_face_look_at.cpp index d6ac0ec0f..000db78e6 100644 --- a/code/nel/src/3d/ps_face_look_at.cpp +++ b/code/nel/src/3d/ps_face_look_at.cpp @@ -996,7 +996,7 @@ void CPSFaceLookAt::resize(uint32 capacity) ///=========================================================================================== -void CPSFaceLookAt::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSFaceLookAt::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSFaceLookAt_serial) // version 4 : added 'align on z-axis' flag diff --git a/code/nel/src/3d/ps_fan_light.cpp b/code/nel/src/3d/ps_fan_light.cpp index 6296373b6..a2a0dcf0b 100644 --- a/code/nel/src/3d/ps_fan_light.cpp +++ b/code/nel/src/3d/ps_fan_light.cpp @@ -393,7 +393,7 @@ void CPSFanLight::draw(bool opaque) } ///==================================================================================== -void CPSFanLight::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSFanLight::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSFanLight_serial) sint ver = f.serialVersion(2); diff --git a/code/nel/src/3d/ps_float.cpp b/code/nel/src/3d/ps_float.cpp index f4f0a7226..7c364f2b8 100644 --- a/code/nel/src/3d/ps_float.cpp +++ b/code/nel/src/3d/ps_float.cpp @@ -151,7 +151,7 @@ void CPSFloatCurveFunctor::updateTab(void) } ///======================================================================================= -void CPSFloatCurveFunctor::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSFloatCurveFunctor::serial(NLMISC::IStream &f) { f.serialVersion(1); f.serial(_NumSamples, _Smoothing); diff --git a/code/nel/src/3d/ps_force.cpp b/code/nel/src/3d/ps_force.cpp index bf0ca662d..fa42766b1 100644 --- a/code/nel/src/3d/ps_force.cpp +++ b/code/nel/src/3d/ps_force.cpp @@ -45,7 +45,7 @@ CPSForce::CPSForce() -void CPSForce::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSForce::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSForce_serial) f.serialVersion(1); @@ -189,7 +189,7 @@ void CPSForceIntensity::setIntensityScheme(CPSAttribMaker *scheme) if (getForceIntensityOwner() && scheme->hasMemory()) scheme->resize(getForceIntensityOwner()->getMaxSize(), getForceIntensityOwner()->getSize()); } -void CPSForceIntensity::serialForceIntensity(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSForceIntensity::serialForceIntensity(NLMISC::IStream &f) { NL_PS_FUNC(CPSForceIntensity_IStream ) f.serialVersion(1); @@ -229,7 +229,7 @@ void CPSForceIntensity::serialForceIntensity(NLMISC::IStream &f) throw(NLMISC::E //////////////////////////////////////// -void CPSForceIntensityHelper::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSForceIntensityHelper::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSForceIntensityHelper_serial) f.serialVersion(1); @@ -320,7 +320,7 @@ void CPSDirectionnalForce::show() } } -void CPSDirectionnalForce::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSDirectionnalForce::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSDirectionnalForce_serial) // Version 2 : added link to a global vector value @@ -488,7 +488,7 @@ void CPSGravity::show() } -void CPSGravity::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSGravity::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSGravity_IStream ) f.serialVersion(1); @@ -747,7 +747,7 @@ void CPSCentralGravity::show() displayIcon2d(tab, tabSize, sSize); } -void CPSCentralGravity::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSCentralGravity::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSCentralGravity_IStream ) f.serialVersion(1); @@ -785,7 +785,7 @@ void CPSSpring::computeForces(CPSLocated &target) } -void CPSSpring::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSSpring::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSSpring_serial) f.serialVersion(1); @@ -921,7 +921,7 @@ CMatrix CPSCylindricVortex::getMatrix(uint32 index) const } -void CPSCylindricVortex::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSCylindricVortex::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSCylindricVortex_IStream ) f.serialVersion(1); @@ -960,7 +960,7 @@ void CPSCylindricVortex::resize(uint32 size) * a magnetic field that has the given direction */ -void CPSMagneticForce::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSMagneticForce::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSMagneticForce_serial) f.serialVersion(1); @@ -1369,7 +1369,7 @@ void CPSBrownianForce::computeForces(CPSLocated &target) } ///======================================================================= -void CPSBrownianForce::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSBrownianForce::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSBrownianForce_serial) sint ver = f.serialVersion(3); diff --git a/code/nel/src/3d/ps_light.cpp b/code/nel/src/3d/ps_light.cpp index 034a5bfcb..48e579283 100644 --- a/code/nel/src/3d/ps_light.cpp +++ b/code/nel/src/3d/ps_light.cpp @@ -72,7 +72,7 @@ CPSLight::~CPSLight() } // *************************************************************************************************************** -void CPSLight::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSLight::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSLight_serial) CPSLocatedBindable::serial(f); diff --git a/code/nel/src/3d/ps_located.cpp b/code/nel/src/3d/ps_located.cpp index 8dbe2d823..1af7b370d 100644 --- a/code/nel/src/3d/ps_located.cpp +++ b/code/nel/src/3d/ps_located.cpp @@ -1411,7 +1411,7 @@ void CPSLocated::resize(uint32 newSize) class CDummyCollision { public: - void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + void serial(NLMISC::IStream &f) { NL_PS_FUNC(CDummyCollision_serial) f.serialVersion(1); @@ -1422,7 +1422,7 @@ public: }; /// *************************************************************************************** -void CPSLocated::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSLocated::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSLocated_serial) @@ -2710,7 +2710,7 @@ void CPSLocatedBindable::notifyTargetRemoved(CPSLocated *ptr) } /// *************************************************************************************** -void CPSLocatedBindable::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSLocatedBindable::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSLocatedBindable_IStream ) sint ver = f.serialVersion(4); @@ -2902,7 +2902,7 @@ void CPSLocatedBindable::releaseAllRef() ///////////////////////////////////////////// /// *************************************************************************************** -void CPSTargetLocatedBindable::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSTargetLocatedBindable::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSTargetLocatedBindable_serial) (void)f.serialVersion(1); diff --git a/code/nel/src/3d/ps_mesh.cpp b/code/nel/src/3d/ps_mesh.cpp index 3331ac315..6f21e2c25 100644 --- a/code/nel/src/3d/ps_mesh.cpp +++ b/code/nel/src/3d/ps_mesh.cpp @@ -158,7 +158,7 @@ static CMesh *CreateDummyMesh(void) //==================================================================================== -void CPSMesh::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSMesh::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSMesh_IStream ) (void)f.serialVersion(3); @@ -1448,7 +1448,7 @@ void CPSConstraintMesh::fillIndexesInPrecompBasis(void) //==================================================================================== /// serialisation. Derivers must override this, and call their parent version -void CPSConstraintMesh::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSConstraintMesh::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSConstraintMesh_IStream ) @@ -2267,7 +2267,7 @@ CPSConstraintMesh::CGlobalTexAnim::CGlobalTexAnim() : TransOffset(NLMISC::CVecto } //===================================================================================== -void CPSConstraintMesh::CGlobalTexAnim::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSConstraintMesh::CGlobalTexAnim::serial(NLMISC::IStream &f) { NL_PS_FUNC(CGlobalTexAnim_IStream ) // version 1 : added offset @@ -2365,7 +2365,7 @@ void CPSConstraintMesh::setTexAnimType(TTexAnimType type) } //===================================================================================== -void CPSConstraintMesh::CGlobalTexAnims::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSConstraintMesh::CGlobalTexAnims::serial(NLMISC::IStream &f) { NL_PS_FUNC(CGlobalTexAnims_IStream ) f.serialVersion(0); diff --git a/code/nel/src/3d/ps_particle_basic.cpp b/code/nel/src/3d/ps_particle_basic.cpp index 42e4d31c6..110b5963b 100644 --- a/code/nel/src/3d/ps_particle_basic.cpp +++ b/code/nel/src/3d/ps_particle_basic.cpp @@ -152,7 +152,7 @@ CPSColoredParticle::~CPSColoredParticle() } //======================================= -void CPSColoredParticle::serialColorScheme(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSColoredParticle::serialColorScheme(NLMISC::IStream &f) { NL_PS_FUNC(CPSColoredParticle_IStream ) f.serialVersion(1); @@ -213,7 +213,7 @@ CPSSizedParticle::~CPSSizedParticle() } //======================================= -void CPSSizedParticle::serialSizeScheme(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSSizedParticle::serialSizeScheme(NLMISC::IStream &f) { NL_PS_FUNC(CPSSizedParticle_serialSizeScheme) f.serialVersion(1); @@ -277,7 +277,7 @@ CPSRotated2DParticle::~CPSRotated2DParticle() } ///=================================================================================== -void CPSRotated2DParticle::serialAngle2DScheme(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSRotated2DParticle::serialAngle2DScheme(NLMISC::IStream &f) { NL_PS_FUNC(CPSRotated2DParticle_serialAngle2DScheme) f.serialVersion(1); @@ -387,7 +387,7 @@ CPSTexturedParticle::~CPSTexturedParticle() } ///=================================================================================== -void CPSTexturedParticle::serialTextureScheme(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSTexturedParticle::serialTextureScheme(NLMISC::IStream &f) { NL_PS_FUNC(CPSTexturedParticle_serialTextureScheme) f.serialVersion(1); @@ -489,7 +489,7 @@ CPSRotated3DPlaneParticle::~CPSRotated3DPlaneParticle() } ///=================================================================================== -void CPSRotated3DPlaneParticle::serialPlaneBasisScheme(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSRotated3DPlaneParticle::serialPlaneBasisScheme(NLMISC::IStream &f) { NL_PS_FUNC(CPSRotated3DPlaneParticle_serialPlaneBasisScheme) f.serialVersion(1); @@ -515,7 +515,7 @@ CPSMaterial::CPSMaterial() } ///=================================================================================== -void CPSMaterial::serialMaterial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSMaterial::serialMaterial(NLMISC::IStream &f) { NL_PS_FUNC(CPSMaterial_IStream ) // version 3 : added zbias @@ -726,7 +726,7 @@ void CPSMultiTexturedParticle::enableAlternateTex(bool enabled /*= true*/) } //======================================= -void CPSMultiTexturedParticle::serialMultiTex(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSMultiTexturedParticle::serialMultiTex(NLMISC::IStream &f) { NL_PS_FUNC(CPSMultiTexturedParticle_serialMultiTex) /// version 1 : bump factor diff --git a/code/nel/src/3d/ps_plane_basis_maker.cpp b/code/nel/src/3d/ps_plane_basis_maker.cpp index bdc99cd18..05df5821b 100644 --- a/code/nel/src/3d/ps_plane_basis_maker.cpp +++ b/code/nel/src/3d/ps_plane_basis_maker.cpp @@ -320,7 +320,7 @@ uint32 CSpinnerFunctor::getNumSamples(void) const } ///============================================================================ -void CSpinnerFunctor::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CSpinnerFunctor::serial(NLMISC::IStream &f) { f.serialVersion(1); f.serial(_Axis, _NbSamples); diff --git a/code/nel/src/3d/ps_quad.cpp b/code/nel/src/3d/ps_quad.cpp index 295c31c93..8ce6ce821 100644 --- a/code/nel/src/3d/ps_quad.cpp +++ b/code/nel/src/3d/ps_quad.cpp @@ -382,7 +382,7 @@ void CPSQuad::updateMatAndVbForColor(void) } //============================================================== -void CPSQuad::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSQuad::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSQuad_serial) sint ver = f.serialVersion(2); diff --git a/code/nel/src/3d/ps_ribbon.cpp b/code/nel/src/3d/ps_ribbon.cpp index 06bb08787..499991b5e 100644 --- a/code/nel/src/3d/ps_ribbon.cpp +++ b/code/nel/src/3d/ps_ribbon.cpp @@ -136,7 +136,7 @@ struct CDummy2DAngle : CPSRotated2DParticle }; ///================================================================================================================== -void CPSRibbon::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSRibbon::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSRibbon_serial) // Version 3 : - added brace mode diff --git a/code/nel/src/3d/ps_ribbon_base.cpp b/code/nel/src/3d/ps_ribbon_base.cpp index a3f70253b..e56ebc4d4 100644 --- a/code/nel/src/3d/ps_ribbon_base.cpp +++ b/code/nel/src/3d/ps_ribbon_base.cpp @@ -750,7 +750,7 @@ void CPSRibbonBase::initDateVect() //======================================================= -void CPSRibbonBase::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSRibbonBase::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSRibbonBase_serial) CPSParticle::serial(f); diff --git a/code/nel/src/3d/ps_ribbon_look_at.cpp b/code/nel/src/3d/ps_ribbon_look_at.cpp index 2e03acaf6..d7c646fc9 100644 --- a/code/nel/src/3d/ps_ribbon_look_at.cpp +++ b/code/nel/src/3d/ps_ribbon_look_at.cpp @@ -61,7 +61,7 @@ CPSRibbonLookAt::~CPSRibbonLookAt() } //======================================================= -void CPSRibbonLookAt::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSRibbonLookAt::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSRibbonLookAt_serial) /** Version 4 : added CPSRibbonBase has a base class instead of CPSParticle diff --git a/code/nel/src/3d/ps_shockwave.cpp b/code/nel/src/3d/ps_shockwave.cpp index dc94f5f96..cc7547c45 100644 --- a/code/nel/src/3d/ps_shockwave.cpp +++ b/code/nel/src/3d/ps_shockwave.cpp @@ -262,7 +262,7 @@ void CPSShockWave::setUFactor(float value) } ///================================================================================= -void CPSShockWave::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSShockWave::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSShockWave_serial) sint ver = f.serialVersion(2); diff --git a/code/nel/src/3d/ps_sound.cpp b/code/nel/src/3d/ps_sound.cpp index 873b3ed34..d0b82adb2 100644 --- a/code/nel/src/3d/ps_sound.cpp +++ b/code/nel/src/3d/ps_sound.cpp @@ -261,7 +261,7 @@ void CPSSound::setPitchScheme(CPSAttribMaker *pitch) } // *************************************************************************************************** -void CPSSound::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSSound::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSSound_serial) CPSLocatedBindable::serial(f); diff --git a/code/nel/src/3d/ps_tail_dot.cpp b/code/nel/src/3d/ps_tail_dot.cpp index 69caa8f71..e8146e582 100644 --- a/code/nel/src/3d/ps_tail_dot.cpp +++ b/code/nel/src/3d/ps_tail_dot.cpp @@ -79,7 +79,7 @@ CPSTailDot::~CPSTailDot() } //======================================================= -void CPSTailDot::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSTailDot::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSTailDot_serial) diff --git a/code/nel/src/3d/ps_zone.cpp b/code/nel/src/3d/ps_zone.cpp index 55a65d68f..7adf48b8f 100644 --- a/code/nel/src/3d/ps_zone.cpp +++ b/code/nel/src/3d/ps_zone.cpp @@ -47,7 +47,7 @@ CPSZone::CPSZone() : _BounceFactor(1.f), _CollisionBehaviour(bounce) NL_PS_FUNC(CPSZone_CPSZone) } -void CPSZone::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSZone::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSZone_serial) f.serialVersion(1); @@ -280,7 +280,7 @@ void CPSZonePlane::setNormal(uint32 index, CVector n) -void CPSZonePlane::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSZonePlane::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSZonePlane_serial) f.serialVersion(1); @@ -420,7 +420,7 @@ CVector CPSZoneSphere::getScale(uint32 k) const } -void CPSZoneSphere::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSZoneSphere::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSZoneSphere_serial) f.serialVersion(1); @@ -600,7 +600,7 @@ CVector CPSZoneDisc::getScale(uint32 k) const } -void CPSZoneDisc::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSZoneDisc::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSZoneDisc_serial) f.serialVersion(1); @@ -1089,7 +1089,7 @@ void CPSZoneCylinder::setScale(uint32 index, const CVector &s) } -void CPSZoneCylinder::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSZoneCylinder::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSZoneCylinder_serial) f.serialVersion(1); @@ -1269,7 +1269,7 @@ CVector CPSZoneRectangle::getScale(uint32 index) const -void CPSZoneRectangle::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPSZoneRectangle::serial(NLMISC::IStream &f) { NL_PS_FUNC(CPSZoneRectangle_IStream ) f.serialVersion(1); diff --git a/code/nel/src/3d/seg_remanence_shape.cpp b/code/nel/src/3d/seg_remanence_shape.cpp index f31b2c0b2..eb546177c 100644 --- a/code/nel/src/3d/seg_remanence_shape.cpp +++ b/code/nel/src/3d/seg_remanence_shape.cpp @@ -47,7 +47,7 @@ CSegRemanenceShape::CSegRemanenceShape() : _GeomTouched(true), } //=========================================================== -void CSegRemanenceShape::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CSegRemanenceShape::serial(NLMISC::IStream &f) { // version 2 : added default tracks // version 1 : rollup ratio diff --git a/code/nel/src/3d/shape.cpp b/code/nel/src/3d/shape.cpp index 6b0db63b8..93e0cccd7 100644 --- a/code/nel/src/3d/shape.cpp +++ b/code/nel/src/3d/shape.cpp @@ -116,7 +116,7 @@ IShape* CShapeStream::getShapePointer () const // *************************************************************************** -void CShapeStream::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CShapeStream::serial(NLMISC::IStream &f) { // First, serial an header or checking if it is correct f.serialCheck (NELID("PAHS")); diff --git a/code/nel/src/3d/skeleton_shape.cpp b/code/nel/src/3d/skeleton_shape.cpp index 230915407..afa7701af 100644 --- a/code/nel/src/3d/skeleton_shape.cpp +++ b/code/nel/src/3d/skeleton_shape.cpp @@ -33,7 +33,7 @@ namespace NL3D // *************************************************************************** -void CSkeletonShape::CLod::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CSkeletonShape::CLod::serial(NLMISC::IStream &f) { (void)f.serialVersion(0); @@ -175,7 +175,7 @@ CTransformShape *CSkeletonShape::createInstance(CScene &scene) } // *************************************************************************** -void CSkeletonShape::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CSkeletonShape::serial(NLMISC::IStream &f) { /* Version 1: diff --git a/code/nel/src/3d/texture.cpp b/code/nel/src/3d/texture.cpp index 3e248e521..c31fecdea 100644 --- a/code/nel/src/3d/texture.cpp +++ b/code/nel/src/3d/texture.cpp @@ -136,7 +136,7 @@ ITextureDrvInfos::~ITextureDrvInfos() // *************************************************************************** -void ITexture::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void ITexture::serial(NLMISC::IStream &f) { /* Version 1: diff --git a/code/nel/src/3d/texture_blend.cpp b/code/nel/src/3d/texture_blend.cpp index 0d85664d6..aad39cc6d 100644 --- a/code/nel/src/3d/texture_blend.cpp +++ b/code/nel/src/3d/texture_blend.cpp @@ -112,7 +112,7 @@ void CTextureBlend::doGenerate(bool async) // ************************************************************************ -void CTextureBlend::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CTextureBlend::serial(NLMISC::IStream &f) { f.serialVersion(0); ITexture::serial(f); diff --git a/code/nel/src/3d/texture_bump.cpp b/code/nel/src/3d/texture_bump.cpp index adc425c37..3707476b2 100644 --- a/code/nel/src/3d/texture_bump.cpp +++ b/code/nel/src/3d/texture_bump.cpp @@ -162,7 +162,7 @@ void CTextureBump::setHeightMap(ITexture *heightMap) ///============================================================================================== -void CTextureBump::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CTextureBump::serial(NLMISC::IStream &f) { /// version 2 : normalization flag sint ver = f.serialVersion(3); diff --git a/code/nel/src/3d/texture_cube.cpp b/code/nel/src/3d/texture_cube.cpp index f754aa2a0..34737af4f 100644 --- a/code/nel/src/3d/texture_cube.cpp +++ b/code/nel/src/3d/texture_cube.cpp @@ -147,7 +147,7 @@ void CTextureCube::release() } // *************************************************************************** -void CTextureCube::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CTextureCube::serial(NLMISC::IStream &f) { sint ver= f.serialVersion(2); diff --git a/code/nel/src/3d/texture_emboss.cpp b/code/nel/src/3d/texture_emboss.cpp index 1c9733bda..a106454f4 100644 --- a/code/nel/src/3d/texture_emboss.cpp +++ b/code/nel/src/3d/texture_emboss.cpp @@ -47,7 +47,7 @@ void CTextureEmboss::setHeightMap(ITexture *heightMap) } // *********************************************************************************************************** -void CTextureEmboss::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CTextureEmboss::serial(NLMISC::IStream &f) { f.serialVersion(0); ITexture::serial(f); diff --git a/code/nel/src/3d/texture_file.cpp b/code/nel/src/3d/texture_file.cpp index a30b21bb1..0e343ec8e 100644 --- a/code/nel/src/3d/texture_file.cpp +++ b/code/nel/src/3d/texture_file.cpp @@ -240,7 +240,7 @@ void CTextureFile::doGenerate(bool async) // *************************************************************************** -void CTextureFile::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CTextureFile::serial(NLMISC::IStream &f) { /* Version 1: diff --git a/code/nel/src/3d/texture_grouped.cpp b/code/nel/src/3d/texture_grouped.cpp index b6d42f3b1..273d383e8 100644 --- a/code/nel/src/3d/texture_grouped.cpp +++ b/code/nel/src/3d/texture_grouped.cpp @@ -309,7 +309,7 @@ std::string CTextureGrouped::getShareName() const } ///===================================================================================================== -void CTextureGrouped::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CTextureGrouped::serial(NLMISC::IStream &f) { f.serialVersion(1); diff --git a/code/nel/src/3d/texture_multi_file.cpp b/code/nel/src/3d/texture_multi_file.cpp index b2316cc73..cd05beb55 100644 --- a/code/nel/src/3d/texture_multi_file.cpp +++ b/code/nel/src/3d/texture_multi_file.cpp @@ -82,7 +82,7 @@ void CTextureMultiFile::doGenerate(bool async) } ///=========================================================== -void CTextureMultiFile::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CTextureMultiFile::serial(NLMISC::IStream &f) { (void)f.serialVersion(0); diff --git a/code/nel/src/3d/tile_bank.cpp b/code/nel/src/3d/tile_bank.cpp index 1260f3972..e2c488fe5 100644 --- a/code/nel/src/3d/tile_bank.cpp +++ b/code/nel/src/3d/tile_bank.cpp @@ -47,7 +47,7 @@ namespace NL3D // *************************************************************************** const sint CTileLand::_Version=0; // *************************************************************************** -void CTileLand::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CTileLand::serial(NLMISC::IStream &f) { (void)f.serialVersion(_Version); @@ -91,7 +91,7 @@ CTileBank::CTileBank () _DisplacementMap[0].setEmpty (); } // *************************************************************************** -void CTileBank::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CTileBank::serial(NLMISC::IStream &f) { f.serialCheck (std::string ("BANK")); @@ -753,7 +753,7 @@ void CTileBank::postfixTileVegetableDesc (const char *postfix) // *************************************************************************** const sint CTile::_Version=4; // *************************************************************************** -void CTile::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CTile::serial(NLMISC::IStream &f) { sint streamver = f.serialVersion(_Version); @@ -916,7 +916,7 @@ const std::string& CTileSet::getName () const return _Name; } // *************************************************************************** -void CTileSet::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CTileSet::serial(NLMISC::IStream &f) { sint streamver = f.serialVersion(_Version); @@ -1595,7 +1595,7 @@ void CTileSet::loadTileVegetableDesc() // *************************************************************************** const sint CTileBorder::_Version=0; // *************************************************************************** -void CTileBorder::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CTileBorder::serial(NLMISC::IStream &f) { (void)f.serialVersion(_Version); @@ -1824,7 +1824,7 @@ void CTileBorder::rotate() // *************************************************************************** const sint CTileSetTransition::_Version=1; // *************************************************************************** -void CTileSetTransition::serial(class NLMISC::IStream &f) throw(EStream) +void CTileSetTransition::serial(NLMISC::IStream &f) { sint streamver = f.serialVersion(_Version); diff --git a/code/nel/src/3d/tile_far_bank.cpp b/code/nel/src/3d/tile_far_bank.cpp index d8eceb21e..e86f18389 100644 --- a/code/nel/src/3d/tile_far_bank.cpp +++ b/code/nel/src/3d/tile_far_bank.cpp @@ -39,7 +39,7 @@ namespace NL3D { // *************************************************************************** const sint CTileFarBank::CTileFar::_Version=0x0; // *************************************************************************** -void CTileFarBank::CTileFar::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CTileFarBank::CTileFar::serial(NLMISC::IStream &f) { // Serial version (void)f.serialVersion(_Version); @@ -105,7 +105,7 @@ CTileFarBank::CTileFarBank() // *************************************************************************** const sint CTileFarBank::_Version=0x0; // *************************************************************************** -void CTileFarBank::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CTileFarBank::serial(NLMISC::IStream &f) { // Write/Check "FAR_BANK" in header of the stream f.serialCheck (NELID("_RAF")); diff --git a/code/nel/src/3d/water_height_map.cpp b/code/nel/src/3d/water_height_map.cpp index 3348ffd05..5f67ffce3 100644 --- a/code/nel/src/3d/water_height_map.cpp +++ b/code/nel/src/3d/water_height_map.cpp @@ -674,7 +674,7 @@ void CWaterHeightMap::setWaves(float intensity, float period, uint radius, bool //=========================================================================================== -void CWaterHeightMap::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CWaterHeightMap::serial(NLMISC::IStream &f) { f.xmlPushBegin("WaterHeightMap"); f.xmlSetAttrib ("NAME") ; diff --git a/code/nel/src/3d/water_pool_manager.cpp b/code/nel/src/3d/water_pool_manager.cpp index 8ca8e2bfc..361264f81 100644 --- a/code/nel/src/3d/water_pool_manager.cpp +++ b/code/nel/src/3d/water_pool_manager.cpp @@ -214,7 +214,7 @@ void CWaterPoolManager::removePool(uint32 ID) } //=============================================================================================== -void CWaterPoolManager::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CWaterPoolManager::serial(NLMISC::IStream &f) { f.xmlPush("WaterPoolManager"); (void)f.serialVersion(0); diff --git a/code/nel/src/3d/water_shape.cpp b/code/nel/src/3d/water_shape.cpp index df5e6dadf..6df5acb4c 100644 --- a/code/nel/src/3d/water_shape.cpp +++ b/code/nel/src/3d/water_shape.cpp @@ -523,7 +523,7 @@ const ITexture *CWaterShape::getHeightMap(uint k) const } //============================================ -void CWaterShape::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CWaterShape::serial(NLMISC::IStream &f) { /* *********************************************** * WARNING: This Class/Method must be thread-safe (ctor/dtor/serial): no static access for instance @@ -763,7 +763,7 @@ CWaveMakerShape::~CWaveMakerShape() } //============================================ -void CWaveMakerShape::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CWaveMakerShape::serial(NLMISC::IStream &f) { f.serialVersion(0); f.serial(_Period, _Radius, _Intensity, _PoolID, _ImpulsionMode); diff --git a/code/nel/src/georges/form.cpp b/code/nel/src/georges/form.cpp index f5cbcc3a1..a02b9e8cd 100644 --- a/code/nel/src/georges/form.cpp +++ b/code/nel/src/georges/form.cpp @@ -263,7 +263,7 @@ const std::string &CForm::getComment () const // *************************************************************************** -void CForm::write (class NLMISC::IStream &stream) +void CForm::write (NLMISC::IStream &stream) { // Xml stream COXml xmlStream; diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index c9977589f..7b2621b18 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -698,6 +698,8 @@ namespace NLGUI } requestTerminated(); } + + continue; } for (vector::iterator it=Curls.begin(); itRequest); + + // release CCurlWWWData + delete Curls[i].data; + } + } + Curls.clear(); } class CGroupListAdaptor : public CInterfaceGroup @@ -3059,8 +3073,13 @@ namespace NLGUI // this is why the call to 'updateRefreshButton' has been removed from stopBrowse clearContext(); + releaseDownloads(); + if (_CurlWWW) delete _CurlWWW; + + if(MultiCurl) + curl_multi_cleanup(MultiCurl); } std::string CGroupHTML::getProperty( const std::string &name ) const @@ -4657,7 +4676,6 @@ namespace NLGUI if(!CFile::fileExists(normal)) { normal = "web_del.tga"; - addImageDownload(normalBitmap, ctrlButton, style); } else { @@ -4674,6 +4692,8 @@ namespace NLGUI normal = "web_del.tga"; } } + + addImageDownload(normalBitmap, ctrlButton, style); } } @@ -4698,10 +4718,7 @@ namespace NLGUI if (overBitmap != normalBitmap) { over = localImageName(overBitmap); - if (!CFile::fileExists(over)) - { - addImageDownload(overBitmap, ctrlButton, style, TImageType::OverImage); - } + addImageDownload(overBitmap, ctrlButton, style, TImageType::OverImage); } } diff --git a/code/nel/src/gui/group_menu.cpp b/code/nel/src/gui/group_menu.cpp index d2e11a2c9..7d002cfd6 100644 --- a/code/nel/src/gui/group_menu.cpp +++ b/code/nel/src/gui/group_menu.cpp @@ -1802,7 +1802,7 @@ namespace NLGUI return 0; } - // ------------------------------------------------------------------------------------------------ + // ------------------------------------------------------------------------------------------------ int CGroupSubMenu::luaAddIconLine(CLuaState &ls) { const char *funcName = "addIconLine"; diff --git a/code/nel/src/gui/http_hsts.cpp b/code/nel/src/gui/http_hsts.cpp index 980bdabda..c69062538 100644 --- a/code/nel/src/gui/http_hsts.cpp +++ b/code/nel/src/gui/http_hsts.cpp @@ -55,7 +55,7 @@ namespace NLGUI { time_t currentTime; time(¤tTime); - return (hsts.Expires < currentTime); + return (hsts.Expires > currentTime); } return false; diff --git a/code/nel/src/gui/lua_ihm.cpp b/code/nel/src/gui/lua_ihm.cpp index fed1340a0..0b4a1d0dc 100644 --- a/code/nel/src/gui/lua_ihm.cpp +++ b/code/nel/src/gui/lua_ihm.cpp @@ -1817,9 +1817,7 @@ namespace NLGUI ucstring CLuaIHM::findReplaceAll(const ucstring &str, const ucstring &search, const ucstring &replace) { //H_AUTO(Lua_CLuaIHM_findReplaceAll) - ucstring ret= str; - while(strFindReplace(ret, search, replace)); - return ret; + return strFindReplaceAll(str, search, replace); } // *************************************************************************** diff --git a/code/nel/src/misc/bitmap_gif.cpp b/code/nel/src/misc/bitmap_gif.cpp index 5b964998a..653942d08 100644 --- a/code/nel/src/misc/bitmap_gif.cpp +++ b/code/nel/src/misc/bitmap_gif.cpp @@ -215,9 +215,6 @@ uint8 CBitmap::readGIF( NLMISC::IStream &f ) for (uint32 x = 0; x < width; x++) { - srcOffset++; - dstOffset+= dstChannels; - uint32 index = curFrame->RasterBits[srcOffset]; if ((sint32)index != transparency) @@ -250,6 +247,9 @@ uint8 CBitmap::readGIF( NLMISC::IStream &f ) _Data[0][dstOffset+1] = g; _Data[0][dstOffset+2] = b; _Data[0][dstOffset+3] = a; + + srcOffset++; + dstOffset+= dstChannels; } // x loop } // y loop } // pass loop @@ -262,9 +262,6 @@ uint8 CBitmap::readGIF( NLMISC::IStream &f ) uint32 dstOffset = (y + offset_y)*gif->SWidth*dstChannels + offset_x*dstChannels; for (uint32 x = 0; x < width; x++) { - srcOffset++; - dstOffset+= dstChannels; - uint32 index = curFrame->RasterBits[srcOffset]; if ((sint32)index != transparency) @@ -297,6 +294,9 @@ uint8 CBitmap::readGIF( NLMISC::IStream &f ) _Data[0][dstOffset+1] = g; _Data[0][dstOffset+2] = b; _Data[0][dstOffset+3] = a; + + srcOffset++; + dstOffset+= dstChannels; } // x loop } // y loop } diff --git a/code/nel/src/misc/bitmap_png.cpp b/code/nel/src/misc/bitmap_png.cpp index 251fd5495..2e700787c 100644 --- a/code/nel/src/misc/bitmap_png.cpp +++ b/code/nel/src/misc/bitmap_png.cpp @@ -37,8 +37,16 @@ namespace NLMISC static void readPNGData(png_structp png_ptr, png_bytep data, png_size_t length) { IStream *stream = static_cast(png_get_io_ptr(png_ptr)); - if (stream) - stream->serialBuffer((uint8*)data, (uint)length); + + try + { + if (stream) + stream->serialBuffer((uint8*)data, (uint)length); + } + catch (...) + { + png_error(png_ptr, "Read error while decoding PNG file"); + } } static void writePNGData(png_structp png_ptr, png_bytep data, png_size_t length) diff --git a/code/nel/src/misc/common.cpp b/code/nel/src/misc/common.cpp index 7eebdafbf..db605f4f1 100644 --- a/code/nel/src/misc/common.cpp +++ b/code/nel/src/misc/common.cpp @@ -633,7 +633,7 @@ void toLower(char *str) } } -std::string toUpper(const std::string &str) +std::string toUpper(const std::string &str) { string res; res.reserve(str.size()); @@ -647,7 +647,7 @@ std::string toUpper(const std::string &str) return res; } -void toUpper(char *str) +void toUpper(char *str) { if (str == 0) return; @@ -662,6 +662,109 @@ void toUpper(char *str) } } +std::string toHexa(const uint8 &b) +{ + return toString("%02hhx", b); +} + +std::string toHexa(const uint8 *data, uint size) +{ + std::string res; + + // hexadecimal string will be always twice the original size + res.reserve(size * 2); + + // process each byte + for (uint i = 0; i < size; ++i) + { + res += toHexa(data[i]); + } + + return res; +} + +std::string toHexa(const std::string &str) +{ + return toHexa((uint8*)str.c_str(), (uint)str.length()); +} + +std::string toHexa(const char *str) +{ + return toHexa((uint8*)str, (uint)strlen(str)); +} + +bool fromHexa(const std::string &hexa, uint8 &b) +{ + return fromHexa(hexa.c_str(), b); +} + +bool fromHexa(const std::string &hexa, uint8 *data) +{ + return fromHexa(hexa.c_str(), data); +} + +bool fromHexa(const std::string &hexa, std::string &str) +{ + return fromHexa(hexa.c_str(), str); +} + +bool fromHexa(const char *hexa, uint8 &b) +{ + char c1 = *hexa; + char c2 = *(hexa+1); + uint8 x1, x2; + if (!fromHexa(c1, x1)) return false; + if (!fromHexa(c2, x2)) return false; + + b = (x1 << 4) | x2; + + return true; +} + +bool fromHexa(const char *hexa, uint8 *data) +{ + // length of the string + uint len = strlen(hexa); + + // process each byte + for (uint i = 0; i < len; i += 2) + { + if (!fromHexa(hexa + i, *(data++))) return false; + } + + return true; +} + +bool fromHexa(const char *hexa, std::string &str) +{ + str.resize(strlen(hexa) * 2); + + return fromHexa(hexa, (uint8*)str.c_str()); +} + +bool fromHexa(const char hexa, uint8 &b) +{ + if (hexa >= '0' && hexa <= '9') + { + b = hexa - '0'; + return true; + } + + if (hexa >= 'A' && hexa <= 'F') + { + b = hexa - 'A' + 10; + return true; + } + + if (hexa >= 'a' && hexa <= 'f') + { + b = hexa - 'a' + 10; + return true; + } + + return false; +} + std::string formatThousands(const std::string& s) { sint i, k; @@ -894,8 +997,8 @@ bool launchProgram(const std::string &programName, const std::string &arguments, int status = vfork (); ///////////////////////////////////////////////////////// - /// WARNING : NO MORE INSTRUCTION AFTER VFORK ! - /// READ VFORK manual + // WARNING : NO MORE INSTRUCTION AFTER VFORK ! + // READ VFORK manual ///////////////////////////////////////////////////////// if (status == -1) { @@ -1000,8 +1103,8 @@ bool launchProgramArray (const std::string &programName, const std::vector &args) return res; } +std::string escapeArgument(const std::string &arg) +{ +#ifdef NL_OS_WINDOWS + // we can't escape %VARIABLE% on command-line under Windows + return arg; +#else + // characters to escape, only " and $ (to prevent a $something replaced by an environment variable) + static const char s_charsToEscape[] = "\"$"; + + std::string res; + std::string::size_type pos = 0, lastPos = 0; + + // to avoid reallocations + res.reserve(arg.size() * 2); + + while ((pos = arg.find_first_of(s_charsToEscape, lastPos)) != std::string::npos) + { + // add previous part + res += arg.substr(lastPos, pos - lastPos); + + // not already escaped + if (!pos || arg[pos - 1] != '\\') res += '\\'; + + // add escaped character + res += arg[pos]; + + lastPos = pos+1; + } + + res += arg.substr(lastPos); + + return res; +#endif +} + /* * Display the bits (with 0 and 1) composing a byte (from right to left) */ diff --git a/code/nel/src/misc/md5.cpp b/code/nel/src/misc/md5.cpp index eaf9df6cc..052bfa0b2 100644 --- a/code/nel/src/misc/md5.cpp +++ b/code/nel/src/misc/md5.cpp @@ -118,31 +118,6 @@ CHashKeyMD5 getMD5(const uint8 *buffer, uint32 size) return Message_Digest; } -// **************************************************************************** -// Helper -// **************************************************************************** -static bool fromHex(char c, uint8 &x) -{ - if (c >= '0' && c <= '9') - { - x = c - '0'; - return true; - } - else if (c >= 'A' && c <= 'F') - { - x = c - 'A' + 10; - return true; - } - else if (c >= 'a' && c <= 'f') - { - x = c - 'a' + 10; - return true; - } - - nlwarning("cannot convert to hexa"); - return false; -} - // **************************************************************************** // **************************************************************************** // CHashKeyMD5 @@ -159,10 +134,7 @@ void CHashKeyMD5::clear() // **************************************************************************** string CHashKeyMD5::toString() const { - string sTmp; - for (uint32 i = 0; i < 16; ++i) - sTmp += NLMISC::toString("%02x", Data[i]); - return sTmp; + return toHexa(Data, 16); } // **************************************************************************** @@ -174,16 +146,7 @@ bool CHashKeyMD5::fromString(const std::string &in) return false; } - for (uint32 i = 0; i < 16; ++i) - { - char c1 = in[2*i]; - char c2 = in[2*i+1]; - uint8 x1, x2; - if (!fromHex(c1, x1)) return false; - if (!fromHex(c2, x2)) return false; - Data[i] = (x1 << 4) | x2; - } - return true; + return fromHexa(in, Data); } // **************************************************************************** diff --git a/code/nel/src/misc/polygon.cpp b/code/nel/src/misc/polygon.cpp index 16575073f..856255c34 100644 --- a/code/nel/src/misc/polygon.cpp +++ b/code/nel/src/misc/polygon.cpp @@ -113,7 +113,7 @@ void CPolygon::clip(const std::vector &planes) // *************************************************************************** -void CPolygon::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPolygon::serial(NLMISC::IStream &f) { f.serialVersion(0); f.serialCont(Vertices); @@ -1011,7 +1011,7 @@ void CPolygon2D::buildConvexHull(CPolygon2D &dest) const // *************************************************************************** -void CPolygon2D::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CPolygon2D::serial(NLMISC::IStream &f) { (void)f.serialVersion(0); f.serialCont(Vertices); diff --git a/code/nel/src/misc/rgba.cpp b/code/nel/src/misc/rgba.cpp index d053887c4..277793489 100644 --- a/code/nel/src/misc/rgba.cpp +++ b/code/nel/src/misc/rgba.cpp @@ -50,7 +50,7 @@ const CRGBA CRGBA::Cyan(0, 255, 255) ; const CRGBA CRGBA::White(255, 255, 255) ; // *************************************************************************** -void CRGBA::serial(class NLMISC::IStream &f) +void CRGBA::serial(NLMISC::IStream &f) { f.serial (R); f.serial (G); @@ -581,7 +581,7 @@ void CRGBA::subtractColors(CRGBA *dest, const CRGBA *src1, const CRGBA *src2, ui // *************************************************************************** -void CBGRA::serial(class NLMISC::IStream &f) +void CBGRA::serial(NLMISC::IStream &f) { f.serial (B); f.serial (G); @@ -792,7 +792,7 @@ bool CRGBA::fromString( const std::string &s ) // *************************************************************************** -void CRGBAF::serial(class NLMISC::IStream &f) +void CRGBAF::serial(NLMISC::IStream &f) { f.serial (R); f.serial (G); diff --git a/code/nel/src/misc/sheet_id.cpp b/code/nel/src/misc/sheet_id.cpp index 1b3ca490f..2dd895153 100644 --- a/code/nel/src/misc/sheet_id.cpp +++ b/code/nel/src/misc/sheet_id.cpp @@ -561,7 +561,7 @@ string CSheetId::toString(bool ifNotFoundUseNumericId) const } // toString // -void CSheetId::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CSheetId::serial(NLMISC::IStream &f) { nlassert(!_DontHaveSheetKnowledge); @@ -576,7 +576,7 @@ void CSheetId::serial(NLMISC::IStream &f) throw(NLMISC::EStream) #endif } -void CSheetId::serialString(NLMISC::IStream &f, const std::string &defaultType) throw(NLMISC::EStream) +void CSheetId::serialString(NLMISC::IStream &f, const std::string &defaultType) { nlassert(_Initialised); diff --git a/code/nel/src/misc/system_info.cpp b/code/nel/src/misc/system_info.cpp index 545de0cc6..2afa8da09 100644 --- a/code/nel/src/misc/system_info.cpp +++ b/code/nel/src/misc/system_info.cpp @@ -23,6 +23,156 @@ # include # include # define nlcpuid(regs, idx) __cpuid(regs, idx) + +// define them here to not rely on Windows 10 SDKs +# define NL_PRODUCT_UNDEFINED 0x00000000 +# define NL_PRODUCT_ULTIMATE 0x00000001 +# define NL_PRODUCT_HOME_BASIC 0x00000002 +# define NL_PRODUCT_HOME_PREMIUM 0x00000003 +# define NL_PRODUCT_ENTERPRISE 0x00000004 +# define NL_PRODUCT_HOME_BASIC_N 0x00000005 +# define NL_PRODUCT_BUSINESS 0x00000006 +# define NL_PRODUCT_STANDARD_SERVER 0x00000007 +# define NL_PRODUCT_DATACENTER_SERVER 0x00000008 +# define NL_PRODUCT_SMALLBUSINESS_SERVER 0x00000009 +# define NL_PRODUCT_ENTERPRISE_SERVER 0x0000000A +# define NL_PRODUCT_STARTER 0x0000000B +# define NL_PRODUCT_DATACENTER_SERVER_CORE 0x0000000C +# define NL_PRODUCT_STANDARD_SERVER_CORE 0x0000000D +# define NL_PRODUCT_ENTERPRISE_SERVER_CORE 0x0000000E +# define NL_PRODUCT_ENTERPRISE_SERVER_IA64 0x0000000F +# define NL_PRODUCT_BUSINESS_N 0x00000010 +# define NL_PRODUCT_WEB_SERVER 0x00000011 +# define NL_PRODUCT_CLUSTER_SERVER 0x00000012 +# define NL_PRODUCT_HOME_SERVER 0x00000013 +# define NL_PRODUCT_STORAGE_EXPRESS_SERVER 0x00000014 +# define NL_PRODUCT_STORAGE_STANDARD_SERVER 0x00000015 +# define NL_PRODUCT_STORAGE_WORKGROUP_SERVER 0x00000016 +# define NL_PRODUCT_STORAGE_ENTERPRISE_SERVER 0x00000017 +# define NL_PRODUCT_SERVER_FOR_SMALLBUSINESS 0x00000018 +# define NL_PRODUCT_SMALLBUSINESS_SERVER_PREMIUM 0x00000019 +# define NL_PRODUCT_HOME_PREMIUM_N 0x0000001A +# define NL_PRODUCT_ENTERPRISE_N 0x0000001B +# define NL_PRODUCT_ULTIMATE_N 0x0000001C +# define NL_PRODUCT_WEB_SERVER_CORE 0x0000001D +# define NL_PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT 0x0000001E +# define NL_PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY 0x0000001F +# define NL_PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING 0x00000020 +# define NL_PRODUCT_SERVER_FOUNDATION 0x00000021 +# define NL_PRODUCT_HOME_PREMIUM_SERVER 0x00000022 +# define NL_PRODUCT_SERVER_FOR_SMALLBUSINESS_V 0x00000023 +# define NL_PRODUCT_STANDARD_SERVER_V 0x00000024 +# define NL_PRODUCT_DATACENTER_SERVER_V 0x00000025 +# define NL_PRODUCT_ENTERPRISE_SERVER_V 0x00000026 +# define NL_PRODUCT_DATACENTER_SERVER_CORE_V 0x00000027 +# define NL_PRODUCT_STANDARD_SERVER_CORE_V 0x00000028 +# define NL_PRODUCT_ENTERPRISE_SERVER_CORE_V 0x00000029 +# define NL_PRODUCT_HYPERV 0x0000002A +# define NL_PRODUCT_STORAGE_EXPRESS_SERVER_CORE 0x0000002B +# define NL_PRODUCT_STORAGE_STANDARD_SERVER_CORE 0x0000002C +# define NL_PRODUCT_STORAGE_WORKGROUP_SERVER_CORE 0x0000002D +# define NL_PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE 0x0000002E +# define NL_PRODUCT_STARTER_N 0x0000002F +# define NL_PRODUCT_PROFESSIONAL 0x00000030 +# define NL_PRODUCT_PROFESSIONAL_N 0x00000031 +# define NL_PRODUCT_SB_SOLUTION_SERVER 0x00000032 +# define NL_PRODUCT_SERVER_FOR_SB_SOLUTIONS 0x00000033 +# define NL_PRODUCT_STANDARD_SERVER_SOLUTIONS 0x00000034 +# define NL_PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE 0x00000035 +# define NL_PRODUCT_SB_SOLUTION_SERVER_EM 0x00000036 +# define NL_PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM 0x00000037 +# define NL_PRODUCT_SOLUTION_EMBEDDEDSERVER 0x00000038 +# define NL_PRODUCT_SOLUTION_EMBEDDEDSERVER_CORE 0x00000039 +# define NL_PRODUCT_PROFESSIONAL_EMBEDDED 0x0000003A +# define NL_PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT 0x0000003B +# define NL_PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL 0x0000003C +# define NL_PRODUCT_ESSENTIALBUSINESS_SERVER_MGMTSVC 0x0000003D +# define NL_PRODUCT_ESSENTIALBUSINESS_SERVER_ADDLSVC 0x0000003E +# define NL_PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE 0x0000003F +# define NL_PRODUCT_CLUSTER_SERVER_V 0x00000040 +# define NL_PRODUCT_EMBEDDED 0x00000041 +# define NL_PRODUCT_STARTER_E 0x00000042 +# define NL_PRODUCT_HOME_BASIC_E 0x00000043 +# define NL_PRODUCT_HOME_PREMIUM_E 0x00000044 +# define NL_PRODUCT_PROFESSIONAL_E 0x00000045 +# define NL_PRODUCT_ENTERPRISE_E 0x00000046 +# define NL_PRODUCT_ULTIMATE_E 0x00000047 +# define NL_PRODUCT_ENTERPRISE_EVALUATION 0x00000048 +# define NL_PRODUCT_MULTIPOINT_STANDARD_SERVER 0x0000004C +# define NL_PRODUCT_MULTIPOINT_PREMIUM_SERVER 0x0000004D +# define NL_PRODUCT_STANDARD_EVALUATION_SERVER 0x0000004F +# define NL_PRODUCT_DATACENTER_EVALUATION_SERVER 0x00000050 +# define NL_PRODUCT_ENTERPRISE_N_EVALUATION 0x00000054 +# define NL_PRODUCT_EMBEDDED_AUTOMOTIVE 0x00000055 +# define NL_PRODUCT_EMBEDDED_INDUSTRY_A 0x00000056 +# define NL_PRODUCT_THINPC 0x00000057 +# define NL_PRODUCT_EMBEDDED_A 0x00000058 +# define NL_PRODUCT_EMBEDDED_INDUSTRY 0x00000059 +# define NL_PRODUCT_EMBEDDED_E 0x0000005A +# define NL_PRODUCT_EMBEDDED_INDUSTRY_E 0x0000005B +# define NL_PRODUCT_EMBEDDED_INDUSTRY_A_E 0x0000005C +# define NL_PRODUCT_STORAGE_WORKGROUP_EVALUATION_SERVER 0x0000005F +# define NL_PRODUCT_STORAGE_STANDARD_EVALUATION_SERVER 0x00000060 +# define NL_PRODUCT_CORE_ARM 0x00000061 +# define NL_PRODUCT_CORE_N 0x00000062 +# define NL_PRODUCT_CORE_COUNTRYSPECIFIC 0x00000063 +# define NL_PRODUCT_CORE_SINGLELANGUAGE 0x00000064 +# define NL_PRODUCT_CORE 0x00000065 +# define NL_PRODUCT_PROFESSIONAL_WMC 0x00000067 +# define NL_PRODUCT_MOBILE_CORE 0x00000068 +# define NL_PRODUCT_EMBEDDED_INDUSTRY_EVAL 0x00000069 +# define NL_PRODUCT_EMBEDDED_INDUSTRY_E_EVAL 0x0000006A +# define NL_PRODUCT_EMBEDDED_EVAL 0x0000006B +# define NL_PRODUCT_EMBEDDED_E_EVAL 0x0000006C +# define NL_PRODUCT_CORE_SERVER 0x0000006D +# define NL_PRODUCT_CLOUD_STORAGE_SERVER 0x0000006E +# define NL_PRODUCT_CORE_CONNECTED 0x0000006F +# define NL_PRODUCT_PROFESSIONAL_STUDENT 0x00000070 +# define NL_PRODUCT_CORE_CONNECTED_N 0x00000071 +# define NL_PRODUCT_PROFESSIONAL_STUDENT_N 0x00000072 +# define NL_PRODUCT_CORE_CONNECTED_SINGLELANGUAGE 0x00000073 +# define NL_PRODUCT_CORE_CONNECTED_COUNTRYSPECIFIC 0x00000074 +# define NL_PRODUCT_CONNECTED_CAR 0x00000075 +# define NL_PRODUCT_INDUSTRY_HANDHELD 0x00000076 +# define NL_PRODUCT_PPI_PRO 0x00000077 +# define NL_PRODUCT_ARM64_SERVER 0x00000078 +# define NL_PRODUCT_EDUCATION 0x00000079 +# define NL_PRODUCT_EDUCATION_N 0x0000007A +# define NL_PRODUCT_IOTUAP 0x0000007B +# define NL_PRODUCT_CLOUD_HOST_INFRASTRUCTURE_SERVER 0x0000007C +# define NL_PRODUCT_ENTERPRISE_S 0x0000007D +# define NL_PRODUCT_ENTERPRISE_S_N 0x0000007E +# define NL_PRODUCT_PROFESSIONAL_S 0x0000007F +# define NL_PRODUCT_PROFESSIONAL_S_N 0x00000080 +# define NL_PRODUCT_ENTERPRISE_S_EVALUATION 0x00000081 +# define NL_PRODUCT_ENTERPRISE_S_N_EVALUATION 0x00000082 +# define NL_PRODUCT_HOLOGRAPHIC 0x00000087 +# define NL_PRODUCT_PRO_SINGLE_LANGUAGE 0x0000008A +# define NL_PRODUCT_PRO_CHINA 0x0000008B +# define NL_PRODUCT_ENTERPRISE_SUBSCRIPTION 0x0000008C +# define NL_PRODUCT_ENTERPRISE_SUBSCRIPTION_N 0x0000008D +# define NL_PRODUCT_DATACENTER_NANO_SERVER 0x0000008F +# define NL_PRODUCT_STANDARD_NANO_SERVER 0x00000090 +# define NL_PRODUCT_DATACENTER_A_SERVER_CORE 0x00000091 +# define NL_PRODUCT_STANDARD_A_SERVER_CORE 0x00000092 +# define NL_PRODUCT_DATACENTER_WS_SERVER_CORE 0x00000093 +# define NL_PRODUCT_STANDARD_WS_SERVER_CORE 0x00000094 +# define NL_PRODUCT_UTILITY_VM 0x00000095 +# define NL_PRODUCT_DATACENTER_EVALUATION_SERVER_CORE 0x0000009F +# define NL_PRODUCT_STANDARD_EVALUATION_SERVER_CORE 0x000000A0 +# define NL_PRODUCT_PRO_WORKSTATION 0x000000A1 +# define NL_PRODUCT_PRO_WORKSTATION_N 0x000000A2 +# define NL_PRODUCT_PRO_FOR_EDUCATION 0x000000A4 +# define NL_PRODUCT_PRO_FOR_EDUCATION_N 0x000000A5 +# define NL_PRODUCT_AZURE_SERVER_CORE 0x000000A8 +# define NL_PRODUCT_AZURE_NANO_SERVER 0x000000A9 +# define NL_PRODUCT_ENTERPRISEG 0x000000AB +# define NL_PRODUCT_ENTERPRISEGN 0x000000AC +# define NL_PRODUCT_SERVERRDSH 0x000000AF +# define NL_PRODUCT_CLOUD 0x000000B2 +# define NL_PRODUCT_CLOUDN 0x000000B3 +# define NL_PRODUCT_UNLICENSED 0xABCDABCD + #else # include # include @@ -443,544 +593,461 @@ string CSystemInfo::getOS() if (pGetProductInfo && pGetProductInfo(osvi.dwMajorVersion, osvi.dwMinorVersion, osvi.wServicePackMajor, osvi.wServicePackMinor, &dwType)) { // Test for the specific product family. + // see https://msdn.microsoft.com/fr-fr/library/windows/desktop/ms724358(v=vs.85).aspx switch (dwType) { -#ifdef PRODUCT_UNLICENSED - case PRODUCT_UNLICENSED: + case NL_PRODUCT_UNLICENSED: OSString += " Unlicensed"; break; -#endif -#ifdef PRODUCT_ULTIMATE - case PRODUCT_ULTIMATE: + case NL_PRODUCT_ULTIMATE: OSString += " Ultimate"; break; -#endif -#ifdef PRODUCT_HOME_BASIC - case PRODUCT_HOME_BASIC: + case NL_PRODUCT_HOME_BASIC: OSString += " Home Basic"; break; -#endif -#ifdef PRODUCT_HOME_PREMIUM - case PRODUCT_HOME_PREMIUM: + case NL_PRODUCT_HOME_PREMIUM: OSString += " Home Premium"; break; -#endif -#ifdef PRODUCT_ENTERPRISE - case PRODUCT_ENTERPRISE: + case NL_PRODUCT_ENTERPRISE: OSString += " Enterprise"; break; -#endif -#ifdef PRODUCT_HOME_BASIC_N - case PRODUCT_HOME_BASIC_N: + case NL_PRODUCT_HOME_BASIC_N: OSString += " Home Basic N"; break; -#endif -#ifdef PRODUCT_BUSINESS - case PRODUCT_BUSINESS: + case NL_PRODUCT_BUSINESS: OSString += " Business"; break; -#endif -#ifdef PRODUCT_STANDARD_SERVER - case PRODUCT_STANDARD_SERVER: + case NL_PRODUCT_STANDARD_SERVER: OSString += " Server Standard"; break; -#endif -#ifdef PRODUCT_DATACENTER_SERVER - case PRODUCT_DATACENTER_SERVER: + case NL_PRODUCT_DATACENTER_SERVER: OSString += " Server Datacenter (full installation)"; break; -#endif -#ifdef PRODUCT_SMALLBUSINESS_SERVER - case PRODUCT_SMALLBUSINESS_SERVER: + case NL_PRODUCT_SMALLBUSINESS_SERVER: OSString += " Small Business Server"; break; -#endif -#ifdef PRODUCT_ENTERPRISE_SERVER - case PRODUCT_ENTERPRISE_SERVER: + case NL_PRODUCT_ENTERPRISE_SERVER: OSString += " Server Enterprise (full installation)"; break; -#endif -#ifdef PRODUCT_STARTER - case PRODUCT_STARTER: + case NL_PRODUCT_STARTER: OSString += " Starter"; break; -#endif -#ifdef PRODUCT_DATACENTER_SERVER_CORE - case PRODUCT_DATACENTER_SERVER_CORE: + case NL_PRODUCT_DATACENTER_SERVER_CORE: OSString += " Server Datacenter (core installation)"; break; -#endif -#ifdef PRODUCT_STANDARD_SERVER_CORE - case PRODUCT_STANDARD_SERVER_CORE: + case NL_PRODUCT_STANDARD_SERVER_CORE: OSString += " Server Standard (core installation)"; break; -#endif -#ifdef PRODUCT_ENTERPRISE_SERVER_CORE - case PRODUCT_ENTERPRISE_SERVER_CORE: + case NL_PRODUCT_ENTERPRISE_SERVER_CORE: OSString += " Server Enterprise (core installation)"; break; -#endif -#ifdef PRODUCT_ENTERPRISE_SERVER_IA64 - case PRODUCT_ENTERPRISE_SERVER_IA64: + case NL_PRODUCT_ENTERPRISE_SERVER_IA64: OSString += " Server Enterprise for Itanium-based Systems"; break; -#endif -#ifdef PRODUCT_BUSINESS_N - case PRODUCT_BUSINESS_N: + case NL_PRODUCT_BUSINESS_N: OSString += " Business N"; break; -#endif -#ifdef PRODUCT_WEB_SERVER - case PRODUCT_WEB_SERVER: + case NL_PRODUCT_WEB_SERVER: OSString += " Web Server (full installation)"; break; -#endif -#ifdef PRODUCT_CLUSTER_SERVER - case PRODUCT_CLUSTER_SERVER: + case NL_PRODUCT_CLUSTER_SERVER: OSString += " Server Hyper Core"; break; -#endif -#ifdef PRODUCT_HOME_SERVER - case PRODUCT_HOME_SERVER: + case NL_PRODUCT_HOME_SERVER: OSString += " Home Server"; break; -#endif -#ifdef PRODUCT_STORAGE_EXPRESS_SERVER - case PRODUCT_STORAGE_EXPRESS_SERVER: + case NL_PRODUCT_STORAGE_EXPRESS_SERVER: OSString += " Storage Server Express"; break; -#endif -#ifdef PRODUCT_STORAGE_STANDARD_SERVER - case PRODUCT_STORAGE_STANDARD_SERVER: + case NL_PRODUCT_STORAGE_STANDARD_SERVER: OSString += " Storage Server Standard"; break; -#endif -#ifdef PRODUCT_STORAGE_WORKGROUP_SERVER - case PRODUCT_STORAGE_WORKGROUP_SERVER: + case NL_PRODUCT_STORAGE_WORKGROUP_SERVER: OSString += " Storage Server Workgroup"; break; -#endif -#ifdef PRODUCT_STORAGE_ENTERPRISE_SERVER - case PRODUCT_STORAGE_ENTERPRISE_SERVER: + case NL_PRODUCT_STORAGE_ENTERPRISE_SERVER: OSString += " Storage Server Enterprise"; break; -#endif -#ifdef PRODUCT_SERVER_FOR_SMALLBUSINESS - case PRODUCT_SERVER_FOR_SMALLBUSINESS: + case NL_PRODUCT_SERVER_FOR_SMALLBUSINESS: OSString += " Essential Server Solutions"; break; -#endif -#ifdef PRODUCT_SMALLBUSINESS_SERVER_PREMIUM - case PRODUCT_SMALLBUSINESS_SERVER_PREMIUM: + case NL_PRODUCT_SMALLBUSINESS_SERVER_PREMIUM: OSString += " Small Business Server Premium"; break; -#endif -#ifdef PRODUCT_HOME_PREMIUM_N - case PRODUCT_HOME_PREMIUM_N: + case NL_PRODUCT_HOME_PREMIUM_N: OSString += " Home Premium N"; break; -#endif -#ifdef PRODUCT_ENTERPRISE_N - case PRODUCT_ENTERPRISE_N: + case NL_PRODUCT_ENTERPRISE_N: OSString += " Enterprise N"; break; -#endif -#ifdef PRODUCT_ULTIMATE_N - case PRODUCT_ULTIMATE_N: + case NL_PRODUCT_ULTIMATE_N: OSString += " Ultimate N"; break; -#endif -#ifdef PRODUCT_WEB_SERVER_CORE - case PRODUCT_WEB_SERVER_CORE: + case NL_PRODUCT_WEB_SERVER_CORE: OSString += " Web Server (core installation)"; break; -#endif -#ifdef PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT - case PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT: + case NL_PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT: OSString += " Essential Business Server Management Server"; break; -#endif -#ifdef PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY - case PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY: + case NL_PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY: OSString += " Essential Business Server Security Server"; break; -#endif -#ifdef PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING - case PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING: + case NL_PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING: OSString += " Essential Business Server Messaging Server"; break; -#endif -#ifdef PRODUCT_SERVER_FOUNDATION - case PRODUCT_SERVER_FOUNDATION: + case NL_PRODUCT_SERVER_FOUNDATION: OSString += " Server Foundation"; break; -#endif -#ifdef PRODUCT_HOME_PREMIUM_SERVER - case PRODUCT_HOME_PREMIUM_SERVER: + case NL_PRODUCT_HOME_PREMIUM_SERVER: OSString += " Home Server"; break; -#endif -#ifdef PRODUCT_SERVER_FOR_SMALLBUSINESS_V - case PRODUCT_SERVER_FOR_SMALLBUSINESS_V: + case NL_PRODUCT_SERVER_FOR_SMALLBUSINESS_V: OSString += " Server without Hyper-V for Windows Essential Server Solutions"; break; -#endif -#ifdef PRODUCT_STANDARD_SERVER_V - case PRODUCT_STANDARD_SERVER_V: + case NL_PRODUCT_STANDARD_SERVER_V: OSString += " Server Standard without Hyper-V"; break; -#endif -#ifdef PRODUCT_DATACENTER_SERVER_V - case PRODUCT_DATACENTER_SERVER_V: + case NL_PRODUCT_DATACENTER_SERVER_V: OSString += " Server Datacenter without Hyper-V (full installation)"; break; -#endif -#ifdef PRODUCT_ENTERPRISE_SERVER_V - case PRODUCT_ENTERPRISE_SERVER_V: + case NL_PRODUCT_ENTERPRISE_SERVER_V: OSString += " Enterprise without Hyper-V (full installation)"; break; -#endif -#ifdef PRODUCT_DATACENTER_SERVER_CORE_V - case PRODUCT_DATACENTER_SERVER_CORE_V: + case NL_PRODUCT_DATACENTER_SERVER_CORE_V: OSString += " Datacenter without Hyper-V (core installation)"; break; -#endif -#ifdef PRODUCT_STANDARD_SERVER_CORE_V - case PRODUCT_STANDARD_SERVER_CORE_V: + case NL_PRODUCT_STANDARD_SERVER_CORE_V: OSString += " Standard without Hyper-V (core installation)"; break; -#endif -#ifdef PRODUCT_ENTERPRISE_SERVER_CORE_V - case PRODUCT_ENTERPRISE_SERVER_CORE_V: + case NL_PRODUCT_ENTERPRISE_SERVER_CORE_V: OSString += " Enterprise without Hyper-V (core installation)"; break; -#endif -#ifdef PRODUCT_HYPERV - case PRODUCT_HYPERV: + case NL_PRODUCT_HYPERV: OSString += " Hyper-V Server"; break; -#endif -#ifdef PRODUCT_STORAGE_EXPRESS_SERVER_CORE - case PRODUCT_STORAGE_EXPRESS_SERVER_CORE: + case NL_PRODUCT_STORAGE_EXPRESS_SERVER_CORE: OSString += " Storage Server Express (core installation)"; break; -#endif -#ifdef PRODUCT_STORAGE_STANDARD_SERVER_CORE - case PRODUCT_STORAGE_STANDARD_SERVER_CORE: + case NL_PRODUCT_STORAGE_STANDARD_SERVER_CORE: OSString += " Storage Server Standard (core installation)"; break; -#endif -#ifdef PRODUCT_STORAGE_WORKGROUP_SERVER_CORE - case PRODUCT_STORAGE_WORKGROUP_SERVER_CORE: + case NL_PRODUCT_STORAGE_WORKGROUP_SERVER_CORE: OSString += " Storage Server Workgroup (core installation)"; break; -#endif -#ifdef PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE - case PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE: + case NL_PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE: OSString += " Storage Server Enterprise (core installation)"; break; -#endif -#ifdef PRODUCT_STARTER_N - case PRODUCT_STARTER_N: + case NL_PRODUCT_STARTER_N: OSString += " Starter N Edition"; break; -#endif -#ifdef PRODUCT_PROFESSIONAL - case PRODUCT_PROFESSIONAL: + case NL_PRODUCT_PROFESSIONAL: OSString += " Professional"; break; -#endif -#ifdef PRODUCT_PROFESSIONAL_N - case PRODUCT_PROFESSIONAL_N: + case NL_PRODUCT_PROFESSIONAL_N: OSString += " Professional N"; break; -#endif -#ifdef PRODUCT_SB_SOLUTION_SERVER - case PRODUCT_SB_SOLUTION_SERVER: + case NL_PRODUCT_SB_SOLUTION_SERVER: OSString += " Small Business Server"; break; -#endif -#ifdef PRODUCT_SERVER_FOR_SB_SOLUTIONS - case PRODUCT_SERVER_FOR_SB_SOLUTIONS: + case NL_PRODUCT_SERVER_FOR_SB_SOLUTIONS: OSString += " Server For Small Business Solutions"; break; -#endif -#ifdef PRODUCT_STANDARD_SERVER_SOLUTIONS - case PRODUCT_STANDARD_SERVER_SOLUTIONS: + case NL_PRODUCT_STANDARD_SERVER_SOLUTIONS: OSString += " Server Solutions Premium"; break; -#endif -#ifdef PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE - case PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE: + case NL_PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE: OSString += " Server Solutions Premium (core installation)"; break; -#endif -#ifdef PRODUCT_SB_SOLUTION_SERVER_EM - case PRODUCT_SB_SOLUTION_SERVER_EM: + case NL_PRODUCT_SB_SOLUTION_SERVER_EM: OSString += " Server For Small Business Solutions EM"; break; -#endif -#ifdef PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM - case PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM: + case NL_PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM: OSString += " Server For Small Business Solutions EM"; break; -#endif - -#ifdef PRODUCT_SOLUTION_EMBEDDEDSERVER - case PRODUCT_SOLUTION_EMBEDDEDSERVER: + case NL_PRODUCT_SOLUTION_EMBEDDEDSERVER: OSString += " Solution Embedded Server (full installation)"; break; -#endif -#ifdef PRODUCT_SOLUTION_EMBEDDEDSERVER_CORE - case PRODUCT_SOLUTION_EMBEDDEDSERVER_CORE: + case NL_PRODUCT_SOLUTION_EMBEDDEDSERVER_CORE: OSString += " Solution Embedded Server (core installation)"; break; -#endif -#ifdef PRODUCT_PROFESSIONAL_EMBEDDED - case PRODUCT_PROFESSIONAL_EMBEDDED: + case NL_PRODUCT_PROFESSIONAL_EMBEDDED: OSString += " Professional Embedded"; break; -#endif -#ifdef PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT - case PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT: + case NL_PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT: OSString += " Essential Server Solution Management"; break; -#endif -#ifdef PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL - case PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL: + case NL_PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL: OSString += " Essential Server Solution Additional"; break; -#endif -#ifdef PRODUCT_ESSENTIALBUSINESS_SERVER_MGMTSVC - case PRODUCT_ESSENTIALBUSINESS_SERVER_MGMTSVC: + case NL_PRODUCT_ESSENTIALBUSINESS_SERVER_MGMTSVC: OSString += " Essential Server Solution Management SVC"; break; -#endif -#ifdef PRODUCT_ESSENTIALBUSINESS_SERVER_ADDLSVC - case PRODUCT_ESSENTIALBUSINESS_SERVER_ADDLSVC: + case NL_PRODUCT_ESSENTIALBUSINESS_SERVER_ADDLSVC: OSString += " Essential Server Solution Additional SVC"; break; -#endif -#ifdef PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE - case PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE: + case NL_PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE: OSString += " Small Business Server Premium (core installation)"; break; -#endif -#ifdef PRODUCT_CLUSTER_SERVER_V - case PRODUCT_CLUSTER_SERVER_V: + case NL_PRODUCT_CLUSTER_SERVER_V: OSString += " Server Hyper Core V"; break; -#endif -#ifdef PRODUCT_EMBEDDED - case PRODUCT_EMBEDDED: + case NL_PRODUCT_EMBEDDED: OSString += " Embedded"; break; -#endif -#ifdef PRODUCT_STARTER_E - case PRODUCT_STARTER_E: + case NL_PRODUCT_STARTER_E: OSString += " Starter E"; break; -#endif -#ifdef PRODUCT_HOME_BASIC_E - case PRODUCT_HOME_BASIC_E: + case NL_PRODUCT_HOME_BASIC_E: OSString += " Home Basic E"; break; -#endif -#ifdef PRODUCT_HOME_PREMIUM_E - case PRODUCT_HOME_PREMIUM_E: + case NL_PRODUCT_HOME_PREMIUM_E: OSString += " Home Premium E"; break; -#endif -#ifdef PRODUCT_PROFESSIONAL_E - case PRODUCT_PROFESSIONAL_E: + case NL_PRODUCT_PROFESSIONAL_E: OSString += " Professional E"; break; -#endif -#ifdef PRODUCT_ENTERPRISE_E - case PRODUCT_ENTERPRISE_E: + case NL_PRODUCT_ENTERPRISE_E: OSString += " Enterprise E"; break; -#endif -#ifdef PRODUCT_ULTIMATE_E - case PRODUCT_ULTIMATE_E: + case NL_PRODUCT_ULTIMATE_E: OSString += " Ultimate E"; break; -#endif -#ifdef PRODUCT_ENTERPRISE_EVALUATION - case PRODUCT_ENTERPRISE_EVALUATION: + case NL_PRODUCT_ENTERPRISE_EVALUATION: OSString += " Enterprise Evaluation"; break; -#endif -#ifdef PRODUCT_MULTIPOINT_STANDARD_SERVER - case PRODUCT_MULTIPOINT_STANDARD_SERVER: + // nothing from 0x49 to 0x4b + case NL_PRODUCT_MULTIPOINT_STANDARD_SERVER: OSString += " MultiPoint Server Standard (full installation)"; break; -#endif -#ifdef PRODUCT_MULTIPOINT_PREMIUM_SERVER - case PRODUCT_MULTIPOINT_PREMIUM_SERVER: + case NL_PRODUCT_MULTIPOINT_PREMIUM_SERVER: OSString += " MultiPoint Server Premium (full installation)"; break; -#endif -#ifdef PRODUCT_STANDARD_EVALUATION_SERVER - case PRODUCT_STANDARD_EVALUATION_SERVER: + case NL_PRODUCT_STANDARD_EVALUATION_SERVER: OSString += " Server Standard (evaluation installation)"; break; -#endif -#ifdef PRODUCT_DATACENTER_EVALUATION_SERVER - case PRODUCT_DATACENTER_EVALUATION_SERVER: + case NL_PRODUCT_DATACENTER_EVALUATION_SERVER: OSString += " Server Datacenter (evaluation installation)"; break; -#endif -#ifdef PRODUCT_ENTERPRISE_N_EVALUATION - case PRODUCT_ENTERPRISE_N_EVALUATION: + // nothing from 0x51 to 0x53 + case NL_PRODUCT_ENTERPRISE_N_EVALUATION: OSString += " Enterprise N (evaluation installation)"; break; -#endif -#ifdef PRODUCT_EMBEDDED_AUTOMOTIVE - case PRODUCT_EMBEDDED_AUTOMOTIVE: + case NL_PRODUCT_EMBEDDED_AUTOMOTIVE: OSString += " Embedded Automotive"; break; -#endif -#ifdef PRODUCT_EMBEDDED_INDUSTRY_A - case PRODUCT_EMBEDDED_INDUSTRY_A: + case NL_PRODUCT_EMBEDDED_INDUSTRY_A: OSString += " Embedded Industry A"; break; -#endif -#ifdef PRODUCT_THINPC - case PRODUCT_THINPC: + case NL_PRODUCT_THINPC: OSString += " Thin PC"; break; -#endif -#ifdef PRODUCT_EMBEDDED_A - case PRODUCT_EMBEDDED_A: + case NL_PRODUCT_EMBEDDED_A: OSString += " Embedded A"; break; -#endif -#ifdef PRODUCT_EMBEDDED_INDUSTRY - case PRODUCT_EMBEDDED_INDUSTRY: + case NL_PRODUCT_EMBEDDED_INDUSTRY: OSString += " Embedded Industry"; break; -#endif -#ifdef PRODUCT_EMBEDDED_E - case PRODUCT_EMBEDDED_E: + case NL_PRODUCT_EMBEDDED_E: OSString += " Embedded E"; break; -#endif -#ifdef PRODUCT_EMBEDDED_INDUSTRY_E - case PRODUCT_EMBEDDED_INDUSTRY_E: + case NL_PRODUCT_EMBEDDED_INDUSTRY_E: OSString += " Embedded Industry E"; break; -#endif -#ifdef PRODUCT_EMBEDDED_INDUSTRY_A_E - case PRODUCT_EMBEDDED_INDUSTRY_A_E: + case NL_PRODUCT_EMBEDDED_INDUSTRY_A_E: OSString += " Embedded Industry A E"; break; -#endif -#ifdef PRODUCT_STORAGE_WORKGROUP_EVALUATION_SERVER - case PRODUCT_STORAGE_WORKGROUP_EVALUATION_SERVER: + // nothing from 0x5d to 0x5e + case NL_PRODUCT_STORAGE_WORKGROUP_EVALUATION_SERVER: OSString += " Storage Server Workgroup (evaluation installation)"; break; -#endif -#ifdef PRODUCT_STORAGE_STANDARD_EVALUATION_SERVER - case PRODUCT_STORAGE_STANDARD_EVALUATION_SERVER: + case NL_PRODUCT_STORAGE_STANDARD_EVALUATION_SERVER: OSString += " Storage Server Standard (evaluation installation)"; break; -#endif -#ifdef PRODUCT_CORE_ARM - case PRODUCT_CORE_ARM: + case NL_PRODUCT_CORE_ARM: OSString += " RT"; break; -#endif -#ifdef PRODUCT_CORE_N - case PRODUCT_CORE_N: + case NL_PRODUCT_CORE_N: OSString += " Home N"; break; -#endif -#ifdef PRODUCT_CORE_COUNTRYSPECIFIC - case PRODUCT_CORE_COUNTRYSPECIFIC: + case NL_PRODUCT_CORE_COUNTRYSPECIFIC: OSString += " Home China"; break; -#endif -#ifdef PRODUCT_CORE_SINGLELANGUAGE - case PRODUCT_CORE_SINGLELANGUAGE: + case NL_PRODUCT_CORE_SINGLELANGUAGE: OSString += " Home Single Language"; break; -#endif -#ifdef PRODUCT_CORE - case PRODUCT_CORE: + case NL_PRODUCT_CORE: OSString += " Home"; break; -#endif -#ifdef PRODUCT_PROFESSIONAL_WMC - case PRODUCT_PROFESSIONAL_WMC: + // nothing at 0x66 + case NL_PRODUCT_PROFESSIONAL_WMC: OSString += " Professional with Media Center"; break; -#endif -#ifdef PRODUCT_MOBILE_CORE - case PRODUCT_MOBILE_CORE: + case NL_PRODUCT_MOBILE_CORE: OSString += " Mobile"; break; -#endif -#ifdef PRODUCT_EMBEDDED_INDUSTRY_EVAL - case PRODUCT_EMBEDDED_INDUSTRY_EVAL: + case NL_PRODUCT_EMBEDDED_INDUSTRY_EVAL: OSString += " Embedded Industry (evaluation installation)"; break; -#endif -#ifdef PRODUCT_EMBEDDED_INDUSTRY_E_EVAL - case PRODUCT_EMBEDDED_INDUSTRY_E_EVAL: + case NL_PRODUCT_EMBEDDED_INDUSTRY_E_EVAL: OSString += " Embedded Industry E (evaluation installation)"; break; -#endif -#ifdef PRODUCT_EMBEDDED_EVAL - case PRODUCT_EMBEDDED_EVAL: + case NL_PRODUCT_EMBEDDED_EVAL: OSString += " Embedded (evaluation installation)"; break; -#endif -#ifdef PRODUCT_EMBEDDED_E_EVAL - case PRODUCT_EMBEDDED_E_EVAL: + case NL_PRODUCT_EMBEDDED_E_EVAL: OSString += " Embedded E (evaluation installation)"; break; -#endif -#ifdef PRODUCT_CORE_SERVER - case PRODUCT_CORE_SERVER: + case NL_PRODUCT_CORE_SERVER: OSString += " Server"; break; -#endif -#ifdef PRODUCT_CLOUD_STORAGE_SERVER - case PRODUCT_CLOUD_STORAGE_SERVER: + case NL_PRODUCT_CLOUD_STORAGE_SERVER: OSString += " Server Could Storage"; break; -#endif -#ifdef PRODUCT_CORE_CONNECTED - case PRODUCT_CORE_CONNECTED: + case NL_PRODUCT_CORE_CONNECTED: OSString += " Home Connected"; break; -#endif -#ifdef PRODUCT_PROFESSIONAL_STUDENT - case PRODUCT_PROFESSIONAL_STUDENT: + case NL_PRODUCT_PROFESSIONAL_STUDENT: OSString += " Professional Student"; break; -#endif -#ifdef PRODUCT_CORE_CONNECTED_N - case PRODUCT_CORE_CONNECTED_N: + case NL_PRODUCT_CORE_CONNECTED_N: OSString += " Home N Connected"; break; -#endif -#ifdef PRODUCT_PROFESSIONAL_STUDENT_N - case PRODUCT_PROFESSIONAL_STUDENT_N: + case NL_PRODUCT_PROFESSIONAL_STUDENT_N: OSString += " Professional Student N"; break; -#endif -#ifdef PRODUCT_CORE_CONNECTED_SINGLELANGUAGE - case PRODUCT_CORE_CONNECTED_SINGLELANGUAGE: + case NL_PRODUCT_CORE_CONNECTED_SINGLELANGUAGE: OSString += " Home Single Language Connected"; break; -#endif -#ifdef PRODUCT_CORE_CONNECTED_COUNTRYSPECIFIC - case PRODUCT_CORE_CONNECTED_COUNTRYSPECIFIC: + case NL_PRODUCT_CORE_CONNECTED_COUNTRYSPECIFIC: OSString += " Home China Connected"; break; -#endif + case NL_PRODUCT_CONNECTED_CAR: + OSString += " Connected Car"; + break; + case NL_PRODUCT_INDUSTRY_HANDHELD: + OSString += " Industry Handheld"; + break; + case NL_PRODUCT_PPI_PRO: + OSString += " PPI Pro"; + break; + case NL_PRODUCT_ARM64_SERVER: + OSString += " ARM64 Server"; + break; + case NL_PRODUCT_EDUCATION: + OSString += " Education"; + break; + case NL_PRODUCT_EDUCATION_N: + OSString += " Education N"; + break; + case NL_PRODUCT_IOTUAP: + OSString += " IoT Core"; + break; + case NL_PRODUCT_CLOUD_HOST_INFRASTRUCTURE_SERVER: + OSString += " Cloud Host Infrastructure Server"; + break; + case NL_PRODUCT_ENTERPRISE_S: + OSString += " Product Enterprise S"; + break; + case NL_PRODUCT_ENTERPRISE_S_N: + OSString += " Enterprise S N"; + break; + case NL_PRODUCT_PROFESSIONAL_S: + OSString += " Professional S"; + break; + case NL_PRODUCT_PROFESSIONAL_S_N: + OSString += " Professional S N"; + break; + case NL_PRODUCT_ENTERPRISE_S_EVALUATION: + OSString += " Enterprise S Evaluation"; + break; + case NL_PRODUCT_ENTERPRISE_S_N_EVALUATION: + OSString += " Enterprise S N Evaluation"; + break; + // nothing from x83 to 0x86 + case NL_PRODUCT_HOLOGRAPHIC: + OSString += " Holographic"; + break; + // nothing from x88 to 0x89 + case NL_PRODUCT_PRO_SINGLE_LANGUAGE: + OSString += " Pro Single Language"; + break; + case NL_PRODUCT_PRO_CHINA: + OSString += " Pro China"; + break; + case NL_PRODUCT_ENTERPRISE_SUBSCRIPTION: + OSString += " Enterprise Subscription"; + break; + case NL_PRODUCT_ENTERPRISE_SUBSCRIPTION_N: + OSString += " Enterprise Subscription N"; + break; + // nothing at 0x8e + case NL_PRODUCT_DATACENTER_NANO_SERVER: + OSString += " Datacenter Nano Server"; + break; + case NL_PRODUCT_STANDARD_NANO_SERVER: + OSString += " Standard Nano Server"; + break; + case NL_PRODUCT_DATACENTER_A_SERVER_CORE: + OSString += " Datacenter A Server Core"; + break; + case NL_PRODUCT_STANDARD_A_SERVER_CORE: + OSString += " Standard A Server Core"; + break; + case NL_PRODUCT_DATACENTER_WS_SERVER_CORE: + OSString += " Datacenter WS Server Core"; + break; + case NL_PRODUCT_STANDARD_WS_SERVER_CORE: + OSString += " Standard WS Server Core"; + break; + case NL_PRODUCT_UTILITY_VM: + OSString += " Utility VM"; + break; + // nothing from 0x96 to 0x9e + case NL_PRODUCT_DATACENTER_EVALUATION_SERVER_CORE: + OSString += " Datacenter_evaluation_server_core"; + break; + case NL_PRODUCT_STANDARD_EVALUATION_SERVER_CORE: + OSString += " Standard Evaluation Server Core"; + break; + case NL_PRODUCT_PRO_WORKSTATION: + OSString += " Pro Workstation"; + break; + case NL_PRODUCT_PRO_WORKSTATION_N: + OSString += " Pro Workstation N"; + break; + // nothing at 0xa3 + case NL_PRODUCT_PRO_FOR_EDUCATION: + OSString += " Pro for Education"; + break; + case NL_PRODUCT_PRO_FOR_EDUCATION_N: + OSString += " Pro for Education N"; + break; + // nothing from 0xa6 to 0xa7 + case NL_PRODUCT_AZURE_SERVER_CORE: + OSString += " Azure Server Core"; + break; + case NL_PRODUCT_AZURE_NANO_SERVER: + OSString += " Azure Nano Server"; + break; + // nothing at 0xaa + case NL_PRODUCT_ENTERPRISEG: + OSString += " Enterprise G"; + break; + case NL_PRODUCT_ENTERPRISEGN: + OSString += " Enterprise GN"; + break; + // nothing from 0xad to 0xae + case NL_PRODUCT_SERVERRDSH: + OSString += " Server RDSH"; + break; + // nothing from 0xb0 to 0xb1 + case NL_PRODUCT_CLOUD: + OSString += " Cloud"; + break; + case NL_PRODUCT_CLOUDN: + OSString += " Cloud N"; + break; + default: OSString += toString(" Unknown Edition (0x%04x)", dwType); } diff --git a/code/nel/src/misc/win_displayer.cpp b/code/nel/src/misc/win_displayer.cpp index b157448ec..d350f25f3 100644 --- a/code/nel/src/misc/win_displayer.cpp +++ b/code/nel/src/misc/win_displayer.cpp @@ -502,7 +502,7 @@ void CWinDisplayer::clear () SendMessageW (_HEdit, EM_SETSEL, 0, nIndex); // clear all the text - SendMessageW (_HEdit, EM_REPLACESEL, FALSE, (LPARAM) ""); + SendMessageW (_HEdit, EM_REPLACESEL, FALSE, (LPARAM) L""); SendMessageW(_HEdit,EM_SETMODIFY,(WPARAM)TRUE,(LPARAM)0); @@ -575,7 +575,7 @@ void CWinDisplayer::display_main () LRESULT oldIndex2 = SendMessageW (_HEdit, EM_LINEINDEX, nblineremove, 0); //nlassert (oldIndex2 != -1); SendMessageW (_HEdit, EM_SETSEL, oldIndex1, oldIndex2); - SendMessageW (_HEdit, EM_REPLACESEL, FALSE, (LPARAM) ""); + SendMessageW (_HEdit, EM_REPLACESEL, FALSE, (LPARAM) L""); // update the selection due to the erasing sint dt = (sint)(oldIndex2 - oldIndex1); diff --git a/code/nel/src/net/buf_client.cpp b/code/nel/src/net/buf_client.cpp index 350b2d6db..18ce7babf 100644 --- a/code/nel/src/net/buf_client.cpp +++ b/code/nel/src/net/buf_client.cpp @@ -32,6 +32,10 @@ # include #endif +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; using namespace std; diff --git a/code/nel/src/net/inet_address.cpp b/code/nel/src/net/inet_address.cpp index 093bf8dcb..13ae02c39 100644 --- a/code/nel/src/net/inet_address.cpp +++ b/code/nel/src/net/inet_address.cpp @@ -121,6 +121,10 @@ BOOLEAN IN6_IS_ADDR_UNSPECIFIED(CONST IN6_ADDR *a) using namespace std; using namespace NLMISC; +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + #ifndef NI_MAXHOST # define NI_MAXHOST 1025 #endif diff --git a/code/nel/src/net/module.cpp b/code/nel/src/net/module.cpp index 73a1c7867..1b5e03bec 100644 --- a/code/nel/src/net/module.cpp +++ b/code/nel/src/net/module.cpp @@ -24,6 +24,10 @@ #include "nel/net/module_gateway.h" #include "nel/net/module_socket.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; using namespace NLNET; diff --git a/code/nel/src/net/stdnet.h b/code/nel/src/net/stdnet.h index 16e87c9f8..6ced991a5 100644 --- a/code/nel/src/net/stdnet.h +++ b/code/nel/src/net/stdnet.h @@ -17,20 +17,11 @@ #ifndef NL_STDNET_H #define NL_STDNET_H -#include "nel/misc/types_nl.h" - -#ifdef NL_OS_WINDOWS -# define WIN32_LEAN_AND_MEAN -# define _WIN32_WINDOWS 0x0500 -# ifndef _WIN32_WINNT -# define _WIN32_WINNT 0x0500 -# endif -# ifndef NL_COMP_MINGW -# define WINVER 0x0500 -# define NOMINMAX -# endif -# include -# include +#if defined(_MSC_VER) && defined(_DEBUG) +#define _CRTDBG_MAP_ALLOC +#include +#include +#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__) #endif #include @@ -55,6 +46,7 @@ #include +#include "nel/misc/types_nl.h" #include "nel/misc/debug.h" #include "nel/misc/common.h" #include "nel/misc/stream.h" @@ -64,4 +56,18 @@ #include "nel/misc/mem_stream.h" #include "nel/misc/hierarchical_timer.h" +#ifdef NL_OS_WINDOWS +# define WIN32_LEAN_AND_MEAN +# define _WIN32_WINDOWS 0x0500 +# ifndef _WIN32_WINNT +# define _WIN32_WINNT 0x0500 +# endif +# ifndef NL_COMP_MINGW +# define WINVER 0x0500 +# define NOMINMAX +# endif +# include +# include +#endif + #endif diff --git a/code/nel/src/net/transport_class.cpp b/code/nel/src/net/transport_class.cpp index 810ea6928..9dade0190 100644 --- a/code/nel/src/net/transport_class.cpp +++ b/code/nel/src/net/transport_class.cpp @@ -33,6 +33,9 @@ #include "nel/net/transport_class.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif // // Namespace diff --git a/code/nel/src/net/unified_network.cpp b/code/nel/src/net/unified_network.cpp index 3a57b4b0d..2589e1cbf 100644 --- a/code/nel/src/net/unified_network.cpp +++ b/code/nel/src/net/unified_network.cpp @@ -828,7 +828,6 @@ void CUnifiedNetwork::addService(const string &name, const vector for (uint i = 0; i < addr.size(); i++) { // first we have to look if we have a network that can established the connection - uint j = 0; // it's loopback ip address, it's ok diff --git a/code/nel/src/pacs/surface_quad.cpp b/code/nel/src/pacs/surface_quad.cpp index dade8462c..308dc0054 100644 --- a/code/nel/src/pacs/surface_quad.cpp +++ b/code/nel/src/pacs/surface_quad.cpp @@ -19,6 +19,10 @@ #include "nel/misc/file.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace NLMISC; using namespace std; diff --git a/code/nel/src/sound/audio_mixer_user.cpp b/code/nel/src/sound/audio_mixer_user.cpp index 5a21650e0..854a2c1dc 100644 --- a/code/nel/src/sound/audio_mixer_user.cpp +++ b/code/nel/src/sound/audio_mixer_user.cpp @@ -56,6 +56,10 @@ #include "nel/sound/containers.h" #include "nel/sound/audio_decoder.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; diff --git a/code/nel/src/sound/sound_bank.cpp b/code/nel/src/sound/sound_bank.cpp index ee00e1742..29621d337 100644 --- a/code/nel/src/sound/sound_bank.cpp +++ b/code/nel/src/sound/sound_bank.cpp @@ -33,6 +33,10 @@ #include "nel/georges/load_form.h" +#ifdef DEBUG_NEW +#define new DEBUG_NEW +#endif + using namespace std; using namespace NLMISC; using namespace NLGEORGES; diff --git a/code/nel/src/sound/stdsound.h b/code/nel/src/sound/stdsound.h index 071e2c70c..474e64441 100644 --- a/code/nel/src/sound/stdsound.h +++ b/code/nel/src/sound/stdsound.h @@ -14,9 +14,15 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -#include "nel/misc/types_nl.h" -#include "nel/misc/common.h" -#include "nel/misc/debug.h" +#ifndef SOUND_STDPCH_H +#define SOUND_STDPCH_H + +#if defined(_MSC_VER) && defined(_DEBUG) +#define _CRTDBG_MAP_ALLOC +#include +#include +#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__) +#endif #include #include @@ -40,6 +46,11 @@ #include +#include "nel/misc/types_nl.h" +#include "nel/misc/common.h" +#include "nel/misc/debug.h" #include "nel/misc/vector.h" #include "nel/misc/path.h" #include "nel/misc/file.h" + +#endif diff --git a/code/nel/tools/3d/mesh_utils/CMakeLists.txt b/code/nel/tools/3d/mesh_utils/CMakeLists.txt index 0d9f6deb3..d8a5b29d9 100644 --- a/code/nel/tools/3d/mesh_utils/CMakeLists.txt +++ b/code/nel/tools/3d/mesh_utils/CMakeLists.txt @@ -3,11 +3,11 @@ FILE(GLOB HDRS *.h) SOURCE_GROUP("" FILES ${SRCS} ${HDRS}) -INCLUDE_DIRECTORIES(${assimp_INCLUDE_DIRS}) +INCLUDE_DIRECTORIES(${ASSIMP_INCLUDE_DIRS}) NL_TARGET_LIB(mesh_utils ${SRCS} ${HDRS}) -TARGET_LINK_LIBRARIES(mesh_utils ${assimp_LIBRARIES} nelmisc nelpipeline nel3d) +TARGET_LINK_LIBRARIES(mesh_utils ${ASSIMP_LIBRARIES} nelmisc nelpipeline nel3d) NL_DEFAULT_PROPS(mesh_utils "NeL, Tools, 3D: Mesh Utils") NL_ADD_RUNTIME_FLAGS(mesh_utils) diff --git a/code/nel/tools/3d/object_viewer/dup_ps.cpp b/code/nel/tools/3d/object_viewer/dup_ps.cpp index d942a3d6e..1d9f538c4 100644 --- a/code/nel/tools/3d/object_viewer/dup_ps.cpp +++ b/code/nel/tools/3d/object_viewer/dup_ps.cpp @@ -40,7 +40,7 @@ using namespace NL3D; * TODO maybe this could be used elsewhere ? */ template -static T *DupSerializable(const T *in) throw(NLMISC::EStream) +static T *DupSerializable(const T *in) { NLMISC::CMemStream ms; nlassert(!ms.isReading()); @@ -62,7 +62,7 @@ static T *DupSerializable(const T *in) throw(NLMISC::EStream) struct CDupObjPolicy { template - static void serial(T *&obj, NLMISC::IStream &dest) throw(NLMISC::EStream) + static void serial(T *&obj, NLMISC::IStream &dest) { dest.serialPtr(obj); /*if (dest.isReading()) @@ -84,7 +84,7 @@ struct CDupObjPolicy struct CDupPolymorphicObjPolicy { template - static void serial(T *&obj, NLMISC::IStream &dest) throw(NLMISC::EStream) + static void serial(T *&obj, NLMISC::IStream &dest) { dest.serialPolyPtr(obj); } diff --git a/code/nel/tools/3d/object_viewer/object_viewer.cpp b/code/nel/tools/3d/object_viewer/object_viewer.cpp index 2835b9b42..f1f663e38 100644 --- a/code/nel/tools/3d/object_viewer/object_viewer.cpp +++ b/code/nel/tools/3d/object_viewer/object_viewer.cpp @@ -3897,7 +3897,7 @@ bool browseFolder(const CString &caption, CString &destFolder, HWND parent) bi.lpfn = NULL; bi.lParam = NULL; bi.iImage = 0; - LPITEMIDLIST result = SHBrowseForFolder(&bi); + PIDLIST_ABSOLUTE result = SHBrowseForFolder(&bi); if (result != NULL && SHGetPathFromIDList(result, chosenPath)) { destFolder = chosenPath; diff --git a/code/nel/tools/3d/object_viewer/particle_workspace.cpp b/code/nel/tools/3d/object_viewer/particle_workspace.cpp index 54df32400..43be30812 100644 --- a/code/nel/tools/3d/object_viewer/particle_workspace.cpp +++ b/code/nel/tools/3d/object_viewer/particle_workspace.cpp @@ -260,7 +260,7 @@ void CParticleWorkspace::CNode::savePS() //*********************************************************************************************** -void CParticleWorkspace::CNode::savePSAs(const std::string &fullPath) throw(NLMISC::EStream) +void CParticleWorkspace::CNode::savePSAs(const std::string &fullPath) { nlassert(_WS); if (!_PS) return; @@ -415,7 +415,7 @@ void CParticleWorkspace::removeNode(CNode *ptr) } //*********************************************************************************************** -void CParticleWorkspace::save() throw(NLMISC::EStream) +void CParticleWorkspace::save() { NLMISC::COFile stream; stream.open(_Filename); @@ -437,7 +437,7 @@ void CParticleWorkspace::load() } //*********************************************************************************************** -void CParticleWorkspace::serial(NLMISC::IStream &f) throw(NLMISC::EStream) +void CParticleWorkspace::serial(NLMISC::IStream &f) { f.xmlPush("PARTICLE_WORKSPACE"); f.serialVersion(0); diff --git a/code/nel/tools/3d/object_viewer/particle_workspace.h b/code/nel/tools/3d/object_viewer/particle_workspace.h index fb94b2e15..694aab986 100644 --- a/code/nel/tools/3d/object_viewer/particle_workspace.h +++ b/code/nel/tools/3d/object_viewer/particle_workspace.h @@ -60,15 +60,15 @@ public: // Serial node information into workspace stream. This does not save the particle system shape, only a reference to its file void serial(NLMISC::IStream &f); // Save the particle system target file - void savePS() throw(NLMISC::EStream); + void savePS(); // Save particle system with an arbitrary filename - void savePSAs(const std::string &fullPath) throw(NLMISC::EStream); + void savePSAs(const std::string &fullPath); // put back in the unloaded state void unload(); /** Load the particle system target file * \return true if loading succeed (false means that loading was ok, but this is not a particle system). Other cases throw an exception. */ - bool loadPS() throw(NLMISC::EStream); + bool loadPS(); // create an empty particle system void createEmptyPS(); // helper flag to know if a ps has been modified @@ -196,11 +196,11 @@ public: /** Save the workspace structure. The target file is the one given when this object was created * NB : ps shape are not saved, only the structure is. To save the shapes, call CNode::save() */ - void save() throw(NLMISC::EStream); + void save(); /** Load the workspace structure. The target file is the one given when this object was created * All nodes are in the 'unloaded" state, so it is to the caller to load them by calling load() on their node */ - void load() throw(NLMISC::EStream); + void load(); // Test whether the structure of the workspace has been modified (does not test if ps inside the workspace have been modified) bool isModified() const { return _Modified; } // Test whether the content of the workspace has ben modified @@ -229,7 +229,7 @@ private: std::string _Name; // workspace user name private: // serial the object - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); // set the 'modified flag' and call the callback void setModifiedFlag(bool modified); public: diff --git a/code/nel/tools/3d/object_viewer/range_manager.h b/code/nel/tools/3d/object_viewer/range_manager.h index 2bdac5189..338578ce4 100644 --- a/code/nel/tools/3d/object_viewer/range_manager.h +++ b/code/nel/tools/3d/object_viewer/range_manager.h @@ -62,7 +62,7 @@ public: } /// serialization - static void serial(NLMISC::IStream &f) throw(NLMISC::EStream) + static void serial(NLMISC::IStream &f) { uint32 size; if (!f.isReading()) diff --git a/code/nel/tools/3d/object_viewer/scheme_manager.cpp b/code/nel/tools/3d/object_viewer/scheme_manager.cpp index e7f93b589..7c3d7a3ec 100644 --- a/code/nel/tools/3d/object_viewer/scheme_manager.cpp +++ b/code/nel/tools/3d/object_viewer/scheme_manager.cpp @@ -47,7 +47,7 @@ void CSchemeManager::getSchemes(const std::string &type, std::vector &dest); // serial this collection - void serial(NLMISC::IStream &f) throw(NLMISC::EStream); + void serial(NLMISC::IStream &f); // swap this collection with another one void swap(CSchemeManager &other); // remove a scheme from the bank, given a pointer on it diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp index f0de21376..4482ab51f 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp @@ -243,7 +243,7 @@ extern HINSTANCE hInstance; static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { // Set locale to english - setlocale (LC_NUMERIC, "English"); + setlocale (LC_NUMERIC, "C"); BOOL ret = TRUE; switch (msg) @@ -744,11 +744,6 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP } break; - case WM_LBUTTONDOWN: - case WM_LBUTTONUP: - case WM_MOUSEMOVE: - theCNelExport._Ip->RollupMouseMessage(hWnd,msg,wParam,lParam); - break; default: ret = FALSE; diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export.h b/code/nel/tools/3d/plugin_max/nel_export/nel_export.h index eabc05a09..3cf20cf47 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export.h +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export.h @@ -49,7 +49,7 @@ public: CNelExport (); - ~CNelExport(); + virtual ~CNelExport(); void init (bool view, bool errorInDialog, Interface *ip, bool loadStruct); @@ -81,8 +81,8 @@ public: static void deleteLM(INode& ZeNode); // the export scene struct MUST be initialized before calling this fn void OnNodeProperties (const std::set &listNode); - ULONG SelectFileForSave(HWND Parent, TCHAR* Title, const TCHAR* Mask, std::string &FileName); - ULONG SelectDir(HWND Parent, TCHAR* Title, std::string &Path); + ULONG SelectFileForSave(HWND Parent, const TCHAR* Title, const TCHAR* Mask, std::string &FileName); + ULONG SelectDir(HWND Parent, const TCHAR* Title, std::string &Path); // The nel export objtect CExportNel *_ExportNel; diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export_export.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export_export.cpp index a41c3134c..3be72a9bb 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export_export.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export_export.cpp @@ -265,7 +265,7 @@ bool CNelExport::exportAnim (const std::string &sPath, std::vector& vect { // try to get the prefix from the appData if present. If not, takes it from the node name nodeName = CExportNel::getScriptAppData (vectNode[n], NEL3D_APPDATA_INSTANCE_NAME, ""); - if (nodeName == "") // not found ? + if (nodeName.empty()) // not found ? { nodeName=CExportNel::getName (*vectNode[n]); } diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export_filetools.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export_filetools.cpp index 7ecb61efe..11020e4fc 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export_filetools.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export_filetools.cpp @@ -26,7 +26,7 @@ //-------------------------------------------------------------------------------------------------------------- -ULONG CNelExport::SelectFileForSave(HWND Parent, TCHAR* Title, const TCHAR* Mask, std::string &FileName) +ULONG CNelExport::SelectFileForSave(HWND Parent, const TCHAR* Title, const TCHAR* Mask, std::string &FileName) { TCHAR curdir[MAX_PATH]; TCHAR fname[MAX_PATH]; @@ -76,7 +76,7 @@ ULONG CNelExport::SelectFileForSave(HWND Parent, TCHAR* Title, const TCHAR* Mask //-------------------------------------------------------------------------------------------------------------- -ULONG CNelExport::SelectDir(HWND Parent, TCHAR* Title, std::string &Path) +ULONG CNelExport::SelectDir(HWND Parent, const TCHAR* Title, std::string &Path) { TCHAR str[MAX_PATH]; _tcscpy_s(str, MAX_PATH, utf8ToTStr(Path)); @@ -91,7 +91,7 @@ ULONG CNelExport::SelectDir(HWND Parent, TCHAR* Title, std::string &Path) bi.lParam=0; bi.iImage=0; - ITEMIDLIST* pidl = SHBrowseForFolder(&bi); + PIDLIST_ABSOLUTE pidl = SHBrowseForFolder(&bi); if (!SHGetPathFromIDList(pidl,str) ) { diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export_node_properties.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export_node_properties.cpp index 59d149128..949395d14 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export_node_properties.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export_node_properties.cpp @@ -63,7 +63,7 @@ TCHAR *_EnvironmentNames[] = _T("PSYCHOTIC"), NULL }; -TCHAR *_MaterialNames[] = +TCHAR *_MaterialNames[] = { _T(""), _T("no occlusion"), @@ -85,7 +85,7 @@ const std::set *listNodeCallBack; // *************************************************************************** -class addSubLodNodeHitCallBack : public HitByNameDlgCallback +class addSubLodNodeHitCallBack : public HitByNameDlgCallback { public: INodeTab NodeTab; @@ -154,7 +154,7 @@ public: ((CRGBA*)this)->operator= (col); return *this; } - + void setDifferentValuesMode() { DifferentValues= true; @@ -174,7 +174,7 @@ public: SubDlg[i] = NULL; for (i=0; iVertexProgramBypassed ? FALSE : TRUE); // Enable AmbientAddSun for realTime Ambient only - EnableWindow(GetDlgItem (hwndDlg, IDC_REALTIME_LIGHT_AMBIENT_ADD_SUN), + EnableWindow(GetDlgItem (hwndDlg, IDC_REALTIME_LIGHT_AMBIENT_ADD_SUN), SendMessage (GetDlgItem (hwndDlg, IDC_EXPORT_REALTIME_LIGHT), BM_GETCHECK, 0, 0)!=BST_UNCHECKED); } @@ -382,14 +382,14 @@ void VegetableStateChanged (HWND hwndDlg) { // Vegetable ? bool enable = ( SendMessage (GetDlgItem (hwndDlg, IDC_VEGETABLE), BM_GETCHECK, 0, 0)!=BST_UNCHECKED ); - + // Enable alpha blend button EnableWindow (GetDlgItem (hwndDlg, IDC_VEGETABLE_ALPHA_BLEND_ON), enable); EnableWindow (GetDlgItem (hwndDlg, IDC_VEGETABLE_ALPHA_BLEND_OFF), enable); EnableWindow (GetDlgItem (hwndDlg, IDC_CENTER_Z), enable); EnableWindow (GetDlgItem (hwndDlg, IDC_CENTER_NULL), enable); EnableWindow (GetDlgItem (hwndDlg, IDC_VEGETABLE_BEND_FACTOR), enable); - + // Alpha blend ? bool alphaBlend = IsDlgButtonChecked (hwndDlg, IDC_VEGETABLE_ALPHA_BLEND_ON)!=BST_UNCHECKED; @@ -407,7 +407,7 @@ void VegetableStateChanged (HWND hwndDlg) precomputed= IsDlgButtonChecked (hwndDlg, IDC_VEGETABLE_AB_ON_LIGHTED_PRECOMPUTED)!=BST_UNCHECKED; else precomputed= IsDlgButtonChecked (hwndDlg, IDC_VEGETABLE_AB_OFF_LIGHTED_PRECOMPUTED)!=BST_UNCHECKED; - + // Force Best Sided Lighting only if precomputed EnableWindow (GetDlgItem (hwndDlg, IDC_VEGETABLE_FORCE_BEST_SIDED_LIGHTING), enable && precomputed); @@ -456,7 +456,7 @@ void exploreNode(INode *node) if (soundGroup != "no sound") _KnownSoundGroups.insert(soundGroup); - + for (int i= 0; iNumChildren(); ++i) { exploreNode(node->GetChildNode(i)); @@ -473,7 +473,7 @@ INT_PTR CALLBACK AccelDialogCallback ( { CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); - switch (uMsg) + switch (uMsg) { case WM_INITDIALOG: { @@ -508,42 +508,42 @@ INT_PTR CALLBACK AccelDialogCallback ( { for (uint i=0; _MaterialNames[i] != 0; ++i) { - SendMessage (GetDlgItem (hwndDlg, IDC_OCC_MODEL), CB_ADDSTRING, 0, (LPARAM)(_MaterialNames[i])); - SendMessage (GetDlgItem (hwndDlg, IDC_OPEN_OCC_MODEL), CB_ADDSTRING, 0, (LPARAM)(_MaterialNames[i])); + SendMessage (GetDlgItem (hwndDlg, IDC_OCC_MODEL), CB_ADDSTRING, 0, (LPARAM)_MaterialNames[i]); + SendMessage (GetDlgItem (hwndDlg, IDC_OPEN_OCC_MODEL), CB_ADDSTRING, 0, (LPARAM)_MaterialNames[i]); } } { for (uint i =0; _EnvironmentNames[i] != 0; ++i) { - SendMessage (GetDlgItem (hwndDlg, IDC_ENV_FX), CB_ADDSTRING, 0, (LPARAM)(_EnvironmentNames[i])); + SendMessage (GetDlgItem (hwndDlg, IDC_ENV_FX), CB_ADDSTRING, 0, (LPARAM)_EnvironmentNames[i]); } } { std::set::iterator first(_KnownSoundGroups.begin()), last(_KnownSoundGroups.end()); for (; first != last; ++first) { - SendMessage (GetDlgItem (hwndDlg, IDC_SOUND_GROUP), CB_ADDSTRING, 0, (LPARAM)(first->c_str())); + SendMessage (GetDlgItem (hwndDlg, IDC_SOUND_GROUP), CB_ADDSTRING, 0, (LPARAM)utf8ToTStr(*first)); } } // set the combo and edit box - if (SendMessage (GetDlgItem (hwndDlg, IDC_OCC_MODEL), CB_SELECTSTRING, -1, (LPARAM)(currentParam->OcclusionModel.c_str())) == CB_ERR) + if (SendMessage (GetDlgItem (hwndDlg, IDC_OCC_MODEL), CB_SELECTSTRING, -1, (LPARAM)utf8ToTStr(currentParam->OcclusionModel)) == CB_ERR) { // nlassert(false); } - if (SendMessage (GetDlgItem (hwndDlg, IDC_OPEN_OCC_MODEL), CB_SELECTSTRING, -1, (LPARAM)(currentParam->OpenOcclusionModel.c_str())) == CB_ERR) + if (SendMessage (GetDlgItem (hwndDlg, IDC_OPEN_OCC_MODEL), CB_SELECTSTRING, -1, (LPARAM)utf8ToTStr(currentParam->OpenOcclusionModel)) == CB_ERR) { // nlassert(false); } - if (SendMessage (GetDlgItem (hwndDlg, IDC_ENV_FX), CB_SELECTSTRING, -1, (LPARAM)(currentParam->EnvironmentFX.c_str())) == CB_ERR) + if (SendMessage (GetDlgItem (hwndDlg, IDC_ENV_FX), CB_SELECTSTRING, -1, (LPARAM)utf8ToTStr(currentParam->EnvironmentFX)) == CB_ERR) { // nlassert(false); } - if (SendMessage (GetDlgItem (hwndDlg, IDC_SOUND_GROUP), CB_SELECTSTRING, -1, (LPARAM)(currentParam->SoundGroup.c_str())) == CB_ERR) + if (SendMessage (GetDlgItem (hwndDlg, IDC_SOUND_GROUP), CB_SELECTSTRING, -1, (LPARAM)utf8ToTStr(currentParam->SoundGroup)) == CB_ERR) { // nlassert(false); } -// SendMessage(GetDlgItem(hwndDlg, IDC_SOUND_GROUP), WM_SETTEXT, 0, (LONG)(currentParam->SoundGroup.c_str())); - +// SendMessage(GetDlgItem(hwndDlg, IDC_SOUND_GROUP), WM_SETTEXT, 0, (LPARAM)utf8ToTStr(currentParam->SoundGroup)); + bool accelerator = (currentParam->AcceleratorType != -1); CheckRadioButton (hwndDlg, IDC_RADIOACCELNO, IDC_RADIOACCELCLUSTER, accelerator?(IDC_RADIOACCELNO+(currentParam->AcceleratorType&NEL3D_APPDATA_ACCEL_TYPE)):0); AccelStateChanged (hwndDlg); @@ -554,7 +554,7 @@ INT_PTR CALLBACK AccelDialogCallback ( if( HIWORD(wParam) == BN_CLICKED ) { HWND hwndButton = (HWND) lParam; - switch (LOWORD(wParam)) + switch (LOWORD(wParam)) { case IDCANCEL: EndDialog(hwndDlg, IDCANCEL); @@ -644,7 +644,7 @@ INT_PTR CALLBACK MRMDialogCallback ( { CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); - switch (uMsg) + switch (uMsg) { case WM_INITDIALOG: { @@ -668,7 +668,7 @@ INT_PTR CALLBACK MRMDialogCallback ( EnableWindow (GetDlgItem (hwndDlg, IDC_REMOVE), currentParam->ListActived); EnableWindow (GetDlgItem (hwndDlg, IDC_UP), currentParam->ListActived); EnableWindow (GetDlgItem (hwndDlg, IDC_DOWN), currentParam->ListActived); - + SetWindowText (GetDlgItem (hwndDlg, IDC_DIST_MAX), utf8ToTStr(currentParam->DistMax)); SetWindowText (GetDlgItem (hwndDlg, IDC_BLEND_LENGTH), utf8ToTStr(currentParam->BlendLength)); @@ -704,7 +704,7 @@ INT_PTR CALLBACK MRMDialogCallback ( if( HIWORD(wParam) == BN_CLICKED ) { HWND hwndButton = (HWND) lParam; - switch (LOWORD(wParam)) + switch (LOWORD(wParam)) { case IDCANCEL: EndDialog(hwndDlg, IDCANCEL); @@ -716,7 +716,7 @@ INT_PTR CALLBACK MRMDialogCallback ( currentParam->BlendOut=SendMessage (GetDlgItem (hwndDlg, IDC_BLEND_OUT), BM_GETCHECK, 0, 0); currentParam->CoarseMesh=SendMessage (GetDlgItem (hwndDlg, IDC_COARSE_MESH), BM_GETCHECK, 0, 0); currentParam->DynamicMesh=SendMessage (GetDlgItem (hwndDlg, IDC_DYNAMIC_MESH), BM_GETCHECK, 0, 0); - + TCHAR tmp[512]; GetWindowText (GetDlgItem (hwndDlg, IDC_DIST_MAX), tmp, 512); currentParam->DistMax = tStrToUtf8(tmp); @@ -912,7 +912,7 @@ INT_PTR CALLBACK InstanceDialogCallback ( { CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); - switch (uMsg) + switch (uMsg) { case WM_INITDIALOG: { @@ -934,7 +934,7 @@ INT_PTR CALLBACK InstanceDialogCallback ( bool colOk = currentParam->CollisionMeshGeneration>=0 && currentParam->CollisionMeshGeneration<4; CheckRadioButton (hwndDlg, IDC_CAMERA_COL_RADIO1, IDC_CAMERA_COL_RADIO4, colOk?(IDC_CAMERA_COL_RADIO1+(currentParam->CollisionMeshGeneration)):0); - + InstanceStateChanged(hwndDlg); } break; @@ -943,7 +943,7 @@ INT_PTR CALLBACK InstanceDialogCallback ( if( HIWORD(wParam) == BN_CLICKED ) { HWND hwndButton = (HWND) lParam; - switch (LOWORD(wParam)) + switch (LOWORD(wParam)) { case IDCANCEL: EndDialog(hwndDlg, IDCANCEL); @@ -956,7 +956,7 @@ INT_PTR CALLBACK InstanceDialogCallback ( GetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_INSTANCE_NAME), tmp, 512); currentParam->InstanceName = tStrToUtf8(tmp); - + currentParam->DontAddToScene=SendMessage (GetDlgItem (hwndDlg, IDC_DONT_ADD_TO_SCENE), BM_GETCHECK, 0, 0); GetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_INSTANCE_GROUP_NAME), tmp, 512); currentParam->InstanceGroupName = tStrToUtf8(tmp); @@ -1028,7 +1028,7 @@ INT_PTR CALLBACK LightmapDialogCallback ( { CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); - switch (uMsg) + switch (uMsg) { case WM_INITDIALOG: { @@ -1050,7 +1050,7 @@ INT_PTR CALLBACK LightmapDialogCallback ( SendMessage (GetDlgItem (hwndDlg, IDC_LIGHT_DONT_CAST_SHADOW_EXTERIOR), BM_SETCHECK, currentParam->LightDontCastShadowExterior, 0); SetWindowText (GetDlgItem (hwndDlg, IDC_EXPORT_LIGHTMAP_NAME), utf8ToTStr(currentParam->ExportLightMapName)); SendMessage (GetDlgItem (hwndDlg, IDC_REALTIME_LIGHT_AMBIENT_ADD_SUN), BM_SETCHECK, currentParam->RealTimeAmbientLightAddSun, 0); - + // Set enable disable LightingStateChanged (hwndDlg, currentParam); @@ -1062,7 +1062,7 @@ INT_PTR CALLBACK LightmapDialogCallback ( if( HIWORD(wParam) == BN_CLICKED ) { HWND hwndButton = (HWND) lParam; - switch (LOWORD(wParam)) + switch (LOWORD(wParam)) { case IDC_RESET_NAME: SetWindowText (GetDlgItem (hwndDlg, IDC_EXPORT_LIGHTMAP_NAME), _T("GlobalLight")); @@ -1092,7 +1092,7 @@ INT_PTR CALLBACK LightmapDialogCallback ( GetWindowText (GetDlgItem (hwndDlg, IDC_EXPORT_LIGHTMAP_NAME), tmp, 512); currentParam->ExportLightMapName = tStrToUtf8(tmp); currentParam->RealTimeAmbientLightAddSun= SendMessage (GetDlgItem (hwndDlg, IDC_REALTIME_LIGHT_AMBIENT_ADD_SUN), BM_GETCHECK, 0, 0); - + // Get the acceleration type if (IsDlgButtonChecked (hwndDlg, IDC_LIGHT_GROUP_ALWAYS) == BST_CHECKED) currentParam->LightGroup = 0; @@ -1154,7 +1154,7 @@ INT_PTR CALLBACK LightmapDialogCallback ( EndDialog(hwndDlg,1); break; - case WM_DESTROY: + case WM_DESTROY: break; @@ -1180,7 +1180,7 @@ void Lightmap2StateChanged (HWND hwndDlg, CLodDialogBoxParam *currentParam) EnableWindow (GetDlgItem(hwndDlg, IDC_LMC_AUTO_SETUP), enabled); EnableWindow (GetDlgItem(hwndDlg, IDC_LMC_AUTO_SETUP_VISIBLEONLY), enabled); EnableWindow (GetDlgItem(hwndDlg, IDC_LMC_COPY_FROM), enabled); - + // MAX enable/disable uint i; for(i=0;i lights; getLightmapLightBuilds(lights, theCNelExport._Ip->GetTime(), *theCNelExport._Ip, visibleOnly); - + // mean all light, by lightgroup CRGBAF sumAmbient[CLodDialogBoxParam::NumLightGroup]; CRGBAF sumDiffuse[CLodDialogBoxParam::NumLightGroup]; @@ -1258,7 +1258,7 @@ void lmcAutoSetup(CLodDialogBoxParam *currentParam, bool visibleOnly) sumDiffuse[i]/= float(countDiffuse[i]); diff= sumDiffuse[i]; } - + // change the control and value currentParam->LMCAmbient[i]= amb; currentParam->LMCAmbient[i].Ctrl->SetColor(RGB(amb.R, amb.G, amb.B)); @@ -1269,7 +1269,7 @@ void lmcAutoSetup(CLodDialogBoxParam *currentParam, bool visibleOnly) // *************************************************************************** -struct CLMCParamFrom +struct CLMCParamFrom { bool AmbFilter[CLodDialogBoxParam::NumLightGroup]; bool DiffFilter[CLodDialogBoxParam::NumLightGroup]; @@ -1278,7 +1278,7 @@ struct CLMCParamFrom std::vector Nodes; // true if the user has clicked at least one item bool SelectionDone; - + CLMCParamFrom() { SelectionDone= false; @@ -1311,8 +1311,8 @@ INT_PTR CALLBACK LMCCopyFromDialogCallback( { CLMCParamFrom *lmcParam=(CLMCParamFrom *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); uint i; - - switch (uMsg) + + switch (uMsg) { case WM_INITDIALOG: { @@ -1336,7 +1336,7 @@ INT_PTR CALLBACK LMCCopyFromDialogCallback( lmcParam->AmbValue[i].Ctrl->SetColor(RGB(a.R, a.G, a.B)); lmcParam->DiffValue[i].Ctrl->SetColor(RGB(d.R, d.G, d.B)); } - + // init the filters. nlctassert(CLodDialogBoxParam::NumLightGroup==3); SendMessage (GetDlgItem (hwndDlg, IDC_LMC_COPY_ALWAYS_AMBIENT_FILTER), BM_SETCHECK, lmcParam->AmbFilter[0]?BST_CHECKED:BST_UNCHECKED, 0); @@ -1345,7 +1345,7 @@ INT_PTR CALLBACK LMCCopyFromDialogCallback( SendMessage (GetDlgItem (hwndDlg, IDC_LMC_COPY_ALWAYS_DIFFUSE_FILTER), BM_SETCHECK, lmcParam->DiffFilter[0]?BST_CHECKED:BST_UNCHECKED, 0); SendMessage (GetDlgItem (hwndDlg, IDC_LMC_COPY_SUN_DIFFUSE_FILTER), BM_SETCHECK, lmcParam->DiffFilter[1]?BST_CHECKED:BST_UNCHECKED, 0); SendMessage (GetDlgItem (hwndDlg, IDC_LMC_COPY_NIGHT_DIFFUSE_FILTER), BM_SETCHECK, lmcParam->DiffFilter[2]?BST_CHECKED:BST_UNCHECKED, 0); - + // init the list HWND hwndList=GetDlgItem (hwndDlg, IDC_LMC_COPY_LIST); for(i=0;iNodes.size();i++) @@ -1355,7 +1355,7 @@ INT_PTR CALLBACK LMCCopyFromDialogCallback( // Insert string SendMessage (hwndList, LB_ADDSTRING, 0, (LPARAM) str.c_str()); } - + // gray the OK button EnableWindow( GetDlgItem(hwndDlg, IDOK), FALSE); } @@ -1365,7 +1365,7 @@ INT_PTR CALLBACK LMCCopyFromDialogCallback( if( HIWORD(wParam) == BN_CLICKED ) { HWND hwndButton = (HWND) lParam; - switch (LOWORD(wParam)) + switch (LOWORD(wParam)) { case IDCANCEL: EndDialog(hwndDlg, IDCANCEL); @@ -1380,7 +1380,7 @@ INT_PTR CALLBACK LMCCopyFromDialogCallback( lmcParam->DiffFilter[0]= SendMessage (GetDlgItem (hwndDlg, IDC_LMC_COPY_ALWAYS_DIFFUSE_FILTER), BM_GETCHECK, 0, 0) == BST_CHECKED; lmcParam->DiffFilter[1]= SendMessage (GetDlgItem (hwndDlg, IDC_LMC_COPY_SUN_DIFFUSE_FILTER), BM_GETCHECK, 0, 0) == BST_CHECKED; lmcParam->DiffFilter[2]= SendMessage (GetDlgItem (hwndDlg, IDC_LMC_COPY_NIGHT_DIFFUSE_FILTER), BM_GETCHECK, 0, 0) == BST_CHECKED; - + // get colors for(i=0;iGetINodeByName(name); if (nodeClk) @@ -1454,17 +1454,17 @@ INT_PTR CALLBACK LMCCopyFromDialogCallback( // ungray the OK button EnableWindow( GetDlgItem(hwndDlg, IDOK), TRUE); } - + } break; - + case WM_CLOSE: EndDialog(hwndDlg,IDCANCEL); break; - - case WM_DESTROY: + + case WM_DESTROY: break; - + default: return FALSE; } @@ -1479,7 +1479,7 @@ void lmcCopyFrom(CLodDialogBoxParam *currentParam, HWND parentDlg) // static to save filter between calls static CLMCParamFrom paramLMCFrom; - + // **** get all nodes // get all nodes std::vector nodes; @@ -1532,7 +1532,7 @@ INT_PTR CALLBACK Lightmap2DialogCallback ( { CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); - switch (uMsg) + switch (uMsg) { case WM_INITDIALOG: { @@ -1540,7 +1540,7 @@ INT_PTR CALLBACK Lightmap2DialogCallback ( LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); - // retrieve the color choosing Ctrl + // retrieve the color choosing Ctrl nlctassert(CLodDialogBoxParam::NumLightGroup==3); nlverify(currentParam->LMCAmbient[0].Ctrl= GetIColorSwatch(GetDlgItem(hwndDlg, IDC_LM_ALWAYS_AMBIENT))); nlverify(currentParam->LMCAmbient[1].Ctrl= GetIColorSwatch(GetDlgItem(hwndDlg, IDC_LM_DAY_AMBIENT))); @@ -1548,7 +1548,7 @@ INT_PTR CALLBACK Lightmap2DialogCallback ( nlverify(currentParam->LMCDiffuse[0].Ctrl= GetIColorSwatch(GetDlgItem(hwndDlg, IDC_LM_ALWAYS_DIFFUSE))); nlverify(currentParam->LMCDiffuse[1].Ctrl= GetIColorSwatch(GetDlgItem(hwndDlg, IDC_LM_DAY_DIFFUSE))); nlverify(currentParam->LMCDiffuse[2].Ctrl= GetIColorSwatch(GetDlgItem(hwndDlg, IDC_LM_NIGHT_DIFFUSE))); - + // set color, and color state for(uint i=0;iLMCEnabled, 0); - + // Set enable disable Lightmap2StateChanged (hwndDlg, currentParam); } @@ -1570,7 +1570,7 @@ INT_PTR CALLBACK Lightmap2DialogCallback ( if( HIWORD(wParam) == BN_CLICKED ) { HWND hwndButton = (HWND) lParam; - switch (LOWORD(wParam)) + switch (LOWORD(wParam)) { case IDCANCEL: EndDialog(hwndDlg, IDCANCEL); @@ -1616,7 +1616,7 @@ INT_PTR CALLBACK Lightmap2DialogCallback ( { nlctassert(CLodDialogBoxParam::NumLightGroup==3); CRGBAProp *propEdited; - switch(LOWORD(wParam)) + switch(LOWORD(wParam)) { case IDC_LM_ALWAYS_AMBIENT: propEdited= ¤tParam->LMCAmbient[0]; break; case IDC_LM_DAY_AMBIENT: propEdited= ¤tParam->LMCAmbient[1]; break; @@ -1635,7 +1635,7 @@ INT_PTR CALLBACK Lightmap2DialogCallback ( EndDialog(hwndDlg,1); break; - case WM_DESTROY: + case WM_DESTROY: break; default: @@ -1655,7 +1655,7 @@ INT_PTR CALLBACK VegetableDialogCallback ( { CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); - switch (uMsg) + switch (uMsg) { case WM_INITDIALOG: { @@ -1664,19 +1664,19 @@ INT_PTR CALLBACK VegetableDialogCallback ( currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); SendMessage (GetDlgItem (hwndDlg, IDC_VEGETABLE), BM_SETCHECK, currentParam->Vegetable, 0); - + // Yoyo: enable like this. Crappy CheckRadioButton method... SendMessage (GetDlgItem (hwndDlg, IDC_VEGETABLE_ALPHA_BLEND_ON), BM_SETCHECK, currentParam->VegetableAlphaBlend==0, 0 ); SendMessage (GetDlgItem (hwndDlg, IDC_VEGETABLE_ALPHA_BLEND_OFF), BM_SETCHECK, currentParam->VegetableAlphaBlend==1, 0 ); - + CheckRadioButton(hwndDlg, IDC_VEGETABLE_AB_ON_LIGHTED_PRECOMPUTED, IDC_VEGETABLE_AB_ON_UNLIGHTED, IDC_VEGETABLE_AB_ON_LIGHTED_PRECOMPUTED+currentParam->VegetableAlphaBlendOnLighted); - + CheckRadioButton(hwndDlg, IDC_VEGETABLE_AB_OFF_LIGHTED_PRECOMPUTED, IDC_VEGETABLE_AB_OFF_UNLIGHTED, IDC_VEGETABLE_AB_OFF_LIGHTED_PRECOMPUTED+currentParam->VegetableAlphaBlendOffLighted); - + SendMessage (GetDlgItem (hwndDlg, IDC_VEGETABLE_AB_OFF_DOUBLE_SIDED), BM_SETCHECK, currentParam->VegetableAlphaBlendOffDoubleSided, 0); SendMessage (GetDlgItem (hwndDlg, IDC_VEGETABLE_FORCE_BEST_SIDED_LIGHTING), BM_SETCHECK, currentParam->VegetableForceBestSidedLighting, 0); - + CheckRadioButton(hwndDlg, IDC_CENTER_NULL, IDC_CENTER_Z, IDC_CENTER_NULL+currentParam->VegetableBendCenter); SetWindowText (GetDlgItem (hwndDlg, IDC_VEGETABLE_BEND_FACTOR), utf8ToTStr(currentParam->VegetableBendFactor)); @@ -1689,7 +1689,7 @@ INT_PTR CALLBACK VegetableDialogCallback ( if( HIWORD(wParam) == BN_CLICKED ) { HWND hwndButton = (HWND) lParam; - switch (LOWORD(wParam)) + switch (LOWORD(wParam)) { case IDCANCEL: EndDialog(hwndDlg, IDCANCEL); @@ -1702,25 +1702,25 @@ INT_PTR CALLBACK VegetableDialogCallback ( currentParam->VegetableAlphaBlend = 0; else if (IsDlgButtonChecked (hwndDlg, IDC_VEGETABLE_ALPHA_BLEND_OFF) == BST_CHECKED) currentParam->VegetableAlphaBlend = 1; - else + else currentParam->VegetableAlphaBlend = -1; - + if (IsDlgButtonChecked (hwndDlg, IDC_VEGETABLE_AB_ON_LIGHTED_PRECOMPUTED) == BST_CHECKED) currentParam->VegetableAlphaBlendOnLighted = 0; else if (IsDlgButtonChecked (hwndDlg, IDC_VEGETABLE_AB_ON_UNLIGHTED) == BST_CHECKED) currentParam->VegetableAlphaBlendOnLighted = 1; - else + else currentParam->VegetableAlphaBlendOnLighted = -1; - + if (IsDlgButtonChecked (hwndDlg, IDC_VEGETABLE_AB_OFF_LIGHTED_PRECOMPUTED) == BST_CHECKED) currentParam->VegetableAlphaBlendOffLighted = 0; else if (IsDlgButtonChecked (hwndDlg, IDC_VEGETABLE_AB_OFF_LIGHTED_DYNAMIC) == BST_CHECKED) currentParam->VegetableAlphaBlendOffLighted = 1; else if (IsDlgButtonChecked (hwndDlg, IDC_VEGETABLE_AB_OFF_UNLIGHTED) == BST_CHECKED) currentParam->VegetableAlphaBlendOffLighted = 2; - else + else currentParam->VegetableAlphaBlendOffLighted = -1; - + currentParam->VegetableAlphaBlendOffDoubleSided = SendMessage (GetDlgItem (hwndDlg, IDC_VEGETABLE_AB_OFF_DOUBLE_SIDED), BM_GETCHECK, 0, 0); currentParam->VegetableForceBestSidedLighting= SendMessage (GetDlgItem (hwndDlg, IDC_VEGETABLE_FORCE_BEST_SIDED_LIGHTING), BM_GETCHECK, 0, 0); @@ -1729,9 +1729,9 @@ INT_PTR CALLBACK VegetableDialogCallback ( currentParam->VegetableBendCenter = 0; else if (IsDlgButtonChecked (hwndDlg, IDC_CENTER_Z) == BST_CHECKED) currentParam->VegetableBendCenter = 1; - else + else currentParam->VegetableBendCenter = -1; - + TCHAR tmp[512]; GetWindowText (GetDlgItem (hwndDlg, IDC_VEGETABLE_BEND_FACTOR), tmp, 512); currentParam->VegetableBendFactor = tStrToUtf8(tmp); @@ -1775,7 +1775,7 @@ INT_PTR CALLBACK VertexProgramDialogCallBack ( { CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); - switch (uMsg) + switch (uMsg) { case WM_INITDIALOG: { @@ -1789,8 +1789,8 @@ INT_PTR CALLBACK VertexProgramDialogCallBack ( if(currentParam->VertexProgramId>=0) { // Init DropList. - SendDlgItemMessage(hwndDlg, IDC_COMBO_VP, CB_ADDSTRING, 0, (LPARAM)"Disable"); - SendDlgItemMessage(hwndDlg, IDC_COMBO_VP, CB_ADDSTRING, 0, (LPARAM)"Wind Tree"); + SendDlgItemMessage(hwndDlg, IDC_COMBO_VP, CB_ADDSTRING, 0, (LPARAM)_T("Disable")); + SendDlgItemMessage(hwndDlg, IDC_COMBO_VP, CB_ADDSTRING, 0, (LPARAM)_T("Wind Tree")); SendDlgItemMessage(hwndDlg, IDC_COMBO_VP, CB_SETCURSEL, currentParam->VertexProgramId, 0); EnableWindow( GetDlgItem(hwndDlg, IDC_COMBO_VP), TRUE); } @@ -1823,7 +1823,7 @@ INT_PTR CALLBACK VertexProgramDialogCallBack ( for (uint vpId=0; vpIdSubVPDlg[vpId] = CreateDialogParam (hInstance, MAKEINTRESOURCE(SubVPTab[vpId]), hwndDlg, SubVPProc[vpId], (LONG)lParam); + currentParam->SubVPDlg[vpId] = CreateDialogParam (hInstance, MAKEINTRESOURCE(SubVPTab[vpId]), hwndDlg, SubVPProc[vpId], lParam); // To client coord RECT client = tabRect; @@ -1847,7 +1847,7 @@ INT_PTR CALLBACK VertexProgramDialogCallBack ( if( HIWORD(wParam) == BN_CLICKED ) { HWND hwndButton = (HWND) lParam; - switch (LOWORD(wParam)) + switch (LOWORD(wParam)) { case IDCANCEL: EndDialog(hwndDlg, IDCANCEL); @@ -1933,7 +1933,7 @@ void updateVPWTStatic(HWND hwndDlg, uint type, uint depth, const CVPWindTreeAppD TCHAR stmp[256]; float nticks= CVPWindTreeAppData::NumTicks; float scale; - + // which scale?? switch(type) { @@ -1951,27 +1951,27 @@ void updateVPWTStatic(HWND hwndDlg, uint type, uint depth, const CVPWindTreeAppD // update static according to type. switch(type) { - case 0: + case 0: sliderValue= SendDlgItemMessage(hwndDlg, VPWTFreqSliderId[depth], TBM_GETPOS, 0, 0); _stprintf(stmp, _T("%.2f"), scale * float(sliderValue)/nticks); SetWindowText( GetDlgItem(hwndDlg, VPWTFreqStaticId[depth]), stmp ); break; - case 1: + case 1: sliderValue= SendDlgItemMessage(hwndDlg, VPWTFreqWDSliderId[depth], TBM_GETPOS, 0, 0); _stprintf(stmp, _T("%.2f"), scale * float(sliderValue)/nticks); SetWindowText( GetDlgItem(hwndDlg, VPWTFreqWDStaticId[depth]), stmp ); break; - case 2: + case 2: sliderValue= SendDlgItemMessage(hwndDlg, VPWTDistXYSliderId[depth], TBM_GETPOS, 0, 0); _stprintf(stmp, _T("%.2f"), scale * float(sliderValue)/nticks); SetWindowText( GetDlgItem(hwndDlg, VPWTDistXYStaticId[depth]), stmp ); break; - case 3: + case 3: sliderValue= SendDlgItemMessage(hwndDlg, VPWTDistZSliderId[depth], TBM_GETPOS, 0, 0); _stprintf(stmp, _T("%.2f"), scale * float(sliderValue)/nticks); SetWindowText( GetDlgItem(hwndDlg, VPWTDistZStaticId[depth]), stmp ); break; - case 4: + case 4: sliderValue= SendDlgItemMessage(hwndDlg, VPWTBiasSliderId[depth], TBM_GETPOS, 0, 0); // expand to -2 to 2. float biasVal= 4 * float(sliderValue)/nticks - 2; @@ -2041,10 +2041,10 @@ INT_PTR CALLBACK VPWindTreeCallback ( { CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); - switch (uMsg) + switch (uMsg) { case WM_INITDIALOG: - { + { // Param pointers LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); @@ -2108,7 +2108,7 @@ INT_PTR CALLBACK VPWindTreeCallback ( if( HIWORD(wParam) == BN_CLICKED ) { HWND hwndButton = (HWND) lParam; - switch (LOWORD(wParam)) + switch (LOWORD(wParam)) { case IDCANCEL: EndDialog(hwndDlg, IDCANCEL); @@ -2175,9 +2175,9 @@ INT_PTR CALLBACK VPWindTreeCallback ( // EditBox change: ... if( HIWORD(wParam) == EN_KILLFOCUS || EnChangeReturn) - { - switch (LOWORD(wParam)) - { + { + switch (LOWORD(wParam)) + { case IDC_EDIT_VPWT_FREQ_SCALE: { // Read FreqScale @@ -2220,7 +2220,7 @@ INT_PTR CALLBACK VPWindTreeCallback ( SetWindowText( GetDlgItem(hwndDlg, IDC_EDIT_VPWT_DIST_SCALE), stmp ); } break; - } + } } } break; @@ -2279,10 +2279,10 @@ INT_PTR CALLBACK MiscDialogCallback ( { CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); - switch (uMsg) + switch (uMsg) { case WM_INITDIALOG: - { + { // Param pointers LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); @@ -2302,12 +2302,12 @@ INT_PTR CALLBACK MiscDialogCallback ( // Mesh interfaces SetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_INTERFACE_FILE), utf8ToTStr(currentParam->InterfaceFileName)); - SetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_INTERFACE_THRESHOLD), + SetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_INTERFACE_THRESHOLD), currentParam->InterfaceThreshold != -1.f ? utf8ToTStr(toStringMax(currentParam->InterfaceThreshold)) : _T("") ); SendMessage(GetDlgItem(hwndDlg, IDC_GET_INTERFACE_NORMAL_FROM_SCENE_OBJECTS), BM_SETCHECK, currentParam->GetInterfaceNormalsFromSceneObjects, 0); - + // Skeleton Scale SendMessage( GetDlgItem(hwndDlg, IDC_EXPORT_BONE_SCALE), BM_SETCHECK, currentParam->ExportBoneScale, 0); SetWindowText (GetDlgItem (hwndDlg, IDC_EXPORT_BONE_SCALE_NAME_EXT), utf8ToTStr(currentParam->ExportBoneScaleNameExt)); @@ -2325,7 +2325,7 @@ INT_PTR CALLBACK MiscDialogCallback ( if( HIWORD(wParam) == BN_CLICKED ) { HWND hwndButton = (HWND) lParam; - switch (LOWORD(wParam)) + switch (LOWORD(wParam)) { case IDCANCEL: EndDialog(hwndDlg, IDCANCEL); @@ -2358,10 +2358,10 @@ INT_PTR CALLBACK MiscDialogCallback ( currentParam->InterfaceFileName = tStrToUtf8(tmp); GetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_INTERFACE_THRESHOLD), tmp, 512); if (_tcslen(tmp) != 0) - currentParam->InterfaceThreshold = toFloatMax(tmp); + currentParam->InterfaceThreshold = toFloatMax(tmp); currentParam->GetInterfaceNormalsFromSceneObjects = SendMessage (GetDlgItem (hwndDlg, IDC_GET_INTERFACE_NORMAL_FROM_SCENE_OBJECTS), BM_GETCHECK, 0, 0); - - + + // Skeleton Scale currentParam->ExportBoneScale= SendMessage( GetDlgItem(hwndDlg, IDC_EXPORT_BONE_SCALE), BM_GETCHECK, 0, 0); GetWindowText (GetDlgItem (hwndDlg, IDC_EXPORT_BONE_SCALE_NAME_EXT), tmp, 512); @@ -2414,10 +2414,10 @@ INT_PTR CALLBACK AnimationDialogCallback ( { CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); - switch (uMsg) + switch (uMsg) { case WM_INITDIALOG: - { + { // Param pointers LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); @@ -2434,7 +2434,7 @@ INT_PTR CALLBACK AnimationDialogCallback ( if( HIWORD(wParam) == BN_CLICKED ) { HWND hwndButton = (HWND) lParam; - switch (LOWORD(wParam)) + switch (LOWORD(wParam)) { case IDCANCEL: EndDialog(hwndDlg, IDCANCEL); @@ -2483,7 +2483,7 @@ INT_PTR CALLBACK LodDialogCallback ( { CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); - switch (uMsg) + switch (uMsg) { case WM_INITDIALOG: { @@ -2526,7 +2526,7 @@ INT_PTR CALLBACK LodDialogCallback ( SendMessage (GetDlgItem (hwndDlg, IDC_TAB), TCM_INSERTITEM, SendMessage (GetDlgItem (hwndDlg, IDC_TAB), TCM_GETITEMCOUNT, 0, 0), (LPARAM)&tabItem); // Create the dialog - currentParam->SubDlg[tab] = CreateDialogParam (hInstance, MAKEINTRESOURCE(SubTab[tab]), GetDlgItem (hwndDlg, IDC_TAB), SubProc[tab], (LONG)lParam); + currentParam->SubDlg[tab] = CreateDialogParam (hInstance, MAKEINTRESOURCE(SubTab[tab]), GetDlgItem (hwndDlg, IDC_TAB), SubProc[tab], lParam); // To client coord RECT client = tabRect; @@ -2551,7 +2551,7 @@ INT_PTR CALLBACK LodDialogCallback ( { case TCN_SELCHANGE: { - + uint curSel=SendMessage (pnmh->hwndFrom, TCM_GETCURSEL, 0, 0); for (uint tab=0; tab &listNode) { - // Get + // Get uint nNumSelNode=(uint)listNode.size(); if (nNumSelNode) @@ -2780,13 +2780,13 @@ void CNelExport::OnNodeProperties (const std::set &listNode) param.LMCAmbient[i]= CExportNel::getScriptAppData (node, NEL3D_APPDATA_EXPORT_LMC_AMBIENT_START+i, CRGBA::Black); param.LMCDiffuse[i]= CExportNel::getScriptAppData (node, NEL3D_APPDATA_EXPORT_LMC_DIFFUSE_START+i, CRGBA::White); } - + // CollisionMeshGeneration param.CollisionMeshGeneration=CExportNel::getScriptAppData (node, NEL3D_APPDATA_CAMERA_COLLISION_MESH_GENERATION, 0); - + // RealTimeAmbientLightAddSun param.RealTimeAmbientLightAddSun= CExportNel::getScriptAppData (node, NEL3D_APPDATA_REALTIME_AMBIENT_ADD_SUN, BST_UNCHECKED); - + // Something selected ? std::set::const_iterator ite=listNode.begin(); ite++; @@ -2902,7 +2902,7 @@ void CNelExport::OnNodeProperties (const std::set &listNode) param.RemanenceRollupRatio = -1.f; if (CExportNel::getScriptAppData (node, NEL3D_APPDATA_REMANENCE_SLICE_NUMBER, 64)!=param.RemanenceSliceNumber) param.RemanenceSliceNumber = -1; - + // Radial normals for (uint smoothGroup=0; smoothGroup &listNode) if (CExportNel::getScriptAppData (node, NEL3D_APPDATA_LIGHT_DONT_CAST_SHADOW_EXTERIOR, BST_UNCHECKED) != param.LightDontCastShadowExterior) param.LightDontCastShadowExterior= BST_INDETERMINATE; - + // VertexProgram - // simply disable VertexProgram edition of multiple selection... + // simply disable VertexProgram edition of multiple selection... param.VertexProgramId= -1; // Collision @@ -3037,15 +3037,15 @@ void CNelExport::OnNodeProperties (const std::set &listNode) if(CExportNel::getScriptAppData (node, NEL3D_APPDATA_EXPORT_LMC_DIFFUSE_START+i, CRGBA::White) != param.LMCDiffuse[i]) param.LMCDiffuse[i].setDifferentValuesMode(); } - + // CollisionMeshGeneration if (CExportNel::getScriptAppData (node, NEL3D_APPDATA_CAMERA_COLLISION_MESH_GENERATION, 0)!=param.CollisionMeshGeneration) param.CollisionMeshGeneration = -1; - + // RealTimeAmbientLightAddSun if (CExportNel::getScriptAppData (node, NEL3D_APPDATA_REALTIME_AMBIENT_ADD_SUN, BST_UNCHECKED) != param.RealTimeAmbientLightAddSun) param.RealTimeAmbientLightAddSun= BST_INDETERMINATE; - + // Next sel ite++; } @@ -3154,22 +3154,22 @@ void CNelExport::OnNodeProperties (const std::set &listNode) } if ( (param.InstanceShape != DIFFERENT_VALUE_STRING) || (listNode.size()==1)) - CExportNel::setScriptAppData (node, NEL3D_APPDATA_INSTANCE_SHAPE, param.InstanceShape); + CExportNel::setScriptAppData (node, NEL3D_APPDATA_INSTANCE_SHAPE, param.InstanceShape); if (param.InstanceName != DIFFERENT_VALUE_STRING) - CExportNel::setScriptAppData (node, NEL3D_APPDATA_INSTANCE_NAME, param.InstanceName); + CExportNel::setScriptAppData (node, NEL3D_APPDATA_INSTANCE_NAME, param.InstanceName); if (param.DontAddToScene != BST_INDETERMINATE) CExportNel::setScriptAppData (node, NEL3D_APPDATA_DONT_ADD_TO_SCENE, param.DontAddToScene); if (param.AutomaticAnimation != BST_INDETERMINATE) CExportNel::setScriptAppData (node, NEL3D_APPDATA_AUTOMATIC_ANIMATION, param.AutomaticAnimation); if (param.InstanceGroupName != DIFFERENT_VALUE_STRING) - CExportNel::setScriptAppData (node, NEL3D_APPDATA_IGNAME, param.InstanceGroupName); + CExportNel::setScriptAppData (node, NEL3D_APPDATA_IGNAME, param.InstanceGroupName); if (param.InterfaceFileName != "") CExportNel::setScriptAppData (node, NEL3D_APPDATA_INTERFACE_FILE, param.InterfaceFileName); if (param.InterfaceThreshold != -1) CExportNel::setScriptAppData (node, NEL3D_APPDATA_INTERFACE_THRESHOLD, param.InterfaceThreshold); if (param.GetInterfaceNormalsFromSceneObjects != BST_INDETERMINATE) CExportNel::setScriptAppData (node, NEL3D_APPDATA_GET_INTERFACE_NORMAL_FROM_SCENE_OBJECTS, param.GetInterfaceNormalsFromSceneObjects); - + if (param.LightGroup != -1) CExportNel::setScriptAppData (node, NEL3D_APPDATA_LM_LIGHT_GROUP, param.LightGroup); @@ -3195,7 +3195,7 @@ void CNelExport::OnNodeProperties (const std::set &listNode) CExportNel::setScriptAppData (node, NEL3D_APPDATA_RADIAL_NORMAL_SM+smoothGroup, param.RadialNormals[smoothGroup]); } - + if (param.LumelSizeMul != DIFFERENT_VALUE_STRING) CExportNel::setScriptAppData (node, NEL3D_APPDATA_LUMELSIZEMUL, param.LumelSizeMul); if (param.SoftShadowRadius != DIFFERENT_VALUE_STRING) @@ -3228,7 +3228,7 @@ void CNelExport::OnNodeProperties (const std::set &listNode) // Write size of the list uint sizeList=std::min ((uint)param.ListLodName.size(), (uint)NEL3D_APPDATA_LOD_NAME_COUNT_MAX); CExportNel::setScriptAppData (node, NEL3D_APPDATA_LOD_NAME_COUNT, (int)sizeList); - + // Write the strings uint stringIndex=0; std::list::iterator ite=param.ListLodName.begin(); @@ -3289,7 +3289,7 @@ void CNelExport::OnNodeProperties (const std::set &listNode) if (param.VertexProgramId!=-1) { CExportNel::setScriptAppData (node, NEL3D_APPDATA_VERTEXPROGRAM_ID, param.VertexProgramId); - // according to VertexProgram, change setup + // according to VertexProgram, change setup if(param.VertexProgramId==1) { CExportNel::setScriptAppDataVPWT(node, param.VertexProgramWindTree); @@ -3346,15 +3346,15 @@ void CNelExport::OnNodeProperties (const std::set &listNode) CExportNel::setScriptAppData (node, NEL3D_APPDATA_EXPORT_LMC_DIFFUSE_START+i, col); } } - + // CollisionMeshGeneration if (param.CollisionMeshGeneration != -1) CExportNel::setScriptAppData (node, NEL3D_APPDATA_CAMERA_COLLISION_MESH_GENERATION, param.CollisionMeshGeneration); - + // RealTimeAmbientLightAddSun. if (param.RealTimeAmbientLightAddSun != BST_INDETERMINATE) CExportNel::setScriptAppData (node, NEL3D_APPDATA_REALTIME_AMBIENT_ADD_SUN, param.RealTimeAmbientLightAddSun); - + // Next node ite++; } diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_misc.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_misc.cpp index 908d87c6d..7af1a7bc5 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_misc.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_misc.cpp @@ -95,9 +95,9 @@ Matrix3 CExportNel::viewMatrix2CameraMatrix (const Matrix3& viewMatrix) // ConvertMatrix a 3dsmax vector in NeL matrix void CExportNel::convertVector (CVector& nelVector, const Point3& maxVector) { - nelVector.x = maxVector.x; - nelVector.y = maxVector.y; - nelVector.z = maxVector.z; + nelVector.x = maxVector.x; + nelVector.y = maxVector.y; + nelVector.z = maxVector.z; } @@ -409,7 +409,7 @@ bool getValueByNameUsingParamBlock2Internal (Animatable& node, const char* sName } else { - nlwarning("Invalid type specified for pblock2 value with name '%s', given type '%u', found '%u'", + nlwarning("Invalid type specified for pblock2 value with name '%s', given type '%u', found '%u'", sName, (uint32)type, (uint32)paramType); } } @@ -476,12 +476,12 @@ Modifier* CExportNel::getModifier (INode* pNode, Class_ID modCID) int m; int nNumMods = pDObj->NumModifiers(); // Step through all modififers and verify the class id - for (m=0; mGetModifier(m); - if (pMod) + if (pMod) { - if (pMod->ClassID() == modCID) + if (pMod->ClassID() == modCID) { // Match! Return it return pMod; @@ -528,22 +528,22 @@ std::string CExportNel::getNelObjectName (INode& node) if (obj) { Class_ID clid = obj->ClassID(); - // is the object a particle system ? (we do this defore meshs, because for now there is a mesh in max scenes to say where a particle system is...) + // is the object a particle system ? (we do this defore meshs, because for now there is a mesh in max scenes to say where a particle system is...) if (clid.PartA() == NEL_PARTICLE_SYSTEM_CLASS_ID) { std::string shapeName; if (CExportNel::getValueByNameUsingParamBlock2(node, "ps_file_name", (ParamType2) TYPE_STRING, &shapeName, 0)) { return NLMISC::CFile::getFilename(shapeName); - } + } } } - // Try to get an APPDATA for the name of the object + // Try to get an APPDATA for the name of the object AppDataChunk *ad = node.GetAppDataChunk (MAXSCRIPT_UTILITY_CLASS_ID, UTILITY_CLASS_ID, NEL3D_APPDATA_INSTANCE_SHAPE); if (ad&&ad->data) { if (::strlen((const char *) ad->data) != 0) - { + { // Get the name of the object in the APP data return (const char*)ad->data; } @@ -562,7 +562,7 @@ std::string CExportNel::getNelObjectName (INode& node) if (ad&&ad->data) { if (_tcslen((const TCHAR *) ad->data) != 0) - { + { // get file name only return NLMISC::CFile::getFilename(tStrToUtf8((const TCHAR*)ad->data)); } @@ -578,7 +578,7 @@ std::string CExportNel::getNelObjectName (INode& node) } } else - { + { // Extract the node name return tStrToUtf8(node.GetName()); } @@ -587,7 +587,7 @@ std::string CExportNel::getNelObjectName (INode& node) // -------------------------------------------------- -void CExportNel::decompMatrix (NLMISC::CVector& nelScale, NLMISC::CQuat& nelRot, NLMISC::CVector& nelPos, +void CExportNel::decompMatrix (NLMISC::CVector& nelScale, NLMISC::CQuat& nelRot, NLMISC::CVector& nelPos, const Matrix3& maxMatrix) { // Use decomp part of the max SDK @@ -601,7 +601,7 @@ void CExportNel::decompMatrix (NLMISC::CVector& nelScale, NLMISC::CQuat& nelRot, parts.q.MakeMatrix(rtm); parts.u.MakeMatrix(srtm); stm = ScaleMatrix(parts.k); - ftm = ScaleMatrix(Point3(parts.f,parts.f,parts.f)); + ftm = ScaleMatrix(Point3(parts.f,parts.f,parts.f)); Matrix3 mat = Inverse(srtm) * stm * srtm * rtm * ftm * ptm; // Set the translation @@ -841,7 +841,7 @@ void CExportNel::addParentLodNode (INode &child, std::set &lodListToExcl if (parent == NULL) parent = _Ip->GetRootNode(); - // Get its child lod + // Get its child lod uint lodCount = getScriptAppData (parent, NEL3D_APPDATA_LOD_NAME_COUNT, 0); for (uint lod=0; lod &dest, const NLMISC::CMatrix &basis, NLMISC::CVector &avgNormal) { - /// We use a very simple (but slow) algo : examine for each segment how many tris share it. If it is one then it is a border seg + /// We use a very simple (but slow) algo : examine for each segment how many tris share it. If it is one then it is a border seg /// Then, just order segments - - typedef std::map TSegMap; - + + typedef std::map TSegMap; + avgNormal.set(0, 0, 0); ///////////////////////////////////////////////////////////// @@ -1056,15 +1056,15 @@ void CExportNel::maxPolygonMeshToOrderedPoly(Mesh &mesh, std::vector TSegList; - TSegList borderSegs; + typedef std::list TSegList; + TSegList borderSegs; for(TSegMap::const_iterator it = segs.begin(); it != segs.end(); ++it) { if (it->second == 1) borderSegs.push_back(it->first); } - + dest.clear(); if (borderSegs.empty()) return; @@ -1081,9 +1081,9 @@ void CExportNel::maxPolygonMeshToOrderedPoly(Mesh &mesh, std::vectorV0 == nextToFind ? nextSeg->V0 : nextSeg->V1]); - dest.push_back(basis * pos); + dest.push_back(basis * pos); nextToFind = (nextSeg->V0 == nextToFind) ? nextSeg->V1 : nextSeg->V0; borderSegs.erase(nextSeg); } @@ -1096,14 +1096,14 @@ void CExportNel::maxPolygonMeshToOrderedPoly(Mesh &mesh, std::vectorGetIVal(); param[1] = IsDlgButtonChecked(hWnd, IDC_CLEARSELECTION); ReleaseISpinner(spin); - EndDialog(hWnd, 1); + EndDialog(hWnd, 1); break; } @@ -57,7 +57,7 @@ INT_PTR CALLBACK SelectByMatDlgProc( // ------------------------------------------------------------------------------------------------------------------------------------------------------ -void SetSmoothButtonState(HWND hWnd, DWORD bits, DWORD invalid, DWORD unused = 0) +void SetSmoothButtonState(HWND hWnd, DWORD bits, DWORD invalid, DWORD unused = 0) { for (int i = IDC_SMOOTH_GRP1; i < IDC_SMOOTH_GRP1 + 32; i++) { @@ -71,7 +71,7 @@ void SetSmoothButtonState(HWND hWnd, DWORD bits, DWORD invalid, DWORD unused = 0 { SetWindowText(GetDlgItem(hWnd, i), NULL); SendMessage(GetDlgItem(hWnd, i), CC_COMMAND, CC_CMD_SET_STATE, FALSE); - } else + } else { TSTR buf; buf.printf(_T("%d"), i - IDC_SMOOTH_GRP1 + 1); @@ -84,7 +84,7 @@ void SetSmoothButtonState(HWND hWnd, DWORD bits, DWORD invalid, DWORD unused = 0 // ------------------------------------------------------------------------------------------------------------------------------------------------------ -INT_PTR CALLBACK SelectBySmoothDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK SelectBySmoothDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { static DWORD *param; switch (msg) @@ -99,19 +99,19 @@ INT_PTR CALLBACK SelectBySmoothDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARA CenterWindow(hWnd, GetParent(hWnd)); break; - case WM_COMMAND: + case WM_COMMAND: if (LOWORD(wParam) >= IDC_SMOOTH_GRP1 && LOWORD(wParam) <= IDC_SMOOTH_GRP32) { - ICustButton *iBut = GetICustButton(GetDlgItem(hWnd, LOWORD(wParam))); - int shift = LOWORD(wParam) - IDC_SMOOTH_GRP1; + ICustButton *iBut = GetICustButton(GetDlgItem(hWnd, LOWORD(wParam))); + int shift = LOWORD(wParam) - IDC_SMOOTH_GRP1; if (iBut->IsChecked()) { param[0] |= 1 << shift; - } else + } else { param[0] &= ~(1 << shift); - } + } ReleaseICustButton(iBut); break; } @@ -119,15 +119,15 @@ INT_PTR CALLBACK SelectBySmoothDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARA switch (LOWORD(wParam)) { case IDOK: - param[1] = IsDlgButtonChecked(hWnd, IDC_CLEARSELECTION); - EndDialog(hWnd, 1); - break; + param[1] = IsDlgButtonChecked(hWnd, IDC_CLEARSELECTION); + EndDialog(hWnd, 1); + break; case IDCANCEL: EndDialog(hWnd, 0); break; } - break; + break; default: return FALSE; @@ -142,10 +142,10 @@ INT_PTR CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM EditPatchMod *ep =(EditPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); if (!ep && message != WM_INITDIALOG) return FALSE; - + switch (message) { - case WM_INITDIALOG: + case WM_INITDIALOG: { ep =(EditPatchMod *)lParam; @@ -169,16 +169,16 @@ INT_PTR CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM ep->tileRot = NULL; } return FALSE; - + case CC_SPINNER_CHANGE: /*switch (LOWORD(wParam)) { - case IDC_TILE_MAT_SPIN: + case IDC_TILE_MAT_SPIN: if (HIWORD(wParam)) break; // No interactive action ep->SetTileNum (ep->tileNum->GetIVal()); break; - case IDC_TILE_ROT_SPIN: + case IDC_TILE_ROT_SPIN: if (HIWORD(wParam)) break; // No interactive action ep->SetTileRot (ep->tileRot->GetIVal()); @@ -208,8 +208,8 @@ INT_PTR CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM if (u == 0xffffffff) { ep->tileNum->SetIndeterminate(TRUE); - } - else + } + else { ep->tileNum->SetIndeterminate(FALSE); ep->tileNum->SetValue((int)u, FALSE); @@ -220,30 +220,24 @@ INT_PTR CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM if (v == -1) { ep->tileRot->SetIndeterminate(TRUE); - } - else + } + else { ep->tileRot->SetIndeterminate(FALSE); ep->tileRot->SetValue(v, FALSE); }*/ - + ep->patchUIValid = TRUE; } return FALSE; - case WM_LBUTTONDOWN: - case WM_LBUTTONUP: - case WM_MOUSEMOVE: - ep->ip->RollupMouseMessage(hDlg, message, wParam, lParam); - return FALSE; - - case WM_COMMAND: + case WM_COMMAND: /*switch (LOWORD(wParam)) { }*/ break; } - + return FALSE; } @@ -254,10 +248,10 @@ INT_PTR CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM EditPatchMod *ep =(EditPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); if (!ep && message != WM_INITDIALOG) return FALSE; - + switch (message) { - case WM_INITDIALOG: + case WM_INITDIALOG: { ep =(EditPatchMod *)lParam; @@ -269,7 +263,7 @@ INT_PTR CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM case WM_DESTROY: return FALSE; - + case WM_PAINT: if (!ep->edgeUIValid) { @@ -298,15 +292,9 @@ INT_PTR CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM } return FALSE; - case WM_LBUTTONDOWN: - case WM_LBUTTONUP: - case WM_MOUSEMOVE: - ep->ip->RollupMouseMessage(hDlg, message, wParam, lParam); - return FALSE; - - case WM_COMMAND: + case WM_COMMAND: switch (LOWORD(wParam)) - { + { case IDC_NO_SMOOTH: // 3 states management if (IsDlgButtonChecked(hDlg, IDC_NO_SMOOTH)==BST_INDETERMINATE) @@ -318,7 +306,7 @@ INT_PTR CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM } break; } - + return FALSE; } @@ -329,21 +317,21 @@ INT_PTR CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM EditPatchMod *ep =(EditPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); if (!ep && message != WM_INITDIALOG) return FALSE; - + switch (message) { - case WM_INITDIALOG: + case WM_INITDIALOG: { ep = (EditPatchMod *)lParam; ep->hSurfPanel = hDlg; for (int i = IDC_SMOOTH_GRP1; i < IDC_SMOOTH_GRP1 + 32; i++) SendMessage(GetDlgItem(hDlg, i), CC_COMMAND, CC_CMD_SET_TYPE, CBT_CHECK); - SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); ep->matSpin = SetupIntSpinner(hDlg, IDC_MAT_IDSPIN, IDC_MAT_ID, 1, MAX_MATID, 0); ep->tessUSpin = SetupIntSpinner(hDlg, IDC_TESS_U_SPIN, IDC_TESS_U2, 1, 4, RPO_DEFAULT_TESSEL); ep->tessVSpin = SetupIntSpinner(hDlg, IDC_TESS_V_SPIN, IDC_TESS_V2, 1, 4, RPO_DEFAULT_TESSEL); - + ep->SetSurfDlgEnables(); return TRUE; @@ -366,17 +354,17 @@ INT_PTR CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM ep->tessVSpin = NULL; } return FALSE; - + case CC_SPINNER_CHANGE: switch (LOWORD(wParam)) { - case IDC_MAT_IDSPIN: + case IDC_MAT_IDSPIN: if (HIWORD(wParam)) break; // No interactive action ep->SetSelMatIndex(ep->matSpin->GetIVal() - 1); break; - case IDC_TESS_U_SPIN: - case IDC_TESS_V_SPIN: + case IDC_TESS_U_SPIN: + case IDC_TESS_V_SPIN: if (HIWORD(wParam)) break; // No interactive action ep->SetSelTess(ep->tessUSpin->GetIVal(), ep->tessVSpin->GetIVal()); @@ -391,8 +379,8 @@ INT_PTR CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM ep->SetSelMatIndex(ep->matSpin->GetIVal() - 1); ep->ip->RedrawViews(ep->ip->GetTime(), REDRAW_END); break; - case IDC_TESS_U_SPIN: - case IDC_TESS_V_SPIN: + case IDC_TESS_U_SPIN: + case IDC_TESS_V_SPIN: ep->SetSelTess(ep->tessUSpin->GetIVal(), ep->tessVSpin->GetIVal()); ep->ip->RedrawViews(ep->ip->GetTime(), REDRAW_END); break; @@ -407,8 +395,8 @@ INT_PTR CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM if (mat == -1) { ep->matSpin->SetIndeterminate(TRUE); - } - else + } + else { ep->matSpin->SetIndeterminate(FALSE); ep->matSpin->SetValue(mat + 1, FALSE); @@ -423,8 +411,8 @@ INT_PTR CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM if (u == -1) { ep->tessUSpin->SetIndeterminate(TRUE); - } - else + } + else { ep->tessUSpin->SetIndeterminate(FALSE); ep->tessUSpin->SetValue(u, FALSE); @@ -435,8 +423,8 @@ INT_PTR CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM if (v == -1) { ep->tessVSpin->SetIndeterminate(TRUE); - } - else + } + else { ep->tessVSpin->SetIndeterminate(FALSE); ep->tessVSpin->SetValue(v, FALSE); @@ -446,13 +434,7 @@ INT_PTR CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM } return FALSE; - case WM_LBUTTONDOWN: - case WM_LBUTTONUP: - case WM_MOUSEMOVE: - ep->ip->RollupMouseMessage(hDlg, message, wParam, lParam); - return FALSE; - - case WM_COMMAND: + case WM_COMMAND: if (LOWORD(wParam) >= IDC_SMOOTH_GRP1 && LOWORD(wParam) <= IDC_SMOOTH_GRP32) { @@ -464,25 +446,25 @@ INT_PTR CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM break; } switch (LOWORD(wParam)) - { + { // Material - case IDC_SELECT_BYID: - { + case IDC_SELECT_BYID: + { if (DialogBoxParam( - hInstance, + hInstance, MAKEINTRESOURCE(IDD_SELECTBYMAT), - ep->ip->GetMAXHWnd(), + ep->ip->GetMAXHWnd(), SelectByMatDlgProc, (LPARAM)sbmParams)) { - + ep->SelectByMat(sbmParams[0] - 1/*index*/, sbmParams[1]/*clear*/); } break; } // Smoothing groups - case IDC_SELECTBYSMOOTH: - { + case IDC_SELECTBYSMOOTH: + { sbsParams[2] = ~ep->GetUsedSmoothBits(); if (DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_EM_SELECTBYSMOOTH), ep->ip->GetMAXHWnd(), SelectBySmoothDlgProc, (LPARAM)sbsParams)) @@ -504,19 +486,19 @@ INT_PTR CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM } break; } - + return FALSE; } // ------------------------------------------------------------------------------------------------------------------------------------------------------ -void EditPatchMod::SetSurfDlgEnables() +void EditPatchMod::SetSurfDlgEnables() { if (!hSurfPanel) return; - + nlassert(ip); - + BOOL oType =(GetSubobjectLevel() == EP_OBJECT) ? TRUE : FALSE; BOOL pType =(GetSubobjectLevel() == EP_PATCH) ? TRUE : FALSE; @@ -550,13 +532,13 @@ void EditPatchMod::SetSurfDlgEnables() // ------------------------------------------------------------------------------------------------------------------------------------------------------ -void EditPatchMod::SetTileDlgEnables() +void EditPatchMod::SetTileDlgEnables() { if (!hTilePanel) return; - + nlassert(ip); - + BOOL oType =(GetSubobjectLevel() == EP_OBJECT) ? TRUE : FALSE; BOOL pType =(GetSubobjectLevel() == EP_TILE) ? TRUE : FALSE; @@ -568,13 +550,13 @@ void EditPatchMod::SetTileDlgEnables() // ------------------------------------------------------------------------------------------------------------------------------------------------------ -void EditPatchMod::SetEdgeDlgEnables() +void EditPatchMod::SetEdgeDlgEnables() { if (!hEdgePanel) return; - + nlassert(ip); - + BOOL oType =(GetSubobjectLevel() == EP_OBJECT) ? TRUE : FALSE; BOOL pType =(GetSubobjectLevel() == EP_TILE) ? TRUE : FALSE; @@ -591,14 +573,14 @@ DWORD EditPatchMod::GetSelSmoothBits(DWORD &invalid) BOOL first = 1; DWORD bits = 0; invalid = 0; - ModContextList mcList; + ModContextList mcList; INodeTab nodes; if (!ip) return 0; ip->GetModContexts(mcList, nodes); ClearPatchDataFlag(mcList, EPD_BEENDONE); - + for (int i = 0; i < mcList.Count(); i++) { EditPatchData *patchData =(EditPatchData*)mcList[i]->localData; @@ -619,8 +601,8 @@ DWORD EditPatchMod::GetSelSmoothBits(DWORD &invalid) if (first) { first = FALSE; - bits = patch->patches[j].smGroup; - } else + bits = patch->patches[j].smGroup; + } else { if (patch->patches[j].smGroup != bits) { @@ -632,7 +614,7 @@ DWORD EditPatchMod::GetSelSmoothBits(DWORD &invalid) patchData->SetFlag(EPD_BEENDONE, TRUE); } - + nodes.DisposeTemporary(); return bits; } @@ -640,16 +622,16 @@ DWORD EditPatchMod::GetSelSmoothBits(DWORD &invalid) // ------------------------------------------------------------------------------------------------------------------------------------------------------ DWORD EditPatchMod::GetUsedSmoothBits() - { + { DWORD bits = 0; - ModContextList mcList; + ModContextList mcList; INodeTab nodes; if (!ip) return 0; ip->GetModContexts(mcList, nodes); ClearPatchDataFlag(mcList, EPD_BEENDONE); - + for (int i = 0; i < mcList.Count(); i++) { EditPatchData *patchData =(EditPatchData*)mcList[i]->localData; @@ -666,11 +648,11 @@ DWORD EditPatchMod::GetUsedSmoothBits() for (int j = 0; j < patch->getNumPatches(); j++) { bits |= patch->patches[j].smGroup; - } + } patchData->SetFlag(EPD_BEENDONE, TRUE); } - + nodes.DisposeTemporary(); return bits; } @@ -679,14 +661,14 @@ DWORD EditPatchMod::GetUsedSmoothBits() void EditPatchMod::SelectBySmoothGroup(DWORD bits, BOOL clear) { - ModContextList mcList; + ModContextList mcList; INodeTab nodes; if (!ip) return; ip->GetModContexts(mcList, nodes); ClearPatchDataFlag(mcList, EPD_BEENDONE); - + theHold.Begin(); for (int i = 0; i < mcList.Count(); i++) @@ -707,25 +689,25 @@ void EditPatchMod::SelectBySmoothGroup(DWORD bits, BOOL clear) { theHold.Put(new PatchSelRestore(patchData, this, patch)); } - + if (clear) - patch->patchSel.ClearAll(); + patch->patchSel.ClearAll(); for (int j = 0; j < patch->getNumPatches(); j++) - { + { if (patch->patches[j].smGroup & bits) { - patch->patchSel.Set(j); + patch->patchSel.Set(j); } } - + patchData->UpdateChanges(patch, rpatch, FALSE); patchData->SetFlag(EPD_BEENDONE, TRUE); patchData->TempData(this)->Invalidate(PART_SELECT); } - + PatchSelChanged(); theHold.Accept(GetString(IDS_RB_SELECTBYSMOOTH)); - + nodes.DisposeTemporary(); NotifyDependents(FOREVER, PART_SELECT, REFMSG_CHANGE); ip->RedrawViews(ip->GetTime()); @@ -735,14 +717,14 @@ void EditPatchMod::SelectBySmoothGroup(DWORD bits, BOOL clear) void EditPatchMod::SetSelSmoothBits(DWORD bits, DWORD which) { - ModContextList mcList; + ModContextList mcList; INodeTab nodes; if (!ip) return; ip->GetModContexts(mcList, nodes); ClearPatchDataFlag(mcList, EPD_BEENDONE); - + theHold.Begin(); for (int i = 0; i < mcList.Count(); i++) @@ -763,24 +745,24 @@ void EditPatchMod::SetSelSmoothBits(DWORD bits, DWORD which) { theHold.Put(new PatchSelRestore(patchData, this, patch)); } - + for (int j = 0; j < patch->getNumPatches(); j++) - { + { if (patch->patchSel[j]) { patch->patches[j].smGroup &= ~which; - patch->patches[j].smGroup |= bits&which; + patch->patches[j].smGroup |= bits&which; } } - + patchData->UpdateChanges(patch, rpatch, FALSE); patchData->SetFlag(EPD_BEENDONE, TRUE); patchData->TempData(this)->Invalidate(PART_SELECT); } - + PatchSelChanged(); theHold.Accept(GetString(IDS_RB_SETSMOOTHGROUP)); - + nodes.DisposeTemporary(); NotifyDependents(FOREVER, PART_TOPO, REFMSG_CHANGE); InvalidateSurfaceUI(); diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_tess.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_tess.cpp index 34d6b8397..de534123d 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_tess.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_tess.cpp @@ -14,7 +14,7 @@ #define PROMPT_TIME 2000 extern AdvParams sParams; -INT_PTR CALLBACK AdvParametersDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK AdvParametersDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); // ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -56,7 +56,7 @@ void EditPatchMod::SetTessUI(HWND hDlg, TessApprox *tess) { CheckDlgButton(hDlg, IDC_TILE_MODE, TRUE); } - else + else { CheckDlgButton(hDlg, IDC_TILE_MODE, FALSE); } @@ -66,7 +66,7 @@ void EditPatchMod::SetTessUI(HWND hDlg, TessApprox *tess) EnableWindow (GetDlgItem (hDlg, IDC_STEPSSPINNER), !bCheck); EnableWindow (GetDlgItem (hDlg, IDC_STEPS_RENDER), !bCheck); EnableWindow (GetDlgItem (hDlg, IDC_STEPSRENDERSPINNER), !bCheck); - + // New EnableWindow (GetDlgItem (hDlg, IDC_TILESTEPS), bCheck); EnableWindow (GetDlgItem (hDlg, IDC_TILESTEPSSPINNER), bCheck); @@ -76,7 +76,7 @@ void EditPatchMod::SetTessUI(HWND hDlg, TessApprox *tess) if (keepMapping) CheckDlgButton(hDlg, IDC_KEEP_MAPPING, TRUE); - else + else CheckDlgButton(hDlg, IDC_KEEP_MAPPING, FALSE); switch (tess->type) @@ -166,13 +166,13 @@ void EditPatchMod::SetTessUI(HWND hDlg, TessApprox *tess) EnableWindow(GetDlgItem(hDlg, IDC_TESS_NORMALS), !GetViewTessWeld()); EnableWindow(GetDlgItem(hDlg, IDC_WELDTESS), tess->merge > 0.0f); } - } else + } else { if (settingDisp) { ShowWindow(GetDlgItem(hDlg, IDC_MESH), SW_SHOW); ShowWindow(GetDlgItem(hDlg, IDC_DISP), SW_SHOW); - } else + } else { if (tess->type != TESS_SET) { @@ -202,7 +202,7 @@ void EditPatchMod::SetTessUI(HWND hDlg, TessApprox *tess) CheckDlgButton(hDlg, IDC_TESS_RENDERER, FALSE); CheckDlgButton(hDlg, IDC_TESS_NORMALS, GetViewTessNormals()); CheckDlgButton(hDlg, IDC_WELDTESS, GetViewTessWeld()); - } else + } else { CheckDlgButton(hDlg, IDC_TESS_VIEW, FALSE); CheckDlgButton(hDlg, IDC_TESS_RENDERER, TRUE); @@ -213,28 +213,28 @@ void EditPatchMod::SetTessUI(HWND hDlg, TessApprox *tess) } // ------------------------------------------------------------------------------------------------------------------------------------------------------ - + BOOL CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { EditPatchMod *ep =(EditPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); if (!ep && message != WM_INITDIALOG) return FALSE; - + switch (message) { - case WM_INITDIALOG: + case WM_INITDIALOG: { ep =(EditPatchMod *)lParam; ep->hSurfPanel = hDlg; - SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); if (!ep->settingViewportTess && ep->settingDisp && ep->GetProdTess().type == TESS_SET) ep->settingDisp = FALSE; TessApprox t; if (ep->settingViewportTess) { t = ep->GetViewTess(); - } else + } else { if (ep->settingDisp) t = ep->GetDispTess(); @@ -286,14 +286,14 @@ BOOL CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM ep->mergeSpin = NULL; } return FALSE; - - case CC_SPINNER_BUTTONUP: + + case CC_SPINNER_BUTTONUP: { TessApprox tess; if (ep->settingViewportTess) { tess = ep->GetViewTess(); - } else + } else { if (ep->settingDisp) tess = ep->GetDispTess(); @@ -304,7 +304,7 @@ BOOL CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM } break; - case CC_SPINNER_CHANGE: + case CC_SPINNER_CHANGE: switch (LOWORD(wParam)) { case IDC_TESS_U_SPINNER: @@ -318,7 +318,7 @@ BOOL CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM if (ep->settingViewportTess) { tess = ep->GetViewTess(); - } else + } else { if (ep->settingDisp) tess = ep->GetDispTess(); @@ -349,7 +349,7 @@ BOOL CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM if (ep->settingViewportTess) { ep->SetViewTess(tess); - } else + } else { if (ep->settingDisp) ep->SetDispTess(tess); @@ -363,17 +363,11 @@ BOOL CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM } break; - case WM_LBUTTONDOWN: - case WM_LBUTTONUP: - case WM_MOUSEMOVE: - ep->ip->RollupMouseMessage(hDlg, message, wParam, lParam); - return FALSE; - - case WM_COMMAND: + case WM_COMMAND: switch (LOWORD(wParam)) - { + { // Tessellation - case IDC_TESS_VIEW: + case IDC_TESS_VIEW: { ep->settingViewportTess = TRUE; TessApprox t = ep->GetViewTess(); @@ -381,14 +375,14 @@ BOOL CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM EnableWindow(GetDlgItem(hDlg, IDC_TESS_VIEW_DEP), FALSE); // always off here break; } - case IDC_TESS_RENDERER: + case IDC_TESS_RENDERER: { ep->settingViewportTess = FALSE; if (ep->settingDisp) { TessApprox t = ep->GetDispTess(); ep->SetTessUI(hDlg, &t); - } else + } else { TessApprox t = ep->GetProdTess(); ep->SetTessUI(hDlg, &t); @@ -407,13 +401,13 @@ BOOL CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM { BOOL bCheck=(IsDlgButtonChecked(hDlg, IDC_TILE_MODE)==BST_CHECKED); ep->SetTileMode (bCheck!=0); - + // Old EnableWindow (GetDlgItem (hDlg, IDC_STEPS), !bCheck); EnableWindow (GetDlgItem (hDlg, IDC_STEPSSPINNER), !bCheck); EnableWindow (GetDlgItem (hDlg, IDC_STEPS_RENDER), !bCheck); EnableWindow (GetDlgItem (hDlg, IDC_STEPSRENDERSPINNER), !bCheck); - + // New EnableWindow (GetDlgItem (hDlg, IDC_TILESTEPS), bCheck); EnableWindow (GetDlgItem (hDlg, IDC_TILESTEPSSPINNER), bCheck); @@ -441,7 +435,7 @@ BOOL CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM if (ep->settingViewportTess) { tess = ep->GetViewTess(); - } else + } else { if (ep->settingDisp) tess = ep->GetDispTess(); @@ -482,7 +476,7 @@ BOOL CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM if (ep->settingViewportTess) { ep->SetViewTess(tess); - } else + } else { if (ep->settingDisp) ep->SetDispTess(tess); @@ -492,7 +486,7 @@ BOOL CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM ep->SetTessUI(hDlg, &tess); } break; - case IDC_TESS_VIEW_DEP: + case IDC_TESS_VIEW_DEP: { TessApprox tess; tess = ep->GetProdTess(); @@ -508,7 +502,7 @@ BOOL CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM { ep->SetViewTessNormals(IsDlgButtonChecked(hDlg, IDC_TESS_NORMALS)); ep->SetTessUI(hDlg, &ep->GetViewTess()); - } else + } else { ep->SetProdTessNormals(IsDlgButtonChecked(hDlg, IDC_TESS_NORMALS)); if (ep->settingDisp) @@ -522,7 +516,7 @@ BOOL CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM { ep->SetViewTessWeld(IsDlgButtonChecked(hDlg, IDC_WELDTESS)); ep->SetTessUI(hDlg, &ep->GetViewTess()); - } else + } else { ep->SetProdTessWeld(IsDlgButtonChecked(hDlg, IDC_WELDTESS)); if (ep->settingDisp) @@ -531,13 +525,13 @@ BOOL CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM ep->SetTessUI(hDlg, &ep->GetProdTess()); } break; - case IDC_ADVANCED_PARAMETERS: + case IDC_ADVANCED_PARAMETERS: { TessApprox tess; if (ep->settingViewportTess) { tess = ep->GetViewTess(); - } else + } else { if (ep->settingDisp) tess = ep->GetDispTess(); @@ -563,7 +557,7 @@ BOOL CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM if (MessageBox(hDlg, warning, title, MB_YESNO | MB_ICONWARNING | MB_DEFBUTTON2) == IDYES) confirm = TRUE; - + } else confirm = TRUE; if (confirm) @@ -576,7 +570,7 @@ BOOL CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM if (ep->settingViewportTess) { ep->SetViewTess(tess); - } else + } else { if (ep->settingDisp) ep->SetDispTess(tess); @@ -590,8 +584,8 @@ BOOL CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM } break; } - - return FALSE; + + return FALSE; } // ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -608,7 +602,7 @@ AdvParametersDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { - case WM_INITDIALOG: + case WM_INITDIALOG: { initing = TRUE; CenterWindow(hDlg, GetCOREInterface()->GetMAXHWnd()); @@ -634,7 +628,7 @@ AdvParametersDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) CheckDlgButton(hDlg, IDC_DELAUNAY, TRUE); break; } - break; + break; } case WM_COMMAND: @@ -712,27 +706,27 @@ AdvParametersDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) // ------------------------------------------------------------------------------------------------------------------------------------------------------ -void EditPatchMod::SetViewTess(TessApprox &tess) +void EditPatchMod::SetViewTess(TessApprox &tess) { viewTess = tess; ModContextList mcList; INodeTab nodes; - + if (!ip) - return; - + return; + ip->GetModContexts(mcList, nodes); - + for (int i = 0; i < mcList.Count(); i++) { EditPatchData *patchData =(EditPatchData*)mcList[i]->localData; if (!patchData) - continue; + continue; RPatchMesh *rpatch; PatchMesh *patch = patchData->TempData(this)->GetPatch(ip->GetTime(),rpatch); if (!patch) continue; - + patch->SetViewTess(tess); patchData->viewTess = tess; //rpatch->rTess = rTess; @@ -748,27 +742,27 @@ void EditPatchMod::SetViewTess(TessApprox &tess) // ------------------------------------------------------------------------------------------------------------------------------------------------------ -void EditPatchMod::SetProdTess(TessApprox &tess) +void EditPatchMod::SetProdTess(TessApprox &tess) { prodTess = tess; ModContextList mcList; INodeTab nodes; - + if (!ip) - return; - + return; + ip->GetModContexts(mcList, nodes); - + for (int i = 0; i < mcList.Count(); i++) { EditPatchData *patchData =(EditPatchData*)mcList[i]->localData; if (!patchData) - continue; + continue; RPatchMesh *rpatch; PatchMesh *patch = patchData->TempData(this)->GetPatch(ip->GetTime(),rpatch); if (!patch) continue; - + patch->SetProdTess(tess); patchData->prodTess = tess; if (patchData->tempData) @@ -783,27 +777,27 @@ void EditPatchMod::SetProdTess(TessApprox &tess) // ------------------------------------------------------------------------------------------------------------------------------------------------------ -void EditPatchMod::SetDispTess(TessApprox &tess) +void EditPatchMod::SetDispTess(TessApprox &tess) { dispTess = tess; ModContextList mcList; INodeTab nodes; - + if (!ip) - return; - + return; + ip->GetModContexts(mcList, nodes); - + for (int i = 0; i < mcList.Count(); i++) { EditPatchData *patchData =(EditPatchData*)mcList[i]->localData; if (!patchData) - continue; + continue; RPatchMesh *rpatch; PatchMesh *patch = patchData->TempData(this)->GetPatch(ip->GetTime(),rpatch); if (!patch) continue; - + patch->SetDispTess(tess); patchData->dispTess = tess; if (patchData->tempData) @@ -818,27 +812,27 @@ void EditPatchMod::SetDispTess(TessApprox &tess) // ------------------------------------------------------------------------------------------------------------------------------------------------------ -void EditPatchMod::SetViewTessNormals(BOOL use) +void EditPatchMod::SetViewTessNormals(BOOL use) { mViewTessNormals = use; ModContextList mcList; INodeTab nodes; - + if (!ip) - return; - + return; + ip->GetModContexts(mcList, nodes); - + for (int i = 0; i < mcList.Count(); i++) { EditPatchData *patchData =(EditPatchData*)mcList[i]->localData; if (!patchData) - continue; + continue; RPatchMesh *rpatch; PatchMesh *patch = patchData->TempData(this)->GetPatch(ip->GetTime(),rpatch); if (!patch) continue; - + patch->SetViewTessNormals(use); patchData->mViewTessNormals = use; if (patchData->tempData) @@ -853,27 +847,27 @@ void EditPatchMod::SetViewTessNormals(BOOL use) // ------------------------------------------------------------------------------------------------------------------------------------------------------ -void EditPatchMod::SetProdTessNormals(BOOL use) +void EditPatchMod::SetProdTessNormals(BOOL use) { mProdTessNormals = use; ModContextList mcList; INodeTab nodes; - + if (!ip) - return; - + return; + ip->GetModContexts(mcList, nodes); - + for (int i = 0; i < mcList.Count(); i++) { EditPatchData *patchData =(EditPatchData*)mcList[i]->localData; if (!patchData) - continue; + continue; RPatchMesh *rpatch; PatchMesh *patch = patchData->TempData(this)->GetPatch(ip->GetTime(),rpatch); if (!patch) continue; - + patch->SetProdTessNormals(use); patchData->mProdTessNormals = use; if (patchData->tempData) @@ -888,27 +882,27 @@ void EditPatchMod::SetProdTessNormals(BOOL use) // ------------------------------------------------------------------------------------------------------------------------------------------------------ -void EditPatchMod::SetViewTessWeld(BOOL weld) +void EditPatchMod::SetViewTessWeld(BOOL weld) { mViewTessWeld = weld; ModContextList mcList; INodeTab nodes; - + if (!ip) - return; - + return; + ip->GetModContexts(mcList, nodes); - + for (int i = 0; i < mcList.Count(); i++) { EditPatchData *patchData =(EditPatchData*)mcList[i]->localData; if (!patchData) - continue; + continue; RPatchMesh *rpatch; PatchMesh *patch = patchData->TempData(this)->GetPatch(ip->GetTime(),rpatch); if (!patch) continue; - + patch->SetViewTessWeld(weld); patchData->mViewTessWeld = weld; if (patchData->tempData) @@ -923,27 +917,27 @@ void EditPatchMod::SetViewTessWeld(BOOL weld) // ------------------------------------------------------------------------------------------------------------------------------------------------------ -void EditPatchMod::SetProdTessWeld(BOOL weld) +void EditPatchMod::SetProdTessWeld(BOOL weld) { mProdTessWeld = weld; ModContextList mcList; INodeTab nodes; - + if (!ip) - return; - + return; + ip->GetModContexts(mcList, nodes); - + for (int i = 0; i < mcList.Count(); i++) { EditPatchData *patchData =(EditPatchData*)mcList[i]->localData; if (!patchData) - continue; + continue; RPatchMesh *rpatch; PatchMesh *patch = patchData->TempData(this)->GetPatch(ip->GetTime(),rpatch); if (!patch) continue; - + patch->SetProdTessWeld(weld); patchData->mProdTessWeld = weld; if (patchData->tempData) diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_mods.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_mods.cpp index bb134c871..ec109d320 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_mods.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_mods.cpp @@ -26,7 +26,7 @@ int controlsInit = FALSE; using namespace NLMISC; /** public functions **/ -BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved) +BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved) { // initialize nel context if (!NLMISC::INelContext::isContextInitialised()) @@ -40,11 +40,11 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved) { hInstance = hinstDLL; DisableThreadLibraryCalls(hInstance); - - if (!controlsInit) + + if (!controlsInit) { controlsInit = TRUE; - + // jaguar controls #if MAX_VERSION_MAJOR < 14 InitCustomControls(hInstance); @@ -55,12 +55,12 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved) Ctl3dRegister(hinstDLL); Ctl3dAutoSubclass(hinstDLL); #endif - + // initialize Chicago controls InitCommonControls(); } } - + return TRUE; } @@ -68,20 +68,20 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved) //------------------------------------------------------ // This is the interface to Jaguar: //------------------------------------------------------ -__declspec( dllexport ) const TCHAR *LibDescription() -{ +__declspec( dllexport ) const TCHAR *LibDescription() +{ return _T("NeL Patch Edit"); } /// MUST CHANGE THIS NUMBER WHEN ADD NEW CLASS __declspec( dllexport ) int LibNumberClasses() -{ +{ return 1; } -__declspec( dllexport ) ClassDesc *LibClassDesc(int i) +__declspec( dllexport ) ClassDesc *LibClassDesc(int i) { - switch(i) + switch(i) { case 0: return GetEditPatchModDesc(); default: return NULL; @@ -90,7 +90,7 @@ __declspec( dllexport ) ClassDesc *LibClassDesc(int i) // Return version so can detect obsolete DLLs __declspec( dllexport ) ULONG LibVersion() -{ +{ return VERSION_3DSMAX; } @@ -110,12 +110,6 @@ BOOL CALLBACK DefaultSOTProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam) SetWindowLongPtr(hWnd,GWLP_USERDATA,lParam); break; - case WM_LBUTTONDOWN: - case WM_LBUTTONUP: - case WM_MOUSEMOVE: - if (ip) ip->RollupMouseMessage(hWnd,msg,wParam,lParam); - return FALSE; - default: return FALSE; } diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_rollup.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_rollup.cpp index ede7215f9..baf340ae2 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_rollup.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_rollup.cpp @@ -22,7 +22,7 @@ BOOL filterVerts = TRUE; static BOOL filterVecs = TRUE; -static void SetVertFilter() +static void SetVertFilter() { patchHitLevel[EP_VERTEX] =(filterVerts ? SUBHIT_PATCH_VERTS : 0) |(filterVecs ? SUBHIT_PATCH_VECS : 0); } @@ -40,10 +40,10 @@ INT_PTR CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPAR ICustToolbar *iToolbar; if (!ep && message != WM_INITDIALOG) return FALSE; - + switch (message) { - case WM_INITDIALOG: + case WM_INITDIALOG: { // Get the module path HMODULE hModule = hInstance; @@ -75,9 +75,9 @@ INT_PTR CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPAR // Setup version number TCHAR version[512]; _stprintf(version, _T("Version %d.%d.%d.%d"), - info->dwFileVersionMS>>16, - info->dwFileVersionMS&0xffff, - info->dwFileVersionLS>>16, + info->dwFileVersionMS>>16, + info->dwFileVersionMS&0xffff, + info->dwFileVersionLS>>16, info->dwFileVersionLS&0xffff); SetWindowText (GetDlgItem (hDlg, IDC_VERSION), version); } @@ -104,7 +104,7 @@ INT_PTR CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPAR ep =(EditPatchMod *)lParam; ep->hSelectPanel = hDlg; - SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); // Set up the editing level selector LoadImages(); iToolbar = GetICustToolbar(GetDlgItem(hDlg, IDC_SELTYPE)); @@ -132,18 +132,12 @@ INT_PTR CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPAR ep->ip->ClearPickMode(); CancelEditPatchModes(ep->ip); return FALSE; - - case WM_LBUTTONDOWN: - case WM_LBUTTONUP: - case WM_MOUSEMOVE: - ep->ip->RollupMouseMessage(hDlg, message, wParam, lParam); - return FALSE; - - case WM_COMMAND: + + case WM_COMMAND: { BOOL needRedraw = FALSE; switch (LOWORD(wParam)) - { + { case EP_VERTEX: if (ep->GetSubobjectLevel() == EP_VERTEX) ep->ip->SetSubObjectLevel(PO_OBJECT); @@ -211,7 +205,7 @@ INT_PTR CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPAR if (((LPNMHDR)lParam)->code == TTN_NEEDTEXT) { LPTOOLTIPTEXT lpttt; - lpttt =(LPTOOLTIPTEXT)lParam; + lpttt =(LPTOOLTIPTEXT)lParam; switch (lpttt->hdr.idFrom) { case EP_VERTEX: @@ -231,19 +225,19 @@ INT_PTR CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPAR break; } - + return FALSE; } // ------------------------------------------------------------------------------------------------------------------------------------------------------ -void EditPatchMod::SetOpsDlgEnables() +void EditPatchMod::SetOpsDlgEnables() { if (!hOpsPanel) return; - + nlassert(ip); - + // Disconnect right-click and delete mechanisms ip->GetRightClickMenuManager()->Unregister(&pMenu); ip->UnRegisterDeleteUser(&pDel); @@ -339,7 +333,7 @@ void EditPatchMod::SetOpsDlgEnables() // Enable/disable right-click and delete mechanisms if (!oType) - { + { pMenu.SetMod(this); ip->GetRightClickMenuManager()->Register(&pMenu); pDel.SetMod(this); @@ -355,19 +349,19 @@ INT_PTR CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM if (!ep && message != WM_INITDIALOG) return FALSE; - + ISpinnerControl *spin; ICustButton *ebut; switch (message) { - case WM_INITDIALOG: + case WM_INITDIALOG: { ep =(EditPatchMod *)lParam; ep->hOpsPanel = hDlg; for (int i = IDC_SMOOTH_GRP1; i < IDC_SMOOTH_GRP1 + 32; i++) SendMessage(GetDlgItem(hDlg, i), CC_COMMAND, CC_CMD_SET_TYPE, CBT_CHECK); - SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); ICustButton *but = GetICustButton(GetDlgItem(hDlg, IDC_ATTACH)); but->SetHighlightColor(GREEN_WASH); but->SetType(CBT_CHECK); @@ -407,12 +401,12 @@ INT_PTR CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM EnableWindow (GetDlgItem (hDlg, IDC_STEPSSPINNER), !IsDlgButtonChecked(hDlg, IDC_TILE_MODE)); EnableWindow (GetDlgItem (hDlg, IDC_STEPS_RENDER), !IsDlgButtonChecked(hDlg, IDC_TILE_MODE)); EnableWindow (GetDlgItem (hDlg, IDC_STEPSRENDERSPINNER), !IsDlgButtonChecked(hDlg, IDC_TILE_MODE)); - + // New EnableWindow (GetDlgItem (hDlg, IDC_TILESTEPS), IsDlgButtonChecked(hDlg, IDC_TILE_MODE)); EnableWindow (GetDlgItem (hDlg, IDC_TILESTEPSSPINNER), IsDlgButtonChecked(hDlg, IDC_TILE_MODE)); EnableWindow (GetDlgItem (hDlg, IDC_KEEP_MAPPING), IsDlgButtonChecked(hDlg, IDC_TILE_MODE)); - + // New EnableWindow (GetDlgItem (hDlg, IDC_TRANSITION), IsDlgButtonChecked(hDlg, IDC_TILE_MODE)); EnableWindow (GetDlgItem (hDlg, IDC_TRANSITIONSPINNER), IsDlgButtonChecked(hDlg, IDC_TILE_MODE)); @@ -500,7 +494,7 @@ INT_PTR CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM ep->ip->UnRegisterDeleteUser(&pDel); ep->ip->GetRightClickMenuManager()->Unregister(&pMenu); return FALSE; - + case CC_SPINNER_CHANGE: switch (LOWORD(wParam)) { @@ -550,7 +544,7 @@ INT_PTR CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM } ep->ip->RedrawViews(ep->ip->GetTime(), REDRAW_END); - } else + } else { ep->ip->RedrawViews(ep->ip->GetTime(), REDRAW_INTERACTIVE); } @@ -568,18 +562,18 @@ INT_PTR CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM int sm =0; int sm2 = 0; if (IsDlgButtonChecked(hDlg, IDC_EP_SM_SMOOTH)) - sm = 0; + sm = 0; else if (IsDlgButtonChecked(hDlg, IDC_EP_SM_SMOOTH2)) - sm = 1; + sm = 1; else if (IsDlgButtonChecked(hDlg, IDC_EP_SM_SMOOTH3)) - sm = 2; + sm = 2; if (IsDlgButtonChecked(hDlg, IDC_EP_SM_SMOOTH4)) - sm2 = 0; + sm2 = 0; else if (IsDlgButtonChecked(hDlg, IDC_EP_SM_SMOOTH5)) - sm2 = 1; + sm2 = 1; else if (IsDlgButtonChecked(hDlg, IDC_EP_SM_SMOOTH6)) - sm2 = 2; + sm2 = 2; spin = GetISpinner(GetDlgItem(hDlg, IDC_EP_OUTLINESPINNER)); ep->Bevel(ep->ip->GetTime(), spin->GetFVal(), sm, sm2); @@ -594,7 +588,7 @@ INT_PTR CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM } ep->ip->RedrawViews(ep->ip->GetTime(), REDRAW_END); - } else + } else { ep->ip->RedrawViews(ep->ip->GetTime(), REDRAW_INTERACTIVE); } @@ -645,15 +639,9 @@ INT_PTR CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM } break; - case WM_LBUTTONDOWN: - case WM_LBUTTONUP: - case WM_MOUSEMOVE: - ep->ip->RollupMouseMessage(hDlg, message, wParam, lParam); - return FALSE; - - case WM_COMMAND: + case WM_COMMAND: switch (LOWORD(wParam)) - { + { // Subdivision // watje 3-18-99 case IDC_SHOW_INTERIOR_FACES: @@ -666,18 +654,18 @@ INT_PTR CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM { BOOL bCheck=(IsDlgButtonChecked(hDlg, IDC_TILE_MODE)==BST_CHECKED); ep->SetTileMode (bCheck!=0); - + // Old EnableWindow (GetDlgItem (hDlg, IDC_STEPS), !bCheck); EnableWindow (GetDlgItem (hDlg, IDC_STEPSSPINNER), !bCheck); EnableWindow (GetDlgItem (hDlg, IDC_STEPS_RENDER), !bCheck); EnableWindow (GetDlgItem (hDlg, IDC_STEPSRENDERSPINNER), !bCheck); - + // New EnableWindow (GetDlgItem (hDlg, IDC_TILESTEPS), bCheck); EnableWindow (GetDlgItem (hDlg, IDC_TILESTEPSSPINNER), bCheck); EnableWindow (GetDlgItem (hDlg, IDC_KEEP_MAPPING), bCheck); - + // New EnableWindow (GetDlgItem (hDlg, IDC_TRANSITION), bCheck); EnableWindow (GetDlgItem (hDlg, IDC_TRANSITIONSPINNER), bCheck); @@ -743,7 +731,7 @@ INT_PTR CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM ep->ip->SetStdCommandMode(CID_OBJMOVE); else ep->ip->SetCommandMode(ep->bevelMode); break; - + case IDC_TURN: nlassert (ep->GetSubobjectLevel()==PO_PATCH); ep->DoPatchTurn(true); @@ -784,7 +772,7 @@ INT_PTR CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM case IDC_DETACHREORIENT: patchDetachReorient = IsDlgButtonChecked(hDlg, IDC_DETACHREORIENT); break; - case IDC_ATTACH: + case IDC_ATTACH: { ModContextList mcList; INodeTab nodes; @@ -810,7 +798,7 @@ INT_PTR CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM } break; } - + return FALSE; } diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/DllEntry.cpp b/code/nel/tools/3d/plugin_max/nel_patch_paint/DllEntry.cpp index 8abb9b531..a720a5911 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/DllEntry.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/DllEntry.cpp @@ -16,7 +16,7 @@ using namespace NLMISC; #endif /** public functions **/ -BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved) +BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved) { // initialize nel context if (!NLMISC::INelContext::isContextInitialised()) @@ -25,13 +25,13 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved) nldebug("NeL Patch Paint: DllMain"); NLMISC::CSheetId::initWithoutSheet(); } - + hInstance = hinstDLL; - if ( !controlsInit ) + if ( !controlsInit ) { controlsInit = TRUE; - + // jaguar controls #if MAX_VERSION_MAJOR < 14 InitCustomControls(hInstance); @@ -42,7 +42,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved) Ctl3dRegister(hinstDLL); Ctl3dAutoSubclass(hinstDLL); #endif - + // initialize Chicago controls InitCommonControls(); } @@ -66,8 +66,8 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved) //------------------------------------------------------ __declspec( dllexport ) const TCHAR * -LibDescription() -{ +LibDescription() +{ return _T("NeL patch painter"); } @@ -109,7 +109,7 @@ LibClassDesc(int i) { // Return version so can detect obsolete DLLs -__declspec( dllexport ) ULONG +__declspec( dllexport ) ULONG LibVersion() { return VERSION_3DSMAX; } // Let the plug-in register itself for deferred loading @@ -128,12 +128,6 @@ BOOL CALLBACK DefaultSOTProc( SetWindowLongPtr(hWnd,GWLP_USERDATA,lParam); break; - case WM_LBUTTONDOWN: - case WM_LBUTTONUP: - case WM_MOUSEMOVE: - if (ip) ip->RollupMouseMessage(hWnd,msg,wParam,lParam); - return FALSE; - default: return FALSE; } diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint.cpp b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint.cpp index f89604dc3..98bc67305 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint.cpp @@ -153,7 +153,7 @@ void drawVertexColorBox (float x0, float y0, float x1, float y1, CRGBA color, fl { // Draw a white frame behind CDRU::drawQuad (x0, y0, x1, y1, driver, CRGBA (0x40, 0x40, 0x40), CViewport()); - + // Compute the colors with alpha to show the hardness CRGBA fullFull=color; CRGBA full=color; @@ -222,9 +222,9 @@ void drawInterface (TModeMouse select, TModePaint mode, PaintPatchMod *pobj, IDr CDRU::drawBitmap ( (float)(t%MOD_WIDTH)/(float)MOD_WIDTH, (float)(t/MOD_WIDTH)/(float)MOD_HEIGHT, 1.f/(float)MOD_WIDTH, 1.f/(float)MOD_HEIGHT, *texture, driver, CViewport(), false); else - CDRU::drawQuad ( (float)(t%MOD_WIDTH)/(float)MOD_WIDTH, (float)(t/MOD_WIDTH)/(float)MOD_HEIGHT, + CDRU::drawQuad ( (float)(t%MOD_WIDTH)/(float)MOD_WIDTH, (float)(t/MOD_WIDTH)/(float)MOD_HEIGHT, (float)(t%MOD_WIDTH)/(float)MOD_WIDTH+1.f/(float)MOD_WIDTH, - (float)(t/MOD_WIDTH)/(float)MOD_HEIGHT+1.f/(float)MOD_HEIGHT, driver, + (float)(t/MOD_WIDTH)/(float)MOD_HEIGHT+1.f/(float)MOD_HEIGHT, driver, CRGBA (128, 128, 128), CViewport()); } } @@ -394,7 +394,7 @@ void drawInterface (TModeMouse select, TModePaint mode, PaintPatchMod *pobj, IDr if ((pobj->CurrentTileSet!=-1)&&(mode==ModeTile)) { // *** Draw the current group - ITexture* group[NL3D_CTILE_NUM_GROUP+1]={bankCont->allBitmap, bankCont->_0Bitmap, bankCont->_1Bitmap, bankCont->_2Bitmap, bankCont->_3Bitmap, + ITexture* group[NL3D_CTILE_NUM_GROUP+1]={bankCont->allBitmap, bankCont->_0Bitmap, bankCont->_1Bitmap, bankCont->_2Bitmap, bankCont->_3Bitmap, bankCont->_4Bitmap, bankCont->_5Bitmap, bankCont->_6Bitmap, bankCont->_7Bitmap, bankCont->_8Bitmap, bankCont->_9Bitmap, bankCont->_10Bitmap, bankCont->_11Bitmap}; @@ -450,7 +450,7 @@ void makeVectMesh (std::vector& vectMesh, INodeTab& nodes, ModContextL for (int i = 0; i < mcList.Count (); i++) { - // + // PaintPatchData *patchData = (PaintPatchData*)mcList[i]->localData; if (!patchData) continue; @@ -496,7 +496,7 @@ void transformDesc (tileDesc &desc, bool symmetry, uint rotate, uint mesh, uint CTileBank::TTileType type; bank.getTileXRef (tile, tileSet, number, type); - // Transform the transfo + // Transform the transfo CPatchInfo::getTileSymmetryRotate (bank, desc.getLayer(0).Tile, tileSymmetry, tileRotate); // Get the state of the layer 0 @@ -579,7 +579,7 @@ void transformInvDesc (tileDesc &desc, bool symmetry, uint rotate, uint mesh, ui transformDesc (desc, symmetry, 0, mesh, tile, vectMesh); } -void EPM_PaintMouseProc::SetTile (int mesh, int tile, const tileDesc& desc, std::vector& vectMesh, CLandscape* land, +void EPM_PaintMouseProc::SetTile (int mesh, int tile, const tileDesc& desc, std::vector& vectMesh, CLandscape* land, CNelPatchChanger& nelPatchChg, std::vector* backupStack, bool undo, bool updateDisplace) { // Undo: get old value @@ -600,7 +600,7 @@ void EPM_PaintMouseProc::SetTile (int mesh, int tile, const tileDesc& desc, std: maxDesc.setDisplace (oldDesc.getDisplace()); } - // Transform tile + // Transform tile tileDesc copyDesc=maxDesc; transformInvDesc (maxDesc, vectMesh[mesh].Symmetry, 4-vectMesh[mesh].Rotate, mesh, tile, vectMesh); transformInvDesc (copyDesc, vectMesh[mesh].Symmetry, 0, mesh, tile, vectMesh); @@ -805,7 +805,7 @@ bool EPM_PaintMouseProc::isLocked256 (PaintPatchMod *pobj, EPM_PaintTile* pTile) return false; } -bool EPM_PaintMouseProc::ClearATile ( EPM_PaintTile* pTile, std::vector& vectMesh, +bool EPM_PaintMouseProc::ClearATile ( EPM_PaintTile* pTile, std::vector& vectMesh, CLandscape* land, CNelPatchChanger& nelPatchChg, bool _256, bool _force128) { // ** 1) Backup of the tile @@ -864,7 +864,7 @@ bool EPM_PaintMouseProc::ClearATile ( EPM_PaintTile* pTile, std::vector& visited, std::vector& vectMesh, +bool EPM_PaintMouseProc::PutATile ( EPM_PaintTile* pTile, int tileSet, int curRotation, const CTileBank& bank, + bool selectCycle, std::set& visited, std::vector& vectMesh, CLandscape* land, CNelPatchChanger& nelPatchChg, bool _256) { // If tile 256, must have delta pos aligned on 2x2 @@ -912,7 +912,7 @@ bool EPM_PaintMouseProc::PutATile ( EPM_PaintTile* pTile, int tileSet, int curRo int patch=pTile->tile/NUM_TILE_SEL; // Check if we are in patch subobject and if this patch is selected - + if ((vectMesh[pTile->Mesh].PMesh->selLevel==EP_PATCH)&&(!vectMesh[pTile->Mesh].PMesh->patchSel[patch])) return false; @@ -986,7 +986,7 @@ bool EPM_PaintMouseProc::PutATile ( EPM_PaintTile* pTile, int tileSet, int curRo desc.setTile (1, 1+((-curRotation-1)&3), 0, tileIndex (nTile, (curRotation-nRot)&3), tileIndex (0,0), tileIndex (0,0)); nlassert (other); SetTile (other->Mesh, other->tile, desc, vectMesh, land, nelPatchChg, &backupStack); - + // Add to visited tile set visited.insert (other); @@ -995,7 +995,7 @@ bool EPM_PaintMouseProc::PutATile ( EPM_PaintTile* pTile, int tileSet, int curRo desc.setTile (1, 1+((-curRotation+1)&3), 0, tileIndex (nTile, (curRotation-nRot)&3), tileIndex (0,0), tileIndex (0,0)); nlassert (other); SetTile (other->Mesh, other->tile, desc, vectMesh, land, nelPatchChg, &backupStack); - + // Add to visited tile set visited.insert (other); @@ -1005,7 +1005,7 @@ bool EPM_PaintMouseProc::PutATile ( EPM_PaintTile* pTile, int tileSet, int curRo nlassert (other); nlassert (other==pTile->getBottomRight256 (0, nRot)); SetTile (other->Mesh, other->tile, desc, vectMesh, land, nelPatchChg, &backupStack); - + // Add to visited tile set visited.insert (other); } @@ -1037,14 +1037,14 @@ bool EPM_PaintMouseProc::PutATile ( EPM_PaintTile* pTile, int tileSet, int curRo case 0: // Main if (pTile->voisins[3]) - if (!PropagateBorder (pTile->voisins[3], (pTile->rotate[3]+curRotation)&3, tileSet, visited, bank, + if (!PropagateBorder (pTile->voisins[3], (pTile->rotate[3]+curRotation)&3, tileSet, visited, bank, vectMesh, land, nelPatchChg, backupStack)) { bContinue=false; goto zap; } if (pTile->voisins[0]) - if (!PropagateBorder (pTile->voisins[0], (pTile->rotate[0]+curRotation)&3, tileSet, visited, bank, + if (!PropagateBorder (pTile->voisins[0], (pTile->rotate[0]+curRotation)&3, tileSet, visited, bank, vectMesh, land, nelPatchChg, backupStack)) { bContinue=false; @@ -1212,13 +1212,13 @@ zap:; for (uint corner=0; corner<4; corner++) { finalCorner[corner].TileSet = -1; - + // All the same or empty ? for (uint layer=0; layer<4; layer++) { // Compatible ? - if ( ( finalCorner[corner].TileSet == -1 ) - || ( tileSetCases[layer][corner].TileSet == -1 ) + if ( ( finalCorner[corner].TileSet == -1 ) + || ( tileSetCases[layer][corner].TileSet == -1 ) || ( tileSetCases[layer][corner] == finalCorner[corner] ) ) { // Copy the tile @@ -1265,7 +1265,7 @@ zap:; bFind=true; } } - + // no, ok push it back. if (!bFind) setIndex.push_back (finalCorner[v]); @@ -1369,7 +1369,7 @@ zap:; finalIndex[l].Tile=tileTrans->getTile(); } } - + // Set the border desc tileDesc desc; GetTile (pTile->Mesh, pTile->tile, desc, vectMesh, land); @@ -1403,8 +1403,8 @@ zap:; /*-------------------------------------------------------------------*/ -void EPM_PaintMouseProc::PutADisplacetile ( EPM_PaintTile* pTile, const CTileBank& bank, - std::vector& vectMesh, +void EPM_PaintMouseProc::PutADisplacetile ( EPM_PaintTile* pTile, const CTileBank& bank, + std::vector& vectMesh, CLandscape* land, CNelPatchChanger& nelPatchChg) { // Get tile description @@ -1431,8 +1431,8 @@ void EPM_PaintMouseProc::PutADisplacetile ( EPM_PaintTile* pTile, const CTileBan /*-------------------------------------------------------------------*/ -bool EPM_PaintMouseProc::GetBorderDesc (EPM_PaintTile* tile, tileSetIndex *pVoisinCorner, CTileSet::TFlagBorder pBorder[4][3], - tileDesc *pVoisinIndex, const CTileBank& bank, std::vector& vectMesh, +bool EPM_PaintMouseProc::GetBorderDesc (EPM_PaintTile* tile, tileSetIndex *pVoisinCorner, CTileSet::TFlagBorder pBorder[4][3], + tileDesc *pVoisinIndex, const CTileBank& bank, std::vector& vectMesh, CNelPatchChanger& nelPatchChg, CLandscape *land) { // Tile info @@ -1445,7 +1445,7 @@ bool EPM_PaintMouseProc::GetBorderDesc (EPM_PaintTile* tile, tileSetIndex *pVois tileIndex pIndexx[3]; for (int nL=0; nLrotate[border]; index.Rotate&=3; - + CTileBank::TTileType type; int TileSet, number; @@ -1554,8 +1554,8 @@ int EPM_PaintMouseProc::getLayer (EPM_PaintTile* tile, int border, int tileSet, /*-------------------------------------------------------------------*/ -bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation, int curTileSet, std::set& visited, - const CTileBank& bank, std::vector& vectMesh, +bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation, int curTileSet, std::set& visited, + const CTileBank& bank, std::vector& vectMesh, CLandscape* land, CNelPatchChanger& nelPatchChg, std::vector& backupStack, bool recurseNoDiff) { // 1) Already visited @@ -1698,7 +1698,7 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation, } extraOrdinary[v]++; bDiff=true; - } + } } else { @@ -1799,7 +1799,7 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation, (desc1.isEmpty())|| (desc1.getCase()!=(1+((nCase+3)&3)))|| (desc1.getLayer(0).Tile!=backup.getLayer(0).Tile)|| - (desc1.getLayer(0).Rotate!=((backup.getLayer(0).Rotate-rot)&3)) + (desc1.getLayer(0).Rotate!=((backup.getLayer(0).Rotate-rot)&3)) ) bDiff=true; } @@ -1868,7 +1868,7 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation, bFind=true; } } - + // no, ok push it back. if (!bFind) setIndex.push_back (nCorner[v]); @@ -1877,7 +1877,7 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation, std::sort (setIndex.begin(), setIndex.end()); // Check validity - + // A) Check for more than 3 materials if (setIndex.size()>3) return false; @@ -1981,18 +1981,18 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation, // Last on the stack ? if (*itevoisins[c]) { @@ -2034,7 +2034,7 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation, return false; // Set the tile.. - SetTile (tile->voisins[c]->Mesh, tile->voisins[c]->tile, pVoisinIndex, vectMesh, + SetTile (tile->voisins[c]->Mesh, tile->voisins[c]->tile, pVoisinIndex, vectMesh, land, nelPatchChg, &backupStack); } /*if (pBorder[edge][nLayer]==CTileSet::_0001) @@ -2045,11 +2045,11 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation, } } } - // Normal, + // Normal, else { // Voisin visited or frozen ? - if (tile->voisins[c]&&((visited.find (tile->voisins[c])!=visited.end()) /*|| + if (tile->voisins[c]&&((visited.find (tile->voisins[c])!=visited.end()) /*|| (vectMesh[tile->voisins[c]->Mesh].Node->IsFrozen())*/ )) { // Yes, visited. Copy the border @@ -2057,7 +2057,7 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation, CTileSet::TFlagBorder pBorder[4][3]; tileDesc pVoisinIndex; bool bOk=GetBorderDesc (tile->voisins[c], pVoisinCorner, pBorder, &pVoisinIndex, bank, vectMesh, nelPatchChg, land); - + // Should not be empty nlassert (bOk); int edge=(2+c+tile->rotate[c])&3; @@ -2075,7 +2075,7 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation, else { // No, not yet visited - + // Choose transition by random bool bComputed=false; if ((bVisited[c]||!recurseNoDiff)&&bSameEdge[c]) @@ -2086,7 +2086,7 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation, CTileSet::TFlagBorder pBorder[4][3]; tileDesc pVoisinIndex; bool bOk=GetBorderDesc (tile->voisins[c], pVoisinCorner, pBorder, &pVoisinIndex, bank, vectMesh, nelPatchChg, land); - + // ok voisin is here ? if (bOk) { @@ -2140,18 +2140,18 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation, // Last on the stack ? if (*itevoisins[c])//&&visited.find (tile->voisins[c])!=visited.end()) { @@ -2193,7 +2193,7 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation, return false; // Set the tile.. - SetTile (tile->voisins[c]->Mesh, tile->voisins[c]->tile, pVoisinIndex, vectMesh, + SetTile (tile->voisins[c]->Mesh, tile->voisins[c]->tile, pVoisinIndex, vectMesh, land, nelPatchChg, &backupStack); } /*if (pBorder[edge][nLayer]==CTileSet::_1000) @@ -2205,7 +2205,7 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation, } } - // Normal, + // Normal, else { // Voisin visited ? @@ -2216,7 +2216,7 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation, CTileSet::TFlagBorder pBorder[4][3]; tileDesc pVoisinIndex; bool bOk=GetBorderDesc (tile->voisins[c], pVoisinCorner, pBorder, &pVoisinIndex, bank, vectMesh, nelPatchChg, land); - + // Should not be empty nlassert (bOk); int edge=(2+c+tile->rotate[c])&3; @@ -2235,7 +2235,7 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation, else { // No, not yet visited - + // Choose transition by random bool bComputed=false; if ((bVisited[c]||!recurseNoDiff)&&bSameEdge[c]) @@ -2246,7 +2246,7 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation, CTileSet::TFlagBorder pBorder[4][3]; tileDesc pVoisinIndex; bool bOk=GetBorderDesc (tile->voisins[c], pVoisinCorner, pBorder, &pVoisinIndex, bank, vectMesh, nelPatchChg, land); - + // ok voisin is here ? if (bOk) { @@ -2293,7 +2293,7 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation, } ite++; } - + // Set the border desc tileDesc desc; GetTile (tile->Mesh, tile->tile, desc, vectMesh, land); @@ -2341,22 +2341,22 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation, { // Voisin not already visited and not frozen ? if ((tile->voisins[v]) && (visited.find (tile->voisins[v])==visited.end()) /* && (vectMesh[tile->voisins[v]->Mesh].Node->IsFrozen()==0)*/) - { + { // ok.. not visited, border with modified corner ? if (bModified[v]||bModified[(v+1)&3]||(!bSameEdge[v])) - if (!PropagateBorder (tile->voisins[v], (tile->rotate[v]+curRotation)&3, curTileSet, visited, bank, vectMesh, land, nelPatchChg, + if (!PropagateBorder (tile->voisins[v], (tile->rotate[v]+curRotation)&3, curTileSet, visited, bank, vectMesh, land, nelPatchChg, backupStack, false)) { bContinue=false; break; - } + } } } if (!bContinue) - { + { return false; } - + return true; } @@ -2413,8 +2413,8 @@ uint8 EPM_PaintMouseProc::CalcRotPath (EPM_PaintTile* from, EPM_PaintTile* to, i static TModePaint nModeTexture=ModeTile; static TModeMouse modeSelect=ModePaint; -void EPM_PaintMouseProc::RecursTile (EPM_PaintTile* pTile, const CTileBank& bank, int tileSet, std::vector& vectMesh, CLandscape* land, - int recurs, std::set& alreadyRecursed, bool first, int rotation, +void EPM_PaintMouseProc::RecursTile (EPM_PaintTile* pTile, const CTileBank& bank, int tileSet, std::vector& vectMesh, CLandscape* land, + int recurs, std::set& alreadyRecursed, bool first, int rotation, CNelPatchChanger& nelPatchChg, bool _256) { if (alreadyRecursed.find (pTile)==alreadyRecursed.end()) @@ -2437,20 +2437,20 @@ void EPM_PaintMouseProc::RecursTile (EPM_PaintTile* pTile, const CTileBank& bank if (_256) { if (pTile->get2Voisin(i)) - RecursTile (pTile->get2Voisin(i), bank, tileSet, vectMesh, land, recurs-2, alreadyRecursed, false, + RecursTile (pTile->get2Voisin(i), bank, tileSet, vectMesh, land, recurs-2, alreadyRecursed, false, (rotation+pTile->get2VoisinRotate(i))&3, nelPatchChg, true); } else { if (pTile->voisins[i]) - RecursTile (pTile->voisins[i], bank, tileSet, vectMesh, land, recurs-1, alreadyRecursed, false, (rotation+pTile->rotate[i])&3, + RecursTile (pTile->voisins[i], bank, tileSet, vectMesh, land, recurs-1, alreadyRecursed, false, (rotation+pTile->rotate[i])&3, nelPatchChg, false); } } } } -BOOL EPM_PaintMouseProc::PutDisplace (int tile, int mesh, const CTileBank& bank, std::vector& vectMesh, CLandscape* land, +BOOL EPM_PaintMouseProc::PutDisplace (int tile, int mesh, const CTileBank& bank, std::vector& vectMesh, CLandscape* land, int recurs, std::set& alreadyRecursed, CNelPatchChanger& nelPatchChg) { static sint32 MeshOld=-1; @@ -2460,7 +2460,7 @@ BOOL EPM_PaintMouseProc::PutDisplace (int tile, int mesh, const CTileBank& bank, EPM_PaintTile* pTile=&metaTile[mesh][tile]; // Ok recurse tiles - RecursTile (pTile, bank, 0, vectMesh, land, brushValue[PaintPatchMod::brushSize], alreadyRecursed, true, + RecursTile (pTile, bank, 0, vectMesh, land, brushValue[PaintPatchMod::brushSize], alreadyRecursed, true, EPM_PaintMouseProc::Rotation, nelPatchChg, false); MeshOld=mesh; @@ -2469,7 +2469,7 @@ BOOL EPM_PaintMouseProc::PutDisplace (int tile, int mesh, const CTileBank& bank, return TRUE; } -BOOL EPM_PaintMouseProc::PutTile (int tile, int mesh, bool first, const CTileBank& bank, int tileSet, std::vector& vectMesh, CLandscape* land, +BOOL EPM_PaintMouseProc::PutTile (int tile, int mesh, bool first, const CTileBank& bank, int tileSet, std::vector& vectMesh, CLandscape* land, int recurs, std::set& alreadyRecursed, CNelPatchChanger& nelPatchChg, bool _256) { static sint32 MeshOld=-1; @@ -2523,7 +2523,7 @@ BOOL EPM_PaintMouseProc::PutTile (int tile, int mesh, bool first, const CTileBan std::set alreadyRecursed; // Ok recurse tiles - RecursTile (pTile, bank, tileSet, vectMesh, land, brushValue[PaintPatchMod::brushSize], alreadyRecursed, first, + RecursTile (pTile, bank, tileSet, vectMesh, land, brushValue[PaintPatchMod::brushSize], alreadyRecursed, first, EPM_PaintMouseProc::Rotation, nelPatchChg, _256); } MeshOld=mesh; @@ -2815,7 +2815,7 @@ void mainproc(CScene& scene, CEventListenerAsync& AsyncListener, CEvent3dMouseLi if (AsyncListener.isKeyPushed ((TKey)PainterKeys[SelectColorBrush])) { // Create a dialog filter - static TCHAR szFilter[] = + static TCHAR szFilter[] = _T("Targa Files (*.tga)\0*.tga\0") _T("All Files (*.*)\0*.*\0\0"); @@ -2837,7 +2837,7 @@ void mainproc(CScene& scene, CEventListenerAsync& AsyncListener, CEvent3dMouseLi // Open the dialog if (GetOpenFileName(&openFile)) - { + { // Load the file paintColor.loadBrush (tStrToUtf8(buffer)); paintColor.setBrushMode (true); @@ -2991,7 +2991,7 @@ void mainproc(CScene& scene, CEventListenerAsync& AsyncListener, CEvent3dMouseLi t0= t1; } - + // Draw interface drawInterface (modeSelect, nModeTexture, pData->pobj, driver, landscape, paintColor); @@ -3016,7 +3016,7 @@ public: bool WindowActive; CPaintColor PaintColor; public: - MouseListener (IObjParam *ip, CCamera *camera, CViewport *viewport, PaintPatchMod *pobj, EPM_PaintMouseProc *eproc, CLandscape* land, + MouseListener (IObjParam *ip, CCamera *camera, CViewport *viewport, PaintPatchMod *pobj, EPM_PaintMouseProc *eproc, CLandscape* land, CEventListenerAsync* async, CEvent3dMouseListener* mouseList, std::vector& vectMesh, TimeValue t) : PaintColor (pobj, land, &bankCont->Undo, eproc), _FillTile (pobj, land, &bankCont->Undo, eproc), _VectMesh(vectMesh) { @@ -3063,7 +3063,7 @@ private: if (pressed&&((mouse->Button&rightButton)&&((mouse->Button&(ctrlButton|shiftButton|altButton))==0))) { pressed=false; - + // Undo step bankCont->Undo.pushUndo (); @@ -3099,13 +3099,13 @@ private: if (nModeTexture==ModeTile) { // Put the tile - _Eproc->PutTile (tile1, mesh1, true, bank, _Pobj->CurrentTileSet, _VectMesh, _Land, brushValue[PaintPatchMod::brushSize], + _Eproc->PutTile (tile1, mesh1, true, bank, _Pobj->CurrentTileSet, _VectMesh, _Land, brushValue[PaintPatchMod::brushSize], alreadyRecursed, nelPatchChg, _Pobj->tileSize!=0); } else // (nModeTexture==ModeDisplace) - { + { // Put the tile - _Eproc->PutDisplace (tile1, mesh1, bank, _VectMesh, _Land, brushValue[PaintPatchMod::brushSize], + _Eproc->PutDisplace (tile1, mesh1, bank, _VectMesh, _Land, brushValue[PaintPatchMod::brushSize], alreadyRecursed, nelPatchChg); } @@ -3141,7 +3141,7 @@ private: // Paint mode if (nModeTexture==ModeTile) // Fill this patch with the current tile - _FillTile.fillTile (mesh1, patch, _VectMesh, _Pobj->CurrentTileSet, _Pobj->TileFillRotation, _Pobj->TileGroup, _Pobj->tileSize!=0, + _FillTile.fillTile (mesh1, patch, _VectMesh, _Pobj->CurrentTileSet, _Pobj->TileFillRotation, _Pobj->TileGroup, _Pobj->tileSize!=0, bank); else if (nModeTexture==ModeColor) // Fill this patch with the current color @@ -3188,7 +3188,7 @@ private: { pressed = false; _Pobj->ShowCurrentState = false; - + // Undo step bankCont->Undo.pushUndo (); } @@ -3222,13 +3222,13 @@ private: if (nModeTexture==ModeTile) { // Put the tile - _Eproc->PutTile (tile2, mesh2, false, bank, _Pobj->CurrentTileSet, _VectMesh, _Land, + _Eproc->PutTile (tile2, mesh2, false, bank, _Pobj->CurrentTileSet, _VectMesh, _Land, brushValue[PaintPatchMod::brushSize], alreadyRecursed, nelPatchChg, _Pobj->tileSize!=0); } else // (nModeTexture==ModeDisplace) - { + { // Put the tile - _Eproc->PutDisplace (tile2, mesh2, bank, _VectMesh, _Land, brushValue[PaintPatchMod::brushSize], + _Eproc->PutDisplace (tile2, mesh2, bank, _VectMesh, _Land, brushValue[PaintPatchMod::brushSize], alreadyRecursed, nelPatchChg); } @@ -3299,7 +3299,7 @@ private: _Pobj->CurrentTileSet=tileSetSelector.getTileSet (tile-1); _Pobj->DisplaceTileSet=_Pobj->CurrentTileSet; } - } + } } // Mode displace ? @@ -3308,7 +3308,7 @@ private: if ((tile>=0)&&(tileDisplaceTile=tile; - } + } } } } @@ -3345,7 +3345,7 @@ void MouseListener::pick (int mesh, int tile, const CVector& hit, TModePaint mod // Pickup a displace ? else { - // Get the displace tile index + // Get the displace tile index _Pobj->DisplaceTile=desc.getDisplace (); _Pobj->DisplaceTileSet=tileSet; } @@ -3522,7 +3522,7 @@ void EPM_PaintCMode::DoPaint () static float best = 10000.f; // Set local to english - setlocale (LC_NUMERIC, "English"); + setlocale (LC_NUMERIC, "C"); if (pobj->hOpsPanel) { @@ -3577,7 +3577,7 @@ void EPM_PaintCMode::DoPaint () int nV=1<getUIPatch (p).NbTilesV; for (int u=0; u<=nU; u++) for (int v=0; v<=nV; v++) - { + { Point3 pos=patch->patches[p].interp (patch, (float)u/(float)(nU), (float)v/(float)(nV)); pos=pos*(vectMesh[i].Node->GetObjectTM (t)); if (fMaxXrotate[2]=0; pTile->u=u; pTile->v=v; - + // Compute bouding box of the tile fMinX=FLT_MAX; fMinY=FLT_MAX; @@ -3665,7 +3665,7 @@ void EPM_PaintCMode::DoPaint () pTile->Center=(maxToNel (pos[0])+maxToNel (pos[1])+maxToNel (pos[2])+maxToNel (pos[3]))/4.f; // Store its radius - pTile->Radius=std::max + pTile->Radius=std::max ( std::max ( (maxToNel (pos[0])-pTile->Center).norm(), (maxToNel (pos[1])-pTile->Center).norm() ), std::max ( (maxToNel (pos[2])-pTile->Center).norm(), (maxToNel (pos[3])-pTile->Center).norm() ) @@ -3958,7 +3958,7 @@ void EPM_PaintCMode::DoPaint () pTile->locked = 0; // Check that neighbor tiles are not frozen - uint neighbor; + uint neighbor; for (neighbor=0; neighbor<4; neighbor++) { // Neighbor exist ? @@ -4009,7 +4009,7 @@ void EPM_PaintCMode::DoPaint () pData->pobj=pobj; pData->center=center; pData->T=t; - + myThread (pData); // Do it without thread // Invalidate all objects @@ -4082,9 +4082,9 @@ bool loadLigoConfigFile (CLigoConfig& config, Interface& it) // Can't found the module return false; } - + DWORD WINAPI myThread (LPVOID vData) -{ +{ // Mega try try { @@ -4109,7 +4109,7 @@ DWORD WINAPI myThread (LPVOID vData) } // The scene - + // Loaf cfg files LoadKeyCfg (); LoadVarCfg (); @@ -4155,7 +4155,7 @@ DWORD WINAPI myThread (LPVOID vData) { // Build skined ? bool skined=false; - + // Export the shape IShape *pShape; pShape=export_.buildShape (*pNode, pData->T, NULL, true); @@ -4193,7 +4193,7 @@ DWORD WINAPI myThread (LPVOID vData) CMatrix mat; mat.identity(); CVector I,J,K,P; - + Matrix3 matInvert; matInvert.SetRow (0, Point3(1.f, 0.f, 0.f)); matInvert.SetRow (1, Point3(0.f, 0.f, 1.f)); @@ -4275,7 +4275,7 @@ DWORD WINAPI myThread (LPVOID vData) // Go. //======== CEvent3dMouseListener mouseListener; - MouseListener listener (pData->eproc->ip, CNELU::Camera, &viewport, pData->pobj, pData->eproc, &TheLand->Landscape, + MouseListener listener (pData->eproc->ip, CNELU::Camera, &viewport, pData->pobj, pData->eproc, &TheLand->Landscape, &CNELU::AsyncListener, &mouseListener, pData->VectMesh, pData->T); // Mouse listener @@ -4303,7 +4303,7 @@ DWORD WINAPI myThread (LPVOID vData) { // For all the tileset selected for (sint tss=0; tss<(sint)tileSetSelector.getTileCount (); tss++) - { + { // Get the tileset index sint ts=tileSetSelector.getTileSet (tss); @@ -4434,7 +4434,7 @@ BOOL EPM_PaintMouseProc::HitATile(ViewExp *vpt, IPoint2 *p, int *tile, int *mesh return FALSE; } -BOOL EPM_PaintMouseProc::HitATile(const CViewport& viewport, const CCamera& camera, float x, float y, int *tile, int *mesh, TimeValue t, +BOOL EPM_PaintMouseProc::HitATile(const CViewport& viewport, const CCamera& camera, float x, float y, int *tile, int *mesh, TimeValue t, std::vector& vectMesh, NLMISC::CVector& hit, NLMISC::CVector &topVector) { // Get a world ray with the mouse 2d point @@ -4581,10 +4581,10 @@ bool EPM_PaintTile::intersect (const Ray& ray, std::vector& vectMesh, /*-------------------------------------------------------------------*/ int EPM_PaintMouseProc::proc( - HWND hwnd, - int msg, - int point, - int flags, + HWND hwnd, + int msg, + int point, + int flags, IPoint2 m) { #if MAX_VERSION_MAJOR >= 19 @@ -4611,10 +4611,10 @@ int EPM_PaintMouseProc::proc( case MOUSE_MOVE: break; - + case MOUSE_FREEMOVE: break; - + case MOUSE_ABORT: ip->SetStdCommandMode(CID_OBJMOVE); break; diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_rollup.cpp b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_rollup.cpp index 0b4714090..e225adaa4 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_rollup.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_rollup.cpp @@ -28,13 +28,13 @@ extern void LoadImages(); // ------------------------------------------------------------------------------------------------------------------------------------------------------ -void PaintPatchMod::SetOpsDlgEnables() +void PaintPatchMod::SetOpsDlgEnables() { if (!hOpsPanel) return; - + nlassert(ip); - + ICustButton *but; but = GetICustButton(GetDlgItem(hOpsPanel, IDC_PAINT)); @@ -52,12 +52,12 @@ INT_PTR CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM switch (message) { - case WM_INITDIALOG: + case WM_INITDIALOG: { ep =(PaintPatchMod *)lParam; ep->hOpsPanel = hDlg; - SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); CheckDlgButton(hDlg, IDC_INCLUDE_MESHES, ep->includeMeshes); CheckDlgButton(hDlg, IDC_PRELOAD_TILES, ep->preloadTiles); @@ -65,15 +65,9 @@ INT_PTR CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM return TRUE; } - case WM_LBUTTONDOWN: - case WM_LBUTTONUP: - case WM_MOUSEMOVE: - ep->ip->RollupMouseMessage(hDlg, message, wParam, lParam); - return FALSE; - - case WM_COMMAND: + case WM_COMMAND: switch (LOWORD(wParam)) - { + { case IDC_INCLUDE_MESHES: { BOOL bCheck=(IsDlgButtonChecked(hDlg, IDC_INCLUDE_MESHES)==BST_CHECKED); @@ -92,7 +86,7 @@ INT_PTR CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM } break; } - + return FALSE; } diff --git a/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.cpp b/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.cpp index 3a513683a..664ec0868 100644 --- a/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.cpp +++ b/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.cpp @@ -119,9 +119,9 @@ static INT_PTR CALLBACK VertexPaintDlgProc(HWND hWnd, UINT msg, WPARAM wParam, L // Init comboBox - SendDlgItemMessage(hWnd, IDC_COMBO_TYPE, CB_ADDSTRING, 0, (LPARAM)"Tree Weight"); - SendDlgItemMessage(hWnd, IDC_COMBO_TYPE, CB_ADDSTRING, 0, (LPARAM)"Phase Level 1"); - SendDlgItemMessage(hWnd, IDC_COMBO_TYPE, CB_ADDSTRING, 0, (LPARAM)"Phase Level 2"); + SendDlgItemMessage(hWnd, IDC_COMBO_TYPE, CB_ADDSTRING, 0, (LPARAM)_T("Tree Weight")); + SendDlgItemMessage(hWnd, IDC_COMBO_TYPE, CB_ADDSTRING, 0, (LPARAM)_T("Phase Level 1")); + SendDlgItemMessage(hWnd, IDC_COMBO_TYPE, CB_ADDSTRING, 0, (LPARAM)_T("Phase Level 2")); SendDlgItemMessage(hWnd, IDC_COMBO_TYPE, CB_SETCURSEL, mod->getEditionType(), 0); // If paint mode at last edit. diff --git a/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.cpp b/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.cpp index c77a027a9..893f44eea 100644 --- a/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.cpp +++ b/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.cpp @@ -156,11 +156,6 @@ static INT_PTR CALLBACK Tile_utilityDlgProc(HWND hWnd, UINT msg, WPARAM wParam, // load the sampler dropdown theTile_utility.Destroy(hWnd); break; - case WM_LBUTTONDOWN: - case WM_LBUTTONUP: - case WM_MOUSEMOVE: - theTile_utility.ip->RollupMouseMessage(hWnd,msg,wParam,lParam); - break; case WM_COMMAND: { int id = LOWORD(wParam); @@ -342,7 +337,7 @@ void Tile_utility::SetupUI () std::string name=Bank.getLand(nLand)->getName(); if (hCombo) { - SendMessage (hCombo, CB_INSERTSTRING, -1, (LPARAM) name.c_str()); + SendMessage (hCombo, CB_INSERTSTRING, -1, (LPARAM)utf8ToTStr(name)); } } diff --git a/code/nel/tools/3d/tile_edit/GetVal.cpp b/code/nel/tools/3d/tile_edit/GetVal.cpp index 13128feb5..ff9bcf660 100644 --- a/code/nel/tools/3d/tile_edit/GetVal.cpp +++ b/code/nel/tools/3d/tile_edit/GetVal.cpp @@ -64,8 +64,8 @@ void GetVal::OnOK() CString rString; EditStr->GetWindowText( rString ); int size = rString.GetLength(); - name = new char[size+1]; - strcpy (name, rString); + name = new TCHAR[size+1]; + _tcscpy(name, rString); /**((short*)name)=size; EditStr->GetLine(0,name,size); for (int i=0;iFindStringExact(0,GetStr.name)!=LB_ERR) { - MessageBox(_T("Ce nom existe deja","Error"), MB_ICONERROR); + MessageBox(_T("Ce nom existe deja"), _T("Error"), MB_ICONERROR); } else { list->InsertString(-1, GetStr.name); - tileBank.addLand (GetStr.name); + tileBank.addLand (tStrToUtf8(GetStr.name)); } } } @@ -119,14 +119,14 @@ private: virtual void OnInit () { UpdateData (); - char sTitle[512]; - sprintf (sTitle, "Tile sets use by %s", tileBank.getLand(_land)->getName().c_str()); + TCHAR sTitle[512]; + _stprintf(sTitle, _T("Tile sets use by %s"), utf8ToTStr(tileBank.getLand(_land)->getName())); SetWindowText (sTitle); for (int i=0; igetName().c_str()); + m_ctrlCombo.InsertString (-1, utf8ToTStr(tileBank.getTileSet(i)->getName())); if (tileBank.getLand(_land)->isTileSet (tileBank.getTileSet(i)->getName())) - m_ctrlList.InsertString (-1, tileBank.getTileSet(i)->getName().c_str()); + m_ctrlList.InsertString (-1, utf8ToTStr(tileBank.getTileSet(i)->getName())); } UpdateData (FALSE); } @@ -143,7 +143,7 @@ private: { CString rString; m_ctrlList.GetText(i, rString); - tileBank.getLand(_land)->addTileSet ((const char*)rString); + tileBank.getLand(_land)->addTileSet (tStrToUtf8(rString)); } UpdateData (FALSE); } @@ -202,7 +202,7 @@ void SelectionTerritoire::OnAddTileSet() else { list->InsertString(-1, GetStr.name); - tileBank.addTileSet (GetStr.name); + tileBank.addTileSet (tStrToUtf8(GetStr.name)); } } } @@ -218,16 +218,18 @@ private: virtual void OnInit () { UpdateData (); - char sTitle[512]; - sprintf (sTitle, "Children of the tile set %s", tileBank.getTileSet(_tileSet)->getName().c_str()); + TCHAR sTitle[512]; + _stprintf(sTitle, _T("Children of the tile set %s"), utf8ToTStr(tileBank.getTileSet(_tileSet)->getName())); SetWindowText (sTitle); for (int i=0; igetName().c_str()); + m_ctrlCombo.InsertString (-1, utf8ToTStr(tileBank.getTileSet(i)->getName())); + if (tileBank.getTileSet(_tileSet)->isChild (tileBank.getTileSet(i)->getName())) - m_ctrlList.InsertString (-1, tileBank.getTileSet(i)->getName().c_str()); + m_ctrlList.InsertString (-1, utf8ToTStr(tileBank.getTileSet(i)->getName())); } + UpdateData (FALSE); } virtual void OnOk () @@ -243,7 +245,7 @@ private: { CString rString; m_ctrlList.GetText(i, rString); - tileBank.getTileSet(_tileSet)->addChild ((const char*)rString); + tileBank.getTileSet(_tileSet)->addChild (tStrToUtf8(rString)); } UpdateData (FALSE); } @@ -433,12 +435,12 @@ void SelectionTerritoire::OnSave() Save (str, tileBank); } -void SelectionTerritoire::Save(const char* path, CTileBank &toSave) +void SelectionTerritoire::Save(const TCHAR* path, CTileBank &toSave) { // TODO: Add extra validation here { COFile stream; - if (stream.open ((const char*)path)) + if (stream.open (tStrToUtf8(path))) { toSave.serial (stream); } @@ -452,7 +454,7 @@ void SelectionTerritoire::OnSaveAs() CFileDialog sFile(false, _T("bank"), DefautPath+MainFileName, 0, szFilter, this); if (sFile.DoModal()==IDOK) { - Save (tStrToUtf8(sFile.GetPathName()).c_str(), tileBank); + Save (sFile.GetPathName(), tileBank); MainFileOk = 1; CButton *button = (CButton*)GetDlgItem(IDC_ADD_TERRITOIRE); button->EnableWindow(true); @@ -480,27 +482,26 @@ void SelectionTerritoire::OnCancel() } } -bool CheckPath (const std::string& path, const char* absolutePathToRemplace) +bool CheckPath (const std::string& path, const std::string &absolutePathToRemplace) { // Look for absolute path in path - if (strnicmp (path.c_str(), absolutePathToRemplace, strlen (absolutePathToRemplace))==0) + if (strnicmp(path.c_str(), absolutePathToRemplace.c_str(), absolutePathToRemplace.length()) == 0) return true; - else - return false; + + return false; } -bool RemovePath (std::string& path, const char* absolutePathToRemplace) +bool RemovePath (std::string& path, const std::string &absolutePathToRemplace) { // Look for absolute path in path - if (strnicmp (path.c_str(), absolutePathToRemplace, strlen (absolutePathToRemplace))==0) + if (strnicmp(path.c_str(), absolutePathToRemplace.c_str(), absolutePathToRemplace.length())==0) { // New path - std::string toto=path; - path=toto.c_str()+strlen (absolutePathToRemplace); + path = path.substr(absolutePathToRemplace.length()); return true; } - else - return false; + + return false; } void SelectionTerritoire::OnPath() @@ -508,33 +509,34 @@ void SelectionTerritoire::OnPath() // TODO: Add your control notification handler code here // Select a directory. - char path[MAX_PATH]; + TCHAR path[MAX_PATH]; // Build the struct BROWSEINFO info; memset (&info, 0, sizeof (BROWSEINFO)); - info.lpszTitle="Select the absolute base path of the bank"; + info.lpszTitle = _T("Select the absolute base path of the bank"); info.ulFlags=BIF_RETURNONLYFSDIRS; // Select the path - LPITEMIDLIST list; - if (list=SHBrowseForFolder (&info)) + PIDLIST_ABSOLUTE list = SHBrowseForFolder(&info); + if (list) { // Convert item into path string BOOL bRet=SHGetPathFromIDList(list, path); nlassert (bRet); // Add a final back slash - if (strcmp (path, "")!=0) + if (_tcscmp(path, _T("")) != 0) { // Add a '\' at the end - if (path[strlen (path)-1]!='\\') - strcat (path, "\\"); + if (path[_tcslen(path)-1] != _T('\\')) + _tcscat(path, _T("\\")); } // Last check - char msg[512]; - sprintf (msg, "Do you really want to set %s as base path of the bank ?", path); + TCHAR msg[512]; + _stprintf(msg, _T("Do you really want to set %s as base path of the bank ?"), path); + if (MessageBox (msg, _T("TileEdit"), MB_YESNO|MB_ICONQUESTION)==IDYES) { // Set as default path.. @@ -574,13 +576,13 @@ void SelectionTerritoire::OnPath() if (!bitmapPath.empty()) { // Check the path - if (CheckPath (bitmapPath, path)==false) + if (CheckPath (bitmapPath, tStrToUtf8(path))==false) { // Bad path goodPath=false; // Make a message - sprintf (msg, "Path '%s' can't be found in bitmap '%s'. Continue ?", path, bitmapPath.c_str()); + _stprintf(msg, _T("Path '%s' can't be found in bitmap '%s'. Continue ?"), path, utf8ToTStr(bitmapPath)); // Message if (MessageBox (msg, _T("TileEdit"), MB_YESNO|MB_ICONQUESTION)==IDNO) @@ -603,13 +605,13 @@ void SelectionTerritoire::OnPath() if (strcmp (bitmapPath, "")!=0) { // Check the path - if (CheckPath (bitmapPath, path)==false) + if (CheckPath (bitmapPath, tStrToUtf8(path))==false) { // Bad path goodPath=false; // Make a message - sprintf (msg, "Path '%s' can't be found in bitmap '%s'. Continue ?", path, bitmapPath); + _stprintf(msg, _T("Path '%s' can't be found in bitmap '%s'. Continue ?"), path, utf8ToTStr(bitmapPath)); // Message if (MessageBox (msg, _T("TileEdit"), MB_YESNO|MB_ICONQUESTION)==IDNO) @@ -645,7 +647,7 @@ void SelectionTerritoire::OnPath() if (!bitmapPath.empty()) { // Remove the absolute path - bool res=RemovePath (bitmapPath, path); + bool res=RemovePath (bitmapPath, tStrToUtf8(path)); nlassert (res); // Set the bitmap @@ -665,7 +667,7 @@ void SelectionTerritoire::OnPath() if (!bitmapPath.empty()) { // Remove the absolute path - bool res=RemovePath (bitmapPath, path); + bool res=RemovePath (bitmapPath, tStrToUtf8(path)); nlassert (res); // Set the bitmap @@ -683,7 +685,7 @@ void SelectionTerritoire::OnPath() if (goodPath) { // Change the abs path of the bank - tileBank.setAbsPath (path); + tileBank.setAbsPath (tStrToUtf8(path)); // Change the bouton text GetDlgItem (IDC_PATH)->SetWindowText (path); @@ -698,9 +700,10 @@ void SelectionTerritoire::OnPath() void SelectionTerritoire::OnExport() { // TODO: Add your control notification handler code here - static TCHAR BASED_CODE szFilter[] = - _T("NeL tile bank files (*.smallbank)|*.smallbank|All Files (*.*)|*.*||"); - CFileDialog sFile(false, _T("*.smallbank"), DefautPath+ _T("*.smallbank"), 0, szFilter, this); + static TCHAR BASED_CODE szFilter[] = _T("NeL tile bank files (*.smallbank)|*.smallbank|All Files (*.*)|*.*||"); + + CFileDialog sFile(false, _T("*.smallbank"), DefautPath+ _T("*.smallbank"), 0, szFilter, this); + if (sFile.DoModal()==IDOK) { // Copy the bank diff --git a/code/nel/tools/3d/tile_edit/SelectionTerritoire.h b/code/nel/tools/3d/tile_edit/SelectionTerritoire.h index 600fd9cdb..f38f264d4 100644 --- a/code/nel/tools/3d/tile_edit/SelectionTerritoire.h +++ b/code/nel/tools/3d/tile_edit/SelectionTerritoire.h @@ -86,7 +86,7 @@ protected: afx_msg void OnSelchangeTileSet(); virtual BOOL OnInitDialog(); //}}AFX_MSG - void Save(const char* path, NL3D::CTileBank &toSave); + void Save(const TCHAR* path, NL3D::CTileBank &toSave); DECLARE_MESSAGE_MAP() }; diff --git a/code/nel/tools/3d/tile_edit/View.cpp b/code/nel/tools/3d/tile_edit/View.cpp index 5427f5c2f..cf65a527d 100644 --- a/code/nel/tools/3d/tile_edit/View.cpp +++ b/code/nel/tools/3d/tile_edit/View.cpp @@ -227,7 +227,7 @@ int TileList::addTile256 () return index; } -bool RemovePath (std::string& path, const char* absolutePathToRemplace); +bool RemovePath (std::string& path, const std::string &absolutePathToRemplace); int TileList::setTile128 (int tile, const std::string& name, NL3D::CTile::TBitmap type) { @@ -240,7 +240,9 @@ int TileList::setTile128 (int tile, const std::string& name, NL3D::CTile::TBitma uint Height; if (!loadPic(tileBank2.getAbsPath ()+troncated, tampon, Width, Height)) { - return (int)(MessageBox (NULL, ((tileBank2.getAbsPath ()+troncated)+"\nContinue ?").c_str(), _T("Can't load bitmap."), MB_YESNO|MB_ICONEXCLAMATION)==IDYES); + std::string msg = tileBank2.getAbsPath() + troncated + "\nContinue ?"; + + return (int)(MessageBox (NULL, utf8ToTStr(msg), _T("Can't load bitmap."), MB_YESNO|MB_ICONEXCLAMATION)==IDYES); } else { @@ -256,10 +258,10 @@ int TileList::setTile128 (int tile, const std::string& name, NL3D::CTile::TBitma error=tileBank2.getTileSet(_tileSet)->checkTile128 (type, border, pixel, composante); if ((error!=CTileSet::ok)&&(error!=CTileSet::addFirstA128128)&&!zouille ()) { - char sTmp[512]; static const char* comp[]={"Red", "Green", "Blue", "Alpha", ""}; - sprintf (sTmp, "%s\nPixel: %d (%s)", CTileSet::getErrorMessage (error), pixel, comp[composante]); - return (int)(MessageBox (NULL, (std::string(sTmp)+"\nContinue ?").c_str(), _T("Can't add tile"), MB_YESNO|MB_ICONEXCLAMATION)==IDYES); + std::string msg = NLMISC::toString("%s\nPixel: %d (%s)\nContinue ?", CTileSet::getErrorMessage (error), pixel, comp[composante]); + + return (int)(MessageBox (NULL, utf8ToTStr(msg), _T("Can't add tile"), MB_YESNO|MB_ICONEXCLAMATION)==IDYES); } else { @@ -286,9 +288,8 @@ int TileList::setTile128 (int tile, const std::string& name, NL3D::CTile::TBitma else { // Error: bitmap not in the absolute path.. - char msg[512]; - sprintf (msg, "The bitmap %s is not in the absolute path %s.", name.c_str(), tileBank2.getAbsPath ().c_str()); - return (int)(MessageBox (NULL, (std::string (msg)+"\nContinue ?").c_str(), _T("Load error"), MB_YESNO|MB_ICONEXCLAMATION)==IDYES); + std::string msg = NLMISC::toString("The bitmap %s is not in the absolute path %s.\nContinue ?", name.c_str(), tileBank2.getAbsPath ().c_str()); + return (int)(MessageBox (NULL, utf8ToTStr(msg), _T("Load error"), MB_YESNO|MB_ICONEXCLAMATION)==IDYES); } return 1; @@ -305,7 +306,8 @@ int TileList::setTile256 (int tile, const std::string& name, NL3D::CTile::TBitma uint Height; if (!loadPic(tileBank2.getAbsPath ()+troncated, tampon, Width, Height)) { - return (int)(MessageBox (NULL, ((tileBank2.getAbsPath ()+troncated)+"\nContinue ?").c_str(), _T("Can't load bitmap."), MB_YESNO|MB_ICONEXCLAMATION)==IDYES); + std::string msg = tileBank2.getAbsPath() + troncated + "\nContinue ?"; + return (int)(MessageBox (NULL, utf8ToTStr(msg), _T("Can't load bitmap."), MB_YESNO|MB_ICONEXCLAMATION)==IDYES); } else { @@ -322,10 +324,9 @@ int TileList::setTile256 (int tile, const std::string& name, NL3D::CTile::TBitma error=tileBank2.getTileSet(_tileSet)->checkTile256 (type, border, pixel, composante); if ((error!=CTileSet::ok)&&!zouille()) { - char sTmp[512]; - static const char* comp[]={"Red", "Green", "Blue", "Alpha", ""}; - sprintf (sTmp, "%s\nPixel: %d (%s)", CTileSet::getErrorMessage (error), pixel, comp[composante]); - return (int)(MessageBox (NULL, (std::string(sTmp)+"\nContinue ?").c_str(), _T("Can't add tile"), MB_YESNO|MB_ICONEXCLAMATION)==IDYES); + static const char* comp[] = { "Red", "Green", "Blue", "Alpha", "" }; + std::string msg = NLMISC::toString("%s\nPixel: %d (%s)\nContinue ?", CTileSet::getErrorMessage (error), pixel, comp[composante]); + return (int)(MessageBox (NULL, utf8ToTStr(msg), _T("Can't add tile"), MB_YESNO|MB_ICONEXCLAMATION)==IDYES); } else { @@ -349,9 +350,8 @@ int TileList::setTile256 (int tile, const std::string& name, NL3D::CTile::TBitma else { // Error: bitmap not in the absolute path.. - char msg[512]; - sprintf (msg, "The bitmap %s is not in the absolute path %s.", name.c_str(), tileBank2.getAbsPath ().c_str()); - return (int)(MessageBox (NULL, (std::string (msg)+"\nContinue ?").c_str(), _T("Load error"), MB_YESNO|MB_ICONEXCLAMATION)==IDYES); + std::string msg = NLMISC::toString("The bitmap %s is not in the absolute path %s.\nContinue ?", name.c_str(), tileBank2.getAbsPath ().c_str()); + return (int)(MessageBox (NULL, utf8ToTStr(msg), _T("Load error"), MB_YESNO|MB_ICONEXCLAMATION)==IDYES); } return 1; @@ -371,7 +371,8 @@ int TileList::setTileTransition (int tile, const std::string& name, NL3D::CTile: uint Height; if (!loadPic(tileBank2.getAbsPath ()+troncated, tampon, Width, Height)) { - return (int)(MessageBox (NULL, ((tileBank2.getAbsPath ()+troncated)+"\nContinue ?").c_str(), _T("Can't load bitmap."), MB_YESNO|MB_ICONEXCLAMATION)==IDYES); + std::string msg = tileBank2.getAbsPath() + troncated + "\nContinue ?"; + return (int)(MessageBox (NULL, utf8ToTStr(msg), _T("Can't load bitmap."), MB_YESNO|MB_ICONEXCLAMATION)==IDYES); } else { @@ -387,10 +388,9 @@ int TileList::setTileTransition (int tile, const std::string& name, NL3D::CTile: error=tileBank2.getTileSet(_tileSet)->checkTile128 (type, border, pixel, composante); if ((error!=CTileSet::ok)&&(error!=CTileSet::addFirstA128128)&&!zouille ()) { - char sTmp[512]; static const char* comp[]={"Red", "Green", "Blue", "Alpha", ""}; - sprintf (sTmp, "%s\nPixel: %d (%s)", CTileSet::getErrorMessage (error), pixel, comp[composante]); - return MessageBox (NULL, (std::string(sTmp)+"\nContinue ?").c_str(), _T("Can't add tile"), MB_YESNO|MB_ICONEXCLAMATION)==IDYES; + std::string msg = NLMISC::toString("%s\nPixel: %d (%s)\nContinue ?", CTileSet::getErrorMessage(error), pixel, comp[composante]); + return MessageBox (NULL, utf8ToTStr(msg), _T("Can't add tile"), MB_YESNO|MB_ICONEXCLAMATION)==IDYES; } else { @@ -437,14 +437,17 @@ int TileList::setDisplacement (int tile, const std::string& name) theListDisplacement[tile].loaded=0; if (!_LoadBitmap(tileBank2.getAbsPath() + troncated, &theListDisplacement[tile].BmpInfo, theListDisplacement[tile].Bits, NULL, 0)) - MessageBox (NULL, (tileBank2.getAbsPath() + troncated).c_str(), _T("Can't load file"), MB_OK|MB_ICONEXCLAMATION); + { + std::string msg = tileBank2.getAbsPath() + troncated; + MessageBox(NULL, utf8ToTStr(msg), _T("Can't load file"), MB_OK | MB_ICONEXCLAMATION); + } else { // Check the size if ((theListDisplacement[tile].BmpInfo.bmiHeader.biWidth!=32)||(-theListDisplacement[tile].BmpInfo.bmiHeader.biHeight!=32)) { // Error message - MessageBox (NULL, _T("Invalid size: displacement map must be 32x32 8 bits."), troncated.c_str(), + MessageBox (NULL, _T("Invalid size: displacement map must be 32x32 8 bits."), utf8ToTStr(troncated), MB_OK|MB_ICONEXCLAMATION); // Free the bitmap @@ -464,9 +467,8 @@ int TileList::setDisplacement (int tile, const std::string& name) else { // Error: bitmap not in the absolute path.. - char msg[512]; - sprintf (msg, "The bitmap %s is not in the absolute path %s.", name.c_str(), tileBank2.getAbsPath ().c_str()); - MessageBox (NULL, msg, _T("Load error"), MB_OK|MB_ICONEXCLAMATION); + std::string msg = NLMISC::toString("The bitmap %s is not in the absolute path %s.", name.c_str(), tileBank2.getAbsPath ().c_str()); + MessageBox (NULL, utf8ToTStr(msg), _T("Load error"), MB_OK|MB_ICONEXCLAMATION); } return 1; @@ -483,7 +485,8 @@ int TileList::setTileTransitionAlpha (int tile, const std::string& name, int rot uint Height; if (!loadPic(tileBank2.getAbsPath ()+troncated, tampon, Width, Height)) { - return MessageBox (NULL, ((tileBank2.getAbsPath ()+troncated)+"\nContinue ?").c_str(), _T("Can't load bitmap."), MB_YESNO|MB_ICONEXCLAMATION)==IDYES; + std::string msg = tileBank2.getAbsPath() + troncated + "\nContinue ?"; + return MessageBox (NULL, utf8ToTStr(msg), _T("Can't load bitmap."), MB_YESNO|MB_ICONEXCLAMATION)==IDYES; } else { @@ -505,23 +508,27 @@ int TileList::setTileTransitionAlpha (int tile, const std::string& name, int rot if (((error=tileBank2.getTileSet(_tileSet)->checkTileTransition ((CTileSet::TTransition)tile, CTile::alpha, border, indexError, pixel, composante))!=CTileSet::ok)&&!zouille ()) { - char sMsg[512]; + std::string msg; if ((error==CTileSet::topInterfaceProblem)||(error==CTileSet::bottomInterfaceProblem)||(error==CTileSet::leftInterfaceProblem) ||(error==CTileSet::rightInterfaceProblem)||(error==CTileSet::topBottomNotTheSame)||(error==CTileSet::rightLeftNotTheSame) ||(error==CTileSet::topInterfaceProblem)) { static const char* comp[]={"Red", "Green", "Blue", "Alpha", ""}; if (indexError!=-1) - sprintf (sMsg, "%s\nIncompatible with tile nb %d\nPixel: %d (%s)", CTileSet::getErrorMessage (error), indexError, + msg = NLMISC::toString("%s\nIncompatible with tile nb %d\nPixel: %d (%s)", CTileSet::getErrorMessage (error), indexError, pixel, comp[composante]); else - sprintf (sMsg, "%s\nIncompatible with the 128x128 tile\nPixel: %d (%s)", CTileSet::getErrorMessage (error), + msg = NLMISC::toString("%s\nIncompatible with the 128x128 tile\nPixel: %d (%s)", CTileSet::getErrorMessage (error), pixel, comp[composante]); } else - sprintf (sMsg, "%s\nIncompatible filled tile", CTileSet::getErrorMessage (error)); + { + msg = NLMISC::toString("%s\nIncompatible filled tile", CTileSet::getErrorMessage(error)); + } + + msg += "\nContinue ?"; - return MessageBox (NULL, (std::string(sMsg)+"\nContinue ?").c_str(), _T("Can't add tile"), MB_YESNO|MB_ICONEXCLAMATION)==IDYES; + return MessageBox (NULL, utf8ToTStr(msg), _T("Can't add tile"), MB_YESNO|MB_ICONEXCLAMATION)==IDYES; } else { @@ -534,8 +541,8 @@ int TileList::setTileTransitionAlpha (int tile, const std::string& name, int rot else { // Error: bitmap not in the absolute path.. - char msg[512]; - sprintf (msg, "The bitmap %s is not in the absolute path %s.", name.c_str(), tileBank2.getAbsPath ().c_str()); + TCHAR msg[512]; + _stprintf(msg, _T("The bitmap %s is not in the absolute path %s."), utf8ToTStr(name), utf8ToTStr(tileBank2.getAbsPath ())); MessageBox (NULL, msg, _T("Load error"), MB_OK|MB_ICONEXCLAMATION); } diff --git a/code/nel/tools/3d/tile_edit/ViewColumn.cpp b/code/nel/tools/3d/tile_edit/ViewColumn.cpp index d060b6788..db69b11dc 100644 --- a/code/nel/tools/3d/tile_edit/ViewColumn.cpp +++ b/code/nel/tools/3d/tile_edit/ViewColumn.cpp @@ -19,10 +19,36 @@ #include "ViewColumn.h" #include "Browse.h" -char *WndRegKeys[4][5] = {{"POPUP BOTTOM RX","POPUP BOTTOM RY","POPUP BOTTOM CX","POPUP BOTTOM CY","POPUP BOTTOM N"}, - {"POPUP TOP RX","POPUP TOP RY","POPUP TOP CX","POPUP TOP CY","POPUP TOP N"}, - {"POPUP LEFT RX","POPUP LEFT RY","POPUP LEFT CX","POPUP LEFT CY","POPUP LEFT N"}, - {"POPUP RIGHT RX","POPUP RIGHT RY","POPUP RIGHT CX","POPUP RIGHT CY","POPUP RIGHT N"}}; +TCHAR *WndRegKeys[4][5] = { + { + _T("POPUP BOTTOM RX"), + _T("POPUP BOTTOM RY"), + _T("POPUP BOTTOM CX"), + _T("POPUP BOTTOM CY"), + _T("POPUP BOTTOM N") + }, + { + _T("POPUP TOP RX"), + _T("POPUP TOP RY"), + _T("POPUP TOP CX"), + _T("POPUP TOP CY"), + _T("POPUP TOP N") + }, + { + _T("POPUP LEFT RX"), + _T("POPUP LEFT RY"), + _T("POPUP LEFT CX"), + _T("POPUP LEFT CY"), + _T("POPUP LEFT N") + }, + { + _T("POPUP RIGHT RX"), + _T("POPUP RIGHT RY"), + _T("POPUP RIGHT CX"), + _T("POPUP RIGHT CY"), + _T("POPUP RIGHT N") + } +}; ///////////////////////////////////////////////////////////////////////////// // ViewColumn dialog @@ -164,11 +190,11 @@ BOOL ViewColumn::OnInitDialog() if (RegOpenKey(HKEY_CURRENT_USER,REGKEY_TILEDIT,®key)==ERROR_SUCCESS) { unsigned long value; - RegQueryValueEx(regkey,WndRegKeys[pos&3][0],0,&value,(unsigned char *)&rx,&value); - RegQueryValueEx(regkey,WndRegKeys[pos&3][1],0,&value,(unsigned char *)&ry,&value); - RegQueryValueEx(regkey,WndRegKeys[pos&3][2],0,&value,(unsigned char *)&cx,&value); - RegQueryValueEx(regkey,WndRegKeys[pos&3][3],0,&value,(unsigned char *)&cy,&value); - RegQueryValueEx(regkey,WndRegKeys[pos&3][4],0,&value,(unsigned char *)&nTileInWnd,&value); + RegQueryValueEx(regkey, WndRegKeys[pos&3][0], 0, &value, (LPBYTE)&rx, &value); + RegQueryValueEx(regkey, WndRegKeys[pos&3][1], 0, &value, (LPBYTE)&ry, &value); + RegQueryValueEx(regkey, WndRegKeys[pos&3][2], 0, &value, (LPBYTE)&cx, &value); + RegQueryValueEx(regkey, WndRegKeys[pos&3][3], 0, &value, (LPBYTE)&cy, &value); + RegQueryValueEx(regkey, WndRegKeys[pos&3][4], 0, &value, (LPBYTE)&nTileInWnd, &value); RegCloseKey(regkey); } EnableScrollBar(SB_VERT); @@ -378,9 +404,9 @@ void ViewColumn::OnRButtonDown(UINT nFlags, CPoint point) // TODO: Add your message handler code here and/or call default CMenu popup; popup.CreatePopupMenu(); - popup.AppendMenu(MF_STRING | (nTileInWnd==1?MF_CHECKED:0),10,"*1"); - popup.AppendMenu(MF_STRING | (nTileInWnd==4?MF_CHECKED:0),12,"*4"); - popup.AppendMenu(MF_STRING,13,"Replace window"); + popup.AppendMenu(MF_STRING | (nTileInWnd == 1 ? MF_CHECKED:0), 10, _T("*1")); + popup.AppendMenu(MF_STRING | (nTileInWnd == 4 ? MF_CHECKED:0), 12, _T("*4")); + popup.AppendMenu(MF_STRING, 13, _T("Replace window")); RECT rect; GetWindowRect(&rect); popup.TrackPopupMenu(TPM_LEFTALIGN,MousePos.x+rect.left,MousePos.y+rect.top,this,NULL); diff --git a/code/nel/tools/3d/tile_edit/ViewColumn.h b/code/nel/tools/3d/tile_edit/ViewColumn.h index 78455fce2..e079c8fc0 100644 --- a/code/nel/tools/3d/tile_edit/ViewColumn.h +++ b/code/nel/tools/3d/tile_edit/ViewColumn.h @@ -23,7 +23,7 @@ // ViewColumn.h : header file // -extern char *WndRegKeys[4][5]; +extern TCHAR *WndRegKeys[4][5]; #include "View.h" diff --git a/code/nel/tools/3d/tile_edit/custom.cpp b/code/nel/tools/3d/tile_edit/custom.cpp index e33ac3b0f..d7b4f8173 100644 --- a/code/nel/tools/3d/tile_edit/custom.cpp +++ b/code/nel/tools/3d/tile_edit/custom.cpp @@ -97,7 +97,7 @@ LRESULT Custom::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) { CString str; clist->GetLBText(i+2,str); - buttonList[i].Create((LPCSTR)str,BS_CHECKBOX,button,this,i+10); + buttonList[i].Create(str,BS_CHECKBOX,button,this,i+10); buttonList[i].SetFont(&font,1); buttonList[i].ModifyStyle(0,WS_VISIBLE); /* RECT st = button; st.left+=20; st.right = client.right - 90; st.top -= 3; diff --git a/code/nel/tools/logic/logic_editor_dll/logic_editor_interface.h b/code/nel/tools/logic/logic_editor_dll/logic_editor_interface.h index f2ac7c13a..d0059571c 100644 --- a/code/nel/tools/logic/logic_editor_dll/logic_editor_interface.h +++ b/code/nel/tools/logic/logic_editor_dll/logic_editor_interface.h @@ -17,6 +17,8 @@ #ifndef LOGIC_EDITOR_INTERFACE #define LOGIC_EDITOR_INTERFACE +#include + #ifndef LOGIC_EDITOR_EXPORT #define LOGIC_EDITOR_EXPORT __declspec( dllimport ) #endif // LOGIC_EDITOR_EXPORT diff --git a/code/nel/tools/misc/branch_patcher/branch_patcherDlg.cpp b/code/nel/tools/misc/branch_patcher/branch_patcherDlg.cpp index c27111935..134eddebf 100644 --- a/code/nel/tools/misc/branch_patcher/branch_patcherDlg.cpp +++ b/code/nel/tools/misc/branch_patcher/branch_patcherDlg.cpp @@ -208,7 +208,6 @@ int CDirDialog::DoBrowse() } BROWSEINFO bInfo; - LPITEMIDLIST pidl; ZeroMemory((PVOID)&bInfo, sizeof(BROWSEINFO)); if (!m_strInitDir.IsEmpty()) @@ -258,10 +257,8 @@ int CDirDialog::DoBrowse() bInfo.lpszTitle = (m_strTitle.IsEmpty()) ? "Open" : m_strTitle; bInfo.ulFlags = BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS; - if ((pidl = ::SHBrowseForFolder(&bInfo)) == NULL) - { - return 0; - } + PIDLIST_ABSOLUTE pidl = ::SHBrowseForFolder(&bInfo); + if (!pidl) return 0; m_strPath.ReleaseBuffer(); m_iImageIndex = bInfo.iImage; diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/actions.xml b/code/ryzom/client/data/gamedev/interfaces_v3/actions.xml index d628a6996..42c931e29 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/actions.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/actions.xml @@ -235,6 +235,7 @@ + diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/commands.xml b/code/ryzom/client/data/gamedev/interfaces_v3/commands.xml index d7aabccae..31a1a7099 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/commands.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/commands.xml @@ -120,6 +120,8 @@ + + diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/keys.xml b/code/ryzom/client/data/gamedev/interfaces_v3/keys.xml index ae212a589..40ecd1c75 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/keys.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/keys.xml @@ -278,6 +278,7 @@ +