diff --git a/.hgignore b/.hgignore index 0427edd20..cde2a553b 100644 --- a/.hgignore +++ b/.hgignore @@ -45,6 +45,7 @@ default_c *_debug core *.pc +*.gch # Mac OS X compile *.dylib @@ -133,12 +134,14 @@ moc_*.cpp *.moc # Misc garbage +*.rej *.orig *.cachefile *.cache *.patch *.7z external +.svn # build code/nel/build/* diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 06acc5258..40411714a 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -11,6 +11,8 @@ # * NL_SHARE_PREFIX (default: $CMAKE_INSTALL_PREFIX/share) # * NL_BIN_PREFIX (default: $CMAKE_INSTALL_PREFIX/bin) # * NL_SBIN_PREFIX (default: $CMAKE_INSTALL_PREFIX/sbin) +# * NL_LIB_PREFIX (default: $CMAKE_INSTALL_PREFIX/lib) +# * NL_DRIVER_PREFIX (default: $CMAKE_INSTALL_PREFIX/lib (windows) or $CMAKE_INSTALL_PREFIX/lib/nel) # * Enable building of documentation: add -DBUILD_DOCUMENTATION:BOOL=ON - new make target: DoxygenDoc # * Updating version: update header (above) but also update NL_VERSION below. # * To build binary archive, use the 'package' target. @@ -38,10 +40,23 @@ INCLUDE(${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL) CHECK_OUT_OF_SOURCE() IF(WIN32) - SET(CMAKE_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/include;${CMAKE_INCLUDE_PATH}") + IF(NOT EXTERNAL_PATH) + SET(EXTERNAL_PATH "${CMAKE_CURRENT_SOURCE_DIR}/3rdParty" CACHE PATH "3rd party libraries root path.") + ENDIF(NOT EXTERNAL_PATH) + + IF(NOT EXTERNAL_INCLUDE_PATH) + SET(EXTERNAL_INCLUDE_PATH "${EXTERNAL_PATH}/include" CACHE PATH "3rd party libraries include path.") + ENDIF(NOT EXTERNAL_INCLUDE_PATH) + + IF(NOT EXTERNAL_LIBRARY_PATH) + SET(EXTERNAL_LIBRARY_PATH "${EXTERNAL_PATH}/lib" CACHE PATH "3rd party libraries lib path.") + ENDIF(NOT EXTERNAL_LIBRARY_PATH) + + SET(CMAKE_INCLUDE_PATH "${EXTERNAL_INCLUDE_PATH};${CMAKE_INCLUDE_PATH}") # Stupid hack for FindOpenAL.cmake - SET(CMAKE_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/3rdParty;${CMAKE_INCLUDE_PATH}") - SET(CMAKE_LIBRARY_PATH "${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/lib;${CMAKE_LIBRARY_PATH}") + SET(CMAKE_INCLUDE_PATH "${EXTERNAL_PATH};${CMAKE_INCLUDE_PATH}") + SET(CMAKE_LIBRARY_PATH "${EXTERNAL_LIBRARY_PATH};${CMAKE_LIBRARY_PATH}") + IF(NOT DEFINED ENV{QTDIR}) SET(ENV{QTDIR} "c:/qt/4.5.0") ENDIF(NOT DEFINED ENV{QTDIR}) @@ -82,6 +97,10 @@ FIND_PACKAGE(Jpeg) NL_SETUP_BUILD() +IF(WITH_MFC) + FIND_PACKAGE(MFC) +ENDIF(WITH_MFC) + NL_SETUP_BUILD_FLAGS() INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/PCHSupport.cmake) @@ -93,6 +112,8 @@ ENDIF(FINAL_VERSION) IF(WITH_QT) FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtXml REQUIRED) ENDIF(WITH_QT) +ADD_DEFINITIONS(-DHAVE_CONFIG_H) + IF(WITH_NEL) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/nel/include) diff --git a/code/CMakeModules/ConfigureChecks.cmake b/code/CMakeModules/ConfigureChecks.cmake index 982cca4b1..4a0c76e1d 100644 --- a/code/CMakeModules/ConfigureChecks.cmake +++ b/code/CMakeModules/ConfigureChecks.cmake @@ -44,5 +44,6 @@ MACRO(NL_CONFIGURE_CHECKS) CHECK_FUNCTION_EXISTS("stat64" HAVE_STAT64) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) + INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) ADD_DEFINITIONS(-DHAVE_CONFIG_H) ENDMACRO(NL_CONFIGURE_CHECKS) diff --git a/code/CMakeModules/FindLuabind.cmake b/code/CMakeModules/FindLuabind.cmake new file mode 100644 index 000000000..c3722deb7 --- /dev/null +++ b/code/CMakeModules/FindLuabind.cmake @@ -0,0 +1,55 @@ +# - Locate Luabind library +# This module defines +# LUABIND_LIBRARY, the library to link against +# LUABIND_FOUND, if false, do not try to link to LUABIND +# LUABIND_INCLUDE_DIR, where to find headers. + + +IF(LUABIND_LIBRARY AND LUABIND_INCLUDE_DIR) + # in cache already + SET(LUABIND_FIND_QUIETLY TRUE) +ENDIF(LUABIND_LIBRARY AND LUABIND_INCLUDE_DIR) + + + + +FIND_PATH(LUABIND_INCLUDE_DIR + luabind.hpp + PATHS + $ENV{LUABIND_DIR}/include + /usr/local/include + /usr/include + /sw/include + /opt/local/include + /opt/csw/include + /opt/include + PATH_SUFFIXES luabind +) + + +FIND_LIBRARY(LUABIND_LIBRARY + NAMES luabind libluabind luabind_d libluabind_d libluabindd + PATHS + $ENV{LUABIND_DIR}/lib + /usr/local/lib + /usr/lib + /usr/local/X11R6/lib + /usr/X11R6/lib + /sw/lib + /opt/local/lib + /opt/csw/lib + /opt/lib + /usr/freeware/lib64 +) + + +IF(LUABIND_LIBRARY AND LUABIND_INCLUDE_DIR) + SET(LUABIND_FOUND "YES") + IF(NOT LUABIND_FIND_QUIETLY) + MESSAGE(STATUS "Found Luabind: ${LUABIND_LIBRARY}") + ENDIF(NOT LUABIND_FIND_QUIETLY) +ELSE(LUABIND_LIBRARY AND LUABIND_INCLUDE_DIR) + IF(NOT LUABIND_FIND_QUIETLY) + MESSAGE(STATUS "Warning: Unable to find Luabind!") + ENDIF(NOT LUABIND_FIND_QUIETLY) +ENDIF(LUABIND_LIBRARY AND LUABIND_INCLUDE_DIR) diff --git a/code/CMakeModules/FindSTLport.cmake b/code/CMakeModules/FindSTLport.cmake index f2b9be4e8..09acc0201 100644 --- a/code/CMakeModules/FindSTLport.cmake +++ b/code/CMakeModules/FindSTLport.cmake @@ -32,6 +32,8 @@ FIND_LIBRARY(STLPORT_LIBRARY_DEBUG stlportstld_x stlportstld_x.5.2 stlportd + stlportd_statix + stlportd_static PATHS /usr/local/lib /usr/lib @@ -51,6 +53,8 @@ FIND_LIBRARY(STLPORT_LIBRARY_RELEASE stlport stlport_x stlport_x.5.2 + stlport_statix + stlport_static PATHS /usr/local/lib /usr/lib diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index 3125ddb78..bab58b5bf 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -27,7 +27,7 @@ MACRO(NL_TARGET_DRIVER name) IF(WITH_STATIC_DRIVERS) ADD_LIBRARY(${name} STATIC ${ARGN}) ELSE(WITH_STATIC_DRIVERS) - ADD_LIBRARY(${name} SHARED ${ARGN}) + ADD_LIBRARY(${name} MODULE ${ARGN}) ENDIF(WITH_STATIC_DRIVERS) ENDMACRO(NL_TARGET_DRIVER) @@ -38,15 +38,18 @@ ENDMACRO(NL_TARGET_DRIVER) ### MACRO(NL_DEFAULT_PROPS name label) GET_TARGET_PROPERTY(type ${name} TYPE) - IF((${type} STREQUAL SHARED_LIBRARY) OR (${type} STREQUAL MODULE_LIBRARY)) - # Set versions only if target is a shared library or a module - SET(versions VERSION ${NL_VERSION} SOVERSION ${NL_VERSION_MAJOR}) - ENDIF((${type} STREQUAL SHARED_LIBRARY) OR (${type} STREQUAL MODULE_LIBRARY)) - SET_TARGET_PROPERTIES(${name} PROPERTIES - ${versions} - PROJECT_LABEL ${label}) + IF(${type} STREQUAL SHARED_LIBRARY) + # Set versions only if target is a shared library + SET_TARGET_PROPERTIES(${name} PROPERTIES + VERSION ${NL_VERSION} SOVERSION ${NL_VERSION_MAJOR} + PROJECT_LABEL ${label}) + ELSE(${type} STREQUAL SHARED_LIBRARY) + SET_TARGET_PROPERTIES(${name} PROPERTIES + PROJECT_LABEL ${label}) + ENDIF(${type} STREQUAL SHARED_LIBRARY) ENDMACRO(NL_DEFAULT_PROPS) + ### # Adds the target suffix on Windows. # Argument: name - the library's target name. @@ -75,17 +78,17 @@ ENDMACRO(NL_ADD_RUNTIME_FLAGS) MACRO(NL_ADD_STATIC_VID_DRIVERS name) IF(WITH_STATIC_DRIVERS) IF(WIN32) - IF(WITH_DRIVER_DIRECT3D) - TARGET_LINK_LIBRARIES(${name} nel_drv_direct3d_win) + IF(WITH_DRIVER_DIRECT3D) + TARGET_LINK_LIBRARIES(${name} nel_drv_direct3d_win) ENDIF(WITH_DRIVER_DIRECT3D) - - IF(WITH_DRIVER_DSOUND) - TARGET_LINK_LIBRARIES(${name} nel_drv_dsound) - ENDIF(WITH_DRIVER_DSOUND) - - IF(WITH_DRIVER_XAUDIO2) - TARGET_LINK_LIBRARIES(${name} nel_drv_xaudio2) - ENDIF(WITH_DRIVER_XAUDIO2) + + IF(WITH_DRIVER_DSOUND) + TARGET_LINK_LIBRARIES(${name} nel_drv_dsound) + ENDIF(WITH_DRIVER_DSOUND) + + IF(WITH_DRIVER_XAUDIO2) + TARGET_LINK_LIBRARIES(${name} nel_drv_xaudio2) + ENDIF(WITH_DRIVER_XAUDIO2) ENDIF(WIN32) IF(WITH_DRIVER_OPENAL) @@ -98,9 +101,9 @@ MACRO(NL_ADD_STATIC_VID_DRIVERS name) IF(WITH_DRIVER_OPENGL) IF(WIN32) - TARGET_LINK_LIBRARIES(${name} nel_drv_opengl_win) - ELSE(WIN32) - TARGET_LINK_LIBRARIES(${name} nel_drv_opengl) + TARGET_LINK_LIBRARIES(${name} nel_drv_opengl_win) + ELSE(WIN32) + TARGET_LINK_LIBRARIES(${name} nel_drv_opengl) ENDIF(WIN32) ENDIF(WITH_DRIVER_OPENGL) ENDIF(WITH_STATIC_DRIVERS) @@ -109,13 +112,13 @@ ENDMACRO(NL_ADD_STATIC_VID_DRIVERS) MACRO(NL_ADD_STATIC_SND_DRIVERS name) IF(WITH_STATIC_DRIVERS) IF(WIN32) - IF(WITH_DRIVER_DSOUND) - TARGET_LINK_LIBRARIES(${name} nel_drv_dsound) - ENDIF(WITH_DRIVER_DSOUND) - - IF(WITH_DRIVER_XAUDIO2) - TARGET_LINK_LIBRARIES(${name} nel_drv_xaudio2) - ENDIF(WITH_DRIVER_XAUDIO2) + IF(WITH_DRIVER_DSOUND) + TARGET_LINK_LIBRARIES(${name} nel_drv_dsound) + ENDIF(WITH_DRIVER_DSOUND) + + IF(WITH_DRIVER_XAUDIO2) + TARGET_LINK_LIBRARIES(${name} nel_drv_xaudio2) + ENDIF(WITH_DRIVER_XAUDIO2) ENDIF(WIN32) IF(WITH_DRIVER_OPENAL) @@ -209,7 +212,7 @@ MACRO(NL_SETUP_NEL_DEFAULT_OPTIONS) OPTION(WITH_NEL_MAXPLUGIN "Build NeL 3dsMax Plugin" OFF) OPTION(WITH_NEL_SAMPLES "Build NeL Samples" ON ) OPTION(WITH_NEL_TESTS "Build NeL Unit Tests" ON ) - + OPTION(WITH_MFC "With MFC Support" ON ) ENDMACRO(NL_SETUP_NEL_DEFAULT_OPTIONS) MACRO(NL_SETUP_RYZOM_DEFAULT_OPTIONS) @@ -248,12 +251,25 @@ MACRO(NL_SETUP_BUILD) ENDIF(CMAKE_BUILD_TYPE MATCHES "Debug") IF(WIN32) - SET(NL_DEBUG_CFLAGS "/EHa /Ob1 /Zi") - SET(NL_RELEASE_CFLAGS "/EHa /Zi /Ox /Ob2 /Oi /Ot /Oy /GT /GF /GS-") - SET(NL_RELEASEDEBUG_CFLAGS "/EHa /DNL_RELEASE_DEBUG /Zi /Ob2 /GF") + # don't use a /O[012x] flag if you want custom optimizations + SET(SPEED_OPTIMIZATIONS "/Ob2 /Oi /Ot /Oy /GT /GF /GS-") + SET(SIZE_OPTIMIZATIONS "/O1") + # without inlining it's unusable, use custom optimizations again + SET(MIN_OPTIMIZATIONS "/Ob1") + + SET(CMAKE_C_FLAGS_DEBUG "/MDd /Zi /RTC1 /D_DEBUG ${MIN_OPTIMIZATIONS}") + SET(CMAKE_C_FLAGS_RELEASE "/MD /Zi /D NDEBUG ${SPEED_OPTIMIZATIONS}") + SET(CMAKE_C_FLAGS_RELWITHDEBINFO "/MD /Zi /D NDEBUG ${SPEED_OPTIMIZATIONS}") + SET(CMAKE_C_FLAGS_MINSIZEREL "/MD /D NDEBUG ${SIZE_OPTIMIZATIONS}") + SET(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG}) + SET(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE}) + SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO}) + SET(CMAKE_CXX_FLAGS_MINSIZEREL ${CMAKE_C_FLAGS_MINSIZEREL}) + + SET(NL_DEBUG_CFLAGS "/EHa /Zi") + SET(NL_RELEASE_CFLAGS "/EHa /Zi") SET(NL_DEBUG_LINK_FLAGS "/NODEFAULTLIB:msvcrt") SET(NL_RELEASE_LINK_FLAGS "/OPT:REF /OPT:ICF") - SET(NL_RELEASEDEBUG_LINK_FLAGS "/OPT:REF /OPT:ICF") ELSE(WIN32) SET(PLATFORM_CFLAGS "-ftemplate-depth-24 -D_REENTRANT -Wall -ansi -W -Wpointer-arith -Wsign-compare -Wno-deprecated-declarations -Wno-multichar -Wno-long-long -Wno-unused") IF(WITH_COVERAGE) @@ -265,7 +281,6 @@ MACRO(NL_SETUP_BUILD) ENDIF(NOT APPLE) SET(NL_DEBUG_CFLAGS "-DNL_DEBUG -g") SET(NL_RELEASE_CFLAGS "-DNL_RELEASE -O6 -g") - SET(NL_RELEASEDEBUG_CFLAGS "-DNL_RELEASE_DEBUG -g -finline-functions -O3 ") SET(NL_NONE_CFLAGS "-DNL_RELEASE -g -finline-functions -O2 ") ENDIF(WIN32) @@ -308,14 +323,14 @@ MACRO(NL_SETUP_BUILD_FLAGS) SET(CMAKE_LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE} ${NL_RELEASE_LINK_FLAGS} ${PLATFORM_LINKFLAGS} ") ## RelWithDebInfo - SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${NL_RELEASEDEBUG_CFLAGS} ${PLATFORM_CFLAGS} ") - SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${NL_RELEASEDEBUG_CFLAGS} ${PLATFORM_CFLAGS} ") - SET(CMAKE_LINK_FLAGS_RELWITHDEBINFO "${CMAKE_LINK_FLAGS_RELWITHDEBINFO} ${NL_RELEASEDEBUG_LINK_FLAGS} ${PLATFORM_LINKFLAGS} ") + SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${NL_RELEASE_CFLAGS} ${PLATFORM_CFLAGS} ") + SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${NL_RELEASE_CFLAGS} ${PLATFORM_CFLAGS} ") + SET(CMAKE_LINK_FLAGS_RELWITHDEBINFO "${CMAKE_LINK_FLAGS_RELWITHDEBINFO} ${NL_RELEASE_LINK_FLAGS} ${PLATFORM_LINKFLAGS} ") ## MinSizeRel - SET(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} ${NL_RELEASEDEBUG_CFLAGS} ${PLATFORM_CFLAGS} ") - SET(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${NL_RELEASEDEBUG_CFLAGS} ${PLATFORM_CFLAGS} ") - SET(CMAKE_LINK_FLAGS_MINSIZEREL "${CMAKE_LINK_FLAGS_MINSIZEREL} ${NL_RELEASEDEBUG_LINK_CFLAGS} ${PLATFORM_LINKFLAGS} ") + SET(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} ${NL_RELEASE_CFLAGS} ${PLATFORM_CFLAGS} ") + SET(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${NL_RELEASE_CFLAGS} ${PLATFORM_CFLAGS} ") + SET(CMAKE_LINK_FLAGS_MINSIZEREL "${CMAKE_LINK_FLAGS_MINSIZEREL} ${NL_RELEASE_LINK_CFLAGS} ${PLATFORM_LINKFLAGS} ") ENDMACRO(NL_SETUP_BUILD_FLAGS) MACRO(NL_SETUP_PREFIX_PATHS) @@ -331,28 +346,46 @@ MACRO(NL_SETUP_PREFIX_PATHS) ## Allow override of install_prefix/share path. IF(NOT NL_SHARE_PREFIX) IF(WIN32) - SET(NL_SHARE_PREFIX "../share/nel" CACHE PATH "Installation path for data.") - ELSE(WIN32) - SET(NL_SHARE_PREFIX "${CMAKE_INSTALL_PREFIX}/share/nel" CACHE PATH "Installation path for data.") - ENDIF(WIN32) + SET(NL_SHARE_PREFIX "../share/nel" CACHE PATH "Installation path for data.") + ELSE(WIN32) + SET(NL_SHARE_PREFIX "${CMAKE_INSTALL_PREFIX}/share/nel" CACHE PATH "Installation path for data.") + ENDIF(WIN32) ENDIF(NOT NL_SHARE_PREFIX) ## Allow override of install_prefix/sbin path. IF(NOT NL_SBIN_PREFIX) - IF(WIN32) - SET(NL_SBIN_PREFIX "../sbin" CACHE PATH "Installation path for admin tools and services.") - ELSE(WIN32) - SET(NL_SBIN_PREFIX "${CMAKE_INSTALL_PREFIX}/sbin" CACHE PATH "Installation path for admin tools and services.") - ENDIF(WIN32) + IF(WIN32) + SET(NL_SBIN_PREFIX "../sbin" CACHE PATH "Installation path for admin tools and services.") + ELSE(WIN32) + SET(NL_SBIN_PREFIX "${CMAKE_INSTALL_PREFIX}/sbin" CACHE PATH "Installation path for admin tools and services.") + ENDIF(WIN32) ENDIF(NOT NL_SBIN_PREFIX) ## Allow override of install_prefix/bin path. IF(NOT NL_BIN_PREFIX) IF(WIN32) - SET(NL_BIN_PREFIX "../bin" CACHE PATH "Installation path for tools and applications.") + SET(NL_BIN_PREFIX "../bin" CACHE PATH "Installation path for tools and applications.") ELSE(WIN32) - SET(NL_BIN_PREFIX "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation path for tools and applications.") + SET(NL_BIN_PREFIX "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation path for tools and applications.") ENDIF(WIN32) ENDIF(NOT NL_BIN_PREFIX) + ## Allow override of install_prefix/lib path. + IF(NOT NL_LIB_PREFIX) + IF(WIN32) + SET(NL_LIB_PREFIX "../lib" CACHE PATH "Installation path for libraries.") + ELSE(WIN32) + SET(NL_LIB_PREFIX "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation path for libraries.") + ENDIF(WIN32) + ENDIF(NOT NL_LIB_PREFIX) + + ## Allow override of install_prefix/lib path. + IF(NOT NL_DRIVER_PREFIX) + IF(WIN32) + SET(NL_DRIVER_PREFIX "../lib" CACHE PATH "Installation path for drivers.") + ELSE(WIN32) + SET(NL_DRIVER_PREFIX "${CMAKE_INSTALL_PREFIX}/lib/nel" CACHE PATH "Installation path for drivers.") + ENDIF(WIN32) + ENDIF(NOT NL_DRIVER_PREFIX) + ENDMACRO(NL_SETUP_PREFIX_PATHS) diff --git a/code/nel/CMakeLists.txt b/code/nel/CMakeLists.txt index 7eeb3a8d9..408eed9e3 100644 --- a/code/nel/CMakeLists.txt +++ b/code/nel/CMakeLists.txt @@ -1,3 +1,18 @@ +# * NL_LIB_PREFIX (default: $CMAKE_INSTALL_PREFIX/lib) +# * NL_DRIVER_PREFIX (default: $CMAKE_INSTALL_PREFIX/lib (windows) or $CMAKE_INSTALL_PREFIX/lib/nel) + SET(EXTERNAL_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty" CACHE PATH "3rd party libraries root path.") + ENDIF(NOT EXTERNAL_PATH) + + IF(NOT EXTERNAL_INCLUDE_PATH) + SET(EXTERNAL_INCLUDE_PATH "${EXTERNAL_PATH}/include" CACHE PATH "3rd party libraries include path.") + ENDIF(NOT EXTERNAL_INCLUDE_PATH) + + IF(NOT EXTERNAL_LIBRARY_PATH) + SET(EXTERNAL_LIBRARY_PATH "${EXTERNAL_PATH}/lib" CACHE PATH "3rd party libraries lib path.") + ENDIF(NOT EXTERNAL_LIBRARY_PATH) + + SET(CMAKE_INCLUDE_PATH "${EXTERNAL_INCLUDE_PATH};${CMAKE_INCLUDE_PATH}") + PROJECT(NeL CXX C) IF(WITH_STATIC_DRIVERS) @@ -55,6 +70,10 @@ IF(WITH_SOUND) ENDIF(WITH_DRIVER_FMOD) ENDIF(WITH_SOUND) +IF(WITH_MFC) + FIND_PACKAGE(MFC) +ENDIF(WITH_MFC) + IF(WITH_GTK) FIND_PACKAGE(GTK2) ENDIF(WITH_GTK) @@ -95,6 +114,11 @@ IF(WIN32) ENDIF(WIN32) ADD_SUBDIRECTORY(include) +# config.h configuration and use by projects +CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h) +INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}) +ADD_DEFINITIONS(-DHAVE_CONFIG_H) + ADD_SUBDIRECTORY(src) IF(WITH_NEL_SAMPLES) @@ -102,8 +126,6 @@ IF(WITH_NEL_SAMPLES) ENDIF(WITH_NEL_SAMPLES) IF(WITH_NEL_TOOLS) - IF(WIN32) - FIND_PACKAGE(S3TC) - ENDIF(WIN32) + FIND_PACKAGE(Squish) ADD_SUBDIRECTORY(tools) ENDIF(WITH_NEL_TOOLS) \ No newline at end of file diff --git a/code/nel/config.h.cmake b/code/nel/config.h.cmake new file mode 100644 index 000000000..5296b3d50 --- /dev/null +++ b/code/nel/config.h.cmake @@ -0,0 +1,43 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#cmakedefine HAVE_DL_H 1 +#cmakedefine HAVE_EXECINFO_H 1 +#cmakedefine HAVE_ICONV 1 +#cmakedefine HAVE_INTTYPES_H 1 +#cmakedefine HAVE_LANGINFO_CODESET 1 +#cmakedefine HAVE_LIMITS_H 1 +#cmakedefine HAVE_MALLOC_H 1 +#cmakedefine HAVE_PAM_MISC_H 1 +#cmakedefine HAVE_PAM_PAM_APPL_H 1 +#cmakedefine HAVE_PTHREAD 1 +#cmakedefine HAVE_SECURITY_PAM_APPL_H 1 +#cmakedefine HAVE_SECURITY_PAM_MISC_H 1 +#cmakedefine HAVE_STDINT_H 1 +#cmakedefine HAVE_SYS_MOUNT_H 1 +#cmakedefine HAVE_SYS_PARAM_H 1 +#cmakedefine HAVE_SYS_STATVFS_H 1 +#cmakedefine HAVE_SYS_TYPES_H 1 +#cmakedefine HAVE_UNISTD_H 1 +#cmakedefine HAVE_UTIME_H 1 +#cmakedefine HAVE_WCHAR_H 1 + +#cmakedefine HAVE_BACKTRACE 1 +#cmakedefine HAVE_INET_NTOA 1 +#cmakedefine HAVE_INET_NTOP 1 +#cmakedefine HAVE_INET_PTON 1 +#cmakedefine HAVE_STRERROR 1 +#cmakedefine HAVE_STRLCAT 1 +#cmakedefine HAVE_STRPTIME 1 +#cmakedefine HAVE_STRTOK_R 1 +#cmakedefine HAVE_STRTOULL 1 +#cmakedefine HAVE_STATVFS 1 +#cmakedefine HAVE_STAT64 1 + +#cmakedefine NL_BIN_PREFIX "${NL_BIN_PREFIX}" +#cmakedefine NL_ETC_PREFIX "${NL_ETC_PREFIX}" +#cmakedefine NL_SHARE_PREFIX "${NL_SHARE_PREFIX}" +#cmakedefine NL_LIB_PREFIX "${NL_LIB_PREFIX}" +#cmakedefine NL_DRIVER_PREFIX "${NL_DRIVER_PREFIX}" + +#endif // CONFIG_H diff --git a/code/nel/include/nel/net/inet_address.h b/code/nel/include/nel/net/inet_address.h index 50b591fb6..a526b303f 100644 --- a/code/nel/include/nel/net/inet_address.h +++ b/code/nel/include/nel/net/inet_address.h @@ -143,6 +143,9 @@ protected: /// Constructor with ip address, port=0 CInetAddress( const in_addr *ip, const char *hostname = 0); + /// Update _HostName from _SockAddr + void updateHostName(); + private: // Called in all constructors. Calls CBaseSocket::init(). diff --git a/code/nel/samples/3d/cegui/CMakeLists.txt b/code/nel/samples/3d/cegui/CMakeLists.txt index ba04f4229..0b8a8f2a0 100644 --- a/code/nel/samples/3d/cegui/CMakeLists.txt +++ b/code/nel/samples/3d/cegui/CMakeLists.txt @@ -1,19 +1,14 @@ FILE(GLOB SRC *.cpp *.h) -ADD_EXECUTABLE(nl_sample_cegui ${SRC}) +ADD_EXECUTABLE(nl_sample_cegui WIN32 ${SRC}) ADD_DEFINITIONS(-DCEGUI_DATA_DIR="\\"${NL_SHARE_PREFIX}/nl_sample_cegui/datafiles/\\"") -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${CEGUI_INCLUDE_DIRS}) -TARGET_LINK_LIBRARIES(nl_sample_cegui ${LIBXML2_LIBRARIES} ${CEGUI_LIBRARY} ${PLATFORM_LINKFLAGS} nelmisc nel3d) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_cegui PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - LINK_FLAGS "/SUBSYSTEM:WINDOWS" - PROJECT_LABEL "NeL, Samples, 3D: NeL CEGUI Demo") -ENDIF(WIN32) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +INCLUDE_DIRECTORIES(${CEGUI_INCLUDE_DIRS}) + +TARGET_LINK_LIBRARIES(nl_sample_cegui ${CEGUI_LIBRARY} ${PLATFORM_LINKFLAGS} nelmisc nel3d) +NL_DEFAULT_PROPS(nl_sample_cegui "NeL, Samples, 3D: NeL CEGUI Demo") +NL_ADD_RUNTIME_FLAGS(nl_sample_cegui) INSTALL(TARGETS nl_sample_cegui RUNTIME DESTINATION bin COMPONENT samples3d) INSTALL(DIRECTORY datafiles/ diff --git a/code/nel/samples/3d/cluster_viewer/CMakeLists.txt b/code/nel/samples/3d/cluster_viewer/CMakeLists.txt index 384659264..764c83961 100644 --- a/code/nel/samples/3d/cluster_viewer/CMakeLists.txt +++ b/code/nel/samples/3d/cluster_viewer/CMakeLists.txt @@ -4,34 +4,31 @@ ADD_EXECUTABLE(nl_sample_clusterview WIN32 ${SRC}) ADD_DEFINITIONS(-DCV_DIR="\\"${NL_SHARE_PREFIX}/nl_sample_clusterview/\\"") -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nl_sample_clusterview ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc nel3d) +TARGET_LINK_LIBRARIES(nl_sample_clusterview ${PLATFORM_LINKFLAGS} nelmisc nel3d) NL_ADD_RUNTIME_FLAGS(nl_sample_clusterview) NL_DEFAULT_PROPS(nl_sample_clusterview "NeL, Samples, 3D: Cluster Viewer") -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - INSTALL(TARGETS nl_sample_clusterview RUNTIME DESTINATION bin COMPONENT samples3d) INSTALL(FILES main.cvs readme.txt DESTINATION share/nel/nl_sample_clusterview COMPONENT samples3d) -INSTALL(DIRECTORY groups/ +INSTALL(DIRECTORY groups/ DESTINATION share/nel/nl_sample_clusterview/groups COMPONENT samples3d PATTERN "CVS" EXCLUDE PATTERN ".svn" EXCLUDE PATTERN "Makefile*" EXCLUDE) -INSTALL(DIRECTORY fonts/ +INSTALL(DIRECTORY fonts/ DESTINATION share/nel/nl_sample_clusterview/fonts COMPONENT samples3d PATTERN "CVS" EXCLUDE PATTERN ".svn" EXCLUDE PATTERN "Makefile*" EXCLUDE) -INSTALL(DIRECTORY max/ +INSTALL(DIRECTORY max/ DESTINATION share/nel/nl_sample_clusterview/max COMPONENT samples3d PATTERN "CVS" EXCLUDE PATTERN ".svn" EXCLUDE PATTERN "Makefile*" EXCLUDE) -INSTALL(DIRECTORY shapes/ +INSTALL(DIRECTORY shapes/ DESTINATION share/nel/nl_sample_clusterview/shapes COMPONENT samples3d PATTERN "CVS" EXCLUDE diff --git a/code/nel/samples/3d/font/CMakeLists.txt b/code/nel/samples/3d/font/CMakeLists.txt index 2346ca734..28705aa2b 100644 --- a/code/nel/samples/3d/font/CMakeLists.txt +++ b/code/nel/samples/3d/font/CMakeLists.txt @@ -4,12 +4,9 @@ ADD_EXECUTABLE(nl_sample_font WIN32 ${SRC}) ADD_DEFINITIONS(-DFONT_DIR="\\"${NL_SHARE_PREFIX}/nl_sample_font/\\"") -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nl_sample_font ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc nel3d) +TARGET_LINK_LIBRARIES(nl_sample_font ${PLATFORM_LINKFLAGS} nelmisc nel3d) NL_DEFAULT_PROPS(nl_sample_font "NeL, Samples, 3D: Font") NL_ADD_RUNTIME_FLAGS(nl_sample_font) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - INSTALL(TARGETS nl_sample_font RUNTIME DESTINATION bin COMPONENT samples3d) INSTALL(FILES beteckna.ttf DESTINATION share/nel/nl_sample_font COMPONENT samples3d) diff --git a/code/nel/samples/3d/qtnel/CMakeLists.txt b/code/nel/samples/3d/qtnel/CMakeLists.txt index 2fd366069..ed14f6374 100644 --- a/code/nel/samples/3d/qtnel/CMakeLists.txt +++ b/code/nel/samples/3d/qtnel/CMakeLists.txt @@ -17,12 +17,15 @@ SET( QT_USE_QTOPENGL TRUE) QT4_WRAP_CPP( QTNEL_MOC_SRCS ${QTNEL_HDR}) #ADD_EXECUTABLE(qtnel ${TILE_EDIT_SRC} ${TILE_EDIT_MOC_SRCS} ${TILE_EDIT_RC_SRCS} ${TILE_EDIT_UI_HDRS}) -ADD_EXECUTABLE(qtnel ${QTNEL_SRC} ${QTNEL_MOC_SRCS} ${QTNEL_HDR}) +ADD_EXECUTABLE(qtnel WIN32 ${QTNEL_SRC} ${QTNEL_MOC_SRCS} ${QTNEL_HDR}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${QT_INCLUDES}) -TARGET_LINK_LIBRARIES(qtnel ${LIBXML2_LIBRARIES} ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY} ${PLATFORM_LINKFLAGS} nelmisc nel3d) -SET_TARGET_PROPERTIES(qtnel PROPERTIES PROJECT_LABEL "Samples, 3D: Qt Viewer Widget") -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} ${QT_DEFINITIONS}) +INCLUDE_DIRECTORIES(${QT_INCLUDES}) + +TARGET_LINK_LIBRARIES(qtnel ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY} ${PLATFORM_LINKFLAGS} nelmisc nel3d) +NL_DEFAULT_PROPS(qtnel "Samples, 3D: Qt Viewer Widget") +NL_ADD_RUNTIME_FLAGS(qtnel) + +ADD_DEFINITIONS(${QT_DEFINITIONS}) INSTALL(TARGETS qtnel RUNTIME DESTINATION bin COMPONENT samples3d) diff --git a/code/nel/samples/3d/shape_viewer/CMakeLists.txt b/code/nel/samples/3d/shape_viewer/CMakeLists.txt index 87945d310..fc98ff5e2 100644 --- a/code/nel/samples/3d/shape_viewer/CMakeLists.txt +++ b/code/nel/samples/3d/shape_viewer/CMakeLists.txt @@ -2,17 +2,8 @@ FILE(GLOB SRC *.cpp) ADD_EXECUTABLE(nl_sample_shapeview WIN32 ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nl_sample_shapeview ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc nel3d) -NL_DEFAULT_PROPS(nl_sample_shapeview "NeL, Samples, 3D: Font") +TARGET_LINK_LIBRARIES(nl_sample_shapeview ${PLATFORM_LINKFLAGS} nelmisc nel3d) +NL_DEFAULT_PROPS(nl_sample_shapeview "NeL, Samples, 3D: Shape Viewer") NL_ADD_RUNTIME_FLAGS(nl_sample_shapeview) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_shapeview PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - PROJECT_LABEL "NeL, Samples, 3D: Shape Viewer") -ENDIF(WIN32) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - INSTALL(TARGETS nl_sample_shapeview RUNTIME DESTINATION bin COMPONENT samples3d) diff --git a/code/nel/samples/georges/CMakeLists.txt b/code/nel/samples/georges/CMakeLists.txt index 1feb7301e..b481983f9 100644 --- a/code/nel/samples/georges/CMakeLists.txt +++ b/code/nel/samples/georges/CMakeLists.txt @@ -4,13 +4,10 @@ ADD_EXECUTABLE(nl_sample_georges ${SRC}) ADD_DEFINITIONS(-DGF_DIR="\\"${NL_SHARE_PREFIX}/nl_sample_georges/\\"") -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nl_sample_georges ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelgeorges nelmisc) +TARGET_LINK_LIBRARIES(nl_sample_georges ${PLATFORM_LINKFLAGS} nelgeorges nelmisc) NL_DEFAULT_PROPS(nl_sample_georges "NeL, Samples: Georges") NL_ADD_RUNTIME_FLAGS(nl_sample_georges) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - INSTALL(TARGETS nl_sample_georges RUNTIME DESTINATION bin COMPONENT samplesgeorges) INSTALL(FILES boolean.typ coolfilesinfo.dfn default.sample_config int.typ positiondata.dfn sample_config.dfn string.typ sheet_id.bin DESTINATION share/nel/nl_sample_georges/ COMPONENT samplesgeorges) diff --git a/code/nel/samples/misc/debug/CMakeLists.txt b/code/nel/samples/misc/debug/CMakeLists.txt index 843209cd7..4ac6fcd24 100644 --- a/code/nel/samples/misc/debug/CMakeLists.txt +++ b/code/nel/samples/misc/debug/CMakeLists.txt @@ -2,11 +2,8 @@ FILE(GLOB SRC *.cpp) ADD_EXECUTABLE(nl_sample_debug ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nl_sample_debug ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc) +TARGET_LINK_LIBRARIES(nl_sample_debug ${PLATFORM_LINKFLAGS} nelmisc) NL_DEFAULT_PROPS(nl_sample_debug "NeL, Samples, Misc: Debugging") NL_ADD_RUNTIME_FLAGS(nl_sample_debug) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - INSTALL(TARGETS nl_sample_debug RUNTIME DESTINATION bin COMPONENT samplesmisc) diff --git a/code/nel/samples/misc/i18n/CMakeLists.txt b/code/nel/samples/misc/i18n/CMakeLists.txt index 44059fe3c..65ca64c93 100644 --- a/code/nel/samples/misc/i18n/CMakeLists.txt +++ b/code/nel/samples/misc/i18n/CMakeLists.txt @@ -4,12 +4,9 @@ ADD_EXECUTABLE(nl_sample_i18n ${SRC}) ADD_DEFINITIONS(-DNL_LANG_DATA="\\"${NL_SHARE_PREFIX}/nl_sample_i18n/\\"") -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nl_sample_i18n ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc) +TARGET_LINK_LIBRARIES(nl_sample_i18n ${PLATFORM_LINKFLAGS} nelmisc) NL_DEFAULT_PROPS(nl_sample_i18n "NeL, Samples, Misc: I18N") NL_ADD_RUNTIME_FLAGS(nl_sample_i18n) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - INSTALL(TARGETS nl_sample_i18n RUNTIME DESTINATION bin COMPONENT samplesmisc) INSTALL(FILES de.uxt en.uxt fr.uxt DESTINATION share/nel/nl_sample_i18n COMPONENT samplesmisc) diff --git a/code/nel/samples/misc/log/CMakeLists.txt b/code/nel/samples/misc/log/CMakeLists.txt index 547b2f268..866625477 100644 --- a/code/nel/samples/misc/log/CMakeLists.txt +++ b/code/nel/samples/misc/log/CMakeLists.txt @@ -2,11 +2,8 @@ FILE(GLOB SRC *.cpp) ADD_EXECUTABLE(nl_sample_log ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nl_sample_log ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc) +TARGET_LINK_LIBRARIES(nl_sample_log ${PLATFORM_LINKFLAGS} nelmisc) NL_DEFAULT_PROPS(nl_sample_log "NeL, Samples, Misc: Logging") NL_ADD_RUNTIME_FLAGS(nl_sample_log) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - INSTALL(TARGETS nl_sample_log RUNTIME DESTINATION bin COMPONENT samplesmisc) diff --git a/code/nel/samples/misc/strings/CMakeLists.txt b/code/nel/samples/misc/strings/CMakeLists.txt index 6c2b3295d..5c89aa609 100644 --- a/code/nel/samples/misc/strings/CMakeLists.txt +++ b/code/nel/samples/misc/strings/CMakeLists.txt @@ -2,11 +2,8 @@ FILE(GLOB SRC *.cpp) ADD_EXECUTABLE(nl_sample_strings ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nl_sample_strings ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc) +TARGET_LINK_LIBRARIES(nl_sample_strings ${PLATFORM_LINKFLAGS} nelmisc) NL_DEFAULT_PROPS(nl_sample_strings "NeL, Samples, Misc: Strings") NL_ADD_RUNTIME_FLAGS(nl_sample_strings) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - INSTALL(TARGETS nl_sample_strings RUNTIME DESTINATION bin COMPONENT samplesmisc) diff --git a/code/nel/samples/misc/types_check/CMakeLists.txt b/code/nel/samples/misc/types_check/CMakeLists.txt index 229a085f7..600896be8 100644 --- a/code/nel/samples/misc/types_check/CMakeLists.txt +++ b/code/nel/samples/misc/types_check/CMakeLists.txt @@ -2,10 +2,8 @@ FILE(GLOB SRC *.cpp) ADD_EXECUTABLE(nl_sample_types_check ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nl_sample_types_check ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc) +TARGET_LINK_LIBRARIES(nl_sample_types_check ${PLATFORM_LINKFLAGS} nelmisc) +NL_DEFAULT_PROPS(nl_sample_types_check "Samples, MISC: Types check sample") NL_ADD_RUNTIME_FLAGS(nl_sample_types_check) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - INSTALL(TARGETS nl_sample_types_check RUNTIME DESTINATION bin COMPONENT samplesmisc) diff --git a/code/nel/samples/net/chat/CMakeLists.txt b/code/nel/samples/net/chat/CMakeLists.txt index c0a5e670a..ca778ee75 100644 --- a/code/nel/samples/net/chat/CMakeLists.txt +++ b/code/nel/samples/net/chat/CMakeLists.txt @@ -1,28 +1,16 @@ - - ADD_EXECUTABLE(nl_sample_chatclient client.cpp kbhit.cpp kbhit.h) -ADD_EXECUTABLE(nl_sample_chatserver server.cpp) +ADD_EXECUTABLE(nl_sample_chatserver WIN32 server.cpp) ADD_DEFINITIONS(-DCHAT_DIR="\\"${NL_SHARE_PREFIX}/nl_sample_chat/\\"") - -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nl_sample_chatclient ${PLATFORM_LINKFLAGS} nelmisc nelnet) +NL_DEFAULT_PROPS(nl_sample_chatclient "Samples, Net, Chat: Chat Client") +NL_ADD_RUNTIME_FLAGS(nl_sample_chatclient) + TARGET_LINK_LIBRARIES(nl_sample_chatserver ${PLATFORM_LINKFLAGS} nelmisc nelnet) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_chatclient PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - LINK_FLAGS "/SUBSYSTEM:CONSOLE" - PROJECT_LABEL "NeL, Samples, Net, Chat: Chat Client") - SET_TARGET_PROPERTIES(nl_sample_chatserver PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - LINK_FLAGS "/SUBSYSTEM:WINDOWS" - PROJECT_LABEL "NeL, Samples, Net, Chat: Chat Server") -ENDIF(WIN32) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +NL_DEFAULT_PROPS(nl_sample_chatserver "NeL, Samples, Net, Chat: Chat Server") +NL_ADD_RUNTIME_FLAGS(nl_sample_chatserver) INSTALL(TARGETS nl_sample_chatclient nl_sample_chatserver RUNTIME DESTINATION bin COMPONENT samplesnet) INSTALL(FILES chat_service.cfg client.cfg DESTINATION share/nel/nl_sample_chat COMPONENT samplesnet) diff --git a/code/nel/samples/net/class_transport/CMakeLists.txt b/code/nel/samples/net/class_transport/CMakeLists.txt index a8203b411..cb00906b6 100644 --- a/code/nel/samples/net/class_transport/CMakeLists.txt +++ b/code/nel/samples/net/class_transport/CMakeLists.txt @@ -1,25 +1,16 @@ -ADD_EXECUTABLE(nl_sample_ct_ai_service ai_service.cpp) +ADD_EXECUTABLE(nl_sample_ct_ai_service WIN32 ai_service.cpp) -ADD_EXECUTABLE(nl_sample_ct_gd_service gd_service.cpp) +ADD_EXECUTABLE(nl_sample_ct_gd_service WIN32 gd_service.cpp) ADD_DEFINITIONS(-DNL_CT_CFG="\\"${NL_SHARE_PREFIX}/nl_sample_class_transport/\\"") -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nl_sample_ct_ai_service ${PLATFORM_LINKFLAGS} nelmisc nelnet) +NL_DEFAULT_PROPS(nl_sample_ct_ai_service "NeL, Samples, Net, Class Transport: AI Service") +NL_ADD_RUNTIME_FLAGS(nl_sample_ct_ai_service) + TARGET_LINK_LIBRARIES(nl_sample_ct_gd_service ${PLATFORM_LINKFLAGS} nelmisc nelnet) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_ct_ai_service PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - LINK_FLAGS "/SUBSYSTEM:WINDOWS" - PROJECT_LABEL "NeL, Samples, Net, Class Transport: AI Service") - SET_TARGET_PROPERTIES(nl_sample_ct_gd_service PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - LINK_FLAGS "/SUBSYSTEM:WINDOWS" - PROJECT_LABEL "NeL, Samples, Net, Class Transport: GD Service") -ENDIF(WIN32) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +NL_DEFAULT_PROPS(nl_sample_ct_gd_service "NeL, Samples, Net, Class Transport: GD Service") +NL_ADD_RUNTIME_FLAGS(nl_sample_ct_gd_service) INSTALL(TARGETS nl_sample_ct_ai_service nl_sample_ct_gd_service RUNTIME DESTINATION bin COMPONENT samplesnet) INSTALL(FILES ai_service.cfg gd_service.cfg DESTINATION share/nel/nl_sample_class_transport COMPONENT samplesnet) diff --git a/code/nel/samples/net/login_system/CMakeLists.txt b/code/nel/samples/net/login_system/CMakeLists.txt index e9013bc15..d48734a1c 100644 --- a/code/nel/samples/net/login_system/CMakeLists.txt +++ b/code/nel/samples/net/login_system/CMakeLists.txt @@ -1,24 +1,16 @@ ADD_EXECUTABLE(nl_sample_ls_client client.cpp) -ADD_EXECUTABLE(nl_sample_ls_fes frontend_service.cpp) +ADD_EXECUTABLE(nl_sample_ls_fes WIN32 frontend_service.cpp) ADD_DEFINITIONS(-DNL_LS_CFG="\\"${NL_SHARE_PREFIX}/nl_sample_login_system/\\"") -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nl_sample_ls_client ${PLATFORM_LINKFLAGS} nelmisc nelnet) +NL_DEFAULT_PROPS(nl_sample_ls_client "NeL, Samples, Net, Login Service: LS Client") +NL_ADD_RUNTIME_FLAGS(nl_sample_ls_client) + TARGET_LINK_LIBRARIES(nl_sample_ls_fes ${PLATFORM_LINKFLAGS} nelmisc nelnet) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_ls_client PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - PROJECT_LABEL "NeL, Samples, Net, Login Service: LS Client") - SET_TARGET_PROPERTIES(nl_sample_ls_fes PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - LINK_FLAGS "/SUBSYSTEM:WINDOWS" - PROJECT_LABEL "NeL, Samples, Net, Login Service: LS Frontend") -ENDIF(WIN32) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +NL_DEFAULT_PROPS(nl_sample_ls_fes "NeL, Samples, Net, Login Service: LS Frontend") +NL_ADD_RUNTIME_FLAGS(nl_sample_ls_fes) INSTALL(TARGETS nl_sample_ls_client nl_sample_ls_fes RUNTIME DESTINATION bin COMPONENT samplesnet) INSTALL(FILES frontend_service.cfg client.cfg DESTINATION share/nel/nl_sample_login_system COMPONENT samplesnet) diff --git a/code/nel/samples/net/login_system/client.cpp b/code/nel/samples/net/login_system/client.cpp index 408baea65..22cf3e675 100644 --- a/code/nel/samples/net/login_system/client.cpp +++ b/code/nel/samples/net/login_system/client.cpp @@ -95,7 +95,7 @@ int main (int argc, char **argv) Password = fgets(buf, 256, stdin); } // crypt with md5 the password - CHashKeyMD5 hk = getMD5((uint8*)Password.c_str(), Password.size()); + CHashKeyMD5 hk = getMD5((uint8*)Password.c_str(), (uint32)Password.size()); string CPassword = hk.toString(); nlinfo("The crypted password is %s", CPassword.c_str()); diff --git a/code/nel/samples/net/udp/CMakeLists.txt b/code/nel/samples/net/udp/CMakeLists.txt index f0cb89c6e..88b527b2c 100644 --- a/code/nel/samples/net/udp/CMakeLists.txt +++ b/code/nel/samples/net/udp/CMakeLists.txt @@ -10,7 +10,6 @@ IF(WITH_3D) ADD_DEFINITIONS(-DUSE_3D) ENDIF(WITH_3D) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nl_sample_udpclient ${PLATFORM_LINKFLAGS} nelmisc nelnet nel3d) TARGET_LINK_LIBRARIES(nl_sample_udpserver ${PLATFORM_LINKFLAGS} nelmisc nelnet) NL_DEFAULT_PROPS(nl_sample_udpclient "NeL, Samples, Net, UDP: UDP Client") @@ -18,8 +17,6 @@ NL_DEFAULT_PROPS(nl_sample_udpserver "NeL, Samples, Net, UDP: UDP Server") NL_ADD_RUNTIME_FLAGS(nl_sample_udpclient) NL_ADD_RUNTIME_FLAGS(nl_sample_udpserver) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - INSTALL(TARGETS nl_sample_udpclient nl_sample_udpserver RUNTIME DESTINATION bin COMPONENT samplesnet) INSTALL(FILES bench_service.cfg client.cfg readme.txt DESTINATION share/nel/nl_sample_udp COMPONENT samplesnet) diff --git a/code/nel/samples/net/udp/client.cpp b/code/nel/samples/net/udp/client.cpp index 51ed287ce..06f494138 100644 --- a/code/nel/samples/net/udp/client.cpp +++ b/code/nel/samples/net/udp/client.cpp @@ -213,8 +213,8 @@ void cbInfo (CMessage &msgin, TSockId from, CCallbackNetBase &netbase) #ifdef USE_3D string token = "MeanPongTime "; - uint pos=line.find (token); - uint pos2=line.find (" ", pos+token.size()); + string::size_type pos=line.find (token); + string::size_type pos2=line.find (" ", pos+token.size()); uint32 val = atoi(line.substr (pos+token.size(), pos2-pos-token.size()).c_str()); LagGraph.addOneValue ((float)val); #endif @@ -309,7 +309,7 @@ int main( int argc, char **argv ) UTextContext *TextContext= Driver->createTextContext(CPath::lookup("n019003l.pfb")); TextContext->setFontSize(18); - Camera.setPerspective(80*Pi/180, 1.33, 0.15, 1000); + Camera.setPerspective(80*(float)Pi/180, 1.33f, 0.15f, 1000); CEvent3dMouseListener MouseListener; MouseListener.addToServer(Driver->EventServer); diff --git a/code/nel/samples/net/udp/graph.cpp b/code/nel/samples/net/udp/graph.cpp index 3d52279dc..86255e826 100644 --- a/code/nel/samples/net/udp/graph.cpp +++ b/code/nel/samples/net/udp/graph.cpp @@ -81,7 +81,7 @@ void CGraph::render (NL3D::UDriver *Driver, NL3D::UTextContext *TextContext) CVertexBuffer vbuffer; vbuffer.setVertexFormat (CVertexBuffer::PositionFlag); - vbuffer.setNumVertices (Values.size() * 2); + vbuffer.setNumVertices ((uint32)Values.size() * 2); float pos = X+Width-1; uint i = 0; diff --git a/code/nel/samples/net/udp/receive_task.h b/code/nel/samples/net/udp/receive_task.h index 4d58483bf..1bebc3308 100644 --- a/code/nel/samples/net/udp/receive_task.h +++ b/code/nel/samples/net/udp/receive_task.h @@ -53,7 +53,7 @@ struct TReceivedMessage void vectorToAddress(); /// Set "disconnection" message for the current AddrFrom - void setTypeEvent( TEventType t ) { *_Data.begin() = t; } + void setTypeEvent( TEventType t ) { *_Data.begin() = (uint8)t; } void setDate() { *(sint64*)&(*(_Data.begin()+1)) = NLMISC::CTime::getLocalTime(); } @@ -69,7 +69,7 @@ struct TReceivedMessage const uint8 *userDataR() const { return &*_Data.begin() + MsgHeaderSize; } /// Return the size of user data - uint32 userSize() { return _Data.size() - MsgHeaderSize; } + uint32 userSize() { return (uint32)_Data.size() - MsgHeaderSize; } /// Return the data vector (event type header byte + user data) vector& data() { return _Data; } diff --git a/code/nel/samples/pacs/CMakeLists.txt b/code/nel/samples/pacs/CMakeLists.txt index 426a37017..7000c7e7e 100644 --- a/code/nel/samples/pacs/CMakeLists.txt +++ b/code/nel/samples/pacs/CMakeLists.txt @@ -1,23 +1,16 @@ FILE(GLOB SRC *.cpp *.h) -ADD_EXECUTABLE(nl_sample_pacs ${SRC}) +ADD_EXECUTABLE(nl_sample_pacs WIN32 ${SRC}) ADD_DEFINITIONS(-DNL_PACS_DATA="\\"${NL_SHARE_PREFIX}/nl_sample_pacs/\\"") -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nl_sample_pacs ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc nelpacs nel3d) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_pacs PROPERTIES LINK_FLAGS "/SUBSYSTEM:WINDOWS") -ENDIF(WIN32) - +TARGET_LINK_LIBRARIES(nl_sample_pacs ${PLATFORM_LINKFLAGS} nelmisc nelpacs nel3d) NL_DEFAULT_PROPS(nl_sample_pacs "NeL, Samples: PACS") NL_ADD_RUNTIME_FLAGS(nl_sample_pacs) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - INSTALL(TARGETS nl_sample_pacs RUNTIME DESTINATION bin COMPONENT samplespacs) INSTALL(FILES readme.txt DESTINATION share/nel/nl_sample_pacs COMPONENT samplespacs) -INSTALL(DIRECTORY shapes/ +INSTALL(DIRECTORY shapes/ DESTINATION share/nel/nl_sample_pacs/shapes COMPONENT samplespacs PATTERN "CVS" EXCLUDE diff --git a/code/nel/samples/pacs/main.cpp b/code/nel/samples/pacs/main.cpp index 256acf9b3..d3d87a938 100644 --- a/code/nel/samples/pacs/main.cpp +++ b/code/nel/samples/pacs/main.cpp @@ -264,7 +264,7 @@ int main () } // Keyboard - if (arrayObj.size()) + if (!arrayObj.empty()) { // Manipulate selected primitive keyboard (pDriver, deltaTime, *(arrayObj[selected])); @@ -273,7 +273,8 @@ int main () if (pDriver->AsyncListener.isKeyDown (KeyDELETE)) { // remove all but one - if (arrayObj.size() > 1) { + if (arrayObj.size() > 1) + { arrayObj[arrayObj.size()-1]->remove (*container, *pScene); arrayObj.resize (arrayObj.size()-1); } @@ -281,7 +282,7 @@ int main () // Check selected if (selected>=arrayObj.size()) - selected=arrayObj.size()-1; + selected=(uint)arrayObj.size()-1; //if (selected<0) // selected=0; @@ -312,8 +313,7 @@ int main () clearColor=CRGBA::Black; // Setup view matrix - int size=arrayObj.size(); - if (size) + if (!arrayObj.empty()) { // Setup hotspot for the 3d listener plistener->setHotSpot (arrayObj[selected]->getPos()); diff --git a/code/nel/samples/sound_sources/CMakeLists.txt b/code/nel/samples/sound_sources/CMakeLists.txt index ccdefbf13..a30725e2d 100644 --- a/code/nel/samples/sound_sources/CMakeLists.txt +++ b/code/nel/samples/sound_sources/CMakeLists.txt @@ -2,18 +2,16 @@ FILE(GLOB SRC *.cpp *.h) ADD_EXECUTABLE(nl_sample_sound_sources ${SRC}) -ADD_DEFINITIONS(-DNL_SOUND_DATA="\\"${NL_SHARE_PREFIX}/nl_sample_sound/\\"") +ADD_DEFINITIONS(-DNL_SOUND_DATA="\\"${NL_SHARE_PREFIX}/nl_sample_sound/\\"" ${LIBXML2_DEFINITIONS}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nl_sample_sound_sources ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc nelsound nelsnd_lowlevel) +TARGET_LINK_LIBRARIES(nl_sample_sound_sources ${PLATFORM_LINKFLAGS} nelmisc nelsound) NL_DEFAULT_PROPS(nl_sample_sound_sources "NeL, Samples: Sound System") NL_ADD_RUNTIME_FLAGS(nl_sample_sound_sources) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - INSTALL(TARGETS nl_sample_sound_sources RUNTIME DESTINATION bin COMPONENT samplessound) -INSTALL(DIRECTORY data/ +INSTALL(DIRECTORY data/ DESTINATION share/nel/nl_sample_sound/data COMPONENT samplespacs PATTERN "CVS" EXCLUDE diff --git a/code/nel/samples/sound_sources/main.cpp b/code/nel/samples/sound_sources/main.cpp index 27f6b8b64..50d28de6a 100644 --- a/code/nel/samples/sound_sources/main.cpp +++ b/code/nel/samples/sound_sources/main.cpp @@ -62,7 +62,7 @@ void Init() AudioMixer->setSamplePath("data/samplebank"); // Packed sheet option, this mean we want packed sheet generated in 'data' folder AudioMixer->setPackedSheetOption("data", true); - + printf("Select NLSOUND Driver:\n"); printf(" [1] FMod\n"); printf(" [2] OpenAl\n"); @@ -71,7 +71,7 @@ void Init() printf("> "); int selection = getchar(); printf("\n"); - + // init with 32 tracks, EAX enabled, no ADPCM, and activate automatic sample bank loading AudioMixer->init(32, true, false, NULL, true, (UAudioMixer::TDriver)(selection - '0')/*UAudioMixer::DriverFMod*/); @@ -143,7 +143,7 @@ void OnMove( const CVector& listenerpos ) * Note: The NeL vector coordinate system is described as follows: * \verbatim * (top) - * z + * z * | y (front) * | / * -----x (right) @@ -151,7 +151,7 @@ void OnMove( const CVector& listenerpos ) */ int main() { - new CApplicationContext(); // crash at end if on stack ... + CApplicationContext *appContext = new CApplicationContext(); // crash at end if on stack ... // Initialization Init(); @@ -208,4 +208,8 @@ int main() delete src1; delete src2; delete AudioMixer; + + delete appContext; + + return 0; } diff --git a/code/nel/src/3d/CMakeLists.txt b/code/nel/src/3d/CMakeLists.txt index 4045006bd..766dd94f2 100644 --- a/code/nel/src/3d/CMakeLists.txt +++ b/code/nel/src/3d/CMakeLists.txt @@ -664,10 +664,13 @@ SOURCE_GROUP(Shadows FILES NL_TARGET_LIB(nel3d ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${FREETYPE_INCLUDE_DIRS} ${JPEG_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nel3d nelmisc ${FREETYPE_LIBRARY} ${JPEG_LIBRARY}) -NL_DEFAULT_PROPS(nel3d "NeL, Library: 3D") +INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${FREETYPE_INCLUDE_DIRS}) + +TARGET_LINK_LIBRARIES(nel3d nelmisc ${FREETYPE_LIBRARY}) +SET_TARGET_PROPERTIES(nel3d PROPERTIES LINK_INTERFACE_LIBRARIES "") +NL_DEFAULT_PROPS(nel3d "NeL, Library: NeL 3D") NL_ADD_STATIC_VID_DRIVERS(nel3d) + NL_ADD_LIB_SUFFIX(nel3d) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) diff --git a/code/nel/src/3d/driver/direct3d/CMakeLists.txt b/code/nel/src/3d/driver/direct3d/CMakeLists.txt index 755a87d6c..1ee6ad3f8 100644 --- a/code/nel/src/3d/driver/direct3d/CMakeLists.txt +++ b/code/nel/src/3d/driver/direct3d/CMakeLists.txt @@ -2,9 +2,9 @@ FILE(GLOB SRC *.cpp *.h *.def) NL_TARGET_DRIVER(nel_drv_direct3d_win ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${FREETYPE_INC} ${DXSDK_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nel_drv_direct3d_win nel3d ${LIBXML2_LIBRARIES} ${FREETYPE_LIB} ${DXSDK_D3DX9_LIBRARY} ${DXSDK_D3D9_LIBRARY} ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY}) +TARGET_LINK_LIBRARIES(nel_drv_direct3d_win nel3d ${DXSDK_D3DX9_LIBRARY} ${DXSDK_D3D9_LIBRARY} ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY}) NL_DEFAULT_PROPS(nel_drv_direct3d_win "NeL, Driver, Video: Direct3D") NL_ADD_RUNTIME_FLAGS(nel_drv_direct3d_win) @@ -12,13 +12,11 @@ NL_ADD_LIB_SUFFIX(nel_drv_direct3d_win) ADD_DEFINITIONS(/Ddriver_direct3d_EXPORTS) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nel_drv_direct3d_win ${CMAKE_CURRENT_SOURCE_DIR}/stddirect3d.h ${CMAKE_CURRENT_SOURCE_DIR}/stddirect3d.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS nel_drv_direct3d_win LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin COMPONENT drivers3d) +INSTALL(TARGETS nel_drv_direct3d_win LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib RUNTIME DESTINATION bin COMPONENT drivers3d) IF(WITH_MAXPLUGIN) INSTALL(TARGETS nel_drv_direct3d_win RUNTIME DESTINATION maxplugin COMPONENT drivers3d) ENDIF(WITH_MAXPLUGIN) diff --git a/code/nel/src/3d/driver/opengl/CMakeLists.txt b/code/nel/src/3d/driver/opengl/CMakeLists.txt index 2c2249b1b..10fec6111 100644 --- a/code/nel/src/3d/driver/opengl/CMakeLists.txt +++ b/code/nel/src/3d/driver/opengl/CMakeLists.txt @@ -12,8 +12,9 @@ ENDIF(WIN32) NL_TARGET_DRIVER(${NLDRV_OGL_LIB} ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} nel3d nelmisc ${OPENGL_LIBRARIES}) +INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) + +TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} nel3d nelmisc ${OPENGL_gl_LIBRARY}) NL_DEFAULT_PROPS(${NLDRV_OGL_LIB} "NeL, Driver, Video: OpenGL") NL_ADD_LIB_SUFFIX(${NLDRV_OGL_LIB}) NL_ADD_RUNTIME_FLAGS(${NLDRV_OGL_LIB}) @@ -27,7 +28,7 @@ ELSE(WIN32) TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${CARBON}) TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${COCOA}) ELSE(APPLE) - TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${X11_LIBRARIES}) + TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${X11_LIB}) IF(XF86VidMode_FOUND) INCLUDE_DIRECTORIES(${XF86VidMode_INCLUDE_DIR}) ADD_DEFINITIONS(${XF86VidMode_DEFINITIONS}) @@ -41,13 +42,11 @@ ELSE(WIN32) ENDIF(APPLE) ENDIF(WIN32) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - IF(NOT APPLE AND WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(${NLDRV_OGL_LIB} ${CMAKE_CURRENT_SOURCE_DIR}/stdopengl.h ${CMAKE_CURRENT_SOURCE_DIR}/stdopengl.cpp) ENDIF(NOT APPLE AND WITH_PCH) -INSTALL(TARGETS ${NLDRV_OGL_LIB} LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin COMPONENT drivers3d) +INSTALL(TARGETS ${NLDRV_OGL_LIB} LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib RUNTIME DESTINATION bin COMPONENT drivers3d) IF(WITH_MAXPLUGIN) INSTALL(TARGETS ${NLDRV_OGL_LIB} RUNTIME DESTINATION maxplugin COMPONENT drivers3d) ENDIF(WITH_MAXPLUGIN) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp index cdd4bdd20..2aed89013 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp @@ -56,9 +56,13 @@ namespace NL3D bool GlWndProc(CDriverGL *driver, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { H_AUTO_OGL(GlWndProc) + + if (!driver) + return false; + if(message == WM_SIZE) { - if (driver != NULL) + if (!driver->_FullScreen) { RECT rect; GetClientRect (driver->_win, &rect); @@ -70,7 +74,7 @@ bool GlWndProc(CDriverGL *driver, HWND hWnd, UINT message, WPARAM wParam, LPARAM } else if(message == WM_MOVE) { - if (driver != NULL) + if (!driver->_FullScreen) { RECT rect; GetWindowRect (hWnd, &rect); @@ -113,14 +117,37 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l trapMessage = GlWndProc (pDriver, hWnd, message, wParam, lParam); } + // we don't want Windows to erase background + if (message == WM_ERASEBKGND) + { + return TRUE; + } + + if (message == WM_SYSCOMMAND) + { + switch (wParam) + { #ifdef NL_DISABLE_MENU - // disable menu (F10, ALT and ALT+SPACE key doesn't freeze or open the menu) - if(message == WM_SYSCOMMAND && wParam == SC_KEYMENU) - return 0; + // disable menu (F10, ALT and ALT+SPACE key doesn't freeze or open the menu) + case SC_KEYMENU: #endif // NL_DISABLE_MENU + // Screensaver Trying To Start? + case SC_SCREENSAVE: + + // Monitor Trying To Enter Powersave? + case SC_MONITORPOWER: + + // Prevent From Happening + return 0; + + default: + break; + } + } + // disable menu (default ALT-F4 behavior is disabled) - if(message == WM_CLOSE) + if (message == WM_CLOSE) { if(pDriver && pDriver->ExitFunc) { @@ -219,21 +246,6 @@ bool GlWndProc(CDriverGL *driver, XEvent &e) } return true; - -/* - else if (message == WM_ACTIVATE) - { - WORD fActive = LOWORD(wParam); - if (fActive == WA_INACTIVE) - { - driver->_WndActive = false; - } - else - { - driver->_WndActive = true; - } - } -*/ } #endif // NL_OS_UNIX @@ -1442,6 +1454,9 @@ bool CDriverGL::setWindowStyle(EWindowStyle windowStyle) if (_win == EmptyWindow || !_DestroyWindow) return true; + if (getWindowStyle() == windowStyle) + return true; + #if defined(NL_OS_WINDOWS) // get current style @@ -1493,24 +1508,48 @@ bool CDriverGL::setWindowStyle(EWindowStyle windowStyle) #elif defined(NL_OS_UNIX) - // Toggle fullscreen - XEvent xev; - xev.xclient.type = ClientMessage; - xev.xclient.serial = 0; - xev.xclient.send_event = True; - xev.xclient.display = _dpy; - xev.xclient.window = _win; - xev.xclient.message_type = XInternAtom(_dpy, "_NET_WM_STATE", False); - xev.xclient.format = 32; - xev.xclient.data.l[0] = windowStyle == EWSFullscreen ? _NET_WM_STATE_ADD:_NET_WM_STATE_REMOVE; - xev.xclient.data.l[1] = XInternAtom(_dpy, "_NET_WM_STATE_FULLSCREEN", False); - xev.xclient.data.l[2] = 0; - xev.xclient.data.l[3] = 1; // 1 for Application, 2 for Page or Taskbar, 0 for old source - xev.xclient.data.l[4] = 0; - if (!XSendEvent(_dpy, DefaultRootWindow(_dpy), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev)) + XWindowAttributes attr; + XGetWindowAttributes(_dpy, _win, &attr); + + // if window is mapped use events else properties + if (attr.map_state != IsUnmapped) { - nlwarning("3D: Failed to toggle to fullscreen"); - return false; + // Toggle fullscreen + XEvent xev; + xev.xclient.type = ClientMessage; + xev.xclient.serial = 0; + xev.xclient.send_event = True; + xev.xclient.display = _dpy; + xev.xclient.window = _win; + xev.xclient.message_type = XInternAtom(_dpy, "_NET_WM_STATE", False); + xev.xclient.format = 32; + xev.xclient.data.l[0] = windowStyle == EWSFullscreen ? _NET_WM_STATE_ADD:_NET_WM_STATE_REMOVE; + xev.xclient.data.l[1] = XInternAtom(_dpy, "_NET_WM_STATE_FULLSCREEN", False); + xev.xclient.data.l[2] = 0; + xev.xclient.data.l[3] = 1; // 1 for Application, 2 for Page or Taskbar, 0 for old source + xev.xclient.data.l[4] = 0; + if (!XSendEvent(_dpy, DefaultRootWindow(_dpy), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev)) + { + nlwarning("3D: Failed to toggle to fullscreen"); + return false; + } + } + else + { + Atom _NET_WM_STATE = XInternAtom(_dpy, "_NET_WM_STATE", False); + + if (windowStyle == EWSFullscreen) + { + Atom _NET_WM_STATE_FULLSCREEN = XInternAtom(_dpy, "_NET_WM_STATE_FULLSCREEN", False); + + // set state property to fullscreen + XChangeProperty(_dpy, _win, _NET_WM_STATE, XA_ATOM, 32, PropModeReplace, (const unsigned char*)&_NET_WM_STATE_FULLSCREEN, 1); + } + else + { + // delete state property + XDeleteProperty(_dpy, _win, _NET_WM_STATE); + } } // show window (hack to avoid black window bug) diff --git a/code/nel/src/3d/dru.cpp b/code/nel/src/3d/dru.cpp index 5e18f760b..290a51124 100644 --- a/code/nel/src/3d/dru.cpp +++ b/code/nel/src/3d/dru.cpp @@ -25,6 +25,9 @@ #include "nel/3d/vertex_buffer.h" #include "nel/3d/index_buffer.h" +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif // HAVE_CONFIG_H #ifdef NL_OS_WINDOWS # define NOMINMAX @@ -75,6 +78,10 @@ IDriver *CDRU::createGlDriver() throw (EDru) // hInst=LoadLibrary(NL3D_GL_DLL_NAME); CLibrary driverLib; +#if defined(NL_OS_UNIX) && defined(NL_DRIVER_PREFIX) + driverLib.addLibPath(NL_DRIVER_PREFIX); +#endif + // if (!hInst) if (!driverLib.loadLibrary(NL3D_GL_DLL_NAME, true, true, false)) { diff --git a/code/nel/src/3d/patch_lightmap.cpp b/code/nel/src/3d/patch_lightmap.cpp index b5a6c8f8d..bd3886a71 100644 --- a/code/nel/src/3d/patch_lightmap.cpp +++ b/code/nel/src/3d/patch_lightmap.cpp @@ -1671,14 +1671,19 @@ void CPatch::getCurrentTileTLIColors(uint ts, uint tt, NLMISC::CRGBA corners[4] CRGBA tbMiddle; // left. tbEdges[0].avg2RGBOnly(tbCorners[0], tbCorners[2]); + tbEdges[0].A = 255; // bottom tbEdges[1].avg2RGBOnly(tbCorners[2], tbCorners[3]); + tbEdges[1].A = 255; // right tbEdges[2].avg2RGBOnly(tbCorners[1], tbCorners[3]); + tbEdges[2].A = 255; // up tbEdges[3].avg2RGBOnly(tbCorners[0], tbCorners[1]); + tbEdges[3].A = 255; // middle. tbMiddle.avg2RGBOnly(tbEdges[0], tbEdges[2]); + tbMiddle.A = 255; // just copy result according to tile pos in tessBlock. if(tlt==0) diff --git a/code/nel/src/3d/patchuv_locator.cpp b/code/nel/src/3d/patchuv_locator.cpp index 8608fd137..b42716e80 100644 --- a/code/nel/src/3d/patchuv_locator.cpp +++ b/code/nel/src/3d/patchuv_locator.cpp @@ -106,8 +106,8 @@ void CPatchUVLocator::build(const CPatch *patchCenter, sint edgeCenter, CPatch:: // Find the position. //============================= // Find the uv coord at start of the edge, for 2 patchs. - CVector2f uvCenter; - CVector2f uvNeighbor; + CVector2f uvCenter(0.f, 0.f); + CVector2f uvNeighbor(0.f, 0.f); float decal; // find the uv at start of edgeCenter, + decal due to bind 1/X. diff --git a/code/nel/src/3d/vegetable_manager.cpp b/code/nel/src/3d/vegetable_manager.cpp index 656f99dfe..bb472e75a 100644 --- a/code/nel/src/3d/vegetable_manager.cpp +++ b/code/nel/src/3d/vegetable_manager.cpp @@ -1121,6 +1121,8 @@ void CVegetableManager::addInstance(CVegetableInstanceGroup *ig, CVegetableLightEx &vegetLex= ig->VegetableLightEx; // Color of pointLights modulated by diffuse. CRGBA diffusePL[2]; + diffusePL[0] = CRGBA::Black; + diffusePL[1] = CRGBA::Black; if(vegetLex.NumLights>=1) { diffusePL[0].modulateFromColorRGBOnly(diffuseRGBA, vegetLex.Color[0]); @@ -2491,6 +2493,8 @@ uint CVegetableManager::updateInstanceLighting(CVegetableInstanceGroup *ig, uin CVegetableLightEx &vegetLex= ig->VegetableLightEx; // Color of pointLights modulated by diffuse. CRGBA diffusePL[2]; + diffusePL[0] = CRGBA::Black; + diffusePL[1] = CRGBA::Black; if(vegetLex.NumLights>=1) { diffusePL[0].modulateFromColorRGBOnly(vegetLI.MatDiffuse, vegetLex.Color[0]); diff --git a/code/nel/src/3d/zone_lighter.cpp b/code/nel/src/3d/zone_lighter.cpp index 57cba49a8..5a8757605 100644 --- a/code/nel/src/3d/zone_lighter.cpp +++ b/code/nel/src/3d/zone_lighter.cpp @@ -1732,8 +1732,8 @@ void CZoneLighter::addTriangles (const CMeshBase &meshBase, const CMeshGeom &mes CVector v2=modelMT*(*vba.getVertexCoordPointer (triIndex[tri*3+2])); // UV - float u[3]; - float v[3]; + float u[3] = { 0.f }; + float v[3] = { 0.f }; for (uint i=0; i<3; i++) { // Get UV coordinates @@ -1764,8 +1764,8 @@ void CZoneLighter::addTriangles (const CMeshBase &meshBase, const CMeshGeom &mes CVector v2=modelMT*(*vba.getVertexCoordPointer (triIndex[tri*3+2])); // UV - float u[3]; - float v[3]; + float u[3] = { 0.f }; + float v[3] = { 0.f }; for (uint i=0; i<3; i++) { // Get UV coordinates @@ -1898,8 +1898,8 @@ void CZoneLighter::addTriangles (const CMeshBase &meshBase, const CMeshMRMGeom & CVector v2=modelMT*(*vba.getVertexCoordPointer (triIndex[tri*3+2])); // UV - float u[3]; - float v[3]; + float u[3] = { 0.f }; + float v[3] = { 0.f }; for (uint i=0; i<3; i++) { // Get UV coordinates diff --git a/code/nel/src/georges/CMakeLists.txt b/code/nel/src/georges/CMakeLists.txt index d7c669efe..491d0dfaf 100644 --- a/code/nel/src/georges/CMakeLists.txt +++ b/code/nel/src/georges/CMakeLists.txt @@ -7,8 +7,10 @@ SOURCE_GROUP(headers FILES ${PRIV_H} ${PUB_H}) NL_TARGET_LIB(nelgeorges ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nelgeorges nelmisc) -NL_DEFAULT_PROPS(nelgeorges "NeL, Library: Georges") + +TARGET_LINK_LIBRARIES(nelgeorges ${LIBXML2_LIBRARIES} nelmisc) +SET_TARGET_PROPERTIES(nelgeorges PROPERTIES LINK_INTERFACE_LIBRARIES "") +NL_DEFAULT_PROPS(nelgeorges "NeL, Library: NeL Georges") NL_ADD_LIB_SUFFIX(nelgeorges) diff --git a/code/nel/src/ligo/CMakeLists.txt b/code/nel/src/ligo/CMakeLists.txt index d92b773c6..18545a622 100644 --- a/code/nel/src/ligo/CMakeLists.txt +++ b/code/nel/src/ligo/CMakeLists.txt @@ -3,12 +3,18 @@ FILE(GLOB SRC *.cpp *.h) NL_TARGET_LIB(nelligo ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) + TARGET_LINK_LIBRARIES(nelligo ${LIBXML2_LIBRARIES} nelmisc) -NL_DEFAULT_PROPS(nelligo "NeL, Library: Ligo") +SET_TARGET_PROPERTIES(nelligo PROPERTIES LINK_INTERFACE_LIBRARIES "") +NL_DEFAULT_PROPS(nelligo "NeL, Library: NeL Ligo") NL_ADD_LIB_SUFFIX(nelligo) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +IF(WITH_PCH) + ADD_NATIVE_PRECOMPILED_HEADER(nelligo ${CMAKE_CURRENT_SOURCE_DIR}/stdligo.h ${CMAKE_CURRENT_SOURCE_DIR}/stdligo.cpp) +ENDIF(WITH_PCH) + NL_GEN_PC(nel-ligo.pc) INSTALL(TARGETS nelligo LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) diff --git a/code/nel/src/ligo/ligo_config.cpp b/code/nel/src/ligo/ligo_config.cpp index e68197572..8d4b730f0 100644 --- a/code/nel/src/ligo/ligo_config.cpp +++ b/code/nel/src/ligo/ligo_config.cpp @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include "stdligo.h" #include "nel/ligo/ligo_config.h" #include "nel/ligo/primitive.h" diff --git a/code/nel/src/ligo/ligo_error.cpp b/code/nel/src/ligo/ligo_error.cpp index bebaaddfe..1330a60a7 100644 --- a/code/nel/src/ligo/ligo_error.cpp +++ b/code/nel/src/ligo/ligo_error.cpp @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include "stdligo.h" #include "ligo_error.h" namespace NLLIGO diff --git a/code/nel/src/ligo/ligo_material.cpp b/code/nel/src/ligo/ligo_material.cpp index 3b125c1d9..121a30127 100644 --- a/code/nel/src/ligo/ligo_material.cpp +++ b/code/nel/src/ligo/ligo_material.cpp @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include "stdligo.h" #include "ligo_material.h" // Ligo include diff --git a/code/nel/src/ligo/primitive.cpp b/code/nel/src/ligo/primitive.cpp index 3b33aa51d..4c1b3f9dd 100644 --- a/code/nel/src/ligo/primitive.cpp +++ b/code/nel/src/ligo/primitive.cpp @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include "stdligo.h" #include "nel/misc/types_nl.h" #include "nel/misc/hierarchical_timer.h" #include "nel/ligo/primitive.h" diff --git a/code/nel/src/ligo/primitive_class.cpp b/code/nel/src/ligo/primitive_class.cpp index a9b208162..528653786 100644 --- a/code/nel/src/ligo/primitive_class.cpp +++ b/code/nel/src/ligo/primitive_class.cpp @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include "stdligo.h" #include "nel/ligo/primitive_class.h" #include "nel/ligo/primitive.h" #include "nel/ligo/ligo_config.h" diff --git a/code/nel/src/ligo/primitive_configuration.cpp b/code/nel/src/ligo/primitive_configuration.cpp index b03eeb0dc..00de1dc7b 100644 --- a/code/nel/src/ligo/primitive_configuration.cpp +++ b/code/nel/src/ligo/primitive_configuration.cpp @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include "stdligo.h" #include "nel/ligo/primitive_configuration.h" #include "nel/ligo/ligo_config.h" #include "nel/ligo/primitive.h" diff --git a/code/nel/src/ligo/primitive_utils.cpp b/code/nel/src/ligo/primitive_utils.cpp index 2172980dd..2e5e5edd8 100644 --- a/code/nel/src/ligo/primitive_utils.cpp +++ b/code/nel/src/ligo/primitive_utils.cpp @@ -1,5 +1,17 @@ +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . - +#include "stdligo.h" #include "nel/ligo/primitive_utils.h" diff --git a/code/nel/src/ligo/stdligo.cpp b/code/nel/src/ligo/stdligo.cpp new file mode 100644 index 000000000..c0f179857 --- /dev/null +++ b/code/nel/src/ligo/stdligo.cpp @@ -0,0 +1,24 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "stdligo.h" + + +// leave not static else this workaround don't work +void dummyToAvoidStupidCompilerWarning_std_ligo_cpp() +{ +} + diff --git a/code/nel/src/ligo/stdligo.h b/code/nel/src/ligo/stdligo.h new file mode 100644 index 000000000..01e82a4a3 --- /dev/null +++ b/code/nel/src/ligo/stdligo.h @@ -0,0 +1,63 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "nel/misc/types_nl.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Include from libxml2 +#include + +#include "nel/misc/debug.h" +#include "nel/misc/common.h" +#include "nel/misc/fast_mem.h" +#include "nel/misc/system_info.h" +#include "nel/misc/mem_displayer.h" +#include "nel/misc/matrix.h" +#include "nel/misc/stream.h" +#include "nel/misc/path.h" +#include "nel/misc/string_common.h" +#include "nel/misc/config_file.h" +#include "nel/misc/i_xml.h" +#include "nel/misc/o_xml.h" +#include "nel/misc/hierarchical_timer.h" +#include "nel/misc/vector.h" +#include "nel/misc/rgba.h" +#include "nel/misc/file.h" diff --git a/code/nel/src/ligo/transition.cpp b/code/nel/src/ligo/transition.cpp index 5158f5b87..571bed290 100644 --- a/code/nel/src/ligo/transition.cpp +++ b/code/nel/src/ligo/transition.cpp @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include "stdligo.h" #include "transition.h" // Ligo include diff --git a/code/nel/src/ligo/zone_bank.cpp b/code/nel/src/ligo/zone_bank.cpp index 240ec23a1..38b2ca5d6 100644 --- a/code/nel/src/ligo/zone_bank.cpp +++ b/code/nel/src/ligo/zone_bank.cpp @@ -15,6 +15,7 @@ // along with this program. If not, see . +#include "stdligo.h" #include "zone_bank.h" diff --git a/code/nel/src/ligo/zone_edge.cpp b/code/nel/src/ligo/zone_edge.cpp index 235ba0880..b635da499 100644 --- a/code/nel/src/ligo/zone_edge.cpp +++ b/code/nel/src/ligo/zone_edge.cpp @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include "stdligo.h" // Ligo include #include "zone_edge.h" #include "nel/ligo/ligo_config.h" diff --git a/code/nel/src/ligo/zone_region.cpp b/code/nel/src/ligo/zone_region.cpp index ff19aa536..222940100 100644 --- a/code/nel/src/ligo/zone_region.cpp +++ b/code/nel/src/ligo/zone_region.cpp @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include "stdligo.h" #include "zone_region.h" using namespace NLMISC; diff --git a/code/nel/src/ligo/zone_template.cpp b/code/nel/src/ligo/zone_template.cpp index a42ae50aa..2680ee9e9 100644 --- a/code/nel/src/ligo/zone_template.cpp +++ b/code/nel/src/ligo/zone_template.cpp @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include "stdligo.h" #include "zone_template.h" #include "ligo_error.h" #include "nel/ligo/ligo_config.h" diff --git a/code/nel/src/logic/CMakeLists.txt b/code/nel/src/logic/CMakeLists.txt index 681c1d641..bbe65727b 100644 --- a/code/nel/src/logic/CMakeLists.txt +++ b/code/nel/src/logic/CMakeLists.txt @@ -3,8 +3,10 @@ FILE(GLOB SRC *.cpp *.h) NL_TARGET_LIB(nellogic ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) + TARGET_LINK_LIBRARIES(nellogic ${LIBXML2_LIBRARIES} nelmisc nelnet) -NL_DEFAULT_PROPS(nellogic "NeL, Library: Logic") +SET_TARGET_PROPERTIES(nellogic PROPERTIES LINK_INTERFACE_LIBRARIES "") +NL_DEFAULT_PROPS(nellogic "NeL, Library: NeL Logic") NL_ADD_LIB_SUFFIX(nellogic) diff --git a/code/nel/src/misc/CMakeLists.txt b/code/nel/src/misc/CMakeLists.txt index c33d0621c..341c6ef8f 100644 --- a/code/nel/src/misc/CMakeLists.txt +++ b/code/nel/src/misc/CMakeLists.txt @@ -22,8 +22,10 @@ IF(WIN32) ENDIF(WIN32) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${PNG_INCLUDE_DIR} config_file) + TARGET_LINK_LIBRARIES(nelmisc ${LIBXML2_LIBRARIES} ${PNG_LIBRARIES} ${WINSOCK2_LIB}) -NL_DEFAULT_PROPS(nelmisc "NeL, Library: Misc") +SET_TARGET_PROPERTIES(nelmisc PROPERTIES LINK_INTERFACE_LIBRARIES "") +NL_DEFAULT_PROPS(nelmisc "NeL, Library: NeL Misc") NL_ADD_LIB_SUFFIX(nelmisc) diff --git a/code/nel/src/misc/dynloadlib.cpp b/code/nel/src/misc/dynloadlib.cpp index b047b1317..4393bb335 100644 --- a/code/nel/src/misc/dynloadlib.cpp +++ b/code/nel/src/misc/dynloadlib.cpp @@ -67,9 +67,6 @@ void *nlGetSymbolAddress(NL_LIB_HANDLE libHandle, const std::string &procName) #ifdef NL_OS_WINDOWS const string nlLibPrefix; // empty const string nlLibExt(".dll"); -#elif defined(NL_OS_MAC) - const string nlLibPrefix("lib"); - const string nlLibExt(".dylib"); #elif defined(NL_OS_UNIX) const string nlLibPrefix("lib"); const string nlLibExt(".so"); diff --git a/code/nel/src/misc/win_event_emitter.cpp b/code/nel/src/misc/win_event_emitter.cpp index 57924c06c..fc01a8b62 100644 --- a/code/nel/src/misc/win_event_emitter.cpp +++ b/code/nel/src/misc/win_event_emitter.cpp @@ -305,6 +305,8 @@ bool CWinEventEmitter::processMessage (HWND hWnd, uint32 msg, WPARAM wParam, LPA case WM_INPUTLANGCHANGE: if ( _IMEEventsEnabled ) { + // wParam = Specifies the character set of the new locale. + // lParam = Input locale identifier. server->postEvent( new CEventIME( msg, (uint32)wParam, (uint32)lParam, this ) ); return true; // trap message } diff --git a/code/nel/src/net/CMakeLists.txt b/code/nel/src/net/CMakeLists.txt index 5710d6d01..04cb09513 100644 --- a/code/nel/src/net/CMakeLists.txt +++ b/code/nel/src/net/CMakeLists.txt @@ -11,15 +11,12 @@ IF(WITH_GTK) ENDIF(GTK2_FOUND) ENDIF(WITH_GTK) - -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nelnet ${LIBXML2_LIBRARIES} nelmisc) +TARGET_LINK_LIBRARIES(nelnet nelmisc) +SET_TARGET_PROPERTIES(nelnet PROPERTIES LINK_INTERFACE_LIBRARIES "") NL_DEFAULT_PROPS(nelnet "NeL, Library: Net") NL_ADD_LIB_SUFFIX(nelnet) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nelnet ${CMAKE_CURRENT_SOURCE_DIR}/stdnet.h ${CMAKE_CURRENT_SOURCE_DIR}/stdnet.cpp) ENDIF(WITH_PCH) diff --git a/code/nel/src/net/inet_address.cpp b/code/nel/src/net/inet_address.cpp index ea0f69656..41684079e 100644 --- a/code/nel/src/net/inet_address.cpp +++ b/code/nel/src/net/inet_address.cpp @@ -27,6 +27,8 @@ #ifdef NL_OS_WINDOWS # include # include +// for Windows 2000 compatibility +# include #elif defined NL_OS_UNIX # include # include @@ -40,6 +42,9 @@ using namespace std; using namespace NLMISC; +#ifndef NI_MAXHOST +# define NI_MAXHOST 1025 +#endif namespace NLNET { @@ -74,20 +79,32 @@ CInetAddress::CInetAddress( const in_addr *ip, const char *hostname ) } else { - hostent *phostent = gethostbyaddr( (char*)&ip->s_addr, 4, AF_INET ); - if ( phostent == NULL ) - { - _HostName = ipAddress(); - } - else - { - _HostName = string( phostent->h_name ); - } + updateHostName(); } _Valid = true; } +/* + * Update _HostName from _SockAddr current value + */ +void CInetAddress::updateHostName() +{ + char host[NI_MAXHOST]; + + sint status = getnameinfo((struct sockaddr *) _SockAddr, sizeof (struct sockaddr), host, NI_MAXHOST, NULL, 0, NI_NUMERICSERV); + + if ( status ) + { + _HostName = ipAddress(); + } + else + { + _HostName = string( host ); + } +} + + /* * Alternate constructor (calls setByName()) */ @@ -148,16 +165,6 @@ bool operator==( const CInetAddress& a1, const CInetAddress& a2 ) */ bool operator<( const CInetAddress& a1, const CInetAddress& a2 ) { -#ifdef NL_OS_WINDOWS - if ( a1._SockAddr->sin_addr.S_un.S_addr == a2._SockAddr->sin_addr.S_un.S_addr ) - { - return ( a1.port() < a2.port() ); - } - else - { - return ( a1._SockAddr->sin_addr.S_un.S_addr < a2._SockAddr->sin_addr.S_un.S_addr ); - } -#elif defined NL_OS_UNIX if ( a1._SockAddr->sin_addr.s_addr == a2._SockAddr->sin_addr.s_addr ) { return ( a1.port() < a2.port() ); @@ -166,7 +173,6 @@ bool operator<( const CInetAddress& a1, const CInetAddress& a2 ) { return ( a1._SockAddr->sin_addr.s_addr < a2._SockAddr->sin_addr.s_addr ); } -#endif } @@ -223,26 +229,59 @@ CInetAddress& CInetAddress::setByName( const std::string& hostName ) { // Try to convert directly for addresses such as a.b.c.d in_addr iaddr; -#ifdef NL_OS_WINDOWS - iaddr.S_un.S_addr = inet_addr( hostName.c_str() ); - if ( iaddr.S_un.S_addr == INADDR_NONE ) -#elif defined NL_OS_UNIX iaddr.s_addr = inet_addr( hostName.c_str() ); if ( iaddr.s_addr == INADDR_NONE ) -#endif { - // Otherwise use the traditional DNS look-up - hostent *phostent = gethostbyname( hostName.c_str() ); - if ( phostent == NULL ) + struct addrinfo hints; + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_UNSPEC; // AF_INET or AF_INET6 to force version + hints.ai_socktype = SOCK_STREAM; + + struct addrinfo *res = NULL; + sint status = getaddrinfo(hostName.c_str(), NULL, &hints, &res); + + if (status) { _Valid = false; - LNETL0_DEBUG( "LNETL0: Network error: resolution of hostname '%s' failed", hostName.c_str() ); + LNETL0_DEBUG( "LNETL0: Network error: resolution of hostname '%s' failed: %s", hostName.c_str(), gai_strerror(status) ); // return *this; throw ESocket( (string("Hostname resolution failed for ")+hostName).c_str() ); } - _HostName = string( phostent->h_name ); - memcpy( &_SockAddr->sin_addr, phostent->h_addr, sizeof(in_addr) ); + + struct addrinfo *p = res; + + // process all addresses + while (p != NULL) + { + // check address family + if (p->ai_family == AF_INET) + { + // ipv4 + struct sockaddr_in *ipv4 = (struct sockaddr_in *)p->ai_addr; + + // convert the IP to a string + _HostName = string(inet_ntoa(ipv4->sin_addr)); + memcpy( &_SockAddr->sin_addr, &ipv4->sin_addr, sizeof(in_addr) ); + } + else if (p->ai_family == AF_INET6) + { + // ipv6 + // TODO: modify class to be able to handle IPv6 + + // struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)p->ai_addr; + + // convert the IP to a string + // inet_ntop(p->ai_family, addr, ipstr, sizeof(ipstr)); + // memcpy( &_SockAddr->sin_addr, &ipv6->sin_addr, sizeof(in_addr) ); + } + + // process next address + p = p->ai_next; + } + + // free the linked list + freeaddrinfo(res); } else { @@ -275,15 +314,7 @@ void CInetAddress::setSockAddr( const sockaddr_in* saddr ) // Warning: when it can't find it, it take more than 4 seconds if ( CInetAddress::RetrieveNames ) { - hostent *phostent = gethostbyaddr( (char*)&saddr->sin_addr.s_addr, 4, AF_INET ); - if ( phostent == NULL ) - { - _HostName = ipAddress(); - } - else - { - _HostName = string( phostent->h_name ); - } + updateHostName(); } _Valid = true; } @@ -476,20 +507,52 @@ std::vector CInetAddress::localAddresses() // 2. Get address list vector vect; - uint i = 0; - for(;;) + struct addrinfo hints; + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_UNSPEC; // AF_INET or AF_INET6 to force version + hints.ai_socktype = SOCK_STREAM; + + struct addrinfo *res = NULL; + sint status = getaddrinfo(localhost, NULL, &hints, &res); + + if (status) { - hostent *phostent = gethostbyname( localhost ); - if ( phostent == NULL ) // will come here if the local hostname (/etc/hostname in Linux) is not the real name - throw ESocket( (string("Hostname resolution failed for ")+string(localhost)).c_str() ); - - if (phostent->h_addr_list[i] == 0) - break; - - vect.push_back( CInetAddress( (const in_addr*)(phostent->h_addr_list[i]), localhost ) ); - i++; + // will come here if the local hostname (/etc/hostname in Linux) is not the real name + throw ESocket( (string("Hostname resolution failed for ")+string(localhost)).c_str() ); } + struct addrinfo *p = res; + + // process all addresses + while (p != NULL) + { + // check address family + if (p->ai_family == AF_INET) + { + // ipv4 + struct sockaddr_in *ipv4 = (struct sockaddr_in *)p->ai_addr; + + vect.push_back( CInetAddress( &ipv4->sin_addr, localhost ) ); + } + else if (p->ai_family == AF_INET6) + { + // ipv6 + // TODO: modify class to be able to handle IPv6 + + // struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)p->ai_addr; + + // convert the IP to a string + // inet_ntop(p->ai_family, addr, ipstr, sizeof(ipstr)); + // memcpy( &_SockAddr->sin_addr, &ipv6->sin_addr, sizeof(in_addr) ); + } + + // process next address + p = p->ai_next; + } + + // free the linked list + freeaddrinfo(res); + if(vect.empty()) { throw ESocket( (string("No network card detected for ")+string(localhost)).c_str() ); diff --git a/code/nel/src/pacs/CMakeLists.txt b/code/nel/src/pacs/CMakeLists.txt index 928cfbcf7..3fc35de1b 100644 --- a/code/nel/src/pacs/CMakeLists.txt +++ b/code/nel/src/pacs/CMakeLists.txt @@ -3,12 +3,15 @@ FILE(GLOB SRC *.cpp *.h) NL_TARGET_LIB(nelpacs ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nelpacs ${LIBXML2_LIBRARIES} nelmisc) -NL_DEFAULT_PROPS(nelpacs "NeL, Library: PACS") -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) + +TARGET_LINK_LIBRARIES(nelpacs nelmisc) +SET_TARGET_PROPERTIES(nelpacs PROPERTIES LINK_INTERFACE_LIBRARIES "") +NL_DEFAULT_PROPS(nelpacs "NeL, Library: NeL PACS") NL_ADD_LIB_SUFFIX(nelpacs) +ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) + IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nelpacs ${CMAKE_CURRENT_SOURCE_DIR}/stdpacs.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpacs.cpp) ENDIF(WITH_PCH) diff --git a/code/nel/src/sound/CMakeLists.txt b/code/nel/src/sound/CMakeLists.txt index fb2080f34..61187125b 100644 --- a/code/nel/src/sound/CMakeLists.txt +++ b/code/nel/src/sound/CMakeLists.txt @@ -3,13 +3,15 @@ FILE(GLOB SRC *.cpp *.h) NL_TARGET_LIB(nelsound ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nelsound ${LIBXML2_LIBRARIES} nelmisc nelligo nelgeorges nel3d nelsnd_lowlevel) -NL_DEFAULT_PROPS(nelsound "NeL, Library: Sound") -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +TARGET_LINK_LIBRARIES(nelsound ${LIBXML2_LIBRARIES} nelmisc nelligo nelgeorges nel3d nelsnd_lowlevel) +SET_TARGET_PROPERTIES(nelsound PROPERTIES LINK_INTERFACE_LIBRARIES "") +NL_DEFAULT_PROPS(nelsound "NeL, Library: NeL Sound") NL_ADD_LIB_SUFFIX(nelsound) +ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) + IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nelsound ${CMAKE_CURRENT_SOURCE_DIR}/stdsound.h ${CMAKE_CURRENT_SOURCE_DIR}/stdsound.cpp) ENDIF(WITH_PCH) diff --git a/code/nel/src/sound/clustered_sound.cpp b/code/nel/src/sound/clustered_sound.cpp index 71b1dec50..3a75ee4f4 100644 --- a/code/nel/src/sound/clustered_sound.cpp +++ b/code/nel/src/sound/clustered_sound.cpp @@ -493,6 +493,9 @@ void CClusteredSound::soundTraverse(const std::vector &clusters, CSo CSoundTravContext &travContext = curClusters.back().second; CClusterSoundStatus css; + css.DistFactor = 0.0f; + css.Position = CVector::Null; + css.PosAlpha = 0.0f; css.Gain = travContext.Gain; css.Dist = travContext.Dist; css.Direction = travContext.Direction; diff --git a/code/nel/src/sound/driver/CMakeLists.txt b/code/nel/src/sound/driver/CMakeLists.txt index 102abb7bd..b30ee76dd 100644 --- a/code/nel/src/sound/driver/CMakeLists.txt +++ b/code/nel/src/sound/driver/CMakeLists.txt @@ -1,12 +1,15 @@ FILE(GLOB SRC *.cpp *.h) -nl_target_lib(nelsnd_lowlevel ${SRC}) +NL_TARGET_LIB(nelsnd_lowlevel ${SRC}) INCLUDE_DIRECTORIES(${OGG_INCLUDE_DIR} ${VORBIS_INCLUDE_DIR}) + TARGET_LINK_LIBRARIES(nelsnd_lowlevel nelmisc ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY} ${OGG_LIBRARY}) -nl_default_props(nelsnd_lowlevel "NeL, Library: Sound Lowlevel") +SET_TARGET_PROPERTIES(nelsnd_lowlevel PROPERTIES LINK_INTERFACE_LIBRARIES "") +NL_DEFAULT_PROPS(nelsnd_lowlevel "NeL, Library: Sound Lowlevel") NL_ADD_STATIC_VID_DRIVERS(nelsnd_lowlevel) -nl_add_lib_suffix(nelsnd_lowlevel) + +NL_ADD_LIB_SUFFIX(nelsnd_lowlevel) IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nelsnd_lowlevel ${CMAKE_CURRENT_SOURCE_DIR}/stdsound_lowlevel.h ${CMAKE_CURRENT_SOURCE_DIR}/stdsound_lowlevel.cpp) diff --git a/code/nel/src/sound/driver/dsound/CMakeLists.txt b/code/nel/src/sound/driver/dsound/CMakeLists.txt index be30efd6c..e64e0c1d7 100644 --- a/code/nel/src/sound/driver/dsound/CMakeLists.txt +++ b/code/nel/src/sound/driver/dsound/CMakeLists.txt @@ -2,20 +2,18 @@ FILE(GLOB SRC *.cpp *.h) NL_TARGET_DRIVER(nel_drv_dsound ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${DXSDK_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nel_drv_dsound ${LIBXML2_LIBRARIES} nelsnd_lowlevel ${DXSDK_DSOUND_LIBRARY} ${DXSDK_GUID_LIBRARY}) +INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) +TARGET_LINK_LIBRARIES(nel_drv_dsound nelmisc nelsnd_lowlevel ${DXSDK_DSOUND_LIBRARY} ${DXSDK_GUID_LIBRARY}) NL_DEFAULT_PROPS(nel_drv_dsound "NeL, Driver, Sound: DirectSound") NL_ADD_LIB_SUFFIX(nel_drv_dsound) NL_ADD_RUNTIME_FLAGS(nel_drv_dsound) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nel_drv_dsound ${CMAKE_CURRENT_SOURCE_DIR}/stddsound.h ${CMAKE_CURRENT_SOURCE_DIR}/stddsound.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS nel_drv_dsound RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT driverssound) +INSTALL(TARGETS nel_drv_dsound RUNTIME DESTINATION bin LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib COMPONENT driverssound) IF(WITH_MAXPLUGIN) INSTALL(TARGETS nel_drv_dsound RUNTIME DESTINATION maxplugin COMPONENT driverssound) ENDIF(WITH_MAXPLUGIN) diff --git a/code/nel/src/sound/driver/fmod/CMakeLists.txt b/code/nel/src/sound/driver/fmod/CMakeLists.txt index 25095140d..54f46aec1 100644 --- a/code/nel/src/sound/driver/fmod/CMakeLists.txt +++ b/code/nel/src/sound/driver/fmod/CMakeLists.txt @@ -2,20 +2,18 @@ FILE(GLOB SRC *.cpp *.h) NL_TARGET_DRIVER(nel_drv_fmod ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${FMOD_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nel_drv_fmod ${LIBXML2_LIBRARIES} ${FMOD_LIBRARY} nelsnd_lowlevel) +INCLUDE_DIRECTORIES(${FMOD_INCLUDE_DIR}) +TARGET_LINK_LIBRARIES(nel_drv_fmod ${FMOD_LIBRARY} nelmisc nelsnd_lowlevel) NL_DEFAULT_PROPS(nel_drv_fmod "NeL, Driver, Sound: FMOD") NL_ADD_LIB_SUFFIX(nel_drv_fmod) NL_ADD_RUNTIME_FLAGS(nel_drv_fmod) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nel_drv_fmod ${CMAKE_CURRENT_SOURCE_DIR}/stdfmod.h ${CMAKE_CURRENT_SOURCE_DIR}/stdfmod.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS nel_drv_fmod RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT driverssound) +INSTALL(TARGETS nel_drv_fmod RUNTIME DESTINATION bin LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib COMPONENT driverssound) IF(WITH_MAXPLUGIN) INSTALL(TARGETS nel_drv_fmod RUNTIME DESTINATION maxplugin COMPONENT driverssound) ENDIF(WITH_MAXPLUGIN) diff --git a/code/nel/src/sound/driver/openal/CMakeLists.txt b/code/nel/src/sound/driver/openal/CMakeLists.txt index a7e274b07..bf8c0e742 100644 --- a/code/nel/src/sound/driver/openal/CMakeLists.txt +++ b/code/nel/src/sound/driver/openal/CMakeLists.txt @@ -37,7 +37,7 @@ IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nel_drv_openal ${CMAKE_CURRENT_SOURCE_DIR}/stdopenal.h ${CMAKE_CURRENT_SOURCE_DIR}/stdopenal.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS nel_drv_openal RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT driverssound) +INSTALL(TARGETS nel_drv_openal RUNTIME DESTINATION bin LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib COMPONENT driverssound) IF(WITH_MAXPLUGIN) INSTALL(TARGETS nel_drv_openal RUNTIME DESTINATION maxplugin COMPONENT driverssound) ENDIF(WITH_MAXPLUGIN) diff --git a/code/nel/src/sound/driver/sound_driver.cpp b/code/nel/src/sound/driver/sound_driver.cpp index c0ca3d5bc..e4bc219b5 100644 --- a/code/nel/src/sound/driver/sound_driver.cpp +++ b/code/nel/src/sound/driver/sound_driver.cpp @@ -18,6 +18,10 @@ #include "nel/sound/driver/sound_driver.h" +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif // HAVE_CONFIG_H + #ifdef NL_OS_WINDOWS # define NOMINMAX # include @@ -201,6 +205,11 @@ ISoundDriver *ISoundDriver::createDriver(IStringMapperProvider *stringMapper, TD } CLibrary driverLib; + +#if defined(NL_OS_UNIX) && defined(NL_DRIVER_PREFIX) + driverLib.addLibPath(NL_DRIVER_PREFIX); +#endif + // Load it (adding standard nel pre/suffix, looking in library path and not taking ownership) if (!driverLib.loadLibrary(dllName, true, true, false)) { diff --git a/code/nel/src/sound/driver/xaudio2/CMakeLists.txt b/code/nel/src/sound/driver/xaudio2/CMakeLists.txt index a7900c954..3f69d2c42 100644 --- a/code/nel/src/sound/driver/xaudio2/CMakeLists.txt +++ b/code/nel/src/sound/driver/xaudio2/CMakeLists.txt @@ -28,20 +28,18 @@ SOURCE_GROUP(efx FILES NL_TARGET_DRIVER(nel_drv_xaudio2 ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${DXSDK_INCLUDE_DIR} ${VORBIS_INCLUDE_DIR} ${OGG_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nel_drv_xaudio2 ${LIBXML2_LIBRARIES} nelsnd_lowlevel ${DXSDK_XAUDIO_LIBRARY} ${DXSDK_GUID_LIBRARY} ${VORBIS_LIBRARIES} ${OGG_LIBRARY}) +INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) +TARGET_LINK_LIBRARIES(nel_drv_xaudio2 nelmisc nelsnd_lowlevel ${DXSDK_XAUDIO_LIBRARY} ${DXSDK_GUID_LIBRARY}) NL_DEFAULT_PROPS(nel_drv_xaudio2 "NeL, Driver, Sound: XAudio2") NL_ADD_LIB_SUFFIX(nel_drv_xaudio2) NL_ADD_RUNTIME_FLAGS(nel_drv_xaudio2) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nel_drv_xaudio2 ${CMAKE_CURRENT_SOURCE_DIR}/stdxaudio2.h ${CMAKE_CURRENT_SOURCE_DIR}/stdxaudio2.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS nel_drv_xaudio2 RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT driverssound) +INSTALL(TARGETS nel_drv_xaudio2 RUNTIME DESTINATION bin LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib COMPONENT driverssound) IF(WITH_MAXPLUGIN) INSTALL(TARGETS nel_drv_xaudio2 RUNTIME DESTINATION maxplugin COMPONENT driverssound) ENDIF(WITH_MAXPLUGIN) diff --git a/code/nel/tools/3d/CMakeLists.txt b/code/nel/tools/3d/CMakeLists.txt index 1010bbe7d..550293ad3 100644 --- a/code/nel/tools/3d/CMakeLists.txt +++ b/code/nel/tools/3d/CMakeLists.txt @@ -1,4 +1,5 @@ -SUBDIRS( build_coarse_mesh +SUBDIRS( + build_coarse_mesh build_far_bank build_smallbank ig_lighter @@ -22,29 +23,35 @@ SUBDIRS( build_coarse_mesh zone_check_bind zone_dump zviewer) -IF(WIN32) - ADD_SUBDIRECTORY(object_viewer) - ADD_SUBDIRECTORY(object_viewer_exe) - ADD_SUBDIRECTORY(panoply_maker) - ADD_SUBDIRECTORY(tile_edit) + +IF(WIN32) + ADD_SUBDIRECTORY(ig_elevation) + ADD_SUBDIRECTORY(lightmap_optimizer) + + IF(MFC_FOUND) + ADD_SUBDIRECTORY(object_viewer) + ADD_SUBDIRECTORY(object_viewer_exe) + ADD_SUBDIRECTORY(tile_edit) + ENDIF(MFC_FOUND) + + IF(WITH_MAXPLUGIN) + IF(MAXSDK_FOUND) + ADD_SUBDIRECTORY(plugin_max) + ADD_SUBDIRECTORY(ligo) + ENDIF(MAXSDK_FOUND) + ENDIF(WITH_MAXPLUGIN) + ENDIF(WIN32) IF(WITH_QT) ADD_SUBDIRECTORY(tile_edit_qt) ENDIF(WITH_QT) -IF(WITH_MAXPLUGIN) - IF(MAXSDK_FOUND) - ADD_SUBDIRECTORY(plugin_max) - ADD_SUBDIRECTORY(ligo) - ENDIF(MAXSDK_FOUND) -ENDIF(WITH_MAXPLUGIN) +IF(SQUISH_FOUND) + ADD_SUBDIRECTORY(panoply_maker) + ADD_SUBDIRECTORY(tga_2_dds) + ADD_SUBDIRECTORY(hls_bank_maker) +ENDIF(SQUISH_FOUND) -# These use WIndows-specific things that need to be fixed. -#ig_elevation -#lightmap_optimizer -#object_viewer_exe -#hls_bank_maker -#s3tc_compressor_lib -#tga_2_dds -#plugin_max +#crash_log_analyser +#shapes_exporter diff --git a/code/nel/tools/3d/build_interface/main.cpp b/code/nel/tools/3d/build_interface/main.cpp index 207519aaa..ae317269b 100644 --- a/code/nel/tools/3d/build_interface/main.cpp +++ b/code/nel/tools/3d/build_interface/main.cpp @@ -366,9 +366,20 @@ int main(int nNbArg, char **ppArgs) fmtName += ".tga"; if (outTga.open(fmtName)) { - GlobalTexture.writeTGA (outTga, 32); + std::string ext; + if (toLower(fmtName).find(".png") != string::npos) + { + ext = "png"; + GlobalTexture.writePNG (outTga, 32); + } + else + { + ext = "tga"; + GlobalTexture.writeTGA (outTga, 32); + } + outTga.close(); - outString (string("Writing tga file : ") + fmtName + "\n"); + outString (toString("Writing %s file : %s\n", ext.c_str(), fmtName.c_str())); } else { diff --git a/code/nel/tools/3d/hls_bank_maker/CMakeLists.txt b/code/nel/tools/3d/hls_bank_maker/CMakeLists.txt new file mode 100644 index 000000000..ffc3ef01a --- /dev/null +++ b/code/nel/tools/3d/hls_bank_maker/CMakeLists.txt @@ -0,0 +1,11 @@ +FILE(GLOB SRC *.cpp *.h ../panoply_maker/hls_bank_texture_info.cpp ../panoply_maker/hls_bank_texture_info.h ../s3tc_compressor_lib/*.cpp ../s3tc_compressor_lib/*.h) + +ADD_EXECUTABLE(hls_bank_maker ${SRC}) + +INCLUDE_DIRECTORIES(${SQUISH_INCLUDE_DIR}) + +TARGET_LINK_LIBRARIES(hls_bank_maker ${PLATFORM_LINKFLAGS} ${SQUISH_LIBRARY} nelmisc nel3d) +NL_DEFAULT_PROPS(hls_bank_maker "Tools, 3D: hls_bank_maker") +NL_ADD_RUNTIME_FLAGS(hls_bank_maker) + +INSTALL(TARGETS hls_bank_maker RUNTIME DESTINATION bin COMPONENT tools3d) diff --git a/code/nel/tools/3d/ig_add/CMakeLists.txt b/code/nel/tools/3d/ig_add/CMakeLists.txt index 107d700b0..1314bf84a 100644 --- a/code/nel/tools/3d/ig_add/CMakeLists.txt +++ b/code/nel/tools/3d/ig_add/CMakeLists.txt @@ -2,7 +2,7 @@ FILE(GLOB SRC *.cpp *.h) ADD_EXECUTABLE(ig_add ${SRC}) -TARGET_LINK_LIBRARIES(ig_add ${PLATFORM_LINKFLAGS} nel3d) +TARGET_LINK_LIBRARIES(ig_add ${PLATFORM_LINKFLAGS} nel3d nelmisc) NL_DEFAULT_PROPS(ig_add "NeL, Tools, 3D: ig_add") NL_ADD_RUNTIME_FLAGS(ig_add) diff --git a/code/nel/tools/3d/ig_elevation/CMakeLists.txt b/code/nel/tools/3d/ig_elevation/CMakeLists.txt index ad0e04024..2e428cc7a 100644 --- a/code/nel/tools/3d/ig_elevation/CMakeLists.txt +++ b/code/nel/tools/3d/ig_elevation/CMakeLists.txt @@ -1,12 +1,13 @@ FILE(GLOB SRC *.cpp *.h) -DECORATE_NEL_LIB("nel3d") -SET(NL3D_LIB ${LIBNAME}) - ADD_EXECUTABLE(ig_elevation ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(ig_elevation ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} ${NL3D_LIB}) + +TARGET_LINK_LIBRARIES(ig_elevation ${PLATFORM_LINKFLAGS} nelmisc nel3d nelligo) +NL_DEFAULT_PROPS(ig_elevation "Tools, 3D: ig_elevation") +NL_ADD_RUNTIME_FLAGS(ig_elevation) + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) INSTALL(TARGETS ig_elevation RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/lightmap_optimizer/CMakeLists.txt b/code/nel/tools/3d/lightmap_optimizer/CMakeLists.txt index 865886999..7104d05f8 100644 --- a/code/nel/tools/3d/lightmap_optimizer/CMakeLists.txt +++ b/code/nel/tools/3d/lightmap_optimizer/CMakeLists.txt @@ -1,12 +1,9 @@ FILE(GLOB SRC *.cpp *.h) -DECORATE_NEL_LIB("nelmisc") -SET(NLMISC_LIB ${LIBNAME}) - ADD_EXECUTABLE(lightmap_optimizer ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(lightmap_optimizer ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} ${NLMISC_LIB}) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +TARGET_LINK_LIBRARIES(lightmap_optimizer ${PLATFORM_LINKFLAGS} nel3d nelmisc) +NL_DEFAULT_PROPS(lightmap_optimizer "Tools, 3D: lightmap_optimizer") +NL_ADD_RUNTIME_FLAGS(lightmap_optimizer) INSTALL(TARGETS lightmap_optimizer RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/ligo/plugin_max/CMakeLists.txt b/code/nel/tools/3d/ligo/plugin_max/CMakeLists.txt index 29081370f..41123aa21 100644 --- a/code/nel/tools/3d/ligo/plugin_max/CMakeLists.txt +++ b/code/nel/tools/3d/ligo/plugin_max/CMakeLists.txt @@ -3,8 +3,8 @@ FILE(GLOB SRC *.cpp *.h ../../ig_lighter_lib/*.cpp ../../ig_lighter_lib/*.h) ADD_LIBRARY(ligoscape_utility SHARED ligoscape_utility.rc ${SRC} ligoscape_utility.def) INCLUDE_DIRECTORIES(${MAXSDK_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR}) + TARGET_LINK_LIBRARIES(ligoscape_utility - ${LIBXML2_LIBRARIES} nelmisc nelligo nel3d @@ -15,15 +15,11 @@ TARGET_LINK_LIBRARIES(ligoscape_utility nel_3dsmax_shared comctl32) -SET_TARGET_PROPERTIES(ligoscape_utility PROPERTIES - VERSION ${NL_VERSION} - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - SUFFIX ".dlx" - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r" - PROJECT_LABEL "MAX Plugin: Ligoscape Utility") - +SET_TARGET_PROPERTIES(ligoscape_utility PROPERTIES SUFFIX ".dlx") +NL_DEFAULT_PROPS(ligoscape_utility "MAX Plugin: Ligoscape Utility") +NL_ADD_RUNTIME_FLAGS(ligoscape_utility) +NL_ADD_LIB_SUFFIX(ligoscape_utility) + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) INSTALL(TARGETS ligoscape_utility RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) diff --git a/code/nel/tools/3d/ligo/plugin_max/ligoscape_utility.h b/code/nel/tools/3d/ligo/plugin_max/ligoscape_utility.h index b1c9d081e..ab2375eae 100644 --- a/code/nel/tools/3d/ligo/plugin_max/ligoscape_utility.h +++ b/code/nel/tools/3d/ligo/plugin_max/ligoscape_utility.h @@ -14,6 +14,7 @@ #ifndef __PLUGIN_MAX__H #define __PLUGIN_MAX__H +#include #include "Max.h" #include #include diff --git a/code/nel/tools/3d/ligo/plugin_max/max_to_ligo.cpp b/code/nel/tools/3d/ligo/plugin_max/max_to_ligo.cpp index 9e143df06..7500b027b 100644 --- a/code/nel/tools/3d/ligo/plugin_max/max_to_ligo.cpp +++ b/code/nel/tools/3d/ligo/plugin_max/max_to_ligo.cpp @@ -14,6 +14,8 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include + // From MAXSDK #include diff --git a/code/nel/tools/3d/ligo/plugin_max/script.cpp b/code/nel/tools/3d/ligo/plugin_max/script.cpp index 97b9a97ad..228bf5349 100644 --- a/code/nel/tools/3d/ligo/plugin_max/script.cpp +++ b/code/nel/tools/3d/ligo/plugin_max/script.cpp @@ -16,6 +16,8 @@ #define EXPORT_GET_ALLOCATOR +#include + // Various MAX and MXS includes #include #include diff --git a/code/nel/tools/3d/object_viewer/CMakeLists.txt b/code/nel/tools/3d/object_viewer/CMakeLists.txt index 3b24369a0..ae724580b 100644 --- a/code/nel/tools/3d/object_viewer/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer/CMakeLists.txt @@ -10,21 +10,17 @@ SET(CMAKE_MFC_FLAG 2) ADD_LIBRARY(object_viewer_dll SHARED ${SRC} object_viewer.rc) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) + TARGET_LINK_LIBRARIES(object_viewer_dll - ${LIBXML2_LIBRARIES} nelmisc nel3d nelsound nelsnd_lowlevel Version.lib) -SET_TARGET_PROPERTIES(object_viewer_dll PROPERTIES - VERSION ${NL_VERSION} - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r" - PROJECT_LABEL "NeL, Tools, 3D: Object Viewer DLL") +NL_DEFAULT_PROPS(object_viewer_dll "NeL, Tools, 3D: Object Viewer DLL") +NL_ADD_RUNTIME_FLAGS(object_viewer_dll) +NL_ADD_LIB_SUFFIX(object_viewer_dll) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DOBJECT_VIEWER_LIB_EXPORTS) diff --git a/code/nel/tools/3d/object_viewer_exe/CMakeLists.txt b/code/nel/tools/3d/object_viewer_exe/CMakeLists.txt index a171fbf64..945c3b906 100644 --- a/code/nel/tools/3d/object_viewer_exe/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_exe/CMakeLists.txt @@ -5,21 +5,16 @@ ADD_DEFINITIONS(-D_AFXDLL) SET(CMAKE_MFC_FLAG 2) ADD_EXECUTABLE(object_viewer WIN32 ${SRC} object_viewer_exe.rc) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES( object_viewer - ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc nel3d nelsound nelsnd_lowlevel object_viewer_dll) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -SET_TARGET_PROPERTIES(object_viewer PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - PROJECT_LABEL "NeL, Tools, 3D: Object Viewer") +NL_DEFAULT_PROPS(object_viewer "NeL, Tools, 3D: Object Viewer") +NL_ADD_RUNTIME_FLAGS(object_viewer) IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(object_viewer ${CMAKE_CURRENT_SOURCE_DIR}/std_afx.h ${CMAKE_CURRENT_SOURCE_DIR}/std_afx.cpp) diff --git a/code/nel/tools/3d/object_viewer_exe/object_viewer_exe.rc b/code/nel/tools/3d/object_viewer_exe/object_viewer_exe.rc index bbc7e0d13..54045351c 100644 --- a/code/nel/tools/3d/object_viewer_exe/object_viewer_exe.rc +++ b/code/nel/tools/3d/object_viewer_exe/object_viewer_exe.rc @@ -7,7 +7,7 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#include "afxres.h" +#include ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS diff --git a/code/nel/tools/3d/object_viewer_exe/std_afx.h b/code/nel/tools/3d/object_viewer_exe/std_afx.h index a6acb9503..44b1cfadd 100644 --- a/code/nel/tools/3d/object_viewer_exe/std_afx.h +++ b/code/nel/tools/3d/object_viewer_exe/std_afx.h @@ -26,27 +26,4 @@ #define NOMINMAX -#include // MFC core and standard components -#include // MFC extensions - -#ifndef _AFX_NO_OLE_SUPPORT -#include // MFC OLE classes -#include // MFC OLE dialog classes -#include // MFC Automation classes -#endif // _AFX_NO_OLE_SUPPORT - - -#ifndef _AFX_NO_DB_SUPPORT -#include // MFC ODBC database classes -#endif // _AFX_NO_DB_SUPPORT - -#ifndef _AFX_NO_DAO_SUPPORT -#include // MFC DAO database classes -#endif // _AFX_NO_DAO_SUPPORT - -#include // MFC support for Internet Explorer 4 Common Controls -#ifndef _AFX_NO_AFXCMN_SUPPORT -#include // MFC support for Windows Common Controls -#endif // _AFX_NO_AFXCMN_SUPPORT - #endif diff --git a/code/nel/tools/3d/panoply_maker/CMakeLists.txt b/code/nel/tools/3d/panoply_maker/CMakeLists.txt index 1728ebcee..f214a2de8 100644 --- a/code/nel/tools/3d/panoply_maker/CMakeLists.txt +++ b/code/nel/tools/3d/panoply_maker/CMakeLists.txt @@ -2,16 +2,10 @@ FILE(GLOB SRC *.cpp *.h ../s3tc_compressor_lib/*.h ../s3tc_compressor_lib/*.cpp) ADD_EXECUTABLE(panoply_maker ${SRC}) -FIND_PACKAGE(Squish REQUIRED) +INCLUDE_DIRECTORIES(${SQUISH_INCLUDE_DIR}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${SQUISH_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(panoply_maker ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} ${SQUISH_LIBRARY} nelmisc nel3d) -IF(WIN32) - SET_TARGET_PROPERTIES(panoply_maker PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - PROJECT_LABEL "NeL, Tools, 3D: panoply_maker") -ENDIF(WIN32) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +TARGET_LINK_LIBRARIES(panoply_maker ${PLATFORM_LINKFLAGS} ${SQUISH_LIBRARY} nelmisc nel3d) +NL_DEFAULT_PROPS(panoply_maker "NeL, Tools, 3D: panoply_maker") +NL_ADD_RUNTIME_FLAGS(panoply_maker) -INSTALL(TARGETS panoply_maker RUNTIME DESTINATION bin COMPONENT tools3d) +INSTALL(TARGETS panoply_maker RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/CMakeLists.txt index 27359b29d..37a9bb0be 100644 --- a/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/CMakeLists.txt @@ -2,9 +2,8 @@ FILE(GLOB SRC *.cpp *.h *.def) ADD_LIBRARY(nel_3dsmax_shared SHARED ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${MAXSDK_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${MAXSDK_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nel_3dsmax_shared - ${LIBXML2_LIBRARIES} nelmisc nel3d nel_mesh_lib @@ -12,15 +11,12 @@ TARGET_LINK_LIBRARIES(nel_3dsmax_shared ${MAXSDK_LIBRARIES} Version.lib) -SET_TARGET_PROPERTIES(nel_3dsmax_shared PROPERTIES - VERSION ${NL_VERSION} - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r" - PROJECT_LABEL "MAX Plugin: NeL 3DSMAX Shared") +NL_DEFAULT_PROPS(nel_3dsmax_shared "MAX Plugin: NeL 3DSMAX Shared") +NL_ADD_RUNTIME_FLAGS(nel_3dsmax_shared) +NL_ADD_LIB_SUFFIX(nel_3dsmax_shared) +SET_TARGET_PROPERTIES(nel_export PROPERTIES SUFFIX ".dlx") -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DNEL_3DSMAX_SHARED_EXPORTS) +ADD_DEFINITIONS(-DNEL_3DSMAX_SHARED_EXPORTS) IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nel_3dsmax_shared ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.h ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.cpp) diff --git a/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/StdAfx.h b/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/StdAfx.h index 0099fe7af..86627aaf7 100644 --- a/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/StdAfx.h +++ b/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/StdAfx.h @@ -30,6 +30,7 @@ // Insert your headers here #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +#include #include #include #include diff --git a/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/nel_3dsmax_shared.cpp b/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/nel_3dsmax_shared.cpp index 2c5cedd65..d30a5cadb 100644 --- a/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/nel_3dsmax_shared.cpp +++ b/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/nel_3dsmax_shared.cpp @@ -15,7 +15,7 @@ // along with this program. If not, see . #include "stdafx.h" -#include "..\nel_patch_lib\rpo.h" +#include "../nel_patch_lib/rpo.h" #include "nel_3dsmax_shared.h" #include "nel/misc/app_context.h" diff --git a/code/nel/tools/3d/plugin_max/nel_export/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_export/CMakeLists.txt index 848deb77e..0c2a215dc 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_export/CMakeLists.txt @@ -7,8 +7,8 @@ LIST(REMOVE_ITEM SRC ${CMAKE_CURRENT_SOURCE_DIR}/last_lightmap.cpp ADD_LIBRARY(nel_export SHARED ${SRC} nel_export.rc) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${MAXSDK_INCLUDE_DIR}) + TARGET_LINK_LIBRARIES(nel_export - ${LIBXML2_LIBRARIES} nelmisc nelpacs nel3d @@ -19,15 +19,11 @@ TARGET_LINK_LIBRARIES(nel_export ${MAXSDK_LIBRARIES} Version.lib comctl32.lib) - -SET_TARGET_PROPERTIES(nel_export PROPERTIES - VERSION ${NL_VERSION} - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r" - SUFFIX ".dlu" - PROJECT_LABEL "MAX Plugin: NeL Export") + +NL_DEFAULT_PROPS(nel_export "MAX Plugin: NeL Export") +NL_ADD_RUNTIME_FLAGS(nel_export) +NL_ADD_LIB_SUFFIX(nel_export) +SET_TARGET_PROPERTIES(nel_export PROPERTIES SUFFIX ".dlu") ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) 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 04e815eac..7b8d2862e 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 @@ -59,7 +59,7 @@ void *CNelExportClassDesc::Create(BOOL loading) } -int CALLBACK OptionsDialogCallback ( +INT_PTR CALLBACK OptionsDialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter @@ -217,7 +217,7 @@ int CALLBACK OptionsDialogCallback ( } extern HINSTANCE hInstance; -static BOOL CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { // Set locale to english setlocale (LC_NUMERIC, "English"); 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 c79295925..9f582bd23 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 @@ -17,6 +17,7 @@ #include "std_afx.h" #include "nel_export.h" #include "nel/misc/file.h" +#include "nel/misc/path.h" #include "nel/3d/shape.h" #include "nel/3d/animation.h" #include "nel/3d/skeleton_shape.h" @@ -34,94 +35,133 @@ using namespace NLMISC; bool CNelExport::exportMesh (const char *sPath, INode& node, TimeValue time) { // Result to return - bool bRet=false; - - // Eval the object a time - ObjectState os = node.EvalWorldState(time); - - // Object exist ? - if (os.obj) + bool bRet = false; + char tempName[L_tmpnam]; + tmpnam(tempName); + + try { - // Skeleton shape - CSkeletonShape *skeletonShape=NULL; - TInodePtrInt *mapIdPtr=NULL; - TInodePtrInt mapId; + // Eval the object a time + ObjectState os = node.EvalWorldState(time); - // If model skinned ? - if (CExportNel::isSkin (node)) + // Object exist ? + if (os.obj) { - // Create a skeleton - INode *skeletonRoot=CExportNel::getSkeletonRootBone (node); + // Skeleton shape + CSmartPtr skeletonShape = NULL; + TInodePtrInt *mapIdPtr=NULL; + TInodePtrInt mapId; - // Skeleton exist ? - if (skeletonRoot) + // If model skinned ? + if (CExportNel::isSkin (node)) { - // Build a skeleton - skeletonShape=new CSkeletonShape(); + // Create a skeleton + INode *skeletonRoot = CExportNel::getSkeletonRootBone(node); - // Add skeleton bind pos info - CExportNel::mapBoneBindPos boneBindPos; - CExportNel::addSkeletonBindPos (node, boneBindPos); + // Skeleton exist ? + if (skeletonRoot) + { + // Build a skeleton + skeletonShape = new CSkeletonShape(); - // Build the skeleton based on the bind pos information - _ExportNel->buildSkeletonShape (*skeletonShape, *skeletonRoot, &boneBindPos, mapId, time); + // Add skeleton bind pos info + CExportNel::mapBoneBindPos boneBindPos; + CExportNel::addSkeletonBindPos (node, boneBindPos); - // Set the pointer to not NULL - mapIdPtr=&mapId; + // Build the skeleton based on the bind pos information + _ExportNel->buildSkeletonShape(*skeletonShape.getPtr(), *skeletonRoot, &boneBindPos, mapId, time); - // Erase the skeleton - if (skeletonShape) - delete skeletonShape; + // Set the pointer to not NULL + mapIdPtr=&mapId; + + // Erase the skeleton + skeletonShape = NULL; + } } - } - - DWORD t = timeGetTime(); - if (InfoLog) - InfoLog->display("Beg buildShape %s \n", node.GetName()); - // Export in mesh format - IShape* pShape=_ExportNel->buildShape (node, time, mapIdPtr, true); - if (InfoLog) - InfoLog->display("End buildShape in %d ms \n", timeGetTime()-t); - - // Conversion success ? - if (pShape) - { - // Open a file - COFile file; - if (file.open (sPath)) + + DWORD t = timeGetTime(); + if (InfoLog) + InfoLog->display("Beg buildShape %s \n", node.GetName()); + // Export in mesh format + CSmartPtr pShape = _ExportNel->buildShape(node, time, mapIdPtr, true); + if (InfoLog) + InfoLog->display("End buildShape in %d ms \n", timeGetTime()-t); + + // Conversion success ? + if (pShape.getPtr()) { + // Open a file + COFile file; + if (file.open(tempName)) + { + try + { + // Create a streamable shape + CShapeStream shapeStream(pShape); + + // Serial the shape + shapeStream.serial(file); + + // All is good + bRet = true; + } + catch (...) + { + nlwarning("Shape serialization failed!"); + try + { + file.close(); + } + catch (...) + { + + } + remove(tempName); + } + } + else + { + nlwarning("Failed to create file %s", tempName); + } + + // Delete the pointer + nldebug ("Delete the pointer"); try { - // Create a streamable shape - CShapeStream shapeStream (pShape); - - // Serial the shape - shapeStream.serial (file); - - // All is good - bRet=true; + bool tempBRet = bRet; + bRet = false; + pShape = NULL; + bRet = tempBRet; } catch (...) { - nlwarning("Shape serialization failed!"); - file.close(); - remove(sPath); + nlwarning("Failed to delete pShape pointer! Something might be wrong."); + remove(tempName); + bRet = false; } } - - // Delete the pointer - nldebug ("Delete the pointer"); - try - { - // memory leak, fixme - // delete pShape; - } - catch (...) - { - nlwarning("Failed to delete pShape pointer! Something might be wrong."); - } } } + catch (...) + { + nlwarning("Fatal exception at CNelExport::exportMesh."); + bRet = false; + } + + if (bRet) + { + try + { + remove(sPath); + } + catch (...) + { + + } + CFile::moveFile(sPath, tempName); + nlinfo("MOVE %s -> %s", tempName, sPath); + } + return bRet; } 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 f56ed592a..d6218fedf 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 @@ -309,22 +309,22 @@ public: HWND SubVPDlg[VP_COUNT]; }; -int CALLBACK MRMDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -int CALLBACK AccelDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -int CALLBACK InstanceDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -int CALLBACK LightmapDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -int CALLBACK Lightmap2DialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -int CALLBACK VegetableDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -int CALLBACK VertexProgramDialogCallBack (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -int CALLBACK MiscDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -int CALLBACK AnimationDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK MRMDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK AccelDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK InstanceDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK LightmapDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK Lightmap2DialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK VegetableDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK VertexProgramDialogCallBack (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK MiscDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK AnimationDialogCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); const char *SubText[TAB_COUNT] = {"LOD & MRM", "Accelerator", "Instance", "Lighting", "LMC", "Vegetable", "VertexProgram", "Misc", "Animation"}; const int SubTab[TAB_COUNT] = {IDD_LOD, IDD_ACCEL, IDD_INSTANCE, IDD_LIGHTMAP, IDD_LIGHTMAP2, IDD_VEGETABLE, IDD_VERTEX_PROGRAM, IDD_MISC, IDD_ANIM}; DLGPROC SubProc[TAB_COUNT] = {MRMDialogCallback, AccelDialogCallback, InstanceDialogCallback, LightmapDialogCallback, Lightmap2DialogCallback, VegetableDialogCallback, VertexProgramDialogCallBack, MiscDialogCallback, AnimationDialogCallback}; // VertexPrograms. -int CALLBACK VPWindTreeCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK VPWindTreeCallback (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); const int SubVPTab[VP_COUNT] = {IDD_VP_WINDTREE}; DLGPROC SubVPProc[VP_COUNT] = {VPWindTreeCallback}; @@ -417,7 +417,7 @@ void VegetableStateChanged (HWND hwndDlg) void AccelStateChanged (HWND hwndDlg) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); bool cluster = (currentParam->AcceleratorType&NEL3D_APPDATA_ACCEL_TYPE) == NEL3D_APPDATA_ACCEL_CLUSTER; bool portal = (currentParam->AcceleratorType&NEL3D_APPDATA_ACCEL_TYPE) == NEL3D_APPDATA_ACCEL_PORTAL; @@ -464,22 +464,22 @@ void exploreNode(INode *node) } -int CALLBACK AccelDialogCallback ( +INT_PTR CALLBACK AccelDialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); // Fill the known sound groups by parsing the max node tree. { @@ -635,22 +635,22 @@ int CALLBACK AccelDialogCallback ( // *************************************************************************** -int CALLBACK MRMDialogCallback ( +INT_PTR CALLBACK MRMDialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); // Window text std::string winName=(*(currentParam->ListNode->begin()))->GetName(); @@ -903,22 +903,22 @@ int CALLBACK MRMDialogCallback ( // *************************************************************************** -int CALLBACK InstanceDialogCallback ( +INT_PTR CALLBACK InstanceDialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); SetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_INSTANCE_GROUP_SHAPE), currentParam->InstanceShape.c_str()); SetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_INSTANCE_NAME), currentParam->InstanceName.c_str()); @@ -1019,22 +1019,22 @@ int CALLBACK InstanceDialogCallback ( // *************************************************************************** -int CALLBACK LightmapDialogCallback ( +INT_PTR CALLBACK LightmapDialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); SetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_LUMELSIZEMUL), currentParam->LumelSizeMul.c_str()); SetWindowText (GetDlgItem (hwndDlg, IDC_EDIT_SOFTSHADOW_RADIUS), currentParam->SoftShadowRadius.c_str()); @@ -1298,14 +1298,14 @@ struct CLMCParamFrom }; // *************************************************************************** -int CALLBACK LMCCopyFromDialogCallback( +INT_PTR CALLBACK LMCCopyFromDialogCallback( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLMCParamFrom *lmcParam=(CLMCParamFrom *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLMCParamFrom *lmcParam=(CLMCParamFrom *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); uint i; switch (uMsg) @@ -1313,8 +1313,8 @@ int CALLBACK LMCCopyFromDialogCallback( case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - lmcParam=(CLMCParamFrom *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + lmcParam=(CLMCParamFrom *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); // init the colors nlctassert(CLodDialogBoxParam::NumLightGroup==3); @@ -1519,22 +1519,22 @@ void lmcCopyFrom(CLodDialogBoxParam *currentParam, HWND parentDlg) } // *************************************************************************** -int CALLBACK Lightmap2DialogCallback ( +INT_PTR CALLBACK Lightmap2DialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); // retrieve the color choosing Ctrl nlctassert(CLodDialogBoxParam::NumLightGroup==3); @@ -1642,22 +1642,22 @@ int CALLBACK Lightmap2DialogCallback ( // *************************************************************************** -int CALLBACK VegetableDialogCallback ( +INT_PTR CALLBACK VegetableDialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); SendMessage (GetDlgItem (hwndDlg, IDC_VEGETABLE), BM_SETCHECK, currentParam->Vegetable, 0); @@ -1762,22 +1762,22 @@ int CALLBACK VegetableDialogCallback ( } // *************************************************************************** -int CALLBACK VertexProgramDialogCallBack ( +INT_PTR CALLBACK VertexProgramDialogCallBack ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); // test wether v.p are bypassed for that object (this may happen when a v.p is needed by a material of this mesh) if (!currentParam->VertexProgramBypassed) @@ -2028,22 +2028,22 @@ static void updateVPWTStaticForControl(HWND hwndDlg, HWND ctrlWnd, CVPWindTreeAp } -int CALLBACK VPWindTreeCallback ( +INT_PTR CALLBACK VPWindTreeCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); // Init controls CVPWindTreeAppData &vpwt= currentParam->VertexProgramWindTree; @@ -2266,22 +2266,22 @@ int CALLBACK VPWindTreeCallback ( // *************************************************************************** -int CALLBACK MiscDialogCallback ( +INT_PTR CALLBACK MiscDialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); SendMessage (GetDlgItem (hwndDlg, IDC_FLOATING_OBJECT), BM_SETCHECK, currentParam->FloatingObject, 0); // Ligoscape @@ -2399,22 +2399,22 @@ int CALLBACK MiscDialogCallback ( // *************************************************************************** -int CALLBACK AnimationDialogCallback ( +INT_PTR CALLBACK AnimationDialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); SendMessage (GetDlgItem (hwndDlg, IDC_EXPORT_NOTE_TRACK), BM_SETCHECK, currentParam->ExportNoteTrack, 0); SendMessage (GetDlgItem (hwndDlg, IDC_EXPORT_SSS_TRACK), BM_SETCHECK, currentParam->ExportSSSTrack, 0); SendMessage (GetDlgItem (hwndDlg, IDC_EXPORT_ANIMATED_MATERIALS), BM_SETCHECK, currentParam->ExportAnimatedMaterials, 0); @@ -2468,22 +2468,22 @@ int CALLBACK AnimationDialogCallback ( // *************************************************************************** -int CALLBACK LodDialogCallback ( +INT_PTR CALLBACK LodDialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { - CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + CLodDialogBoxParam *currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { // Param pointers - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - currentParam=(CLodDialogBoxParam *)GetWindowLong(hwndDlg, GWL_USERDATA); + LONG_PTR res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + currentParam=(CLodDialogBoxParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); // Window text std::string winName=(*(currentParam->ListNode->begin()))->GetName(); @@ -2602,7 +2602,7 @@ void CNelExport::OnNodeProperties (const std::set &listNode) { // Get - uint nNumSelNode=listNode.size(); + uint nNumSelNode=(uint)listNode.size(); if (nNumSelNode) { @@ -3220,7 +3220,7 @@ void CNelExport::OnNodeProperties (const std::set &listNode) if (param.ListActived) { // Write size of the list - uint sizeList=std::min (param.ListLodName.size(), (uint)NEL3D_APPDATA_LOD_NAME_COUNT_MAX); + 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 diff --git a/code/nel/tools/3d/plugin_max/nel_export/progress.cpp b/code/nel/tools/3d/plugin_max/nel_export/progress.cpp index 4c1a239ca..7dd24b761 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/progress.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/progress.cpp @@ -26,7 +26,7 @@ using namespace NLMISC; // ----------------------------------------------------------------------------------------------- // Window dialog callback // ----------------------------------------------------------------------------------------------- -int CALLBACK CalculatingDialogCallback ( +INT_PTR CALLBACK CalculatingDialogCallback ( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter @@ -34,14 +34,14 @@ int CALLBACK CalculatingDialogCallback ( ) { double TimeCurrent = CTime::ticksToSecond( CTime::getPerformanceTime() ); - CProgressBar *pClass = (CProgressBar*)GetWindowLong (hwndDlg, GWL_USERDATA); + CProgressBar *pClass = (CProgressBar*)GetWindowLongPtr (hwndDlg, GWLP_USERDATA); switch (uMsg) { case WM_INITDIALOG: { - LONG res = SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)lParam); - pClass = (CProgressBar*)GetWindowLong (hwndDlg, GWL_USERDATA); + LONG res = SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); + pClass = (CProgressBar*)GetWindowLongPtr (hwndDlg, GWLP_USERDATA); CenterWindow( hwndDlg, theCNelExport._Ip->GetMAXHWnd() ); ShowWindow( hwndDlg, SW_SHOWNORMAL ); diff --git a/code/nel/tools/3d/plugin_max/nel_export/std_afx.h b/code/nel/tools/3d/plugin_max/nel_export/std_afx.h index dcc52202d..326c0b9c1 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/std_afx.h +++ b/code/nel/tools/3d/plugin_max/nel_export/std_afx.h @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#include #include #include #include diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_mesh_lib/CMakeLists.txt index 3e55c015a..555edd263 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/CMakeLists.txt @@ -2,18 +2,11 @@ FILE(GLOB SRC *.cpp *.h) ADD_LIBRARY(nel_mesh_lib STATIC ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${MAXSDK_INCLUDE_DIR} ${MAXSDK_CS_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nel_mesh_lib ${LIBXML2_LIBRARIES} nelmisc) -SET_TARGET_PROPERTIES(nel_mesh_lib PROPERTIES - VERSION ${NL_VERSION} - SOVERSION ${NL_VERSION_MAJOR} - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r" - PROJECT_LABEL "MAX Plugin: NeL Mesh Library") - -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +INCLUDE_DIRECTORIES(${MAXSDK_INCLUDE_DIR} ${MAXSDK_CS_INCLUDE_DIR}) +TARGET_LINK_LIBRARIES(nel_mesh_lib nelmisc) +NL_DEFAULT_PROPS(nel_mesh_lib "MAX Plugin: NeL Mesh Library") +NL_ADD_RUNTIME_FLAGS(nel_mesh_lib) +NL_ADD_LIB_SUFFIX(nel_mesh_lib) IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nel_mesh_lib ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.h ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.cpp) diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/StdAfx.h b/code/nel/tools/3d/plugin_max/nel_mesh_lib/StdAfx.h index 9a99b5fc1..65b65651e 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/StdAfx.h +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/StdAfx.h @@ -26,6 +26,7 @@ //#include "nel/misc/types_nl.h" // Max SDK includes //#define NOMINMAX +#include #include #include #include diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/calc_lm.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/calc_lm.cpp index 9f5d95441..e65b4ea56 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/calc_lm.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/calc_lm.cpp @@ -77,7 +77,8 @@ SLightBuild::SLightBuild() bool SLightBuild::canConvertFromMaxLight (INode *node, TimeValue tvTime) { // Get a pointer on the object's node - Object *obj = node->EvalWorldState(tvTime).obj; + ObjectState os = node->EvalWorldState(tvTime); + Object *obj = os.obj; // Check if there is an object if (!obj) @@ -98,7 +99,7 @@ bool SLightBuild::canConvertFromMaxLight (INode *node, TimeValue tvTime) return false; if( deleteIt ) - maxLight->DeleteMe(); + maxLight->MaybeAutoDelete(); return true; } @@ -107,7 +108,8 @@ bool SLightBuild::canConvertFromMaxLight (INode *node, TimeValue tvTime) void SLightBuild::convertFromMaxLight (INode *node,TimeValue tvTime) { // Get a pointer on the object's node - Object *obj = node->EvalWorldState(tvTime).obj; + ObjectState os = node->EvalWorldState(tvTime); + Object *obj = os.obj; // Check if there is an object if (!obj) return; @@ -295,7 +297,7 @@ void SLightBuild::convertFromMaxLight (INode *node,TimeValue tvTime) this->rSoftShadowConeLength = (float)atof(sTmp.c_str()); if( deleteIt ) - maxLight->DeleteMe(); + maxLight->MaybeAutoDelete(); } // *********************************************************************************************** @@ -2401,7 +2403,10 @@ bool CExportNel::calculateLM( CMesh::CMeshBuild *pZeMeshBuild, CMeshBase::CMeshB TempPlanes[nPlaneNb]->copyFirstLayerTo(*AllPlanes[AllPlanesPrevSize+nPlaneNb],(uint8)nLight); for( nPlaneNb = 0; nPlaneNb < (sint)FaceGroupByPlane.size(); ++nPlaneNb ) + { delete TempPlanes[nPlaneNb]; + TempPlanes[nPlaneNb] = NULL; + } } // Next group of face with the same smooth group and the same material @@ -2497,6 +2502,7 @@ bool CExportNel::calculateLM( CMesh::CMeshBuild *pZeMeshBuild, CMeshBase::CMeshB MoveFaceUV1( AllPlanes[i]->faces.begin(), AllPlanes[i]->faces.size(), AllPlanes[i]->x, AllPlanes[i]->y ); delete AllPlanes[i]; + AllPlanes[i] = NULL; } // Save the lightmap diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_anim.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_anim.cpp index f47204575..3a5d5a259 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_anim.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_anim.cpp @@ -264,6 +264,7 @@ void CExportNel::addParticleSystemTracks(CAnimation& animation, INode& node, con if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -281,6 +282,7 @@ void CExportNel::addParticleSystemTracks(CAnimation& animation, INode& node, con if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -325,6 +327,7 @@ void CExportNel::addNodeTracks (CAnimation& animation, INode& node, const char* if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -348,6 +351,7 @@ void CExportNel::addNodeTracks (CAnimation& animation, INode& node, const char* if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -371,6 +375,7 @@ void CExportNel::addNodeTracks (CAnimation& animation, INode& node, const char* if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -389,6 +394,7 @@ void CExportNel::addNodeTracks (CAnimation& animation, INode& node, const char* if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -413,6 +419,7 @@ void CExportNel::addNodeTracks (CAnimation& animation, INode& node, const char* if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -443,6 +450,7 @@ void CExportNel::addNodeTracks (CAnimation& animation, INode& node, const char* if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -541,7 +549,8 @@ void CExportNel::addLightTracks (NL3D::CAnimation& animation, INode& node, const { CExportDesc desc; - Object *obj = node.EvalWorldState(0).obj; + ObjectState os = node.EvalWorldState(0); + Object *obj = os.obj; // Check if there is an object if (!obj) @@ -567,6 +576,7 @@ void CExportNel::addLightTracks (NL3D::CAnimation& animation, INode& node, const if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -609,6 +619,7 @@ void CExportNel::addMorphTracks (NL3D::CAnimation& animation, INode& node, const if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -639,6 +650,7 @@ void CExportNel::addObjTracks (CAnimation& animation, Object& obj, const char* p if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -681,6 +693,7 @@ void CExportNel::addMtlTracks (CAnimation& animation, Mtl& mtl, const char* pare if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -705,6 +718,7 @@ void CExportNel::addMtlTracks (CAnimation& animation, Mtl& mtl, const char* pare if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -731,6 +745,7 @@ void CExportNel::addMtlTracks (CAnimation& animation, Mtl& mtl, const char* pare if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -755,6 +770,7 @@ void CExportNel::addMtlTracks (CAnimation& animation, Mtl& mtl, const char* pare if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -779,6 +795,7 @@ void CExportNel::addMtlTracks (CAnimation& animation, Mtl& mtl, const char* pare if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -862,6 +879,7 @@ void CExportNel::addTexTracks (CAnimation& animation, Texmap& tex, uint stage, c if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -884,6 +902,7 @@ void CExportNel::addTexTracks (CAnimation& animation, Texmap& tex, uint stage, c if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -906,6 +925,7 @@ void CExportNel::addTexTracks (CAnimation& animation, Texmap& tex, uint stage, c if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -928,6 +948,7 @@ void CExportNel::addTexTracks (CAnimation& animation, Texmap& tex, uint stage, c if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -950,6 +971,7 @@ void CExportNel::addTexTracks (CAnimation& animation, Texmap& tex, uint stage, c if (animation.getTrackByName (name.c_str())) { delete pTrack; + pTrack = NULL; } else { @@ -2319,7 +2341,7 @@ void CSSSBuild::compile(NL3D::CAnimation &dest, const char* sBaseName) { // no keys added delete finalTrack; - finalTrack= NULL; + finalTrack = NULL; } diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_collision.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_collision.cpp index b0264a8e9..e417539ce 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_collision.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_collision.cpp @@ -60,7 +60,8 @@ CCollisionMeshBuild* CExportNel::createCollisionMeshBuild(std::vector & for (node=0; nodeEvalWorldState(tvTime).obj; + ObjectState os = nodes[node]->EvalWorldState(tvTime); + Object *obj = os.obj; // Check if there is an object if (obj) @@ -70,72 +71,76 @@ CCollisionMeshBuild* CExportNel::createCollisionMeshBuild(std::vector & { // Get a triobject from the node TriObject *tri = (TriObject*)obj->ConvertToType(tvTime, Class_ID(TRIOBJ_CLASS_ID, 0)); - - // get the mesh name - uint meshId = rootMeshNames.size(); - rootMeshNames.push_back(nodes[node]->GetName()); - bool collision = getScriptAppData (nodes[node], NEL3D_APPDATA_COLLISION, 0) != 0; - bool exterior = getScriptAppData (nodes[node], NEL3D_APPDATA_COLLISION_EXTERIOR, 0) != 0; - - bool deleteIt=false; - if (collision) + + if (tri) { - // Note that the TriObject should only be deleted - // if the pointer to it is not equal to the object - // pointer that called ConvertToType() - if (obj != tri) - deleteIt = true; + // get the mesh name + uint meshId = rootMeshNames.size(); + rootMeshNames.push_back(nodes[node]->GetName()); + bool collision = getScriptAppData (nodes[node], NEL3D_APPDATA_COLLISION, 0) != 0; + bool exterior = getScriptAppData (nodes[node], NEL3D_APPDATA_COLLISION_EXTERIOR, 0) != 0; - uint i; - Mesh &mesh = tri->GetMesh(); - - // Get the object matrix - CMatrix ToWorldSpace; - Matrix3 verticesToWorld = nodes[node]->GetObjectTM(tvTime); - convertMatrix (ToWorldSpace, verticesToWorld); - - // Convert the vertices - for (i=0; i<(uint)mesh.numVerts; ++i) + bool deleteIt=false; + if (collision) { - Point3 v=mesh.verts[i]; - CVector vv=ToWorldSpace*CVector (v.x, v.y, v.z); - pCollisionMeshBuild->Vertices.push_back(vv); - rootMeshVertices.push_back(node); + // Note that the TriObject should only be deleted + // if the pointer to it is not equal to the object + // pointer that called ConvertToType() + if (obj != tri) + deleteIt = true; + + uint i; + Mesh &mesh = tri->GetMesh(); + + // Get the object matrix + CMatrix ToWorldSpace; + Matrix3 verticesToWorld = nodes[node]->GetObjectTM(tvTime); + convertMatrix (ToWorldSpace, verticesToWorld); + + // Convert the vertices + for (i=0; i<(uint)mesh.numVerts; ++i) + { + Point3 v=mesh.verts[i]; + CVector vv=ToWorldSpace*CVector (v.x, v.y, v.z); + pCollisionMeshBuild->Vertices.push_back(vv); + rootMeshVertices.push_back(node); + } + + uint maxMatId = 0; + + // Convert the faces + for (i=0; i<(uint)mesh.numFaces; ++i) + { + facesRootMeshesInfo.push_back(make_pair(meshId, i)); + + pCollisionMeshBuild->Faces.resize(pCollisionMeshBuild->Faces.size()+1); + pCollisionMeshBuild->Faces.back().V[0] = mesh.faces[i].v[0]+totalVertices; + pCollisionMeshBuild->Faces.back().V[1] = mesh.faces[i].v[1]+totalVertices; + pCollisionMeshBuild->Faces.back().V[2] = mesh.faces[i].v[2]+totalVertices; + + pCollisionMeshBuild->Faces.back().Visibility[0] = ((mesh.faces[i].flags & EDGE_B) != 0); + pCollisionMeshBuild->Faces.back().Visibility[1] = ((mesh.faces[i].flags & EDGE_C) != 0); + pCollisionMeshBuild->Faces.back().Visibility[2] = ((mesh.faces[i].flags & EDGE_A) != 0); + + uint32 maxMaterialId = mesh.faces[i].getMatID(); + if (!exterior && maxMaterialId > maxMatId) + maxMatId = maxMaterialId; + sint32 sid = (exterior) ? -1 : totalSurfaces+maxMaterialId; + + pCollisionMeshBuild->Faces.back().Surface = sid; + pCollisionMeshBuild->Faces.back().Material = maxMaterialId; + } + + totalVertices = pCollisionMeshBuild->Vertices.size(); + totalFaces = pCollisionMeshBuild->Faces.size(); + totalSurfaces += maxMatId+1; } - uint maxMatId = 0; + // Delete the triObject if we should... + if (deleteIt) + tri->MaybeAutoDelete(); - // Convert the faces - for (i=0; i<(uint)mesh.numFaces; ++i) - { - facesRootMeshesInfo.push_back(make_pair(meshId, i)); - - pCollisionMeshBuild->Faces.resize(pCollisionMeshBuild->Faces.size()+1); - pCollisionMeshBuild->Faces.back().V[0] = mesh.faces[i].v[0]+totalVertices; - pCollisionMeshBuild->Faces.back().V[1] = mesh.faces[i].v[1]+totalVertices; - pCollisionMeshBuild->Faces.back().V[2] = mesh.faces[i].v[2]+totalVertices; - - pCollisionMeshBuild->Faces.back().Visibility[0] = ((mesh.faces[i].flags & EDGE_B) != 0); - pCollisionMeshBuild->Faces.back().Visibility[1] = ((mesh.faces[i].flags & EDGE_C) != 0); - pCollisionMeshBuild->Faces.back().Visibility[2] = ((mesh.faces[i].flags & EDGE_A) != 0); - - uint32 maxMaterialId = mesh.faces[i].getMatID(); - if (!exterior && maxMaterialId > maxMatId) - maxMatId = maxMaterialId; - sint32 sid = (exterior) ? -1 : totalSurfaces+maxMaterialId; - - pCollisionMeshBuild->Faces.back().Surface = sid; - pCollisionMeshBuild->Faces.back().Material = maxMaterialId; - } - - totalVertices = pCollisionMeshBuild->Vertices.size(); - totalFaces = pCollisionMeshBuild->Faces.size(); - totalSurfaces += maxMatId+1; } - - // Delete the triObject if we should... - if (deleteIt) - tri->DeleteMe(); } } } @@ -436,6 +441,7 @@ void CExportNel::computeCollisionRetrieverFromScene(TimeValue time, // free the CCollisionMeshBuild. delete pCmb; + pCmb = NULL; // does igname match prefix/suffix??? if(igname.find(igNamePrefix)==0) diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_light.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_light.cpp index 14b38ad78..9bda607bb 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_light.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_light.cpp @@ -200,7 +200,8 @@ void CExportNel::getLights (std::vector& vectLight, TimeValue time, INod node=_Ip->GetRootNode(); // Get a pointer on the object's node - Object *obj = node->EvalWorldState(time).obj; + ObjectState os = node->EvalWorldState(time); + Object *obj = os.obj; // Check if there is an object if (obj) @@ -235,9 +236,9 @@ void CExportNel::getLights (std::vector& vectLight, TimeValue time, INod // Add the light in the list vectLight.push_back (nelLight); - // Delete the triObject if we should... + // Delete the GenLight if we should... if (deleteIt) - maxLight->DeleteMe(); + maxLight->MaybeAutoDelete(); } } diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_lod_character.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_lod_character.cpp index baccbe17b..40cdbf1e6 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_lod_character.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_lod_character.cpp @@ -43,7 +43,8 @@ bool CExportNel::buildLodCharacter (NL3D::CLodCharacterShapeBuild& lodBuild, IN return false; // Get a pointer on the object's node - Object *obj = node.EvalWorldState(time).obj; + ObjectState os = node.EvalWorldState(time); + Object *obj = os.obj; // Check if there is an object if (obj) @@ -55,129 +56,131 @@ bool CExportNel::buildLodCharacter (NL3D::CLodCharacterShapeBuild& lodBuild, IN { // Get a triobject from the node TriObject *tri = (TriObject *) obj->ConvertToType(time, Class_ID(TRIOBJ_CLASS_ID, 0)); + if (tri) + { + // Note that the TriObject should only be deleted + // if the pointer to it is not equal to the object + // pointer that called ConvertToType() + bool deleteIt=false; + if (obj != tri) + deleteIt = true; - // Note that the TriObject should only be deleted - // if the pointer to it is not equal to the object - // pointer that called ConvertToType() - bool deleteIt=false; - if (obj != tri) - deleteIt = true; - - // Get the node matrix - Matrix3 nodeMatrixMax; - CMatrix nodeMatrix; - getLocalMatrix (nodeMatrixMax, node, time); - convertMatrix (nodeMatrix, nodeMatrixMax); + // Get the node matrix + Matrix3 nodeMatrixMax; + CMatrix nodeMatrix; + getLocalMatrix (nodeMatrixMax, node, time); + convertMatrix (nodeMatrix, nodeMatrixMax); - // build the shape - { - // Array of name for the material - CMaxMeshBaseBuild maxBaseBuild; + // build the shape + { + // Array of name for the material + CMaxMeshBaseBuild maxBaseBuild; - // Fill the build interface of CMesh - CMeshBase::CMeshBaseBuild buildBaseMesh; - buildBaseMeshInterface (buildBaseMesh, maxBaseBuild, node, time, nodeMatrix); + // Fill the build interface of CMesh + CMeshBase::CMeshBaseBuild buildBaseMesh; + buildBaseMeshInterface (buildBaseMesh, maxBaseBuild, node, time, nodeMatrix); - CMesh::CMeshBuild buildMesh; - buildMeshInterface (*tri, buildMesh, buildBaseMesh, maxBaseBuild, node, time, nodeMap); + CMesh::CMeshBuild buildMesh; + buildMeshInterface (*tri, buildMesh, buildBaseMesh, maxBaseBuild, node, time, nodeMap); - /* Build a mesh. (duplicate UV/normals) - Use a CMeshMRM for an historic reason: simpler because don't use "matrix blocks". - */ - CMRMParameters mrmParams; - CMeshMRM meshMRM; - // To avoid heavy MRM compute, ask for only one lod (=> no poly reduction) - mrmParams.Divisor= 1; - mrmParams.NLods= 1; - meshMRM.build (buildBaseMesh, buildMesh, std::vector(), mrmParams); - const CMeshMRMGeom &meshMRMGeom= meshMRM.getMeshGeom(); - nlassert(meshMRMGeom.getNbLod()==1); + /* Build a mesh. (duplicate UV/normals) + Use a CMeshMRM for an historic reason: simpler because don't use "matrix blocks". + */ + CMRMParameters mrmParams; + CMeshMRM meshMRM; + // To avoid heavy MRM compute, ask for only one lod (=> no poly reduction) + mrmParams.Divisor= 1; + mrmParams.NLods= 1; + meshMRM.build (buildBaseMesh, buildMesh, std::vector(), mrmParams); + const CMeshMRMGeom &meshMRMGeom= meshMRM.getMeshGeom(); + nlassert(meshMRMGeom.getNbLod()==1); - // Build the lodBuild with the mesh - const CVertexBuffer &VB= meshMRMGeom.getVertexBuffer(); - uint32 format= VB.getVertexFormat(); - uint numVerts= VB.getNumVertices(); + // Build the lodBuild with the mesh + const CVertexBuffer &VB= meshMRMGeom.getVertexBuffer(); + uint32 format= VB.getVertexFormat(); + uint numVerts= VB.getNumVertices(); - // The mesh must have at least skinning. - if( (format & CVertexBuffer::PositionFlag) && meshMRMGeom.isSkinned() ) - { - uint i; - CVertexBufferRead vba; - VB.lock (vba); - - // build vertices and skinWeights - lodBuild.Vertices.resize(numVerts); - for(i=0;i triangleSelection; - lodBuild.TriangleIndices.resize(buildMesh.Faces.size() * 3); - triangleSelection.resize(buildMesh.Faces.size(), false); - uint dstTriIdx= 0; - for(i=0;i0;--n) - *(dst++)=*(src++); + for(i=0;i triangleSelection; + lodBuild.TriangleIndices.resize(buildMesh.Faces.size() * 3); + triangleSelection.resize(buildMesh.Faces.size(), false); + uint dstTriIdx= 0; + for(i=0;i0;--n) + *(dst++)=*(src++); + } + // if the material of this pass is the 0th material, flag tris for TextureInfo selection + if(meshMRMGeom.getRdrPassMaterial(0,i)==0) + { + for(uint tri= dstTriIdx/3; triDeleteMe(); + // Delete the triObject if we should... + if (deleteIt) + tri->MaybeAutoDelete(); + } } } diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_material.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_material.cpp index 5d67684cb..640cf8a19 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_material.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_material.cpp @@ -1294,6 +1294,7 @@ ITexture* CExportNel::buildATexture (Texmap& texmap, CMaterialDesc &remap3dsTexC // Ok, good texture pTexture=pTextureCube; delete srcTex; + srcTex = NULL; } else { diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_mesh.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_mesh.cpp index afa742b61..aad5ee1b9 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_mesh.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_mesh.cpp @@ -68,7 +68,8 @@ CMesh::CMeshBuild* CExportNel::createMeshBuild(INode& node, TimeValue tvTime, CM baseBuild = new CMeshBase::CMeshBaseBuild(); // Get a pointer on the object's node - Object *obj = node.EvalWorldState(tvTime).obj; + ObjectState os = node.EvalWorldState(tvTime); + Object *obj = os.obj; // Check if there is an object if (obj) @@ -79,35 +80,39 @@ CMesh::CMeshBuild* CExportNel::createMeshBuild(INode& node, TimeValue tvTime, CM { // Get a triobject from the node TriObject *tri = (TriObject*)obj->ConvertToType(tvTime, Class_ID(TRIOBJ_CLASS_ID, 0)); + if (tri) + { - // Note that the TriObject should only be deleted - // if the pointer to it is not equal to the object - // pointer that called ConvertToType() - bool deleteIt=false; - if (obj != tri) - deleteIt = true; + // Note that the TriObject should only be deleted + // if the pointer to it is not equal to the object + // pointer that called ConvertToType() + bool deleteIt=false; + if (obj != tri) + deleteIt = true; - // Description of materials - CMaxMeshBaseBuild maxBaseBuild; + // Description of materials + CMaxMeshBaseBuild maxBaseBuild; - // Fill the build interface of CMesh + // Fill the build interface of CMesh - // Reset the material array of the buildMesh because it will be rebuild by the exporter - baseBuild->Materials.clear(); + // Reset the material array of the buildMesh because it will be rebuild by the exporter + baseBuild->Materials.clear(); - // Get the node matrix - Matrix3 nodeMatrixMax; - CMatrix nodeMatrix; - getLocalMatrix (nodeMatrixMax, node, tvTime); - convertMatrix (nodeMatrix, nodeMatrixMax); + // Get the node matrix + Matrix3 nodeMatrixMax; + CMatrix nodeMatrix; + getLocalMatrix (nodeMatrixMax, node, tvTime); + convertMatrix (nodeMatrix, nodeMatrixMax); - buildBaseMeshInterface (*baseBuild, maxBaseBuild, node, tvTime, nodeMatrix); - buildMeshInterface (*tri, *pMeshBuild, *baseBuild, maxBaseBuild, node, tvTime, NULL, CMatrix::Identity, masterNodeMat, isMorphTarget); - + buildBaseMeshInterface (*baseBuild, maxBaseBuild, node, tvTime, nodeMatrix); + buildMeshInterface (*tri, *pMeshBuild, *baseBuild, maxBaseBuild, node, tvTime, NULL, CMatrix::Identity, masterNodeMat, isMorphTarget); + - // Delete the triObject if we should... - if (deleteIt) - tri->DeleteMe(); + // Delete the triObject if we should... + if (deleteIt) + tri->MaybeAutoDelete(); + tri = NULL; + } } } @@ -126,7 +131,7 @@ static void copyMultiLodMeshBaseLod0Infos(CMeshBase::CMeshBaseBuild &dst, const // *************************************************************************** // Export a mesh -IShape* CExportNel::buildShape (INode& node, TimeValue time, const TInodePtrInt *nodeMap, bool buildLods) +NLMISC::CSmartPtr CExportNel::buildShape (INode& node, TimeValue time, const TInodePtrInt *nodeMap, bool buildLods) { // Is this a multi lod object ? @@ -134,14 +139,15 @@ IShape* CExportNel::buildShape (INode& node, TimeValue time, const TInodePtrInt // Here, we must check what kind of node we can build with this mesh. // For the time, just Triobj is supported. - IShape *retShape=NULL; + CSmartPtr retShape = NULL; // If skinning, disable skin modifier if (nodeMap) enableSkinModifier (node, false); // Get a pointer on the object's node - Object *obj = node.EvalWorldState(time).obj; + ObjectState os = node.EvalWorldState(time); + Object *obj = os.obj; // Check if there is an object if (obj) @@ -184,264 +190,269 @@ IShape* CExportNel::buildShape (INode& node, TimeValue time, const TInodePtrInt // Get a triobject from the node TriObject *tri = (TriObject *) obj->ConvertToType(time, Class_ID(TRIOBJ_CLASS_ID, 0)); - // Note that the TriObject should only be deleted - // if the pointer to it is not equal to the object - // pointer that called ConvertToType() - bool deleteIt=false; - if (obj != tri) - deleteIt = true; - - if (hasWaterMaterial(node, time)) // is this a water shape ? + if (tri) { - retShape = buildWaterShape(node, time); - } - else - { - // Mesh base ? - CMeshBase *meshBase; + // Note that the TriObject should only be deleted + // if the pointer to it is not equal to the object + // pointer that called ConvertToType() + bool deleteIt=false; + if (obj != tri) + deleteIt = true; - // Get the node matrix - Matrix3 nodeMatrixMax; - CMatrix nodeMatrix; - getLocalMatrix (nodeMatrixMax, node, time); - convertMatrix (nodeMatrix, nodeMatrixMax); - - // Is a multi lod object ? - uint lodCount=getScriptAppData (&node, NEL3D_APPDATA_LOD_NAME_COUNT, 0); - if (lodCount && buildLods) + if (hasWaterMaterial(node, time)) // is this a water shape ? { - // This is a multilod object - multiLodObject = true; + retShape = buildWaterShape(node, time); + } + else + { + // Mesh base ? + CSmartPtr meshBase = NULL; - // Listy of material names - std::vector listMaterialName; + // Get the node matrix + Matrix3 nodeMatrixMax; + CMatrix nodeMatrix; + getLocalMatrix (nodeMatrixMax, node, time); + convertMatrix (nodeMatrix, nodeMatrixMax); - // Make the root mesh - CMeshMultiLod::CMeshMultiLodBuild multiLodBuild; - multiLodBuild.LodMeshes.reserve (lodCount+1); - - // Resize to one - bool isTransparent; - bool isOpaque; - multiLodBuild.LodMeshes.resize (1); - multiLodBuild.LodMeshes[0].MeshGeom=buildMeshGeom (node, time, nodeMap, multiLodBuild.BaseMesh, - listMaterialName, isTransparent, isOpaque, nodeMatrix); - multiLodBuild.LodMeshes[0].DistMax=getScriptAppData (&node, NEL3D_APPDATA_LOD_DIST_MAX, NEL3D_APPDATA_LOD_DIST_MAX_DEFAULT); - multiLodBuild.LodMeshes[0].BlendLength=getScriptAppData (&node, NEL3D_APPDATA_LOD_BLEND_LENGTH, NEL3D_APPDATA_LOD_BLEND_LENGTH_DEFAULT); - multiLodBuild.LodMeshes[0].Flags=0; - if (getScriptAppData (&node, NEL3D_APPDATA_LOD_BLEND_IN, NEL3D_APPDATA_LOD_BLEND_IN_DEFAULT)) - multiLodBuild.LodMeshes[0].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::BlendIn; - if (getScriptAppData (&node, NEL3D_APPDATA_LOD_BLEND_OUT, NEL3D_APPDATA_LOD_BLEND_OUT_DEFAULT)) - multiLodBuild.LodMeshes[0].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::BlendOut; - if ((getScriptAppData (&node, NEL3D_APPDATA_LOD_COARSE_MESH, NEL3D_APPDATA_LOD_COARSE_MESH_DEFAULT)) && (!_View)) - multiLodBuild.LodMeshes[0].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::CoarseMesh; - if (isTransparent) - multiLodBuild.LodMeshes[0].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::IsTransparent; - if (isOpaque) - multiLodBuild.LodMeshes[0].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::IsOpaque; - multiLodBuild.StaticLod=getScriptAppData (&node, NEL3D_APPDATA_LOD_DYNAMIC_MESH, NEL3D_APPDATA_LOD_DYNAMIC_MESH_DEFAULT)==0; - - // Bacup scale, rot and pos, etc... - CMeshBase::CMeshBaseBuild bkupMeshBase; - copyMultiLodMeshBaseLod0Infos(bkupMeshBase, multiLodBuild.BaseMesh); - - // Build a world to local matrix - CMatrix worldToNodeMatrix; - - // Is first slot is skinned ? - INode *rootSkel=getSkeletonRootBone (node); - - // For all the other lods - for (uint lod=0; lodGetINodeByName(nodeName.c_str()); - if (lodNode) + // Listy of material names + std::vector listMaterialName; + + // Make the root mesh + CMeshMultiLod::CMeshMultiLodBuild multiLodBuild; + multiLodBuild.LodMeshes.reserve (lodCount+1); + + // Resize to one + bool isTransparent; + bool isOpaque; + multiLodBuild.LodMeshes.resize (1); + multiLodBuild.LodMeshes[0].MeshGeom=buildMeshGeom (node, time, nodeMap, multiLodBuild.BaseMesh, + listMaterialName, isTransparent, isOpaque, nodeMatrix); + multiLodBuild.LodMeshes[0].DistMax=getScriptAppData (&node, NEL3D_APPDATA_LOD_DIST_MAX, NEL3D_APPDATA_LOD_DIST_MAX_DEFAULT); + multiLodBuild.LodMeshes[0].BlendLength=getScriptAppData (&node, NEL3D_APPDATA_LOD_BLEND_LENGTH, NEL3D_APPDATA_LOD_BLEND_LENGTH_DEFAULT); + multiLodBuild.LodMeshes[0].Flags=0; + if (getScriptAppData (&node, NEL3D_APPDATA_LOD_BLEND_IN, NEL3D_APPDATA_LOD_BLEND_IN_DEFAULT)) + multiLodBuild.LodMeshes[0].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::BlendIn; + if (getScriptAppData (&node, NEL3D_APPDATA_LOD_BLEND_OUT, NEL3D_APPDATA_LOD_BLEND_OUT_DEFAULT)) + multiLodBuild.LodMeshes[0].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::BlendOut; + if ((getScriptAppData (&node, NEL3D_APPDATA_LOD_COARSE_MESH, NEL3D_APPDATA_LOD_COARSE_MESH_DEFAULT)) && (!_View)) + multiLodBuild.LodMeshes[0].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::CoarseMesh; + if (isTransparent) + multiLodBuild.LodMeshes[0].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::IsTransparent; + if (isOpaque) + multiLodBuild.LodMeshes[0].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::IsOpaque; + multiLodBuild.StaticLod=getScriptAppData (&node, NEL3D_APPDATA_LOD_DYNAMIC_MESH, NEL3D_APPDATA_LOD_DYNAMIC_MESH_DEFAULT)==0; + + // Bacup scale, rot and pos, etc... + CMeshBase::CMeshBaseBuild bkupMeshBase; + copyMultiLodMeshBaseLod0Infos(bkupMeshBase, multiLodBuild.BaseMesh); + + // Build a world to local matrix + CMatrix worldToNodeMatrix; + + // Is first slot is skinned ? + INode *rootSkel=getSkeletonRootBone (node); + + // For all the other lods + for (uint lod=0; lodGetNodeTM (time)); - - // Get the parent matrix - CMatrix parentMatrix; - if (rootSkel) + // Get the node + INode *lodNode=_Ip->GetINodeByName(nodeName.c_str()); + if (lodNode) { - // Yes.. - CMatrix tmp; - convertMatrix (tmp, rootSkel->GetNodeTM (time)); - parentMatrix=nodeTM; + // Index of the lod in the build structure + uint index=multiLodBuild.LodMeshes.size(); + + // Resize the build structure + multiLodBuild.LodMeshes.resize (index+1); + + // Get matrix node + CMatrix nodeTM; + convertMatrix (nodeTM, lodNode->GetNodeTM (time)); + + // Get the parent matrix + CMatrix parentMatrix; + if (rootSkel) + { + // Yes.. + CMatrix tmp; + convertMatrix (tmp, rootSkel->GetNodeTM (time)); + parentMatrix=nodeTM; + } + else + { + buildNeLMatrix (parentMatrix, bkupMeshBase.DefaultScale, bkupMeshBase.DefaultRotQuat, bkupMeshBase.DefaultPos); + } + + // Fill the structure + multiLodBuild.LodMeshes[index].MeshGeom=buildMeshGeom (*lodNode, time, nodeMap, multiLodBuild.BaseMesh, + listMaterialName, isTransparent, isOpaque, parentMatrix); + multiLodBuild.LodMeshes[index].DistMax=getScriptAppData (lodNode, NEL3D_APPDATA_LOD_DIST_MAX, NEL3D_APPDATA_LOD_DIST_MAX_DEFAULT); + multiLodBuild.LodMeshes[index].BlendLength=getScriptAppData (lodNode, NEL3D_APPDATA_LOD_BLEND_LENGTH, NEL3D_APPDATA_LOD_BLEND_LENGTH_DEFAULT); + multiLodBuild.LodMeshes[index].Flags=0; + if (getScriptAppData (lodNode, NEL3D_APPDATA_LOD_BLEND_IN, NEL3D_APPDATA_LOD_BLEND_IN_DEFAULT)) + multiLodBuild.LodMeshes[index].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::BlendIn; + if (getScriptAppData (lodNode, NEL3D_APPDATA_LOD_BLEND_OUT, NEL3D_APPDATA_LOD_BLEND_OUT_DEFAULT)) + multiLodBuild.LodMeshes[index].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::BlendOut; + if ((getScriptAppData (lodNode, NEL3D_APPDATA_LOD_COARSE_MESH, NEL3D_APPDATA_LOD_COARSE_MESH_DEFAULT)) && (!_View)) + multiLodBuild.LodMeshes[index].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::CoarseMesh; + if (isTransparent) + multiLodBuild.LodMeshes[index].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::IsTransparent; + if (isOpaque) + multiLodBuild.LodMeshes[index].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::IsOpaque; + } + } + + // Restaure default pos, scale and rot, etc... + copyMultiLodMeshBaseLod0Infos(multiLodBuild.BaseMesh, bkupMeshBase); + + + // Make a CMeshMultiLod mesh object + CMeshMultiLod *multiMesh = new CMeshMultiLod; + ++multiMesh->crefs; // hack + + // Build it + multiMesh->build(multiLodBuild); + + // Return this pointer + meshBase = multiMesh; + + // ** force material to be animatable + if (CExportNel::getScriptAppData (&node, NEL3D_APPDATA_EXPORT_ANIMATED_MATERIALS, 0) != 0) + { + /// todo hulud: check if material are animated before + for (uint i=0; isetAnimatedMaterial (i, listMaterialName[i]); + } + } + } + else + { + // Array of name for the material + CMaxMeshBaseBuild maxBaseBuild; + + // Fill the build interface of CMesh + CMeshBase::CMeshBaseBuild buildBaseMesh; + buildBaseMeshInterface (buildBaseMesh, maxBaseBuild, node, time, nodeMatrix); + + CMesh::CMeshBuild buildMesh; + buildMeshInterface (*tri, buildMesh, buildBaseMesh, maxBaseBuild, node, time, nodeMap); + + if( hasLightMap( node, time ) && _Options.bExportLighting ) + calculateLM(&buildMesh, &buildBaseMesh, node, time, maxBaseBuild.FirstMaterial, _Options.OutputLightmapLog); + + // optimized materials remap + std::vector materialRemap; + + // MRM mesh ? + if (getScriptAppData (&node, NEL3D_APPDATA_LOD_MRM, 0)) + { + // Build a MRM parameters block + CMRMParameters parameters; + buildMRMParameters (node, parameters); + + // Get the blend shapes that can be linked + std::vector bsList; + getBSMeshBuild (bsList, node, time, nodeMap!=NULL); + + // CMeshMRM or CMeshMRMSkinned ? + + /* + * Here, export plugin choose between CMeshMRM and CMeshMRMSkinned + */ + if (CMeshMRMSkinned::isCompatible(buildMesh) && bsList.empty()) + { + // Make a CMesh object + CMeshMRMSkinned* meshMRMSkinned=new CMeshMRMSkinned; + + // Build the mesh with the build interface + meshMRMSkinned->build (buildBaseMesh, buildMesh, parameters); + + // optimize number of material + meshMRMSkinned->optimizeMaterialUsage(materialRemap); + + // Return this pointer + meshBase=meshMRMSkinned; } else { - buildNeLMatrix (parentMatrix, bkupMeshBase.DefaultScale, bkupMeshBase.DefaultRotQuat, bkupMeshBase.DefaultPos); + // Make a CMesh object + CMeshMRM* meshMRM=new CMeshMRM; + + // Build the mesh with the build interface + meshMRM->build (buildBaseMesh, buildMesh, bsList, parameters); + + // optimize number of material + meshMRM->optimizeMaterialUsage(materialRemap); + + // Return this pointer + meshBase=meshMRM; } - - // Fill the structure - multiLodBuild.LodMeshes[index].MeshGeom=buildMeshGeom (*lodNode, time, nodeMap, multiLodBuild.BaseMesh, - listMaterialName, isTransparent, isOpaque, parentMatrix); - multiLodBuild.LodMeshes[index].DistMax=getScriptAppData (lodNode, NEL3D_APPDATA_LOD_DIST_MAX, NEL3D_APPDATA_LOD_DIST_MAX_DEFAULT); - multiLodBuild.LodMeshes[index].BlendLength=getScriptAppData (lodNode, NEL3D_APPDATA_LOD_BLEND_LENGTH, NEL3D_APPDATA_LOD_BLEND_LENGTH_DEFAULT); - multiLodBuild.LodMeshes[index].Flags=0; - if (getScriptAppData (lodNode, NEL3D_APPDATA_LOD_BLEND_IN, NEL3D_APPDATA_LOD_BLEND_IN_DEFAULT)) - multiLodBuild.LodMeshes[index].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::BlendIn; - if (getScriptAppData (lodNode, NEL3D_APPDATA_LOD_BLEND_OUT, NEL3D_APPDATA_LOD_BLEND_OUT_DEFAULT)) - multiLodBuild.LodMeshes[index].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::BlendOut; - if ((getScriptAppData (lodNode, NEL3D_APPDATA_LOD_COARSE_MESH, NEL3D_APPDATA_LOD_COARSE_MESH_DEFAULT)) && (!_View)) - multiLodBuild.LodMeshes[index].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::CoarseMesh; - if (isTransparent) - multiLodBuild.LodMeshes[index].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::IsTransparent; - if (isOpaque) - multiLodBuild.LodMeshes[index].Flags|=CMeshMultiLod::CMeshMultiLodBuild::CBuildSlot::IsOpaque; - } - } - - // Restaure default pos, scale and rot, etc... - copyMultiLodMeshBaseLod0Infos(multiLodBuild.BaseMesh, bkupMeshBase); - - - // Make a CMeshMultiLod mesh object - CMeshMultiLod* multiMesh=new CMeshMultiLod; - - // Build it - multiMesh->build (multiLodBuild); - - // Return this pointer - meshBase=multiMesh; - - // ** force material to be animatable - if (CExportNel::getScriptAppData (&node, NEL3D_APPDATA_EXPORT_ANIMATED_MATERIALS, 0) != 0) - { - /// todo hulud: check if material are animated before - for (uint i=0; isetAnimatedMaterial (i, listMaterialName[i]); - } - } - } - else - { - // Array of name for the material - CMaxMeshBaseBuild maxBaseBuild; - - // Fill the build interface of CMesh - CMeshBase::CMeshBaseBuild buildBaseMesh; - buildBaseMeshInterface (buildBaseMesh, maxBaseBuild, node, time, nodeMatrix); - - CMesh::CMeshBuild buildMesh; - buildMeshInterface (*tri, buildMesh, buildBaseMesh, maxBaseBuild, node, time, nodeMap); - - if( hasLightMap( node, time ) && _Options.bExportLighting ) - calculateLM(&buildMesh, &buildBaseMesh, node, time, maxBaseBuild.FirstMaterial, _Options.OutputLightmapLog); - - // optimized materials remap - std::vector materialRemap; - - // MRM mesh ? - if (getScriptAppData (&node, NEL3D_APPDATA_LOD_MRM, 0)) - { - // Build a MRM parameters block - CMRMParameters parameters; - buildMRMParameters (node, parameters); - - // Get the blend shapes that can be linked - std::vector bsList; - getBSMeshBuild (bsList, node, time, nodeMap!=NULL); - - // CMeshMRM or CMeshMRMSkinned ? - - /* - * Here, export plugin choose between CMeshMRM and CMeshMRMSkinned - */ - if (CMeshMRMSkinned::isCompatible(buildMesh) && bsList.empty()) - { - // Make a CMesh object - CMeshMRMSkinned* meshMRMSkinned=new CMeshMRMSkinned; - - // Build the mesh with the build interface - meshMRMSkinned->build (buildBaseMesh, buildMesh, parameters); - - // optimize number of material - meshMRMSkinned->optimizeMaterialUsage(materialRemap); - - // Return this pointer - meshBase=meshMRMSkinned; } else { // Make a CMesh object - CMeshMRM* meshMRM=new CMeshMRM; + CMesh* mesh=new CMesh; // Build the mesh with the build interface - meshMRM->build (buildBaseMesh, buildMesh, bsList, parameters); + mesh->build (buildBaseMesh, buildMesh); + + // Must be done after the build to update vertex links + // Pass to buildMeshMorph if the original mesh is skinned or not + buildMeshMorph (buildMesh, node, time, nodeMap!=NULL); + mesh->setBlendShapes (buildMesh.BlendShapes); // optimize number of material - meshMRM->optimizeMaterialUsage(materialRemap); + mesh->optimizeMaterialUsage(materialRemap); // Return this pointer - meshBase=meshMRM; + meshBase=mesh; + } + + // Animate materials (must do it after optimizeMaterialUsage()); + if (CExportNel::getScriptAppData (&node, NEL3D_APPDATA_EXPORT_ANIMATED_MATERIALS, 0) != 0) + { + for (uint i=0; i=0) + // animate it + meshBase->setAnimatedMaterial (dstMatId, matName); + } } } - else + + // check wether this mesh is auto-animated. Force to false if in view mode + if ( !_View && (CExportNel::getScriptAppData (&node, NEL3D_APPDATA_AUTOMATIC_ANIMATION, 0) != 0) ) { - // Make a CMesh object - CMesh* mesh=new CMesh; - - // Build the mesh with the build interface - mesh->build (buildBaseMesh, buildMesh); - - // Must be done after the build to update vertex links - // Pass to buildMeshMorph if the original mesh is skinned or not - buildMeshMorph (buildMesh, node, time, nodeMap!=NULL); - mesh->setBlendShapes (buildMesh.BlendShapes); - - // optimize number of material - mesh->optimizeMaterialUsage(materialRemap); - - // Return this pointer - meshBase=mesh; + // yes, it is + meshBase->setAutoAnim(true); } - // Animate materials (must do it after optimizeMaterialUsage()); - if (CExportNel::getScriptAppData (&node, NEL3D_APPDATA_EXPORT_ANIMATED_MATERIALS, 0) != 0) - { - for (uint i=0; i=0) - // animate it - meshBase->setAnimatedMaterial (dstMatId, matName); - } - } + // Return the mesh base + retShape = meshBase; } - // check wether this mesh is auto-animated. Force to false if in view mode - if ( !_View && (CExportNel::getScriptAppData (&node, NEL3D_APPDATA_AUTOMATIC_ANIMATION, 0) != 0) ) - { - // yes, it is - meshBase->setAutoAnim(true); - } - - // Return the mesh base - retShape=meshBase; + // Delete the triObject if we should... + if (deleteIt) + tri->MaybeAutoDelete(); + tri = NULL; } - - // Delete the triObject if we should... - if (deleteIt) - tri->DeleteMe(); } } @@ -450,7 +461,7 @@ IShape* CExportNel::buildShape (INode& node, TimeValue time, const TInodePtrInt enableSkinModifier (node, true); // Set the dist max for this shape - if (retShape && !multiLodObject && buildLods) + if (retShape.getPtr() && !multiLodObject && buildLods) { // Get the dist max for this node float distmax = getScriptAppData (&node, NEL3D_APPDATA_LOD_DIST_MAX, NEL3D_APPDATA_LOD_DIST_MAX_DEFAULT); @@ -1173,6 +1184,7 @@ void CExportNel::getBSMeshBuild (std::vector &bsList, INode CMeshBase::CMeshBaseBuild *dummyMBB = NULL; std::auto_ptr baseMB(createMeshBuild (node, time, dummyMBB, finalSpace)); delete dummyMBB; + dummyMBB = NULL; if (baseMB.get() == NULL) return; j = 0; @@ -1184,7 +1196,7 @@ void CExportNel::getBSMeshBuild (std::vector &bsList, INode ++j; } - bsList.resize (j); + bsList.resize(j, NULL); j = 0; for (i = 0; i < 100; ++i) @@ -1198,6 +1210,7 @@ void CExportNel::getBSMeshBuild (std::vector &bsList, INode // get the meshbuild of the morhp target bsList[j] = createMeshBuild (*pNode, time, pMBB, finalSpace, true); delete pMBB; + pMBB = NULL; // copy src normals from src mesh for vertices that are on interfaces CMesh::CMeshBuild *mb = bsList[j]; if (mb) @@ -1281,7 +1294,8 @@ IMeshGeom *CExportNel::buildMeshGeom (INode& node, TimeValue time, const TInodeP enableSkinModifier (node, false); // Get a pointer on the object's node - Object *obj = node.EvalWorldState(time).obj; + ObjectState os = node.EvalWorldState(time); + Object *obj = os.obj; // Check if there is an object if (obj) @@ -1291,104 +1305,111 @@ IMeshGeom *CExportNel::buildMeshGeom (INode& node, TimeValue time, const TInodeP { // Get a triobject from the node TriObject *tri = (TriObject *) obj->ConvertToType(time, Class_ID(TRIOBJ_CLASS_ID, 0)); - - // Note that the TriObject should only be deleted - // if the pointer to it is not equal to the object - // pointer that called ConvertToType() - bool deleteIt=false; - if (obj != tri) - deleteIt = true; - - // Coarse mesh ? - bool coarseMesh=(getScriptAppData (&node, NEL3D_APPDATA_LOD_COARSE_MESH, 0)!=0) && (!_View); - - // No skeleton shape - if (coarseMesh) - nodeMap=NULL; - - // Array of name for the material - CMaxMeshBaseBuild maxBaseBuild; - - // Append material to the base - buildBaseMeshInterface (buildBaseMesh, maxBaseBuild, node, time, parentMatrix); - - // Get the node matrix - Matrix3 nodeMatrixMax; - CMatrix nodeMatrix; - getLocalMatrix (nodeMatrixMax, node, time); - convertMatrix (nodeMatrix, nodeMatrixMax); - - // Get the node to parent matrix - CMatrix nodeToParentMatrix; - nodeToParentMatrix = parentMatrix.inverted () * nodeMatrix; - - // Fill the build interface of CMesh - CMesh::CMeshBuild buildMesh; - buildMeshInterface (*tri, buildMesh, buildBaseMesh, maxBaseBuild, node, time, nodeMap, nodeToParentMatrix); - - // Append material names - isTransparent=false; - isOpaque=false; - for (uint i=0; i bsList; - getBSMeshBuild (bsList, node, time, nodeMap!=NULL); - - // Build the mesh with the build interface - meshMRMGeom->build (buildMesh, bsList, buildBaseMesh.Materials.size(), parameters); - - // Return this pointer - meshGeom=meshMRMGeom; - - for (uint32 bsListIt = 0; bsListIt < bsList.size(); ++bsListIt) - delete bsList[bsListIt]; - } - else - { - // Make a CMesh object - CMeshGeom* mGeom=new CMeshGeom; + // Note that the TriObject should only be deleted + // if the pointer to it is not equal to the object + // pointer that called ConvertToType() + bool deleteIt = (obj != tri); // Coarse mesh ? + bool coarseMesh=(getScriptAppData (&node, NEL3D_APPDATA_LOD_COARSE_MESH, 0)!=0) && (!_View); + + // No skeleton shape if (coarseMesh) + nodeMap=NULL; + + // Array of name for the material + CMaxMeshBaseBuild maxBaseBuild; + + // Append material to the base + buildBaseMeshInterface (buildBaseMesh, maxBaseBuild, node, time, parentMatrix); + + // Get the node matrix + Matrix3 nodeMatrixMax; + CMatrix nodeMatrix; + getLocalMatrix (nodeMatrixMax, node, time); + convertMatrix (nodeMatrix, nodeMatrixMax); + + // Get the node to parent matrix + CMatrix nodeToParentMatrix; + nodeToParentMatrix = parentMatrix.inverted () * nodeMatrix; + + // Fill the build interface of CMesh + CMesh::CMeshBuild buildMesh; + buildMeshInterface (*tri, buildMesh, buildBaseMesh, maxBaseBuild, node, time, nodeMap, nodeToParentMatrix); + + // Append material names + isTransparent=false; + isOpaque=false; + for (uint i=0; ibuild (buildMesh, buildBaseMesh.Materials.size()); + if( hasLightMap( node, time ) && _Options.bExportLighting ) + calculateLM(&buildMesh, &buildBaseMesh, node, time, maxBaseBuild.FirstMaterial, _Options.OutputLightmapLog); - // Return this pointer - meshGeom=mGeom; + // MRM mesh ? + if (getScriptAppData (&node, NEL3D_APPDATA_LOD_MRM, 0) && (!coarseMesh) ) + { + // Build a MRM parameters block + CMRMParameters parameters; + buildMRMParameters (node, parameters); + + // Make a CMesh object + CMeshMRMGeom* meshMRMGeom=new CMeshMRMGeom; + + // Get the blend shapes but in mesh build form + std::vector bsList; + getBSMeshBuild (bsList, node, time, nodeMap!=NULL); + + // Build the mesh with the build interface + meshMRMGeom->build (buildMesh, bsList, buildBaseMesh.Materials.size(), parameters); + + // Return this pointer + meshGeom=meshMRMGeom; + + #ifdef NL_DONT_FIND_MAX_CRASH + for (uint32 bsListIt = 0; bsListIt < bsList.size(); ++bsListIt) + { + delete bsList[bsListIt]; + bsList[bsListIt] = NULL; + } + #endif + } + else + { + // Make a CMesh object + CMeshGeom* mGeom=new CMeshGeom; + + // Coarse mesh ? + if (coarseMesh) + { + // Force vertex format + buildMesh.VertexFlags=NL3D_COARSEMESH_VERTEX_FORMAT_EXPORT; + } + + // Build the mesh with the build interface + mGeom->build(buildMesh, buildBaseMesh.Materials.size()); + + // Return this pointer + meshGeom=mGeom; + } + + // Delete the triObject if we should... + if (deleteIt) + tri->MaybeAutoDelete(); + tri = NULL; } - - // Delete the triObject if we should... - if (deleteIt) - tri->DeleteMe(); } } @@ -1397,7 +1418,7 @@ IMeshGeom *CExportNel::buildMeshGeom (INode& node, TimeValue time, const TInodeP enableSkinModifier (node, true); if (InfoLog) - InfoLog->display("buidlMeshGeom : %d ms\n", timeGetTime()-t); + InfoLog->display("buildMeshGeom : %d ms\n", timeGetTime()-t); if (InfoLog) InfoLog->display("End of %s \n", node.GetName()); @@ -1657,10 +1678,15 @@ NL3D::IShape *CExportNel::buildWaterShape(INode& node, TimeValue time) // Get a pointer on the object's node - Object *obj = node.EvalWorldState(time).obj; + ObjectState os = node.EvalWorldState(time); + Object *obj = os.obj; + + if (!obj) return NULL; // Get a triobject from the node - TriObject *tri = (TriObject *) obj->ConvertToType(0, Class_ID(TRIOBJ_CLASS_ID, 0)); + TriObject *tri = (TriObject *) obj->ConvertToType(time, Class_ID(TRIOBJ_CLASS_ID, 0)); + + if (!tri) return NULL; // Note that the TriObject should only be deleted // if the pointer to it is not equal to the object @@ -2033,7 +2059,8 @@ NL3D::IShape *CExportNel::buildWaterShape(INode& node, TimeValue time) // Delete the triObject if we should... if (deleteIt) - tri->DeleteMe(); + tri->MaybeAutoDelete(); + tri = NULL; nlinfo("WaterShape : build succesful"); return ws; } @@ -2047,11 +2074,13 @@ NL3D::IShape *CExportNel::buildWaterShape(INode& node, TimeValue time) // *************************************************************************** bool CExportNel::buildMeshAABBox(INode &node, NLMISC::CAABBox &dest, TimeValue time) { - Object *obj = node.EvalWorldState(time).obj; + ObjectState os = node.EvalWorldState(time); + Object *obj = os.obj; if (!obj) return false; if (!obj->CanConvertToType(Class_ID(TRIOBJ_CLASS_ID, 0))) return false; // Get a triobject from the node TriObject *tri = (TriObject*)obj->ConvertToType(time, Class_ID(TRIOBJ_CLASS_ID, 0)); + if (!tri) return false; // Note that the TriObject should only be deleted // if the pointer to it is not equal to the object // pointer that called ConvertToType() @@ -2073,10 +2102,11 @@ bool CExportNel::buildMeshAABBox(INode &node, NLMISC::CAABBox &dest, TimeValue t // if (deleteIt) { -#ifndef NL_DEBUG - tri->DeleteMe(); +#ifdef NL_DONT_FIND_MAX_CRASH + tri->MaybeAutoDelete(); #endif // NL_DEBUG } + tri = NULL; return true; } diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_mesh_interface.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_mesh_interface.cpp index 4ec4f5ba3..e0b647da3 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_mesh_interface.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_mesh_interface.cpp @@ -131,7 +131,8 @@ struct CMeshInterface bool CMeshInterface::buildFromMaxMesh(INode &node, TimeValue tvTime) { // Get a pointer on the object's node - Object *obj = node.EvalWorldState(tvTime).obj; + ObjectState os = node.EvalWorldState(tvTime); + Object *obj = os.obj; // Check if there is an object if (!obj) return false; @@ -140,6 +141,8 @@ bool CMeshInterface::buildFromMaxMesh(INode &node, TimeValue tvTime) { // Get a triobject from the node TriObject *tri = (TriObject*)obj->ConvertToType(tvTime, Class_ID(TRIOBJ_CLASS_ID, 0)); + + if (!tri) return false; // Note that the TriObject should only be deleted // if the pointer to it is not equal to the object @@ -177,9 +180,8 @@ bool CMeshInterface::buildFromMaxMesh(INode &node, TimeValue tvTime) } // if (deleteIt) - { - tri->DeleteMe(); - } + tri->MaybeAutoDelete(); + tri = NULL; return true; } return false; @@ -316,50 +318,53 @@ static void AddNodeToQuadGrid(const NLMISC::CAABBox &delimiter, TNodeFaceQG &des { nldebug((std::string("Adding ") + node.GetName() + std::string(" to mesh interface quad grid")).c_str()); // add this node tris - Object *obj = node.EvalWorldState(time).obj; + ObjectState os = node.EvalWorldState(time); + Object *obj = os.obj; if (obj) { if (obj->CanConvertToType(Class_ID(TRIOBJ_CLASS_ID, 0))) { // Get a triobject from the node TriObject *tri = (TriObject*)obj->ConvertToType(time, Class_ID(TRIOBJ_CLASS_ID, 0)); - // Note that the TriObject should only be deleted - // if the pointer to it is not equal to the object - // pointer that called ConvertToType() - bool deleteIt = false; - if (obj != tri) - deleteIt = true; - Mesh &mesh = tri->GetMesh(); - - Matrix3 nodeMat = node.GetObjectTM(time); - CNodeFace nodeFace; - - NLMISC::CAABBox faceBBox; - - uint numFaceAdded = 0; - for(sint l = 0; l < mesh.getNumFaces(); ++l) + if (tri) { - for(uint m = 0; m < 3; ++m) + // Note that the TriObject should only be deleted + // if the pointer to it is not equal to the object + // pointer that called ConvertToType() + bool deleteIt = false; + if (obj != tri) + deleteIt = true; + Mesh &mesh = tri->GetMesh(); + + Matrix3 nodeMat = node.GetObjectTM(time); + CNodeFace nodeFace; + + NLMISC::CAABBox faceBBox; + + uint numFaceAdded = 0; + for(sint l = 0; l < mesh.getNumFaces(); ++l) { - Point3 pos = nodeMat * mesh.getVert(mesh.faces[l].v[m]); - CExportNel::convertVector(nodeFace.P[m], pos); - } - // test if we must insert in quadgrid - nodeFace.buildBBox(faceBBox); - if (faceBBox.intersect(delimiter)) - { - nodeFace.SmoothGroup = mesh.faces[l].smGroup; - destQuadGrid.insert(faceBBox.getMin(), faceBBox.getMax(), nodeFace); - ++ numFaceAdded; - } - - } - nldebug("%d faces where added", numFaceAdded); - // - if (deleteIt) - { - tri->DeleteMe(); - } + for(uint m = 0; m < 3; ++m) + { + Point3 pos = nodeMat * mesh.getVert(mesh.faces[l].v[m]); + CExportNel::convertVector(nodeFace.P[m], pos); + } + // test if we must insert in quadgrid + nodeFace.buildBBox(faceBBox); + if (faceBBox.intersect(delimiter)) + { + nodeFace.SmoothGroup = mesh.faces[l].smGroup; + destQuadGrid.insert(faceBBox.getMin(), faceBBox.getMax(), nodeFace); + ++ numFaceAdded; + } + + } + nldebug("%d faces where added", numFaceAdded); + // + if (deleteIt) + tri->MaybeAutoDelete(); + tri = NULL; + } } } } @@ -478,16 +483,20 @@ static void ApplyMeshInterfacesUsingSceneNormals(INode &sceneBaseNode, std::vect */ static bool SelectVerticesInMeshFromInterfaces(const std::vector &inters, float threshold, INode &node, TimeValue tvTime) { - Object *obj = node.EvalWorldState(tvTime).obj; + ObjectState os = node.EvalWorldState(tvTime); + Object *obj = os.obj; // Check if there is an object + if (!obj) return false; if (obj->CanConvertToType(Class_ID(TRIOBJ_CLASS_ID, 0))) { // Get a triobject from the node - TriObject *tri = (TriObject*)obj->ConvertToType(tvTime, Class_ID(TRIOBJ_CLASS_ID, 0)); + TriObject *tri = (TriObject*)obj->ConvertToType(tvTime, Class_ID(TRIOBJ_CLASS_ID, 0)); + if (!tri) return false; if (obj != tri) { // not a mesh object, so do nothing - tri->DeleteMe(); + tri->MaybeAutoDelete(); + tri = NULL; return false; } 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 0f2ebdc18..0b2426758 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 @@ -511,7 +511,8 @@ std::string CExportNel::getNelObjectName (INode& node) { // Workaround for FX (don't know why, but the AppData are not copied when FX are duplicated, so try to get the name in another way) // If this is a particle system, try to get the name of the shape.from the param blocks - Object *obj = node.EvalWorldState(0).obj; + ObjectState os = node.EvalWorldState(0); + Object *obj = os.obj; // Check if there is an object if (obj) { @@ -542,7 +543,8 @@ std::string CExportNel::getNelObjectName (INode& node) } else { - Object *obj = node.EvalWorldState(0).obj; + ObjectState os = node.EvalWorldState(0); + Object *obj = os.obj; if (obj) { ad = obj->GetAppDataChunk (MAXSCRIPT_UTILITY_CLASS_ID, UTILITY_CLASS_ID, NEL3D_APPDATA_INSTANCE_SHAPE); @@ -906,7 +908,8 @@ void CExportNel::getObjectNodes (std::vector& vectNode, TimeValue time, node=_Ip->GetRootNode(); // Get a pointer on the object's node - Object *obj = node->EvalWorldState(time).obj; + ObjectState os = node->EvalWorldState(time); + Object *obj = os.obj; // Check if there is an object if (obj) @@ -1257,7 +1260,8 @@ void CExportNel::buildCamera(NL3D::CCameraInfo &cameraInfo, INode& node, TimeVal cameraInfo.Fov = genCamera->GetFOV(time); if (deleteIt) - genCamera->DeleteMe(); + genCamera->MaybeAutoDelete(); + genCamera = NULL; } } } diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_nel.h b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_nel.h index 81fbac682..d413e1109 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_nel.h +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_nel.h @@ -292,7 +292,7 @@ public: * * skeletonShape must be NULL if no bones. */ - NL3D::IShape* buildShape (INode& node, TimeValue time, const TInodePtrInt *nodeMap, + NLMISC::CSmartPtr buildShape (INode& node, TimeValue time, const TInodePtrInt *nodeMap, bool buildLods); /** diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_particle_system.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_particle_system.cpp index 4d10a5508..4c6b6bc8b 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_particle_system.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_particle_system.cpp @@ -26,7 +26,8 @@ using namespace NL3D; IShape* CExportNel::buildParticleSystem(INode& node, TimeValue time) { - Object *obj = node.EvalWorldState(time).obj; + ObjectState os = node.EvalWorldState(time); + Object *obj = os.obj; nlassert(obj); std::string shapeName; // try to get the complete path diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_scene.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_scene.cpp index 8395d11ce..4e7edea8a 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_scene.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_scene.cpp @@ -249,8 +249,8 @@ CInstanceGroup* CExportNel::buildInstanceGroup(const vector& vectNode, v clusterTemp.Name = pNode->GetName(); vClusters.push_back (clusterTemp); - delete pMB; - delete pMBB; + delete pMB; pMB = NULL; + delete pMBB; pMBB = NULL; } } @@ -376,7 +376,9 @@ CInstanceGroup* CExportNel::buildInstanceGroup(const vector& vectNode, v vPortals.push_back (portalTemp); delete pMB; + pMB = NULL; delete pMBB; + pMBB = NULL; } } @@ -406,7 +408,8 @@ CInstanceGroup* CExportNel::buildInstanceGroup(const vector& vectNode, v * If it is a FX, we read its bbox from its shape * If we can't read it, we use the bbox of the fx helper in max */ - Object *obj = pNode->EvalWorldState(tvTime).obj; + ObjectState os = pNode->EvalWorldState(tvTime); + Object *obj = os.obj; // Check if there is an object if (obj) { @@ -452,6 +455,7 @@ CInstanceGroup* CExportNel::buildInstanceGroup(const vector& vectNode, v buildMeshBBox = false; } delete ss.getShapePointer(); + ss.setShapePointer(NULL); } catch (NLMISC::Exception &e) { @@ -506,8 +510,8 @@ CInstanceGroup* CExportNel::buildInstanceGroup(const vector& vectNode, v } // debug purpose : to remove - delete pMB; - delete pMBB; + delete pMB; pMB = NULL; + delete pMBB; pMBB = NULL; } ++nNumIG; @@ -911,7 +915,7 @@ void CExportNel::buildScene (NL3D::CScene &scene, NL3D::CShapeBank &shapeBank, I // Swap pointer and release unlighted one. swap(ig, igOut); - delete igOut; + delete igOut; igOut = NULL; } // Add all models to the scene diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_skinning.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_skinning.cpp index c48b840c7..57f742972 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_skinning.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_skinning.cpp @@ -748,15 +748,20 @@ uint CExportNel::buildSkinning (CMesh::CMeshBuild& buildMesh, const TInodePtrInt { if (blendedInterface) { - // Get the bone weight - float weight=blendedInterface->GetWeight(bone); - // Get node INode *node=blendedInterface->GetNode(bone); - nlassert (node); - - // Insert in the map - weightMap.insert (std::map::value_type (weight, node)); + if (node == NULL) + { + nlwarning("node == NULL; bone = %i / %i", bone, boneCount); + } + else + { + // Get the bone weight + float weight=blendedInterface->GetWeight(bone); + + // Insert in the map + weightMap.insert (std::map::value_type (weight, node)); + } } else { @@ -1191,49 +1196,64 @@ void CExportNel::addSkeletonBindPos (INode& skinedNode, mapBoneBindPos& boneBind for (boneIndex=0; boneIndexGetNode(boneIndex); + INode *bone = blendedInterface->GetNode(boneIndex); - // Get the bind matrix of the bone - Matrix3 bindPos; - int res=physiqueInterface->GetInitNodeTM (bone, bindPos); - nlassert (res==MATRIX_RETURNED); - - // Add an entry inthe map - if (boneBindPos.insert (mapBoneBindPos::value_type (bone, bindPos)).second) + if (bone == NULL) { -#ifdef NL_DEBUG - // *** Debug info + nlwarning("bone == NULL; boneIndex = %i / %i", boneIndex, count); + } + else + { + // Get the bind matrix of the bone + Matrix3 bindPos; + int res = physiqueInterface->GetInitNodeTM (bone, bindPos); - // Bone name - std::string boneName=getName (*bone); + if (res != MATRIX_RETURNED) + { + nlwarning("res != MATRIX_RETURNED; res = %i; boneIndex = %i / %i", res, boneIndex, count); + nlwarning("bone = %i", (uint32)(void *)bone); + std::string boneName = getName (*bone); + nlwarning("boneName = %s", boneName.c_str()); + nlassert(false); + } - // Local matrix - Matrix3 nodeTM; - nodeTM=bone->GetNodeTM (0); + // Add an entry inthe map + if (boneBindPos.insert (mapBoneBindPos::value_type (bone, bindPos)).second) + { + #ifdef NL_DEBUG + // *** Debug info - // Offset matrix - Matrix3 offsetScaleTM (TRUE); - Matrix3 offsetRotTM (TRUE); - Matrix3 offsetPosTM (TRUE); - ApplyScaling (offsetScaleTM, bone->GetObjOffsetScale ()); - offsetRotTM.SetRotate (bone->GetObjOffsetRot ()); - offsetPosTM.SetTrans (bone->GetObjOffsetPos ()); - Matrix3 offsetTM = offsetScaleTM * offsetRotTM * offsetPosTM; + // Bone name + std::string boneName=getName (*bone); - // Local + offset matrix - Matrix3 nodeOffsetTM = offsetTM * nodeTM; + // Local matrix + Matrix3 nodeTM; + nodeTM=bone->GetNodeTM (0); - // Init TM - Matrix3 initTM; - int res=physiqueInterface->GetInitNodeTM (bone, initTM); - nlassert (res==MATRIX_RETURNED); + // Offset matrix + Matrix3 offsetScaleTM (TRUE); + Matrix3 offsetRotTM (TRUE); + Matrix3 offsetPosTM (TRUE); + ApplyScaling (offsetScaleTM, bone->GetObjOffsetScale ()); + offsetRotTM.SetRotate (bone->GetObjOffsetRot ()); + offsetPosTM.SetTrans (bone->GetObjOffsetPos ()); + Matrix3 offsetTM = offsetScaleTM * offsetRotTM * offsetPosTM; - // invert - initTM.Invert(); - Matrix3 compNode=nodeTM*initTM; - Matrix3 compOffsetNode=nodeOffsetTM*initTM; - Matrix3 compOffsetNode2=nodeOffsetTM*initTM; + // Local + offset matrix + Matrix3 nodeOffsetTM = offsetTM * nodeTM; + + // Init TM + Matrix3 initTM; + int res=physiqueInterface->GetInitNodeTM (bone, initTM); + nlassert (res==MATRIX_RETURNED); + + // invert + initTM.Invert(); + Matrix3 compNode=nodeTM*initTM; + Matrix3 compOffsetNode=nodeOffsetTM*initTM; + Matrix3 compOffsetNode2=nodeOffsetTM*initTM; #endif // NL_DEBUG + } } } } @@ -1386,7 +1406,8 @@ bool CExportNel::mirrorPhysiqueSelection(INode &node, TimeValue tvTime, const st uint vertCount; // Get a pointer on the object's node. - Object *obj = node.EvalWorldState(tvTime).obj; + ObjectState os = node.EvalWorldState(tvTime); + Object *obj = os.obj; // Check if there is an object ok= false; @@ -1398,35 +1419,39 @@ bool CExportNel::mirrorPhysiqueSelection(INode &node, TimeValue tvTime, const st { // Get a triobject from the node TriObject *tri = (TriObject*)obj->ConvertToType(tvTime, Class_ID(TRIOBJ_CLASS_ID, 0)); - - // Note that the TriObject should only be deleted - // if the pointer to it is not equal to the object - // pointer that called ConvertToType() - bool deleteIt=false; - if (obj != tri) - deleteIt = true; - - // Get the node matrix. TODO: Matrix headhache? - /*Matrix3 nodeMatrixMax; - CMatrix nodeMatrix; - getLocalMatrix (nodeMatrixMax, node, tvTime); - convertMatrix (nodeMatrix, nodeMatrixMax);*/ - - // retrive Position geometry - vertCount= tri->NumPoints(); - tempVertex.resize(vertCount); - for(uint i=0;iGetPoint(i); - tempVertex[i].Pos.set(v.x, v.y, v.z); + // Note that the TriObject should only be deleted + // if the pointer to it is not equal to the object + // pointer that called ConvertToType() + bool deleteIt=false; + if (obj != tri) + deleteIt = true; + + // Get the node matrix. TODO: Matrix headhache? + /*Matrix3 nodeMatrixMax; + CMatrix nodeMatrix; + getLocalMatrix (nodeMatrixMax, node, tvTime); + convertMatrix (nodeMatrix, nodeMatrixMax);*/ + + // retrive Position geometry + vertCount= tri->NumPoints(); + tempVertex.resize(vertCount); + for(uint i=0;iGetPoint(i); + tempVertex[i].Pos.set(v.x, v.y, v.z); + } + + // Delete the triObject if we should... + if (deleteIt) + tri->MaybeAutoDelete(); + tri = NULL; + + // ok! + ok= true; } - - // Delete the triObject if we should... - if (deleteIt) - tri->DeleteMe(); - - // ok! - ok= true; } } if(!ok) diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_vegetable.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_vegetable.cpp index 6c054404a..6e10f9c78 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_vegetable.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_vegetable.cpp @@ -33,7 +33,8 @@ bool CExportNel::buildVegetableShape (NL3D::CVegetableShape& skeletonShape, INo bool res = false; // Get a pointer on the object's node - Object *obj = node.EvalWorldState(time).obj; + ObjectState os = node.EvalWorldState(time); + Object *obj = os.obj; // Check if there is an object if (obj) @@ -42,116 +43,119 @@ bool CExportNel::buildVegetableShape (NL3D::CVegetableShape& skeletonShape, INo { // Get a triobject from the node TriObject *tri = (TriObject *) obj->ConvertToType(time, Class_ID(TRIOBJ_CLASS_ID, 0)); - - // Note that the TriObject should only be deleted - // if the pointer to it is not equal to the object - // pointer that called ConvertToType() - bool deleteIt=false; - if (obj != tri) - deleteIt = true; - - // Build a mesh base structure - CMeshBase::CMeshBaseBuild buildBaseMesh; - CMaxMeshBaseBuild maxBaseBuild; - - // Get the node matrix - Matrix3 nodeMatrixMax; - CMatrix nodeMatrix; - getLocalMatrix (nodeMatrixMax, node, time); - convertMatrix (nodeMatrix, nodeMatrixMax); - - buildBaseMeshInterface (buildBaseMesh, maxBaseBuild, node, time, nodeMatrix); - - // Build a mesh - CMesh::CMeshBuild buildMesh; - buildMeshInterface (*tri, buildMesh, buildBaseMesh, maxBaseBuild, node, time, NULL); - - // Has UV 1 - if ((buildMesh.VertexFlags & CVertexBuffer::TexCoord0Flag) == 0) - { - // Error - outputErrorMessage ("Can't build vegetable mesh: need UV1 coordinates"); - } - else + + if (tri) { + // Note that the TriObject should only be deleted + // if the pointer to it is not equal to the object + // pointer that called ConvertToType() + bool deleteIt=false; + if (obj != tri) + deleteIt = true; + + // Build a mesh base structure + CMeshBase::CMeshBaseBuild buildBaseMesh; + CMaxMeshBaseBuild maxBaseBuild; + + // Get the node matrix + Matrix3 nodeMatrixMax; + CMatrix nodeMatrix; + getLocalMatrix (nodeMatrixMax, node, time); + convertMatrix (nodeMatrix, nodeMatrixMax); + + buildBaseMeshInterface (buildBaseMesh, maxBaseBuild, node, time, nodeMatrix); + // Build a mesh - CMesh mesh; - mesh.build (buildBaseMesh, buildMesh); + CMesh::CMeshBuild buildMesh; + buildMeshInterface (*tri, buildMesh, buildBaseMesh, maxBaseBuild, node, time, NULL); - // Number of matrix block - if (mesh.getNbMatrixBlock () != 1) + // Has UV 1 + if ((buildMesh.VertexFlags & CVertexBuffer::TexCoord0Flag) == 0) { // Error - outputErrorMessage ("The object can't be skinned"); + outputErrorMessage ("Can't build vegetable mesh: need UV1 coordinates"); } else { - // Number of render pass - if (mesh.getNbRdrPass (0) != 1) + // Build a mesh + CMesh mesh; + mesh.build (buildBaseMesh, buildMesh); + + // Number of matrix block + if (mesh.getNbMatrixBlock () != 1) { // Error - outputErrorMessage ("The object must have less than one material!"); + outputErrorMessage ("The object can't be skinned"); } else { - // Build a vegetable mesh - CVegetableShapeBuild vegetableBuild; - - // Copy the vertex buffer - vegetableBuild.VB = mesh.getVertexBuffer (); - - // Copy the primitive block - vegetableBuild.PB = mesh.getRdrPassPrimitiveBlock (0, 0); - - // Get the appdata - vegetableBuild.AlphaBlend = CExportNel::getScriptAppData (&node, NEL3D_APPDATA_VEGETABLE_ALPHA_BLEND, 0) == 0; - - // Alpha blend ? - if (vegetableBuild.AlphaBlend) + // Number of render pass + if (mesh.getNbRdrPass (0) != 1) { - // Default options - vegetableBuild.PreComputeLighting = true; - vegetableBuild.DoubleSided = true; - - // Lighted ? - vegetableBuild.Lighted = CExportNel::getScriptAppData (&node, NEL3D_APPDATA_VEGETABLE_ALPHA_BLEND_ON_LIGHTED, 0) == 0; + // Error + outputErrorMessage ("The object must have less than one material!"); } else { - // Lighted ? - vegetableBuild.Lighted = CExportNel::getScriptAppData (&node, NEL3D_APPDATA_VEGETABLE_ALPHA_BLEND_OFF_LIGHTED, 0) != 2; + // Build a vegetable mesh + CVegetableShapeBuild vegetableBuild; - // Precompute light ? - vegetableBuild.PreComputeLighting = CExportNel::getScriptAppData (&node, NEL3D_APPDATA_VEGETABLE_ALPHA_BLEND_OFF_LIGHTED, 0) == 0; + // Copy the vertex buffer + vegetableBuild.VB = mesh.getVertexBuffer (); - // Double sided ? - vegetableBuild.DoubleSided = CExportNel::getScriptAppData (&node, NEL3D_APPDATA_VEGETABLE_ALPHA_BLEND_OFF_DOUBLE_SIDED, 0) != BST_UNCHECKED; + // Copy the primitive block + vegetableBuild.PB = mesh.getRdrPassPrimitiveBlock (0, 0); + + // Get the appdata + vegetableBuild.AlphaBlend = CExportNel::getScriptAppData (&node, NEL3D_APPDATA_VEGETABLE_ALPHA_BLEND, 0) == 0; + + // Alpha blend ? + if (vegetableBuild.AlphaBlend) + { + // Default options + vegetableBuild.PreComputeLighting = true; + vegetableBuild.DoubleSided = true; + + // Lighted ? + vegetableBuild.Lighted = CExportNel::getScriptAppData (&node, NEL3D_APPDATA_VEGETABLE_ALPHA_BLEND_ON_LIGHTED, 0) == 0; + } + else + { + // Lighted ? + vegetableBuild.Lighted = CExportNel::getScriptAppData (&node, NEL3D_APPDATA_VEGETABLE_ALPHA_BLEND_OFF_LIGHTED, 0) != 2; + + // Precompute light ? + vegetableBuild.PreComputeLighting = CExportNel::getScriptAppData (&node, NEL3D_APPDATA_VEGETABLE_ALPHA_BLEND_OFF_LIGHTED, 0) == 0; + + // Double sided ? + vegetableBuild.DoubleSided = CExportNel::getScriptAppData (&node, NEL3D_APPDATA_VEGETABLE_ALPHA_BLEND_OFF_DOUBLE_SIDED, 0) != BST_UNCHECKED; + } + + // PreComputeLighting? + if (vegetableBuild.PreComputeLighting) + { + // BestSidedPreComputeLighting? + vegetableBuild.BestSidedPreComputeLighting= CExportNel::getScriptAppData (&node, NEL3D_APPDATA_VEGETABLE_FORCE_BEST_SIDED_LIGHTING, 0) != BST_UNCHECKED; + } + + // Max bend weight + vegetableBuild.MaxBendWeight = CExportNel::getScriptAppData (&node, NEL3D_APPDATA_BEND_FACTOR, NEL3D_APPDATA_BEND_FACTOR_DEFAULT); + + // BendMode + vegetableBuild.BendCenterMode = (CVegetableShapeBuild::TBendCenterMode)CExportNel::getScriptAppData (&node, NEL3D_APPDATA_BEND_CENTER, 0); + + // Build it + skeletonShape.build (vegetableBuild); + + // Ok + res = true; } - - // PreComputeLighting? - if (vegetableBuild.PreComputeLighting) - { - // BestSidedPreComputeLighting? - vegetableBuild.BestSidedPreComputeLighting= CExportNel::getScriptAppData (&node, NEL3D_APPDATA_VEGETABLE_FORCE_BEST_SIDED_LIGHTING, 0) != BST_UNCHECKED; - } - - // Max bend weight - vegetableBuild.MaxBendWeight = CExportNel::getScriptAppData (&node, NEL3D_APPDATA_BEND_FACTOR, NEL3D_APPDATA_BEND_FACTOR_DEFAULT); - - // BendMode - vegetableBuild.BendCenterMode = (CVegetableShapeBuild::TBendCenterMode)CExportNel::getScriptAppData (&node, NEL3D_APPDATA_BEND_CENTER, 0); - - // Build it - skeletonShape.build (vegetableBuild); - - // Ok - res = true; } } - } - if (deleteIt) - tri->DeleteMe(); + if (deleteIt) + tri->MaybeAutoDelete(); + } } } diff --git a/code/nel/tools/3d/plugin_max/nel_patch_converter/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_patch_converter/CMakeLists.txt index e70f7471f..3d06dd679 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_converter/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_patch_converter/CMakeLists.txt @@ -2,9 +2,8 @@ FILE(GLOB SRC *.cpp *.h *.def) ADD_LIBRARY(nel_patch_converter SHARED ${SRC} nel_patch_converter.rc) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${MAXSDK_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${MAXSDK_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nel_patch_converter - ${LIBXML2_LIBRARIES} nelmisc nel3d nel_mesh_lib @@ -14,13 +13,9 @@ TARGET_LINK_LIBRARIES(nel_patch_converter Version.lib comctl32.lib) -SET_TARGET_PROPERTIES(nel_patch_converter PROPERTIES - VERSION ${NL_VERSION} - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r" - SUFFIX ".dlm" - PROJECT_LABEL "MAX Plugin: NeL Patch Converter") - -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +SET_TARGET_PROPERTIES(nel_patch_converter PROPERTIES SUFFIX ".dlm") +NL_DEFAULT_PROPS(nel_patch_converter "MAX Plugin: NeL Patch Converter") +NL_ADD_RUNTIME_FLAGS(nel_patch_converter) +NL_ADD_LIB_SUFFIX(nel_patch_converter) INSTALL(TARGETS nel_patch_converter RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) diff --git a/code/nel/tools/3d/plugin_max/nel_patch_converter/PO2RPO.h b/code/nel/tools/3d/plugin_max/nel_patch_converter/PO2RPO.h index 991ec01ff..51e7255b8 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_converter/PO2RPO.h +++ b/code/nel/tools/3d/plugin_max/nel_patch_converter/PO2RPO.h @@ -18,6 +18,7 @@ #ifndef __PMESH2RKLPMESH__H #define __PMESH2RKLPMESH__H +#include #include "Max.h" #include "resource.h" #include "istdplug.h" diff --git a/code/nel/tools/3d/plugin_max/nel_patch_converter/nel_patch_converter.cpp b/code/nel/tools/3d/plugin_max/nel_patch_converter/nel_patch_converter.cpp index 0310ecef7..eee8b1cf8 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_converter/nel_patch_converter.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_converter/nel_patch_converter.cpp @@ -121,7 +121,7 @@ void PO2RPO::ModifyObject(TimeValue t, ModContext &mc, ObjectState * os, INode * // ----------------------------------------------------------------------------------------------------------------------------------------------------------- extern HINSTANCE hInstance; -BOOL CALLBACK DlgProc_Panel(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK DlgProc_Panel(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { diff --git a/code/nel/tools/3d/plugin_max/nel_patch_converter/script.cpp b/code/nel/tools/3d/plugin_max/nel_patch_converter/script.cpp index 731d9aefb..b324c2cc6 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_converter/script.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_converter/script.cpp @@ -21,6 +21,7 @@ #define _CRT_SECURE_NO_DEPRECATE +#include #include #include diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_patch_edit/CMakeLists.txt index b99689017..5c7b42843 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/CMakeLists.txt @@ -2,9 +2,8 @@ FILE(GLOB SRC *.cpp *.h *.def) ADD_LIBRARY(nel_patch_edit SHARED ${SRC} mods.rc) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${MAXSDK_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${MAXSDK_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nel_patch_edit - ${LIBXML2_LIBRARIES} nelmisc nel3d nel_mesh_lib @@ -14,16 +13,10 @@ TARGET_LINK_LIBRARIES(nel_patch_edit Version.lib comctl32.lib) -SET_TARGET_PROPERTIES(nel_patch_edit PROPERTIES - VERSION ${NL_VERSION} - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r" - SUFFIX ".dlm" - PROJECT_LABEL "MAX Plugin: NeL Patch Editor") - -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +SET_TARGET_PROPERTIES(nel_patch_edit PROPERTIES SUFFIX ".dlm") +NL_DEFAULT_PROPS(nel_patch_edit "MAX Plugin: NeL Patch Editor") +NL_ADD_RUNTIME_FLAGS(nel_patch_edit) +NL_ADD_LIB_SUFFIX(nel_patch_edit) IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nel_patch_edit ${CMAKE_CURRENT_SOURCE_DIR}/stdafx.h ${CMAKE_CURRENT_SOURCE_DIR}/stdafx.cpp) diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_edit_patch_mod.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_edit_patch_mod.cpp index cdc3d5ed9..ef7a87642 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_edit_patch_mod.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_edit_patch_mod.cpp @@ -264,7 +264,7 @@ void EditPatchMod::NewSetByOperator(TSTR &newName, Tab < int> &sets, int op) // Named selection set copy/paste methods follow... -static BOOL CALLBACK PickSetNameDlgProc( +static INT_PTR CALLBACK PickSetNameDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { static TSTR *name; @@ -328,7 +328,7 @@ BOOL EditPatchMod::GetUniqueSetName(TSTR &name) -static BOOL CALLBACK PickSetDlgProc( +static INT_PTR CALLBACK PickSetDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_editpops.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_editpops.cpp index 89da6fbe1..22a678ec0 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_editpops.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_editpops.cpp @@ -50,7 +50,7 @@ EPTempData::EPTempData(EditPatchMod *m,EditPatchData *pd) mod = m; } -void EPTempData::Invalidate(DWORD part,BOOL patchValid) +void EPTempData::Invalidate(PartID part,BOOL patchValid) { if ( !patchValid ) { diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_selection.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_selection.cpp index 1370a93cf..cee83b2b0 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_selection.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_selection.cpp @@ -9,9 +9,9 @@ #define PROMPT_TIME 2000 -BOOL CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); extern void ChangePatchType(PatchMesh *patch, int index, int type); extern BOOL filterVerts; // ------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_surface.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_surface.cpp index 154e5b78c..164748768 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_surface.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_surface.cpp @@ -15,7 +15,7 @@ extern int sbmParams[4]; extern DWORD sbsParams[3]; // ------------------------------------------------------------------------------------------------------------------------------------------------------ -BOOL CALLBACK SelectByMatDlgProc( +INT_PTR CALLBACK SelectByMatDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { static int *param; @@ -84,7 +84,7 @@ void SetSmoothButtonState(HWND hWnd, DWORD bits, DWORD invalid, DWORD unused = 0 // ------------------------------------------------------------------------------------------------------------------------------------------------------ -BOOL CALLBACK SelectBySmoothDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK SelectBySmoothDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { static DWORD *param; switch (msg) @@ -137,9 +137,9 @@ BOOL CALLBACK SelectBySmoothDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l // ------------------------------------------------------------------------------------------------------------------------------------------------------ -BOOL CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { - EditPatchMod *ep =(EditPatchMod *)GetWindowLong(hDlg, GWL_USERDATA); + EditPatchMod *ep =(EditPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); if (!ep && message != WM_INITDIALOG) return FALSE; @@ -150,7 +150,7 @@ BOOL CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lP ep =(EditPatchMod *)lParam; ep->hTilePanel = hDlg; - SetWindowLong(hDlg, GWL_USERDATA, (LONG)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); ep->tileNum = SetupIntSpinner(hDlg, IDC_TILE_MAT_SPIN, IDC_TILE_MAT, 0, 65535, 0); ep->tileRot = SetupIntSpinner(hDlg, IDC_TILE_ROT_SPIN, IDC_TILE_ROT, 0, 3, 0); ep->SetTileDlgEnables(); @@ -249,9 +249,9 @@ BOOL CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lP // ------------------------------------------------------------------------------------------------------------------------------------------------------ -BOOL CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { - EditPatchMod *ep =(EditPatchMod *)GetWindowLong(hDlg, GWL_USERDATA); + EditPatchMod *ep =(EditPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); if (!ep && message != WM_INITDIALOG) return FALSE; @@ -262,7 +262,7 @@ BOOL CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lP ep =(EditPatchMod *)lParam; ep->hEdgePanel = hDlg; - SetWindowLong(hDlg, GWL_USERDATA, (LONG)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); ep->SetEdgeDlgEnables(); return TRUE; } @@ -324,9 +324,9 @@ BOOL CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lP // ------------------------------------------------------------------------------------------------------------------------------------------------------ -BOOL CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { - EditPatchMod *ep =(EditPatchMod *)GetWindowLong(hDlg, GWL_USERDATA); + EditPatchMod *ep =(EditPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); if (!ep && message != WM_INITDIALOG) return FALSE; @@ -339,7 +339,7 @@ BOOL CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lP for (int i = IDC_SMOOTH_GRP1; i < IDC_SMOOTH_GRP1 + 32; i++) SendMessage(GetDlgItem(hDlg, i), CC_COMMAND, CC_CMD_SET_TYPE, CBT_CHECK); - SetWindowLong(hDlg, GWL_USERDATA, (LONG)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); ep->matSpin = SetupIntSpinner(hDlg, IDC_MAT_IDSPIN, IDC_MAT_ID, 1, MAX_MATID, 0); ep->tessUSpin = SetupIntSpinner(hDlg, IDC_TESS_U_SPIN, IDC_TESS_U2, 1, 4, RPO_DEFAULT_TESSEL); ep->tessVSpin = SetupIntSpinner(hDlg, IDC_TESS_V_SPIN, IDC_TESS_V2, 1, 4, RPO_DEFAULT_TESSEL); diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_tess.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_epm_tess.cpp index d73ea12ce..ec95d6ce5 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 @@ -10,7 +10,7 @@ #define PROMPT_TIME 2000 extern AdvParams sParams; -BOOL CALLBACK AdvParametersDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK AdvParametersDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); // ------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -212,7 +212,7 @@ void EditPatchMod::SetTessUI(HWND hDlg, TessApprox *tess) BOOL CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { - EditPatchMod *ep =(EditPatchMod *)GetWindowLong(hDlg, GWL_USERDATA); + EditPatchMod *ep =(EditPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); if (!ep && message != WM_INITDIALOG) return FALSE; @@ -223,7 +223,7 @@ BOOL CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM ep =(EditPatchMod *)lParam; ep->hSurfPanel = hDlg; - SetWindowLong(hDlg, GWL_USERDATA, (LONG)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG)ep); if (!ep->settingViewportTess && ep->settingDisp && ep->GetProdTess().type == TESS_SET) ep->settingDisp = FALSE; TessApprox t; @@ -599,7 +599,7 @@ static ISpinnerControl* psMaxTrisSpin = NULL; // this max matches the MI max. #define MAX_SUBDIV 7 static BOOL initing = FALSE; // this is a hack but CenterWindow causes bad commands -BOOL CALLBACK +INT_PTR CALLBACK AdvParametersDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_main.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_main.cpp index 5cab14922..42389e4d0 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_main.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_main.cpp @@ -9,12 +9,12 @@ #define PROMPT_TIME 2000 -BOOL CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchObjSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchSurfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchTileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchEdgeDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); extern void CancelEditPatchModes(IObjParam *ip); diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_mods.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_mods.cpp index 8470f3653..c2696674a 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 @@ -96,12 +96,12 @@ __declspec( dllexport ) ULONG CanAutoDefer() BOOL CALLBACK DefaultSOTProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam) { - IObjParam *ip = (IObjParam*)GetWindowLong(hWnd,GWL_USERDATA); + IObjParam *ip = (IObjParam*)GetWindowLongPtr(hWnd,GWLP_USERDATA); switch (msg) { case WM_INITDIALOG: - SetWindowLong(hWnd,GWL_USERDATA,lParam); + SetWindowLongPtr(hWnd,GWLP_USERDATA,lParam); break; case WM_LBUTTONDOWN: diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/np_rollup.cpp b/code/nel/tools/3d/plugin_max/nel_patch_edit/np_rollup.cpp index 86a35b083..be29c758c 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 @@ -33,10 +33,10 @@ extern void CancelEditPatchModes(IObjParam *ip); extern void LoadImages(); -BOOL CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { static char string[64]; - EditPatchMod *ep =(EditPatchMod *)GetWindowLong(hDlg, GWL_USERDATA); + EditPatchMod *ep =(EditPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); ICustToolbar *iToolbar; if (!ep && message != WM_INITDIALOG) return FALSE; @@ -104,7 +104,7 @@ BOOL CALLBACK PatchSelectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM ep =(EditPatchMod *)lParam; ep->hSelectPanel = hDlg; - SetWindowLong(hDlg, GWL_USERDATA, (LONG)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); // Set up the editing level selector LoadImages(); iToolbar = GetICustToolbar(GetDlgItem(hDlg, IDC_SELTYPE)); @@ -349,9 +349,9 @@ void EditPatchMod::SetOpsDlgEnables() // ------------------------------------------------------------------------------------------------------------------------------------------------------ -BOOL CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { - EditPatchMod *ep =(EditPatchMod *)GetWindowLong(hDlg, GWL_USERDATA); + EditPatchMod *ep =(EditPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); if (!ep && message != WM_INITDIALOG) return FALSE; @@ -367,7 +367,7 @@ BOOL CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa ep->hOpsPanel = hDlg; for (int i = IDC_SMOOTH_GRP1; i < IDC_SMOOTH_GRP1 + 32; i++) SendMessage(GetDlgItem(hDlg, i), CC_COMMAND, CC_CMD_SET_TYPE, CBT_CHECK); - SetWindowLong(hDlg, GWL_USERDATA, (LONG)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); ICustButton *but = GetICustButton(GetDlgItem(hDlg, IDC_ATTACH)); but->SetHighlightColor(GREEN_WASH); but->SetType(CBT_CHECK); diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/stdafx.h b/code/nel/tools/3d/plugin_max/nel_patch_edit/stdafx.h index 5adc0636d..cb4ae8ecf 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/stdafx.h +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/stdafx.h @@ -1,4 +1,5 @@ #pragma warning (disable : 4786) +#include #include #include #include diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/CMakeLists.txt index 15f2dab27..52a8b1bbd 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/CMakeLists.txt @@ -2,9 +2,8 @@ FILE(GLOB SRC *.cpp *.h *.def) ADD_LIBRARY(nel_patch_edit_adv SHARED ${SRC} mods.rc) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${MAXSDK_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${MAXSDK_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nel_patch_edit_adv - ${LIBXML2_LIBRARIES} nelmisc nel3d nel_mesh_lib @@ -14,15 +13,9 @@ TARGET_LINK_LIBRARIES(nel_patch_edit_adv Version.lib comctl32.lib) -SET_TARGET_PROPERTIES(nel_patch_edit_adv PROPERTIES - VERSION ${NL_VERSION} - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - SUFFIX ".dlm" - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r" - PROJECT_LABEL "MAX Plugin: NeL Patch Edit (Adv)") - -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +SET_TARGET_PROPERTIES(nel_patch_edit_adv PROPERTIES SUFFIX ".dlm") +NL_DEFAULT_PROPS(nel_patch_edit_adv "MAX Plugin: NeL Patch Edit (Adv)") +NL_ADD_RUNTIME_FLAGS(nel_patch_edit_adv) +NL_ADD_LIB_SUFFIX(nel_patch_edit_adv) INSTALL(TARGETS nel_patch_edit_adv RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) diff --git a/code/nel/tools/3d/plugin_max/nel_patch_lib/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_patch_lib/CMakeLists.txt index 6110cc0d3..c27ec5345 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_lib/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_patch_lib/CMakeLists.txt @@ -2,21 +2,10 @@ FILE(GLOB SRC *.cpp *.h) ADD_LIBRARY(nel_patch_lib STATIC ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${MAXSDK_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nel_patch_lib - ${LIBXML2_LIBRARIES} - nelmisc - nel3d - ${MAXSDK_LIBRARIES}) -SET_TARGET_PROPERTIES(nel_patch_lib PROPERTIES - VERSION ${NL_VERSION} - SOVERSION ${NL_VERSION_MAJOR} - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r" - PROJECT_LABEL "MAX Plugin: NeL Patch Library") - -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +INCLUDE_DIRECTORIES(${MAXSDK_INCLUDE_DIR}) +TARGET_LINK_LIBRARIES(nel_patch_lib nelmisc nel3d ${MAXSDK_LIBRARIES}) +NL_DEFAULT_PROPS(nel_patch_lib "MAX Plugin: NeL Patch Library") +NL_ADD_RUNTIME_FLAGS(nel_patch_lib) +NL_ADD_LIB_SUFFIX(nel_patch_lib) INSTALL(TARGETS nel_patch_lib RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) diff --git a/code/nel/tools/3d/plugin_max/nel_patch_lib/nel_patch_mesh.h b/code/nel/tools/3d/plugin_max/nel_patch_lib/nel_patch_mesh.h index 508a9b843..12238a87b 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_lib/nel_patch_mesh.h +++ b/code/nel/tools/3d/plugin_max/nel_patch_lib/nel_patch_mesh.h @@ -521,7 +521,7 @@ public: // Get map hit size uint getMapHitSize () const { - return _Data._MapHitToTileIndex->size (); + return (uint)_Data._MapHitToTileIndex->size (); } // Remap a triangle @@ -534,7 +534,7 @@ public: // Get the patch user info size uint getUIPatchSize () const { - return _Data._UIPatch->size(); + return (uint)_Data._UIPatch->size(); } // Get a patch user info @@ -558,7 +558,7 @@ public: // Get vertex user info size uint getUIVertexSize () const { - return _Data._UIVertex->size(); + return (uint)_Data._UIVertex->size(); } // Get a vertex user info diff --git a/code/nel/tools/3d/plugin_max/nel_patch_lib/stdafx.h b/code/nel/tools/3d/plugin_max/nel_patch_lib/stdafx.h index f295970f5..8962b86bc 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_lib/stdafx.h +++ b/code/nel/tools/3d/plugin_max/nel_patch_lib/stdafx.h @@ -20,6 +20,7 @@ #define _CRT_SECURE_NO_DEPRECATE #pragma warning (disable : 4786) +#include #include #include #include diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_patch_paint/CMakeLists.txt index 8b0c940e9..29ddbd82f 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/CMakeLists.txt @@ -5,8 +5,8 @@ LIST(REMOVE_ITEM SRC ${CMAKE_CURRENT_SOURCE_DIR}/nel_paint.cpp) ADD_LIBRARY(nel_patch_paint SHARED ${SRC} nel_patch_paint.rc) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${MAXSDK_INCLUDE_DIR}) + TARGET_LINK_LIBRARIES(nel_patch_paint - ${LIBXML2_LIBRARIES} nelmisc nelligo nel3d @@ -17,14 +17,10 @@ TARGET_LINK_LIBRARIES(nel_patch_paint Version.lib comctl32.lib) -SET_TARGET_PROPERTIES(nel_patch_paint PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - VERSION ${NL_VERSION} - SUFFIX ".dlm" - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r" - PROJECT_LABEL "MAX Plugin: NeL Patch Painter") +SET_TARGET_PROPERTIES(nel_patch_paint PROPERTIES SUFFIX ".dlm") +NL_DEFAULT_PROPS(nel_patch_paint "MAX Plugin: NeL Patch Painter") +NL_ADD_RUNTIME_FLAGS(nel_patch_paint) +NL_ADD_LIB_SUFFIX(nel_patch_paint) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) 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 d7fd70aec..a3578a0bc 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 @@ -112,11 +112,11 @@ __declspec( dllexport ) ULONG CanAutoDefer() BOOL CALLBACK DefaultSOTProc( HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam) { - IObjParam *ip = (IObjParam*)GetWindowLong(hWnd,GWL_USERDATA); + IObjParam *ip = (IObjParam*)GetWindowLongPtr(hWnd,GWLP_USERDATA); switch (msg) { case WM_INITDIALOG: - SetWindowLong(hWnd,GWL_USERDATA,lParam); + SetWindowLongPtr(hWnd,GWLP_USERDATA,lParam); break; case WM_LBUTTONDOWN: diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_main.cpp b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_main.cpp index c03c0994e..46934e653 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_main.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_main.cpp @@ -3,7 +3,7 @@ // ------------------------------------------------------------------------------------------------------------------------------------------------------ -BOOL CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); extern void CancelEditPatchModes(IObjParam *ip); diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_pops.cpp b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_pops.cpp index e7e6d57dd..9fa7d8953 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_pops.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_pops.cpp @@ -23,7 +23,7 @@ EPTempData::EPTempData(PaintPatchMod *m,PaintPatchData *pd) mod = m; } -void EPTempData::Invalidate(DWORD part,BOOL patchValid) +void EPTempData::Invalidate(PartID part,BOOL patchValid) { if ( !patchValid ) { diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_rollup.cpp b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint_rollup.cpp index 6785fdd3d..37b73fdc1 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 @@ -44,9 +44,9 @@ void PaintPatchMod::SetOpsDlgEnables() // ------------------------------------------------------------------------------------------------------------------------------------------------------ -BOOL CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { - PaintPatchMod *ep =(PaintPatchMod *)GetWindowLong(hDlg, GWL_USERDATA); + PaintPatchMod *ep =(PaintPatchMod *)GetWindowLongPtr(hDlg, GWLP_USERDATA); if (!ep && message != WM_INITDIALOG) return FALSE; @@ -57,7 +57,7 @@ BOOL CALLBACK PatchOpsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa ep =(PaintPatchMod *)lParam; ep->hOpsPanel = hDlg; - SetWindowLong(hDlg, GWL_USERDATA, (LONG)ep); + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)ep); CheckDlgButton(hDlg, IDC_INCLUDE_MESHES, ep->includeMeshes); CheckDlgButton(hDlg, IDC_PRELOAD_TILES, ep->preloadTiles); diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/stdafx.h b/code/nel/tools/3d/plugin_max/nel_patch_paint/stdafx.h index bb52ca5e3..4e731a3ff 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/stdafx.h +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/stdafx.h @@ -1,6 +1,7 @@ #pragma warning (disable : 4786) // max.h include uses min/max in 3dsmax 2010 sdk +#include #include "Max.h" #ifdef min # undef min diff --git a/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/CMakeLists.txt index 4fa021475..52462143f 100644 --- a/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/CMakeLists.txt @@ -2,9 +2,9 @@ FILE(GLOB SRC *.cpp *.h *.def) ADD_LIBRARY(nel_vertex_tree_paint SHARED ${SRC} vertex_tree_paint.def vertex_tree_paint.rc) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${MAXSDK_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${MAXSDK_INCLUDE_DIR}) + TARGET_LINK_LIBRARIES(nel_vertex_tree_paint - ${LIBXML2_LIBRARIES} nelmisc nel3d nel_mesh_lib @@ -14,15 +14,9 @@ TARGET_LINK_LIBRARIES(nel_vertex_tree_paint Version.lib comctl32.lib) -SET_TARGET_PROPERTIES(nel_vertex_tree_paint PROPERTIES - VERSION ${NL_VERSION} - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r" - SUFFIX ".dlm" - PROJECT_LABEL "MAX Plugin: NeL Vertex Tree Painter") - -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +SET_TARGET_PROPERTIES(nel_vertex_tree_paint PROPERTIES SUFFIX ".dlm") +NL_DEFAULT_PROPS(nel_vertex_tree_paint "MAX Plugin: NeL Vertex Tree Painter") +NL_ADD_RUNTIME_FLAGS(nel_vertex_tree_paint) +NL_ADD_LIB_SUFFIX(nel_vertex_tree_paint) INSTALL(TARGETS nel_vertex_tree_paint RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) 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 0e61183c2..4ab422f9a 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 @@ -49,11 +49,11 @@ class VertexPaintClassDesc:public ClassDesc { static VertexPaintClassDesc VertexPaintDesc; ClassDesc* GetVertexPaintDesc() {return &VertexPaintDesc;} -static BOOL CALLBACK VertexPaintDlgProc( +static INT_PTR CALLBACK VertexPaintDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { int numPoints; - VertexPaint *mod = (VertexPaint*)GetWindowLong(hWnd,GWL_USERDATA); + VertexPaint *mod = (VertexPaint*)GetWindowLongPtr(hWnd,GWLP_USERDATA); if (!mod && msg!=WM_INITDIALOG) return FALSE; int comboResult; @@ -86,7 +86,7 @@ static BOOL CALLBACK VertexPaintDlgProc( case WM_INITDIALOG: LoadImages(); mod = (VertexPaint*)lParam; - SetWindowLong(hWnd,GWL_USERDATA,lParam); + SetWindowLongPtr(hWnd,GWLP_USERDATA,lParam); mod->hParams = hWnd; mod->iPaintButton = GetICustButton(GetDlgItem(hWnd, IDC_PAINT)); mod->iPaintButton->SetType(CBT_CHECK); @@ -217,14 +217,14 @@ LRESULT APIENTRY colorSwatchSubclassWndProc( case WM_LBUTTONUP: case WM_LBUTTONDBLCLK: { HWND hPanel = GetParent(hwnd); - LONG mod = GetWindowLong(hPanel,GWL_USERDATA); + LONG mod = GetWindowLongPtr(hPanel,GWLP_USERDATA); if (mod) { ((VertexPaint*)mod)->PaletteButton(hwnd); } } break; case WM_DESTROY: - SetWindowLong(hwnd, GWL_WNDPROC, (LONG) colorSwatchOriginalWndProc); + SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) colorSwatchOriginalWndProc); // Fallthrough... default: return CallWindowProc(colorSwatchOriginalWndProc, hwnd, uMsg, wParam, lParam); @@ -419,13 +419,13 @@ void VertexPaint::BeginEditParams( IObjParam *ip, ULONG flags,Animatable *prev ) int i; for (i=0; i #include "Max.h" #include "resource.h" #include "istdplug.h" @@ -101,7 +102,7 @@ public: class VertexPaint : public Modifier { friend class PaintMouseProc; - friend BOOL CALLBACK VertexPaintDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); + friend INT_PTR CALLBACK VertexPaintDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); public: static IObjParam* ip; diff --git a/code/nel/tools/3d/plugin_max/scripts/nel_assets_png.ms b/code/nel/tools/3d/plugin_max/scripts/nel_assets_png.ms index 531c0f0b8..82d691d5f 100644 --- a/code/nel/tools/3d/plugin_max/scripts/nel_assets_png.ms +++ b/code/nel/tools/3d/plugin_max/scripts/nel_assets_png.ms @@ -101,3 +101,8 @@ for m in getClassInstances NelMaterial do m.delegate.ReflectionMap = undefined m.delegate.RefractionMap = undefined ) + +actionMan.executeAction 0 "40021" -- Selection: Select All +actionMan.executeAction 0 "311" -- Tools: Zoom Extents All Selected +actionMan.executeAction 0 "63508" -- Views: Standard Display with Maps +actionMan.executeAction 0 "40043" -- Selection: Select None diff --git a/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms b/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms index b6b5e0434..7b39adb21 100644 --- a/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms +++ b/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_batched.ms @@ -21,6 +21,10 @@ fn getAbsoluteDestination t = ( return ((getFilenamePath t) + "\\" + (getFilenameFile (filenameFromPath t)) + ".png") ) + else if ((findString t "E:\\Ryzom\\tryker") != undefined) then + ( + return "W:\\database\\Stuff\\Tryker\\Decors\\_textures\\Batiments\\" + (getFilenameFile (filenameFromPath t)) + ".png" + ) else if ((findString t "\\tronc.") != undefined) then ( return "W:\\database\\database_proto\\stuff\\fyros\\objects\\tronc.png" @@ -41,22 +45,93 @@ fn getAbsoluteDestination t = fn getFixedTexturePath t = ( - if (doesFileExist (getAbsoluteSource t)) then + absoluteDestination = (getAbsoluteDestination t) + if (not (doesFileExist absoluteDestination)) and (((findString t "\\Stuff\\Fyros\\Decors\\_textures\\Batiments") != undefined) or ((findString t "\\Stuff\\Fyros\\Decors\\_textures\\Accessories\\Vv2\\") != undefined)) then ( - if not (doesFileExist (getAbsoluteDestination t)) then + testDestination = ("W:\\database\\stuff\\Fyros\\Agents\\_textures\\Accessories\\" + (getFilenameFile (filenameFromPath t)) + ".png") + if (doesFileExist testDestination) then ( - makeDir (getFilenamePath (getAbsoluteDestination t)) all:true - renameFile (getAbsoluteSource t) (getAbsoluteDestination t) - ) - if (doesFileExist (getAbsoluteDestination t)) then - ( - if (getAbsoluteDestination t) != (getAbsoluteSource t) then - ( - deleteFile (getAbsoluteSource t) - ) + return testDestination ) ) - return (getAbsoluteDestination t) + if (not (doesFileExist absoluteDestination)) and (((findString t "\\Stuff\\Fyros\\Decors\\_textures\\Batiments") != undefined) or ((findString t "\\Stuff\\Fyros\\Decors\\_textures\\Accessories\\") != undefined)) then + ( + testDestination = ("W:\\database\\stuff\\Fyros\\Agents\\_textures\\Accessories\\Vv2\\" + (getFilenameFile (filenameFromPath t)) + ".png") + if (doesFileExist testDestination) then + ( + return testDestination + ) + ) + if (not (doesFileExist absoluteDestination)) and ((findString t "\\Stuff\\Fyros\\Decors\\_textures\\Accessories") != undefined) then + ( + testDestination = ("W:\\database\\stuff\\Fyros\\Agents\\_textures\\Batiments\\" + (getFilenameFile (filenameFromPath t)) + ".png") + if (doesFileExist testDestination) then + ( + return testDestination + ) + ) + if (not (doesFileExist absoluteDestination)) and ((findString t "\\Stuff\\Tryker\\Decors\\_textures\\batiments") != undefined) then + ( + testDestination = ("W:\\database\\Stuff\\Tryker\\Decors\\_textures\\batiments\\noutilise\\" + (getFilenameFile (filenameFromPath t)) + ".png") + if (doesFileExist testDestination) then + ( + return testDestination + ) + ) + if (not (doesFileExist absoluteDestination)) and ((findString t "\\Stuff\\Tryker\\Decors\\_textures\\batiments") != undefined) then + ( + testDestination = ("W:\\database\\Stuff\\Tryker\\Decors\\_textures\\batiments\\vv2\\" + (getFilenameFile (filenameFromPath t)) + ".png") + if (doesFileExist testDestination) then + ( + return testDestination + ) + ) + if (not (doesFileExist absoluteDestination)) and ((findString t "\\Stuff\\Tryker\\Decors\\_textures\\batiments") != undefined) then + ( + testDestination = ("W:\\database\\Stuff\\Tryker\\Decors\\_textures\\batiments\\tempautel\\" + (getFilenameFile (filenameFromPath t)) + ".png") + if (doesFileExist testDestination) then + ( + return testDestination + ) + ) + if (not (doesFileExist absoluteDestination)) and ((findString t "\\Stuff\\Tryker\\Decors\\_textures\\batiments") != undefined) then + ( + testDestination = ("W:\\database\\Stuff\\Tryker\\Decors\\_textures\\batiments\\" + (getFilenameFile (filenameFromPath t)) + ".png") + if (doesFileExist testDestination) then + ( + return testDestination + ) + ) + if (not (doesFileExist absoluteDestination)) and ((findString t "\\Stuff\\Fyros\\Decors\\_textures") != undefined) then + ( + testDestination = ("W:\\database\\Stuff\\Fyros\\Decors\\_textures\\Batiments\\" + (getFilenameFile (filenameFromPath t)) + ".png") + if (doesFileExist testDestination) then + ( + return testDestination + ) + ) + if (not (doesFileExist absoluteDestination)) and ((findString t "\\Stuff\\Fyros\\Decors\\_textures") != undefined) then + ( + testDestination = ("W:\\database\\Stuff\\Tryker\\Decors\\_textures\\Batiments\\" + (getFilenameFile (filenameFromPath t)) + ".png") + if (doesFileExist testDestination) then + ( + return testDestination + ) + ) + if (not (doesFileExist absoluteDestination)) and ((findString t "\\sky_V2\\textures\\textures") != undefined) then + ( + testDestination = ("W:\\database\\sky_V2\\textures\\textures\\nodds\\" + (getFilenameFile (filenameFromPath t)) + ".png") + if (doesFileExist testDestination) then (return testDestination) + testDestination = ("W:\\database\\sky_V2\\textures\\textures\\desert\\" + (getFilenameFile (filenameFromPath t)) + ".png") + if (doesFileExist testDestination) then (return testDestination) + testDestination = ("W:\\database\\sky_V2\\textures\\textures\\forest\\" + (getFilenameFile (filenameFromPath t)) + ".png") + if (doesFileExist testDestination) then (return testDestination) + testDestination = ("W:\\database\\sky_V2\\textures\\textures\\jungle\\" + (getFilenameFile (filenameFromPath t)) + ".png") + if (doesFileExist testDestination) then (return testDestination) + testDestination = ("W:\\database\\sky_V2\\textures\\textures\\lacustre\\" + (getFilenameFile (filenameFromPath t)) + ".png") + if (doesFileExist testDestination) then (return testDestination) + ) + return absoluteDestination ) fn renameTexture t = @@ -169,9 +244,15 @@ rollout assets_png_rollout "Properties" m.delegate.ReflectionMap = undefined m.delegate.RefractionMap = undefined ) - actionMan.executeAction 0 "63508" -- Views: Standard Display with Maps + actionMan.executeAction 0 "40021" -- Selection: Select All actionMan.executeAction 0 "311" -- Tools: Zoom Extents All Selected + actionMan.executeAction 0 "40807" -- Views: Activate All Maps + actionMan.executeAction 0 "63508" -- Views: Standard Display with Maps + actionMan.executeAction 0 "40043" -- Selection: Select None + + max views redraw + return 1 ) diff --git a/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_database.ms b/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_database.ms index cd372322c..2d119e4e0 100644 --- a/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_database.ms +++ b/code/nel/tools/3d/plugin_max/scripts/nel_assets_png_database.ms @@ -141,3 +141,8 @@ for m in getClassInstances NelMaterial do m.delegate.ReflectionMap = undefined m.delegate.RefractionMap = undefined ) + +actionMan.executeAction 0 "40021" -- Selection: Select All +actionMan.executeAction 0 "311" -- Tools: Zoom Extents All Selected +actionMan.executeAction 0 "63508" -- Views: Standard Display with Maps +actionMan.executeAction 0 "40043" -- Selection: Select None diff --git a/code/nel/tools/3d/plugin_max/tile_utility/CMakeLists.txt b/code/nel/tools/3d/plugin_max/tile_utility/CMakeLists.txt index 8430da2ec..5fc407eee 100644 --- a/code/nel/tools/3d/plugin_max/tile_utility/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/tile_utility/CMakeLists.txt @@ -2,9 +2,8 @@ FILE(GLOB SRC *.cpp *.h *.def) ADD_LIBRARY(tile_utility SHARED ${SRC} tile_utility.rc) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${MAXSDK_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${MAXSDK_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(tile_utility - ${LIBXML2_LIBRARIES} nelmisc nel3d nel_mesh_lib @@ -14,15 +13,9 @@ TARGET_LINK_LIBRARIES(tile_utility Version.lib comctl32.lib) -SET_TARGET_PROPERTIES(tile_utility PROPERTIES - VERSION ${NL_VERSION} - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - SUFFIX ".dlu" - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r" - PROJECT_LABEL "MAX Plugin: Tile Utility") - -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +SET_TARGET_PROPERTIES(tile_utility PROPERTIES SUFFIX ".dlu") +NL_DEFAULT_PROPS(tile_utility "MAX Plugin: Tile Utility") +NL_ADD_RUNTIME_FLAGS(tile_utility) +NL_ADD_LIB_SUFFIX(tile_utility) INSTALL(TARGETS tile_utility RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) 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 5ca8454fa..46c9f35cb 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 @@ -83,7 +83,7 @@ class Tile_utilityClassDesc:public ClassDesc2 static Tile_utilityClassDesc Tile_utilityDesc; ClassDesc2* GetTile_utilityDesc() {return &Tile_utilityDesc;} -static BOOL CALLBACK Tile_utilityDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +static INT_PTR CALLBACK Tile_utilityDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { diff --git a/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.h b/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.h index 336c7aec2..5962f6809 100644 --- a/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.h +++ b/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.h @@ -22,6 +22,7 @@ #define _CRT_SECURE_NO_DEPRECATE +#include #include #include #include diff --git a/code/nel/tools/3d/s3tc_compressor_lib/s3tc_compressor.cpp b/code/nel/tools/3d/s3tc_compressor_lib/s3tc_compressor.cpp index 49d4e5923..441d58020 100644 --- a/code/nel/tools/3d/s3tc_compressor_lib/s3tc_compressor.cpp +++ b/code/nel/tools/3d/s3tc_compressor_lib/s3tc_compressor.cpp @@ -28,7 +28,7 @@ static void compressMipMap(uint8 *pixSrc, sint width, sint height, vector0) { return DXT1A; } - + if(h.ddpf.dwFourCC==MAKEFOURCC('D','X', 'T', '3')) { return DXT3; @@ -86,17 +97,29 @@ uint8 getType(const char *sFileNameDest) return NOT_DEFINED; } -bool sameType(const char *sFileNameDest, uint8 &algo, bool wantMipMap) +bool sameType(const std::string &sFileNameDest, uint8 &algo, bool wantMipMap) { uint32 dds; - FILE *f = fopen(sFileNameDest,"rb"); + FILE *f = fopen(sFileNameDest.c_str(),"rb"); if(f==NULL) { return false; } + CS3TCCompressor::DDS_HEADER h; - fread(&dds,1,4,f); - fread(&h,sizeof(::DDS_HEADER),1,f); + + if (fread(&dds,1,4,f) != 4) + { + fclose(f); + return false; + } + + if (fread(&h,sizeof(::DDS_HEADER),1,f) != 1) + { + fclose(f); + return false; + } + if(fclose(f)) { cerr<0) algoOk=true; break; - + case DXT3: if(h.ddpf.dwFourCC==MAKEFOURCC('D','X', 'T', '3')) algoOk=true; @@ -129,7 +152,7 @@ bool sameType(const char *sFileNameDest, uint8 &algo, bool wantMipMap) } if(!algoOk) return false; - + // Test Mipmap. bool fileHasMipMap= (h.dwFlags&DDSD_MIPMAPCOUNT) && (h.dwMipMapCount>1); if(fileHasMipMap==wantMipMap) @@ -140,53 +163,36 @@ bool sameType(const char *sFileNameDest, uint8 &algo, bool wantMipMap) -bool dataCheck(const char *sFileNameSrc, const char *sFileNameDest, uint8& algo, bool wantMipMap) +bool dataCheck(const std::string &sFileNameSrc, const std::string &sFileNameDest, uint8& algo, bool wantMipMap) { - HANDLE h1 = CreateFile( sFileNameSrc, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if(h1 == INVALID_HANDLE_VALUE) + if (!CFile::fileExists(sFileNameSrc)) { - cerr<<"Can't open file "< lastWriteTime2) { return false; } - if(nComp==-1) + if (lastWriteTime1 < lastWriteTime2) { if(!sameType(sFileNameDest, algo, wantMipMap)) { return false; // file exists but a new compression type is required } - return true; } return true; } - void writeInstructions() { cout< [-o ] [-a ] [-m]"<>2; } } @@ -379,14 +385,12 @@ int main(int argc, char **argv) return 0; } - // Reading TGA or PNG and converting to RGBA //==================================== CBitmap picTga; CBitmap picTga2; CBitmap picSrc; - std::string inputFileName(argv[1]); if(inputFileName.find("_usercolor") RGBADest; RGBADest.resize(height*width*4); uint dstRGBADestId= 0; - - - // UserColor //=========== @@ -488,15 +489,14 @@ int main(int argc, char **argv) if (pos == std::string::npos) { // name whithout extension - userColorFileName = inputFileName + "_usercolor"; + userColorFileName = inputFileName + "_usercolor"; } else { // append input filename extension userColorFileName = inputFileName.substr(0,pos) + "_usercolor" + inputFileName.substr(pos); } - - + // Reading second Tga for user color, don't complain if _usercolor is missing NLMISC::CIFile input2; if (CPath::exists(userColorFileName) && input2.open(userColorFileName)) @@ -508,8 +508,6 @@ int main(int argc, char **argv) nlassert(height2==height); picTga2.convertToType (CBitmap::RGBA); - - RGBASrc2 = picTga2.getPixels(); NLMISC::CRGBA *pRGBASrc = (NLMISC::CRGBA*)&RGBASrc[0]; @@ -519,7 +517,7 @@ int main(int argc, char **argv) { // If no UserColor, must take same RGB, and keep same Alpha from src1 !!! So texture can have both alpha // userColor and other alpha usage. - if(pRGBASrc2[i].A==255) + if(pRGBASrc2[i].A==255) { RGBADest[dstRGBADestId++]= pRGBASrc[i].R; RGBADest[dstRGBADestId++]= pRGBASrc[i].G; @@ -610,12 +608,12 @@ int main(int argc, char **argv) cerr<<"Can't open output file "< tagTime): + updateCount = updateCount + 1 + else: + skipCount = skipCount + 1 + else: + updateCount = updateCount + 1 + if updateCount > 0: + printLog(log, "UPDATE " + str(updateCount) + " / " + str(len(sourceFiles)) + "; SKIP " + str(skipCount) + " / " + str(len(sourceFiles)) + "; DEST " + str(len(destFiles))) + return 1 + else: + printLog(log, "SKIP " + str(skipCount) + " / " + str(len(sourceFiles)) + "; DEST " + str(len(destFiles))) + return 0 + +def needUpdateDirNoSubdirLogExt(log, dir_source, ext_source, dir_dest, ext_dest): + latestSourceFile = 0 + latestDestFile = 0 + sourceFiles = findFilesNoSubdir(log, dir_source, ext_source) + destFiles = findFilesNoSubdir(log, dir_dest, ext_dest) + for file in sourceFiles: + fileTime = os.stat(dir_source + "/" + file).st_mtime + if (fileTime > latestSourceFile): + latestSourceFile = fileTime + for file in destFiles: + fileTime = os.stat(dir_dest + "/" + file).st_mtime + if (fileTime > latestDestFile): + latestDestFile = fileTime + if latestSourceFile > latestDestFile or len(sourceFiles) > len(destFiles): + printLog(log, "UPDATE; Source: " + str(latestSourceFile) + ", " + str(len(sourceFiles)) + " files; Dest: " + str(latestDestFile) + ", " + str(len(destFiles)) + " files") + return 1 + else: + printLog(log, "SKIP *") + return 0 + +def needUpdateDirNoSubdirLogExtMultidir(log, all_dir_base, all_dir_source, dir_source, ext_source, dir_dest, ext_dest): + latestSourceFile = 0 + latestDestFile = 0 + sourceFilesAll = [ ] + for dir in all_dir_source: + sourceFilesAll += findFilesNoSubdir(log, all_dir_base + "/" + dir, ext_source) + sourceFiles = findFilesNoSubdir(log, dir_source, ext_source) + destFiles = findFilesNoSubdir(log, dir_dest, ext_dest) + for file in sourceFiles: + fileTime = os.stat(dir_source + "/" + file).st_mtime + if (fileTime > latestSourceFile): + latestSourceFile = fileTime + for file in destFiles: + fileTime = os.stat(dir_dest + "/" + file).st_mtime + if (fileTime > latestDestFile): + latestDestFile = fileTime + if latestSourceFile > latestDestFile or len(sourceFilesAll) > len(destFiles): + printLog(log, "UPDATE; Source: " + str(latestSourceFile) + ", " + str(len(sourceFilesAll)) + " files; Dest: " + str(latestDestFile) + ", " + str(len(destFiles)) + " files") + return 1 + else: + printLog(log, "SKIP *") + return 0 + def findTool(log, dirs_where, file_name, suffix): try: for dir in dirs_where: diff --git a/code/nel/tools/build_gamedata/configuration/tools.py b/code/nel/tools/build_gamedata/configuration/tools.py index d02f0347b..ed3e2fbb8 100644 --- a/code/nel/tools/build_gamedata/configuration/tools.py +++ b/code/nel/tools/build_gamedata/configuration/tools.py @@ -49,6 +49,8 @@ LigoExportTimeout = 3600000 LigoBuildTimeout = 1800000 PacsPrimExportTimeout = 600000 +MaxShapeExportTimeout = 300000 # 5min + # *** TOOLS CONFIGURATION *** TgaToDdsTool = "tga2dds" @@ -82,3 +84,4 @@ LandExportTool = "land_export" PrimExportTool = "prim_export" IgElevationTool = "ig_elevation" IgAddTool = "ig_add" +BuildClodBankTool = "build_clod_bank" diff --git a/code/nel/tools/build_gamedata/generators/ecosystem_project_template/directories.py b/code/nel/tools/build_gamedata/generators/ecosystem_project_template/directories.py new file mode 100644 index 000000000..50157963e --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/ecosystem_project_template/directories.py @@ -0,0 +1,196 @@ +#!/usr/bin/python +# +# ################################################################# +# ## %PreGenWarning% +# ################################################################# +# +# \file directories.py +# \brief Directories configuration +# \date %PreGenDateTimeStamp% +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration for '%PreGenEcosystemName%' ecosystem. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + + +# *** ECOSYSTEM AND CONTINENT NAMES *** + +EcosystemName = "%PreGenEcosystemName%" +EcosystemPath = "ecosystems/" + EcosystemName +CommonName = EcosystemName +CommonPath = EcosystemPath + +DatabaseRootName = "%PreGenDatabaseRootName%" +DatabaseRootPath = "stuff/" + DatabaseRootName + + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + +# Shape directories +ShapeSourceDirectories = [ ] +ShapeSourceDirectories += [ DatabaseRootPath + "/decors/vegetations" ] +ShapeSourceDirectories += [ "landscape/ligo/" + EcosystemName + "/max" ] + +# Maps directories +MapSourceDirectories = [ ] +MapSourceDirectories += [ DatabaseRootPath + "/decors/_textures" ] +%PreGenMapSubdirectories%MapSourceDirectories += [ "landscape/microveget/" + EcosystemName + "" ] +MapSourceDirectories += [ "landscape/water/meshes/" + EcosystemName + "" ] + +MapUncompressedSourceDirectories = [ ] + +# Tiles directories +TilesSourceDirectories = [ ] +%PreGenTileSourceDirectories% +# Tiles root directory +TileRootSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + +# Displace directory +DisplaceSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + "/displace" + +# Do not use, needs to be removed and fixed in processes +DisplaceSourceDirectories = [ ] +DisplaceSourceDirectories += [ DisplaceSourceDirectory ] + +# Bank directory +BankSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + +# Vegetable set directories +VegetSetSourceDirectories = [ ] +VegetSetSourceDirectories += [ "landscape/microveget/" + EcosystemName ] + +# Veget directories +VegetSourceDirectories = [ ] +VegetSourceDirectories += [ "landscape/microveget/" + EcosystemName ] + +# Ligo directories +LigoBaseSourceDirectory = "landscape/ligo/" + EcosystemName +LigoMaxSourceDirectory = LigoBaseSourceDirectory + "/max" + +# Zone directories +ZoneSourceDirectory = [ "landscape/zones/" + EcosystemName ] # For old snowballs style landscape when not using ligo + +# Ig landscape directories +IgLandSourceDirectory = "_invalid" + +# Ig other directories +IgOtherSourceDirectory = "_invalid" + +# PACS primitives directories +PacsPrimSourceDirectories = [ ] +PacsPrimSourceDirectories += [ DatabaseRootPath + "/decors/vegetations" ] + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Shape directories +ShapeTagExportDirectory = CommonPath + "/shape_tag" +ShapeNotOptimizedExportDirectory = CommonPath + "/shape_not_optimized" +ShapeWithCoarseMeshExportDirectory = CommonPath + "/shape_with_coarse_mesh" +ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_optimized" +ShapeAnimExportDirectory = CommonPath + "/shape_anim" + +# Smallbank directories +SmallbankExportDirectory = CommonPath + "/smallbank" + +# Tiles directories +TilesExportDirectory = CommonPath + "/tiles" + +# Tiles directories +DisplaceExportDirectory = CommonPath + "/diplace" + +# Veget directories +VegetExportDirectory = CommonPath + "/veget" +VegetTagExportDirectory = CommonPath + "/veget_tag" + +# Veget Set directories +VegetSetExportDirectory = CommonPath + "/veget_set" + +# Ligo directories +LigoDatabaseExportDirectory = "landscape/ligo/" + EcosystemName +LigoDatabaseIgExportDirectory = LigoDatabaseExportDirectory + "/igs" +LigoDatabaseZoneExportDirectory = LigoDatabaseExportDirectory + "/zones" +LigoDatabaseZoneLigoExportDirectory = LigoDatabaseExportDirectory + "/zoneligos" +LigoDatabaseCmbExportDirectory = LigoDatabaseExportDirectory + "/cmb" +LigoTagExportDirectory = CommonPath + "/ligo_tag" + +# Zone directories +ZoneExportDirectory = CommonPath + "/zone" + +# PACS primitives directories +PacsPrimExportDirectory = CommonPath + "/pacs_prim" + + +# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** + +# Map directories +MapBuildDirectory = CommonPath + "/map" +MapPanoplyBuildDirectory = CommonPath + "/map_panoply" + +# Shape directories +ShapeClodtexBuildDirectory = CommonPath + "/shape_clodtex_build" +ShapeWithCoarseMeshBuildDirectory = CommonPath + "/shape_with_coarse_mesh_builded" +ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" +ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" + +# Farbank directories +FarbankBuildDirectory = CommonPath + "/farbank" + +# Ig directories ************** TODO CONFIRM IN IG BUILD PROCESS ************ FIX RBANK IF NEEDED *********** +IgLandBuildDirectory = "_invalid" +IgOtherBuildDirectory = "_invalid" + +# Rbank directories +RbankOutputBuildDirectory = "_invalid" +RbankMeshBuildDirectory = "_invalid" + +# Ligo directories + + +# *** INSTALL DIRECTORIES IN THE CLIENT DATA *** + +# Map directory +MapClientDirectory = CommonName + "_maps" +BitmapClientDirectory = MapClientDirectory + +# Shape directory +ShapeClientDirectory = CommonName + "_shapes" + +# Lightmap directory +LightmapClientDirectory = CommonName + "_lightmaps" + +# Tile directory +TilesClientDirectory = CommonName + "_tiles" + +# Displace directory +DisplaceClientDirectory = CommonName + "_displaces" + +# Bank directory +BankClientDirectory = CommonName + "_bank" + +# Vegetable set directory +VegetSetClientDirectory = CommonName + "_vegetable_sets" + +# Vegetable shape directory +VegetClientDirectory = CommonName + "_vegetables" + +# PACS primitives directories +PacsPrimClientDirectory = CommonName + "_pacs_prim" diff --git a/code/nel/tools/build_gamedata/generators/ecosystem_project_template/process.py b/code/nel/tools/build_gamedata/generators/ecosystem_project_template/process.py new file mode 100644 index 000000000..7a7478b99 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/ecosystem_project_template/process.py @@ -0,0 +1,120 @@ +#!/usr/bin/python +# +# ################################################################# +# ## %PreGenWarning% +# ################################################################# +# +# \file config.py +# \brief Process configuration +# \date %PreGenDateTimeStamp% +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration for '%PreGenEcosystemName%' ecosystem. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** PROCESS CONFIGURATION *** + +# *** PROCESS CONFIG *** +ProcessToComplete = [ ] +ProcessToComplete += [ "shape" ] +ProcessToComplete += [ "map" ] +ProcessToComplete += [ "smallbank" ] +ProcessToComplete += [ "farbank" ] +ProcessToComplete += [ "tiles" ] +ProcessToComplete += [ "displace" ] +ProcessToComplete += [ "veget" ] +ProcessToComplete += [ "vegetset" ] +ProcessToComplete += [ "ligo" ] +ProcessToComplete += [ "pacs_prim" ] + + +# *** ECOSYSTEM AND CONTINENT NAMES *** + +EcosystemName = "%PreGenEcosystemName%" +EcosystemPath = "ecosystems/" + EcosystemName +CommonName = EcosystemName +CommonPath = EcosystemPath + + +# *** MAP EXPORT OPTIONS *** +PanoplyFileList = [ ] +HlsBankFileName = "" + +# *** SHAPE EXPORT OPTIONS *** + +# Compute lightmaps ? +ShapeExportOptExportLighting = "%PreGenShapeExportOptExportLighting%" + +# Cast shadow in lightmap ? +ShapeExportOptShadow = "%PreGenShapeExportOptShadow%" + +# Lighting limits. 0 : normal, 1 : soft shadows +ShapeExportOptLightingLimit = %PreGenShapeExportOptLightingLimit% + +# Lightmap lumel size +ShapeExportOptLumelSize = "%PreGenShapeExportOptLumelSize%" + +# Oversampling value. Can be 1, 2, 4 or 8 +ShapeExportOptOversampling = %PreGenShapeExportOptOversampling% + +# Does the lightmap must be generated in 8 bits format ? +ShapeExportOpt8BitsLightmap = "%PreGenShapeExportOpt8BitsLightmap%" + +# Does the lightmaps export must generate logs ? +ShapeExportOptLightmapLog = "%PreGenShapeExportOptLightmapLog%" + +# Coarse mesh texture mul size +TextureMulSizeValue = "%PreGenTextureMulSizeValue%" + +DoBuildShadowSkin = 0 + +ClodConfigFile = "" + +# *** COARSE MESH TEXTURE NAME *** +CoarseMeshTextureNames = [ ] +%PreGenCoarseMeshTextureNames% +# *** POSTFIX USED BY THE MULTIPLE TILES SYSTEM *** +MultipleTilesPostfix = [ ] +%PreGenMultipleTilesPostfix% +# *** BANK EXPORT OPTIONS *** + +# Name of the tilebank to use +BankTileBankName = EcosystemName + +# *** RBANK EXPORT OPTIONS *** + +# Output names +RbankRbankName = "_invalid" + +# *** LIGO OPTIONS *** + +LigoExportLand = "" +LigoExportOnePass = 0 + +# *** MAPS OPTIONS *** + +ReduceBitmapFactor = 0 + +# *** SHAPE BUILD OPTIONS * + +DoBuildShadowSkin = False +ClodConfigFile = "" + +# *** PACS_PRIM OPTIONS *** +WantLandscapeColPrimPacsList = True diff --git a/code/nel/tools/build_gamedata/generators/generate_all.py b/code/nel/tools/build_gamedata/generators/generate_all.py new file mode 100644 index 000000000..f6af77bc2 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/generate_all.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Run all setup processes +# \date 2009-02-18 15:28GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Run all setup processes +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../configuration") +if os.path.isfile("generate_all.log"): + os.remove("generate_all.log") +log = open("generate_all.log", "w") +from scripts import * +from buildsite import * +from tools import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Generate all") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + + +try: + subprocess.call([ "python", "generate_simple_max_exporters.py" ]) +except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) +printLog(log, "") + + +try: + subprocess.call([ "python", "generate_tagged_max_exporters.py" ]) +except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) +printLog(log, "") + + +try: + subprocess.call([ "python", "generate_ecosystem_projects.py" ]) +except Exception, e: + printLog(log, "<" + processName + "> " + str(e)) +printLog(log, "") + + +log.close() diff --git a/code/nel/tools/build_gamedata/generators/generate_ecosystem_projects.py b/code/nel/tools/build_gamedata/generators/generate_ecosystem_projects.py new file mode 100644 index 000000000..7802b16f6 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/generate_ecosystem_projects.py @@ -0,0 +1,278 @@ +#!/usr/bin/python +# +# \file generate_ecosystem_projects.py +# \brief Run all setup processes +# \date 2010-09-02 10:36GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Generate ecosystem projects +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../configuration") +if os.path.isfile("generate_ecosystem_projects.log"): + os.remove("generate_ecosystem_projects.log") +log = open("generate_ecosystem_projects.log", "w") +from scripts import * +from buildsite import * +from tools import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Generate ecosystem projects") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +templateDir = os.getcwd().replace("\\", "/") + "/ecosystem_project_template" +mkPath(log, templateDir) + +os.chdir("..") + + +# Scroll down to add an ecosystem. + + + +DefaultShapeExportOptExportLighting = "true" +DefaultShapeExportOptShadow = "true" +DefaultShapeExportOptLightingLimit = "1" +DefaultShapeExportOptLumelSize = "0.25" +DefaultShapeExportOptOversampling = "1" +DefaultShapeExportOpt8BitsLightmap = "true" +DefaultShapeExportOptLightmapLog = "true" +DefaultTextureMulSizeValue = "1.5" +DefaultSeasonSuffixes = [ "sp" ] + [ "su" ] + [ "au" ] + [ "wi" ] +DefaultMapSubdirectories = [ ] +DefaultTileDirectories = [ ] + + +ShapeExportOptExportLighting = DefaultShapeExportOptExportLighting +ShapeExportOptShadow = DefaultShapeExportOptShadow +ShapeExportOptLightingLimit = DefaultShapeExportOptLightingLimit +ShapeExportOptLumelSize = DefaultShapeExportOptLumelSize +ShapeExportOptOversampling = DefaultShapeExportOptOversampling +ShapeExportOpt8BitsLightmap = DefaultShapeExportOpt8BitsLightmap +ShapeExportOptLightmapLog = DefaultShapeExportOptLightmapLog +TextureMulSizeValue = DefaultTextureMulSizeValue +SeasonSuffixes = DefaultSeasonSuffixes +MapSubdirectories = DefaultMapSubdirectories +TileDirectories = DefaultTileDirectories + + +PreGenDateTimeStamp = None +PreGenEcosystemName = None +PreGenDatabaseRootName = None +PreGenCoarseMeshTextureNames = None +PreGenMultipleTilesPostfix = None +PreGenMapSubdirectories = None +PreGenTileSourceDirectories = None + + +def transformLine(line): + newline = line.replace("%PreGenWarning%", "WARNING : this is a generated file, don't change it !") + newline = newline.replace("%PreGenDateTimeStamp%", PreGenDateTimeStamp) + + newline = newline.replace("%PreGenEcosystemName%", PreGenEcosystemName) + newline = newline.replace("%PreGenDatabaseRootName%", PreGenDatabaseRootName) + + newline = newline.replace("%PreGenCoarseMeshTextureNames%", PreGenCoarseMeshTextureNames) + newline = newline.replace("%PreGenMultipleTilesPostfix%", PreGenMultipleTilesPostfix) + newline = newline.replace("%PreGenMapSubdirectories%", PreGenMapSubdirectories) + newline = newline.replace("%PreGenTileSourceDirectories%", PreGenTileSourceDirectories) + + newline = newline.replace("%PreGenShapeExportOptExportLighting%", ShapeExportOptExportLighting) + newline = newline.replace("%PreGenShapeExportOptShadow%", ShapeExportOptShadow) + newline = newline.replace("%PreGenShapeExportOptLightingLimit%", ShapeExportOptLightingLimit) + newline = newline.replace("%PreGenShapeExportOptLumelSize%", ShapeExportOptLumelSize) + newline = newline.replace("%PreGenShapeExportOptOversampling%", ShapeExportOptOversampling) + newline = newline.replace("%PreGenShapeExportOpt8BitsLightmap%", ShapeExportOpt8BitsLightmap) + newline = newline.replace("%PreGenShapeExportOptLightmapLog%", ShapeExportOptLightmapLog) + newline = newline.replace("%PreGenTextureMulSizeValue%", TextureMulSizeValue) + newline = newline.replace("%PreGenTileSourceDirectories%", PreGenTileSourceDirectories) + + return newline + +def generateFile(sourceFile, destFile): + srcf = open(sourceFile, "r") + dstf = open(destFile, "w") + printLog(log, "WRITE " + destFile) + for line in srcf: + dstf.write(transformLine(line)) + dstf.close() + srcf.close() + +def generateEcosystem(ecosystemName, databaseRootName): + global PreGenEcosystemName + PreGenEcosystemName = ecosystemName + global PreGenDatabaseRootName + PreGenDatabaseRootName = databaseRootName + global PreGenDateTimeStamp + PreGenDateTimeStamp = time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + + global PreGenMultipleTilesPostfix + PreGenMultipleTilesPostfix = "" + global PreGenCoarseMeshTextureNames + PreGenCoarseMeshTextureNames = "" + global PreGenTileSourceDirectories + PreGenTileSourceDirectories = "" + for suffix in SeasonSuffixes: + PreGenMultipleTilesPostfix += "MultipleTilesPostfix += [ \"_" + suffix + "\" ]\n" + PreGenCoarseMeshTextureNames += "CoarseMeshTextureNames += [ \"nel_coarse_mesh_\" + EcosystemName + \"_" + suffix + "\" ]\n" + for tiledir in TileDirectories: + PreGenTileSourceDirectories += "TilesSourceDirectories += [ \"landscape/_texture_tiles/\" + EcosystemName + \"_" + suffix + "/" + tiledir + "\" ]\n" + global PreGenMapSubdirectories + PreGenMapSubdirectories = "" + for subdir in MapSubdirectories: + PreGenMapSubdirectories += "MapSourceDirectories += [ DatabaseRootPath + \"/decors/_textures/" + subdir + "\" ]\n" + + destDir = WorkspaceDirectory + "/ecosystems/" + ecosystemName + mkPath(log, destDir) + + generateFile(templateDir + "/process.py", destDir + "/process.py") + generateFile(templateDir + "/directories.py", destDir + "/directories.py") + + return + + + +# Add new ecosystems below this line. + + + +# DESERT +ShapeExportOptExportLighting = DefaultShapeExportOptExportLighting +ShapeExportOptShadow = DefaultShapeExportOptShadow +ShapeExportOptLightingLimit = DefaultShapeExportOptLightingLimit +ShapeExportOptLumelSize = DefaultShapeExportOptLumelSize +ShapeExportOptOversampling = DefaultShapeExportOptOversampling +ShapeExportOpt8BitsLightmap = DefaultShapeExportOpt8BitsLightmap +ShapeExportOptLightmapLog = DefaultShapeExportOptLightmapLog +TextureMulSizeValue = DefaultTextureMulSizeValue +SeasonSuffixes = DefaultSeasonSuffixes +MapSubdirectories = [ ] +MapSubdirectories += [ "vegetations" ] +TileDirectories = [ ] +TileDirectories += [ "1.5-marecage_profond" ] +TileDirectories += [ "1-marecages" ] +TileDirectories += [ "2-citees" ] +TileDirectories += [ "3-fond_canyon" ] +TileDirectories += [ "4.2-boisbandeclair" ] +TileDirectories += [ "4.5-desert2boisbande" ] +TileDirectories += [ "4-falaise_bois_bande" ] +TileDirectories += [ "5-falaise_normales" ] +TileDirectories += [ "6.5-desertalternatif" ] +TileDirectories += [ "6-desert" ] +TileDirectories += [ "7-routes" ] +TileDirectories += [ "8-foretbrule" ] +generateEcosystem("desert", "fyros") + + +# JUNGLE +ShapeExportOptExportLighting = DefaultShapeExportOptExportLighting +ShapeExportOptShadow = DefaultShapeExportOptShadow +ShapeExportOptLightingLimit = DefaultShapeExportOptLightingLimit +ShapeExportOptLumelSize = DefaultShapeExportOptLumelSize +ShapeExportOptOversampling = DefaultShapeExportOptOversampling +ShapeExportOpt8BitsLightmap = "false" +ShapeExportOptLightmapLog = DefaultShapeExportOptLightmapLog +TextureMulSizeValue = DefaultTextureMulSizeValue +SeasonSuffixes = DefaultSeasonSuffixes +MapSubdirectories = [ ] +MapSubdirectories += [ "vegetations" ] +TileDirectories = [ ] +TileDirectories += [ "10-crevassejungle" ] +TileDirectories += [ "11-paroisjungle" ] +TileDirectories += [ "12-vasejungle" ] +TileDirectories += [ "1-junglemousse" ] +TileDirectories += [ "2-junglefeuilles" ] +TileDirectories += [ "3-jungleherbesseche" ] +TileDirectories += [ "4-jungleherbevieille" ] +TileDirectories += [ "5-jungleterreaux" ] +TileDirectories += [ "6-junglegoo" ] +TileDirectories += [ "7-sciurejungle" ] +TileDirectories += [ "8-terrejungle" ] +TileDirectories += [ "9-falaisejungle" ] +TileDirectories += [ "Transitions" ] +generateEcosystem("jungle", "jungle") + + +# PRIMES RACINES +ShapeExportOptExportLighting = DefaultShapeExportOptExportLighting +ShapeExportOptShadow = DefaultShapeExportOptShadow +ShapeExportOptLightingLimit = DefaultShapeExportOptLightingLimit +ShapeExportOptLumelSize = DefaultShapeExportOptLumelSize +ShapeExportOptOversampling = DefaultShapeExportOptOversampling +ShapeExportOpt8BitsLightmap = "false" +ShapeExportOptLightmapLog = DefaultShapeExportOptLightmapLog +TextureMulSizeValue = DefaultTextureMulSizeValue +SeasonSuffixes = DefaultSeasonSuffixes +MapSubdirectories = [ ] +MapSubdirectories += [ "vegetations" ] +MapSubdirectories += [ "batiments" ] +TileDirectories = [ ] +TileDirectories += [ "PR-creux" ] +TileDirectories += [ "PR-dome-moussu" ] +TileDirectories += [ "PR-kitiniere" ] +TileDirectories += [ "PR-mousse-licken" ] +TileDirectories += [ "PR-mousse-spongieus" ] +TileDirectories += [ "PR-parois" ] +TileDirectories += [ "PR-sol-mousse" ] +TileDirectories += [ "PR-souche" ] +TileDirectories += [ "PR-stalagmite" ] +TileDirectories += [ "PR-terre" ] +TileDirectories += [ "aditif" ] +generateEcosystem("primes_racines", "primes_racines") + + +# LACUSTRE +ShapeExportOptExportLighting = DefaultShapeExportOptExportLighting +ShapeExportOptShadow = DefaultShapeExportOptShadow +ShapeExportOptLightingLimit = "0" +ShapeExportOptLumelSize = DefaultShapeExportOptLumelSize +ShapeExportOptOversampling = "8" +ShapeExportOpt8BitsLightmap = "false" +ShapeExportOptLightmapLog = DefaultShapeExportOptLightmapLog +TextureMulSizeValue = DefaultTextureMulSizeValue +SeasonSuffixes = DefaultSeasonSuffixes +MapSubdirectories = [ ] +MapSubdirectories += [ "vegetations" ] +TileDirectories = [ ] +TileDirectories += [ "1a-sable-marin" ] +TileDirectories += [ "1-plages" ] +TileDirectories += [ "2-iles" ] +TileDirectories += [ "2-ilesa" ] +TileDirectories += [ "2-iles-marines" ] +TileDirectories += [ "3-fondmarin2plage" ] +TileDirectories += [ "4-marecages" ] +TileDirectories += [ "5-marecages" ] +TileDirectories += [ "5-parois-marine" ] +TileDirectories += [ "6-fond_marin" ] +TileDirectories += [ "7-bassesiles" ] +TileDirectories += [ "7-mousseter" ] +TileDirectories += [ "7-racines" ] +TileDirectories += [ "8-mousse_marine" ] +TileDirectories += [ "constructible" ] +generateEcosystem("lacustre", "tryker") + + + + +printLog(log, "") +log.close() diff --git a/code/nel/tools/build_gamedata/generators/generate_simple_max_exporters.py b/code/nel/tools/build_gamedata/generators/generate_simple_max_exporters.py new file mode 100644 index 000000000..d6d65d689 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/generate_simple_max_exporters.py @@ -0,0 +1,104 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Run all setup processes +# \date 2009-02-18 15:28GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Run all setup processes +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../configuration") +if os.path.isfile("generate_simple_max_exporters.log"): + os.remove("generate_simple_max_exporters.log") +log = open("generate_simple_max_exporters.log", "w") +from scripts import * +from buildsite import * +from tools import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Generate simple max exporters") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +def processLine(line, processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp): + newline = line.replace("%PreGenWarning%", "WARNING : this is a generated file, don't change it !") + newline = newline.replace("%PreGenDateTimeStamp%", dateTimeStamp) + newline = newline.replace("%PreGenProcessName%", processName) + newline = newline.replace("%PreGenFileExtension%", fileExtension) + newline = newline.replace("%PreGenSourceDirectoriesVariable%", sourceDirectoriesVariable) + newline = newline.replace("%PreGenExportDirectoryVariable%", exportDirectoryVariable) + newline = newline.replace("%PreGenClientDirectoryVariable%", clientDirectoryVariable) + return newline + +def generateSimpleMaxExporterFile(sourceFile, destFile, writeMode, processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp): + srcf = open(sourceFile, "r") + dstf = open(destFile, writeMode) + printLog(log, "WRITE " + destFile + " " + writeMode) + for line in srcf: + dstf.write(processLine(line, processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp)) + dstf.close() + srcf.close() + +def generateSimpleMaxExporter(processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable): + dateTimeStamp = time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + processDir = ScriptDirectory + "/processes/" + processName + mkPath(log, processDir) + maxscriptDir = processDir + "/maxscript" + mkPath(log, maxscriptDir) + templateDir = os.getcwd().replace("\\", "/") + "/simple_max_exporter_template" + mkPath(log, templateDir) + scriptDir = os.getcwd().replace("\\", "/") + "/max_exporter_scripts" + mkPath(log, scriptDir) + + if not os.path.isfile(processDir + "/0_setup.py"): + generateSimpleMaxExporterFile(templateDir + "/0_setup.py", processDir + "/0_setup.py", "w", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + + generateSimpleMaxExporterFile(templateDir + "/1_export_header.py", processDir + "/1_export.py", "w", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + generateSimpleMaxExporterFile(scriptDir + "/" + fileExtension + ".py", processDir + "/1_export.py", "a", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + generateSimpleMaxExporterFile(templateDir + "/1_export_footer.py", processDir + "/1_export.py", "a", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + + if not os.path.isfile(processDir + "/2_build.py"): + generateSimpleMaxExporterFile(templateDir + "/2_build.py", processDir + "/2_build.py", "w", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + if not os.path.isfile(processDir + "/3_install.py"): + generateSimpleMaxExporterFile(templateDir + "/3_install.py", processDir + "/3_install.py", "w", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + + generateSimpleMaxExporterFile(templateDir + "/export_header.ms", maxscriptDir + "/" + fileExtension + "_export.ms", "w", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + generateSimpleMaxExporterFile(scriptDir + "/" + fileExtension + ".ms", maxscriptDir + "/" + fileExtension + "_export.ms", "a", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + generateSimpleMaxExporterFile(templateDir + "/export_footer.ms", maxscriptDir + "/" + fileExtension + "_export.ms", "a", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + + + +generateSimpleMaxExporter("pacs_prim", "pacs_prim", "PacsPrimSourceDirectories", "PacsPrimExportDirectory", "PacsPrimClientDirectory") + +generateSimpleMaxExporter("anim", "anim", "AnimSourceDirectories", "AnimExportDirectory", "AnimClientDirectory") + +generateSimpleMaxExporter("skel", "skel", "SkelSourceDirectories", "SkelExportDirectory", "SkelClientDirectory") + +generateSimpleMaxExporter("swt", "swt", "SwtSourceDirectories", "SwtExportDirectory", "SwtClientDirectory") + +generateSimpleMaxExporter("zone", "zone", "ZoneSourceDirectory", "ZoneExportDirectory", "ZoneClientDirectory") + + + +printLog(log, "") +log.close() diff --git a/code/nel/tools/build_gamedata/generators/generate_tagged_max_exporters.py b/code/nel/tools/build_gamedata/generators/generate_tagged_max_exporters.py new file mode 100644 index 000000000..d7a62a478 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/generate_tagged_max_exporters.py @@ -0,0 +1,114 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Run all setup processes +# \date 2009-02-18 15:28GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Run all setup processes +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../configuration") +if os.path.isfile("generate_tagged_max_exporters.log"): + os.remove("generate_tagged_max_exporters.log") +log = open("generate_tagged_max_exporters.log", "w") +from scripts import * +from buildsite import * +from tools import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Generate tagged max exporters") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +templateDir = os.getcwd().replace("\\", "/") + "/tagged_max_exporter_template" +mkPath(log, templateDir) +scriptDir = os.getcwd().replace("\\", "/") + "/max_exporter_scripts" +mkPath(log, scriptDir) + +def processLine(line, processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp): + newline = line.replace("%PreGenWarning%", "WARNING : this is a generated file, don't change it !") + newline = newline.replace("%PreGenDateTimeStamp%", dateTimeStamp) + newline = newline.replace("%PreGenProcessName%", processName) + newline = newline.replace("%PreGenFileExtension%", fileExtension) + newline = newline.replace("%PreGenSourceDirectoriesVariable%", sourceDirectoriesVariable) + newline = newline.replace("%PreGenExportDirectoryVariable%", exportDirectoryVariable) + newline = newline.replace("%PreGenTagExportDirectoryVariable%", tagExportDirectoryVariable) + newline = newline.replace("%PreGenClientDirectoryVariable%", clientDirectoryVariable) + return newline + +def generateTaggedMaxExporterFile(sourceFile, destFile, writeMode, processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp): + srcf = open(sourceFile, "r") + dstf = open(destFile, writeMode) + printLog(log, "WRITE " + destFile + " " + writeMode) + for line in srcf: + dstf.write(processLine(line, processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp)) + dstf.close() + srcf.close() + +def generateTaggedMaxScriptFile(processDir, processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp): + maxscriptDir = processDir + "/maxscript" + mkPath(log, maxscriptDir) + generateTaggedMaxExporterFile(templateDir + "/export_header.ms", maxscriptDir + "/" + fileExtension + "_export.ms", "w", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + generateTaggedMaxExporterFile(scriptDir + "/" + fileExtension + ".ms", maxscriptDir + "/" + fileExtension + "_export.ms", "a", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + generateTaggedMaxExporterFile(templateDir + "/export_footer.ms", maxscriptDir + "/" + fileExtension + "_export.ms", "a", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + +def generateTaggedMaxScript(processName, fileExtension): + dateTimeStamp = time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + processDir = ScriptDirectory + "/processes/" + processName + mkPath(log, processDir) + + generateTaggedMaxScriptFile(processDir, processName, fileExtension, "_invalid", "_invalid", "_invalid", "_invalid", dateTimeStamp) + +def generateTaggedMaxExporter(processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable): + dateTimeStamp = time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + processDir = ScriptDirectory + "/processes/" + processName + mkPath(log, processDir) + + if not os.path.isfile(processDir + "/0_setup.py"): + generateTaggedMaxExporterFile(templateDir + "/0_setup.py", processDir + "/0_setup.py", "w", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + + generateTaggedMaxExporterFile(templateDir + "/1_export_header.py", processDir + "/1_export.py", "w", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + generateTaggedMaxExporterFile(scriptDir + "/" + fileExtension + ".py", processDir + "/1_export.py", "a", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + generateTaggedMaxExporterFile(templateDir + "/1_export_footer.py", processDir + "/1_export.py", "a", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + + if not os.path.isfile(processDir + "/2_build.py"): + generateTaggedMaxExporterFile(templateDir + "/2_build.py", processDir + "/2_build.py", "w", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + if not os.path.isfile(processDir + "/3_install.py"): + generateTaggedMaxExporterFile(templateDir + "/3_install.py", processDir + "/3_install.py", "w", processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + + generateTaggedMaxScriptFile(processDir, processName, fileExtension, sourceDirectoriesVariable, exportDirectoryVariable, tagExportDirectoryVariable, clientDirectoryVariable, dateTimeStamp) + + + +generateTaggedMaxExporter("clodbank", "clod", "ClodSourceDirectories", "ClodExportDirectory", "ClodTagExportDirectory", "ClodClientDirectory") + +generateTaggedMaxScript("ig", "ig") + +generateTaggedMaxExporter("rbank", "cmb", "RBankCmbSourceDirectories", "RBankCmbExportDirectory", "RBankCmbTagExportDirectory", "PacsClientDirectory") + +generateTaggedMaxExporter("veget", "veget", "VegetSourceDirectories", "VegetExportDirectory", "VegetTagExportDirectory", "VegetClientDirectory") + + + +printLog(log, "") +log.close() diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/anim.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/anim.ms new file mode 100644 index 000000000..c189e71f8 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/anim.ms @@ -0,0 +1,69 @@ + + +NEL3D_APPDATA_EXPORT_NODE_ANIMATION = 1423062800 + +fn runNelMaxExport inputMaxFile = +( + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".%PreGenFileExtension%") + tagThisFile = false + + -- Unhide category + unhidecategory() + + -- Select Bip01, not very smart + if $Bip01 != undefined then + ( + select $Bip01 + + -- Always uncheck triangle pelvis + if (classof $Bip01) == Biped_Object then + ( + $Bip01.controller.figureMode = true + $Bip01.controller.trianglepelvis = false + $Bip01.controller.figureMode = false + ) + ) + + -- For each node + for node in objects do + ( + exportNodeAnmation = getappdata node NEL3D_APPDATA_EXPORT_NODE_ANIMATION + if (exportNodeAnmation != undefined) then + ( + if (exportNodeAnmation == "1") then + ( + selectmore node + + -- Is it a biped ? + if (classof node.controller) == Vertical_Horizontal_Turn then + ( + -- Always uncheck triangle pelvis + node.controller.trianglepelvis = false + ) + ) + ) + ) + + if ((selection as array).count != 0) then + ( + -- Export the animation + if (NelExportAnimation (selection as array) outputNelFile false) == false then + ( + nlerror("ERROR exporting animation " + inputMaxFile) + tagThisFile = false + ) + else + ( + nlerror("OK " + outputNelFile) + tagThisFile = true + ) + ) + else + ( + -- Error + nlerror("ERROR exporting animation: no node animated to export in file " + inputMaxFile) + ) + + return tagThisFile +) + diff --git a/code/nel/tools/build_gamedata/processes/anim/todo_export_maxscript b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/anim.py similarity index 100% rename from code/nel/tools/build_gamedata/processes/anim/todo_export_maxscript rename to code/nel/tools/build_gamedata/generators/max_exporter_scripts/anim.py diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/clod.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/clod.ms new file mode 100644 index 000000000..29744c7d1 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/clod.ms @@ -0,0 +1,123 @@ + + +-- Some globals + +NEL3D_APPDATA_DONOTEXPORT = 1423062565 -- do not export me : "undefined" = export me + -- "0" = export me + -- "1" = DONT export me +NEL3D_APPDATA_CHARACTER_LOD = 1423062618 -- "1": I am a character lod if "1". "0" or undefined: I am not. + + +-- Must export this node ? +fn isToBeExported node = +( + if ((classof node) == RklPatch) then + return false + + if ((classof node) == nel_ps) then + return false + + if ((classof node) == nel_pacs_cylinder) then + return false + + if ((classof node) == nel_pacs_box) then + return false + + doNotExport = getappdata node NEL3D_APPDATA_DONOTEXPORT + if (doNotExport != undefined) then + ( + if (doNotExport == "1") then + return false + ) + return true +) + + +-- is this node flagged as a LodCharacter ?? +fn isLodCharacter node = +( + isCLod = getappdata node NEL3D_APPDATA_CHARACTER_LOD + if (isCLod == undefined) then + return false + if (isCLod == "1") then + return true + return false +) + +fn runNelMaxExport inputMaxFile = +( + tagThisFile = true + + -- Unhide category + unhidecategory() + + -- Unhide + max unhide all + + -- unselect + max select none + + -- Exported object count + exported = 0 + + -- For each node + for node in geometry do + ( + -- It is root ? + if (node.parent == undefined) then + ( + -- Can be exported ? + if (isToBeExported node == true) then + ( + -- Is a Lod character? + if ((isLodCharacter node) == true) then + ( + -- Output directory + outputNelFile = ("%OutputDirectory%/" + (node.name) + ".clod") + + -- Compare file date + if (NeLTestFileDate outputNelFile inputMaxFile) == true then + ( + try + ( + -- Export the shape + if (NelExportLodCharacter node outputNelFile false) == true then + ( + nlerror("OK " + outputNelFile) + exported = exported+1 + ) + else + ( + -- Error + nlerror("ERROR exporting .clod " + node.name + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + catch + ( + -- Error + nlerror("ERROR fatal error exporting .clod " + node.name + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + else + ( + -- Error + nlerror("SKIPPED " + outputNelFile) + exported = exported + 1 + ) + ) + ) + ) + ) + + -- Something exported + if (exported == 0) then + ( + -- Error + nlerror ("WARNING no .clod exported from the file " + inputMaxFile) + ) + + return tagThisFile +) + diff --git a/code/nel/tools/build_gamedata/processes/skel/todo_export_maxscript b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/clod.py similarity index 100% rename from code/nel/tools/build_gamedata/processes/skel/todo_export_maxscript rename to code/nel/tools/build_gamedata/generators/max_exporter_scripts/clod.py diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/cmb.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/cmb.ms new file mode 100644 index 000000000..2a7492c29 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/cmb.ms @@ -0,0 +1,59 @@ + + +NEL3D_APPDATA_COLLISION = 1423062613 +NEL3D_APPDATA_COLLISION_EXTERIOR = 1423062614 + + +-- Must export this node ? +fn isToBeExported node = +( + doNotExport = getappdata node NEL3D_APPDATA_COLLISION + if (doNotExport != undefined) then + ( + if (doNotExport == "1") then + return true + ) + + doNotExport = getappdata node NEL3D_APPDATA_COLLISION_EXTERIOR + if (doNotExport != undefined) then + ( + if (doNotExport == "1") then + return true + ) + + return false +) + +fn runNelMaxExport inputMaxFile = +( + outputNelDir = "%OutputDirectory%" + + -- Tag this file ? + tagThisFile = true + + -- Unhide category + unhidecategory() + + -- Select all collision mesh + max select none + for m in geometry do + ( + if (isToBeExported m) == true then + selectmore m + ) + + -- Export the collision + if (NelExportCollision ($selection as array) outputNelDir) == false then + ( + nlerror("ERROR exporting collision " + inputMaxFile) + tagThisFile = false + ) + else + ( + nlerror("OK collision in folder " + outputNelDir) + ) + + return tagThisFile +) + + diff --git a/code/nel/tools/build_gamedata/processes/swt/todo_export_maxscript b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/cmb.py similarity index 100% rename from code/nel/tools/build_gamedata/processes/swt/todo_export_maxscript rename to code/nel/tools/build_gamedata/generators/max_exporter_scripts/cmb.py diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/ig.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/ig.ms new file mode 100644 index 000000000..7c9563088 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/ig.ms @@ -0,0 +1,172 @@ + + +-- Some globals + +NEL3D_APPDATA_ACCEL = 1423062561 -- type of accelerator : "32" = is not an accelerator and IS clusterized + -- "0" = is not an accelerator and IS NOT clusterized (always visible) + -- "1" = is an accelerator type PORTAL + -- "2" = is an accelerator type CLUSTER + -- "6" = is an accelerator type CLUSTER FATHER-VISIBLE + -- "10" = is an accelerator type CLUSTER VISIBLE-FROM-FATHER + -- "14" = is an accelerator type CLUSTER FATHER-VISIBLE and VISIBLE-FROM-FATHER + -- "17" = is an accelerator type PORTAL DYNAMIC + +NEL3D_APPDATA_DONOTEXPORT = 1423062565 -- do not export me : "undefined" = export me + -- "0" = export me + -- "1" = DONT export me + +NEL3D_APPDATA_IGNAME = 1423062564 -- string : name of the Instance Group + +NEL3D_APPDATA_LOD_NAME_COUNT_MAX = 10 +NEL3D_APPDATA_LOD = 1423062537 +NEL3D_APPDATA_LOD_NAME_COUNT = NEL3D_APPDATA_LOD +NEL3D_APPDATA_LOD_NAME = NEL3D_APPDATA_LOD_NAME_COUNT+1 +NEL3D_APPDATA_LOD_BLEND_IN = NEL3D_APPDATA_LOD_NAME+NEL3D_APPDATA_LOD_NAME_COUNT_MAX +NEL3D_APPDATA_LOD_BLEND_OUT = NEL3D_APPDATA_LOD_BLEND_IN+1 +NEL3D_APPDATA_LOD_COARSE_MESH = NEL3D_APPDATA_LOD_BLEND_OUT+1 + +NEL_OBJECT_NAME_DATA = 1970 + + +-- This node is n accelerator ? +fn isAccelerator node = +( + accel = getappdata node NEL3D_APPDATA_ACCEL + if (accel != undefined) then + ( + if (accel == "0") or (accel == "32") then + return false + else + return true + ) + return false +) + +-- Get the ig name of this object +fn getIg node = +( + return (getappdata node NEL3D_APPDATA_IGNAME) +) + + +fn runNelMaxExport inputMaxFile = +( + tagThisFile = true + + -- Unhide category + unhidecategory() + + -- Unhide + max unhide all + + -- unselect + max select none + + -- Exported object count + exported = 0 + + -- Ig array + ig_array = #() + + -- Scan all the ig in this project + for node in objects do + ( + ig = getIg node + if ( (ig != undefined) and (ig != "") ) then + ( + -- Found ? + found = false + + -- Already found ? + for j = 1 to ig_array.count do + ( + if (ig_array[j]==ig) then + ( + found = true + exit + ) + ) + + -- Found ? + if (found == false) then + ( + append ig_array ig + ) + ) + ) + + -- Have some ig ? + if (ig_array.count != 0) then + ( + -- For each ig + for ig = 1 to ig_array.count do + ( + -- Output filename + outputNelFile = ("%OutputDirectory%/" + ig_array[ig] + ".ig") + + -- Check date + if (NeLTestFileDate outputNelFile inputMaxFile) == true then + ( + -- Select none + max select none + + -- Select all node in this ig + for node in geometry do + ( + -- Select it if in the ig + if ((getIg node) == ig_array[ig]) then + selectmore node + ) + -- Select all lights in this ig + for node in lights do + ( + -- Select it if in the ig + if ((getIg node) == ig_array[ig]) then + selectmore node + ) + -- Select all lights in this ig + for node in helpers do + ( + -- Select it if in the ig + if ((getIg node) == ig_array[ig]) then + selectmore node + ) + + -- Check export + try + ( + -- Export the ig + instancegroup2export = $selection as array + if (NelExportInstanceGroup instancegroup2export outputNelFile) == true then + ( + nlerror("OK " + outputNelFile) + ) + else + ( + -- Error + nlerror("ERROR exporting ig " + ig_array[ig] + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + catch + ( + -- Error + nlerror("ERROR fatal error exporting ig " + ig_array[ig] + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + else + ( + nlerror("SKIPPED " + outputNelFile) + ) + ) + ) + else + ( + -- Error + nlerror("WARNING nothing exported from ig max file " + inputMaxFile) + ) + + return tagThisFile +) + diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/pacs_prim.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/pacs_prim.ms new file mode 100644 index 000000000..93e94de19 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/pacs_prim.ms @@ -0,0 +1,47 @@ + + +fn runNelMaxExport inputMaxFile = +( + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".%PreGenFileExtension%") + tagThisFile = false + + -- Unhide category + unhidecategory() + + -- Select none + max select none + + -- Select all PACS primitives + for i in geometry do + ( + if ((classof i) == nel_pacs_cylinder) or ((classof i) == nel_pacs_box) then + selectmore i + ) + + -- Array of node + arrayNode = selection as array + + -- Something to export ? + if (arrayNode.count != 0) then + ( + -- Export the collision + if (NelExportPACSPrimitives arrayNode outputNelFile) == false then + ( + nlerror("ERROR exporting PACS primitives in file " + inputMaxFile) + tagThisFile = false + ) + else + ( + nlerror("OK PACS primitives in file " + inputMaxFile) + tagThisFile = true + ) + ) + else + ( + nlerror("WARNING no PACS primitives in file " + inputMaxFile) + tagThisFile = true + ) + + return tagThisFile +) + diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/pacs_prim.py b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/pacs_prim.py new file mode 100644 index 000000000..b1c3e5966 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/pacs_prim.py @@ -0,0 +1,16 @@ + + +printLog(log, ">>> List %PreGenFileExtension% <<<") +outDirPacsPrim = ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable% +mkPath(log, outDirPacsPrim) +listPath = ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable% + "/landscape_col_prim_pacs_list.txt" +if os.path.isfile(listPath): + os.remove(listPath) +if WantLandscapeColPrimPacsList: + exportedPacsPrims = findFiles(log, outDirPacsPrim, "", ".%PreGenFileExtension%") + printLog(log, "WRITE " + listPath) + listFile = open(listPath, "w") + for exported in exportedPacsPrims: + listFile.write(exported + "\n") + listFile.close() + diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/skel.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/skel.ms new file mode 100644 index 000000000..b86e10c75 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/skel.ms @@ -0,0 +1,53 @@ + + +fn runNelMaxExport inputMaxFile = +( + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".%PreGenFileExtension%") + tagThisFile = false + + -- Unhide category + unhidecategory() + + -- Select Bip01, not very smart + if $Bip01 != undefined then + ( + -- Select Bip01 + select $Bip01 + + if ($ != undefined) then + ( + -- Set figure mode on + if ((classof $) == Biped_Object) then + ( + $.controller.figureMode = true + ) + + -- Export the skeleton template + if (NelExportSkeleton $ outputNelFile) == false then + ( + nlerror("ERROR exporting skeleton " + inputMaxFile) + tagThisFile = false + ) + else + ( + nlerror("OK " + outputNelFile) + tagThisFile = true + ) + ) + else + ( + -- Error + nlerror("ERROR exporting skeleton: no Bip01 node in file " + inputMaxFile) + tagThisFile = false + ) + ) + else + ( + -- Error + nlerror("ERROR exporting skeleton: no Bip01 node in file " + inputMaxFile) + tagThisFile = false + ) + + return tagThisFile +) + diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/skel.py b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/skel.py new file mode 100644 index 000000000..884e11db3 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/skel.py @@ -0,0 +1,8 @@ + + +printLog(log, ">>> Export skel directly <<<") +mkPath(log, ExportBuildDirectory + "/" + SkelExportDirectory) +for dir in SkelSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + copyFilesExtNoSubdirIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + SkelExportDirectory, ".skel") + diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/swt.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/swt.ms new file mode 100644 index 000000000..d6330b611 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/swt.ms @@ -0,0 +1,28 @@ + + +fn runNelMaxExport inputMaxFile = +( + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".%PreGenFileExtension%") + tagThisFile = false + + -- Unhide category + unhidecategory() + + -- Select all the nodes + max select all + + -- Export the skeleton template + if NelExportSkeletonWeight ($selection as array) outputNelFile == false then + ( + nlerror("ERROR exporting skeleton weight " + inputMaxFile) + tagThisFile = false + ) + else + ( + nlerror("OK " + outputNelFile) + tagThisFile = true + ) + + return tagThisFile +) + diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/swt.py b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/swt.py new file mode 100644 index 000000000..e69de29bb diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/veget.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/veget.ms new file mode 100644 index 000000000..f0d5cd584 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/veget.ms @@ -0,0 +1,113 @@ + + +-- Some globals + +NEL3D_APPDATA_DONOTEXPORT = 1423062565 -- do not export me : "undefined" = export me + -- "0" = export me + -- "1" = DONT export me + +NEL3D_APPDATA_VEGETABLE = 1423062580 -- "undefined" = not vegetable + -- "0" = not vegetable + -- "1" = vegetable + + +-- Must export this node ? +fn isToBeExported node = +( + if (classof node == nel_ps) then + return false + + doNotExport = getappdata node NEL3D_APPDATA_DONOTEXPORT + if (doNotExport != undefined) then + ( + if (doNotExport == "1") then + return false + ) + + vegetable = getappdata node NEL3D_APPDATA_VEGETABLE + if (vegetable != undefined) then + if (vegetable == "1") then + return true + + -- Do not export + return false +) + + +fn runNelMaxExport inputMaxFile = +( + tagThisFile = true + + -- Unhide category + unhidecategory() + + -- Unhide + max unhide all + + -- unselect + max select none + + -- Exported object count + exported = 0 + + -- For each node + for node in geometry do + ( + -- It is root ? + if (node.parent == undefined) then + ( + -- Is not a skeleton ? + if (node.name != "Bip01") then + ( + -- Can be exported ? + if (isToBeExported node == true) then + ( + -- Output directory + outputNelFile = ("%OutputDirectory%/" + (node.name) + ".veget") + + -- Compare file date + if (NeLTestFileDate outputNelFile inputMaxFile) == true then + ( + try + ( + -- Export the veget + if (NelExportVegetable node outputNelFile false) == true then + ( + nlerror("OK "+outputNelFile) + exported = exported+1 + ) + else + ( + -- Error + nlerror("ERROR exporting veget " + node.name + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + catch + ( + -- Error + nlerror("ERROR fata error exporting veget " + node.name + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + else + ( + -- Error + nlerror("SKIPPED " + outputNelFile) + exported = exported + 1 + ) + ) + ) + ) + ) + + -- Something exported + if exported == 0 then + ( + -- Error + nlerror("WARNING no veget exported from the file " + inputMaxFile) + ) + + return tagThisFile +) + diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/veget.py b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/veget.py new file mode 100644 index 000000000..e69de29bb diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/zone.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/zone.ms new file mode 100644 index 000000000..d4ecbe275 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/zone.ms @@ -0,0 +1,86 @@ + + +-- Find id +Fn findID node = +( + local + + -- Const + alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ" + NameTab = filterString node.name "_" + Z_ID = -1 + alpha_letter1 = NameTab[2][1] + alpha_letter2 = NameTab[2][2] + alpha_letter1_value = findstring alphabet alpha_letter1 + alpha_letter2_value = findstring alphabet alpha_letter2 + + -- Decompose theh name in an array array[1]=numeric string value array[2]=alpha string value + -- The index of the engine start at 0 but the script one at 1 so we sub 1 each time + alpha_sub_id = (((alpha_letter1_value as integer - 1) * 26 + (alpha_letter2_value as integer)))-1 + num_sub_id = (NameTab[1] as integer)-1 + + -- Array of 256 per 256 + --------------------------- + -- 0 1 2 3 ... 255 + -- 256 257 258 259 ... 511 + -- 512 513 514 515 ... 767 + -- ... + + Z_ID = num_sub_id*256 + alpha_sub_id + return Z_ID +) + +fn runNelMaxExport inputMaxFile = +( + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".%PreGenFileExtension%") + tagThisFile = false + + -- Unhide category + unhidecategory() + + -- Select none + max select none + + -- Found it ? + find = false + + -- For each object in the priject + for i in geometry do + ( + -- Look for a NeL patch mesh + if (classof i) == RklPatch then + ( + -- Error catching + try + ( + if (ExportRykolZone i outputNelFile (findID i)) == false then + ( + nlerror("ERROR exporting zone " + i.name + " in file " + inputMaxFile) + ) + else + ( + nlerror("OK " + outputNelFile) + tagThisFile = true + find = true + exit + ) + ) + catch + ( + -- Error + nlerror("ERROR fatal error exporting zone " + i.name + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + ) + + -- Not found ? + if (find == false) then + ( + -- Error + nlerror("WARNING no zone found in project " + inputMaxFile) + tagThisFile = true + ) + + return tagThisFile +) diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/zone.py b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/zone.py new file mode 100644 index 000000000..d6e821879 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/zone.py @@ -0,0 +1,8 @@ + + +printLog(log, ">>> Try to copy ligo zone if any <<<") +printLog(log, "********************************") +printLog(log, "******** TODO ********") +printLog(log, "********************************") +printLog(log, "") + diff --git a/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/0_setup.py b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/0_setup.py new file mode 100644 index 000000000..a2c6ef2b2 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/0_setup.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup %PreGenProcessName% +# \date %PreGenDateTimeStamp% +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup %PreGenProcessName% +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup %PreGenProcessName%") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +for dir in %PreGenSourceDirectoriesVariable%: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable%) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + %PreGenClientDirectoryVariable%) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/1_export_footer.py b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/1_export_footer.py new file mode 100644 index 000000000..f4d6f4950 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/1_export_footer.py @@ -0,0 +1,7 @@ + + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/1_export_header.py b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/1_export_header.py new file mode 100644 index 000000000..5b79ed18e --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/1_export_header.py @@ -0,0 +1,92 @@ +#!/usr/bin/python +# +# ################################################################# +# ## %PreGenWarning% +# ################################################################# +# +# \file 1_export.py +# \brief Export %PreGenProcessName% +# \date %PreGenDateTimeStamp% +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export %PreGenProcessName% +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export %PreGenProcessName%") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +# ... + +# Export %PreGenProcessName% 3dsmax +if MaxAvailable: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + printLog(log, "") + + printLog(log, ">>> Export %PreGenProcessName% 3dsmax <<<") + mkPath(log, ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable%) + for dir in %PreGenSourceDirectoriesVariable%: + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable%, ".%PreGenFileExtension%")): + scriptSrc = "maxscript/%PreGenFileExtension%_export.ms" + scriptDst = MaxUserDirectory + "/scripts/%PreGenFileExtension%_export.ms" + outputLogfile = ScriptDirectory + "/processes/%PreGenProcessName%/log.log" + outputDirectory = ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable% + maxSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, outputDirectory, "", ".%PreGenFileExtension%") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "%PreGenFileExtension%_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, outputDirectory, "", ".%PreGenFileExtension%") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .%PreGenFileExtension% files!") + os.remove(scriptDst) + diff --git a/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/2_build.py b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/2_build.py new file mode 100644 index 000000000..6278c85cd --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/2_build.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build %PreGenProcessName% +# \date %PreGenDateTimeStamp% +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build %PreGenProcessName% +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build %PreGenProcessName%") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/3_install.py b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/3_install.py new file mode 100644 index 000000000..c9486b77f --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install %PreGenProcessName% +# \date %PreGenDateTimeStamp% +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install %PreGenProcessName% +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install %PreGenProcessName%") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, ">>> Install %PreGenProcessName% <<<") +exportPath = ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable% +mkPath(log, exportPath) +clientPath = ClientDataDirectory + "/" + %PreGenClientDirectoryVariable% +mkPath(log, clientPath) +copyFilesExtNoSubdirIfNeeded(log, exportPath, clientPath, ".%PreGenFileExtension%") + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/export_footer.ms b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/export_footer.ms new file mode 100644 index 000000000..2c6e99bd3 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/export_footer.ms @@ -0,0 +1,74 @@ + + +try +( + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + + -- Sort files + sort files + gc() + + -- No file ? + if files.count != 0 then + ( + -- For each files + for i = 1 to files.count do + ( + inputMaxFile = files[i] + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".%PreGenFileExtension%") + + try + ( + -- Compare file date + if (NeLTestFileDate outputNelFile inputMaxFile) == true then + ( + -- Free memory and file handles + gc() + heapfree + + -- Reset 3dsmax + resetMAXFile #noprompt + + -- Open the max project + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then + ( + runNelMaxExport(inputMaxFile) + ) + else + ( + -- Error + nlerror("ERROR exporting '%PreGenFileExtension%': can't open the file " + inputMaxFile) + ) + ) + else + ( + nlerror("SKIPPED " + inputMaxFile) + ) + ) + catch + ( + -- Error + nlerror("ERROR error exporting '%PreGenFileExtension%' in files " + inputMaxFile) + ) + ) + ) + else + ( + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") + ) +) +catch +( + -- Error + nlerror("ERROR fatal error exporting '%PreGenFileExtension%' in folder %MaxSourceDirectory%") +) + +-- Bye + +resetMAXFile #noprompt +quitMAX #noPrompt +quitMAX() #noPrompt + diff --git a/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/export_header.ms b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/export_header.ms new file mode 100644 index 000000000..2d5e5434f --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/simple_max_exporter_template/export_header.ms @@ -0,0 +1,63 @@ + + +-- ################################################################# +-- ## %PreGenWarning% +-- ################################################################# + + +-- Allocate 20 Me for the script +heapSize += 15000000 + +nlErrorFilename = "%OutputLogfile%" +nlErrorStream = openFile nlErrorFilename mode:"a" +if nlErrorStream == undefined then + nlErrorStream = createFile nlErrorFilename + +-- Unhide category +fn unhidecategory = +( + if (geometry.count > 0) then + ( + unhide geometry[1] + if (geometry[1].ishidden == true) then + max hide object toggle + ) + if (shapes.count > 0) then + ( + unhide shapes[1] + if (shapes[1].ishidden == true) then + max hide shape toggle + ) + if (lights.count > 0) then + ( + unhide lights[1] + if (lights[1].ishidden == true) then + max hide light toggle + ) + if (cameras.count > 0) then + ( + unhide cameras[1] + if (cameras[1].ishidden == true) then + max hide camera toggle + ) + if (helpers.count > 0) then + ( + unhide helpers[1] + if (helpers[1].ishidden == true) then + max hide helper toggle + ) +) + +-- Log a message +fn nlerror message = +( + if nlErrorStream != undefined then + ( + format "%\n" message to:nlErrorStream + flush nlErrorStream + ) + + -- To the console + print message +) + diff --git a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/0_setup.py b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/0_setup.py new file mode 100644 index 000000000..d572c1f43 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/0_setup.py @@ -0,0 +1,66 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup %PreGenProcessName% +# \date %PreGenDateTimeStamp% +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup %PreGenProcessName% +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup %PreGenProcessName%") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +for dir in %PreGenSourceDirectoriesVariable%: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable%) +mkPath(log, ExportBuildDirectory + "/" + %PreGenTagExportDirectoryVariable%) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + %PreGenClientDirectoryVariable%) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/1_export_footer.py b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/1_export_footer.py new file mode 100644 index 000000000..f4d6f4950 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/1_export_footer.py @@ -0,0 +1,7 @@ + + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/1_export_header.py b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/1_export_header.py new file mode 100644 index 000000000..e48b44648 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/1_export_header.py @@ -0,0 +1,96 @@ +#!/usr/bin/python +# +# ################################################################# +# ## %PreGenWarning% +# ################################################################# +# +# \file 1_export.py +# \brief Export %PreGenProcessName% +# \date %PreGenDateTimeStamp% +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export %PreGenProcessName% +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export %PreGenProcessName%") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + + +# Find tools +# ... + +# Export %PreGenProcessName% 3dsmax +if MaxAvailable: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + printLog(log, "") + + printLog(log, ">>> Export %PreGenProcessName% 3dsmax <<<") + mkPath(log, ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable%) + mkPath(log, ExportBuildDirectory + "/" + %PreGenTagExportDirectoryVariable%) + for dir in %PreGenSourceDirectoriesVariable%: + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + %PreGenTagExportDirectoryVariable%, ".max.tag")): + scriptSrc = "maxscript/%PreGenFileExtension%_export.ms" + scriptDst = MaxUserDirectory + "/scripts/%PreGenFileExtension%_export.ms" + outputLogfile = ScriptDirectory + "/processes/%PreGenProcessName%/log.log" + outputDirectory = ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable% + tagDirectory = ExportBuildDirectory + "/" + %PreGenTagExportDirectoryVariable% + maxSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, tagDirectory, "", ".max.tag") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + newline = newline.replace("%TagDirectory%", tagDirectory) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "%PreGenFileExtension%_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, tagDirectory, "", ".max.tag") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .max files!") + os.remove(scriptDst) + diff --git a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/2_build.py b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/2_build.py new file mode 100644 index 000000000..6278c85cd --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/2_build.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build %PreGenProcessName% +# \date %PreGenDateTimeStamp% +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build %PreGenProcessName% +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build %PreGenProcessName%") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/3_install.py b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/3_install.py new file mode 100644 index 000000000..f3dde5aa2 --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install %PreGenProcessName% +# \date %PreGenDateTimeStamp% +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install %PreGenProcessName% +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install %PreGenProcessName%") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, ">>> Install %PreGenProcessName% <<<") +exportPath = ExportBuildDirectory + "/" + %PreGenExportDirectoryVariable% +mkPath(log, exportPath) +clientPath = ClientDataDirectory + "/" + %PreGenClientDirectoryVariable% +mkPath(log, clientPath) +copyFilesNoTreeIfNeeded(log, exportPath, clientPath) + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/export_footer.ms b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/export_footer.ms new file mode 100644 index 000000000..42f9a51fa --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/export_footer.ms @@ -0,0 +1,89 @@ + + +try +( + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + + -- Sort files + sort files + gc() + + -- No file ? + if files.count != 0 then + ( + -- For each files + for i = 1 to files.count do + ( + inputMaxFile = files[i] + outputTagFile = ("%TagDirectory%/" + (getFilenameFile inputMaxFile) + (getFilenameType inputMaxFile) + ".tag") + + try + ( + -- Compare file date + if (NeLTestFileDate outputTagFile inputMaxFile) == true then + ( + -- Free memory and file handles + gc() + heapfree + + -- Reset 3dsmax + resetMAXFile #noprompt + + -- Open the max project + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then + ( + tagThisFile = runNelMaxExport(inputMaxFile) + + -- Write a tag file + if tagThisFile == true then + ( + tagFile = createFile outputTagFile + if tagFile == undefined then + ( + nlerror("WARNING can't create tag file " + outputTagFile) + ) + else + ( + print "mukyu" to: tagFile + close tagFile + ) + ) + ) + else + ( + -- Error + nlerror("ERROR exporting '%PreGenFileExtension%': can't open the file " + inputMaxFile) + ) + ) + else + ( + nlerror("SKIPPED BY TAG " + inputMaxFile) + ) + ) + catch + ( + -- Error + nlerror("ERROR error exporting '%PreGenFileExtension%' in files " + inputMaxFile) + ) + ) + ) + else + ( + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") + ) +) +catch +( + -- Error + nlerror("ERROR fatal error exporting '%PreGenFileExtension%' in folder %MaxSourceDirectory%") +) + +-- Bye + +resetMAXFile #noprompt +quitMAX #noPrompt +quitMAX() #noPrompt + diff --git a/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/export_header.ms b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/export_header.ms new file mode 100644 index 000000000..2d5e5434f --- /dev/null +++ b/code/nel/tools/build_gamedata/generators/tagged_max_exporter_template/export_header.ms @@ -0,0 +1,63 @@ + + +-- ################################################################# +-- ## %PreGenWarning% +-- ################################################################# + + +-- Allocate 20 Me for the script +heapSize += 15000000 + +nlErrorFilename = "%OutputLogfile%" +nlErrorStream = openFile nlErrorFilename mode:"a" +if nlErrorStream == undefined then + nlErrorStream = createFile nlErrorFilename + +-- Unhide category +fn unhidecategory = +( + if (geometry.count > 0) then + ( + unhide geometry[1] + if (geometry[1].ishidden == true) then + max hide object toggle + ) + if (shapes.count > 0) then + ( + unhide shapes[1] + if (shapes[1].ishidden == true) then + max hide shape toggle + ) + if (lights.count > 0) then + ( + unhide lights[1] + if (lights[1].ishidden == true) then + max hide light toggle + ) + if (cameras.count > 0) then + ( + unhide cameras[1] + if (cameras[1].ishidden == true) then + max hide camera toggle + ) + if (helpers.count > 0) then + ( + unhide helpers[1] + if (helpers[1].ishidden == true) then + max hide helper toggle + ) +) + +-- Log a message +fn nlerror message = +( + if nlErrorStream != undefined then + ( + format "%\n" message to:nlErrorStream + flush nlErrorStream + ) + + -- To the console + print message +) + diff --git a/code/nel/tools/build_gamedata/processes/anim/1_export.py b/code/nel/tools/build_gamedata/processes/anim/1_export.py index fe6770ced..0958d9643 100644 --- a/code/nel/tools/build_gamedata/processes/anim/1_export.py +++ b/code/nel/tools/build_gamedata/processes/anim/1_export.py @@ -1,8 +1,12 @@ #!/usr/bin/python # +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# # \file 1_export.py # \brief Export anim -# \date 2009-03-10 13:13GMT +# \date 2010-09-03-10-06-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export anim @@ -44,19 +48,51 @@ printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") # Find tools -Max = findMax(log, MaxDirectory, MaxExecutable) -printLog(log, "") +# ... -# For each anim directory -printLog(log, ">>> Export anim 3dsmax <<<") -printLog(log, "********************************") -printLog(log, "******** TODO ********") -printLog(log, "********************************") -mkPath(log, ExportBuildDirectory + "/" + AnimExportDirectory) -for dir in AnimSourceDirectories: - mkPath(log, DatabaseDirectory + "/" + dir) -printLog(log, "") +# Export anim 3dsmax +if MaxAvailable: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + printLog(log, "") + + printLog(log, ">>> Export anim 3dsmax <<<") + mkPath(log, ExportBuildDirectory + "/" + AnimExportDirectory) + for dir in AnimSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + AnimExportDirectory, ".anim")): + scriptSrc = "maxscript/anim_export.ms" + scriptDst = MaxUserDirectory + "/scripts/anim_export.ms" + outputLogfile = ScriptDirectory + "/processes/anim/log.log" + outputDirectory = ExportBuildDirectory + "/" + AnimExportDirectory + maxSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, outputDirectory, "", ".anim") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "anim_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, outputDirectory, "", ".anim") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .anim files!") + os.remove(scriptDst) + + +printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/anim/2_build.py b/code/nel/tools/build_gamedata/processes/anim/2_build.py index 3cd6ead71..8b6a902bd 100644 --- a/code/nel/tools/build_gamedata/processes/anim/2_build.py +++ b/code/nel/tools/build_gamedata/processes/anim/2_build.py @@ -56,7 +56,12 @@ else: mkPath(log, srcDir) destDir = ExportBuildDirectory + "/" + AnimBuildDirectory mkPath(log, destDir) - subprocess.call([ AnimBuilder, srcDir, destDir, ScriptDirectory + "/configuration/zone_lighter_properties.cfg" ]) + if DoOptimizeAnimations: + printLog(log, ">>> Optimizing animations <<<") + subprocess.call([ AnimBuilder, srcDir, destDir, ActiveProjectDirectory + "/anim_builder.cfg" ]) + else: + printLog(log, ">>> Not optimizing animations <<<") + copyFilesNoTreeIfNeeded(log, srcDir, destDir) printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/anim/maxscript/anim_export.ms b/code/nel/tools/build_gamedata/processes/anim/maxscript/anim_export.ms new file mode 100644 index 000000000..05878c1cd --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/anim/maxscript/anim_export.ms @@ -0,0 +1,206 @@ + + +-- ################################################################# +-- ## WARNING : this is a generated file, don't change it ! +-- ################################################################# + + +-- Allocate 20 Me for the script +heapSize += 15000000 + +nlErrorFilename = "%OutputLogfile%" +nlErrorStream = openFile nlErrorFilename mode:"a" +if nlErrorStream == undefined then + nlErrorStream = createFile nlErrorFilename + +-- Unhide category +fn unhidecategory = +( + if (geometry.count > 0) then + ( + unhide geometry[1] + if (geometry[1].ishidden == true) then + max hide object toggle + ) + if (shapes.count > 0) then + ( + unhide shapes[1] + if (shapes[1].ishidden == true) then + max hide shape toggle + ) + if (lights.count > 0) then + ( + unhide lights[1] + if (lights[1].ishidden == true) then + max hide light toggle + ) + if (cameras.count > 0) then + ( + unhide cameras[1] + if (cameras[1].ishidden == true) then + max hide camera toggle + ) + if (helpers.count > 0) then + ( + unhide helpers[1] + if (helpers[1].ishidden == true) then + max hide helper toggle + ) +) + +-- Log a message +fn nlerror message = +( + if nlErrorStream != undefined then + ( + format "%\n" message to:nlErrorStream + flush nlErrorStream + ) + + -- To the console + print message +) + + + +NEL3D_APPDATA_EXPORT_NODE_ANIMATION = 1423062800 + +fn runNelMaxExport inputMaxFile = +( + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".anim") + tagThisFile = false + + -- Unhide category + unhidecategory() + + -- Select Bip01, not very smart + if $Bip01 != undefined then + ( + select $Bip01 + + -- Always uncheck triangle pelvis + if (classof $Bip01) == Biped_Object then + ( + $Bip01.controller.figureMode = true + $Bip01.controller.trianglepelvis = false + $Bip01.controller.figureMode = false + ) + ) + + -- For each node + for node in objects do + ( + exportNodeAnmation = getappdata node NEL3D_APPDATA_EXPORT_NODE_ANIMATION + if (exportNodeAnmation != undefined) then + ( + if (exportNodeAnmation == "1") then + ( + selectmore node + + -- Is it a biped ? + if (classof node.controller) == Vertical_Horizontal_Turn then + ( + -- Always uncheck triangle pelvis + node.controller.trianglepelvis = false + ) + ) + ) + ) + + if ((selection as array).count != 0) then + ( + -- Export the animation + if (NelExportAnimation (selection as array) outputNelFile false) == false then + ( + nlerror("ERROR exporting animation " + inputMaxFile) + tagThisFile = false + ) + else + ( + nlerror("OK " + outputNelFile) + tagThisFile = true + ) + ) + else + ( + -- Error + nlerror("ERROR exporting animation: no node animated to export in file " + inputMaxFile) + ) + + return tagThisFile +) + + + +try +( + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + + -- Sort files + sort files + gc() + + -- No file ? + if files.count != 0 then + ( + -- For each files + for i = 1 to files.count do + ( + inputMaxFile = files[i] + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".anim") + + try + ( + -- Compare file date + if (NeLTestFileDate outputNelFile inputMaxFile) == true then + ( + -- Free memory and file handles + gc() + heapfree + + -- Reset 3dsmax + resetMAXFile #noprompt + + -- Open the max project + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then + ( + runNelMaxExport(inputMaxFile) + ) + else + ( + -- Error + nlerror("ERROR exporting 'anim': can't open the file " + inputMaxFile) + ) + ) + else + ( + nlerror("SKIPPED " + inputMaxFile) + ) + ) + catch + ( + -- Error + nlerror("ERROR error exporting 'anim' in files " + inputMaxFile) + ) + ) + ) + else + ( + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") + ) +) +catch +( + -- Error + nlerror("ERROR fatal error exporting 'anim' in folder %MaxSourceDirectory%") +) + +-- Bye + +resetMAXFile #noprompt +quitMAX #noPrompt +quitMAX() #noPrompt + diff --git a/code/nel/tools/build_gamedata/processes/clodbank/0_setup.py b/code/nel/tools/build_gamedata/processes/clodbank/0_setup.py new file mode 100644 index 000000000..e28f629d9 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/clodbank/0_setup.py @@ -0,0 +1,85 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Setup clodbank +# \date 2009-03-10 14:56GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup clodbank +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup clodbank") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +for dir in ClodSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + ClodTagExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + ClodExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + SkelExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + ClodBankBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + AnimBuildDirectory) + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + ShapeClientDirectory) + +# Setup configuration files +printLog(log, ">>> Setup configuration files <<<") +mkPath(log, ActiveProjectDirectory + "/generated") +cfgOut = open(ActiveProjectDirectory + "/generated/clod_paths.cfg", "w") +cfgOut.write("\n") +cfgOut.write("// The search pathes, look in the current process\n") +cfgOut.write("search_pathes = \n") +cfgOut.write("{\n") +cfgOut.write("\t\"" + ExportBuildDirectory + "/" + ClodExportDirectory + "\", \n") +cfgOut.write("\t\"" + ExportBuildDirectory + "/" + SkelExportDirectory + "\", \n") +cfgOut.write("\t\"" + ExportBuildDirectory + "/" + AnimBuildDirectory + "\", \n") +cfgOut.write("};\n") +cfgOut.write("\n") +cfgOut.close() + + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/clodbank/1_export.py b/code/nel/tools/build_gamedata/processes/clodbank/1_export.py new file mode 100644 index 000000000..92ba0a1b9 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/clodbank/1_export.py @@ -0,0 +1,103 @@ +#!/usr/bin/python +# +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# +# \file 1_export.py +# \brief Export clodbank +# \date 2010-09-03-10-06-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export clodbank +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export clodbank") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + + +# Find tools +# ... + +# Export clodbank 3dsmax +if MaxAvailable: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + printLog(log, "") + + printLog(log, ">>> Export clodbank 3dsmax <<<") + mkPath(log, ExportBuildDirectory + "/" + ClodExportDirectory) + mkPath(log, ExportBuildDirectory + "/" + ClodTagExportDirectory) + for dir in ClodSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + ClodTagExportDirectory, ".max.tag")): + scriptSrc = "maxscript/clod_export.ms" + scriptDst = MaxUserDirectory + "/scripts/clod_export.ms" + outputLogfile = ScriptDirectory + "/processes/clodbank/log.log" + outputDirectory = ExportBuildDirectory + "/" + ClodExportDirectory + tagDirectory = ExportBuildDirectory + "/" + ClodTagExportDirectory + maxSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, tagDirectory, "", ".max.tag") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + newline = newline.replace("%TagDirectory%", tagDirectory) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "clod_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, tagDirectory, "", ".max.tag") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .max files!") + os.remove(scriptDst) + + + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/clodbank/2_build.py b/code/nel/tools/build_gamedata/processes/clodbank/2_build.py new file mode 100644 index 000000000..8155c0e00 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/clodbank/2_build.py @@ -0,0 +1,68 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build clodbank +# \date 2009-03-10 13:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build clodbank +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build clodbank") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +BuildClodBank = findTool(log, ToolDirectories, BuildClodBankTool, ToolSuffix) +printLog(log, "") + +# Build clodbank +printLog(log, ">>> Build clodbank <<<") +if BuildClodBank == "": + toolLogFail(log, BuildClodBankTool, ToolSuffix) +else: + srcDir = ExportBuildDirectory + "/" + ClodExportDirectory + mkPath(log, srcDir) + destDir = ExportBuildDirectory + "/" + ClodBankBuildDirectory + mkPath(log, destDir) + mkPath(log, ActiveProjectDirectory + "/generated") + destFile = destDir + "/" + ClodBankFileName + configFile = DatabaseDirectory + "/" + ClodConfigFile + subprocess.call([ BuildClodBank, ActiveProjectDirectory + "/generated/clod_paths.cfg", configFile, destFile ]) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/clodbank/3_install.py b/code/nel/tools/build_gamedata/processes/clodbank/3_install.py new file mode 100644 index 000000000..6879f3da8 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/clodbank/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install clodbank +# \date 2009-03-10 13:13GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install clodbank +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install clodbank") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, ">>> Install clodbank <<<") +srcDir = ExportBuildDirectory + "/" + ClodBankBuildDirectory +mkPath(log, srcDir) +destDir = ClientDataDirectory + "/" + ShapeClientDirectory +mkPath(log, destDir) +copyFilesNoTreeIfNeeded(log, srcDir, destDir) + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/clodbank/maxscript/clod_export.ms b/code/nel/tools/build_gamedata/processes/clodbank/maxscript/clod_export.ms index 49326a260..0c0d78fe0 100644 --- a/code/nel/tools/build_gamedata/processes/clodbank/maxscript/clod_export.ms +++ b/code/nel/tools/build_gamedata/processes/clodbank/maxscript/clod_export.ms @@ -1,15 +1,14 @@ --- Some globals -NEL3D_APPDATA_DONOTEXPORT = 1423062565 -- do not export me : "undefined" = export me - -- "0" = export me - -- "1" = DONT export me -NEL3D_APPDATA_CHARACTER_LOD = 1423062618 -- "1": I am a character lod if "1". "0" or undefined: I am not. + +-- ################################################################# +-- ## WARNING : this is a generated file, don't change it ! +-- ################################################################# -- Allocate 20 Me for the script heapSize += 15000000 -nlErrorFilename = "output_logfile" +nlErrorFilename = "%OutputLogfile%" nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename @@ -62,21 +61,31 @@ fn nlerror message = print message ) + + +-- Some globals + +NEL3D_APPDATA_DONOTEXPORT = 1423062565 -- do not export me : "undefined" = export me + -- "0" = export me + -- "1" = DONT export me +NEL3D_APPDATA_CHARACTER_LOD = 1423062618 -- "1": I am a character lod if "1". "0" or undefined: I am not. + + -- Must export this node ? -fn isToBeExported node = +fn isToBeExported node = ( if ((classof node) == RklPatch) then return false - + if ((classof node) == nel_ps) then return false - + if ((classof node) == nel_pacs_cylinder) then return false - + if ((classof node) == nel_pacs_box) then return false - + doNotExport = getappdata node NEL3D_APPDATA_DONOTEXPORT if (doNotExport != undefined) then ( @@ -86,8 +95,9 @@ fn isToBeExported node = return true ) + -- is this node flagged as a LodCharacter ?? -fn isLodCharacter node = +fn isLodCharacter node = ( isCLod = getappdata node NEL3D_APPDATA_CHARACTER_LOD if (isCLod == undefined) then @@ -97,173 +107,169 @@ fn isLodCharacter node = return false ) -fn goClodExport = +fn runNelMaxExport inputMaxFile = ( - try + tagThisFile = true + + -- Unhide category + unhidecategory() + + -- Unhide + max unhide all + + -- unselect + max select none + + -- Exported object count + exported = 0 + + -- For each node + for node in geometry do ( - -- Get files in the shape_source_directory - files = getFiles "shape_source_directory/*.max" - - -- Sort files - sort files - - -- No file ? - if files.count != 0 then + -- It is root ? + if (node.parent == undefined) then ( - -- For each files - for i = 1 to files.count do + -- Can be exported ? + if (isToBeExported node == true) then ( - try + -- Is a Lod character? + if ((isLodCharacter node) == true) then ( - -- Ok ? - ok = false - - -- Free memory and file handles - gc () - - -- Reset 3dsmax - resetMAXFile #noprompt - - -- Get the tag file name - tag = ("output_directory_tag/"+(getFilenameFile files[i])+(getFilenameType files[i])+".tag") - - -- Compare date with the tag file - if (NeLTestFileDate tag files[i]) == true then + -- Output directory + outputNelFile = ("%OutputDirectory%/" + (node.name) + ".clod") + + -- Compare file date + if (NeLTestFileDate outputNelFile inputMaxFile) == true then ( - -- Open the max project - nlerror ("Scanning file "+files[i]+" ...") - if loadMaxFile files[i] quiet:true == true then + try ( - -- Unhide category - unhidecategory() - - tagThisFile = true - - -- Unhide - max unhide all - - -- unselect - max select none - - -- Exported object count - exported = 0 - - -- For each node - for node in geometry do + -- Export the shape + if (NelExportLodCharacter node outputNelFile false) == true then ( - -- It is root ? - if (node.parent == undefined) then - ( - -- Can be exported ? - if (isToBeExported node == true) then - ( - -- Is a Lod character? - if ((isLodCharacter node) == true) then - ( - -- Output directory - output = ("output_directory_clod/"+(node.name)+".clod") - - -- Compare file date - if (NeLTestFileDate output files[i]) == true then - ( - try - ( - -- Export the shape - if (NelExportLodCharacter node output false) == true then - ( - nlerror ("OK "+output) - exported = exported+1 - ) - else - ( - -- Error - nlerror ("ERROR exporting .clod "+node.name+" in file "+files[i]) - tagThisFile = false - ) - ) - catch - ( - -- Error - nlerror ("ERROR fatal error exporting .clod "+node.name+" in file "+files[i]) - tagThisFile = false - return 0 - ) - ) - else - ( - -- Error - nlerror ("SKIPPED "+output) - exported = exported+1 - ) - ) - ) - ) + nlerror("OK " + outputNelFile) + exported = exported+1 ) - - -- Something exported - if (exported == 0) then + else ( -- Error - nlerror ("WARNING no .clod exported from the file "+files[i]) - ) - - -- Write a tag file - if tagThisFile == true then - ( - tagFile = createFile tag - if tagFile == undefined then - ( - nlerror ("WARNING can't create tag file "+tag) - ) - else - ( - print "toto" to: tagFile - close tagFile - ) + nlerror("ERROR exporting .clod " + node.name + " in file " + inputMaxFile) + tagThisFile = false ) ) - else + catch ( -- Error - nlerror ("ERROR exporting .clod: can't open the file "+files[i]) + nlerror("ERROR fatal error exporting .clod " + node.name + " in file " + inputMaxFile) + tagThisFile = false ) ) else ( -- Error - nlerror ("SKIPPED BY TAG "+files[i]) + nlerror("SKIPPED " + outputNelFile) + exported = exported + 1 ) - - gc () - - -- Reset 3dsmax - resetMAXFile #noprompt - ) - catch - ( - -- Error - nlerror ("ERROR fatal error exporting .clod in file " + files[i]) - -- break ) ) ) - else - ( - nlerror ("WARNING no max file in folder shape_source_directory") - ) ) - catch + + -- Something exported + if (exported == 0) then ( -- Error - nlerror ("ERROR fatal error exporting .clod in folder shape_source_directory") - return 0 + nlerror ("WARNING no .clod exported from the file " + inputMaxFile) ) + + return tagThisFile ) -goClodExport() -nlerror ("BYE") +try +( + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + + -- Sort files + sort files + gc() + + -- No file ? + if files.count != 0 then + ( + -- For each files + for i = 1 to files.count do + ( + inputMaxFile = files[i] + outputTagFile = ("%TagDirectory%/" + (getFilenameFile inputMaxFile) + (getFilenameType inputMaxFile) + ".tag") + + try + ( + -- Compare file date + if (NeLTestFileDate outputTagFile inputMaxFile) == true then + ( + -- Free memory and file handles + gc() + heapfree + + -- Reset 3dsmax + resetMAXFile #noprompt + + -- Open the max project + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then + ( + tagThisFile = runNelMaxExport(inputMaxFile) + + -- Write a tag file + if tagThisFile == true then + ( + tagFile = createFile outputTagFile + if tagFile == undefined then + ( + nlerror("WARNING can't create tag file " + outputTagFile) + ) + else + ( + print "mukyu" to: tagFile + close tagFile + ) + ) + ) + else + ( + -- Error + nlerror("ERROR exporting 'clod': can't open the file " + inputMaxFile) + ) + ) + else + ( + nlerror("SKIPPED BY TAG " + inputMaxFile) + ) + ) + catch + ( + -- Error + nlerror("ERROR error exporting 'clod' in files " + inputMaxFile) + ) + ) + ) + else + ( + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") + ) +) +catch +( + -- Error + nlerror("ERROR fatal error exporting 'clod' in folder %MaxSourceDirectory%") +) + +-- Bye + +resetMAXFile #noprompt quitMAX #noPrompt -quitMAX () #noPrompt +quitMAX() #noPrompt diff --git a/code/nel/tools/build_gamedata/processes/font/0_setup.py b/code/nel/tools/build_gamedata/processes/font/0_setup.py index bf61fce0e..3eb5a97fd 100644 --- a/code/nel/tools/build_gamedata/processes/font/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/font/0_setup.py @@ -50,6 +50,7 @@ for dir in FontSourceDirectories: # Setup export directories printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + FontExportDirectory) # Setup build directories printLog(log, ">>> Setup build directories <<<") diff --git a/code/nel/tools/build_gamedata/processes/font/1_export.py b/code/nel/tools/build_gamedata/processes/font/1_export.py index 54292bec5..34089b83d 100644 --- a/code/nel/tools/build_gamedata/processes/font/1_export.py +++ b/code/nel/tools/build_gamedata/processes/font/1_export.py @@ -43,6 +43,17 @@ printLog(log, "-------") printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") +printLog(log, ">>> Export font <<<") +fontExportDir = ExportBuildDirectory + "/" + FontExportDirectory +mkPath(log, fontExportDir) +for dir in FontSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, fontExportDir, ".ttf") + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, fontExportDir, ".afm") + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, fontExportDir, ".pfb") + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, fontExportDir, ".pfm") + + printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/font/3_install.py b/code/nel/tools/build_gamedata/processes/font/3_install.py index 55da60bed..4415c1195 100644 --- a/code/nel/tools/build_gamedata/processes/font/3_install.py +++ b/code/nel/tools/build_gamedata/processes/font/3_install.py @@ -45,14 +45,14 @@ printLog(log, "") clientPath = ClientDataDirectory + "/" + FontClientDirectory mkPath(log, clientPath) +fontExportDir = ExportBuildDirectory + "/" + FontExportDirectory +mkPath(log, fontExportDir) printLog(log, ">>> Install font <<<") -for dir in FontSourceDirectories: - mkPath(log, DatabaseDirectory + "/" + dir) - copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, clientPath, ".ttf") - copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, clientPath, ".afm") - copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, clientPath, ".pfb") - copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, clientPath, ".pfm") +copyFilesExtNoTreeIfNeeded(log, fontExportDir, clientPath, ".ttf") +copyFilesExtNoTreeIfNeeded(log, fontExportDir, clientPath, ".afm") +copyFilesExtNoTreeIfNeeded(log, fontExportDir, clientPath, ".pfb") +copyFilesExtNoTreeIfNeeded(log, fontExportDir, clientPath, ".pfm") printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/ig/1_export.py b/code/nel/tools/build_gamedata/processes/ig/1_export.py index 8921b2d1a..06fe7050d 100644 --- a/code/nel/tools/build_gamedata/processes/ig/1_export.py +++ b/code/nel/tools/build_gamedata/processes/ig/1_export.py @@ -49,35 +49,36 @@ Max = "" #find later def igExport(sourceDir, targetDir): scriptSrc = "maxscript/ig_export.ms" scriptDst = MaxUserDirectory + "/scripts/ig_export.ms" - logFile = ScriptDirectory + "/processes/ig/log.log" - outDirTag = ExportBuildDirectory + "/" + IgStaticTagExportDirectory - outDirIg = ExportBuildDirectory + "/" + targetDir - igSourceDir = DatabaseDirectory + "/" + sourceDir - tagList = findFiles(log, outDirTag, "", ".tag") - tagLen = len(tagList) - if os.path.isfile(scriptDst): + outputLogfile = ScriptDirectory + "/processes/ig/log.log" + tagDirectory = ExportBuildDirectory + "/" + IgStaticTagExportDirectory + outputDirectory = ExportBuildDirectory + "/" + targetDir + maxSourceDir = DatabaseDirectory + "/" + sourceDir + if (needUpdateDirByTagLog(log, maxSourceDir, ".max", tagDirectory, ".max.tag")): + tagList = findFiles(log, tagDirectory, "", ".tag") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + newline = newline.replace("%TagDirectory%", tagDirectory) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "ig_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, tagDirectory, "", ".tag") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .max files!") os.remove(scriptDst) - tagDiff = 1 - sSrc = open(scriptSrc, "r") - sDst = open(scriptDst, "w") - for line in sSrc: - newline = line.replace("output_logfile", logFile) - newline = newline.replace("ig_source_directory", igSourceDir) - newline = newline.replace("output_directory_tag", outDirTag) - newline = newline.replace("output_directory_ig", outDirIg) - sDst.write(newline) - sSrc.close() - sDst.close() - while tagDiff > 0: - printLog(log, "MAXSCRIPT " + scriptDst) - subprocess.call([ Max, "-U", "MAXScript", "ig_export.ms", "-q", "-mi", "-vn" ]) - tagList = findFiles(log, outDirTag, "", ".tag") - newTagLen = len(tagList) - tagDiff = newTagLen - tagLen - tagLen = newTagLen - printLog(log, "Exported " + str(tagDiff) + " .max files!") - os.remove(scriptDst) - return + return if MaxAvailable: diff --git a/code/nel/tools/build_gamedata/processes/ig/maxscript/ig_export.ms b/code/nel/tools/build_gamedata/processes/ig/maxscript/ig_export.ms index de1853994..d7be706a8 100644 --- a/code/nel/tools/build_gamedata/processes/ig/maxscript/ig_export.ms +++ b/code/nel/tools/build_gamedata/processes/ig/maxscript/ig_export.ms @@ -1,34 +1,14 @@ --- Some globals -NEL3D_APPDATA_ACCEL = 1423062561 -- type of accelerator : "32" = is not an accelerator and IS clusterized - -- "0" = is not an accelerator and IS NOT clusterized (always visible) - -- "1" = is an accelerator type PORTAL - -- "2" = is an accelerator type CLUSTER - -- "6" = is an accelerator type CLUSTER FATHER-VISIBLE - -- "10" = is an accelerator type CLUSTER VISIBLE-FROM-FATHER - -- "14" = is an accelerator type CLUSTER FATHER-VISIBLE and VISIBLE-FROM-FATHER - -- "17" = is an accelerator type PORTAL DYNAMIC - -NEL3D_APPDATA_DONOTEXPORT = 1423062565 -- do not export me : "undefined" = export me - -- "0" = export me - -- "1" = DONT export me -NEL3D_APPDATA_IGNAME = 1423062564 -- string : name of the Instance Group +-- ################################################################# +-- ## WARNING : this is a generated file, don't change it ! +-- ################################################################# -NEL3D_APPDATA_LOD_NAME_COUNT_MAX = 10 -NEL3D_APPDATA_LOD = 1423062537 -NEL3D_APPDATA_LOD_NAME_COUNT = NEL3D_APPDATA_LOD -NEL3D_APPDATA_LOD_NAME = NEL3D_APPDATA_LOD_NAME_COUNT+1 -NEL3D_APPDATA_LOD_BLEND_IN = NEL3D_APPDATA_LOD_NAME+NEL3D_APPDATA_LOD_NAME_COUNT_MAX -NEL3D_APPDATA_LOD_BLEND_OUT = NEL3D_APPDATA_LOD_BLEND_IN+1 -NEL3D_APPDATA_LOD_COARSE_MESH = NEL3D_APPDATA_LOD_BLEND_OUT+1 - -NEL_OBJECT_NAME_DATA = 1970 -- Allocate 20 Me for the script heapSize += 15000000 -nlErrorFilename = "output_logfile" +nlErrorFilename = "%OutputLogfile%" nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename @@ -81,6 +61,36 @@ fn nlerror message = print message ) + + +-- Some globals + +NEL3D_APPDATA_ACCEL = 1423062561 -- type of accelerator : "32" = is not an accelerator and IS clusterized + -- "0" = is not an accelerator and IS NOT clusterized (always visible) + -- "1" = is an accelerator type PORTAL + -- "2" = is an accelerator type CLUSTER + -- "6" = is an accelerator type CLUSTER FATHER-VISIBLE + -- "10" = is an accelerator type CLUSTER VISIBLE-FROM-FATHER + -- "14" = is an accelerator type CLUSTER FATHER-VISIBLE and VISIBLE-FROM-FATHER + -- "17" = is an accelerator type PORTAL DYNAMIC + +NEL3D_APPDATA_DONOTEXPORT = 1423062565 -- do not export me : "undefined" = export me + -- "0" = export me + -- "1" = DONT export me + +NEL3D_APPDATA_IGNAME = 1423062564 -- string : name of the Instance Group + +NEL3D_APPDATA_LOD_NAME_COUNT_MAX = 10 +NEL3D_APPDATA_LOD = 1423062537 +NEL3D_APPDATA_LOD_NAME_COUNT = NEL3D_APPDATA_LOD +NEL3D_APPDATA_LOD_NAME = NEL3D_APPDATA_LOD_NAME_COUNT+1 +NEL3D_APPDATA_LOD_BLEND_IN = NEL3D_APPDATA_LOD_NAME+NEL3D_APPDATA_LOD_NAME_COUNT_MAX +NEL3D_APPDATA_LOD_BLEND_OUT = NEL3D_APPDATA_LOD_BLEND_IN+1 +NEL3D_APPDATA_LOD_COARSE_MESH = NEL3D_APPDATA_LOD_BLEND_OUT+1 + +NEL_OBJECT_NAME_DATA = 1970 + + -- This node is n accelerator ? fn isAccelerator node = ( @@ -101,204 +111,214 @@ fn getIg node = return (getappdata node NEL3D_APPDATA_IGNAME) ) + +fn runNelMaxExport inputMaxFile = +( + tagThisFile = true + + -- Unhide category + unhidecategory() + + -- Unhide + max unhide all + + -- unselect + max select none + + -- Exported object count + exported = 0 + + -- Ig array + ig_array = #() + + -- Scan all the ig in this project + for node in objects do + ( + ig = getIg node + if ( (ig != undefined) and (ig != "") ) then + ( + -- Found ? + found = false + + -- Already found ? + for j = 1 to ig_array.count do + ( + if (ig_array[j]==ig) then + ( + found = true + exit + ) + ) + + -- Found ? + if (found == false) then + ( + append ig_array ig + ) + ) + ) + + -- Have some ig ? + if (ig_array.count != 0) then + ( + -- For each ig + for ig = 1 to ig_array.count do + ( + -- Output filename + outputNelFile = ("%OutputDirectory%/" + ig_array[ig] + ".ig") + + -- Check date + if (NeLTestFileDate outputNelFile inputMaxFile) == true then + ( + -- Select none + max select none + + -- Select all node in this ig + for node in geometry do + ( + -- Select it if in the ig + if ((getIg node) == ig_array[ig]) then + selectmore node + ) + -- Select all lights in this ig + for node in lights do + ( + -- Select it if in the ig + if ((getIg node) == ig_array[ig]) then + selectmore node + ) + -- Select all lights in this ig + for node in helpers do + ( + -- Select it if in the ig + if ((getIg node) == ig_array[ig]) then + selectmore node + ) + + -- Check export + try + ( + -- Export the ig + instancegroup2export = $selection as array + if (NelExportInstanceGroup instancegroup2export outputNelFile) == true then + ( + nlerror("OK " + outputNelFile) + ) + else + ( + -- Error + nlerror("ERROR exporting ig " + ig_array[ig] + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + catch + ( + -- Error + nlerror("ERROR fatal error exporting ig " + ig_array[ig] + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + else + ( + nlerror("SKIPPED " + outputNelFile) + ) + ) + ) + else + ( + -- Error + nlerror("WARNING nothing exported from ig max file " + inputMaxFile) + ) + + return tagThisFile +) + + + try ( - -- Get files in the ig_source_directory - files = getFiles "ig_source_directory/*.max" - + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + -- Sort files sort files - + gc() + -- No file ? if files.count != 0 then ( -- For each files for i = 1 to files.count do ( + inputMaxFile = files[i] + outputTagFile = ("%TagDirectory%/" + (getFilenameFile inputMaxFile) + (getFilenameType inputMaxFile) + ".tag") + try ( - -- Free memory and file handles - gc () - - -- Reset 3dsmax - resetMAXFile #noprompt - - -- Get the tag file name - tag = ("output_directory_tag/"+(getFilenameFile files[i])+(getFilenameType files[i])+".tag") - - -- Compare date with the tag file - if (NeLTestFileDate tag files[i]) == true then + -- Compare file date + if (NeLTestFileDate outputTagFile inputMaxFile) == true then ( + -- Free memory and file handles + gc() + heapfree + + -- Reset 3dsmax + resetMAXFile #noprompt + -- Open the max project - nlerror ("Scanning file "+files[i]+" ...") - if (mergeMaxFile files[i] quiet:true) == true then + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then ( - -- Unhide category - unhidecategory() - - tagThisFile = true - - -- Unhide - max unhide all - - -- unselect - max select none - - -- Exported object count - exported = 0 - - -- Ig array - ig_array = #() - - -- Scan all the ig in this project - for node in objects do - ( - ig = getIg node - if ( (ig != undefined) and (ig != "") ) then - ( - -- Found ? - found = false - - -- Already found ? - for j = 1 to ig_array.count do - ( - if (ig_array[j]==ig) then - ( - found = true - exit - ) - ) - - -- Found ? - if (found == false) then - ( - append ig_array ig - ) - ) - ) - - -- Have some ig ? - if (ig_array.count != 0) then - ( - -- For each ig - for ig = 1 to ig_array.count do - ( - -- Output filename - output = ("output_directory_ig/"+ig_array[ig]+".ig") - - -- Check date - if (NeLTestFileDate output files[i]) == true then - ( - -- Select none - max select none - - -- Select all node in this ig - for node in geometry do - ( - -- Select it if in the ig - if ( (getIg node) == ig_array[ig]) then - selectmore node - ) - -- Select all lights in this ig - for node in lights do - ( - -- Select it if in the ig - if ( (getIg node) == ig_array[ig]) then - selectmore node - ) - -- Select all lights in this ig - for node in helpers do - ( - -- Select it if in the ig - if ( (getIg node) == ig_array[ig]) then - selectmore node - ) - - -- Check export - try - ( - -- Export the ig - instancegroup2export = $selection as array - if (NelExportInstanceGroup instancegroup2export output) == true then - ( - nlerror ("OK "+output) - ) - else - ( - -- Error - nlerror ("ERROR exporting ig "+ig_array[ig]+" in file "+files[i]) - tagThisFile = false - ) - ) - catch - ( - -- Error - nlerror ("ERROR fatal error exporting ig "+ig_array[ig]+" in file "+files[i]) - tagThisFile = false - ) - ) - else - ( - nlerror ("SKIPPED "+output) - ) - ) - ) - else - ( - -- Error - nlerror ("WARNING nothing exported from ig max file "+files[i]) - ) - + tagThisFile = runNelMaxExport(inputMaxFile) + -- Write a tag file if tagThisFile == true then ( - tagFile = createFile tag + tagFile = createFile outputTagFile if tagFile == undefined then ( - nlerror ("WARNING can't create tag file "+tag) + nlerror("WARNING can't create tag file " + outputTagFile) ) else ( - print "toto" to: tagFile + print "mukyu" to: tagFile close tagFile ) ) - - resetMAXFile #noprompt ) else ( -- Error - nlerror ("ERROR exporting ig: can't open the file "+files[i]) + nlerror("ERROR exporting 'ig': can't open the file " + inputMaxFile) ) ) else ( - -- Error - nlerror ("SKIPPED BY TAG "+files[i]) - ) + nlerror("SKIPPED BY TAG " + inputMaxFile) + ) ) catch ( -- Error - nlerror ("ERROR error exporting ig in files " + files[i]) + nlerror("ERROR error exporting 'ig' in files " + inputMaxFile) ) ) ) else ( - nlerror ("WARNING no max file in folder ig_source_directory") + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") ) ) catch ( -- Error - nlerror ("ERROR fatal error exporting ig in folder ig_source_directory") + nlerror("ERROR fatal error exporting 'ig' in folder %MaxSourceDirectory%") ) -- Bye resetMAXFile #noprompt quitMAX #noPrompt -quitMAX () #noPrompt +quitMAX() #noPrompt diff --git a/code/nel/tools/build_gamedata/processes/ig_light/2_build.py b/code/nel/tools/build_gamedata/processes/ig_light/2_build.py index 90b962012..c8f8a05d3 100644 --- a/code/nel/tools/build_gamedata/processes/ig_light/2_build.py +++ b/code/nel/tools/build_gamedata/processes/ig_light/2_build.py @@ -56,7 +56,7 @@ else: mkPath(log, srcDir) destDir = ExportBuildDirectory + "/" + IgOtherLightedBuildDirectory mkPath(log, destDir) - subprocess.call([ IgLighter, srcDir, destDir, ActiveProjectDirectory + "/generated/zone_lighter.cfg" ]) + subprocess.call([ IgLighter, srcDir, destDir, ActiveProjectDirectory + "/generated/properties.cfg" ]) printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/interface/0_setup.py b/code/nel/tools/build_gamedata/processes/interface/0_setup.py index 64fdee329..d77614701 100644 --- a/code/nel/tools/build_gamedata/processes/interface/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/interface/0_setup.py @@ -45,8 +45,9 @@ printLog(log, "") # Setup source directories printLog(log, ">>> Setup source directories <<<") -for dir in InterfaceSourceDirectories: - mkPath(log, DatabaseDirectory + "/" + dir) +for dirs in InterfaceSourceDirectories: + for dir in dirs: + mkPath(log, DatabaseDirectory + "/" + dir) for dir in InterfaceDxtcSourceDirectories: mkPath(log, DatabaseDirectory + "/" + dir) for dir in InterfaceFullscreenSourceDirectories: diff --git a/code/nel/tools/build_gamedata/processes/interface/1_export.py b/code/nel/tools/build_gamedata/processes/interface/1_export.py index d7ba086ac..37911ba7e 100644 --- a/code/nel/tools/build_gamedata/processes/interface/1_export.py +++ b/code/nel/tools/build_gamedata/processes/interface/1_export.py @@ -50,12 +50,14 @@ printLog(log, "") # For each interface directory printLog(log, ">>> Export interface <<<") mkPath(log, ExportBuildDirectory + "/" + InterfaceExportDirectory) -for dir in InterfaceSourceDirectories: - mkPath(log, DatabaseDirectory + "/" + dir) - niouname = dir.replace("/", "_") +for dirs in InterfaceSourceDirectories: + niouname = dirs[0].replace("/", "_") newpath = ExportBuildDirectory + "/" + InterfaceExportDirectory + "/" + niouname mkPath(log, newpath) - copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, newpath, ".tga") + for dir in dirs: + mkPath(log, DatabaseDirectory + "/" + dir) + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, newpath, ".tga") + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, newpath, ".png") printLog(log, "") # For each interface directory to compress in one DXTC @@ -64,6 +66,7 @@ mkPath(log, ExportBuildDirectory + "/" + InterfaceDxtcExportDirectory) for dir in InterfaceDxtcSourceDirectories: mkPath(log, DatabaseDirectory + "/" + dir) copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + InterfaceDxtcExportDirectory, ".tga") + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + InterfaceDxtcExportDirectory, ".png") printLog(log, "") # For each interface fullscreen directory compress independently all in dds @@ -80,6 +83,12 @@ else: destFile = ExportBuildDirectory + "/" + InterfaceFullscreenExportDirectory + "/" + os.path.basename(file)[0:-len(".tga")] + ".dds" if needUpdateLogRemoveDest(log, sourceFile, destFile): subprocess.call([ TgaToDds, sourceFile, "-o", destFile, "-a", "5" ]) + files = findFiles(log, DatabaseDirectory + "/" + dir, "", ".png") + for file in files: + sourceFile = DatabaseDirectory + "/" + dir + "/" + file + destFile = ExportBuildDirectory + "/" + InterfaceFullscreenExportDirectory + "/" + os.path.basename(file)[0:-len(".png")] + ".dds" + if needUpdateLogRemoveDest(log, sourceFile, destFile): + subprocess.call([ TgaToDds, sourceFile, "-o", destFile, "-a", "5" ]) printLog(log, "") # For each interface 3d directory @@ -88,6 +97,7 @@ mkPath(log, ExportBuildDirectory + "/" + Interface3DExportDirectory) for dir in Interface3DSourceDirectories: mkPath(log, DatabaseDirectory + "/" + dir) copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + Interface3DExportDirectory, ".tga") + copyFilesExtNoTreeIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + Interface3DExportDirectory, ".png") printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/ligo/0_setup.py b/code/nel/tools/build_gamedata/processes/ligo/0_setup.py index 344f88422..269effd25 100644 --- a/code/nel/tools/build_gamedata/processes/ligo/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/ligo/0_setup.py @@ -47,7 +47,7 @@ printLog(log, "") printLog(log, ">>> Setup source directories <<<") mkPath(log, DatabaseDirectory + "/" + LigoBaseSourceDirectory) mkPath(log, DatabaseDirectory + "/" + LigoMaxSourceDirectory) -mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory) +mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory[0]) # Setup export directories printLog(log, ">>> Setup export directories <<<") diff --git a/code/nel/tools/build_gamedata/processes/ligo/1_export.py b/code/nel/tools/build_gamedata/processes/ligo/1_export.py index 4ae323c43..dbf28109d 100644 --- a/code/nel/tools/build_gamedata/processes/ligo/1_export.py +++ b/code/nel/tools/build_gamedata/processes/ligo/1_export.py @@ -60,42 +60,42 @@ if LigoExportLand == "" or LigoExportOnePass == 1: mkPath(log, DatabaseDirectory + "/" + LigoDatabaseZoneExportDirectory) mkPath(log, DatabaseDirectory + "/" + LigoDatabaseZoneLigoExportDirectory) mkPath(log, DatabaseDirectory + "/" + LigoDatabaseCmbExportDirectory) - mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory) + mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory[0]) mkPath(log, ExportBuildDirectory + "/" + LigoTagExportDirectory) - printLog(log, "WRITE " + ligoIniPath) - ligoIni = open(ligoIniPath, "w") - ligoIni.write("[LigoConfig]\n") - ligoIni.write("LigoPath=" + DatabaseDirectory + "/" + LigoMaxSourceDirectory + "/\n") - ligoIni.write("LigoExportPath=" + DatabaseDirectory + "/" + LigoDatabaseExportDirectory + "/\n") - ligoIni.write("LigoOldZonePath=" + DatabaseDirectory + "/" + ZoneSourceDirectory + "/\n") - ligoIni.close() - - outDirTag = ExportBuildDirectory + "/" + LigoTagExportDirectory - logFile = ScriptDirectory + "/processes/ligo/log.log" - smallBank = ExportBuildDirectory + "/" + SmallbankExportDirectory + "/" + BankTileBankName + ".smallbank" - - scriptSrc = "maxscript/nel_ligo_export.ms" - scriptDst = MaxUserDirectory + "/scripts/nel_ligo_export.ms" - - if os.path.isfile(scriptDst): + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + LigoMaxSourceDirectory, ".max", ExportBuildDirectory + "/" + LigoTagExportDirectory, ".max.tag")): + printLog(log, "WRITE " + ligoIniPath) + ligoIni = open(ligoIniPath, "w") + ligoIni.write("[LigoConfig]\n") + ligoIni.write("LigoPath=" + DatabaseDirectory + "/" + LigoMaxSourceDirectory + "/\n") + ligoIni.write("LigoExportPath=" + DatabaseDirectory + "/" + LigoDatabaseExportDirectory + "/\n") + ligoIni.write("LigoOldZonePath=" + DatabaseDirectory + "/" + ZoneSourceDirectory[0] + "/\n") + ligoIni.close() + + outDirTag = ExportBuildDirectory + "/" + LigoTagExportDirectory + logFile = ScriptDirectory + "/processes/ligo/log.log" + smallBank = ExportBuildDirectory + "/" + SmallbankExportDirectory + "/" + BankTileBankName + ".smallbank" + + scriptSrc = "maxscript/nel_ligo_export.ms" + scriptDst = MaxUserDirectory + "/scripts/nel_ligo_export.ms" + + if os.path.isfile(scriptDst): + os.remove(scriptDst) + + printLog(log, "WRITE " + scriptDst) + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("output_logfile", logFile) + newline = newline.replace("output_directory_tag", outDirTag) + newline = newline.replace("bankFilename", smallBank) + sDst.write(newline) + sSrc.close() + sDst.close() + + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "nel_ligo_export.ms", "-q", "-mi", "-vn" ]) + os.remove(scriptDst) - - printLog(log, "WRITE " + scriptDst) - sSrc = open(scriptSrc, "r") - sDst = open(scriptDst, "w") - for line in sSrc: - newline = line.replace("output_logfile", logFile) - newline = newline.replace("output_directory_tag", outDirTag) - newline = newline.replace("bankFilename", smallBank) - sDst.write(newline) - sSrc.close() - sDst.close() - - printLog(log, "MAXSCRIPT " + scriptDst) - subprocess.call([ Max, "-U", "MAXScript", "nel_ligo_export.ms", "-q", "-mi", "-vn" ]) - - os.remove(scriptDst) - printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/map/2_build.py b/code/nel/tools/build_gamedata/processes/map/2_build.py index abff9ec7a..44d28979f 100644 --- a/code/nel/tools/build_gamedata/processes/map/2_build.py +++ b/code/nel/tools/build_gamedata/processes/map/2_build.py @@ -63,13 +63,13 @@ else: mkPath(log, sourcePath) destPath = ExportBuildDirectory + "/" + MapBuildDirectory mkPath(log, destPath) - files = findFiles(log, sourcePath, "", ".tga") + files = findFilesNoSubdir(log, sourcePath, ".tga") for file in files: sourceFile = sourcePath + "/" + file destFile = destPath + "/" + os.path.basename(file)[0:-len(".tga")] + ".dds" if needUpdateLogRemoveDest(log, sourceFile, destFile): subprocess.call([ ExecTimeout, str(MapsBuildTimeout), TgaToDds, sourceFile, "-o", destFile, "-m", "-r" + str(ReduceBitmapFactor) ]) - files = findFiles(log, sourcePath, "", ".png") + files = findFilesNoSubdir(log, sourcePath, ".png") for file in files: sourceFile = sourcePath + "/" + file destFile = destPath + "/" + os.path.basename(file)[0:-len(".png")] + ".dds" @@ -78,14 +78,14 @@ else: printLog(log, "") printLog(log, ">>> Build map uncompressed: copy tga, png, dds <<<") -for dir in MapSourceDirectories: +for dir in MapUncompressedSourceDirectories: sourcePath = DatabaseDirectory + "/" + dir mkPath(log, sourcePath) destPath = ExportBuildDirectory + "/" + MapBuildDirectory mkPath(log, destPath) - copyFilesExtNoTreeIfNeeded(log, sourcePath, destPath, ".dds") - copyFilesExtNoTreeIfNeeded(log, sourcePath, destPath, ".png") - copyFilesExtNoTreeIfNeeded(log, sourcePath, destPath, ".tga") + copyFilesExtNoSubdirIfNeeded(log, sourcePath, destPath, ".dds") + copyFilesExtNoSubdirIfNeeded(log, sourcePath, destPath, ".png") + copyFilesExtNoSubdirIfNeeded(log, sourcePath, destPath, ".tga") printLog(log, ">>> Build panoply <<<") printLog(log, "********************************") diff --git a/code/nel/tools/build_gamedata/processes/pacs_prim/0_setup.py b/code/nel/tools/build_gamedata/processes/pacs_prim/0_setup.py new file mode 100644 index 000000000..db68c6484 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/pacs_prim/0_setup.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup pacs_prim +# \date 2010-08-31 16:50GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup pacs_prim +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup pacs_prim") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +for dir in PacsPrimSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + PacsPrimExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + PacsPrimClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/pacs_prim/1_export.py b/code/nel/tools/build_gamedata/processes/pacs_prim/1_export.py new file mode 100644 index 000000000..d28e30670 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/pacs_prim/1_export.py @@ -0,0 +1,115 @@ +#!/usr/bin/python +# +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# +# \file 1_export.py +# \brief Export pacs_prim +# \date 2010-09-03-10-06-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export pacs_prim +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export pacs_prim") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +# ... + +# Export pacs_prim 3dsmax +if MaxAvailable: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + printLog(log, "") + + printLog(log, ">>> Export pacs_prim 3dsmax <<<") + mkPath(log, ExportBuildDirectory + "/" + PacsPrimExportDirectory) + for dir in PacsPrimSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + PacsPrimExportDirectory, ".pacs_prim")): + scriptSrc = "maxscript/pacs_prim_export.ms" + scriptDst = MaxUserDirectory + "/scripts/pacs_prim_export.ms" + outputLogfile = ScriptDirectory + "/processes/pacs_prim/log.log" + outputDirectory = ExportBuildDirectory + "/" + PacsPrimExportDirectory + maxSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, outputDirectory, "", ".pacs_prim") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "pacs_prim_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, outputDirectory, "", ".pacs_prim") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .pacs_prim files!") + os.remove(scriptDst) + + + +printLog(log, ">>> List pacs_prim <<<") +outDirPacsPrim = ExportBuildDirectory + "/" + PacsPrimExportDirectory +mkPath(log, outDirPacsPrim) +listPath = ExportBuildDirectory + "/" + PacsPrimExportDirectory + "/landscape_col_prim_pacs_list.txt" +if os.path.isfile(listPath): + os.remove(listPath) +if WantLandscapeColPrimPacsList: + exportedPacsPrims = findFiles(log, outDirPacsPrim, "", ".pacs_prim") + printLog(log, "WRITE " + listPath) + listFile = open(listPath, "w") + for exported in exportedPacsPrims: + listFile.write(exported + "\n") + listFile.close() + + + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/pacs_prim/2_build.py b/code/nel/tools/build_gamedata/processes/pacs_prim/2_build.py new file mode 100644 index 000000000..84186d962 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/pacs_prim/2_build.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build pacs_prim +# \date 2010-08-31 16:50GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build pacs_prim +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build pacs_prim") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/pacs_prim/3_install.py b/code/nel/tools/build_gamedata/processes/pacs_prim/3_install.py new file mode 100644 index 000000000..abd174652 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/pacs_prim/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install pacs_prim +# \date 2010-08-31 16:50GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install pacs_prim +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install pacs_prim") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +clientPath = ClientDataDirectory + "/" + PacsPrimClientDirectory +mkPath(log, clientPath) + +printLog(log, ">>> Install pacs_prim <<<") +mkPath(log, ExportBuildDirectory + "/" + PacsPrimExportDirectory) +copyFilesExtNoSubdirIfNeeded(log, ExportBuildDirectory + "/" + PacsPrimExportDirectory, clientPath, ".pacs_prim") + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/pacs_prim/maxscript/pacs_prim_export.ms b/code/nel/tools/build_gamedata/processes/pacs_prim/maxscript/pacs_prim_export.ms new file mode 100644 index 000000000..21bdcdd4c --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/pacs_prim/maxscript/pacs_prim_export.ms @@ -0,0 +1,184 @@ + + +-- ################################################################# +-- ## WARNING : this is a generated file, don't change it ! +-- ################################################################# + + +-- Allocate 20 Me for the script +heapSize += 15000000 + +nlErrorFilename = "%OutputLogfile%" +nlErrorStream = openFile nlErrorFilename mode:"a" +if nlErrorStream == undefined then + nlErrorStream = createFile nlErrorFilename + +-- Unhide category +fn unhidecategory = +( + if (geometry.count > 0) then + ( + unhide geometry[1] + if (geometry[1].ishidden == true) then + max hide object toggle + ) + if (shapes.count > 0) then + ( + unhide shapes[1] + if (shapes[1].ishidden == true) then + max hide shape toggle + ) + if (lights.count > 0) then + ( + unhide lights[1] + if (lights[1].ishidden == true) then + max hide light toggle + ) + if (cameras.count > 0) then + ( + unhide cameras[1] + if (cameras[1].ishidden == true) then + max hide camera toggle + ) + if (helpers.count > 0) then + ( + unhide helpers[1] + if (helpers[1].ishidden == true) then + max hide helper toggle + ) +) + +-- Log a message +fn nlerror message = +( + if nlErrorStream != undefined then + ( + format "%\n" message to:nlErrorStream + flush nlErrorStream + ) + + -- To the console + print message +) + + + +fn runNelMaxExport inputMaxFile = +( + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".pacs_prim") + tagThisFile = false + + -- Unhide category + unhidecategory() + + -- Select none + max select none + + -- Select all PACS primitives + for i in geometry do + ( + if ((classof i) == nel_pacs_cylinder) or ((classof i) == nel_pacs_box) then + selectmore i + ) + + -- Array of node + arrayNode = selection as array + + -- Something to export ? + if (arrayNode.count != 0) then + ( + -- Export the collision + if (NelExportPACSPrimitives arrayNode outputNelFile) == false then + ( + nlerror("ERROR exporting PACS primitives in file " + inputMaxFile) + tagThisFile = false + ) + else + ( + nlerror("OK PACS primitives in file " + inputMaxFile) + tagThisFile = true + ) + ) + else + ( + nlerror("WARNING no PACS primitives in file " + inputMaxFile) + tagThisFile = true + ) + + return tagThisFile +) + + + +try +( + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + + -- Sort files + sort files + gc() + + -- No file ? + if files.count != 0 then + ( + -- For each files + for i = 1 to files.count do + ( + inputMaxFile = files[i] + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".pacs_prim") + + try + ( + -- Compare file date + if (NeLTestFileDate outputNelFile inputMaxFile) == true then + ( + -- Free memory and file handles + gc() + heapfree + + -- Reset 3dsmax + resetMAXFile #noprompt + + -- Open the max project + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then + ( + runNelMaxExport(inputMaxFile) + ) + else + ( + -- Error + nlerror("ERROR exporting 'pacs_prim': can't open the file " + inputMaxFile) + ) + ) + else + ( + nlerror("SKIPPED " + inputMaxFile) + ) + ) + catch + ( + -- Error + nlerror("ERROR error exporting 'pacs_prim' in files " + inputMaxFile) + ) + ) + ) + else + ( + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") + ) +) +catch +( + -- Error + nlerror("ERROR fatal error exporting 'pacs_prim' in folder %MaxSourceDirectory%") +) + +-- Bye + +resetMAXFile #noprompt +quitMAX #noPrompt +quitMAX() #noPrompt + diff --git a/code/nel/tools/build_gamedata/processes/properties/0_setup.py b/code/nel/tools/build_gamedata/processes/properties/0_setup.py new file mode 100644 index 000000000..64fb5b198 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/properties/0_setup.py @@ -0,0 +1,125 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup properties +# \date 2010-05-24 13:42GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup properties +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup properties") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + + + +mkPath(log, ActiveProjectDirectory + "/generated") +zlp = open(ActiveProjectDirectory + "/generated/properties.cfg", "w") +ps = open(ActiveProjectDirectory + "/properties_base.cfg", "r") +for line in ps: + try: + SmallbankExportDirectory + except NameError: + SmallbankExportDirectory = "_invalid" + try: + FarbankBuildDirectory + except NameError: + FarbankBuildDirectory = "_invalid" + try: + EcosystemName + except NameError: + EcosystemName = "_invalid" + try: + EcosystemPath + except NameError: + EcosystemPath = "_invalid" + try: + ContinentName + except NameError: + ContinentName = "_invalid" + try: + ContinentPath + except NameError: + ContinentPath = "_invalid" + try: + BankTileBankName + except NameError: + BankTileBankName = "_invalid" + try: + IgLandBuildDirectory + except NameError: + IgLandBuildDirectory = "_invalid" + try: + IgOtherBuildDirectory + except NameError: + IgOtherBuildDirectory = "_invalid" + try: + RbankOutputBuildDirectory + except NameError: + RbankOutputBuildDirectory = "_invalid" + try: + RbankRbankName + except NameError: + RbankRbankName = "_invalid" + newline = line.replace("%ExportBuildDirectory%", ExportBuildDirectory) + newline = newline.replace("%SmallbankExportDirectory%", SmallbankExportDirectory) + newline = newline.replace("%FarbankBuildDirectory%", FarbankBuildDirectory) + newline = newline.replace("%EcosystemName%", EcosystemName) + newline = newline.replace("%EcosystemPath%", EcosystemPath) + newline = newline.replace("%ContinentName%", ContinentName) + newline = newline.replace("%ContinentPath%", ContinentPath) + newline = newline.replace("%CommonName%", CommonName) + newline = newline.replace("%CommonPath%", CommonPath) + newline = newline.replace("%BankTileBankName%", BankTileBankName) + newline = newline.replace("%IgLandBuildDirectory%", IgLandBuildDirectory) + newline = newline.replace("%IgOtherBuildDirectory%", IgOtherBuildDirectory) + newline = newline.replace("%RbankOutputBuildDirectory%", RbankOutputBuildDirectory) + newline = newline.replace("%RbankRbankName%", RbankRbankName) + newline = newline.replace("%BuildQuality%", str(BuildQuality)) + zlp.write(newline) +ps.close() +if (BuildQuality == 1): + ps = open(ActiveProjectDirectory + "/properties_final.cfg", "r") +else: + ps = open(ActiveProjectDirectory + "/properties_draft.cfg", "r") +for line in ps: + zlp.write(line) +zlp.close() +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/properties/1_export.py b/code/nel/tools/build_gamedata/processes/properties/1_export.py new file mode 100644 index 000000000..f494d646e --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/properties/1_export.py @@ -0,0 +1,44 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export properties +# \date 2010-05-24 13:42GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export properties +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/properties/2_build.py b/code/nel/tools/build_gamedata/processes/properties/2_build.py new file mode 100644 index 000000000..d2d245947 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/properties/2_build.py @@ -0,0 +1,42 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build properties +# \date 2010-05-24 13:42GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build properties +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/properties/3_install.py b/code/nel/tools/build_gamedata/processes/properties/3_install.py new file mode 100644 index 000000000..68daf1f4a --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/properties/3_install.py @@ -0,0 +1,43 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install properties +# \date 2010-05-24 13:42GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install properties +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/ps/0_setup.py b/code/nel/tools/build_gamedata/processes/ps/0_setup.py new file mode 100644 index 000000000..54c1ee692 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/ps/0_setup.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief setup ps +# \date 2010-05-24 13:42GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup ps +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup ps") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +for dir in PsSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + PsExportDirectory) + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, ClientDataDirectory + "/" + PsClientDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/ps/1_export.py b/code/nel/tools/build_gamedata/processes/ps/1_export.py new file mode 100644 index 000000000..ea5ed019c --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/ps/1_export.py @@ -0,0 +1,60 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export ps +# \date 2010-05-24 13:42GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export ps +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export ps") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# For each ps directory +printLog(log, ">>> Export ps 3dsmax <<<") +mkPath(log, ExportBuildDirectory + "/" + PsExportDirectory) +for dir in PsSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + copyFilesExtNoSubdirIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + PsExportDirectory, ".ps") + copyFilesExtNoSubdirIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + PsExportDirectory, ".shape") + copyFilesExtNoSubdirIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + PsExportDirectory, ".primitive") + +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/ps/2_build.py b/code/nel/tools/build_gamedata/processes/ps/2_build.py new file mode 100644 index 000000000..b75c4e145 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/ps/2_build.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build ps +# \date 2010-05-24 13:42GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build ps +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build ps") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/ps/3_install.py b/code/nel/tools/build_gamedata/processes/ps/3_install.py new file mode 100644 index 000000000..67671d031 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/ps/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install ps +# \date 2010-05-24 13:42GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install ps +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install ps") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +printLog(log, ">>> Install ps <<<") +srcDir = ExportBuildDirectory + "/" + PsExportDirectory +mkPath(log, srcDir) +destDir = ClientDataDirectory + "/" + PsClientDirectory +mkPath(log, destDir) +copyFilesNoTreeIfNeeded(log, srcDir, destDir) + +printLog(log, "") +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/rbank/0_setup.py b/code/nel/tools/build_gamedata/processes/rbank/0_setup.py index e2accccf3..555f921f3 100644 --- a/code/nel/tools/build_gamedata/processes/rbank/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/rbank/0_setup.py @@ -45,10 +45,14 @@ printLog(log, "") # Setup source directories printLog(log, ">>> Setup source directories <<<") +for dir in RBankCmbSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) mkPath(log, LeveldesignWorldDirectory) # Setup export directories printLog(log, ">>> Setup export directories <<<") +mkPath(log, ExportBuildDirectory + "/" + RBankCmbExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + RBankCmbTagExportDirectory) mkPath(log, ExportBuildDirectory + "/" + SmallbankExportDirectory) # Setup build directories diff --git a/code/nel/tools/build_gamedata/processes/rbank/1_export.py b/code/nel/tools/build_gamedata/processes/rbank/1_export.py index 89b38beac..90922c0c3 100644 --- a/code/nel/tools/build_gamedata/processes/rbank/1_export.py +++ b/code/nel/tools/build_gamedata/processes/rbank/1_export.py @@ -1,8 +1,12 @@ #!/usr/bin/python # +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# # \file 1_export.py # \brief Export rbank -# \date 2009-03-10-22-43-GMT +# \date 2010-09-03-10-06-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export rbank @@ -43,17 +47,56 @@ printLog(log, "-------") printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") + # Find tools -printLog(log, "") +# ... + +# Export rbank 3dsmax +if MaxAvailable: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + printLog(log, "") + + printLog(log, ">>> Export rbank 3dsmax <<<") + mkPath(log, ExportBuildDirectory + "/" + RBankCmbExportDirectory) + mkPath(log, ExportBuildDirectory + "/" + RBankCmbTagExportDirectory) + for dir in RBankCmbSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + RBankCmbTagExportDirectory, ".max.tag")): + scriptSrc = "maxscript/cmb_export.ms" + scriptDst = MaxUserDirectory + "/scripts/cmb_export.ms" + outputLogfile = ScriptDirectory + "/processes/rbank/log.log" + outputDirectory = ExportBuildDirectory + "/" + RBankCmbExportDirectory + tagDirectory = ExportBuildDirectory + "/" + RBankCmbTagExportDirectory + maxSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, tagDirectory, "", ".max.tag") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + newline = newline.replace("%TagDirectory%", tagDirectory) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "cmb_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, tagDirectory, "", ".max.tag") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .max files!") + os.remove(scriptDst) + -# For each rbank directory -printLog(log, ">>> Export rbank 3dsmax <<<") -printLog(log, "********************************") -printLog(log, "******** TODO ********") -printLog(log, "********************************") printLog(log, "") - log.close() diff --git a/code/nel/tools/build_gamedata/processes/rbank/maxscript/cmb_export.ms b/code/nel/tools/build_gamedata/processes/rbank/maxscript/cmb_export.ms new file mode 100644 index 000000000..73f1605f9 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/rbank/maxscript/cmb_export.ms @@ -0,0 +1,211 @@ + + +-- ################################################################# +-- ## WARNING : this is a generated file, don't change it ! +-- ################################################################# + + +-- Allocate 20 Me for the script +heapSize += 15000000 + +nlErrorFilename = "%OutputLogfile%" +nlErrorStream = openFile nlErrorFilename mode:"a" +if nlErrorStream == undefined then + nlErrorStream = createFile nlErrorFilename + +-- Unhide category +fn unhidecategory = +( + if (geometry.count > 0) then + ( + unhide geometry[1] + if (geometry[1].ishidden == true) then + max hide object toggle + ) + if (shapes.count > 0) then + ( + unhide shapes[1] + if (shapes[1].ishidden == true) then + max hide shape toggle + ) + if (lights.count > 0) then + ( + unhide lights[1] + if (lights[1].ishidden == true) then + max hide light toggle + ) + if (cameras.count > 0) then + ( + unhide cameras[1] + if (cameras[1].ishidden == true) then + max hide camera toggle + ) + if (helpers.count > 0) then + ( + unhide helpers[1] + if (helpers[1].ishidden == true) then + max hide helper toggle + ) +) + +-- Log a message +fn nlerror message = +( + if nlErrorStream != undefined then + ( + format "%\n" message to:nlErrorStream + flush nlErrorStream + ) + + -- To the console + print message +) + + + +NEL3D_APPDATA_COLLISION = 1423062613 +NEL3D_APPDATA_COLLISION_EXTERIOR = 1423062614 + + +-- Must export this node ? +fn isToBeExported node = +( + doNotExport = getappdata node NEL3D_APPDATA_COLLISION + if (doNotExport != undefined) then + ( + if (doNotExport == "1") then + return true + ) + + doNotExport = getappdata node NEL3D_APPDATA_COLLISION_EXTERIOR + if (doNotExport != undefined) then + ( + if (doNotExport == "1") then + return true + ) + + return false +) + +fn runNelMaxExport inputMaxFile = +( + outputNelDir = "%OutputDirectory%" + + -- Tag this file ? + tagThisFile = true + + -- Unhide category + unhidecategory() + + -- Select all collision mesh + max select none + for m in geometry do + ( + if (isToBeExported m) == true then + selectmore m + ) + + -- Export the collision + if (NelExportCollision ($selection as array) outputNelDir) == false then + ( + nlerror("ERROR exporting collision " + inputMaxFile) + tagThisFile = false + ) + else + ( + nlerror("OK collision in folder " + outputNelDir) + ) + + return tagThisFile +) + + + + +try +( + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + + -- Sort files + sort files + gc() + + -- No file ? + if files.count != 0 then + ( + -- For each files + for i = 1 to files.count do + ( + inputMaxFile = files[i] + outputTagFile = ("%TagDirectory%/" + (getFilenameFile inputMaxFile) + (getFilenameType inputMaxFile) + ".tag") + + try + ( + -- Compare file date + if (NeLTestFileDate outputTagFile inputMaxFile) == true then + ( + -- Free memory and file handles + gc() + heapfree + + -- Reset 3dsmax + resetMAXFile #noprompt + + -- Open the max project + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then + ( + tagThisFile = runNelMaxExport(inputMaxFile) + + -- Write a tag file + if tagThisFile == true then + ( + tagFile = createFile outputTagFile + if tagFile == undefined then + ( + nlerror("WARNING can't create tag file " + outputTagFile) + ) + else + ( + print "mukyu" to: tagFile + close tagFile + ) + ) + ) + else + ( + -- Error + nlerror("ERROR exporting 'cmb': can't open the file " + inputMaxFile) + ) + ) + else + ( + nlerror("SKIPPED BY TAG " + inputMaxFile) + ) + ) + catch + ( + -- Error + nlerror("ERROR error exporting 'cmb' in files " + inputMaxFile) + ) + ) + ) + else + ( + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") + ) +) +catch +( + -- Error + nlerror("ERROR fatal error exporting 'cmb' in folder %MaxSourceDirectory%") +) + +-- Bye + +resetMAXFile #noprompt +quitMAX #noPrompt +quitMAX() #noPrompt + diff --git a/code/nel/tools/build_gamedata/processes/shape/0_setup.py b/code/nel/tools/build_gamedata/processes/shape/0_setup.py index 54c53826c..5183c38de 100644 --- a/code/nel/tools/build_gamedata/processes/shape/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/shape/0_setup.py @@ -53,18 +53,24 @@ for dir in MapSourceDirectories: # Setup export directories printLog(log, ">>> Setup export directories <<<") mkPath(log, ExportBuildDirectory + "/" + ShapeTagExportDirectory) -mkPath(log, ExportBuildDirectory + "/" + ShapeExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + ShapeNotOptimizedExportDirectory) mkPath(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshExportDirectory) mkPath(log, ExportBuildDirectory + "/" + ShapeLightmapNotOptimizedExportDirectory) mkPath(log, ExportBuildDirectory + "/" + ShapeAnimExportDirectory) +if ClodConfigFile != "": + mkPath(log, ExportBuildDirectory + "/" + ClodExportDirectory) # Setup build directories printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory) mkPath(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + ShapeLightmap16BitsBuildDirectory) # Setup client directories printLog(log, ">>> Setup client directories <<<") mkPath(log, ClientDataDirectory + "/" + ShapeClientDirectory) +mkPath(log, ClientDataDirectory + "/" + LightmapClientDirectory) log.close() diff --git a/code/nel/tools/build_gamedata/processes/shape/1_export.py b/code/nel/tools/build_gamedata/processes/shape/1_export.py index 432511d30..9d3cb67e5 100644 --- a/code/nel/tools/build_gamedata/processes/shape/1_export.py +++ b/code/nel/tools/build_gamedata/processes/shape/1_export.py @@ -29,36 +29,17 @@ sys.path.append("../../configuration") if os.path.isfile("log.log"): os.remove("log.log") -log = open("log.log", "w") +if os.path.isfile("temp_log.log"): + os.remove("temp_log.log") +log = open("temp_log.log", "w") from scripts import * from buildsite import * from process import * from tools import * from directories import * -def hackBigTree(): - # FO_S2_big_tree is corrupt on first export... - outDirTag = ExportBuildDirectory + "/" + ShapeTagExportDirectory - outDirWithCoarse = ExportBuildDirectory + "/" + ShapeWithCoarseMeshExportDirectory - shapeName = "FO_S2_big_tree.shape" - tagName = "FO_S2_big_tree.max.tag" - hackName = "FO_S2_big_tree_hack.tag" - if os.path.exists(outDirWithCoarse + "/" + shapeName) and os.path.exists(outDirTag + "/" + tagName) and not os.path.exists(outDirTag + "/" + hackName): - printLog(log, "Removing bad export of FO_S2_big_tree") - printLog(log, "RM " + outDirWithCoarse + "/" + shapeName) - os.remove(outDirWithCoarse + "/" + shapeName) - printLog(log, "RM " + outDirTag + "/" + tagName) - os.remove(outDirTag + "/" + tagName) - printLog(log, "TAG " + outDirTag + "/" + hackName) - hackTagFile = open(outDirTag + "/" + hackName, "w") - hackTagFile.write("FO_S2_big_tree") - hackTagFile.close() - return 1 - elif os.path.exists(outDirTag + "/" + hackName) and not os.path.exists(outDirWithCoarse + "/" + shapeName) and not os.path.exists(outDirTag + "/" + tagName): - printLog(log, "Missing export of FO_S2_big_tree") - return 0 - else: - return 0 +def getTagFileName(filePath): + return os.path.split(filePath)[1] + ".tag" printLog(log, "") printLog(log, "-------") @@ -78,7 +59,7 @@ if BuildQuality == 0: if MaxAvailable: # Find tools Max = findMax(log, MaxDirectory, MaxExecutable) - # ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) + ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) printLog(log, "") # Export shape 3dsmax @@ -91,7 +72,7 @@ if MaxAvailable: logFile = ScriptDirectory + "/processes/shape/log.log" outDirTag = ExportBuildDirectory + "/" + ShapeTagExportDirectory mkPath(log, outDirTag) - outDirWithoutCoarse = ExportBuildDirectory + "/" + ShapeExportDirectory + outDirWithoutCoarse = ExportBuildDirectory + "/" + ShapeNotOptimizedExportDirectory mkPath(log, outDirWithoutCoarse) outDirWithCoarse = ExportBuildDirectory + "/" + ShapeWithCoarseMeshExportDirectory mkPath(log, outDirWithCoarse) @@ -108,43 +89,67 @@ if MaxAvailable: os.remove(scriptDst) for dir in ShapeSourceDirectories: tagDiff = 1 + secondTry = 1 shapeSourceDir = DatabaseDirectory + "/" + dir mkPath(log, shapeSourceDir) - sSrc = open(scriptSrc, "r") - sDst = open(scriptDst, "w") - for line in sSrc: - newline = line.replace("output_logfile", logFile) - newline = newline.replace("shape_source_directory", shapeSourceDir) - newline = newline.replace("output_directory_tag", outDirTag) - newline = newline.replace("output_directory_without_coarse_mesh", outDirWithoutCoarse) - newline = newline.replace("output_directory_with_coarse_mesh", outDirWithCoarse) - newline = newline.replace("shape_export_opt_export_lighting", ShapeExportOptExportLighting) - newline = newline.replace("shape_export_opt_shadow", ShapeExportOptShadow) - newline = newline.replace("shape_export_opt_lighting_limit", str(ShapeExportOptLightingLimit)) - newline = newline.replace("shape_export_opt_lumel_size", ShapeExportOptLumelSize) - newline = newline.replace("shape_export_opt_oversampling", str(ShapeExportOptOversampling)) - newline = newline.replace("shape_export_opt_lightmap_log", ShapeExportOptLightmapLog) - newline = newline.replace("shape_lightmap_path", outDirLightmap) - newline = newline.replace("output_directory_anim", outDirAnim) - sDst.write(newline) - sSrc.close() - sDst.close() - while tagDiff > 0: - printLog(log, "MAXSCRIPT " + scriptDst) - subprocess.call([ Max, "-U", "MAXScript", "shape_export.ms", "-q", "-mi", "-vn" ]) - tagList = findFiles(log, outDirTag, "", ".tag") - newTagLen = len(tagList) - tagDiff = newTagLen - tagLen - tagLen = newTagLen - printLog(log, "Exported " + str(tagDiff) + " .max files!") - tagDiff += hackBigTree() # force rerun also when big tree deleted - os.remove(scriptDst) + maxFiles = findFilesNoSubdir(log, shapeSourceDir, ".max") + for maxFile in maxFiles: + maxFilePath = shapeSourceDir + "/" + maxFile + tagFilePath = outDirTag + "/" + getTagFileName(maxFilePath) + if (needUpdate(log, maxFilePath, tagFilePath)): + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("output_logfile", logFile) + # newline = newline.replace("shape_source_directory", shapeSourceDir) + newline = newline.replace("shape_max_file_path", maxFilePath) + newline = newline.replace("output_directory_tag", outDirTag) + newline = newline.replace("output_directory_without_coarse_mesh", outDirWithoutCoarse) + newline = newline.replace("output_directory_with_coarse_mesh", outDirWithCoarse) + newline = newline.replace("shape_export_opt_export_lighting", ShapeExportOptExportLighting) + newline = newline.replace("shape_export_opt_shadow", ShapeExportOptShadow) + newline = newline.replace("shape_export_opt_lighting_limit", str(ShapeExportOptLightingLimit)) + newline = newline.replace("shape_export_opt_lumel_size", ShapeExportOptLumelSize) + newline = newline.replace("shape_export_opt_oversampling", str(ShapeExportOptOversampling)) + newline = newline.replace("shape_export_opt_lightmap_log", ShapeExportOptLightmapLog) + newline = newline.replace("shape_lightmap_path", outDirLightmap) + newline = newline.replace("output_directory_anim", outDirAnim) + sDst.write(newline) + sSrc.close() + sDst.close() + retriesLeft = 5 + while retriesLeft > 0: + printLog(log, "MAXSCRIPT " + scriptDst + "; " + maxFilePath) + subprocess.call([ ExecTimeout, str(MaxShapeExportTimeout), Max, "-U", "MAXScript", "shape_export.ms", "-q", "-mi", "-vn" ]) + if os.path.exists(logFile): + try: + lSrc = open(logFile, "r") + for line in lSrc: + lineStrip = line.strip() + if (len(lineStrip) > 0): + printLog(log, lineStrip) + lSrc.close() + os.remove(logFile) + except Exception: + printLog(log, "ERROR Failed to read 3dsmax log") + else: + printLog(log, "WARNING No 3dsmax log") + if (os.path.exists(tagFilePath)): + printLog(log, "OK " + maxFilePath) + retriesLeft = 0 + else: + printLog(log, "FAIL " + maxFilePath) + retriesLeft = retriesLeft - 1 + os.remove(scriptDst) + else: + printLog(log, "SKIP " + maxFilePath) # Export clod 3dsmax - printLog(log, ">>> Export character lod shape files (.clod) from Max <<<") - printLog(log, "********************************") - printLog(log, "******** TODO ********") - printLog(log, "********************************") + # this is historical garbage, just use the clodbank process.. :-) + #printLog(log, ">>> Export character lod shape files (.clod) from Max <<<") + #printLog(log, "********************************") + #printLog(log, "******** TODO ********") + #printLog(log, "********************************") # cat ../clodbank/maxscript/clod_export.ms #| sed -e "s&shape_source_directory&$database_directory/$i&g" @@ -156,6 +161,8 @@ if MaxAvailable: printLog(log, "") log.close() - +if os.path.isfile("log.log"): + os.remove("log.log") +shutil.move("temp_log.log", "log.log") # end of file diff --git a/code/nel/tools/build_gamedata/processes/shape/2_build.py b/code/nel/tools/build_gamedata/processes/shape/2_build.py index c0e158918..60873e12a 100644 --- a/code/nel/tools/build_gamedata/processes/shape/2_build.py +++ b/code/nel/tools/build_gamedata/processes/shape/2_build.py @@ -57,23 +57,49 @@ if DoBuildShadowSkin: printLog(log, "******** TODO ********") printLog(log, "********************************") +mkPath(log, ExportBuildDirectory + "/" + ShapeNotOptimizedExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory) if ClodConfigFile != "": - printLog(log, ">>> BuildClodtex <<<") - printLog(log, "********************************") - printLog(log, "******** TODO ********") - printLog(log, "********************************") + mkPath(log, ExportBuildDirectory + "/" + ClodExportDirectory) + printLog(log, ">>> Build CLodTex <<<") + subprocess.call([ BuildClodtex, "-d", DatabaseDirectory + "/" + ClodConfigFile, ExportBuildDirectory + "/" + ClodExportDirectory, ExportBuildDirectory + "/" + ShapeNotOptimizedExportDirectory, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory ]) +else: + printLog(log, ">>> Copy Shape <<<") + copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeNotOptimizedExportDirectory, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory, ".shape") -printLog(log, ">>> LightmapOptimizer <<<") -printLog(log, "********************************") -printLog(log, "******** TODO ********") -printLog(log, "********************************") +# copy lightmap_not_optimized to lightmap +printLog(log, ">>> Optimize lightmaps <<<") +mkPath(log, ExportBuildDirectory + "/" + ShapeLightmapNotOptimizedExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + ShapeTagExportDirectory) +mkPath(log, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory) +removeFilesRecursive(log, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory) +copyFiles(log, ExportBuildDirectory + "/" + ShapeLightmapNotOptimizedExportDirectory, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory) +# Optimize lightmaps if any. Additionnaly, output a file indicating which lightmaps are 8 bits +subprocess.call([ LightmapOptimizer, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory, ExportBuildDirectory + "/" + ShapeTagExportDirectory, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory + "/list_lm_8bit.txt" ]) -printLog(log, ">>> TgaToDds <<<") -printLog(log, "********************************") -printLog(log, "******** TODO ********") -printLog(log, "********************************") +# Convert lightmap in 16 bits mode if they are not 8 bits lightmap +printLog(log, ">>> Convert lightmaps in 16 or 8 bits <<<") +mkPath(log, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + ShapeLightmap16BitsBuildDirectory) +lightMapTgas = findFilesNoSubdir(log, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory, ".tga") +listLm8Bit = [ ] +listLm8BitFile = open(ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory + "/list_lm_8bit.txt", "r") +for line in listLm8BitFile: + lineStrip = line.strip() + if (len(lineStrip) > 0): + listLm8Bit += [ lineStrip ] +for lightMapTga in lightMapTgas: + srcTga = ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory + "/" + lightMapTga + dstTga = ExportBuildDirectory + "/" + ShapeLightmap16BitsBuildDirectory + "/" + lightMapTga + if needUpdateLogRemoveDest(log, srcTga, dstTga): + if lightMapTga in listLm8Bit: # THIS MAY NOT WORK, PLEASE VERIFY CONTENTS OF list_lm_8bit.txt!!! + subprocess.call([ TgaToDds, srcTga, "-o", dstTga, "-a", "tga8" ]) + else: + subprocess.call([ TgaToDds, srcTga, "-o", dstTga, "-a", "tga16" ]) -if 1: # todo: CoarseMeshTextureNames length > 0 ... +# Corse meshes for this process ? +if len(CoarseMeshTextureNames) > 0: printLog(log, ">>> Build coarse meshes <<<") shapeWithCoarseMesh = ExportBuildDirectory + "/" + ShapeWithCoarseMeshExportDirectory mkPath(log, shapeWithCoarseMesh) @@ -109,8 +135,11 @@ if 1: # todo: CoarseMeshTextureNames length > 0 ... cf.close() subprocess.call([ BuildCoarseMesh, "config_generated.cfg" ]) os.remove("config_generated.cfg") + # Convert the coarse texture to dds for tn in CoarseMeshTextureNames: subprocess.call([ TgaToDds, shapeWithCoarseMesh + "/" + tn + ".tga", "-o", shapeWithCoarseMeshBuilded + "/" + tn + ".dds", "-a", "5" ]) +else: + printLog(log, ">>> No coarse meshes <<<") log.close() diff --git a/code/nel/tools/build_gamedata/processes/shape/3_install.py b/code/nel/tools/build_gamedata/processes/shape/3_install.py index 3253a46fc..393216e8f 100644 --- a/code/nel/tools/build_gamedata/processes/shape/3_install.py +++ b/code/nel/tools/build_gamedata/processes/shape/3_install.py @@ -43,26 +43,26 @@ printLog(log, "-------") printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") +printLog(log, ">>> Install shape <<<") clientPath = ClientDataDirectory + "/" + ShapeClientDirectory mkPath(log, clientPath) - -printLog(log, ">>> Install shape <<<") -mkPath(log, ExportBuildDirectory + "/" + ShapeExportDirectory) -copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeExportDirectory, clientPath, ".shape") +mkPath(log, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory, clientPath, ".shape") mkPath(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory) copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory, clientPath, ".shape") copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory, clientPath, ".dds") -#if test "$lightmap_install_directory"; then -# mkdir $client_directory/$lightmap_install_directory 2>> log.log 2> /dev/null -# cp -u -p -R lightmap_16_bits/. $client_directory/$lightmap_install_directory 2>> log.log -#fi - mkPath(log, ExportBuildDirectory + "/" + ShapeAnimExportDirectory) copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeAnimExportDirectory, clientPath, ".anim") # ls anim | grep ".anim" >> $client_directory/auto_animations_list.txt +printLog(log, ">>> Install shape lightmaps <<<") +clientPath = ClientDataDirectory + "/" + LightmapClientDirectory +mkPath(log, clientPath) +mkPath(log, ExportBuildDirectory + "/" + ShapeLightmap16BitsBuildDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeLightmap16BitsBuildDirectory, clientPath, ".tga") + printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms b/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms index f8af9e878..84a35f0e7 100644 --- a/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms +++ b/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms @@ -99,40 +99,40 @@ fn isToBeExported node = ( if (isAccelerator node) == true then return false - + if ((classof node) == RklPatch) then return false - + if ((classof node) == nel_ps) then return false - + if ((classof node) == nel_pacs_cylinder) then return false - + if ((classof node) == nel_pacs_box) then return false - + doNotExport = getappdata node NEL3D_APPDATA_DONOTEXPORT if (doNotExport != undefined) then ( if (doNotExport == "1") then return false ) - + doNotExport = getappdata node NEL3D_APPDATA_COLLISION if (doNotExport != undefined) then ( if (doNotExport == "1") then return false ) - + doNotExport = getappdata node NEL3D_APPDATA_COLLISION_EXTERIOR if (doNotExport != undefined) then ( if (doNotExport == "1") then return false ) - + return true ) @@ -144,16 +144,16 @@ fn isAnimToBeExported node = return false if (automaticAnimation == "0") then return false - + if (isAccelerator node) == true then return false - + if ((classof node) == nel_pacs_cylinder) then return false - + if ((classof node) == nel_pacs_box) then return false - + doNotExport = getappdata node NEL3D_APPDATA_DONOTEXPORT if (doNotExport != undefined) then ( @@ -221,13 +221,13 @@ fn haveCoarseMesh node = ( -- Get the lod lod = getappdata node (NEL3D_APPDATA_LOD_NAME+lod-1) - + -- Exist ? if (lod != undefined) then ( -- Select a node nd = execute ("$'"+lod+"'") - + -- Node exist ? if (nd != undefined) then ( @@ -245,267 +245,271 @@ fn goShapeExport = ( try ( - -- Get files in the shape_source_directory - files = getFiles "shape_source_directory/*.max" - - -- Sort files - sort files - - -- No file ? - if files.count != 0 then + -- Get filepath + filePath = "shape_max_file_path" + + try ( - -- For each files - for i = 1 to files.count do + -- Delete lod files + lod_array = #() + + -- Ok ? + ok = false + + -- Free memory and file handles + gc () + + -- Reset 3dsmax + resetMAXFile #noprompt + + -- Get the tag file name + tag = ("output_directory_tag/" + (getFilenameFile filePath) + (getFilenameType filePath) + ".tag") + + -- Open the max project + nlerror ("Scanning file " + filePath + " ...") + if loadMaxFile filePath quiet:true == true then ( - try + -- Unhide category + unhidecategory() + + -- Unhide + max unhide all + + -- unselect + max select none + + -- Exported object count + exported = 0 + + -- Add the lod + for node in geometry do ( - -- Delete lod files - lod_array = #() - - -- Ok ? - ok = false - - -- Free memory and file handles - gc () - - -- Reset 3dsmax - resetMAXFile #noprompt - - -- Get the tag file name - tag = ("output_directory_tag/"+(getFilenameFile files[i])+(getFilenameType files[i])+".tag") - - -- Compare date with the tag file - if (NeLTestFileDate tag files[i]) == true then + -- Get lod count + nodeCount = getappdata node NEL3D_APPDATA_LOD_NAME_COUNT + if (nodeCount != undefined) then ( - -- Open the max project - nlerror ("Scanning file "+files[i]+" ...") - if loadMaxFile files[i] quiet:true == true then + -- For each lod + nodeCountNum = nodeCount as Integer + for lod = 1 to nodeCountNum do ( - -- Unhide category - unhidecategory() - - -- Unhide - max unhide all - - -- unselect - max select none - - -- Exported object count - exported = 0 - - -- Add the lod - for node in geometry do + -- Get the lod + lod = getappdata node (NEL3D_APPDATA_LOD_NAME+lod-1) + + -- Exist ? + if (lod != undefined) then ( - -- Get lod count - nodeCount = getappdata node NEL3D_APPDATA_LOD_NAME_COUNT - if (nodeCount != undefined) then + -- Select a node + try ( - -- For each lod - nodeCountNum = nodeCount as Integer - for lod = 1 to nodeCountNum do - ( - -- Get the lod - lod = getappdata node (NEL3D_APPDATA_LOD_NAME+lod-1) - - -- Exist ? - if (lod != undefined) then - ( - -- Select a node - try - ( - nd = execute ("$'"+lod+"'") - ) - catch - ( - nlerror ("Error in Execute $'"+lod+"' from node "+node.name) - nd = undefined - ) - - -- Node exist ? - if (nd != undefined) then - ( - append lod_array nd - ) - ) - ) - ) - ) - - -- Select objects for shadows - for node in geometry do - ( - if (node.parent == undefined) then + nd = execute ("$'"+lod+"'") + ) + catch ( - -- Cast shadow ? - if (isCastShadow node == true) then - ( - -- Select this node - selectmore node - ) - ) - ) - - -- Tag this file ? - tagThisFile = true - - -- Array of node to export - array_node = #() - - -- Add geometry - for node in geometry do - append array_node node - - -- Add shapes - for node in shapes do - append array_node node - - -- For each node - for node in array_node do - ( - -- It is root ? - if (node.parent == undefined) then + nlerror ("Error in Execute $'"+lod+"' from node "+node.name) + nd = undefined + ) + + -- Node exist ? + if (nd != undefined) then ( - -- Is not a skeleton ? - if (node.name != "Bip01") then - ( - -- Can be exported ? - if (isToBeExported node == true) then - ( - -- Not a lod ? - if ((isLod node) == false) then - ( - -- Output directory - if (haveCoarseMesh node) == true then - output = ("output_directory_with_coarse_mesh/"+(node.name)+".shape") - else - output = ("output_directory_without_coarse_mesh/"+(node.name)+".shape") - - -- Compare file date - if (NeLTestFileDate output files[i]) == true then - ( - try - ( - -- Export the shape - if (NelExportShapeEx node output shape_export_opt_shadow shape_export_opt_export_lighting "shape_lightmap_path" shape_export_opt_lighting_limit shape_export_opt_lumel_size shape_export_opt_oversampling true false shape_export_opt_lightmap_log) == true then - ( - nlerror ("OK "+output) - exported = exported+1 - ) - else - ( - -- Error - nlerror ("ERROR exporting shape "+node.name+" in file "+files[i]) - tagThisFile = false - return 0 - ) - ) - catch - ( - -- Error - nlerror ("ERROR fatal error exporting shape "+node.name+" in file "+files[i]) - tagThisFile = false - return 0 - ) - ) - else - ( - -- Error - nlerror ("SKIPPED "+output) - exported = exported+1 - ) - ) - ) - ) + append lod_array nd ) ) - - -- Export default animations - - for node in objects do + ) + ) + ) + + -- Select objects for shadows + for node in geometry do + ( + if (node.parent == undefined) then + ( + -- Cast shadow ? + if (isCastShadow node == true) then + ( + -- Select this node + selectmore node + ) + ) + ) + + -- Tag this file ? + tagThisFile = true + + -- Array of node to export + array_node = #() + + -- Add geometry + for node in geometry do + append array_node node + + -- Add shapes + for node in shapes do + append array_node node + + -- For each node + for node in array_node do + ( + -- It is root ? + if (node.parent == undefined) then + ( + -- Is not a skeleton ? + if (node.name != "Bip01") then + ( + -- Can be exported ? + if (isToBeExported node == true) then ( - -- Can export it ? - if (isAnimToBeExported node) == true then + -- Not a lod ? + if ((isLod node) == false) then ( - -- Anim output directory - output = ("output_directory_anim/"+(node.name)+".anim") - - -- Export the animation - if (NelExportAnimation #(node) output false) == false then + -- Output directory + if (haveCoarseMesh node) == true then + output = ("output_directory_with_coarse_mesh/"+(node.name)+".shape") + else + output = ("output_directory_without_coarse_mesh/"+(node.name)+".shape") + + -- Compare file date + if (NeLTestFileDate output filePath) == true then ( - nlerror ("ERROR exporting animation "+output) - return 0 + try + ( + -- Export the shape + if (NelExportShapeEx node output shape_export_opt_shadow shape_export_opt_export_lighting "shape_lightmap_path" shape_export_opt_lighting_limit shape_export_opt_lumel_size shape_export_opt_oversampling true false shape_export_opt_lightmap_log) == true then + ( + nlerror ("OK "+output) + exported = exported+1 + ) + else + ( + -- Error + nlerror ("ERROR exporting shape "+node.name+" in file "+filePath) + tagThisFile = false + return 0 + ) + ) + catch + ( + -- Error + nlerror ("ERROR fatal error exporting shape "+node.name+" in file "+filePath) + tagThisFile = false + return 0 + ) ) else ( - nlerror ("OK "+output) + -- Error + nlerror ("SKIPPED "+output) + exported = exported+1 ) ) ) - - -- Write a tag file - if tagThisFile == true then - ( - tagFile = createFile tag - if tagFile == undefined then - ( - nlerror ("WARNING can't create tag file "+tag) - ) - else - ( - print "toto" to: tagFile - close tagFile - ) - ) - - -- Something exported - if exported == 0 then - ( - -- Error - nlerror ("WARNING no shape exported from the file "+files[i]) - ) + ) + ) + ) + + -- Export default animations + + for node in objects do + ( + -- Can export it ? + if (isAnimToBeExported node) == true then + ( + -- Anim output directory + output = ("output_directory_anim/"+(node.name)+".anim") + + -- Export the animation + if (NelExportAnimation #(node) output false) == false then + ( + nlerror ("ERROR exporting animation "+output) + return 0 ) else ( - -- Error - nlerror ("ERROR exporting shape: can't open the file "+files[i]) + nlerror ("OK "+output) ) ) + ) + + -- Write a tag file + if tagThisFile == true then + ( + tagFile = createFile tag + if tagFile == undefined then + ( + nlerror ("WARNING can't create tag file "+tag) + ) else ( - -- Error - nlerror ("SKIPPED BY TAG "+files[i]) + print "toto" to: tagFile + close tagFile ) - - gc () - - -- Reset 3dsmax - resetMAXFile #noprompt ) - catch + + -- Something exported + if exported == 0 then ( -- Error - nlerror ("ERROR fatal error exporting shape in file " + files[i]) - -- return 0 + nlerror ("WARNING no shape exported from the file "+filePath) ) ) + else + ( + -- Error + nlerror ("ERROR exporting shape: can't open the file "+filePath) + ) + + try + ( + gc () + ) + catch + ( + nlerror ("ERROR gc " + getCurrentException()) + ) + + try + ( + -- Reset 3dsmax + resetMAXFile #noprompt + ) + catch + ( + nlerror ("ERROR resetMAXFile " + getCurrentException()) + ) + + try + ( + gc () + ) + catch + ( + nlerror ("ERROR gc " + getCurrentException()) + ) ) - else + catch ( - nlerror ("WARNING no max file in folder shape_source_directory") + -- Error + nlerror ("ERROR fatal error exporting shape in file " + filePath) + return 0 ) ) catch ( -- Error - nlerror ("ERROR fatal error exporting shape in folder shape_source_directory") + nlerror ("ERROR fatal error exporting shape in file") return 0 ) ) -goShapeExport() +undo off +( + goShapeExport() +) nlerror ("BYE") quitMAX #noPrompt quitMAX () #noPrompt +quitMAX #noPrompt +quitMAX () #noPrompt diff --git a/code/nel/tools/build_gamedata/processes/skel/1_export.py b/code/nel/tools/build_gamedata/processes/skel/1_export.py index 32744a224..340a0957e 100644 --- a/code/nel/tools/build_gamedata/processes/skel/1_export.py +++ b/code/nel/tools/build_gamedata/processes/skel/1_export.py @@ -1,8 +1,12 @@ #!/usr/bin/python # +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# # \file 1_export.py # \brief Export skel -# \date 2009-03-10-20-23-GMT +# \date 2010-09-03-10-06-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export skel @@ -44,19 +48,59 @@ printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") # Find tools -Max = findMax(log, MaxDirectory, MaxExecutable) -printLog(log, "") +# ... -# For each skel directory -printLog(log, ">>> Export skel 3dsmax <<<") -printLog(log, "********************************") -printLog(log, "******** TODO ********") -printLog(log, "********************************") +# Export skel 3dsmax +if MaxAvailable: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + printLog(log, "") + + printLog(log, ">>> Export skel 3dsmax <<<") + mkPath(log, ExportBuildDirectory + "/" + SkelExportDirectory) + for dir in SkelSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + SkelExportDirectory, ".skel")): + scriptSrc = "maxscript/skel_export.ms" + scriptDst = MaxUserDirectory + "/scripts/skel_export.ms" + outputLogfile = ScriptDirectory + "/processes/skel/log.log" + outputDirectory = ExportBuildDirectory + "/" + SkelExportDirectory + maxSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, outputDirectory, "", ".skel") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "skel_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, outputDirectory, "", ".skel") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .skel files!") + os.remove(scriptDst) + + + +printLog(log, ">>> Export skel directly <<<") mkPath(log, ExportBuildDirectory + "/" + SkelExportDirectory) for dir in SkelSourceDirectories: mkPath(log, DatabaseDirectory + "/" + dir) -printLog(log, "") + copyFilesExtNoSubdirIfNeeded(log, DatabaseDirectory + "/" + dir, ExportBuildDirectory + "/" + SkelExportDirectory, ".skel") + + +printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/skel/maxscript/skel_export.ms b/code/nel/tools/build_gamedata/processes/skel/maxscript/skel_export.ms new file mode 100644 index 000000000..7fd2af0fb --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/skel/maxscript/skel_export.ms @@ -0,0 +1,190 @@ + + +-- ################################################################# +-- ## WARNING : this is a generated file, don't change it ! +-- ################################################################# + + +-- Allocate 20 Me for the script +heapSize += 15000000 + +nlErrorFilename = "%OutputLogfile%" +nlErrorStream = openFile nlErrorFilename mode:"a" +if nlErrorStream == undefined then + nlErrorStream = createFile nlErrorFilename + +-- Unhide category +fn unhidecategory = +( + if (geometry.count > 0) then + ( + unhide geometry[1] + if (geometry[1].ishidden == true) then + max hide object toggle + ) + if (shapes.count > 0) then + ( + unhide shapes[1] + if (shapes[1].ishidden == true) then + max hide shape toggle + ) + if (lights.count > 0) then + ( + unhide lights[1] + if (lights[1].ishidden == true) then + max hide light toggle + ) + if (cameras.count > 0) then + ( + unhide cameras[1] + if (cameras[1].ishidden == true) then + max hide camera toggle + ) + if (helpers.count > 0) then + ( + unhide helpers[1] + if (helpers[1].ishidden == true) then + max hide helper toggle + ) +) + +-- Log a message +fn nlerror message = +( + if nlErrorStream != undefined then + ( + format "%\n" message to:nlErrorStream + flush nlErrorStream + ) + + -- To the console + print message +) + + + +fn runNelMaxExport inputMaxFile = +( + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".skel") + tagThisFile = false + + -- Unhide category + unhidecategory() + + -- Select Bip01, not very smart + if $Bip01 != undefined then + ( + -- Select Bip01 + select $Bip01 + + if ($ != undefined) then + ( + -- Set figure mode on + if ((classof $) == Biped_Object) then + ( + $.controller.figureMode = true + ) + + -- Export the skeleton template + if (NelExportSkeleton $ outputNelFile) == false then + ( + nlerror("ERROR exporting skeleton " + inputMaxFile) + tagThisFile = false + ) + else + ( + nlerror("OK " + outputNelFile) + tagThisFile = true + ) + ) + else + ( + -- Error + nlerror("ERROR exporting skeleton: no Bip01 node in file " + inputMaxFile) + tagThisFile = false + ) + ) + else + ( + -- Error + nlerror("ERROR exporting skeleton: no Bip01 node in file " + inputMaxFile) + tagThisFile = false + ) + + return tagThisFile +) + + + +try +( + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + + -- Sort files + sort files + gc() + + -- No file ? + if files.count != 0 then + ( + -- For each files + for i = 1 to files.count do + ( + inputMaxFile = files[i] + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".skel") + + try + ( + -- Compare file date + if (NeLTestFileDate outputNelFile inputMaxFile) == true then + ( + -- Free memory and file handles + gc() + heapfree + + -- Reset 3dsmax + resetMAXFile #noprompt + + -- Open the max project + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then + ( + runNelMaxExport(inputMaxFile) + ) + else + ( + -- Error + nlerror("ERROR exporting 'skel': can't open the file " + inputMaxFile) + ) + ) + else + ( + nlerror("SKIPPED " + inputMaxFile) + ) + ) + catch + ( + -- Error + nlerror("ERROR error exporting 'skel' in files " + inputMaxFile) + ) + ) + ) + else + ( + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") + ) +) +catch +( + -- Error + nlerror("ERROR fatal error exporting 'skel' in folder %MaxSourceDirectory%") +) + +-- Bye + +resetMAXFile #noprompt +quitMAX #noPrompt +quitMAX() #noPrompt + diff --git a/code/nel/tools/build_gamedata/processes/swt/1_export.py b/code/nel/tools/build_gamedata/processes/swt/1_export.py index 924ba2a6d..a50f6e5a7 100644 --- a/code/nel/tools/build_gamedata/processes/swt/1_export.py +++ b/code/nel/tools/build_gamedata/processes/swt/1_export.py @@ -1,8 +1,12 @@ #!/usr/bin/python # +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# # \file 1_export.py # \brief Export swt -# \date 2009-03-10-20-23-GMT +# \date 2010-09-03-10-06-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export swt @@ -38,25 +42,57 @@ from directories import * printLog(log, "") printLog(log, "-------") -printLog(log, "--- Export skeleton weigths") +printLog(log, "--- Export swt") printLog(log, "-------") printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") # Find tools -Max = findMax(log, MaxDirectory, MaxExecutable) -printLog(log, "") +# ... -# For each swt directory -printLog(log, ">>> Export skeleton weigths 3dsmax <<<") -printLog(log, "********************************") -printLog(log, "******** TODO ********") -printLog(log, "********************************") -mkPath(log, ExportBuildDirectory + "/" + SwtExportDirectory) -for dir in SwtSourceDirectories: - mkPath(log, DatabaseDirectory + "/" + dir) -printLog(log, "") +# Export swt 3dsmax +if MaxAvailable: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + printLog(log, "") + + printLog(log, ">>> Export swt 3dsmax <<<") + mkPath(log, ExportBuildDirectory + "/" + SwtExportDirectory) + for dir in SwtSourceDirectories: + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + SwtExportDirectory, ".swt")): + scriptSrc = "maxscript/swt_export.ms" + scriptDst = MaxUserDirectory + "/scripts/swt_export.ms" + outputLogfile = ScriptDirectory + "/processes/swt/log.log" + outputDirectory = ExportBuildDirectory + "/" + SwtExportDirectory + maxSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, outputDirectory, "", ".swt") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "swt_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, outputDirectory, "", ".swt") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .swt files!") + os.remove(scriptDst) + + +printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/swt/maxscript/swt_export.ms b/code/nel/tools/build_gamedata/processes/swt/maxscript/swt_export.ms index 98cdb0c30..ea6ff95c3 100644 --- a/code/nel/tools/build_gamedata/processes/swt/maxscript/swt_export.ms +++ b/code/nel/tools/build_gamedata/processes/swt/maxscript/swt_export.ms @@ -1,24 +1,18 @@ + + +-- ################################################################# +-- ## WARNING : this is a generated file, don't change it ! +-- ################################################################# + + -- Allocate 20 Me for the script heapSize += 15000000 -nlErrorFilename = "output_logfile" +nlErrorFilename = "%OutputLogfile%" nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename --- Log a message -fn nlerror message = -( - if nlErrorStream != undefined then - ( - format "%\n" message to:nlErrorStream - flush nlErrorStream - ) - - -- To the console - print message -) - -- Unhide category fn unhidecategory = ( @@ -54,86 +48,118 @@ fn unhidecategory = ) ) +-- Log a message +fn nlerror message = +( + if nlErrorStream != undefined then + ( + format "%\n" message to:nlErrorStream + flush nlErrorStream + ) + + -- To the console + print message +) + + + +fn runNelMaxExport inputMaxFile = +( + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".swt") + tagThisFile = false + + -- Unhide category + unhidecategory() + + -- Select all the nodes + max select all + + -- Export the skeleton template + if NelExportSkeletonWeight ($selection as array) outputNelFile == false then + ( + nlerror("ERROR exporting skeleton weight " + inputMaxFile) + tagThisFile = false + ) + else + ( + nlerror("OK " + outputNelFile) + tagThisFile = true + ) + + return tagThisFile +) + + + try ( - -- Get files in the swt_source_directory - files = getFiles "swt_source_directory/*.max" - + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + -- Sort files sort files - + gc() + -- No file ? if files.count != 0 then ( -- For each files for i = 1 to files.count do ( + inputMaxFile = files[i] + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".swt") + try ( - -- Output file - output = ("output_directory/"+(getFilenameFile files[i])+".swt") - -- Compare file date - if (NeLTestFileDate output files[i]) == true then + if (NeLTestFileDate outputNelFile inputMaxFile) == true then ( -- Free memory and file handles - gc () - + gc() + heapfree + -- Reset 3dsmax resetMAXFile #noprompt - + -- Open the max project - nlerror ("Scanning file "+files[i]+" ...") - if loadMaxFile files[i] == true then + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then ( - -- Unhide category - unhidecategory() - - -- Select all the nodes - max select all - - -- Export the skeleton template - if NelExportSkeletonWeight ($selection as array) output == false then - ( - nlerror ("ERROR exporting skeleton weight "+files[i]) - ) - else - ( - nlerror ("OK "+output) - ) + runNelMaxExport(inputMaxFile) ) else ( -- Error - nlerror ("ERROR exporting skeleton weight: can't open the file "+files[i]) + nlerror("ERROR exporting 'swt': can't open the file " + inputMaxFile) ) ) else ( - nlerror ("SKIPPED "+files[i]) + nlerror("SKIPPED " + inputMaxFile) ) ) catch ( -- Error - nlerror ("ERROR error exporting skeleton weight in files " + files[i]) + nlerror("ERROR error exporting 'swt' in files " + inputMaxFile) ) ) ) else ( - nlerror ("WARNING no skeleton weight file in folder swt_source_directory") + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") ) ) catch ( -- Error - nlerror ("ERROR error exporting skeleton weight in folder swt_source_directory") + nlerror("ERROR fatal error exporting 'swt' in folder %MaxSourceDirectory%") ) -- Bye resetMAXFile #noprompt quitMAX #noPrompt -quitMAX () #noPrompt +quitMAX() #noPrompt diff --git a/code/nel/tools/build_gamedata/processes/veget/0_setup.py b/code/nel/tools/build_gamedata/processes/veget/0_setup.py index 84ae97c7d..5c41088e8 100644 --- a/code/nel/tools/build_gamedata/processes/veget/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/veget/0_setup.py @@ -2,7 +2,7 @@ # # \file 0_setup.py # \brief setup veget -# \date 2010-05-24 08:13GMT +# \date 2010-09-02-08-40-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Setup veget diff --git a/code/nel/tools/build_gamedata/processes/veget/1_export.py b/code/nel/tools/build_gamedata/processes/veget/1_export.py index 39e03c484..d73362d45 100644 --- a/code/nel/tools/build_gamedata/processes/veget/1_export.py +++ b/code/nel/tools/build_gamedata/processes/veget/1_export.py @@ -1,8 +1,12 @@ #!/usr/bin/python # +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# # \file 1_export.py # \brief Export veget -# \date 2010-05-24 08:13GMT +# \date 2010-09-03-10-06-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export veget @@ -43,48 +47,56 @@ printLog(log, "-------") printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") + +# Find tools +# ... + +# Export veget 3dsmax if MaxAvailable: # Find tools Max = findMax(log, MaxDirectory, MaxExecutable) - ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) printLog(log, "") - # Export veget 3dsmax printLog(log, ">>> Export veget 3dsmax <<<") - - # Build paths - scriptSrc = "maxscript/veget_export.ms" - # scriptDst = MaxDirectory + "/scripts/veget_export.ms" - scriptDst = MaxUserDirectory + "/scripts/veget_export.ms" - logFile = ScriptDirectory + "/processes/veget/log.log" - outputDirVeget = ExportBuildDirectory + "/" + VegetExportDirectory - mkPath(log, outputDirVeget) - outputDirTag = ExportBuildDirectory + "/" + VegetTagExportDirectory - mkPath(log, outputDirTag) - - # For each directoy mkPath(log, ExportBuildDirectory + "/" + VegetExportDirectory) - if os.path.isfile(scriptDst): - os.remove(scriptDst) + mkPath(log, ExportBuildDirectory + "/" + VegetTagExportDirectory) for dir in VegetSourceDirectories: - vegetSourceDir = DatabaseDirectory + "/" + dir - mkPath(log, vegetSourceDir) - sSrc = open(scriptSrc, "r") - sDst = open(scriptDst, "w") - for line in sSrc: - newline = line.replace("output_logfile", logFile) - newline = newline.replace("veget_source_directory", vegetSourceDir) - newline = newline.replace("output_directory_veget", outputDirVeget) - newline = newline.replace("output_directory_tag", outputDirTag) - sDst.write(newline) - sSrc.close() - sDst.close() - printLog(log, "MAXSCRIPT " + scriptDst) - subprocess.call([ Max, "-U", "MAXScript", "veget_export.ms", "-q", "-mi", "-vn" ]) - os.remove(scriptDst) + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + VegetTagExportDirectory, ".max.tag")): + scriptSrc = "maxscript/veget_export.ms" + scriptDst = MaxUserDirectory + "/scripts/veget_export.ms" + outputLogfile = ScriptDirectory + "/processes/veget/log.log" + outputDirectory = ExportBuildDirectory + "/" + VegetExportDirectory + tagDirectory = ExportBuildDirectory + "/" + VegetTagExportDirectory + maxSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, tagDirectory, "", ".max.tag") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + newline = newline.replace("%TagDirectory%", tagDirectory) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "veget_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, tagDirectory, "", ".max.tag") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .max files!") + os.remove(scriptDst) + + printLog(log, "") - log.close() diff --git a/code/nel/tools/build_gamedata/processes/veget/2_build.py b/code/nel/tools/build_gamedata/processes/veget/2_build.py index c08502eaa..856e87082 100644 --- a/code/nel/tools/build_gamedata/processes/veget/2_build.py +++ b/code/nel/tools/build_gamedata/processes/veget/2_build.py @@ -2,7 +2,7 @@ # # \file 2_build.py # \brief Build veget -# \date 2010-05-24 08:13GMT +# \date 2010-09-02-08-40-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Build veget diff --git a/code/nel/tools/build_gamedata/processes/veget/3_install.py b/code/nel/tools/build_gamedata/processes/veget/3_install.py index 4be5ffc18..69a2ec539 100644 --- a/code/nel/tools/build_gamedata/processes/veget/3_install.py +++ b/code/nel/tools/build_gamedata/processes/veget/3_install.py @@ -2,7 +2,7 @@ # # \file 3_install.py # \brief Install veget -# \date 2010-05-24 08:13GMT +# \date 2010-09-02-08-40-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Install veget @@ -43,12 +43,12 @@ printLog(log, "-------") printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") +printLog(log, ">>> Install veget <<<") +exportPath = ExportBuildDirectory + "/" + VegetExportDirectory +mkPath(log, exportPath) clientPath = ClientDataDirectory + "/" + VegetClientDirectory mkPath(log, clientPath) - -printLog(log, ">>> Install veget <<<") -mkPath(log, ExportBuildDirectory + "/" + VegetExportDirectory) -copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + VegetExportDirectory, clientPath, ".veget") +copyFilesNoTreeIfNeeded(log, exportPath, clientPath) printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/veget/maxscript/veget_export.ms b/code/nel/tools/build_gamedata/processes/veget/maxscript/veget_export.ms index 404f6e2ed..097a37609 100644 --- a/code/nel/tools/build_gamedata/processes/veget/maxscript/veget_export.ms +++ b/code/nel/tools/build_gamedata/processes/veget/maxscript/veget_export.ms @@ -1,17 +1,14 @@ --- Some globals -NEL3D_APPDATA_DONOTEXPORT = 1423062565 -- do not export me : "undefined" = export me - -- "0" = export me - -- "1" = DONT export me -NEL3D_APPDATA_VEGETABLE = 1423062580 -- "undefined" = not vegetable - -- "0" = not vegetable - -- "1" = vegetable +-- ################################################################# +-- ## WARNING : this is a generated file, don't change it ! +-- ################################################################# + -- Allocate 20 Me for the script heapSize += 15000000 -nlErrorFilename = "output_logfile" +nlErrorFilename = "%OutputLogfile%" nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename @@ -64,6 +61,19 @@ fn nlerror message = print message ) + + +-- Some globals + +NEL3D_APPDATA_DONOTEXPORT = 1423062565 -- do not export me : "undefined" = export me + -- "0" = export me + -- "1" = DONT export me + +NEL3D_APPDATA_VEGETABLE = 1423062580 -- "undefined" = not vegetable + -- "0" = not vegetable + -- "1" = vegetable + + -- Must export this node ? fn isToBeExported node = ( @@ -86,127 +96,134 @@ fn isToBeExported node = return false ) + +fn runNelMaxExport inputMaxFile = +( + tagThisFile = true + + -- Unhide category + unhidecategory() + + -- Unhide + max unhide all + + -- unselect + max select none + + -- Exported object count + exported = 0 + + -- For each node + for node in geometry do + ( + -- It is root ? + if (node.parent == undefined) then + ( + -- Is not a skeleton ? + if (node.name != "Bip01") then + ( + -- Can be exported ? + if (isToBeExported node == true) then + ( + -- Output directory + outputNelFile = ("%OutputDirectory%/" + (node.name) + ".veget") + + -- Compare file date + if (NeLTestFileDate outputNelFile inputMaxFile) == true then + ( + try + ( + -- Export the veget + if (NelExportVegetable node outputNelFile false) == true then + ( + nlerror("OK "+outputNelFile) + exported = exported+1 + ) + else + ( + -- Error + nlerror("ERROR exporting veget " + node.name + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + catch + ( + -- Error + nlerror("ERROR fata error exporting veget " + node.name + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + else + ( + -- Error + nlerror("SKIPPED " + outputNelFile) + exported = exported + 1 + ) + ) + ) + ) + ) + + -- Something exported + if exported == 0 then + ( + -- Error + nlerror("WARNING no veget exported from the file " + inputMaxFile) + ) + + return tagThisFile +) + + + try ( - -- Get files in the veget_source_directory - files = getFiles "veget_source_directory/*.max" - + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + -- Sort files sort files - + gc() + -- No file ? if files.count != 0 then ( -- For each files for i = 1 to files.count do ( + inputMaxFile = files[i] + outputTagFile = ("%TagDirectory%/" + (getFilenameFile inputMaxFile) + (getFilenameType inputMaxFile) + ".tag") + try ( - -- Delete lod files - lod_array = #() - - -- Ok ? - ok = false - - -- Free memory and file handles - gc () - - -- Reset 3dsmax - resetMAXFile #noprompt - - -- Get the tag file name - tag = ("output_directory_tag/"+(getFilenameFile files[i])+(getFilenameType files[i])+".tag") - - -- Compare date with the tag file - if (NeLTestFileDate tag files[i]) == true then + -- Compare file date + if (NeLTestFileDate outputTagFile inputMaxFile) == true then ( + -- Free memory and file handles + gc() + heapfree + + -- Reset 3dsmax + resetMAXFile #noprompt + -- Open the max project - nlerror ("Scanning file "+files[i]+" ...") - if loadMaxFile files[i] quiet:true == true then + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then ( - -- Unhide category - unhidecategory() - - tagThisFile = true - - -- Unhide - max unhide all - - -- unselect - max select none - - -- Exported object count - exported = 0 - - -- For each node - for node in geometry do - ( - -- It is root ? - if (node.parent == undefined) then - ( - -- Is not a skeleton ? - if (node.name != "Bip01") then - ( - -- Can be exported ? - if (isToBeExported node == true) then - ( - -- Output directory - output = ("output_directory_veget/"+(node.name)+".veget") - - -- Compare file date - if (NeLTestFileDate output files[i]) == true then - ( - try - ( - -- Export the veget - if (NelExportVegetable node output false) == true then - ( - nlerror ("OK "+output) - exported = exported+1 - ) - else - ( - -- Error - nlerror ("ERROR exporting veget "+node.name+" in file "+files[i]) - tagThisFile = false - ) - ) - catch - ( - -- Error - nlerror ("ERROR fata error exporting veget "+node.name+" in file "+files[i]) - tagThisFile = false - ) - ) - else - ( - -- Error - nlerror ("SKIPPED "+output) - exported = exported+1 - ) - ) - ) - ) - ) - - -- Something exported - if exported == 0 then - ( - -- Error - nlerror ("WARNING no veget exported from the file "+files[i]) - ) - + tagThisFile = runNelMaxExport(inputMaxFile) + -- Write a tag file if tagThisFile == true then ( - tagFile = createFile tag + tagFile = createFile outputTagFile if tagFile == undefined then ( - nlerror ("WARNING can't create tag file "+tag) + nlerror("WARNING can't create tag file " + outputTagFile) ) else ( - print "toto" to: tagFile + print "mukyu" to: tagFile close tagFile ) ) @@ -214,36 +231,35 @@ try else ( -- Error - nlerror ("ERROR exporting veget: can't open the file "+files[i]) + nlerror("ERROR exporting 'veget': can't open the file " + inputMaxFile) ) ) else ( - -- Error - nlerror ("SKIPPED BY TAG "+files[i]) + nlerror("SKIPPED BY TAG " + inputMaxFile) ) ) catch ( -- Error - nlerror ("ERROR error exporting veget in files " + files[i]) + nlerror("ERROR error exporting 'veget' in files " + inputMaxFile) ) ) ) else ( - nlerror ("WARNING no max file in folder veget_source_directory") + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") ) ) catch ( -- Error - nlerror ("ERROR fatal error exporting veget in folder veget_source_directory") + nlerror("ERROR fatal error exporting 'veget' in folder %MaxSourceDirectory%") ) -- Bye resetMAXFile #noprompt quitMAX #noPrompt -quitMAX () #noPrompt +quitMAX() #noPrompt diff --git a/code/nel/tools/build_gamedata/processes/zone/0_setup.py b/code/nel/tools/build_gamedata/processes/zone/0_setup.py index 8f1acdab9..e6dc014d9 100644 --- a/code/nel/tools/build_gamedata/processes/zone/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/zone/0_setup.py @@ -45,7 +45,7 @@ printLog(log, "") # Setup source directories printLog(log, ">>> Setup source directories <<<") -mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory) +mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory[0]) # Setup export directories printLog(log, ">>> Setup export directories <<<") diff --git a/code/nel/tools/build_gamedata/processes/zone/1_export.py b/code/nel/tools/build_gamedata/processes/zone/1_export.py index 19308e1d1..10e085024 100644 --- a/code/nel/tools/build_gamedata/processes/zone/1_export.py +++ b/code/nel/tools/build_gamedata/processes/zone/1_export.py @@ -1,8 +1,12 @@ #!/usr/bin/python # +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# # \file 1_export.py # \brief Export zone -# \date 2009-03-10-22-23-GMT +# \date 2010-09-03-10-06-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Export zone @@ -44,25 +48,59 @@ printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") # Find tools -Max = findMax(log, MaxDirectory, MaxExecutable) -ExecTimeout = findTool(log, ToolDirectories, ExecTimeoutTool, ToolSuffix) -printLog(log, "") +# ... -# For each zone directory -printLog(log, ">>> Export zone 3dsmax <<<") -printLog(log, "********************************") -printLog(log, "******** TODO ********") -printLog(log, "********************************") -mkPath(log, ExportBuildDirectory + "/" + ZoneExportDirectory) -mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory) -printLog(log, "") +# Export zone 3dsmax +if MaxAvailable: + # Find tools + Max = findMax(log, MaxDirectory, MaxExecutable) + printLog(log, "") + + printLog(log, ">>> Export zone 3dsmax <<<") + mkPath(log, ExportBuildDirectory + "/" + ZoneExportDirectory) + for dir in ZoneSourceDirectory: + mkPath(log, DatabaseDirectory + "/" + dir) + if (needUpdateDirByTagLog(log, DatabaseDirectory + "/" + dir, ".max", ExportBuildDirectory + "/" + ZoneExportDirectory, ".zone")): + scriptSrc = "maxscript/zone_export.ms" + scriptDst = MaxUserDirectory + "/scripts/zone_export.ms" + outputLogfile = ScriptDirectory + "/processes/zone/log.log" + outputDirectory = ExportBuildDirectory + "/" + ZoneExportDirectory + maxSourceDir = DatabaseDirectory + "/" + dir + tagList = findFiles(log, outputDirectory, "", ".zone") + tagLen = len(tagList) + if os.path.isfile(scriptDst): + os.remove(scriptDst) + tagDiff = 1 + sSrc = open(scriptSrc, "r") + sDst = open(scriptDst, "w") + for line in sSrc: + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%MaxSourceDirectory%", maxSourceDir) + newline = newline.replace("%OutputDirectory%", outputDirectory) + sDst.write(newline) + sSrc.close() + sDst.close() + while tagDiff > 0: + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "zone_export.ms", "-q", "-mi", "-vn" ]) + tagList = findFiles(log, outputDirectory, "", ".zone") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + printLog(log, "Exported " + str(tagDiff) + " .zone files!") + os.remove(scriptDst) -printLog(log, ">>> Export zone ligo <<<") + + +printLog(log, ">>> Try to copy ligo zone if any <<<") printLog(log, "********************************") printLog(log, "******** TODO ********") printLog(log, "********************************") printLog(log, "") + + +printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/zone/2_build.py b/code/nel/tools/build_gamedata/processes/zone/2_build.py index cdbecfe12..42d033102 100644 --- a/code/nel/tools/build_gamedata/processes/zone/2_build.py +++ b/code/nel/tools/build_gamedata/processes/zone/2_build.py @@ -61,7 +61,7 @@ if BuildQuality == 1: mkPath(log, ExportBuildDirectory + "/" + ZoneDependBuildDirectory) mkPath(log, ActiveProjectDirectory + "/generated") configFile = ActiveProjectDirectory + "/generated/zone_dependencies.cfg" - templateCf = open(ActiveProjectDirectory + "/generated/zone_lighter.cfg", "r") + templateCf = open(ActiveProjectDirectory + "/generated/properties.cfg", "r") cf = open(configFile, "w") for line in templateCf: cf.write(line) diff --git a/code/nel/tools/build_gamedata/processes/zone/maxscript/zone_export.ms b/code/nel/tools/build_gamedata/processes/zone/maxscript/zone_export.ms new file mode 100644 index 000000000..71f63e45b --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/zone/maxscript/zone_export.ms @@ -0,0 +1,223 @@ + + +-- ################################################################# +-- ## WARNING : this is a generated file, don't change it ! +-- ################################################################# + + +-- Allocate 20 Me for the script +heapSize += 15000000 + +nlErrorFilename = "%OutputLogfile%" +nlErrorStream = openFile nlErrorFilename mode:"a" +if nlErrorStream == undefined then + nlErrorStream = createFile nlErrorFilename + +-- Unhide category +fn unhidecategory = +( + if (geometry.count > 0) then + ( + unhide geometry[1] + if (geometry[1].ishidden == true) then + max hide object toggle + ) + if (shapes.count > 0) then + ( + unhide shapes[1] + if (shapes[1].ishidden == true) then + max hide shape toggle + ) + if (lights.count > 0) then + ( + unhide lights[1] + if (lights[1].ishidden == true) then + max hide light toggle + ) + if (cameras.count > 0) then + ( + unhide cameras[1] + if (cameras[1].ishidden == true) then + max hide camera toggle + ) + if (helpers.count > 0) then + ( + unhide helpers[1] + if (helpers[1].ishidden == true) then + max hide helper toggle + ) +) + +-- Log a message +fn nlerror message = +( + if nlErrorStream != undefined then + ( + format "%\n" message to:nlErrorStream + flush nlErrorStream + ) + + -- To the console + print message +) + + + +-- Find id +Fn findID node = +( + local + + -- Const + alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ" + NameTab = filterString node.name "_" + Z_ID = -1 + alpha_letter1 = NameTab[2][1] + alpha_letter2 = NameTab[2][2] + alpha_letter1_value = findstring alphabet alpha_letter1 + alpha_letter2_value = findstring alphabet alpha_letter2 + + -- Decompose theh name in an array array[1]=numeric string value array[2]=alpha string value + -- The index of the engine start at 0 but the script one at 1 so we sub 1 each time + alpha_sub_id = (((alpha_letter1_value as integer - 1) * 26 + (alpha_letter2_value as integer)))-1 + num_sub_id = (NameTab[1] as integer)-1 + + -- Array of 256 per 256 + --------------------------- + -- 0 1 2 3 ... 255 + -- 256 257 258 259 ... 511 + -- 512 513 514 515 ... 767 + -- ... + + Z_ID = num_sub_id*256 + alpha_sub_id + return Z_ID +) + +fn runNelMaxExport inputMaxFile = +( + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".zone") + tagThisFile = false + + -- Unhide category + unhidecategory() + + -- Select none + max select none + + -- Found it ? + find = false + + -- For each object in the priject + for i in geometry do + ( + -- Look for a NeL patch mesh + if (classof i) == RklPatch then + ( + -- Error catching + try + ( + if (ExportRykolZone i outputNelFile (findID i)) == false then + ( + nlerror("ERROR exporting zone " + i.name + " in file " + inputMaxFile) + ) + else + ( + nlerror("OK " + outputNelFile) + tagThisFile = true + find = true + exit + ) + ) + catch + ( + -- Error + nlerror("ERROR fatal error exporting zone " + i.name + " in file " + inputMaxFile) + tagThisFile = false + ) + ) + ) + + -- Not found ? + if (find == false) then + ( + -- Error + nlerror("WARNING no zone found in project " + inputMaxFile) + tagThisFile = true + ) + + return tagThisFile +) + + +try +( + -- Get files in the %MaxSourceDirectory% directory + files = getFiles "%MaxSourceDirectory%/*.max" + gc() + + -- Sort files + sort files + gc() + + -- No file ? + if files.count != 0 then + ( + -- For each files + for i = 1 to files.count do + ( + inputMaxFile = files[i] + outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".zone") + + try + ( + -- Compare file date + if (NeLTestFileDate outputNelFile inputMaxFile) == true then + ( + -- Free memory and file handles + gc() + heapfree + + -- Reset 3dsmax + resetMAXFile #noprompt + + -- Open the max project + nlerror("Scanning file " + inputMaxFile + " ...") + if (loadMaxFile inputMaxFile quiet:true) == true then + ( + runNelMaxExport(inputMaxFile) + ) + else + ( + -- Error + nlerror("ERROR exporting 'zone': can't open the file " + inputMaxFile) + ) + ) + else + ( + nlerror("SKIPPED " + inputMaxFile) + ) + ) + catch + ( + -- Error + nlerror("ERROR error exporting 'zone' in files " + inputMaxFile) + ) + ) + ) + else + ( + nlerror("WARNING no *.max file in folder %MaxSourceDirectory%") + ) +) +catch +( + -- Error + nlerror("ERROR fatal error exporting 'zone' in folder %MaxSourceDirectory%") +) + +-- Bye + +resetMAXFile #noprompt +quitMAX #noPrompt +quitMAX() #noPrompt + diff --git a/code/nel/tools/build_gamedata/processes/zone_light/0_setup.py b/code/nel/tools/build_gamedata/processes/zone_light/0_setup.py index e4792e9e6..7ce53d05c 100644 --- a/code/nel/tools/build_gamedata/processes/zone_light/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/zone_light/0_setup.py @@ -43,32 +43,6 @@ printLog(log, "-------") printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") -mkPath(log, ActiveProjectDirectory + "/generated") -zlp = open(ActiveProjectDirectory + "/generated/zone_lighter.cfg", "w") -ps = open(ActiveProjectDirectory + "/zone_lighter_base.cfg", "r") -for line in ps: - newline = line.replace("%ExportBuildDirectory%", ExportBuildDirectory) - newline = newline.replace("%SmallbankExportDirectory%", SmallbankExportDirectory) - newline = newline.replace("%FarbankBuildDirectory%", FarbankBuildDirectory) - newline = newline.replace("%EcosystemName%", EcosystemName) - newline = newline.replace("%EcosystemPath%", EcosystemPath) - newline = newline.replace("%BankTileBankName%", BankTileBankName) - newline = newline.replace("%IgLandBuildDirectory%", IgLandBuildDirectory) - newline = newline.replace("%IgOtherBuildDirectory%", IgOtherBuildDirectory) - newline = newline.replace("%RbankOutputBuildDirectory%", RbankOutputBuildDirectory) - newline = newline.replace("%RbankRbankName%", RbankRbankName) - newline = newline.replace("%BuildQuality%", str(BuildQuality)) - zlp.write(newline) -ps.close() -if (BuildQuality == 1): - ps = open(ActiveProjectDirectory + "/zone_lighter_final.cfg", "r") -else: - ps = open(ActiveProjectDirectory + "/zone_lighter_draft.cfg", "r") -for line in ps: - zlp.write(line) -zlp.close() -printLog(log, "") - # Setup source directories printLog(log, ">>> Setup source directories <<<") for dir in WaterMapSourceDirectories: @@ -81,6 +55,7 @@ mkPath(log, ExportBuildDirectory + "/" + ZoneLightWaterShapesLightedExportDirect # Setup build directories printLog(log, ">>> Setup build directories <<<") mkPath(log, ExportBuildDirectory + "/" + ZoneWeldBuildDirectory) +mkPath(log, ExportBuildDirectory + "/" + ZoneDependBuildDirectory) mkPath(log, ExportBuildDirectory + "/" + ZoneLightBuildDirectory) mkPath(log, ExportBuildDirectory + "/" + ZoneLightDependBuildDirectory) mkPath(log, ExportBuildDirectory + "/" + ZoneLightIgLandBuildDirectory) diff --git a/code/nel/tools/build_gamedata/processes/zone_light/2_build.py b/code/nel/tools/build_gamedata/processes/zone_light/2_build.py index dc6cccdfa..f06e7f72c 100644 --- a/code/nel/tools/build_gamedata/processes/zone_light/2_build.py +++ b/code/nel/tools/build_gamedata/processes/zone_light/2_build.py @@ -60,15 +60,15 @@ else: mkPath(log, srcDir) destDir = ExportBuildDirectory + "/" + ZoneLightBuildDirectory mkPath(log, destDir) - dependDir = ExportBuildDirectory + "/" + ZoneLightDependBuildDirectory + dependDir = ExportBuildDirectory + "/" + ZoneDependBuildDirectory mkPath(log, dependDir) files = findFiles(log, srcDir, "", ".zonew") for file in files: srcFile = srcDir + "/" + file destFile = destDir + "/" + file[0:-len(".zonew")] + ".zonel" if (needUpdateLogRemoveDest(log, srcFile, destFile)): - dependFile = destDir + "/" + file[0:-len(".zonew")] + ".depend" - subprocess.call([ ExecTimeout, str(ZoneLightBuildTimeout), ZoneLighter, srcFile, destFile, ActiveProjectDirectory + "/generated/zone_lighter.cfg", dependFile ]) + dependFile = dependDir + "/" + file[0:-len(".zonew")] + ".depend" + subprocess.call([ ExecTimeout, str(ZoneLightBuildTimeout), ZoneLighter, srcFile, destFile, ActiveProjectDirectory + "/generated/properties.cfg", dependFile ]) printLog(log, "") # For each zone_light ig @@ -84,7 +84,7 @@ else: mkPath(log, igsrcDir) destDir = ExportBuildDirectory + "/" + ZoneLightIgLandBuildDirectory mkPath(log, destDir) - dependDir = ExportBuildDirectory + "/" + ZoneLightDependBuildDirectory + dependDir = ExportBuildDirectory + "/" + ZoneDependBuildDirectory mkPath(log, dependDir) files = findFiles(log, srcDir, "", ".zonel") for file in files: @@ -93,8 +93,8 @@ else: if (os.path.isfile(igsrcFile)): if (needUpdateLogRemoveDest(log, igsrcFile, destFile)): srcFile = srcDir + "/" + file - dependFile = destDir + "/" + file[0:-len(".zonel")] + ".depend" - subprocess.call([ ExecTimeout, str(ZoneIgLightBuildTimeout), ZoneIgLighter, srcFile, destFile, ActiveProjectDirectory + "/generated/zone_lighter.cfg", dependFile ]) + dependFile = dependDir + "/" + file[0:-len(".zonel")] + ".depend" + subprocess.call([ ExecTimeout, str(ZoneIgLightBuildTimeout), ZoneIgLighter, srcFile, destFile, ActiveProjectDirectory + "/generated/properties.cfg", dependFile ]) printLog(log, "") log.close() diff --git a/code/nel/tools/georges/georges2csv/CMakeLists.txt b/code/nel/tools/georges/georges2csv/CMakeLists.txt index 79ced2634..5aeb95876 100644 --- a/code/nel/tools/georges/georges2csv/CMakeLists.txt +++ b/code/nel/tools/georges/georges2csv/CMakeLists.txt @@ -3,8 +3,11 @@ FILE(GLOB SRC *.cpp *.h) ADD_EXECUTABLE(georges2csv ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) + TARGET_LINK_LIBRARIES(georges2csv ${PLATFORM_LINKFLAGS} nelmisc nelgeorges) NL_DEFAULT_PROPS(georges2csv "NeL, Tools, Georges: georges2csv") NL_ADD_RUNTIME_FLAGS(georges2csv) +ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) + INSTALL(TARGETS georges2csv RUNTIME DESTINATION bin COMPONENT toolsgeorges) diff --git a/code/nel/tools/georges/georges2csv/georges2csv.vcproj b/code/nel/tools/georges/georges2csv/georges2csv.vcproj index 5099fe41a..a75693980 100644 --- a/code/nel/tools/georges/georges2csv/georges2csv.vcproj +++ b/code/nel/tools/georges/georges2csv/georges2csv.vcproj @@ -4,6 +4,7 @@ Version="9,00" Name="georges2csv" ProjectGUID="{885542B1-BE3C-401A-A2A4-DA49E48DF0AB}" + RootNamespace="georges2csv" TargetFrameworkVersion="0" > @@ -95,86 +96,6 @@ Name="VCPostBuildEventTool" /> - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + 1000 -#pragma once -#endif // _MSC_VER > 1000 - - -// TODO: reference additional headers your program requires here - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_STDAFX_H__39F9814B_8C9D_4AA7_958F_111437B98069__INCLUDED_) diff --git a/code/nel/tools/memory/memlog/memlog.cpp b/code/nel/tools/memory/memlog/memlog.cpp index dff34ad6d..53a843718 100644 --- a/code/nel/tools/memory/memlog/memlog.cpp +++ b/code/nel/tools/memory/memlog/memlog.cpp @@ -1,7 +1,20 @@ -// memlog.cpp : Defines the entry point for the console application. +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited // +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . -#include "stdafx.h" +#include #include #include diff --git a/code/nel/tools/misc/make_sheet_id/make_sheet_id.cpp b/code/nel/tools/misc/make_sheet_id/make_sheet_id.cpp index 2755e2a96..c84b328ef 100644 --- a/code/nel/tools/misc/make_sheet_id/make_sheet_id.cpp +++ b/code/nel/tools/misc/make_sheet_id/make_sheet_id.cpp @@ -424,11 +424,10 @@ int main( int argc, char ** argv ) NLMISC::CApplicationContext appContext; #ifdef NL_OS_UNIX - std::string homeDir = getenv("HOME"); - NLMISC::CPath::addSearchPath( homeDir + "/.nel"); + NLMISC::CPath::addSearchPath(NLMISC::CFile::getApplicationDirectory("NeL")); #endif // NL_OS_UNIX - NLMISC::CPath::addSearchPath(NL_MK_SH_ID_CFG); + NLMISC::CPath::addSearchPath(NL_MK_SH_ID_CFG); // read args if( argc < 2 ) diff --git a/code/nel/tools/misc/message_box_qt/CMakeLists.txt b/code/nel/tools/misc/message_box_qt/CMakeLists.txt index f1e75bf97..f77fc3fd4 100644 --- a/code/nel/tools/misc/message_box_qt/CMakeLists.txt +++ b/code/nel/tools/misc/message_box_qt/CMakeLists.txt @@ -9,10 +9,12 @@ SET( QT_USE_QTXML TRUE) ADD_EXECUTABLE(message_box_qt ${MESSAGE_BOX_SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${QT_INCLUDES}) -TARGET_LINK_LIBRARIES(message_box_qt ${LIBXML2_LIBRARIES} ${QT_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc) -SET_TARGET_PROPERTIES(message_box_qt PROPERTIES PROJECT_LABEL "Tools, Misc: Qt Message Box") -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} ${QT_DEFINITIONS}) +INCLUDE_DIRECTORIES(${QT_INCLUDES}) + +TARGET_LINK_LIBRARIES(message_box_qt ${QT_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc) +NL_DEFAULT_PROPS(message_box_qt "Tools, Misc: Qt Message Box") + +ADD_DEFINITIONS(${QT_DEFINITIONS}) INSTALL(TARGETS message_box_qt RUNTIME DESTINATION bin COMPONENT toolsmisc) diff --git a/code/nel/tools/misc/words_dic_qt/CMakeLists.txt b/code/nel/tools/misc/words_dic_qt/CMakeLists.txt index b697e9f50..ed8e51389 100644 --- a/code/nel/tools/misc/words_dic_qt/CMakeLists.txt +++ b/code/nel/tools/misc/words_dic_qt/CMakeLists.txt @@ -22,10 +22,13 @@ QT4_WRAP_CPP( WORDS_DIC_MOC_SRCS ${WORDS_DIC_HDR}) ADD_EXECUTABLE(words_dic_qt ${WORDS_DIC_SRC} ${WORDS_DIC_MOC_SRCS} ${WORDS_DIC_RC_SRCS} ${WORDS_DIC_UI_HDRS} ${WORDS_DIC_RC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${QT_INCLUDES}) -TARGET_LINK_LIBRARIES(words_dic_qt ${LIBXML2_LIBRARIES} ${QT_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc) -SET_TARGET_PROPERTIES(words_dic_qt PROPERTIES PROJECT_LABEL "Tools, Misc: Qt Words Dic") -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} ${QT_DEFINITIONS}) +INCLUDE_DIRECTORIES(${QT_INCLUDES}) + +TARGET_LINK_LIBRARIES(words_dic_qt ${QT_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc) +NL_DEFAULT_PROPS(words_dic_qt "Tools, Misc: Qt Words Dic") +NL_ADD_RUNTIME_FLAGS(words_dic_qt) + +ADD_DEFINITIONS(${QT_DEFINITIONS}) INSTALL(TARGETS words_dic_qt RUNTIME DESTINATION bin COMPONENT toolsmisc) INSTALL(FILES words_dic.cfg DESTINATION etc/nel COMPONENT toolsmisc) diff --git a/code/nel/tools/nel_unit_test/CMakeLists.txt b/code/nel/tools/nel_unit_test/CMakeLists.txt index 66fefc76a..f939bcaf5 100644 --- a/code/nel/tools/nel_unit_test/CMakeLists.txt +++ b/code/nel/tools/nel_unit_test/CMakeLists.txt @@ -3,11 +3,11 @@ FILE(GLOB SRC *.cpp *.h) ADD_EXECUTABLE(nel_unit_test ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${CPPTEST_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nel_unit_test ${LIBXML2_LIBRARIES} ${CPPTEST_LIBRARY} ${PLATFORM_LINKFLAGS} nelmisc nelnet nelligo) + +TARGET_LINK_LIBRARIES(nel_unit_test ${CPPTEST_LIBRARY} ${PLATFORM_LINKFLAGS} nelmisc nelnet nelligo) NL_DEFAULT_PROPS(nel_unit_test "Unit Tests") NL_ADD_RUNTIME_FLAGS(nel_unit_test) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -ADD_DEFINITIONS(-DNEL_UNIT_BASE="\\"${PROJECT_SOURCE_DIR}/tools/nel_unit_test/\\"") +ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DNEL_UNIT_BASE="\\"${PROJECT_SOURCE_DIR}/tools/nel_unit_test/\\"") INSTALL(TARGETS nel_unit_test RUNTIME DESTINATION bin) diff --git a/code/nel/tools/pacs/build_ig_boxes/main.cpp b/code/nel/tools/pacs/build_ig_boxes/main.cpp index de308ed25..9d420745d 100644 --- a/code/nel/tools/pacs/build_ig_boxes/main.cpp +++ b/code/nel/tools/pacs/build_ig_boxes/main.cpp @@ -86,11 +86,10 @@ void init() try { #ifdef NL_OS_UNIX - std::string homeDir = getenv("HOME"); - NLMISC::CPath::addSearchPath( homeDir + "/.nel"); + NLMISC::CPath::addSearchPath(NLMISC::CFile::getApplicationDirectory("NeL")); #endif // NL_OS_UNIX - NLMISC::CPath::addSearchPath(NL_BIB_CFG); + NLMISC::CPath::addSearchPath(NL_BIB_CFG); CConfigFile cf; uint i; diff --git a/code/nel/tools/pacs/build_indoor_rbank/main.cpp b/code/nel/tools/pacs/build_indoor_rbank/main.cpp index e237f9bcd..9fbd77d1e 100644 --- a/code/nel/tools/pacs/build_indoor_rbank/main.cpp +++ b/code/nel/tools/pacs/build_indoor_rbank/main.cpp @@ -122,11 +122,10 @@ void initConfig() try { #ifdef NL_OS_UNIX - std::string homeDir = getenv("HOME"); - NLMISC::CPath::addSearchPath( homeDir + "/.nel"); + NLMISC::CPath::addSearchPath(NLMISC::CFile::getApplicationDirectory("NeL")); #endif // NL_OS_UNIX - NLMISC::CPath::addSearchPath(NL_BIRB_CFG); + NLMISC::CPath::addSearchPath(NL_BIRB_CFG); CConfigFile cf; diff --git a/code/nel/tools/pacs/build_rbank/CMakeLists.txt b/code/nel/tools/pacs/build_rbank/CMakeLists.txt index f4dbc1251..fce2c5f58 100644 --- a/code/nel/tools/pacs/build_rbank/CMakeLists.txt +++ b/code/nel/tools/pacs/build_rbank/CMakeLists.txt @@ -10,5 +10,7 @@ TARGET_LINK_LIBRARIES(build_rbank ${PLATFORM_LINKFLAGS} nelpacs nel3d nelligo ne NL_DEFAULT_PROPS(build_rbank "NeL, Tools, PACS: build_rbank") NL_ADD_RUNTIME_FLAGS(build_rbank) +ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) + INSTALL(TARGETS build_rbank RUNTIME DESTINATION bin COMPONENT toolspacs) INSTALL(FILES build_rbank.cfg DESTINATION etc/nel COMPONENT toolspacs) diff --git a/code/nel/tools/sound/CMakeLists.txt b/code/nel/tools/sound/CMakeLists.txt new file mode 100644 index 000000000..d3f5a12fa --- /dev/null +++ b/code/nel/tools/sound/CMakeLists.txt @@ -0,0 +1 @@ + diff --git a/code/nelns/login_system/nel_launcher_windows_ext2/CMakeLists.txt b/code/nelns/login_system/nel_launcher_windows_ext2/CMakeLists.txt index c80badf81..4bdc373b1 100644 --- a/code/nelns/login_system/nel_launcher_windows_ext2/CMakeLists.txt +++ b/code/nelns/login_system/nel_launcher_windows_ext2/CMakeLists.txt @@ -1,20 +1,16 @@ FILE(GLOB SRC *.cpp *.h) -DECORATE_NEL_LIB("nel3d") -SET(NL3D_LIB ${LIBNAME}) - ADD_EXECUTABLE(nel_launcher_ext2 WIN32 ${SRC} nel_launcher.rc) IF(CURL_FOUND) ADD_DEFINITIONS(-DUSE_CURL) ENDIF(CURL_FOUND) ADD_DEFINITIONS(-DNL_LAUNCHER_CFG="\\"${NL_ETC_PREFIX}/\\"") -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${NELMISC_INCLUDE_DIRS}) -TARGET_LINK_LIBRARIES(nel_launcher_ext2 ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} ${NELNET_LIBRARY} ${NELMISC_LIBRARY} ${ZLIB_LIBRARY} ${CURL_LIBRARY}) -SET_TARGET_PROPERTIES(nel_launcher_ext2 PROPERTIES - LINK_FLAGS "/NODEFAULTLIB:libcmt" - PROJECT_LABEL "Launcher: NeL Launcher Ext2") -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +INCLUDE_DIRECTORIES(${NELMISC_INCLUDE_DIRS}) + +TARGET_LINK_LIBRARIES(nel_launcher_ext2 ${PLATFORM_LINKFLAGS} ${NELNET_LIBRARY} ${NELMISC_LIBRARY} ${ZLIB_LIBRARY} ${CURL_LIBRARY}) +NL_DEFAULT_PROPS(nel_launcher_ext2 "Launcher: NeL Launcher Ext2") +NL_ADD_RUNTIME_FLAGS(nel_launcher_ext2) INSTALL(TARGETS nel_launcher_ext2 RUNTIME DESTINATION bin COMPONENT launcher) INSTALL(FILES nel_launcher.cfg DESTINATION etc/nel COMPONENT launcher) diff --git a/code/ryzom/CMakeLists.txt b/code/ryzom/CMakeLists.txt index dc89aa7c6..149861d31 100644 --- a/code/ryzom/CMakeLists.txt +++ b/code/ryzom/CMakeLists.txt @@ -6,6 +6,7 @@ IF(WITH_LUA51) ELSE(WITH_LUA51) FIND_PACKAGE(Lua50 REQUIRED) ENDIF(WITH_LUA51) +FIND_PACKAGE(Luabind REQUIRED) FIND_PACKAGE(CURL REQUIRED) FIND_PACKAGE(Libwww) FIND_PACKAGE(ZLIB) @@ -16,11 +17,6 @@ ENDIF(NOT WIN32 AND NOT APPLE) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/common/src ) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/common ) -# config.h configuration and use by projects -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -ADD_DEFINITIONS(-DHAVE_CONFIG_H) - ADD_SUBDIRECTORY(common) IF(WITH_RYZOM_CLIENT) diff --git a/code/ryzom/client/src/CMakeLists.txt b/code/ryzom/client/src/CMakeLists.txt index 76f89b494..4b2708caa 100644 --- a/code/ryzom/client/src/CMakeLists.txt +++ b/code/ryzom/client/src/CMakeLists.txt @@ -65,6 +65,7 @@ ENDIF(APPLE) INCLUDE_DIRECTORIES( ${LIBXML2_INCLUDE_DIR} ${LUA_INCLUDE_DIR} + ${LUABIND_INCLUDE_DIR} ${LIBWWW_INCLUDE_DIR} ${CURL_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}) @@ -81,12 +82,11 @@ TARGET_LINK_LIBRARIES(ryzom_client ${PLATFORM_LINKFLAGS} ryzom_gameshare nelpacs ${LUA_LIBRARIES} + ${LUABIND_LIBRARY} ${CURL_LIBRARIES} ${LIBWWW_LIBRARY} ${SEVENZIP_LIBRARY} - ${LIBXML2_LIBRARIES} - luabind # TODO: find luabind and expat cleanly using a find script - expat) + expat) # TODO: find expat cleanly using a find script IF(NOT APPLE AND NOT WIN32) TARGET_LINK_LIBRARIES(ryzom_client ${X11_LIBRARIES}) diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index d53e6f2c1..987261227 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -169,6 +169,24 @@ else \ cfgWarning("CFG: Default value used for '"#variableName"' !!!"); \ +//----------------------------------------------- +/// Macro to read a String Vector from the CFG. +/// variableName : Variable Name to Read and Set. +//----------------------------------------------- +#define _READ_STRINGVECTOR(variableName) \ + /* Read the Variable Value From Script */ \ + varPtr = ClientCfg.ConfigFile.getVarPtr(#variableName); \ + /* Value found, set the Variable */ \ + if(varPtr) \ + { \ + ClientCfg.variableName.clear (); \ + int iSz = varPtr->size(); \ + for (int i = 0; i < iSz; i++) \ + ClientCfg.variableName.push_back(varPtr->asString(i)); \ + } \ + /* Use the Default Value */ \ + else \ + cfgWarning("CFG: Default value used for '"#variableName"' !!!"); \ //----------------------------------------------- // Macro for the dev version @@ -183,6 +201,7 @@ #define READ_STRING_DEV(variableName) _READ_STRING(variableName) #define READ_CVECTOR_DEV(variableName) _READ_CVECTOR(variableName) #define READ_ENUM_ASINT_DEV(type, variableName) _READ_ENUM_ASINT(type, variableName) +#define READ_STRINGVECTOR_DEV(variableName) _READ_STRINGVECTOR(variableName) #else // !FINAL_VERSION #define READ_BOOL_DEV(variableName) #define READ_INT_DEV(variableName) @@ -192,6 +211,7 @@ #define READ_STRING_DEV(variableName) #define READ_CVECTOR_DEV(variableName) #define READ_ENUM_ASINT_DEV(type, variableName) +#define READ_STRINGVECTOR_DEV(variableName) #endif // !FINAL_VERSION //----------------------------------------------- @@ -206,6 +226,7 @@ #define READ_STRING_FV(variableName) _READ_STRING(variableName) #define READ_CVECTOR_FV(variableName) _READ_CVECTOR(variableName) #define READ_ENUM_ASINT_FV(type, variableName) _READ_ENUM_ASINT(type, variableName) +#define READ_STRINGVECTOR_FV(variableName) _READ_STRINGVECTOR(variableName) /////////// // USING // @@ -278,6 +299,22 @@ CClientConfig::CClientConfig() Local = false; // Default is Net Mode. FSHost = ""; // Default Host. +#if 1 // Yubo hack + // The order is important here, because in a layer, global texture are rendered through this order + TexturesInterface.push_back("texture_interfaces_v3"); + // DXTC contain all items and bricks bitmaps, they must come after standard texture + TexturesInterface.push_back("new_texture_interfaces_dxtc"); + // Added icons by Yubo's Team 2009 + TexturesInterface.push_back("texture_extra"); +#else + TexturesInterface.push_back("texture_interfaces_v3"); + TexturesInterfaceDXTC.push_back("texture_interfaces_dxtc"); +#endif + + TexturesOutGameInterface.push_back("texture_interfaces_v3_outgame_ui"); + + TexturesLoginInterface.push_back("texture_interfaces_v3_login"); + DisplayAccountButtons = true; CreateAccountURL = "https://secure.ryzom.com/signup/from_client.php"; ConditionsTermsURL = "https://secure.ryzom.com/signup/terms_of_use.php"; @@ -703,6 +740,18 @@ void CClientConfig::setValues() ClientCfg.SelectedSlot = 0; } + // interface textures login menus + READ_STRINGVECTOR_FV(TexturesLoginInterface); + READ_STRINGVECTOR_FV(TexturesLoginInterfaceDXTC); + + // interface textures outgame menus + READ_STRINGVECTOR_FV(TexturesOutGameInterface); + READ_STRINGVECTOR_FV(TexturesOutGameInterfaceDXTC); + + // interface textures ingame and r2 + READ_STRINGVECTOR_FV(TexturesInterface); + READ_STRINGVECTOR_FV(TexturesInterfaceDXTC); + // interface files login menus ClientCfg.XMLLoginInterfaceFiles.clear (); CConfigFile::CVar *pcvXMLLoginInterface = ClientCfg.ConfigFile.getVarPtr("XMLLoginInterfaceFiles"); @@ -1985,7 +2034,7 @@ void CClientConfig::init(const string &configFileName) { std::string defaultConfigFileName = "client_default.cfg"; bool found = false; - + if (CFile::isExists(defaultConfigFileName)) found = true; #ifdef RYZOM_ETC_PREFIX diff --git a/code/ryzom/client/src/client_cfg.h b/code/ryzom/client/src/client_cfg.h index d9d8f5b5e..dad8e8077 100644 --- a/code/ryzom/client/src/client_cfg.h +++ b/code/ryzom/client/src/client_cfg.h @@ -78,6 +78,18 @@ struct CClientConfig sint SelectCharacter; /// Selected slot in select char interface uint8 SelectedSlot; + + /// Textures for interface login + std::vector TexturesLoginInterface; + std::vector TexturesLoginInterfaceDXTC; + + /// Textures for interface outgame + std::vector TexturesOutGameInterface; + std::vector TexturesOutGameInterfaceDXTC; + + /// Textures for ingame interface and r2 interface + std::vector TexturesInterface; + std::vector TexturesInterfaceDXTC; /// vector of XML file names that describe the interfaces config for login std::vector XMLLoginInterfaceFiles; @@ -85,7 +97,6 @@ struct CClientConfig /// vector of XML file names that describe the interfaces config for outgame menus std::vector XMLOutGameInterfaceFiles; - /// vector of XML file names that describe the interfaces config std::vector XMLInterfaceFiles; diff --git a/code/ryzom/client/src/client_sheets/client_sheets.vcproj b/code/ryzom/client/src/client_sheets/client_sheets.vcproj index 46037a090..666bd3449 100644 --- a/code/ryzom/client/src/client_sheets/client_sheets.vcproj +++ b/code/ryzom/client/src/client_sheets/client_sheets.vcproj @@ -114,7 +114,7 @@ Optimization="4" InlineFunctionExpansion="1" AdditionalIncludeDirectories="../../../common/src/" - PreprocessorDefinitions="WIN32;_DEBUG;_LIB" + PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LIBXML_STATIC" StringPooling="true" MinimalRebuild="true" ExceptionHandling="2" diff --git a/code/ryzom/client/src/client_sheets/sbrick_sheet.cpp b/code/ryzom/client/src/client_sheets/sbrick_sheet.cpp index c9379e1ed..98640bbca 100644 --- a/code/ryzom/client/src/client_sheets/sbrick_sheet.cpp +++ b/code/ryzom/client/src/client_sheets/sbrick_sheet.cpp @@ -404,8 +404,7 @@ void CSBrickSheet::build (const NLGEORGES::UFormElm &root) // **** Magic only: try to get a ResistType against this brick for(i=0;i AllContinents; // Map with all continents. { - CEntitySheet *sheet = SheetMngr.get(CSheetId("ryzom.world")); + CEntitySheet *sheet = SheetMngr.get(CSheetId(worldSheet)); if (!sheet || sheet->type() != CEntitySheet::WORLD) { @@ -100,7 +100,7 @@ bool buildLMConts() vector vRegionFiles; { vector vTmp; - CPath::getPathContent("../../common/data_leveldesign/primitives", true, false, true, vTmp); + CPath::getPathContent(primitivesPath, true, false, true, vTmp); for (uint32 i = 0; i < vTmp.size(); ++i) { string filename = CFile::getFilename(vTmp[i]); @@ -115,7 +115,7 @@ bool buildLMConts() string sPackedFileName = CPath::lookup(LM_PACKED_FILE, false); if (sPackedFileName.empty()) { - sPackedFileName = LM_PACKED_FILE_SAVE; + sPackedFileName = NLMISC::CPath::standardizePath(dataPath) + LM_PACKED_FILE; bRebuild = true; } else @@ -253,7 +253,7 @@ bool buildLMConts() } else { - nlwarning("cannot find continent %s in ryzom.world", contName.c_str()); + nlwarning("cannot find continent %s in %s", contName.c_str(), worldSheet.c_str()); } } } diff --git a/code/ryzom/client/src/continent_manager_build.h b/code/ryzom/client/src/continent_manager_build.h index fdcd77c46..46361689f 100644 --- a/code/ryzom/client/src/continent_manager_build.h +++ b/code/ryzom/client/src/continent_manager_build.h @@ -83,10 +83,9 @@ public: } }; -extern bool buildLMConts(); +extern bool buildLMConts(const std::string &worldSheet, const std::string &primitivesPath, const std::string &dataPath); #define LM_PACKED_FILE "lmconts.packed" -#define LM_PACKED_FILE_SAVE "../../client/data/" LM_PACKED_FILE #define WORLD_MAP_FILE "global_world_map.primitive" #endif // CL_CONTINENT_MANAGER_BUILD_H diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index 7d9c8cbf1..75e12fba5 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -763,6 +763,7 @@ void prelogInit() // Remap tga files on dds files. CPath::remapExtension ("dds", "tga", true); CPath::remapExtension ("dds", "png", true); + CPath::remapExtension ("png", "tga", true); FPU_CHECKER_ONCE uint i; @@ -1304,6 +1305,7 @@ void postlogInit() nmsg = "Loading sheets..."; ProgressBar.newMessage ( ClientCfg.buildLoadingString(nmsg) ); + SheetMngr.setOutputDataPath("../../client/data"); SheetMngr.load (ProgressBar, ClientCfg.UpdatePackedSheet, ClientCfg.NeedComputeVS, ClientCfg.DumpVSIndex); initLast = initCurrent; diff --git a/code/ryzom/client/src/interface_v3/action_handler.cpp b/code/ryzom/client/src/interface_v3/action_handler.cpp index 59c4f5130..529c7f1c2 100644 --- a/code/ryzom/client/src/interface_v3/action_handler.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler.cpp @@ -71,7 +71,7 @@ std::string IActionHandler::getParam (const string &Params, const string &ParamN { string allparam = Params; skipBlankAtStart (allparam); - string param = strlwr (ParamName); + string param = toLower (ParamName); while (allparam.size() > 0) { std::string::size_type e = allparam.find('='); diff --git a/code/ryzom/client/src/interface_v3/interface_manager.cpp b/code/ryzom/client/src/interface_v3/interface_manager.cpp index efe64837e..d859d48d4 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.cpp +++ b/code/ryzom/client/src/interface_v3/interface_manager.cpp @@ -456,7 +456,19 @@ void CInterfaceManager::initLogin() return; } - loadTextures ("texture_interfaces_v3_login.tga", "texture_interfaces_v3_login.txt"); + nldebug("Textures Login Interface"); + + for (vector::iterator it = ClientCfg.TexturesLoginInterface.begin(), end = ClientCfg.TexturesLoginInterface.end(); it != end; ++it) + { + nldebug("Textures Login Interface: %s", (*it).c_str()); + loadTextures(*it + ".tga", *it + ".txt", false); + } + + for (vector::iterator it = ClientCfg.TexturesLoginInterfaceDXTC.begin(), end = ClientCfg.TexturesLoginInterfaceDXTC.end(); it != end; ++it) + { + nldebug("Textures Login Interface DXTC: %s", (*it).c_str()); + loadTextures(*it + ".tga", *it + ".txt", true); + } parseInterface (ClientCfg.XMLLoginInterfaceFiles, false); @@ -534,7 +546,19 @@ void CInterfaceManager::initOutGame() return; } - loadTextures ("texture_interfaces_v3_outgame_ui.tga", "texture_interfaces_v3_outgame_ui.txt"); + nldebug("Textures OutGame Interface"); + + for (vector::iterator it = ClientCfg.TexturesOutGameInterface.begin(), end = ClientCfg.TexturesOutGameInterface.end(); it != end; ++it) + { + nldebug("Textures OutGame Interface: %s", (*it).c_str()); + loadTextures(*it + ".tga", *it + ".txt", false); + } + + for (vector::iterator it = ClientCfg.TexturesOutGameInterfaceDXTC.begin(), end = ClientCfg.TexturesOutGameInterfaceDXTC.end(); it != end; ++it) + { + nldebug("Textures OutGame Interface DXTC: %s", (*it).c_str()); + loadTextures(*it + ".tga", *it + ".txt", true); + } parseInterface (ClientCfg.XMLOutGameInterfaceFiles, false); @@ -801,14 +825,19 @@ void CInterfaceManager::initInGame() // ------------------------------------------------------------------------------------------------ void CInterfaceManager::loadIngameInterfaceTextures() { - // The order is important here, because in a layer, global texture are rendered through this order - loadTextures ("texture_interfaces_v3.tga", "texture_interfaces_v3.txt"); + nldebug("Textures Ingame Interface"); - // DXTC contain all items and bricks bitmaps, they must come after standard texture - loadTextures ("new_texture_interfaces_dxtc.tga", "new_texture_interfaces_dxtc.txt"); + for (vector::iterator it = ClientCfg.TexturesInterface.begin(), end = ClientCfg.TexturesInterface.end(); it != end; ++it) + { + nldebug("Textures Ingame Interface: %s", (*it).c_str()); + loadTextures(*it + ".tga", *it + ".txt", false); + } - // Added icons by Yubo's Team 2009 - loadTextures ("texture_extra.tga", "texture_extra.txt"); + for (vector::iterator it = ClientCfg.TexturesInterfaceDXTC.begin(), end = ClientCfg.TexturesInterfaceDXTC.end(); it != end; ++it) + { + nldebug("Textures Ingame Interface DXTC: %s", (*it).c_str()); + loadTextures(*it + ".tga", *it + ".txt", true); + } } // ------------------------------------------------------------------------------------------------ diff --git a/code/ryzom/client/src/interface_v3/view_renderer.cpp b/code/ryzom/client/src/interface_v3/view_renderer.cpp index 9e131ec71..a2b38c3f5 100644 --- a/code/ryzom/client/src/interface_v3/view_renderer.cpp +++ b/code/ryzom/client/src/interface_v3/view_renderer.cpp @@ -744,6 +744,13 @@ void CViewRenderer::loadTextures (const std::string &textureFileName, const std: image.UVMax.V = uvMaxV; sTGAname = tgaName; sTGAname = strlwr(sTGAname); + string::size_type stripPng = sTGAname.find(".png"); + if (stripPng != string::npos) + { + sTGAname[stripPng + 1] = 't'; + sTGAname[stripPng + 2] = 'g'; + sTGAname[stripPng + 3] = 'a'; + } image.Name = sTGAname; image.GlobalTexturePtr = &(_GlobalTextures.back()); if (getTextureIdFromName(sTGAname) != -1) @@ -1025,7 +1032,14 @@ sint32 CViewRenderer::getTextureIdFromName (const string &sName) const static string nameLwr; nameLwr= sName; strlwr(nameLwr); - + string::size_type stripPng = nameLwr.find(".png"); + if (stripPng != string::npos) + { + nameLwr[stripPng + 1] = 't'; + nameLwr[stripPng + 2] = 'g'; + nameLwr[stripPng + 3] = 'a'; + } + // Search in map TTextureMap::const_iterator it= _TextureMap.find(nameLwr); if( it==_TextureMap.end() ) diff --git a/code/ryzom/client/src/sheet_manager.cpp b/code/ryzom/client/src/sheet_manager.cpp index fff3c5162..5ac3d2831 100644 --- a/code/ryzom/client/src/sheet_manager.cpp +++ b/code/ryzom/client/src/sheet_manager.cpp @@ -674,7 +674,7 @@ void CSheetManager::loadAllSheet(NLMISC::IProgressCallback &callBack, bool updat path.clear(); } if(path.empty()) - path = "../../client/data/" + TypeVersion[i].Type + ".packed_sheets"; + path = CPath::standardizePath(_OutputDataPath) + TypeVersion[i].Type + ".packed_sheets"; ::loadForm(extensions, path, entitySheetContainer, updatePackedSheet); TEntitySheetMap::iterator it = entitySheetContainer.begin(); diff --git a/code/ryzom/client/src/sheet_manager.h b/code/ryzom/client/src/sheet_manager.h index ee504f9fd..c0ba386a2 100644 --- a/code/ryzom/client/src/sheet_manager.h +++ b/code/ryzom/client/src/sheet_manager.h @@ -203,11 +203,20 @@ public: /// dump all visual slots indexes in a file void dumpVisualSlotsIndex(); + /// Set output data path + void setOutputDataPath(const std::string &dataPath) { _OutputDataPath = dataPath; } + + /// Return output data path + const std::string& getOutputDataPath() const { return _OutputDataPath; } + private: typedef std::vector TItemVector; typedef std::vector TSlots; TSlots _VisualSlots; + // directory where to create .packed_sheets + std::string _OutputDataPath; + protected: diff --git a/code/ryzom/common/src/game_share/dir_light_setup.cpp b/code/ryzom/common/src/game_share/dir_light_setup.cpp index 1f7998d5e..23f393227 100644 --- a/code/ryzom/common/src/game_share/dir_light_setup.cpp +++ b/code/ryzom/common/src/game_share/dir_light_setup.cpp @@ -25,10 +25,11 @@ //----------------------------------------------- -CDirLightSetup::CDirLightSetup() : Ambiant(0, 0, 0), - Diffuse(255, 255, 255), - Specular(0, 0, 0), - Direction(1.f, 0.f, 0.f) +CDirLightSetup::CDirLightSetup() : + Ambiant(0, 0, 0), + Diffuse(255, 255, 255), + Specular(0, 0, 0), + Direction(1.f, 0.f, 0.f) { } diff --git a/code/ryzom/common/src/game_share/generate_module_interface.xslt b/code/ryzom/common/src/game_share/generate_module_interface.xslt index 2a4f16e63..425e699a4 100644 --- a/code/ryzom/common/src/game_share/generate_module_interface.xslt +++ b/code/ryzom/common/src/game_share/generate_module_interface.xslt @@ -170,9 +170,9 @@ namespace // unused interceptors std::string fwdBuildModuleManifest() const { return std::string(); } - void fwdOnModuleUp(NLNET::IModuleProxy *moduleProxy) {}; - void fwdOnModuleDown(NLNET::IModuleProxy *moduleProxy) {}; - void fwdOnModuleSecurityChange(NLNET::IModuleProxy *moduleProxy) {}; + void fwdOnModuleUp(NLNET::IModuleProxy *moduleProxy) {} + void fwdOnModuleDown(NLNET::IModuleProxy *moduleProxy) {} + void fwdOnModuleSecurityChange(NLNET::IModuleProxy *moduleProxy) {} // process module message interceptor bool fwdOnProcessModuleMessage(NLNET::IModuleProxy *sender, const NLNET::CMessage &message); diff --git a/code/ryzom/tools/build_gamedata/workspace/common/construction/directories.py b/code/ryzom/tools/build_gamedata/workspace/common/construction/directories.py new file mode 100644 index 000000000..a55f23182 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/construction/directories.py @@ -0,0 +1,141 @@ +#!/usr/bin/python +# +# \file directories.py +# \brief Directories configuration +# \date 2010-08-27 17:13GMT +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + + +# *** COMMON NAMES AND PATHS *** +EcosystemName = "construction" +EcosystemPath = "common/" + EcosystemName +ContinentName = EcosystemName +ContinentPath = EcosystemPath +CommonName = ContinentName +CommonPath = ContinentPath + + +# *** SOURCE DIRECTORIES LEVELDESIGN/WORLD *** +ContinentLeveldesignWorldDirectory = "" # DISABLED + + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + +# Shape directories +ShapeSourceDirectories = [ ] +ShapeSourceDirectories += [ "stuff/Generique/Decors/Constructions" ] + +# Maps directories +MapSourceDirectories = [ ] +MapSourceDirectories += [ "stuff/Generique/Decors/_Textures/Batiments" ] + +MapUncompressedSourceDirectories = [ ] + +# Ligo directories +LigoBaseSourceDirectory = "landscape/ligo" + +# Ig directories +IgLandSourceDirectories = [ ] +IgOtherSourceDirectories = [ ] +IgOtherSourceDirectories += [ "stuff/Generique/Decors/Constructions" ] +IgPrimitiveSourceDirectories = [ ] + +# Tiles root directory +TileRootSourceDirectory = "landscape/_texture_tiles" + +# Displace directory +DisplaceSourceDirectory = "landscape/_texture_tiles/displace" + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Shape directories +ShapeTagExportDirectory = CommonPath + "/shape_tag" +ShapeNotOptimizedExportDirectory = CommonPath + "/shape_not_optimized" +ShapeWithCoarseMeshExportDirectory = CommonPath + "/shape_with_coarse_mesh" +ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_optimized" +ShapeAnimExportDirectory = CommonPath + "/shape_anim" + +# Ig directories +IgStaticLandExportDirectory = CommonPath + "/ig_static_land" # Landscape IG eported from 3dsmax not elevated by the heightmap +IgStaticOtherExportDirectory = CommonPath + "/ig_static_other" # Village or construction IGs exported from 3dsmax +IgStaticTagExportDirectory = CommonPath + "/ig_static_tag" # Tag for exported 3dsmax files + +# Zone directories +ZoneWeldBuildDirectory = CommonPath + "/zone_weld" +ZoneDependBuildDirectory = CommonPath + "/zone_depend" +ZoneLightWaterShapesLightedExportDirectory = CommonPath + "/zone_lwsl_temp" #fixme +ZoneLightBuildDirectory = CommonPath + "/zone_lighted" #fixme +ZoneLightDependBuildDirectory = CommonPath + "/zone_lighted_depend" #fixme +ZoneLightIgLandBuildDirectory = CommonPath + "/zone_lighted_ig_land" #fixme + + +# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** + +# Map directories +MapBuildDirectory = CommonPath + "/map" +MapPanoplyBuildDirectory = CommonPath + "/map_panoply" + +# Shape directories +ShapeClodtexBuildDirectory = CommonPath + "/shape_clodtex_build" +ShapeWithCoarseMeshBuildDirectory = CommonPath + "/shape_with_coarse_mesh_builded" +ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" +ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" + +# Ig directories +IgElevLandPrimBuildDirectory = CommonPath + "/ig_elev_land_prim" # landscape IG generated by the prim exporter (already elevated by the land exporter) +IgElevLandLigoBuildDirectory = CommonPath + "/ig_elev_land_ligo" # Landscape IG found in ligo bricks from 3dsmax elevated by the heightmap +IgElevLandStaticBuildDirectory = CommonPath + "/ig_elev_land_static" # Landscape IG eported from 3dsmax elevated by the heightmap +IgTempLandMergeBuildDirectory = CommonPath + "/ig_temp_land_merge" +IgTempLandCompareBuildDirectory = CommonPath + "/ig_temp_land_compare" # Tmp final IG directory for landscape IGs before comparison +IgLandBuildDirectory = CommonPath + "/ig_land" # Final IG directory for landscape IGs +IgOtherBuildDirectory = CommonPath + "/ig_other" # Final IG directory for village or construction IGs +IgOtherLightedBuildDirectory = CommonPath + "/ig_other_lighted" + +# Farbank directories +FarbankBuildDirectory = CommonPath + "/farbank" + +# Ligo directories +LigoZoneBuildDirectory = CommonPath + "/ligo_zones" +LigoIgLandBuildDirectory = CommonPath + "/ligo_ig_land" # Landscape IG found in ligo bricks not elevated by the heightmap +LigoIgOtherBuildDirectory = CommonPath + "/ligo_ig_other" # Village or construction IGs exported from ligo landscape + + +# *** INSTALL DIRECTORIES IN THE CLIENT DATA *** + +# Map directory +MapClientDirectory = CommonName +BitmapClientDirectory = MapClientDirectory + +# Shape directory +ShapeClientDirectory = CommonName + +# Lightmap directory +LightmapClientDirectory = CommonName + +# Animation directory +AnimClientDirectory = CommonName + +# Ig directory +IgClientDirectory = CommonName diff --git a/code/ryzom/tools/build_gamedata/workspace/common/construction/process.py b/code/ryzom/tools/build_gamedata/workspace/common/construction/process.py new file mode 100644 index 000000000..6c4508985 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/construction/process.py @@ -0,0 +1,110 @@ +#!/usr/bin/python +# +# \file config.py +# \brief Process configuration +# \date 2010-08-27 17:02GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** PROCESS CONFIGURATION *** + + +# *** PROCESS CONFIG *** +ProcessToComplete = [ ] +ProcessToComplete += [ "properties" ] +ProcessToComplete += [ "shape" ] +ProcessToComplete += [ "map" ] +ProcessToComplete += [ "ig" ] +ProcessToComplete += [ "ig_light" ] + + +# *** COMMON NAMES AND PATHS *** +EcosystemName = "construction" +EcosystemPath = "common/" + EcosystemName +ContinentName = EcosystemName +ContinentPath = EcosystemPath +CommonName = ContinentName +CommonPath = ContinentPath + + +# *** SHAPE EXPORT OPTIONS *** + +# Compute lightmaps ? +ShapeExportOptExportLighting = "true" + +# Cast shadow in lightmap ? +ShapeExportOptShadow = "true" + +# Lighting limits. 0 : normal, 1 : soft shadows +ShapeExportOptLightingLimit = 0 + +# Lightmap lumel size +ShapeExportOptLumelSize = "0.25" + +# Oversampling value. Can be 1, 2, 4 or 8 +ShapeExportOptOversampling = 1 + +# Does the lightmap must be generated in 8 bits format ? +ShapeExportOpt8BitsLightmap = "false" + +# Does the lightmaps export must generate logs ? +ShapeExportOptLightmapLog = "true" + +# Coarse mesh texture mul size +TextureMulSizeValue = "1.5" + +DoBuildShadowSkin = 0 + +ClodConfigFile = "" + +# *** COARSE MESH TEXTURE NAME *** +CoarseMeshTextureNames = [ ] + +# *** POSTFIX USED BY THE MULTIPLE TILES SYSTEM *** +MultipleTilesPostfix = [ ] +MultipleTilesPostfix += [ "_sp" ] +MultipleTilesPostfix += [ "_su" ] +MultipleTilesPostfix += [ "_au" ] +MultipleTilesPostfix += [ "_wi" ] + +# Name of the tilebank to use +BankTileBankName = "" + +# *** LANDSCAPE NAME *** +LandscapeName = ContinentName + +# *** LIGO OPTIONS *** +LigoExportLand = "" +LigoExportOnePass = 0 +LigoExportColormap = "colormap_invalid.png" +LigoExportHeightmap1 = "big_invalid.png" +LigoExportZFactor1 = "1.0" +LigoExportHeightmap2 = "noise_invalid.png" +LigoExportZFactor2 = "0.5" +LigoTileBankFile = "landscape/_texture_tiles/jungle/jungle.bank" + +# *** MAPS OPTIONS *** + +ReduceBitmapFactor = 0 + +# *** ANIMATIONS OPTIONS *** + +DoOptimizeAnimations = 0 diff --git a/code/ryzom/tools/build_gamedata/workspace/common/construction/properties_base.cfg b/code/ryzom/tools/build_gamedata/workspace/common/construction/properties_base.cfg new file mode 100644 index 000000000..2fa378594 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/construction/properties_base.cfg @@ -0,0 +1,51 @@ + +// Bank file name +bank_name = "%ExportBuildDirectory%/ecosystems/jungle/smallbank/jungle.smallbank"; +bankfar_name = "%ExportBuildDirectory%/ecosystems/jungle/farbank/jungle.farbank"; + +// Search pathes +search_pathes = +{ + "%ExportBuildDirectory%/common/sfx/ps", // Sfx directory + "%ExportBuildDirectory%/common/sfx/shape", // Sfx directory + "%ExportBuildDirectory%/common/sfx/shape_with_coarse_mesh", // Sfx directory + "%ExportBuildDirectory%/common/sfx/map", // Sfx directory + "%ExportBuildDirectory%/common/construction/shape", // Construction directory + "%ExportBuildDirectory%/common/construction/shape_with_coarse_mesh", // Construction directory + "%ExportBuildDirectory%/common/construction/map", // Construction directory +}; + +// Additional ig file name +additionnal_ig = +{ + +}; + +// Sun direction. +//sun_direction = { -0.095, +1.0, -0.50 }; +sun_direction = { -0.776685, +0.216619, -0.59147 }; + +// Center of the landscape pointed by the sun +sun_center = {9954, -11017, 0}; + +// Distance of the sun +sun_distance = 50000; + +// FOV of the sun in radian +sun_fov = 0.52359877; // Pi / 6 + +// Sun radius, (for softshadow sampling) +sun_radius = 5000; + +// GlobalRetriever bank file.gr. Empty string to disable SurfaceLighting +grbank= "%ExportBuildDirectory%/continents/newbieland/rbank_output/newbieland.gr"; + +// LocalRetriever bank file .rbank. Empty string to disable SurfaceLighting +rbank= "%ExportBuildDirectory%/continents/newbieland/rbank_output/newbieland.rbank"; + +// The lighter search in rbank any retriever with identifier ---igname*** as substring +// where --- is col_identifier_prefix and *** is col_identifier_suffix +// eg: if igname= "street", col_identifier_prefix= "col_", col_identifier_suffix= "_", +// then "col_street_1" and "col_street_2" are valid and are used to build LightSurface infos in the Ig. +col_identifier_prefix= ""; +col_identifier_suffix= ""; diff --git a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_draft.cfg b/code/ryzom/tools/build_gamedata/workspace/common/construction/properties_draft.cfg similarity index 100% rename from code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_draft.cfg rename to code/ryzom/tools/build_gamedata/workspace/common/construction/properties_draft.cfg diff --git a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_final.cfg b/code/ryzom/tools/build_gamedata/workspace/common/construction/properties_final.cfg similarity index 94% rename from code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_final.cfg rename to code/ryzom/tools/build_gamedata/workspace/common/construction/properties_final.cfg index ccb91159d..522c15d44 100644 --- a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_final.cfg +++ b/code/ryzom/tools/build_gamedata/workspace/common/construction/properties_final.cfg @@ -6,7 +6,7 @@ load_ig = 1; compute_dependencies_with_igs = 1; // Enable shadows. 0 disable, 1 enable -shadow = 0; // FIXME: should be 1, but missing .depend files +shadow = 1; // Landscape ZBuffers size for all the landscape. There is one zbuffer like this one per softshadow sample. zbuffer_landscape_size = 32768; diff --git a/code/ryzom/tools/build_gamedata/workspace/common/fauna/anim_builder.cfg b/code/ryzom/tools/build_gamedata/workspace/common/fauna/anim_builder.cfg new file mode 100644 index 000000000..08128b23e --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/fauna/anim_builder.cfg @@ -0,0 +1,15 @@ + +// *************************** +// Animation Optimizer +// *************************** + +// Tracks which contain one of those name (eg "Bip01 Finger11.rotquat") will be mark as "Low Precision". +// Usefull for memory optimisation. Avoid setting legs or root bones. Warning: case sensitive. +anim_low_precision_tracks= +{ +"Finger", +"Ponytail", +}; + +// The Sample Rate. +anim_sample_rate= 30; diff --git a/code/ryzom/tools/build_gamedata/workspace/common/fauna/directories.py b/code/ryzom/tools/build_gamedata/workspace/common/fauna/directories.py new file mode 100644 index 000000000..ac8baa134 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/fauna/directories.py @@ -0,0 +1,277 @@ +#!/usr/bin/python +# +# \file directories.py +# \brief Directories configuration +# \date 2010-08-27 17:13GMT +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + + +# *** COMMON NAMES AND PATHS *** +EcosystemName = "fauna" +EcosystemPath = "common/" + EcosystemName +ContinentName = EcosystemName +ContinentPath = EcosystemPath +CommonName = ContinentName +CommonPath = ContinentPath + + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + +# Skeleton directories +SkelSourceDirectories = [ ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/aquatique/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/aquatique_monture/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/cheval/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/chien/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/coureur/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/crustace/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/familier/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/grand_ryzomien/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kamiforet/animations/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kamiguard/animations/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/kitin/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/kitin_volant/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/oiseau/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/pachyderme/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/ryzomien/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/carnitree/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/electroalg/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/endrobouchea/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/phytopsy/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/sapenslaver/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/swarmplant/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_guide_2/animations/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_guide_3/animations/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_guide_4/animations/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_preacher_2/animations/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_preacher_3/animations/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_preacher_4/animations/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/homins_degeneres/cute/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/homins_degeneres/frahar/animation/skeletons" ] +SkelSourceDirectories += [ "stuff/tryker/agents/monsters/homins_degeneres/gibbai/animation/skeletons" ] + +# Skeleton template weight directories +SwtSourceDirectories = [ ] + +# Shape directories +ShapeSourceDirectories = [ ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/aquatique/clapclap" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/aquatique/ryzetacee" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/aquatique_monture/sagass_selle" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/cheval/mektoub" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/cheval/mektoubselle" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/cheval/mektoubpack" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/chien/chorani" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/chien/jungler" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/chien/regus" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/chien/varinx" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/coureur/capryni" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/coureur/filin" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/crustace/cococlaw" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/crustace/estrasson" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/crustace/hachtaha" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/crustace/diranak" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/familier/dag" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/grand_ryzomien/ryzerb" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/grand_ryzomien/ryzoholok" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kamiforet" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kamiguard" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_guide_2" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_guide_3" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_guide_4" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_preacher_2" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_preacher_3" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_preacher_4" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kitin/kitihank" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kitin/kitinagan" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kitin/kitinarak" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kitin/kitinega" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kitin/kitinokto" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kitin/kitimandib" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kitin/pucetron" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kitin_volant/kitifly" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kitin_volant/kitikil" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/oiseau/kazoar" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/oiseau/lightbird" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/oiseau/yber" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/pachyderme/arma" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/pachyderme/bul" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/pachyderme/vampignon" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/ryzomien/kakty" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/ryzomien/ryzoholo" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/ryzomien/zerx" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/carnitree" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/electroalg" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/endrobouchea" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/phytopsy" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/sapenslaver" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/swarmplant" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/homins_degeneres/cute" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/homins_degeneres/frahar" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/homins_degeneres/gibbai" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/aquatique" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/chiens" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/coureur" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/crustaces" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/grand_ryzomien" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/kitin" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/kitin_volant" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/oiseau" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/pachyderme/vampignon" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/ryzomien/kakty" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/ryzomien/ryzoholo" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/cheval/c03" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/cheval/h05" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/cheval/h12" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/chien/c02" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/chien/c07" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/coureur/h01" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/coureur/h04" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/crustace/c05" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/grand_ryzomien/c06" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/grand_ryzomien/h07" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/grand_ryzomien/h11" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/oiseau/c01" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/pachyderme/h08" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/pachyderme/h10" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/ryzomien/c04" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/ryzomien/h02" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/ryzomien/h06" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/ryzomien/h09" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/familier/h03" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/ryzomien/c04" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/familier/h03" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/homins_degeneres/cute" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/homins_degeneres/frahar" ] +ShapeSourceDirectories += [ "stuff/goo/agents/monsters/homins_degeneres/gibbai" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/monsters/kitin/kitin_queen" ] + +# Maps directories +MapSourceDirectories = [ ] +MapSourceDirectories += [ "stuff/fyros/agents/_textures/monster" ] +MapSourceDirectories += [ "stuff/tryker/agents/_textures/monster" ] +MapSourceDirectories += [ "stuff/jungle/agents/_textures/monster" ] +MapSourceDirectories += [ "stuff/primes_racines/agents/_textures/monster" ] +MapSourceDirectories += [ "stuff/goo/agents/_textures/monster" ] + +MapUncompressedSourceDirectories = [ ] + +# Animation directories +AnimSourceDirectories = [ ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/aquatique/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/aquatique_monture/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/cheval/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/chien/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/coureur/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/crustace/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/familier/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/grand_ryzomien/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kamiforet/animations/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kamiguard/animations/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/kitin/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/kitin_volant/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/oiseau/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/pachyderme/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/ryzomien/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/carnitree/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/electroalg/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/endrobouchea/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/phytopsy/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/sapenslaver/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/plante_carnivore/swarmplant/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_guide_2/animations/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_guide_3/animations/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_guide_4/animations/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_preacher_2/animations/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_preacher_3/animations/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/kami/kami_preacher_4/animations/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/homins_degeneres/cute/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/homins_degeneres/frahar/animation/anims" ] +AnimSourceDirectories += [ "stuff/tryker/agents/monsters/homins_degeneres/gibbai/animation/anims" ] + +# cLoD shape directories +ClodSourceDirectories = [ ] +ClodSourceDirectories += [ "stuff/lod_actors/lod_fauna" ] + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Skeleton directories +SkelExportDirectory = CommonPath + "/skel" + +# Skeleton template weight directories +SwtExportDirectory = CommonPath + "/swt" + +# Shape directories +ShapeTagExportDirectory = CommonPath + "/shape_tag" +ShapeNotOptimizedExportDirectory = CommonPath + "/shape_not_optimized" +ShapeWithCoarseMeshExportDirectory = CommonPath + "/shape_with_coarse_mesh" +ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_optimized" +ShapeAnimExportDirectory = CommonPath + "/shape_anim" + +# Animation directories +AnimExportDirectory = CommonPath + "/anim_export" + +# cLoD directories +ClodExportDirectory = CommonPath + "/clod_export" +ClodTagExportDirectory = CommonPath + "/clod_tag_export" + + +# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** + +# Map directories +MapBuildDirectory = CommonPath + "/map" +MapPanoplyBuildDirectory = CommonPath + "/map_panoply" + +# Shape directories +ShapeClodtexBuildDirectory = CommonPath + "/shape_clodtex_build" +ShapeWithCoarseMeshBuildDirectory = CommonPath + "/shape_with_coarse_mesh_builded" +ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" +ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" + +# Animation directories +AnimBuildDirectory = CommonPath + "/anim" + +# cLoD directories +ClodBankBuildDirectory = CommonPath + "/clod_bank" + + +# *** INSTALL DIRECTORIES IN THE CLIENT DATA *** + +# Map directory +MapClientDirectory = CommonName + "_maps" +BitmapClientDirectory = MapClientDirectory + +# Shape directory +ShapeClientDirectory = CommonName + "_shapes" +LightmapClientDirectory = ShapeClientDirectory + +# Animation directory +AnimClientDirectory = CommonName + "_animations" + +# Skeleton directory +SkelClientDirectory = CommonName + "_skeletons" + +# Skeleton directory +SwtClientDirectory = CommonName + "_swt" diff --git a/code/ryzom/tools/build_gamedata/workspace/common/fauna/process.py b/code/ryzom/tools/build_gamedata/workspace/common/fauna/process.py new file mode 100644 index 000000000..76e2cfc32 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/fauna/process.py @@ -0,0 +1,109 @@ +#!/usr/bin/python +# +# \file config.py +# \brief Process configuration +# \date 2010-08-27 17:02GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** PROCESS CONFIGURATION *** + +# *** PROCESS CONFIG *** +ProcessToComplete = [ ] +ProcessToComplete += [ "skel" ] +ProcessToComplete += [ "swt" ] +ProcessToComplete += [ "shape" ] +ProcessToComplete += [ "map" ] +ProcessToComplete += [ "anim" ] +ProcessToComplete += [ "clodbank" ] + + +# *** COMMON NAMES AND PATHS *** +EcosystemName = "fauna" +EcosystemPath = "common/" + EcosystemName +ContinentName = EcosystemName +ContinentPath = EcosystemPath +CommonName = ContinentName +CommonPath = ContinentPath + + +# *** SHAPE EXPORT OPTIONS *** + +# Compute lightmaps ? +ShapeExportOptExportLighting = "true" + +# Cast shadow in lightmap ? +ShapeExportOptShadow = "true" + +# Lighting limits. 0 : normal, 1 : soft shadows +ShapeExportOptLightingLimit = 0 + +# Lightmap lumel size +ShapeExportOptLumelSize = "0.25" + +# Oversampling value. Can be 1, 2, 4 or 8 +ShapeExportOptOversampling = 1 + +# Does the lightmap must be generated in 8 bits format ? +ShapeExportOpt8BitsLightmap = "false" + +# Does the lightmaps export must generate logs ? +ShapeExportOptLightmapLog = "true" + +# Coarse mesh texture mul size +TextureMulSizeValue = "1.5" + +DoBuildShadowSkin = 0 + + +# *** CLODBANK OPTIONS *** + +ClodConfigFile = "stuff/lod_actors/lod_" + CommonName + "/clod_" + CommonName + "_script.cfg" +ClodBankFileName = CommonName + ".clodbank" + + +# *** COARSE MESH TEXTURE NAME *** +CoarseMeshTextureNames = [ ] + + +# *** POSTFIX USED BY THE MULTIPLE TILES SYSTEM *** +MultipleTilesPostfix = [ ] +MultipleTilesPostfix += [ "_sp" ] +MultipleTilesPostfix += [ "_su" ] +MultipleTilesPostfix += [ "_au" ] +MultipleTilesPostfix += [ "_wi" ] + + +# *** MAPS OPTIONS *** + +ReduceBitmapFactor = 0 + + +# *** SHADOW SKIN OPTIONS *** +# Fauna are made of a single skin. Allow only 1000 faces for each monster (whatever the original nb faces) +BuildShadowSkin = 1 +BuildShadowSkinRatio = 100 +BuildShadowSkinMaxface = 1000 + + +# *** ANIMATIONS OPTIONS *** + +DoOptimizeAnimations = 1 diff --git a/code/ryzom/tools/build_gamedata/workspace/common/fonts/directories.py b/code/ryzom/tools/build_gamedata/workspace/common/fonts/directories.py new file mode 100644 index 000000000..7840625f8 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/fonts/directories.py @@ -0,0 +1,59 @@ +#!/usr/bin/python +# +# \file directories.py +# \brief Directories configuration +# \date 2010-08-27 17:13GMT +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + + +# *** COMMON NAMES AND PATHS *** +EcosystemName = "fonts" +EcosystemPath = "common/" + EcosystemName +ContinentName = EcosystemName +ContinentPath = EcosystemPath +CommonName = ContinentName +CommonPath = ContinentPath + + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + +# Font directories +FontSourceDirectories = [ ] +FontSourceDirectories += [ "fonts" ] + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Font directories +FontExportDirectory = CommonPath + "/font" + + +# *** INSTALL DIRECTORIES IN THE CLIENT DATA *** + +# Font directory +FontClientDirectory = CommonName + + +# end of file + diff --git a/code/ryzom/tools/build_gamedata/workspace/common/fonts/process.py b/code/ryzom/tools/build_gamedata/workspace/common/fonts/process.py new file mode 100644 index 000000000..e1e6d4824 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/fonts/process.py @@ -0,0 +1,43 @@ +#!/usr/bin/python +# +# \file config.py +# \brief Process configuration +# \date 2010-08-27 17:02GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** PROCESS CONFIGURATION *** + +# *** PROCESS CONFIG *** +ProcessToComplete = [ ] +ProcessToComplete += [ "font" ] + + +# *** COMMON NAMES AND PATHS *** +EcosystemName = "fonts" +EcosystemPath = "common/" + EcosystemName +ContinentName = EcosystemName +ContinentPath = EcosystemPath +CommonName = ContinentName +CommonPath = ContinentPath + + +# end of file diff --git a/code/ryzom/tools/build_gamedata/workspace/common/interface/directories.py b/code/ryzom/tools/build_gamedata/workspace/common/interface/directories.py new file mode 100644 index 000000000..e733bea15 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/interface/directories.py @@ -0,0 +1,92 @@ +#!/usr/bin/python +# +# \file directories.py +# \brief Directories configuration +# \date 2010-08-27 17:13GMT +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + + +# *** COMMON NAMES AND PATHS *** +EcosystemName = "interface" +EcosystemPath = "common/" + EcosystemName +ContinentName = EcosystemName +ContinentPath = EcosystemPath +CommonName = ContinentName +CommonPath = ContinentPath + + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + +#Interface directories +InterfaceSourceDirectories = [ ] +InterfaceSourceDirectories += [ [ "interfaces/v3" ] + [ "interfaces/ring_interface" ] ] +InterfaceSourceDirectories += [ [ "interfaces/v3_outgame/ui" ] ] +InterfaceSourceDirectories += [ [ "interfaces/v3_login" ] ] + +InterfaceDxtcSourceDirectories = [ ] +InterfaceDxtcSourceDirectories += [ "interfaces/v3_bricks" ] +InterfaceDxtcSourceDirectories += [ "interfaces/v3_items" ] +InterfaceDxtcSourceDirectories += [ "interfaces/v3_dxtc_misc" ] + +InterfaceFullscreenSourceDirectories = [ ] +InterfaceFullscreenSourceDirectories += [ "interfaces/v3_fullscreen" ] +InterfaceFullscreenSourceDirectories += [ "interfaces/v3_outgame/fullscreen" ] +InterfaceFullscreenSourceDirectories += [ "interfaces/v3_doc/graph/abilities_items" ] +InterfaceFullscreenSourceDirectories += [ "interfaces/v3_doc/graph/buy_sell" ] +InterfaceFullscreenSourceDirectories += [ "interfaces/v3_doc/graph/camera_character" ] +InterfaceFullscreenSourceDirectories += [ "interfaces/v3_doc/graph/create_perso" ] +InterfaceFullscreenSourceDirectories += [ "interfaces/v3_doc/graph/fight" ] +InterfaceFullscreenSourceDirectories += [ "interfaces/v3_doc/graph/MatisTown" ] +InterfaceFullscreenSourceDirectories += [ "interfaces/v3_doc/graph/spell" ] +InterfaceFullscreenSourceDirectories += [ "interfaces/v3_doc/graph/talk_bot" ] +InterfaceFullscreenSourceDirectories += [ "interfaces/v3_doc/graph/abilities_items" ] +InterfaceFullscreenSourceDirectories += [ "interfaces/v3_quick_help/graph" ] + +Interface3DSourceDirectories = [ ] +Interface3DSourceDirectories += [ "interfaces/v3_outgame/3d" ] +Interface3DSourceDirectories += [ "interfaces/v3_doc/htm" ] +Interface3DSourceDirectories += [ "interfaces/v3_doc" ] +Interface3DSourceDirectories += [ "interfaces/v3_quick_help" ] + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Interface directories +InterfaceExportDirectory = CommonPath + "/interface_export" +InterfaceDxtcExportDirectory = CommonPath + "/interface_dxtc_export" +InterfaceFullscreenExportDirectory = CommonPath + "/interface_fullscreen_export" +Interface3DExportDirectory = CommonPath + "/interface_3d_export" + + +# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** + +# Interface directories +InterfaceBuildDirectory = CommonPath + "/interface_build" +InterfaceDxtcBuildDirectory = CommonPath + "/interface_dxtc_build" + + +# *** INSTALL DIRECTORIES IN THE CLIENT DATA *** + +# Lightmap directory +InterfaceClientDirectory = "interfaces" diff --git a/code/ryzom/tools/build_gamedata/workspace/common/interface/process.py b/code/ryzom/tools/build_gamedata/workspace/common/interface/process.py new file mode 100644 index 000000000..29585bdcd --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/interface/process.py @@ -0,0 +1,45 @@ +#!/usr/bin/python +# +# \file config.py +# \brief Process configuration +# \date 2010-08-27 17:02GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** PROCESS CONFIGURATION *** + +# *** PROCESS CONFIG *** +ProcessToComplete = [ ] +ProcessToComplete += [ "interface" ] + + +# *** COMMON NAMES AND PATHS *** +EcosystemName = "interface" +EcosystemPath = "common/" + EcosystemName +ContinentName = EcosystemName +ContinentPath = EcosystemPath +CommonName = ContinentName +CommonPath = ContinentPath + + +# *** MAPS OPTIONS *** + +ReduceBitmapFactor = 0 diff --git a/code/ryzom/tools/build_gamedata/workspace/common/objects/directories.py b/code/ryzom/tools/build_gamedata/workspace/common/objects/directories.py new file mode 100644 index 000000000..fcd134e00 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/objects/directories.py @@ -0,0 +1,94 @@ +#!/usr/bin/python +# +# \file directories.py +# \brief Directories configuration +# \date 2010-08-27 17:13GMT +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + + +# *** COMMON PATH *** + +CommonPath = "common/objects" + + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + +# Shape directories +ShapeSourceDirectories = [ ] +ShapeSourceDirectories += [ "stuff/fyros/agents/accessories" ] +ShapeSourceDirectories += [ "stuff/tryker/agents/accessories" ] +ShapeSourceDirectories += [ "stuff/matis/agents/accessories" ] +ShapeSourceDirectories += [ "stuff/zorai/agents/accessories" ] +ShapeSourceDirectories += [ "stuff/generique/agents/accessories" ] +ShapeSourceDirectories += [ "stuff/caravan/agents/accessories" ] +ShapeSourceDirectories += [ "stuff/animated_light" ] + +# Maps directories +MapSourceDirectories = [ ] +MapSourceDirectories += [ "stuff/fyros/agents/_textures/accessories" ] +MapSourceDirectories += [ "stuff/tryker/agents/_textures/accessories" ] +MapSourceDirectories += [ "stuff/matis/agents/_textures/accessories" ] +MapSourceDirectories += [ "stuff/zorai/agents/_textures/accessories" ] +MapSourceDirectories += [ "stuff/generique/agents/_textures/accessories" ] +MapSourceDirectories += [ "stuff/caravan/agents/_textures/accessories" ] + +MapUncompressedSourceDirectories = [ ] + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Shape directories +ShapeTagExportDirectory = CommonPath + "/shape_tag" +ShapeNotOptimizedExportDirectory = CommonPath + "/shape_not_optimized" +ShapeWithCoarseMeshExportDirectory = CommonPath + "/shape_with_coarse_mesh" +ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_optimized" +ShapeAnimExportDirectory = CommonPath + "/shape_anim" + + +# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** + +# Map directories +MapBuildDirectory = CommonPath + "/map" +MapPanoplyBuildDirectory = CommonPath + "/map_panoply" + +# Shape directories +ShapeClodtexBuildDirectory = CommonPath + "/shape_clodtex_build" +ShapeWithCoarseMeshBuildDirectory = CommonPath + "/shape_with_coarse_mesh_builded" +ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" +ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" + + +# *** INSTALL DIRECTORIES IN THE CLIENT DATA *** + +# Map directory +MapClientDirectory = "objects" + +# Map directory +BitmapClientDirectory = MapClientDirectory + +# Shape directory +ShapeClientDirectory = "objects" + +# Lightmap directory +LightmapClientDirectory = "objects" diff --git a/code/ryzom/tools/build_gamedata/workspace/common/objects/process.py b/code/ryzom/tools/build_gamedata/workspace/common/objects/process.py new file mode 100644 index 000000000..cdd53ce02 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/objects/process.py @@ -0,0 +1,77 @@ +#!/usr/bin/python +# +# \file config.py +# \brief Process configuration +# \date 2010-08-27 17:02GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** PROCESS CONFIGURATION *** + +# *** PROCESS CONFIG *** +ProcessToComplete = [ ] +ProcessToComplete += [ "shape" ] # not fully implemented, but works for this process +ProcessToComplete += [ "map" ] # not fully implemented, but works for this process + + +# *** SHAPE EXPORT OPTIONS *** + +# Compute lightmaps ? +ShapeExportOptExportLighting = "true" + +# Cast shadow in lightmap ? +ShapeExportOptShadow = "true" + +# Lighting limits. 0 : normal, 1 : soft shadows +ShapeExportOptLightingLimit = 0 + +# Lightmap lumel size +ShapeExportOptLumelSize = "0.25" + +# Oversampling value. Can be 1, 2, 4 or 8 +ShapeExportOptOversampling = 1 + +# Does the lightmap must be generated in 8 bits format ? +ShapeExportOpt8BitsLightmap = "false" + +# Does the lightmaps export must generate logs ? +ShapeExportOptLightmapLog = "true" + +# Coarse mesh texture mul size +TextureMulSizeValue = "1.5" + +DoBuildShadowSkin = 0 + +ClodConfigFile = "" + +# *** COARSE MESH TEXTURE NAME *** +CoarseMeshTextureNames = [ ] + +# *** POSTFIX USED BY THE MULTIPLE TILES SYSTEM *** +MultipleTilesPostfix = [ ] +MultipleTilesPostfix += [ "_sp" ] +MultipleTilesPostfix += [ "_su" ] +MultipleTilesPostfix += [ "_au" ] +MultipleTilesPostfix += [ "_wi" ] + +# *** MAPS OPTIONS *** + +ReduceBitmapFactor = 0 diff --git a/code/ryzom/tools/build_gamedata/workspace/common/outgame/directories.py b/code/ryzom/tools/build_gamedata/workspace/common/outgame/directories.py new file mode 100644 index 000000000..fe7618b72 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/outgame/directories.py @@ -0,0 +1,141 @@ +#!/usr/bin/python +# +# \file directories.py +# \brief Directories configuration +# \date 2010-08-27 17:13GMT +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + + +# *** COMMON NAMES AND PATHS *** +EcosystemName = "outgame" +EcosystemPath = "common/" + EcosystemName +ContinentName = EcosystemName +ContinentPath = EcosystemPath +CommonName = ContinentName +CommonPath = ContinentPath + + +# *** SOURCE DIRECTORIES LEVELDESIGN/WORLD *** +ContinentLeveldesignWorldDirectory = "" # DISABLED + + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + +# Shape directories +ShapeSourceDirectories = [ ] +ShapeSourceDirectories += [ "stuff/outgame/appart_crea" ] + +# Maps directories +MapSourceDirectories = [ ] +MapSourceDirectories += [ "stuff/outgame/_textures" ] + +MapUncompressedSourceDirectories = [ ] + +# Ligo directories +LigoBaseSourceDirectory = "landscape/ligo" + +# Ig directories +IgLandSourceDirectories = [ ] +IgOtherSourceDirectories = [ ] +IgOtherSourceDirectories += [ "stuff/outgame/appart_crea" ] +IgPrimitiveSourceDirectories = [ ] + +# Tiles root directory +TileRootSourceDirectory = "landscape/_texture_tiles" + +# Displace directory +DisplaceSourceDirectory = "landscape/_texture_tiles/displace" + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Shape directories +ShapeTagExportDirectory = CommonPath + "/shape_tag" +ShapeNotOptimizedExportDirectory = CommonPath + "/shape_not_optimized" +ShapeWithCoarseMeshExportDirectory = CommonPath + "/shape_with_coarse_mesh" +ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_optimized" +ShapeAnimExportDirectory = CommonPath + "/shape_anim" + +# Ig directories +IgStaticLandExportDirectory = CommonPath + "/ig_static_land" # Landscape IG eported from 3dsmax not elevated by the heightmap +IgStaticOtherExportDirectory = CommonPath + "/ig_static_other" # Village or construction IGs exported from 3dsmax +IgStaticTagExportDirectory = CommonPath + "/ig_static_tag" # Tag for exported 3dsmax files + +# Zone directories +ZoneWeldBuildDirectory = CommonPath + "/zone_weld" +ZoneDependBuildDirectory = CommonPath + "/zone_depend" +ZoneLightWaterShapesLightedExportDirectory = CommonPath + "/zone_lwsl_temp" #fixme +ZoneLightBuildDirectory = CommonPath + "/zone_lighted" #fixme +ZoneLightDependBuildDirectory = CommonPath + "/zone_lighted_depend" #fixme +ZoneLightIgLandBuildDirectory = CommonPath + "/zone_lighted_ig_land" #fixme + + +# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** + +# Map directories +MapBuildDirectory = CommonPath + "/map" +MapPanoplyBuildDirectory = CommonPath + "/map_panoply" + +# Shape directories +ShapeClodtexBuildDirectory = CommonPath + "/shape_clodtex_build" +ShapeWithCoarseMeshBuildDirectory = CommonPath + "/shape_with_coarse_mesh_builded" +ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" +ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" + +# Ig directories +IgElevLandPrimBuildDirectory = CommonPath + "/ig_elev_land_prim" # landscape IG generated by the prim exporter (already elevated by the land exporter) +IgElevLandLigoBuildDirectory = CommonPath + "/ig_elev_land_ligo" # Landscape IG found in ligo bricks from 3dsmax elevated by the heightmap +IgElevLandStaticBuildDirectory = CommonPath + "/ig_elev_land_static" # Landscape IG eported from 3dsmax elevated by the heightmap +IgTempLandMergeBuildDirectory = CommonPath + "/ig_temp_land_merge" +IgTempLandCompareBuildDirectory = CommonPath + "/ig_temp_land_compare" # Tmp final IG directory for landscape IGs before comparison +IgLandBuildDirectory = CommonPath + "/ig_land" # Final IG directory for landscape IGs +IgOtherBuildDirectory = CommonPath + "/ig_other" # Final IG directory for village or construction IGs +IgOtherLightedBuildDirectory = CommonPath + "/ig_other_lighted" + +# Farbank directories +FarbankBuildDirectory = CommonPath + "/farbank" + +# Ligo directories +LigoZoneBuildDirectory = CommonPath + "/ligo_zones" +LigoIgLandBuildDirectory = CommonPath + "/ligo_ig_land" # Landscape IG found in ligo bricks not elevated by the heightmap +LigoIgOtherBuildDirectory = CommonPath + "/ligo_ig_other" # Village or construction IGs exported from ligo landscape + + +# *** INSTALL DIRECTORIES IN THE CLIENT DATA *** + +# Map directory +MapClientDirectory = CommonName +BitmapClientDirectory = MapClientDirectory + +# Shape directory +ShapeClientDirectory = CommonName + +# Lightmap directory +LightmapClientDirectory = CommonName + +# Animation directory +AnimClientDirectory = CommonName + +# Ig directory +IgClientDirectory = CommonName diff --git a/code/ryzom/tools/build_gamedata/workspace/common/outgame/process.py b/code/ryzom/tools/build_gamedata/workspace/common/outgame/process.py new file mode 100644 index 000000000..9097c3b3a --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/outgame/process.py @@ -0,0 +1,110 @@ +#!/usr/bin/python +# +# \file config.py +# \brief Process configuration +# \date 2010-08-27 17:02GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** PROCESS CONFIGURATION *** + + +# *** PROCESS CONFIG *** +ProcessToComplete = [ ] +ProcessToComplete += [ "properties" ] +ProcessToComplete += [ "shape" ] +ProcessToComplete += [ "map" ] +ProcessToComplete += [ "ig" ] +ProcessToComplete += [ "ig_light" ] + + +# *** COMMON NAMES AND PATHS *** +EcosystemName = "outgame" +EcosystemPath = "common/" + EcosystemName +ContinentName = EcosystemName +ContinentPath = EcosystemPath +CommonName = ContinentName +CommonPath = ContinentPath + + +# *** SHAPE EXPORT OPTIONS *** + +# Compute lightmaps ? +ShapeExportOptExportLighting = "true" + +# Cast shadow in lightmap ? +ShapeExportOptShadow = "true" + +# Lighting limits. 0 : normal, 1 : soft shadows +ShapeExportOptLightingLimit = 0 + +# Lightmap lumel size +ShapeExportOptLumelSize = "0.25" + +# Oversampling value. Can be 1, 2, 4 or 8 +ShapeExportOptOversampling = 1 + +# Does the lightmap must be generated in 8 bits format ? +ShapeExportOpt8BitsLightmap = "false" + +# Does the lightmaps export must generate logs ? +ShapeExportOptLightmapLog = "true" + +# Coarse mesh texture mul size +TextureMulSizeValue = "1.5" + +DoBuildShadowSkin = 0 + +ClodConfigFile = "" + +# *** COARSE MESH TEXTURE NAME *** +CoarseMeshTextureNames = [ ] + +# *** POSTFIX USED BY THE MULTIPLE TILES SYSTEM *** +MultipleTilesPostfix = [ ] +MultipleTilesPostfix += [ "_sp" ] +MultipleTilesPostfix += [ "_su" ] +MultipleTilesPostfix += [ "_au" ] +MultipleTilesPostfix += [ "_wi" ] + +# Name of the tilebank to use +BankTileBankName = "" + +# *** LANDSCAPE NAME *** +LandscapeName = ContinentName + +# *** LIGO OPTIONS *** +LigoExportLand = "" +LigoExportOnePass = 0 +LigoExportColormap = "colormap_invalid.png" +LigoExportHeightmap1 = "big_invalid.png" +LigoExportZFactor1 = "1.0" +LigoExportHeightmap2 = "noise_invalid.png" +LigoExportZFactor2 = "0.5" +LigoTileBankFile = "landscape/_texture_tiles/jungle/jungle.bank" + +# *** MAPS OPTIONS *** + +ReduceBitmapFactor = 0 + +# *** ANIMATIONS OPTIONS *** + +DoOptimizeAnimations = 0 diff --git a/code/ryzom/tools/build_gamedata/workspace/common/outgame/properties_base.cfg b/code/ryzom/tools/build_gamedata/workspace/common/outgame/properties_base.cfg new file mode 100644 index 000000000..a4ffbf3ca --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/outgame/properties_base.cfg @@ -0,0 +1,51 @@ + +// Bank file name +bank_name = "%ExportBuildDirectory%/ecosystems/jungle/smallbank/jungle.smallbank"; +bankfar_name = "%ExportBuildDirectory%/ecosystems/jungle/farbank/jungle.farbank"; + +// Search pathes +search_pathes = +{ + "%ExportBuildDirectory%/common/sfx/ps", // Sfx directory + "%ExportBuildDirectory%/common/sfx/shape", // Sfx directory + "%ExportBuildDirectory%/common/sfx/shape_with_coarse_mesh", // Sfx directory + "%ExportBuildDirectory%/common/sfx/map", // Sfx directory + "%ExportBuildDirectory%/common/outgame/shape", // Outgame directory + "%ExportBuildDirectory%/common/outgame/shape_with_coarse_mesh", // Outgame directory + "%ExportBuildDirectory%/common/outgame/map", // Outgame directory +}; + +// Additional ig file name +additionnal_ig = +{ + +}; + +// Sun direction. +//sun_direction = { -0.095, +1.0, -0.50 }; +sun_direction = { -0.776685, +0.216619, -0.59147 }; + +// Center of the landscape pointed by the sun +sun_center = {9954, -11017, 0}; + +// Distance of the sun +sun_distance = 50000; + +// FOV of the sun in radian +sun_fov = 0.52359877; // Pi / 6 + +// Sun radius, (for softshadow sampling) +sun_radius = 5000; + +// GlobalRetriever bank file.gr. Empty string to disable SurfaceLighting +grbank= "%ExportBuildDirectory%/continents/newbieland/rbank_output/newbieland.gr"; + +// LocalRetriever bank file .rbank. Empty string to disable SurfaceLighting +rbank= "%ExportBuildDirectory%/continents/newbieland/rbank_output/newbieland.rbank"; + +// The lighter search in rbank any retriever with identifier ---igname*** as substring +// where --- is col_identifier_prefix and *** is col_identifier_suffix +// eg: if igname= "street", col_identifier_prefix= "col_", col_identifier_suffix= "_", +// then "col_street_1" and "col_street_2" are valid and are used to build LightSurface infos in the Ig. +col_identifier_prefix= ""; +col_identifier_suffix= ""; diff --git a/code/ryzom/tools/build_gamedata/workspace/common/outgame/properties_draft.cfg b/code/ryzom/tools/build_gamedata/workspace/common/outgame/properties_draft.cfg new file mode 100644 index 000000000..07fad2f60 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/outgame/properties_draft.cfg @@ -0,0 +1,93 @@ + +// Load instance group. 0 disable, 1 enable +load_ig = 0; + +// Use ig to compute dependencies 0 disable, 1 enable +compute_dependencies_with_igs = 0; + +// Enable shadows. 0 disable, 1 enable +shadow = 0; + +// Landscape ZBuffers size for all the landscape. There is one zbuffer like this one per softshadow sample. +zbuffer_landscape_size = 32768; + +// Object ZBuffers size for all the landscape. This zbuffer is typically finer. There is only one zbuffer like this. +zbuffer_object_size = 98304; + +// Square root of the number of soft shadow samples +soft_shadow_samples_sqrt = 4; + +// Soft shadow jitter (0 ~ 1) to smooth softshadow aliasing when sampling number is small +soft_shadow_jitter = 0.4; + +// Enable the sun contribution. 0 disable, 1 enable +sun_contribution = 1; + +// Enable the sky global illumaniation. 0 disable, 1 enable +sky_contribution = 0; + +// The sky global illumaniation intensity . [0 ~ 1] +sky_intensity = 0.20; + +// Accuracy of the sky global illumaniation algorithm in meter +global_illumination_cell_size = 5; + +// shadow bias for water surfaces +water_shadow_bias = 0.8; + +// ambient lighting for water. [0 ~ 1] +water_ambient = 0.3; + +// diffuse lighting for water. [0 ~ 1] +water_diffuse = 1.0; + +// true if the water color should be modulated with the source diffuse map +modulate_water_color = 0; + +// 1 if the water should receive sky lighting contribution +sky_contribution_for_water = 0; + +// Side length of landscape used to compute the sky global illumaniation in meter +global_illumination_length = 600; + +// Size of the quad grid side in meter. Should be a power of 2. (optimisation) +quad_grid_size = 512; + +// Size of a cell of the quad grid in meter. (optimisation) +quad_grid_cell_size = 1; + +// Number of CPU used to calculate the lightmaps. 0 for automatic detection. +cpu_num = 0; + +/// Evaluation the max vegetable height in meters. This is used to decide wether vegetable of a tile +/// are above, below, or intersect a water surface (rough approximation). +/// As a matter of fact, these flags are processed during hte lighting as well. +vegetable_height = 2; + + + + +// *************************** +// Ig Lighting. +// *************************** +// Ig lighting shares also above parameters: sun_direction, shadow, quad_grid_size, quad_grid_cell_size, shapes_path + + +// Oversampling value, must be 0 (disable), 2, 4, 8, 16 +// This apply to surface cells and instances. +ig_oversampling = 16; + + +// IG Surface Lighting (for ig_light process only) + +// If SurfaceLighting enabled, define size of a cell (in meters) in a surface. +cell_surface_light_size = 1.5; + +// If SurfaceLighting enabled, define a deltaZ before raytracing cellPos against lights. Usefull to skip shadow errors like stairs +cell_raytrace_delta_z = 0.2; + + +// Build debug surface shapes (slows the process) +build_debug_surface_shape= 0; + + diff --git a/code/ryzom/tools/build_gamedata/workspace/common/outgame/properties_final.cfg b/code/ryzom/tools/build_gamedata/workspace/common/outgame/properties_final.cfg new file mode 100644 index 000000000..522c15d44 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/outgame/properties_final.cfg @@ -0,0 +1,93 @@ + +// Load instance group. 0 disable, 1 enable +load_ig = 1; + +// Use ig to compute dependencies 0 disable, 1 enable +compute_dependencies_with_igs = 1; + +// Enable shadows. 0 disable, 1 enable +shadow = 1; + +// Landscape ZBuffers size for all the landscape. There is one zbuffer like this one per softshadow sample. +zbuffer_landscape_size = 32768; + +// Object ZBuffers size for all the landscape. This zbuffer is typically finer. There is only one zbuffer like this. +zbuffer_object_size = 98304; + +// Square root of the number of soft shadow samples +soft_shadow_samples_sqrt = 4; + +// Soft shadow jitter (0 ~ 1) to smooth softshadow aliasing when sampling number is small +soft_shadow_jitter = 0.4; + +// Enable the sun contribution. 0 disable, 1 enable +sun_contribution = 1; + +// Enable the sky global illumaniation. 0 disable, 1 enable +sky_contribution = 1; + +// The sky global illumaniation intensity . [0 ~ 1] +sky_intensity = 0.20; + +// Accuracy of the sky global illumaniation algorithm in meter +global_illumination_cell_size = 5; + +// shadow bias for water surfaces +water_shadow_bias = 0.8; + +// ambient lighting for water. [0 ~ 1] +water_ambient = 0.3; + +// diffuse lighting for water. [0 ~ 1] +water_diffuse = 1.0; + +// true if the water color should be modulated with the source diffuse map +modulate_water_color = 0; + +// 1 if the water should receive sky lighting contribution +sky_contribution_for_water = 0; + +// Side length of landscape used to compute the sky global illumaniation in meter +global_illumination_length = 600; + +// Size of the quad grid side in meter. Should be a power of 2. (optimisation) +quad_grid_size = 64; + +// Size of a cell of the quad grid in meter. (optimisation) +quad_grid_cell_size = 2; + +// Number of CPU used to calculate the lightmaps. 0 for automatic detection. +cpu_num = 0; + +/// Evaluation the max vegetable height in meters. This is used to decide wether vegetable of a tile +/// are above, below, or intersect a water surface (rough approximation). +/// As a matter of fact, these flags are processed during hte lighting as well. +vegetable_height = 2; + + + + +// *************************** +// Ig Lighting. +// *************************** +// Ig lighting shares also above parameters: sun_direction, shadow, quad_grid_size, quad_grid_cell_size, shapes_path + + +// Oversampling value, must be 0 (disable), 2, 4, 8, 16 +// This apply to surface cells and instances. +ig_oversampling = 16; + + +// IG Surface Lighting (for ig_light process only) + +// If SurfaceLighting enabled, define size of a cell (in meters) in a surface. +cell_surface_light_size = 1.5; + +// If SurfaceLighting enabled, define a deltaZ before raytracing cellPos against lights. Usefull to skip shadow errors like stairs +cell_raytrace_delta_z = 0.2; + + +// Build debug surface shapes (slows the process) +build_debug_surface_shape= 0; + + diff --git a/code/ryzom/tools/build_gamedata/workspace/common/sfx/directories.py b/code/ryzom/tools/build_gamedata/workspace/common/sfx/directories.py new file mode 100644 index 000000000..5de327a3a --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/sfx/directories.py @@ -0,0 +1,102 @@ +#!/usr/bin/python +# +# \file directories.py +# \brief Directories configuration +# \date 2010-08-27 17:13GMT +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + + +# *** COMMON NAMES AND PATHS *** +EcosystemName = "sfx" +EcosystemPath = "common/" + EcosystemName +ContinentName = EcosystemName +ContinentPath = EcosystemPath +CommonName = ContinentName +CommonPath = ContinentPath + + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + +# PS directories +PsSourceDirectories = [ ] +PsSourceDirectories += [ "sfx/buildings" ] +PsSourceDirectories += [ "sfx/environment" ] +PsSourceDirectories += [ "sfx/fighting" ] +PsSourceDirectories += [ "sfx/magic" ] +PsSourceDirectories += [ "sfx/moving" ] +PsSourceDirectories += [ "sfx/teaser" ] +PsSourceDirectories += [ "sfx/forage" ] +PsSourceDirectories += [ "sfx/monsters" ] + +# Maps directories +MapSourceDirectories = [ ] +MapSourceDirectories += [ "sfx/maps" ] + +# Shape directories +ShapeSourceDirectories = [ ] +ShapeSourceDirectories += [ "sfx/meshtoparticle" ] + +MapUncompressedSourceDirectories = [ ] + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Shape directories +ShapeTagExportDirectory = CommonPath + "/shape_tag" +ShapeNotOptimizedExportDirectory = CommonPath + "/shape_not_optimized" +ShapeWithCoarseMeshExportDirectory = CommonPath + "/shape_with_coarse_mesh" +ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_optimized" +ShapeAnimExportDirectory = CommonPath + "/shape_anim" + +# PS directories +PsExportDirectory = CommonPath + "/ps" + + +# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** + +# Map directories +MapBuildDirectory = CommonPath + "/map" +MapPanoplyBuildDirectory = CommonPath + "/map_panoply" + +# Shape directories +ShapeClodtexBuildDirectory = CommonPath + "/shape_clodtex_build" +ShapeWithCoarseMeshBuildDirectory = CommonPath + "/shape_with_coarse_mesh_builded" +ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" +ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" + + +# *** INSTALL DIRECTORIES IN THE CLIENT DATA *** + +# Particule system directory +PsClientDirectory = "sfx" + +# Map directory +MapClientDirectory = "sfx" +BitmapClientDirectory = MapClientDirectory + +# Shape directory +ShapeClientDirectory = "sfx" + +# Lightmap directory +LightmapClientDirectory = "sfx" diff --git a/code/ryzom/tools/build_gamedata/workspace/common/sfx/process.py b/code/ryzom/tools/build_gamedata/workspace/common/sfx/process.py new file mode 100644 index 000000000..a2f63c1ef --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/sfx/process.py @@ -0,0 +1,87 @@ +#!/usr/bin/python +# +# \file config.py +# \brief Process configuration +# \date 2010-08-27 17:02GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** PROCESS CONFIGURATION *** + +# *** PROCESS CONFIG *** +ProcessToComplete = [ ] +ProcessToComplete += [ "ps" ] +ProcessToComplete += [ "map" ] +ProcessToComplete += [ "shape" ] + + +# *** COMMON NAMES AND PATHS *** +EcosystemName = "sfx" +EcosystemPath = "common/" + EcosystemName +ContinentName = EcosystemName +ContinentPath = EcosystemPath +CommonName = ContinentName +CommonPath = ContinentPath + + +# *** SHAPE EXPORT OPTIONS *** + +# Compute lightmaps ? +ShapeExportOptExportLighting = "true" + +# Cast shadow in lightmap ? +ShapeExportOptShadow = "true" + +# Lighting limits. 0 : normal, 1 : soft shadows +ShapeExportOptLightingLimit = 0 + +# Lightmap lumel size +ShapeExportOptLumelSize = "0.25" + +# Oversampling value. Can be 1, 2, 4 or 8 +ShapeExportOptOversampling = 1 + +# Does the lightmap must be generated in 8 bits format ? +ShapeExportOpt8BitsLightmap = "false" + +# Does the lightmaps export must generate logs ? +ShapeExportOptLightmapLog = "true" + +# Coarse mesh texture mul size +TextureMulSizeValue = "1.5" + +DoBuildShadowSkin = 0 + +ClodConfigFile = "" + +# *** COARSE MESH TEXTURE NAME *** +CoarseMeshTextureNames = [ ] + +# *** POSTFIX USED BY THE MULTIPLE TILES SYSTEM *** +MultipleTilesPostfix = [ ] +MultipleTilesPostfix += [ "_sp" ] +MultipleTilesPostfix += [ "_su" ] +MultipleTilesPostfix += [ "_au" ] +MultipleTilesPostfix += [ "_wi" ] + +# *** MAPS OPTIONS *** + +ReduceBitmapFactor = 0 diff --git a/code/ryzom/tools/build_gamedata/workspace/common/sky/anim_builder.cfg b/code/ryzom/tools/build_gamedata/workspace/common/sky/anim_builder.cfg new file mode 100644 index 000000000..08128b23e --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/sky/anim_builder.cfg @@ -0,0 +1,15 @@ + +// *************************** +// Animation Optimizer +// *************************** + +// Tracks which contain one of those name (eg "Bip01 Finger11.rotquat") will be mark as "Low Precision". +// Usefull for memory optimisation. Avoid setting legs or root bones. Warning: case sensitive. +anim_low_precision_tracks= +{ +"Finger", +"Ponytail", +}; + +// The Sample Rate. +anim_sample_rate= 30; diff --git a/code/ryzom/tools/build_gamedata/workspace/common/sky/directories.py b/code/ryzom/tools/build_gamedata/workspace/common/sky/directories.py new file mode 100644 index 000000000..ba46541dd --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/sky/directories.py @@ -0,0 +1,160 @@ +#!/usr/bin/python +# +# \file directories.py +# \brief Directories configuration +# \date 2010-08-27 17:13GMT +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + + +# *** COMMON NAMES AND PATHS *** +EcosystemName = "sky" +EcosystemPath = "common/" + EcosystemName +ContinentName = EcosystemName +ContinentPath = EcosystemPath +CommonName = ContinentName +CommonPath = ContinentPath + + +# *** SOURCE DIRECTORIES LEVELDESIGN/WORLD *** +ContinentLeveldesignWorldDirectory = "" # DISABLED + + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + +# Shape directories +ShapeSourceDirectories = [ ] +ShapeSourceDirectories += [ "sky_v2/max" ] + +# Maps directories +MapSourceDirectories = [ ] +MapSourceDirectories += [ "sky_v2/textures/textures" ] + +MapUncompressedSourceDirectories = [ ] +MapUncompressedSourceDirectories += [ "sky_v2/textures/textures/desert" ] +MapUncompressedSourceDirectories += [ "sky_v2/textures/textures/forest" ] +MapUncompressedSourceDirectories += [ "sky_v2/textures/textures/jungle" ] +MapUncompressedSourceDirectories += [ "sky_v2/textures/textures/lacustre" ] +MapUncompressedSourceDirectories += [ "sky_v2/textures/setup/desert" ] +MapUncompressedSourceDirectories += [ "sky_v2/textures/setup/forest" ] +MapUncompressedSourceDirectories += [ "sky_v2/textures/setup/jungle" ] +MapUncompressedSourceDirectories += [ "sky_v2/textures/setup/lacustre" ] +MapUncompressedSourceDirectories += [ "sky_v2/textures/textures/nodds" ] + +# Ligo directories +LigoBaseSourceDirectory = "landscape/ligo" + +# Ig directories +IgLandSourceDirectories = [ ] +IgOtherSourceDirectories = [ ] +IgOtherSourceDirectories += [ "sky_v2/max" ] +IgPrimitiveSourceDirectories = [ ] + +# Tiles root directory +TileRootSourceDirectory = "landscape/_texture_tiles" + +# Displace directory +DisplaceSourceDirectory = "landscape/_texture_tiles/displace" + +# Animation directories +AnimSourceDirectories = [ ] +AnimSourceDirectories += [ "sky_v2/max" ] + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Shape directories +ShapeTagExportDirectory = CommonPath + "/shape_tag" +ShapeNotOptimizedExportDirectory = CommonPath + "/shape_not_optimized" +ShapeWithCoarseMeshExportDirectory = CommonPath + "/shape_with_coarse_mesh" +ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_optimized" +ShapeAnimExportDirectory = CommonPath + "/shape_anim" + +# Ig directories +IgStaticLandExportDirectory = CommonPath + "/ig_static_land" # Landscape IG eported from 3dsmax not elevated by the heightmap +IgStaticOtherExportDirectory = CommonPath + "/ig_static_other" # Village or construction IGs exported from 3dsmax +IgStaticTagExportDirectory = CommonPath + "/ig_static_tag" # Tag for exported 3dsmax files + +# Zone directories +ZoneWeldBuildDirectory = CommonPath + "/zone_weld" +ZoneDependBuildDirectory = CommonPath + "/zone_depend" +ZoneLightWaterShapesLightedExportDirectory = CommonPath + "/zone_lwsl_temp" #fixme +ZoneLightBuildDirectory = CommonPath + "/zone_lighted" #fixme +ZoneLightDependBuildDirectory = CommonPath + "/zone_lighted_depend" #fixme +ZoneLightIgLandBuildDirectory = CommonPath + "/zone_lighted_ig_land" #fixme + +# Animation directories +AnimExportDirectory = CommonPath + "/anim_export" + + +# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** + +# Map directories +MapBuildDirectory = CommonPath + "/map" +MapPanoplyBuildDirectory = CommonPath + "/map_panoply" + +# Shape directories +ShapeClodtexBuildDirectory = CommonPath + "/shape_clodtex_build" +ShapeWithCoarseMeshBuildDirectory = CommonPath + "/shape_with_coarse_mesh_builded" +ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" +ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" + +# Ig directories +IgElevLandPrimBuildDirectory = CommonPath + "/ig_elev_land_prim" # landscape IG generated by the prim exporter (already elevated by the land exporter) +IgElevLandLigoBuildDirectory = CommonPath + "/ig_elev_land_ligo" # Landscape IG found in ligo bricks from 3dsmax elevated by the heightmap +IgElevLandStaticBuildDirectory = CommonPath + "/ig_elev_land_static" # Landscape IG eported from 3dsmax elevated by the heightmap +IgTempLandMergeBuildDirectory = CommonPath + "/ig_temp_land_merge" +IgTempLandCompareBuildDirectory = CommonPath + "/ig_temp_land_compare" # Tmp final IG directory for landscape IGs before comparison +IgLandBuildDirectory = CommonPath + "/ig_land" # Final IG directory for landscape IGs +IgOtherBuildDirectory = CommonPath + "/ig_other" # Final IG directory for village or construction IGs +IgOtherLightedBuildDirectory = CommonPath + "/ig_other_lighted" + +# Farbank directories +FarbankBuildDirectory = CommonPath + "/farbank" + +# Ligo directories +LigoZoneBuildDirectory = CommonPath + "/ligo_zones" +LigoIgLandBuildDirectory = CommonPath + "/ligo_ig_land" # Landscape IG found in ligo bricks not elevated by the heightmap +LigoIgOtherBuildDirectory = CommonPath + "/ligo_ig_other" # Village or construction IGs exported from ligo landscape + +# Animation directories +AnimBuildDirectory = CommonPath + "/anim" + + +# *** INSTALL DIRECTORIES IN THE CLIENT DATA *** + +# Map directory +MapClientDirectory = CommonName +BitmapClientDirectory = MapClientDirectory + +# Shape directory +ShapeClientDirectory = CommonName + +# Lightmap directory +LightmapClientDirectory = CommonName + +# Animation directory +AnimClientDirectory = CommonName + +# Ig directory +IgClientDirectory = CommonName diff --git a/code/ryzom/tools/build_gamedata/workspace/common/sky/process.py b/code/ryzom/tools/build_gamedata/workspace/common/sky/process.py new file mode 100644 index 000000000..e68c6853e --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/sky/process.py @@ -0,0 +1,117 @@ +#!/usr/bin/python +# +# \file config.py +# \brief Process configuration +# \date 2010-08-27 17:02GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** PROCESS CONFIGURATION *** + + +# *** PROCESS CONFIG *** +ProcessToComplete = [ ] +ProcessToComplete += [ "properties" ] +ProcessToComplete += [ "shape" ] +ProcessToComplete += [ "map" ] +ProcessToComplete += [ "anim" ] +ProcessToComplete += [ "ig" ] +ProcessToComplete += [ "ig_light" ] + + +# *** COMMON NAMES AND PATHS *** +EcosystemName = "sky" +EcosystemPath = "common/" + EcosystemName +ContinentName = EcosystemName +ContinentPath = EcosystemPath +CommonName = ContinentName +CommonPath = ContinentPath + + +# *** SHAPE EXPORT OPTIONS *** + +# Compute lightmaps ? +ShapeExportOptExportLighting = "true" + +# Cast shadow in lightmap ? +ShapeExportOptShadow = "true" + +# Lighting limits. 0 : normal, 1 : soft shadows +ShapeExportOptLightingLimit = 0 + +# Lightmap lumel size +ShapeExportOptLumelSize = "0.25" + +# Oversampling value. Can be 1, 2, 4 or 8 +ShapeExportOptOversampling = 1 + +# Does the lightmap must be generated in 8 bits format ? +ShapeExportOpt8BitsLightmap = "false" + +# Does the lightmaps export must generate logs ? +ShapeExportOptLightmapLog = "true" + +# Coarse mesh texture mul size +TextureMulSizeValue = "1.5" + +DoBuildShadowSkin = 0 + +ClodConfigFile = "" + + +# *** COARSE MESH TEXTURE NAME *** +CoarseMeshTextureNames = [ ] + + +# *** POSTFIX USED BY THE MULTIPLE TILES SYSTEM *** +MultipleTilesPostfix = [ ] +MultipleTilesPostfix += [ "_sp" ] +MultipleTilesPostfix += [ "_su" ] +MultipleTilesPostfix += [ "_au" ] +MultipleTilesPostfix += [ "_wi" ] + +# Name of the tilebank to use +BankTileBankName = "" + + +# *** LANDSCAPE NAME *** +LandscapeName = ContinentName + + +# *** LIGO OPTIONS *** +LigoExportLand = "" +LigoExportOnePass = 0 +LigoExportColormap = "colormap_invalid.png" +LigoExportHeightmap1 = "big_invalid.png" +LigoExportZFactor1 = "1.0" +LigoExportHeightmap2 = "noise_invalid.png" +LigoExportZFactor2 = "0.5" +LigoTileBankFile = "landscape/_texture_tiles/jungle/jungle.bank" + + +# *** MAPS OPTIONS *** + +ReduceBitmapFactor = 0 + + +# *** ANIMATIONS OPTIONS *** + +DoOptimizeAnimations = 0 diff --git a/code/ryzom/tools/build_gamedata/workspace/common/sky/properties_base.cfg b/code/ryzom/tools/build_gamedata/workspace/common/sky/properties_base.cfg new file mode 100644 index 000000000..6b6cd9e75 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/sky/properties_base.cfg @@ -0,0 +1,51 @@ + +// Bank file name +bank_name = "%ExportBuildDirectory%/ecosystems/jungle/smallbank/jungle.smallbank"; +bankfar_name = "%ExportBuildDirectory%/ecosystems/jungle/farbank/jungle.farbank"; + +// Search pathes +search_pathes = +{ + "%ExportBuildDirectory%/common/sfx/ps", // Sfx directory + "%ExportBuildDirectory%/common/sfx/shape", // Sfx directory + "%ExportBuildDirectory%/common/sfx/shape_with_coarse_mesh", // Sfx directory + "%ExportBuildDirectory%/common/sfx/map", // Sfx directory + "%ExportBuildDirectory%/common/sky/shape", // Sky directory + "%ExportBuildDirectory%/common/sky/shape_with_coarse_mesh", // Sky directory + "%ExportBuildDirectory%/common/sky/map", // Sky directory +}; + +// Additional ig file name +additionnal_ig = +{ + +}; + +// Sun direction. +//sun_direction = { -0.095, +1.0, -0.50 }; +sun_direction = { -0.776685, +0.216619, -0.59147 }; + +// Center of the landscape pointed by the sun +sun_center = {9954, -11017, 0}; + +// Distance of the sun +sun_distance = 50000; + +// FOV of the sun in radian +sun_fov = 0.52359877; // Pi / 6 + +// Sun radius, (for softshadow sampling) +sun_radius = 5000; + +// GlobalRetriever bank file.gr. Empty string to disable SurfaceLighting +grbank= "%ExportBuildDirectory%/continents/newbieland/rbank_output/newbieland.gr"; + +// LocalRetriever bank file .rbank. Empty string to disable SurfaceLighting +rbank= "%ExportBuildDirectory%/continents/newbieland/rbank_output/newbieland.rbank"; + +// The lighter search in rbank any retriever with identifier ---igname*** as substring +// where --- is col_identifier_prefix and *** is col_identifier_suffix +// eg: if igname= "street", col_identifier_prefix= "col_", col_identifier_suffix= "_", +// then "col_street_1" and "col_street_2" are valid and are used to build LightSurface infos in the Ig. +col_identifier_prefix= ""; +col_identifier_suffix= ""; diff --git a/code/ryzom/tools/build_gamedata/workspace/common/sky/properties_draft.cfg b/code/ryzom/tools/build_gamedata/workspace/common/sky/properties_draft.cfg new file mode 100644 index 000000000..07fad2f60 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/sky/properties_draft.cfg @@ -0,0 +1,93 @@ + +// Load instance group. 0 disable, 1 enable +load_ig = 0; + +// Use ig to compute dependencies 0 disable, 1 enable +compute_dependencies_with_igs = 0; + +// Enable shadows. 0 disable, 1 enable +shadow = 0; + +// Landscape ZBuffers size for all the landscape. There is one zbuffer like this one per softshadow sample. +zbuffer_landscape_size = 32768; + +// Object ZBuffers size for all the landscape. This zbuffer is typically finer. There is only one zbuffer like this. +zbuffer_object_size = 98304; + +// Square root of the number of soft shadow samples +soft_shadow_samples_sqrt = 4; + +// Soft shadow jitter (0 ~ 1) to smooth softshadow aliasing when sampling number is small +soft_shadow_jitter = 0.4; + +// Enable the sun contribution. 0 disable, 1 enable +sun_contribution = 1; + +// Enable the sky global illumaniation. 0 disable, 1 enable +sky_contribution = 0; + +// The sky global illumaniation intensity . [0 ~ 1] +sky_intensity = 0.20; + +// Accuracy of the sky global illumaniation algorithm in meter +global_illumination_cell_size = 5; + +// shadow bias for water surfaces +water_shadow_bias = 0.8; + +// ambient lighting for water. [0 ~ 1] +water_ambient = 0.3; + +// diffuse lighting for water. [0 ~ 1] +water_diffuse = 1.0; + +// true if the water color should be modulated with the source diffuse map +modulate_water_color = 0; + +// 1 if the water should receive sky lighting contribution +sky_contribution_for_water = 0; + +// Side length of landscape used to compute the sky global illumaniation in meter +global_illumination_length = 600; + +// Size of the quad grid side in meter. Should be a power of 2. (optimisation) +quad_grid_size = 512; + +// Size of a cell of the quad grid in meter. (optimisation) +quad_grid_cell_size = 1; + +// Number of CPU used to calculate the lightmaps. 0 for automatic detection. +cpu_num = 0; + +/// Evaluation the max vegetable height in meters. This is used to decide wether vegetable of a tile +/// are above, below, or intersect a water surface (rough approximation). +/// As a matter of fact, these flags are processed during hte lighting as well. +vegetable_height = 2; + + + + +// *************************** +// Ig Lighting. +// *************************** +// Ig lighting shares also above parameters: sun_direction, shadow, quad_grid_size, quad_grid_cell_size, shapes_path + + +// Oversampling value, must be 0 (disable), 2, 4, 8, 16 +// This apply to surface cells and instances. +ig_oversampling = 16; + + +// IG Surface Lighting (for ig_light process only) + +// If SurfaceLighting enabled, define size of a cell (in meters) in a surface. +cell_surface_light_size = 1.5; + +// If SurfaceLighting enabled, define a deltaZ before raytracing cellPos against lights. Usefull to skip shadow errors like stairs +cell_raytrace_delta_z = 0.2; + + +// Build debug surface shapes (slows the process) +build_debug_surface_shape= 0; + + diff --git a/code/ryzom/tools/build_gamedata/workspace/common/sky/properties_final.cfg b/code/ryzom/tools/build_gamedata/workspace/common/sky/properties_final.cfg new file mode 100644 index 000000000..522c15d44 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/common/sky/properties_final.cfg @@ -0,0 +1,93 @@ + +// Load instance group. 0 disable, 1 enable +load_ig = 1; + +// Use ig to compute dependencies 0 disable, 1 enable +compute_dependencies_with_igs = 1; + +// Enable shadows. 0 disable, 1 enable +shadow = 1; + +// Landscape ZBuffers size for all the landscape. There is one zbuffer like this one per softshadow sample. +zbuffer_landscape_size = 32768; + +// Object ZBuffers size for all the landscape. This zbuffer is typically finer. There is only one zbuffer like this. +zbuffer_object_size = 98304; + +// Square root of the number of soft shadow samples +soft_shadow_samples_sqrt = 4; + +// Soft shadow jitter (0 ~ 1) to smooth softshadow aliasing when sampling number is small +soft_shadow_jitter = 0.4; + +// Enable the sun contribution. 0 disable, 1 enable +sun_contribution = 1; + +// Enable the sky global illumaniation. 0 disable, 1 enable +sky_contribution = 1; + +// The sky global illumaniation intensity . [0 ~ 1] +sky_intensity = 0.20; + +// Accuracy of the sky global illumaniation algorithm in meter +global_illumination_cell_size = 5; + +// shadow bias for water surfaces +water_shadow_bias = 0.8; + +// ambient lighting for water. [0 ~ 1] +water_ambient = 0.3; + +// diffuse lighting for water. [0 ~ 1] +water_diffuse = 1.0; + +// true if the water color should be modulated with the source diffuse map +modulate_water_color = 0; + +// 1 if the water should receive sky lighting contribution +sky_contribution_for_water = 0; + +// Side length of landscape used to compute the sky global illumaniation in meter +global_illumination_length = 600; + +// Size of the quad grid side in meter. Should be a power of 2. (optimisation) +quad_grid_size = 64; + +// Size of a cell of the quad grid in meter. (optimisation) +quad_grid_cell_size = 2; + +// Number of CPU used to calculate the lightmaps. 0 for automatic detection. +cpu_num = 0; + +/// Evaluation the max vegetable height in meters. This is used to decide wether vegetable of a tile +/// are above, below, or intersect a water surface (rough approximation). +/// As a matter of fact, these flags are processed during hte lighting as well. +vegetable_height = 2; + + + + +// *************************** +// Ig Lighting. +// *************************** +// Ig lighting shares also above parameters: sun_direction, shadow, quad_grid_size, quad_grid_cell_size, shapes_path + + +// Oversampling value, must be 0 (disable), 2, 4, 8, 16 +// This apply to surface cells and instances. +ig_oversampling = 16; + + +// IG Surface Lighting (for ig_light process only) + +// If SurfaceLighting enabled, define size of a cell (in meters) in a surface. +cell_surface_light_size = 1.5; + +// If SurfaceLighting enabled, define a deltaZ before raytracing cellPos against lights. Usefull to skip shadow errors like stairs +cell_raytrace_delta_z = 0.2; + + +// Build debug surface shapes (slows the process) +build_debug_surface_shape= 0; + + diff --git a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/directories.py b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/directories.py index 11633a34a..3c0e4663a 100644 --- a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/directories.py +++ b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/directories.py @@ -33,6 +33,9 @@ EcosystemName = "jungle" EcosystemPath = "ecosystems/" + EcosystemName ContinentName = "newbieland" ContinentPath = "continents/" + ContinentName +CommonName = ContinentName +CommonPath = ContinentPath + # *** SOURCE DIRECTORIES LEVELDESIGN/WORLD *** ContinentLeveldesignWorldDirectory = ContinentName @@ -40,12 +43,25 @@ ContinentLeveldesignWorldDirectory = ContinentName # *** SOURCE DIRECTORIES IN THE DATABASE *** +# Shape directories +ShapeSourceDirectories = [ ] +ShapeSourceDirectories += [ "stuff/" + ContinentName + "/sky" ] + +# Maps directories +MapSourceDirectories = [ ] +MapSourceDirectories += [ "stuff/" + ContinentName + "/sky" ] + +MapUncompressedSourceDirectories = [ ] + # Ligo directories LigoBaseSourceDirectory = "landscape/ligo/" + EcosystemName LigoMaxSourceDirectory = LigoBaseSourceDirectory + "/max" # Zone directories -ZoneSourceDirectory = "landscape/zones/" + EcosystemName +ZoneSourceDirectory = [ "landscape/zones/" + ContinentName ] # For old snowballs style landscape when not using ligo + +# RBank directories +RBankCmbSourceDirectories = [ ] # Ig directories IgLandSourceDirectories = [ ] @@ -61,9 +77,20 @@ TileRootSourceDirectory = "landscape/_texture_tiles/" + EcosystemName # Displace directory DisplaceSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + "/displace" +# Ligo primitive directory used in the client +PsSourceDirectories = [ ] +PsSourceDirectories += [ "primitive_microlife/" + ContinentName ] + # *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** +# Shape directories +ShapeTagExportDirectory = CommonPath + "/shape_tag" +ShapeNotOptimizedExportDirectory = CommonPath + "/shape_not_optimized" +ShapeWithCoarseMeshExportDirectory = CommonPath + "/shape_with_coarse_mesh" +ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_optimized" +ShapeAnimExportDirectory = CommonPath + "/shape_anim" + # Ligo directories LigoDatabaseExportDirectory = "landscape/ligo/" + EcosystemName LigoDatabaseIgExportDirectory = LigoDatabaseExportDirectory + "/igs" @@ -76,6 +103,10 @@ LigoTagExportDirectory = "ecosystems/" + EcosystemName + "/ligo_tag" ZoneExportDirectory = ContinentPath + "/zone" WaterMapSourceDirectories = [ ] +# RBank directories +RBankCmbExportDirectory = CommonPath + "/rbank_cmb_export" +RBankCmbTagExportDirectory = CommonPath + "/rbank_cmb_tag_export" + # Smallbank directories SmallbankExportDirectory = EcosystemPath + "/smallbank" @@ -87,57 +118,80 @@ IgStaticLandExportDirectory = ContinentPath + "/ig_static_land" # Landscape IG e IgStaticOtherExportDirectory = ContinentPath + "/ig_static_other" # Village or construction IGs exported from 3dsmax IgStaticTagExportDirectory = ContinentPath + "/ig_static_tag" # Tag for exported 3dsmax files +# PS directories +PsExportDirectory = CommonPath + "/ps" + # *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** +# Map directories +MapBuildDirectory = CommonPath + "/map" +MapPanoplyBuildDirectory = CommonPath + "/map_panoply" + +# Shape directories +ShapeClodtexBuildDirectory = CommonPath + "/shape_clodtex_build" +ShapeWithCoarseMeshBuildDirectory = CommonPath + "/shape_with_coarse_mesh_builded" +ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" +ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" + # Ligo directories -LigoZoneBuildDirectory = ContinentPath + "/ligo_zones" -LigoIgLandBuildDirectory = ContinentPath + "/ligo_ig_land" # Landscape IG found in ligo bricks not elevated by the heightmap -LigoIgOtherBuildDirectory = ContinentPath + "/ligo_ig_other" # Village or construction IGs exported from ligo landscape +LigoZoneBuildDirectory = CommonPath + "/ligo_zones" +LigoIgLandBuildDirectory = CommonPath + "/ligo_ig_land" # Landscape IG found in ligo bricks not elevated by the heightmap +LigoIgOtherBuildDirectory = CommonPath + "/ligo_ig_other" # Village or construction IGs exported from ligo landscape # Zone directories -ZoneWeldBuildDirectory = ContinentPath + "/zone_weld" -ZoneDependBuildDirectory = ContinentPath + "/zone_depend" -ZoneLightWaterShapesLightedExportDirectory = ContinentPath + "/zone_lwsl_temp" #fixme -ZoneLightBuildDirectory = ContinentPath + "/zone_lighted" #fixme -ZoneLightDependBuildDirectory = ContinentPath + "/zone_lighted_depend" #fixme -ZoneLightIgLandBuildDirectory = ContinentPath + "/zone_lighted_ig_land" #fixme +ZoneWeldBuildDirectory = CommonPath + "/zone_weld" +ZoneDependBuildDirectory = CommonPath + "/zone_depend" +ZoneLightWaterShapesLightedExportDirectory = CommonPath + "/zone_lwsl_temp" #fixme +ZoneLightBuildDirectory = CommonPath + "/zone_lighted" #fixme +ZoneLightDependBuildDirectory = CommonPath + "/zone_lighted_depend" #fixme +ZoneLightIgLandBuildDirectory = CommonPath + "/zone_lighted_ig_land" #fixme # Farbank directories FarbankBuildDirectory = EcosystemPath + "/farbank" # Ig directories -IgElevLandPrimBuildDirectory = ContinentPath + "/ig_elev_land_prim" # landscape IG generated by the prim exporter (already elevated by the land exporter) -IgElevLandLigoBuildDirectory = ContinentPath + "/ig_elev_land_ligo" # Landscape IG found in ligo bricks from 3dsmax elevated by the heightmap -IgElevLandStaticBuildDirectory = ContinentPath + "/ig_elev_land_static" # Landscape IG eported from 3dsmax elevated by the heightmap -IgTempLandMergeBuildDirectory = ContinentPath + "/ig_temp_land_merge" -IgTempLandCompareBuildDirectory = ContinentPath + "/ig_temp_land_compare" # Tmp final IG directory for landscape IGs before comparison -IgLandBuildDirectory = ContinentPath + "/ig_land" # Final IG directory for landscape IGs -IgOtherBuildDirectory = ContinentPath + "/ig_other" # Final IG directory for village or construction IGs -IgOtherLightedBuildDirectory = ContinentPath + "/ig_other_lighted" +IgElevLandPrimBuildDirectory = CommonPath + "/ig_elev_land_prim" # landscape IG generated by the prim exporter (already elevated by the land exporter) +IgElevLandLigoBuildDirectory = CommonPath + "/ig_elev_land_ligo" # Landscape IG found in ligo bricks from 3dsmax elevated by the heightmap +IgElevLandStaticBuildDirectory = CommonPath + "/ig_elev_land_static" # Landscape IG eported from 3dsmax elevated by the heightmap +IgTempLandMergeBuildDirectory = CommonPath + "/ig_temp_land_merge" +IgTempLandCompareBuildDirectory = CommonPath + "/ig_temp_land_compare" # Tmp final IG directory for landscape IGs before comparison +IgLandBuildDirectory = CommonPath + "/ig_land" # Final IG directory for landscape IGs +IgOtherBuildDirectory = CommonPath + "/ig_other" # Final IG directory for village or construction IGs +IgOtherLightedBuildDirectory = CommonPath + "/ig_other_lighted" # Rbank directories -RbankBboxBuildDirectory = ContinentPath + "/rbank_bbox" -RbankTessellationBuildDirectory = ContinentPath + "/rbank_tessellation" -RbankSmoothBuildDirectory = ContinentPath + "/rbank_smooth" -RbankRawBuildDirectory = ContinentPath + "/rbank_raw" -RbankPreprocBuildDirectory = ContinentPath + "/rbank_preproc" -RbankMeshBuildDirectory = ContinentPath + "/rbank_cmb" -RbankRetrieversBuildDirectory = ContinentPath + "/rbank_retrievers" -RbankOutputBuildDirectory = ContinentPath + "/rbank_output" +RbankBboxBuildDirectory = CommonPath + "/rbank_bbox" +RbankTessellationBuildDirectory = CommonPath + "/rbank_tessellation" +RbankSmoothBuildDirectory = CommonPath + "/rbank_smooth" +RbankRawBuildDirectory = CommonPath + "/rbank_raw" +RbankPreprocBuildDirectory = CommonPath + "/rbank_preproc" +RbankMeshBuildDirectory = CommonPath + "/rbank_cmb" +RbankRetrieversBuildDirectory = CommonPath + "/rbank_retrievers" +RbankOutputBuildDirectory = CommonPath + "/rbank_output" # *** INSTALL DIRECTORIES IN THE CLIENT DATA *** +# Map directory +MapClientDirectory = CommonName + "_maps" +BitmapClientDirectory = MapClientDirectory + +# Shape directory +ShapeClientDirectory = CommonName + "_shapes" + +# Shape lightmaps directory +LightmapClientDirectory = ShapeClientDirectory + # Ig directory -IgClientDirectory = ContinentName + "_ig" +IgClientDirectory = CommonName + "_ig" # Zone directory -ZoneClientDirectory = ContinentName + "_zones" -WaterMapsClientDirectory = ContinentName + "_zones" +ZoneClientDirectory = CommonName + "_zones" +WaterMapsClientDirectory = ZoneClientDirectory # PACS directory -PacsClientDirectory = ContinentName + "_pacs" +PacsClientDirectory = CommonName + "_pacs" # PS directory -IgClientDirectory = ContinentName + "_ig" +PsClientDirectory = CommonName + "_ig" diff --git a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/process.py b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/process.py index b543cba32..356670e32 100644 --- a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/process.py +++ b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/process.py @@ -29,18 +29,26 @@ # *** PROCESS CONFIG *** ProcessToComplete = [ ] -ProcessToComplete += [ "ligo" ] # not fully implemented, works for this process (not yet), but does not export max files -ProcessToComplete += [ "zone" ] # works, need to check completeness +ProcessToComplete += [ "properties" ] +ProcessToComplete += [ "map" ] +ProcessToComplete += [ "shape" ] +ProcessToComplete += [ "ligo" ] +ProcessToComplete += [ "zone" ] ProcessToComplete += [ "ig" ] # fully implemented ProcessToComplete += [ "zone_light" ] # works, need to check completeness -ProcessToComplete += [ "rbank" ] # works, need to check completeness +ProcessToComplete += [ "rbank" ] ProcessToComplete += [ "ig_light" ] # fully implemented -#ProcessToComplete += [ "ps" ] # not implemented +ProcessToComplete += [ "ps" ] # *** ECOSYSTEM AND CONTINENT NAMES *** + EcosystemName = "jungle" +EcosystemPath = "ecosystems/" + EcosystemName ContinentName = "newbieland" +ContinentPath = "continents/" + ContinentName +CommonName = ContinentName +CommonPath = ContinentPath # *** LANDSCAPE NAME *** @@ -50,6 +58,40 @@ LandscapeName = ContinentName ContinentFile = ContinentName + "/" + ContinentName + ".continent" + +# *** SHAPE EXPORT OPTIONS *** + +# Compute lightmaps ? +ShapeExportOptExportLighting = "true" + +# Cast shadow in lightmap ? +ShapeExportOptShadow = "true" + +# Lighting limits. 0 : normal, 1 : soft shadows +ShapeExportOptLightingLimit = 0 + +# Lightmap lumel size +ShapeExportOptLumelSize = "0.25" + +# Oversampling value. Can be 1, 2, 4 or 8 +ShapeExportOptOversampling = 1 + +# Does the lightmap must be generated in 8 bits format ? +ShapeExportOpt8BitsLightmap = "false" + +# Does the lightmaps export must generate logs ? +ShapeExportOptLightmapLog = "true" + +# Coarse mesh texture mul size +TextureMulSizeValue = "1.5" + +DoBuildShadowSkin = 0 + +ClodConfigFile = "" + +# *** COARSE MESH TEXTURE NAME *** +CoarseMeshTextureNames = [ ] + # *** BANK EXPORT OPTIONS *** # *** POSTFIX USED BY THE MULTIPLE TILES SYSTEM *** @@ -111,3 +153,7 @@ RbankShapePaths += [ "ecosystems/" + EcosystemName + "/shape_with_coarse_mesh_bu RbankShapePaths += [ "common/sfx/ps" ] # RbankShapePaths += [ "l:/leveldesign/world_edit_files" ] +# *** MAPS OPTIONS *** + +ReduceBitmapFactor = 0 + diff --git a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_base.cfg b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/properties_base.cfg similarity index 52% rename from code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_base.cfg rename to code/ryzom/tools/build_gamedata/workspace/continents/newbieland/properties_base.cfg index 4b886d584..27c73e966 100644 --- a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/zone_lighter_base.cfg +++ b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/properties_base.cfg @@ -6,15 +6,19 @@ bankfar_name = "%ExportBuildDirectory%/%FarbankBuildDirectory%/%EcosystemName%.f // Search pathes search_pathes = { - "%ExportBuildDirectory%/continents/newbieland/ig_land", // Instance group directory - "%ExportBuildDirectory%/continents/newbieland/ig_other", // Instance group directory - "%ExportBuildDirectory%/continents/newbieland/shape", // Shape directory - "%ExportBuildDirectory%/continents/newbieland/shape_with_coarse_mesh", // Shape directory - "%ExportBuildDirectory%/common/sfx/processes/ps/ps", // Sfx directory - "%ExportBuildDirectory%/ecosystems/jungle/shape", // Shape directory - "%ExportBuildDirectory%/ecosystems/jungle/shape_with_coarse_mesh", // Shape directory - "%ExportBuildDirectory%/ecosystems/jungle/map/tga", // Map directory - "%ExportBuildDirectory%/continents/newbieland/zone_light/water_shapes_lighted", // Water shape lighted directory + "%ExportBuildDirectory%/common/sfx/ps", // Sfx directory + "%ExportBuildDirectory%/common/sfx/shape", // Sfx directory + "%ExportBuildDirectory%/common/sfx/shape_with_coarse_mesh", // Sfx directory + "%ExportBuildDirectory%/common/sfx/map", // Sfx directory + "%ExportBuildDirectory%/ecosystems/%EcosystemName%/shape", // Shape directory + "%ExportBuildDirectory%/ecosystems/%EcosystemName%/shape_with_coarse_mesh", // Shape directory + "%ExportBuildDirectory%/ecosystems/%EcosystemName%/map", // Map directory + "%ExportBuildDirectory%/continents/%ContinentName%/zone_light/water_shapes_lighted", // Water shape lighted directory + "%ExportBuildDirectory%/continents/%ContinentName%/ig_land", // Instance group directory + "%ExportBuildDirectory%/continents/%ContinentName%/ig_other", // Instance group directory + "%ExportBuildDirectory%/continents/%ContinentName%/shape", // Shape directory + "%ExportBuildDirectory%/continents/%ContinentName%/shape_with_coarse_mesh", // Shape directory + "%ExportBuildDirectory%/continents/%ContinentName%/map", // Map directory }; // Additional ig file name diff --git a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/properties_draft.cfg b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/properties_draft.cfg new file mode 100644 index 000000000..07fad2f60 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/properties_draft.cfg @@ -0,0 +1,93 @@ + +// Load instance group. 0 disable, 1 enable +load_ig = 0; + +// Use ig to compute dependencies 0 disable, 1 enable +compute_dependencies_with_igs = 0; + +// Enable shadows. 0 disable, 1 enable +shadow = 0; + +// Landscape ZBuffers size for all the landscape. There is one zbuffer like this one per softshadow sample. +zbuffer_landscape_size = 32768; + +// Object ZBuffers size for all the landscape. This zbuffer is typically finer. There is only one zbuffer like this. +zbuffer_object_size = 98304; + +// Square root of the number of soft shadow samples +soft_shadow_samples_sqrt = 4; + +// Soft shadow jitter (0 ~ 1) to smooth softshadow aliasing when sampling number is small +soft_shadow_jitter = 0.4; + +// Enable the sun contribution. 0 disable, 1 enable +sun_contribution = 1; + +// Enable the sky global illumaniation. 0 disable, 1 enable +sky_contribution = 0; + +// The sky global illumaniation intensity . [0 ~ 1] +sky_intensity = 0.20; + +// Accuracy of the sky global illumaniation algorithm in meter +global_illumination_cell_size = 5; + +// shadow bias for water surfaces +water_shadow_bias = 0.8; + +// ambient lighting for water. [0 ~ 1] +water_ambient = 0.3; + +// diffuse lighting for water. [0 ~ 1] +water_diffuse = 1.0; + +// true if the water color should be modulated with the source diffuse map +modulate_water_color = 0; + +// 1 if the water should receive sky lighting contribution +sky_contribution_for_water = 0; + +// Side length of landscape used to compute the sky global illumaniation in meter +global_illumination_length = 600; + +// Size of the quad grid side in meter. Should be a power of 2. (optimisation) +quad_grid_size = 512; + +// Size of a cell of the quad grid in meter. (optimisation) +quad_grid_cell_size = 1; + +// Number of CPU used to calculate the lightmaps. 0 for automatic detection. +cpu_num = 0; + +/// Evaluation the max vegetable height in meters. This is used to decide wether vegetable of a tile +/// are above, below, or intersect a water surface (rough approximation). +/// As a matter of fact, these flags are processed during hte lighting as well. +vegetable_height = 2; + + + + +// *************************** +// Ig Lighting. +// *************************** +// Ig lighting shares also above parameters: sun_direction, shadow, quad_grid_size, quad_grid_cell_size, shapes_path + + +// Oversampling value, must be 0 (disable), 2, 4, 8, 16 +// This apply to surface cells and instances. +ig_oversampling = 16; + + +// IG Surface Lighting (for ig_light process only) + +// If SurfaceLighting enabled, define size of a cell (in meters) in a surface. +cell_surface_light_size = 1.5; + +// If SurfaceLighting enabled, define a deltaZ before raytracing cellPos against lights. Usefull to skip shadow errors like stairs +cell_raytrace_delta_z = 0.2; + + +// Build debug surface shapes (slows the process) +build_debug_surface_shape= 0; + + diff --git a/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/properties_final.cfg b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/properties_final.cfg new file mode 100644 index 000000000..522c15d44 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/continents/newbieland/properties_final.cfg @@ -0,0 +1,93 @@ + +// Load instance group. 0 disable, 1 enable +load_ig = 1; + +// Use ig to compute dependencies 0 disable, 1 enable +compute_dependencies_with_igs = 1; + +// Enable shadows. 0 disable, 1 enable +shadow = 1; + +// Landscape ZBuffers size for all the landscape. There is one zbuffer like this one per softshadow sample. +zbuffer_landscape_size = 32768; + +// Object ZBuffers size for all the landscape. This zbuffer is typically finer. There is only one zbuffer like this. +zbuffer_object_size = 98304; + +// Square root of the number of soft shadow samples +soft_shadow_samples_sqrt = 4; + +// Soft shadow jitter (0 ~ 1) to smooth softshadow aliasing when sampling number is small +soft_shadow_jitter = 0.4; + +// Enable the sun contribution. 0 disable, 1 enable +sun_contribution = 1; + +// Enable the sky global illumaniation. 0 disable, 1 enable +sky_contribution = 1; + +// The sky global illumaniation intensity . [0 ~ 1] +sky_intensity = 0.20; + +// Accuracy of the sky global illumaniation algorithm in meter +global_illumination_cell_size = 5; + +// shadow bias for water surfaces +water_shadow_bias = 0.8; + +// ambient lighting for water. [0 ~ 1] +water_ambient = 0.3; + +// diffuse lighting for water. [0 ~ 1] +water_diffuse = 1.0; + +// true if the water color should be modulated with the source diffuse map +modulate_water_color = 0; + +// 1 if the water should receive sky lighting contribution +sky_contribution_for_water = 0; + +// Side length of landscape used to compute the sky global illumaniation in meter +global_illumination_length = 600; + +// Size of the quad grid side in meter. Should be a power of 2. (optimisation) +quad_grid_size = 64; + +// Size of a cell of the quad grid in meter. (optimisation) +quad_grid_cell_size = 2; + +// Number of CPU used to calculate the lightmaps. 0 for automatic detection. +cpu_num = 0; + +/// Evaluation the max vegetable height in meters. This is used to decide wether vegetable of a tile +/// are above, below, or intersect a water surface (rough approximation). +/// As a matter of fact, these flags are processed during hte lighting as well. +vegetable_height = 2; + + + + +// *************************** +// Ig Lighting. +// *************************** +// Ig lighting shares also above parameters: sun_direction, shadow, quad_grid_size, quad_grid_cell_size, shapes_path + + +// Oversampling value, must be 0 (disable), 2, 4, 8, 16 +// This apply to surface cells and instances. +ig_oversampling = 16; + + +// IG Surface Lighting (for ig_light process only) + +// If SurfaceLighting enabled, define size of a cell (in meters) in a surface. +cell_surface_light_size = 1.5; + +// If SurfaceLighting enabled, define a deltaZ before raytracing cellPos against lights. Usefull to skip shadow errors like stairs +cell_raytrace_delta_z = 0.2; + + +// Build debug surface shapes (slows the process) +build_debug_surface_shape= 0; + + diff --git a/code/ryzom/tools/build_gamedata/workspace/ecosystems/desert/directories.py b/code/ryzom/tools/build_gamedata/workspace/ecosystems/desert/directories.py new file mode 100644 index 000000000..9cc03f2b9 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/desert/directories.py @@ -0,0 +1,245 @@ +#!/usr/bin/python +# +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# +# \file directories.py +# \brief Directories configuration +# \date 2010-09-03-10-06-GMT +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration for 'desert' ecosystem. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + + +# *** ECOSYSTEM AND CONTINENT NAMES *** + +EcosystemName = "desert" +EcosystemPath = "ecosystems/" + EcosystemName +CommonName = EcosystemName +CommonPath = EcosystemPath + +DatabaseRootName = "fyros" +DatabaseRootPath = "stuff/" + DatabaseRootName + + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + +# Shape directories +ShapeSourceDirectories = [ ] +ShapeSourceDirectories += [ DatabaseRootPath + "/decors/vegetations" ] +ShapeSourceDirectories += [ "landscape/ligo/" + EcosystemName + "/max" ] + +# Maps directories +MapSourceDirectories = [ ] +MapSourceDirectories += [ DatabaseRootPath + "/decors/_textures" ] +MapSourceDirectories += [ DatabaseRootPath + "/decors/_textures/vegetations" ] +MapSourceDirectories += [ "landscape/microveget/" + EcosystemName + "" ] +MapSourceDirectories += [ "landscape/water/meshes/" + EcosystemName + "" ] + +MapUncompressedSourceDirectories = [ ] + +# Tiles directories +TilesSourceDirectories = [ ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/1.5-marecage_profond" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/1-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/2-citees" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/3-fond_canyon" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/4.2-boisbandeclair" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/4.5-desert2boisbande" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/4-falaise_bois_bande" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/5-falaise_normales" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/6.5-desertalternatif" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/6-desert" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/7-routes" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/8-foretbrule" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/1.5-marecage_profond" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/1-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/2-citees" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/3-fond_canyon" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/4.2-boisbandeclair" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/4.5-desert2boisbande" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/4-falaise_bois_bande" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/5-falaise_normales" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/6.5-desertalternatif" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/6-desert" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/7-routes" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/8-foretbrule" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/1.5-marecage_profond" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/1-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/2-citees" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/3-fond_canyon" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/4.2-boisbandeclair" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/4.5-desert2boisbande" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/4-falaise_bois_bande" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/5-falaise_normales" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/6.5-desertalternatif" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/6-desert" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/7-routes" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/8-foretbrule" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/1.5-marecage_profond" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/1-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/2-citees" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/3-fond_canyon" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/4.2-boisbandeclair" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/4.5-desert2boisbande" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/4-falaise_bois_bande" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/5-falaise_normales" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/6.5-desertalternatif" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/6-desert" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/7-routes" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/8-foretbrule" ] + +# Tiles root directory +TileRootSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + +# Displace directory +DisplaceSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + "/displace" + +# Do not use, needs to be removed and fixed in processes +DisplaceSourceDirectories = [ ] +DisplaceSourceDirectories += [ DisplaceSourceDirectory ] + +# Bank directory +BankSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + +# Vegetable set directories +VegetSetSourceDirectories = [ ] +VegetSetSourceDirectories += [ "landscape/microveget/" + EcosystemName ] + +# Veget directories +VegetSourceDirectories = [ ] +VegetSourceDirectories += [ "landscape/microveget/" + EcosystemName ] + +# Ligo directories +LigoBaseSourceDirectory = "landscape/ligo/" + EcosystemName +LigoMaxSourceDirectory = LigoBaseSourceDirectory + "/max" + +# Zone directories +ZoneSourceDirectory = [ "landscape/zones/" + EcosystemName ] # For old snowballs style landscape when not using ligo + +# Ig landscape directories +IgLandSourceDirectory = "_invalid" + +# Ig other directories +IgOtherSourceDirectory = "_invalid" + +# PACS primitives directories +PacsPrimSourceDirectories = [ ] +PacsPrimSourceDirectories += [ DatabaseRootPath + "/decors/vegetations" ] + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Shape directories +ShapeTagExportDirectory = CommonPath + "/shape_tag" +ShapeNotOptimizedExportDirectory = CommonPath + "/shape_not_optimized" +ShapeWithCoarseMeshExportDirectory = CommonPath + "/shape_with_coarse_mesh" +ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_optimized" +ShapeAnimExportDirectory = CommonPath + "/shape_anim" + +# Smallbank directories +SmallbankExportDirectory = CommonPath + "/smallbank" + +# Tiles directories +TilesExportDirectory = CommonPath + "/tiles" + +# Tiles directories +DisplaceExportDirectory = CommonPath + "/diplace" + +# Veget directories +VegetExportDirectory = CommonPath + "/veget" +VegetTagExportDirectory = CommonPath + "/veget_tag" + +# Veget Set directories +VegetSetExportDirectory = CommonPath + "/veget_set" + +# Ligo directories +LigoDatabaseExportDirectory = "landscape/ligo/" + EcosystemName +LigoDatabaseIgExportDirectory = LigoDatabaseExportDirectory + "/igs" +LigoDatabaseZoneExportDirectory = LigoDatabaseExportDirectory + "/zones" +LigoDatabaseZoneLigoExportDirectory = LigoDatabaseExportDirectory + "/zoneligos" +LigoDatabaseCmbExportDirectory = LigoDatabaseExportDirectory + "/cmb" +LigoTagExportDirectory = CommonPath + "/ligo_tag" + +# Zone directories +ZoneExportDirectory = CommonPath + "/zone" + +# PACS primitives directories +PacsPrimExportDirectory = CommonPath + "/pacs_prim" + + +# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** + +# Map directories +MapBuildDirectory = CommonPath + "/map" +MapPanoplyBuildDirectory = CommonPath + "/map_panoply" + +# Shape directories +ShapeClodtexBuildDirectory = CommonPath + "/shape_clodtex_build" +ShapeWithCoarseMeshBuildDirectory = CommonPath + "/shape_with_coarse_mesh_builded" +ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" +ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" + +# Farbank directories +FarbankBuildDirectory = CommonPath + "/farbank" + +# Ig directories ************** TODO CONFIRM IN IG BUILD PROCESS ************ FIX RBANK IF NEEDED *********** +IgLandBuildDirectory = "_invalid" +IgOtherBuildDirectory = "_invalid" + +# Rbank directories +RbankOutputBuildDirectory = "_invalid" +RbankMeshBuildDirectory = "_invalid" + +# Ligo directories + + +# *** INSTALL DIRECTORIES IN THE CLIENT DATA *** + +# Map directory +MapClientDirectory = CommonName + "_maps" +BitmapClientDirectory = MapClientDirectory + +# Shape directory +ShapeClientDirectory = CommonName + "_shapes" + +# Lightmap directory +LightmapClientDirectory = CommonName + "_lightmaps" + +# Tile directory +TilesClientDirectory = CommonName + "_tiles" + +# Displace directory +DisplaceClientDirectory = CommonName + "_displaces" + +# Bank directory +BankClientDirectory = CommonName + "_bank" + +# Vegetable set directory +VegetSetClientDirectory = CommonName + "_vegetable_sets" + +# Vegetable shape directory +VegetClientDirectory = CommonName + "_vegetables" + +# PACS primitives directories +PacsPrimClientDirectory = CommonName + "_pacs_prim" diff --git a/code/ryzom/tools/build_gamedata/workspace/ecosystems/desert/process.py b/code/ryzom/tools/build_gamedata/workspace/ecosystems/desert/process.py new file mode 100644 index 000000000..12104fead --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/desert/process.py @@ -0,0 +1,128 @@ +#!/usr/bin/python +# +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# +# \file config.py +# \brief Process configuration +# \date 2010-09-03-10-06-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration for 'desert' ecosystem. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** PROCESS CONFIGURATION *** + +# *** PROCESS CONFIG *** +ProcessToComplete = [ ] +ProcessToComplete += [ "shape" ] +ProcessToComplete += [ "map" ] +ProcessToComplete += [ "smallbank" ] +ProcessToComplete += [ "farbank" ] +ProcessToComplete += [ "tiles" ] +ProcessToComplete += [ "displace" ] +ProcessToComplete += [ "veget" ] +ProcessToComplete += [ "vegetset" ] +ProcessToComplete += [ "ligo" ] +ProcessToComplete += [ "pacs_prim" ] + + +# *** ECOSYSTEM AND CONTINENT NAMES *** + +EcosystemName = "desert" +EcosystemPath = "ecosystems/" + EcosystemName +CommonName = EcosystemName +CommonPath = EcosystemPath + + +# *** MAP EXPORT OPTIONS *** +PanoplyFileList = [ ] +HlsBankFileName = "" + +# *** SHAPE EXPORT OPTIONS *** + +# Compute lightmaps ? +ShapeExportOptExportLighting = "true" + +# Cast shadow in lightmap ? +ShapeExportOptShadow = "true" + +# Lighting limits. 0 : normal, 1 : soft shadows +ShapeExportOptLightingLimit = 1 + +# Lightmap lumel size +ShapeExportOptLumelSize = "0.25" + +# Oversampling value. Can be 1, 2, 4 or 8 +ShapeExportOptOversampling = 1 + +# Does the lightmap must be generated in 8 bits format ? +ShapeExportOpt8BitsLightmap = "true" + +# Does the lightmaps export must generate logs ? +ShapeExportOptLightmapLog = "true" + +# Coarse mesh texture mul size +TextureMulSizeValue = "1.5" + +DoBuildShadowSkin = 0 + +ClodConfigFile = "" + +# *** COARSE MESH TEXTURE NAME *** +CoarseMeshTextureNames = [ ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_sp" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_su" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_au" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_wi" ] + +# *** POSTFIX USED BY THE MULTIPLE TILES SYSTEM *** +MultipleTilesPostfix = [ ] +MultipleTilesPostfix += [ "_sp" ] +MultipleTilesPostfix += [ "_su" ] +MultipleTilesPostfix += [ "_au" ] +MultipleTilesPostfix += [ "_wi" ] + +# *** BANK EXPORT OPTIONS *** + +# Name of the tilebank to use +BankTileBankName = EcosystemName + +# *** RBANK EXPORT OPTIONS *** + +# Output names +RbankRbankName = "_invalid" + +# *** LIGO OPTIONS *** + +LigoExportLand = "" +LigoExportOnePass = 0 + +# *** MAPS OPTIONS *** + +ReduceBitmapFactor = 0 + +# *** SHAPE BUILD OPTIONS * + +DoBuildShadowSkin = False +ClodConfigFile = "" + +# *** PACS_PRIM OPTIONS *** +WantLandscapeColPrimPacsList = True diff --git a/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/directories.py b/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/directories.py index f18db50b5..1916e5013 100644 --- a/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/directories.py +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/directories.py @@ -1,13 +1,17 @@ #!/usr/bin/python # +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# # \file directories.py # \brief Directories configuration -# \date 2010-05-24 06:34GMT +# \date 2010-09-03-10-06-GMT # \author Jan Boon (Kaetemi) # \date 2001-2005 # \author Nevrax # Python port of game data build pipeline. -# Directories configuration. +# Directories configuration for 'jungle' ecosystem. # # NeL - MMORPG Framework # Copyright (C) 2010 Winch Gate Property Limited @@ -26,21 +30,29 @@ # along with this program. If not, see . # -# *** SOURCE DIRECTORIES IN THE DATABASE *** +# *** ECOSYSTEM AND CONTINENT NAMES *** -# *** ECOSYSTEM NAME *** EcosystemName = "jungle" EcosystemPath = "ecosystems/" + EcosystemName +CommonName = EcosystemName +CommonPath = EcosystemPath + +DatabaseRootName = "jungle" +DatabaseRootPath = "stuff/" + DatabaseRootName + + +# *** SOURCE DIRECTORIES IN THE DATABASE *** # Shape directories ShapeSourceDirectories = [ ] -ShapeSourceDirectories += [ "stuff/" + EcosystemName + "/decors/vegetations" ] +ShapeSourceDirectories += [ DatabaseRootPath + "/decors/vegetations" ] ShapeSourceDirectories += [ "landscape/ligo/" + EcosystemName + "/max" ] # Maps directories MapSourceDirectories = [ ] -MapSourceDirectories += [ "stuff/" + EcosystemName + "/decors/_textures/Vegetations" ] +MapSourceDirectories += [ DatabaseRootPath + "/decors/_textures" ] +MapSourceDirectories += [ DatabaseRootPath + "/decors/_textures/vegetations" ] MapSourceDirectories += [ "landscape/microveget/" + EcosystemName + "" ] MapSourceDirectories += [ "landscape/water/meshes/" + EcosystemName + "" ] @@ -48,7 +60,9 @@ MapUncompressedSourceDirectories = [ ] # Tiles directories TilesSourceDirectories = [ ] - +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/10-crevassejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/11-paroisjungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/12-vasejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/1-junglemousse" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/2-junglefeuilles" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/3-jungleherbesseche" ] @@ -58,11 +72,10 @@ TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/6 TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/7-sciurejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/8-terrejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/9-falaisejungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/10-crevassejungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/11-paroisjungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/12-vasejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/Transitions" ] - +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/10-crevassejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/11-paroisjungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/12-vasejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/1-junglemousse" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/2-junglefeuilles" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/3-jungleherbesseche" ] @@ -72,11 +85,10 @@ TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/6 TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/7-sciurejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/8-terrejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/9-falaisejungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/10-crevassejungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/11-paroisjungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/12-vasejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/Transitions" ] - +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/10-crevassejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/11-paroisjungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/12-vasejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/1-junglemousse" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/2-junglefeuilles" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/3-jungleherbesseche" ] @@ -86,11 +98,10 @@ TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/6 TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/7-sciurejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/8-terrejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/9-falaisejungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/10-crevassejungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/11-paroisjungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/12-vasejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/Transitions" ] - +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/10-crevassejungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/11-paroisjungle" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/12-vasejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/1-junglemousse" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/2-junglefeuilles" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/3-jungleherbesseche" ] @@ -100,9 +111,6 @@ TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/6 TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/7-sciurejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/8-terrejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/9-falaisejungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/10-crevassejungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/11-paroisjungle" ] -TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/12-vasejungle" ] TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/Transitions" ] # Tiles root directory @@ -131,7 +139,7 @@ LigoBaseSourceDirectory = "landscape/ligo/" + EcosystemName LigoMaxSourceDirectory = LigoBaseSourceDirectory + "/max" # Zone directories -ZoneSourceDirectory = "landscape/zones/" + EcosystemName +ZoneSourceDirectory = [ "landscape/zones/" + EcosystemName ] # For old snowballs style landscape when not using ligo # Ig landscape directories IgLandSourceDirectory = "_invalid" @@ -141,33 +149,33 @@ IgOtherSourceDirectory = "_invalid" # PACS primitives directories PacsPrimSourceDirectories = [ ] -PacsPrimSourceDirectories += [ "stuff/" + EcosystemName + "/decors/vegetations" ] +PacsPrimSourceDirectories += [ DatabaseRootPath + "/decors/vegetations" ] # *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** # Shape directories -ShapeTagExportDirectory = "ecosystems/" + EcosystemName + "/shape_tag" -ShapeExportDirectory = "ecosystems/" + EcosystemName + "/shape" -ShapeWithCoarseMeshExportDirectory = "ecosystems/" + EcosystemName + "/shape_with_coarse_mesh" -ShapeLightmapNotOptimizedExportDirectory = "ecosystems/" + EcosystemName + "/shape_lightmap_not_optimized" -ShapeAnimExportDirectory = "ecosystems/" + EcosystemName + "/shape_anim" +ShapeTagExportDirectory = CommonPath + "/shape_tag" +ShapeNotOptimizedExportDirectory = CommonPath + "/shape_not_optimized" +ShapeWithCoarseMeshExportDirectory = CommonPath + "/shape_with_coarse_mesh" +ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_optimized" +ShapeAnimExportDirectory = CommonPath + "/shape_anim" # Smallbank directories -SmallbankExportDirectory = "ecosystems/" + EcosystemName + "/smallbank" +SmallbankExportDirectory = CommonPath + "/smallbank" # Tiles directories -TilesExportDirectory = "ecosystems/" + EcosystemName + "/tiles" +TilesExportDirectory = CommonPath + "/tiles" # Tiles directories -DisplaceExportDirectory = "ecosystems/" + EcosystemName + "/diplace" +DisplaceExportDirectory = CommonPath + "/diplace" # Veget directories -VegetExportDirectory = "ecosystems/" + EcosystemName + "/veget" -VegetTagExportDirectory = "ecosystems/" + EcosystemName + "/veget_tag" +VegetExportDirectory = CommonPath + "/veget" +VegetTagExportDirectory = CommonPath + "/veget_tag" # Veget Set directories -VegetSetExportDirectory = "ecosystems/" + EcosystemName + "/veget_set" +VegetSetExportDirectory = CommonPath + "/veget_set" # Ligo directories LigoDatabaseExportDirectory = "landscape/ligo/" + EcosystemName @@ -175,23 +183,29 @@ LigoDatabaseIgExportDirectory = LigoDatabaseExportDirectory + "/igs" LigoDatabaseZoneExportDirectory = LigoDatabaseExportDirectory + "/zones" LigoDatabaseZoneLigoExportDirectory = LigoDatabaseExportDirectory + "/zoneligos" LigoDatabaseCmbExportDirectory = LigoDatabaseExportDirectory + "/cmb" -LigoTagExportDirectory = "ecosystems/" + EcosystemName + "/ligo_tag" +LigoTagExportDirectory = CommonPath + "/ligo_tag" # Zone directories -ZoneExportDirectory = "ecosystems/" + EcosystemName + "/zone" +ZoneExportDirectory = CommonPath + "/zone" + +# PACS primitives directories +PacsPrimExportDirectory = CommonPath + "/pacs_prim" # *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** # Map directories -MapBuildDirectory = "ecosystems/" + EcosystemName + "/map" -MapPanoplyBuildDirectory = "ecosystems/" + EcosystemName + "/map_panoply" +MapBuildDirectory = CommonPath + "/map" +MapPanoplyBuildDirectory = CommonPath + "/map_panoply" # Shape directories -ShapeWithCoarseMeshBuildDirectory = "ecosystems/" + EcosystemName + "/shape_with_coarse_mesh_builded" +ShapeClodtexBuildDirectory = CommonPath + "/shape_clodtex_build" +ShapeWithCoarseMeshBuildDirectory = CommonPath + "/shape_with_coarse_mesh_builded" +ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" +ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" # Farbank directories -FarbankBuildDirectory = "ecosystems/" + EcosystemName + "/farbank" +FarbankBuildDirectory = CommonPath + "/farbank" # Ig directories ************** TODO CONFIRM IN IG BUILD PROCESS ************ FIX RBANK IF NEEDED *********** IgLandBuildDirectory = "_invalid" @@ -206,44 +220,30 @@ RbankMeshBuildDirectory = "_invalid" # *** INSTALL DIRECTORIES IN THE CLIENT DATA *** -# Client directories -ClientSetupDirectories = [ ] -ClientSetupDirectories += [ "jungle_shapes" ] -ClientSetupDirectories += [ "jungle_maps" ] -ClientSetupDirectories += [ "jungle_tiles" ] -ClientSetupDirectories += [ "jungle_displaces" ] -ClientSetupDirectories += [ "jungle_bank" ] -ClientSetupDirectories += [ "jungle_vegetables" ] -ClientSetupDirectories += [ "jungle_vegetable_sets" ] -ClientSetupDirectories += [ "jungle_pacs_prim" ] -ClientSetupDirectories += [ "jungle_lightmaps" ] - -# Shape directory -MapClientDirectory = "jungle_maps" - -# Shape directory -ShapeClientDirectory = "jungle_shapes" - # Map directory -BitmapClientDirectory = "jungle_maps" +MapClientDirectory = CommonName + "_maps" +BitmapClientDirectory = MapClientDirectory + +# Shape directory +ShapeClientDirectory = CommonName + "_shapes" # Lightmap directory -LightmapClientDirectory = "jungle_lightmaps" +LightmapClientDirectory = CommonName + "_lightmaps" # Tile directory -TilesClientDirectory = "jungle_tiles" +TilesClientDirectory = CommonName + "_tiles" # Displace directory -DisplaceClientDirectory = "jungle_displaces" +DisplaceClientDirectory = CommonName + "_displaces" # Bank directory -BankClientDirectory = "jungle_bank" +BankClientDirectory = CommonName + "_bank" # Vegetable set directory -VegetSetClientDirectory = "jungle_vegetable_sets" +VegetSetClientDirectory = CommonName + "_vegetable_sets" # Vegetable shape directory -VegetClientDirectory = "jungle_vegetables" +VegetClientDirectory = CommonName + "_vegetables" # PACS primitives directories -PacsPrimitiveClientDirectory = "jungle_pacs_prim" +PacsPrimClientDirectory = CommonName + "_pacs_prim" diff --git a/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/process.py b/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/process.py index ddd54fadf..ca70a8a59 100644 --- a/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/process.py +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/jungle/process.py @@ -1,11 +1,15 @@ #!/usr/bin/python # +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# # \file config.py # \brief Process configuration -# \date 2010-05-24 06:30GMT +# \date 2010-09-03-10-06-GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. -# Process configuration. +# Process configuration for 'jungle' ecosystem. # # NeL - MMORPG Framework # Copyright (C) 2010 Winch Gate Property Limited @@ -28,16 +32,25 @@ # *** PROCESS CONFIG *** ProcessToComplete = [ ] -ProcessToComplete += [ "shape" ] # not fully implemented, but works for this process -ProcessToComplete += [ "map" ] # not fully implemented, but works for this process -ProcessToComplete += [ "smallbank" ] # OK -ProcessToComplete += [ "farbank" ] # OK -ProcessToComplete += [ "tiles" ] # OK -ProcessToComplete += [ "displace" ] # OK -ProcessToComplete += [ "veget" ] # OK -ProcessToComplete += [ "vegetset" ] # OK -ProcessToComplete += [ "ligo" ] # not fully implemented, works for this process, but does not export max files -##ProcessToComplete += [ "pacs_prim" ] +ProcessToComplete += [ "shape" ] +ProcessToComplete += [ "map" ] +ProcessToComplete += [ "smallbank" ] +ProcessToComplete += [ "farbank" ] +ProcessToComplete += [ "tiles" ] +ProcessToComplete += [ "displace" ] +ProcessToComplete += [ "veget" ] +ProcessToComplete += [ "vegetset" ] +ProcessToComplete += [ "ligo" ] +ProcessToComplete += [ "pacs_prim" ] + + +# *** ECOSYSTEM AND CONTINENT NAMES *** + +EcosystemName = "jungle" +EcosystemPath = "ecosystems/" + EcosystemName +CommonName = EcosystemName +CommonPath = EcosystemPath + # *** MAP EXPORT OPTIONS *** PanoplyFileList = [ ] @@ -52,7 +65,7 @@ ShapeExportOptExportLighting = "true" ShapeExportOptShadow = "true" # Lighting limits. 0 : normal, 1 : soft shadows -ShapeExportOptLightingLimit = 0 +ShapeExportOptLightingLimit = 1 # Lightmap lumel size ShapeExportOptLumelSize = "0.25" @@ -64,17 +77,21 @@ ShapeExportOptOversampling = 1 ShapeExportOpt8BitsLightmap = "false" # Does the lightmaps export must generate logs ? -ShapeExportOptLightmapLog = "false" +ShapeExportOptLightmapLog = "true" # Coarse mesh texture mul size TextureMulSizeValue = "1.5" +DoBuildShadowSkin = 0 + +ClodConfigFile = "" + # *** COARSE MESH TEXTURE NAME *** CoarseMeshTextureNames = [ ] -CoarseMeshTextureNames += [ "nel_coarse_mesh_jungle_sp" ] -CoarseMeshTextureNames += [ "nel_coarse_mesh_jungle_su" ] -CoarseMeshTextureNames += [ "nel_coarse_mesh_jungle_au" ] -CoarseMeshTextureNames += [ "nel_coarse_mesh_jungle_wi" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_sp" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_su" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_au" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_wi" ] # *** POSTFIX USED BY THE MULTIPLE TILES SYSTEM *** MultipleTilesPostfix = [ ] @@ -86,7 +103,7 @@ MultipleTilesPostfix += [ "_wi" ] # *** BANK EXPORT OPTIONS *** # Name of the tilebank to use -BankTileBankName = "jungle" +BankTileBankName = EcosystemName # *** RBANK EXPORT OPTIONS *** @@ -106,3 +123,6 @@ ReduceBitmapFactor = 0 DoBuildShadowSkin = False ClodConfigFile = "" + +# *** PACS_PRIM OPTIONS *** +WantLandscapeColPrimPacsList = True diff --git a/code/ryzom/tools/build_gamedata/workspace/ecosystems/lacustre/directories.py b/code/ryzom/tools/build_gamedata/workspace/ecosystems/lacustre/directories.py new file mode 100644 index 000000000..e48979a8c --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/lacustre/directories.py @@ -0,0 +1,257 @@ +#!/usr/bin/python +# +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# +# \file directories.py +# \brief Directories configuration +# \date 2010-09-03-10-06-GMT +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration for 'lacustre' ecosystem. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + + +# *** ECOSYSTEM AND CONTINENT NAMES *** + +EcosystemName = "lacustre" +EcosystemPath = "ecosystems/" + EcosystemName +CommonName = EcosystemName +CommonPath = EcosystemPath + +DatabaseRootName = "tryker" +DatabaseRootPath = "stuff/" + DatabaseRootName + + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + +# Shape directories +ShapeSourceDirectories = [ ] +ShapeSourceDirectories += [ DatabaseRootPath + "/decors/vegetations" ] +ShapeSourceDirectories += [ "landscape/ligo/" + EcosystemName + "/max" ] + +# Maps directories +MapSourceDirectories = [ ] +MapSourceDirectories += [ DatabaseRootPath + "/decors/_textures" ] +MapSourceDirectories += [ DatabaseRootPath + "/decors/_textures/vegetations" ] +MapSourceDirectories += [ "landscape/microveget/" + EcosystemName + "" ] +MapSourceDirectories += [ "landscape/water/meshes/" + EcosystemName + "" ] + +MapUncompressedSourceDirectories = [ ] + +# Tiles directories +TilesSourceDirectories = [ ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/1a-sable-marin" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/1-plages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/2-iles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/2-ilesa" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/2-iles-marines" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/3-fondmarin2plage" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/4-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/5-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/5-parois-marine" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/6-fond_marin" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/7-bassesiles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/7-mousseter" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/7-racines" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/8-mousse_marine" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/constructible" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/1a-sable-marin" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/1-plages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/2-iles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/2-ilesa" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/2-iles-marines" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/3-fondmarin2plage" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/4-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/5-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/5-parois-marine" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/6-fond_marin" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/7-bassesiles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/7-mousseter" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/7-racines" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/8-mousse_marine" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/constructible" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/1a-sable-marin" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/1-plages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/2-iles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/2-ilesa" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/2-iles-marines" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/3-fondmarin2plage" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/4-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/5-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/5-parois-marine" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/6-fond_marin" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/7-bassesiles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/7-mousseter" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/7-racines" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/8-mousse_marine" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/constructible" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/1a-sable-marin" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/1-plages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/2-iles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/2-ilesa" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/2-iles-marines" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/3-fondmarin2plage" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/4-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/5-marecages" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/5-parois-marine" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/6-fond_marin" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/7-bassesiles" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/7-mousseter" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/7-racines" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/8-mousse_marine" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/constructible" ] + +# Tiles root directory +TileRootSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + +# Displace directory +DisplaceSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + "/displace" + +# Do not use, needs to be removed and fixed in processes +DisplaceSourceDirectories = [ ] +DisplaceSourceDirectories += [ DisplaceSourceDirectory ] + +# Bank directory +BankSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + +# Vegetable set directories +VegetSetSourceDirectories = [ ] +VegetSetSourceDirectories += [ "landscape/microveget/" + EcosystemName ] + +# Veget directories +VegetSourceDirectories = [ ] +VegetSourceDirectories += [ "landscape/microveget/" + EcosystemName ] + +# Ligo directories +LigoBaseSourceDirectory = "landscape/ligo/" + EcosystemName +LigoMaxSourceDirectory = LigoBaseSourceDirectory + "/max" + +# Zone directories +ZoneSourceDirectory = [ "landscape/zones/" + EcosystemName ] # For old snowballs style landscape when not using ligo + +# Ig landscape directories +IgLandSourceDirectory = "_invalid" + +# Ig other directories +IgOtherSourceDirectory = "_invalid" + +# PACS primitives directories +PacsPrimSourceDirectories = [ ] +PacsPrimSourceDirectories += [ DatabaseRootPath + "/decors/vegetations" ] + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Shape directories +ShapeTagExportDirectory = CommonPath + "/shape_tag" +ShapeNotOptimizedExportDirectory = CommonPath + "/shape_not_optimized" +ShapeWithCoarseMeshExportDirectory = CommonPath + "/shape_with_coarse_mesh" +ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_optimized" +ShapeAnimExportDirectory = CommonPath + "/shape_anim" + +# Smallbank directories +SmallbankExportDirectory = CommonPath + "/smallbank" + +# Tiles directories +TilesExportDirectory = CommonPath + "/tiles" + +# Tiles directories +DisplaceExportDirectory = CommonPath + "/diplace" + +# Veget directories +VegetExportDirectory = CommonPath + "/veget" +VegetTagExportDirectory = CommonPath + "/veget_tag" + +# Veget Set directories +VegetSetExportDirectory = CommonPath + "/veget_set" + +# Ligo directories +LigoDatabaseExportDirectory = "landscape/ligo/" + EcosystemName +LigoDatabaseIgExportDirectory = LigoDatabaseExportDirectory + "/igs" +LigoDatabaseZoneExportDirectory = LigoDatabaseExportDirectory + "/zones" +LigoDatabaseZoneLigoExportDirectory = LigoDatabaseExportDirectory + "/zoneligos" +LigoDatabaseCmbExportDirectory = LigoDatabaseExportDirectory + "/cmb" +LigoTagExportDirectory = CommonPath + "/ligo_tag" + +# Zone directories +ZoneExportDirectory = CommonPath + "/zone" + +# PACS primitives directories +PacsPrimExportDirectory = CommonPath + "/pacs_prim" + + +# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** + +# Map directories +MapBuildDirectory = CommonPath + "/map" +MapPanoplyBuildDirectory = CommonPath + "/map_panoply" + +# Shape directories +ShapeClodtexBuildDirectory = CommonPath + "/shape_clodtex_build" +ShapeWithCoarseMeshBuildDirectory = CommonPath + "/shape_with_coarse_mesh_builded" +ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" +ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" + +# Farbank directories +FarbankBuildDirectory = CommonPath + "/farbank" + +# Ig directories ************** TODO CONFIRM IN IG BUILD PROCESS ************ FIX RBANK IF NEEDED *********** +IgLandBuildDirectory = "_invalid" +IgOtherBuildDirectory = "_invalid" + +# Rbank directories +RbankOutputBuildDirectory = "_invalid" +RbankMeshBuildDirectory = "_invalid" + +# Ligo directories + + +# *** INSTALL DIRECTORIES IN THE CLIENT DATA *** + +# Map directory +MapClientDirectory = CommonName + "_maps" +BitmapClientDirectory = MapClientDirectory + +# Shape directory +ShapeClientDirectory = CommonName + "_shapes" + +# Lightmap directory +LightmapClientDirectory = CommonName + "_lightmaps" + +# Tile directory +TilesClientDirectory = CommonName + "_tiles" + +# Displace directory +DisplaceClientDirectory = CommonName + "_displaces" + +# Bank directory +BankClientDirectory = CommonName + "_bank" + +# Vegetable set directory +VegetSetClientDirectory = CommonName + "_vegetable_sets" + +# Vegetable shape directory +VegetClientDirectory = CommonName + "_vegetables" + +# PACS primitives directories +PacsPrimClientDirectory = CommonName + "_pacs_prim" diff --git a/code/ryzom/tools/build_gamedata/workspace/ecosystems/lacustre/process.py b/code/ryzom/tools/build_gamedata/workspace/ecosystems/lacustre/process.py new file mode 100644 index 000000000..93817c333 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/lacustre/process.py @@ -0,0 +1,128 @@ +#!/usr/bin/python +# +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# +# \file config.py +# \brief Process configuration +# \date 2010-09-03-10-06-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration for 'lacustre' ecosystem. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** PROCESS CONFIGURATION *** + +# *** PROCESS CONFIG *** +ProcessToComplete = [ ] +ProcessToComplete += [ "shape" ] +ProcessToComplete += [ "map" ] +ProcessToComplete += [ "smallbank" ] +ProcessToComplete += [ "farbank" ] +ProcessToComplete += [ "tiles" ] +ProcessToComplete += [ "displace" ] +ProcessToComplete += [ "veget" ] +ProcessToComplete += [ "vegetset" ] +ProcessToComplete += [ "ligo" ] +ProcessToComplete += [ "pacs_prim" ] + + +# *** ECOSYSTEM AND CONTINENT NAMES *** + +EcosystemName = "lacustre" +EcosystemPath = "ecosystems/" + EcosystemName +CommonName = EcosystemName +CommonPath = EcosystemPath + + +# *** MAP EXPORT OPTIONS *** +PanoplyFileList = [ ] +HlsBankFileName = "" + +# *** SHAPE EXPORT OPTIONS *** + +# Compute lightmaps ? +ShapeExportOptExportLighting = "true" + +# Cast shadow in lightmap ? +ShapeExportOptShadow = "true" + +# Lighting limits. 0 : normal, 1 : soft shadows +ShapeExportOptLightingLimit = 0 + +# Lightmap lumel size +ShapeExportOptLumelSize = "0.25" + +# Oversampling value. Can be 1, 2, 4 or 8 +ShapeExportOptOversampling = 8 + +# Does the lightmap must be generated in 8 bits format ? +ShapeExportOpt8BitsLightmap = "false" + +# Does the lightmaps export must generate logs ? +ShapeExportOptLightmapLog = "true" + +# Coarse mesh texture mul size +TextureMulSizeValue = "1.5" + +DoBuildShadowSkin = 0 + +ClodConfigFile = "" + +# *** COARSE MESH TEXTURE NAME *** +CoarseMeshTextureNames = [ ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_sp" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_su" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_au" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_wi" ] + +# *** POSTFIX USED BY THE MULTIPLE TILES SYSTEM *** +MultipleTilesPostfix = [ ] +MultipleTilesPostfix += [ "_sp" ] +MultipleTilesPostfix += [ "_su" ] +MultipleTilesPostfix += [ "_au" ] +MultipleTilesPostfix += [ "_wi" ] + +# *** BANK EXPORT OPTIONS *** + +# Name of the tilebank to use +BankTileBankName = EcosystemName + +# *** RBANK EXPORT OPTIONS *** + +# Output names +RbankRbankName = "_invalid" + +# *** LIGO OPTIONS *** + +LigoExportLand = "" +LigoExportOnePass = 0 + +# *** MAPS OPTIONS *** + +ReduceBitmapFactor = 0 + +# *** SHAPE BUILD OPTIONS * + +DoBuildShadowSkin = False +ClodConfigFile = "" + +# *** PACS_PRIM OPTIONS *** +WantLandscapeColPrimPacsList = True diff --git a/code/ryzom/tools/build_gamedata/workspace/ecosystems/primes_racines/directories.py b/code/ryzom/tools/build_gamedata/workspace/ecosystems/primes_racines/directories.py new file mode 100644 index 000000000..cebc4857a --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/primes_racines/directories.py @@ -0,0 +1,242 @@ +#!/usr/bin/python +# +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# +# \file directories.py +# \brief Directories configuration +# \date 2010-09-03-10-06-GMT +# \author Jan Boon (Kaetemi) +# \date 2001-2005 +# \author Nevrax +# Python port of game data build pipeline. +# Directories configuration for 'primes_racines' ecosystem. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + + +# *** ECOSYSTEM AND CONTINENT NAMES *** + +EcosystemName = "primes_racines" +EcosystemPath = "ecosystems/" + EcosystemName +CommonName = EcosystemName +CommonPath = EcosystemPath + +DatabaseRootName = "primes_racines" +DatabaseRootPath = "stuff/" + DatabaseRootName + + +# *** SOURCE DIRECTORIES IN THE DATABASE *** + +# Shape directories +ShapeSourceDirectories = [ ] +ShapeSourceDirectories += [ DatabaseRootPath + "/decors/vegetations" ] +ShapeSourceDirectories += [ "landscape/ligo/" + EcosystemName + "/max" ] + +# Maps directories +MapSourceDirectories = [ ] +MapSourceDirectories += [ DatabaseRootPath + "/decors/_textures" ] +MapSourceDirectories += [ DatabaseRootPath + "/decors/_textures/vegetations" ] +MapSourceDirectories += [ DatabaseRootPath + "/decors/_textures/batiments" ] +MapSourceDirectories += [ "landscape/microveget/" + EcosystemName + "" ] +MapSourceDirectories += [ "landscape/water/meshes/" + EcosystemName + "" ] + +MapUncompressedSourceDirectories = [ ] + +# Tiles directories +TilesSourceDirectories = [ ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/PR-creux" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/PR-dome-moussu" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/PR-kitiniere" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/PR-mousse-licken" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/PR-mousse-spongieus" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/PR-parois" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/PR-sol-mousse" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/PR-souche" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/PR-stalagmite" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/PR-terre" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_sp/aditif" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/PR-creux" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/PR-dome-moussu" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/PR-kitiniere" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/PR-mousse-licken" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/PR-mousse-spongieus" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/PR-parois" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/PR-sol-mousse" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/PR-souche" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/PR-stalagmite" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/PR-terre" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_su/aditif" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/PR-creux" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/PR-dome-moussu" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/PR-kitiniere" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/PR-mousse-licken" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/PR-mousse-spongieus" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/PR-parois" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/PR-sol-mousse" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/PR-souche" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/PR-stalagmite" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/PR-terre" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_au/aditif" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/PR-creux" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/PR-dome-moussu" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/PR-kitiniere" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/PR-mousse-licken" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/PR-mousse-spongieus" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/PR-parois" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/PR-sol-mousse" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/PR-souche" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/PR-stalagmite" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/PR-terre" ] +TilesSourceDirectories += [ "landscape/_texture_tiles/" + EcosystemName + "_wi/aditif" ] + +# Tiles root directory +TileRootSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + +# Displace directory +DisplaceSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + "/displace" + +# Do not use, needs to be removed and fixed in processes +DisplaceSourceDirectories = [ ] +DisplaceSourceDirectories += [ DisplaceSourceDirectory ] + +# Bank directory +BankSourceDirectory = "landscape/_texture_tiles/" + EcosystemName + +# Vegetable set directories +VegetSetSourceDirectories = [ ] +VegetSetSourceDirectories += [ "landscape/microveget/" + EcosystemName ] + +# Veget directories +VegetSourceDirectories = [ ] +VegetSourceDirectories += [ "landscape/microveget/" + EcosystemName ] + +# Ligo directories +LigoBaseSourceDirectory = "landscape/ligo/" + EcosystemName +LigoMaxSourceDirectory = LigoBaseSourceDirectory + "/max" + +# Zone directories +ZoneSourceDirectory = [ "landscape/zones/" + EcosystemName ] # For old snowballs style landscape when not using ligo + +# Ig landscape directories +IgLandSourceDirectory = "_invalid" + +# Ig other directories +IgOtherSourceDirectory = "_invalid" + +# PACS primitives directories +PacsPrimSourceDirectories = [ ] +PacsPrimSourceDirectories += [ DatabaseRootPath + "/decors/vegetations" ] + + +# *** EXPORT DIRECTORIES FOR THE BUILD PIPELINE *** + +# Shape directories +ShapeTagExportDirectory = CommonPath + "/shape_tag" +ShapeNotOptimizedExportDirectory = CommonPath + "/shape_not_optimized" +ShapeWithCoarseMeshExportDirectory = CommonPath + "/shape_with_coarse_mesh" +ShapeLightmapNotOptimizedExportDirectory = CommonPath + "/shape_lightmap_not_optimized" +ShapeAnimExportDirectory = CommonPath + "/shape_anim" + +# Smallbank directories +SmallbankExportDirectory = CommonPath + "/smallbank" + +# Tiles directories +TilesExportDirectory = CommonPath + "/tiles" + +# Tiles directories +DisplaceExportDirectory = CommonPath + "/diplace" + +# Veget directories +VegetExportDirectory = CommonPath + "/veget" +VegetTagExportDirectory = CommonPath + "/veget_tag" + +# Veget Set directories +VegetSetExportDirectory = CommonPath + "/veget_set" + +# Ligo directories +LigoDatabaseExportDirectory = "landscape/ligo/" + EcosystemName +LigoDatabaseIgExportDirectory = LigoDatabaseExportDirectory + "/igs" +LigoDatabaseZoneExportDirectory = LigoDatabaseExportDirectory + "/zones" +LigoDatabaseZoneLigoExportDirectory = LigoDatabaseExportDirectory + "/zoneligos" +LigoDatabaseCmbExportDirectory = LigoDatabaseExportDirectory + "/cmb" +LigoTagExportDirectory = CommonPath + "/ligo_tag" + +# Zone directories +ZoneExportDirectory = CommonPath + "/zone" + +# PACS primitives directories +PacsPrimExportDirectory = CommonPath + "/pacs_prim" + + +# *** BUILD DIRECTORIES FOR THE BUILD PIPELINE *** + +# Map directories +MapBuildDirectory = CommonPath + "/map" +MapPanoplyBuildDirectory = CommonPath + "/map_panoply" + +# Shape directories +ShapeClodtexBuildDirectory = CommonPath + "/shape_clodtex_build" +ShapeWithCoarseMeshBuildDirectory = CommonPath + "/shape_with_coarse_mesh_builded" +ShapeLightmapBuildDirectory = CommonPath + "/shape_lightmap" +ShapeLightmap16BitsBuildDirectory = CommonPath + "/shape_lightmap_16_bits" + +# Farbank directories +FarbankBuildDirectory = CommonPath + "/farbank" + +# Ig directories ************** TODO CONFIRM IN IG BUILD PROCESS ************ FIX RBANK IF NEEDED *********** +IgLandBuildDirectory = "_invalid" +IgOtherBuildDirectory = "_invalid" + +# Rbank directories +RbankOutputBuildDirectory = "_invalid" +RbankMeshBuildDirectory = "_invalid" + +# Ligo directories + + +# *** INSTALL DIRECTORIES IN THE CLIENT DATA *** + +# Map directory +MapClientDirectory = CommonName + "_maps" +BitmapClientDirectory = MapClientDirectory + +# Shape directory +ShapeClientDirectory = CommonName + "_shapes" + +# Lightmap directory +LightmapClientDirectory = CommonName + "_lightmaps" + +# Tile directory +TilesClientDirectory = CommonName + "_tiles" + +# Displace directory +DisplaceClientDirectory = CommonName + "_displaces" + +# Bank directory +BankClientDirectory = CommonName + "_bank" + +# Vegetable set directory +VegetSetClientDirectory = CommonName + "_vegetable_sets" + +# Vegetable shape directory +VegetClientDirectory = CommonName + "_vegetables" + +# PACS primitives directories +PacsPrimClientDirectory = CommonName + "_pacs_prim" diff --git a/code/ryzom/tools/build_gamedata/workspace/ecosystems/primes_racines/process.py b/code/ryzom/tools/build_gamedata/workspace/ecosystems/primes_racines/process.py new file mode 100644 index 000000000..b49eec027 --- /dev/null +++ b/code/ryzom/tools/build_gamedata/workspace/ecosystems/primes_racines/process.py @@ -0,0 +1,128 @@ +#!/usr/bin/python +# +# ################################################################# +# ## WARNING : this is a generated file, don't change it ! +# ################################################################# +# +# \file config.py +# \brief Process configuration +# \date 2010-09-03-10-06-GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Process configuration for 'primes_racines' ecosystem. +# +# NeL - MMORPG Framework +# Copyright (C) 2010 Winch Gate Property Limited +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +# *** PROCESS CONFIGURATION *** + +# *** PROCESS CONFIG *** +ProcessToComplete = [ ] +ProcessToComplete += [ "shape" ] +ProcessToComplete += [ "map" ] +ProcessToComplete += [ "smallbank" ] +ProcessToComplete += [ "farbank" ] +ProcessToComplete += [ "tiles" ] +ProcessToComplete += [ "displace" ] +ProcessToComplete += [ "veget" ] +ProcessToComplete += [ "vegetset" ] +ProcessToComplete += [ "ligo" ] +ProcessToComplete += [ "pacs_prim" ] + + +# *** ECOSYSTEM AND CONTINENT NAMES *** + +EcosystemName = "primes_racines" +EcosystemPath = "ecosystems/" + EcosystemName +CommonName = EcosystemName +CommonPath = EcosystemPath + + +# *** MAP EXPORT OPTIONS *** +PanoplyFileList = [ ] +HlsBankFileName = "" + +# *** SHAPE EXPORT OPTIONS *** + +# Compute lightmaps ? +ShapeExportOptExportLighting = "true" + +# Cast shadow in lightmap ? +ShapeExportOptShadow = "true" + +# Lighting limits. 0 : normal, 1 : soft shadows +ShapeExportOptLightingLimit = 1 + +# Lightmap lumel size +ShapeExportOptLumelSize = "0.25" + +# Oversampling value. Can be 1, 2, 4 or 8 +ShapeExportOptOversampling = 1 + +# Does the lightmap must be generated in 8 bits format ? +ShapeExportOpt8BitsLightmap = "false" + +# Does the lightmaps export must generate logs ? +ShapeExportOptLightmapLog = "true" + +# Coarse mesh texture mul size +TextureMulSizeValue = "1.5" + +DoBuildShadowSkin = 0 + +ClodConfigFile = "" + +# *** COARSE MESH TEXTURE NAME *** +CoarseMeshTextureNames = [ ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_sp" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_su" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_au" ] +CoarseMeshTextureNames += [ "nel_coarse_mesh_" + EcosystemName + "_wi" ] + +# *** POSTFIX USED BY THE MULTIPLE TILES SYSTEM *** +MultipleTilesPostfix = [ ] +MultipleTilesPostfix += [ "_sp" ] +MultipleTilesPostfix += [ "_su" ] +MultipleTilesPostfix += [ "_au" ] +MultipleTilesPostfix += [ "_wi" ] + +# *** BANK EXPORT OPTIONS *** + +# Name of the tilebank to use +BankTileBankName = EcosystemName + +# *** RBANK EXPORT OPTIONS *** + +# Output names +RbankRbankName = "_invalid" + +# *** LIGO OPTIONS *** + +LigoExportLand = "" +LigoExportOnePass = 0 + +# *** MAPS OPTIONS *** + +ReduceBitmapFactor = 0 + +# *** SHAPE BUILD OPTIONS * + +DoBuildShadowSkin = False +ClodConfigFile = "" + +# *** PACS_PRIM OPTIONS *** +WantLandscapeColPrimPacsList = True diff --git a/code/ryzom/tools/build_gamedata/workspace/projects.py b/code/ryzom/tools/build_gamedata/workspace/projects.py index 035f43900..a83f27f3b 100644 --- a/code/ryzom/tools/build_gamedata/workspace/projects.py +++ b/code/ryzom/tools/build_gamedata/workspace/projects.py @@ -26,8 +26,33 @@ ProjectsToProcess = [ ] + +# Common projects +ProjectsToProcess += [ "common/fonts" ] +ProjectsToProcess += [ "common/interface" ] +ProjectsToProcess += [ "common/objects" ] +ProjectsToProcess += [ "common/sfx" ] +ProjectsToProcess += [ "common/fauna" ] + +# Ecosystem projects +ProjectsToProcess += [ "ecosystems/desert" ] ProjectsToProcess += [ "ecosystems/jungle" ] +ProjectsToProcess += [ "ecosystems/primes_racines" ] +ProjectsToProcess += [ "ecosystems/lacustre" ] + +# Continent projects ProjectsToProcess += [ "continents/newbieland" ] +# Common projects depending on continent projects +ProjectsToProcess += [ "common/construction" ] # Depends on jungle/newbieland due to ig_light tool usage of properties.cfg... +ProjectsToProcess += [ "common/outgame" ] # Depends on jungle/newbieland due to ig_light tool usage of properties.cfg... +ProjectsToProcess += [ "common/sky" ] # Depends on jungle/newbieland due to ig_light tool usage of properties.cfg... + +# TODO +#ProjectsToProcess += [ "common/characters" ] # TODO +#ProjectsToProcess += [ "common/characters_maps_hr" ] # TODO +#ProjectsToProcess += [ "common/characters_maps_lr" ] # TODO +#ProjectsToProcess += [ "continents/indoors" ] # TODO + # end of file diff --git a/code/ryzom/tools/client/client_config/cfg_file.cpp b/code/ryzom/tools/client/client_config/cfg_file.cpp index 1af5083e1..6c7e13768 100644 --- a/code/ryzom/tools/client/client_config/cfg_file.cpp +++ b/code/ryzom/tools/client/client_config/cfg_file.cpp @@ -97,7 +97,7 @@ bool GetBool (const char *var) // Available ? if (variable) { - string _bool = strlwr (variable->asString ()); + string _bool = toLower (variable->asString ()); if (_bool == "true") return true; if (_bool == "false") diff --git a/code/ryzom/tools/client/client_config/display_dlg.cpp b/code/ryzom/tools/client/client_config/display_dlg.cpp index b5c15210b..3379d9d71 100644 --- a/code/ryzom/tools/client/client_config/display_dlg.cpp +++ b/code/ryzom/tools/client/client_config/display_dlg.cpp @@ -495,8 +495,7 @@ CDisplayDlg::TDriver CDisplayDlg::getActualDriver() const std::string deviceName; uint64 drvVersion; CSystemInfo::getVideoInfo(deviceName, drvVersion); - strlwr(deviceName); - return strstr(deviceName.c_str(), "radeon") != NULL ? Direct3D : OpenGL; + return strstr(toLower(deviceName).c_str(), "radeon") != NULL ? Direct3D : OpenGL; } } return OpenGL; diff --git a/code/ryzom/tools/client/client_patcher/main.cpp b/code/ryzom/tools/client/client_patcher/main.cpp index 23e2c9420..9f4e8c166 100644 --- a/code/ryzom/tools/client/client_patcher/main.cpp +++ b/code/ryzom/tools/client/client_patcher/main.cpp @@ -82,13 +82,32 @@ void printDownload(const std::string &str) static const uint maxLength = 160; static char spaces[maxLength]; + + uint length = 0; + + if (useUtf8) + { + ucstring utf8Str; + utf8Str.fromUtf8(str); + length = (uint)utf8Str.length(); + } + else + { + length = (uint)str.length(); + } + + sint diff = length - previousLength; + + if (diff > 0 && length < maxLength) + { + memset(spaces, ' ', length); + spaces[length] = '\0'; + + // "erase" previous line + printf("%s\r", spaces); + fflush(stdout); + } - memset(spaces, ' ', previousLength); - spaces[previousLength] = '\0'; - - // "erase" previous line - printf("%s\r", spaces); - // display download in purple if (useEsc) { @@ -108,8 +127,10 @@ void printDownload(const std::string &str) SetConsoleTextAttribute(hStdout, attributes); #endif } + + fflush(stdout); - previousLength = (uint)str.length(); + previousLength = length; } int main(int argc, char *argv[]) diff --git a/code/ryzom/tools/sheets_packer/sheets_packer.cfg b/code/ryzom/tools/sheets_packer/sheets_packer.cfg index 9f2647ec5..ab175d829 100644 --- a/code/ryzom/tools/sheets_packer/sheets_packer.cfg +++ b/code/ryzom/tools/sheets_packer/sheets_packer.cfg @@ -4,4 +4,7 @@ ///////////////////////////////// ///////////////////////////////// DataPath = { "../../common/data_leveldesign", "../../common/data_common", "../../client/data" }; +WorldSheet = "ryzom.world"; +PrimitivesPath = "../../common/data_leveldesign/primitives"; +OutputDataPath = "../../client/data"; LigoPrimitiveClass = "world_editor_classes.xml"; diff --git a/code/ryzom/tools/sheets_packer/sheets_packer.vcproj b/code/ryzom/tools/sheets_packer/sheets_packer.vcproj index 9c5d6d60d..f43f88af4 100644 --- a/code/ryzom/tools/sheets_packer/sheets_packer.vcproj +++ b/code/ryzom/tools/sheets_packer/sheets_packer.vcproj @@ -52,7 +52,7 @@ Optimization="4" InlineFunctionExpansion="1" AdditionalIncludeDirectories="..\..\client\src;..\..\common\src" - PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE" + PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE;LIBXML_STATIC" BasicRuntimeChecks="3" SmallerTypeCheck="true" RuntimeLibrary="3" @@ -140,7 +140,7 @@ Optimization="4" InlineFunctionExpansion="1" AdditionalIncludeDirectories="..\..\client\src;..\..\common\src" - PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE" + PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE;LIBXML_STATIC" BasicRuntimeChecks="3" SmallerTypeCheck="true" RuntimeLibrary="3" @@ -148,6 +148,7 @@ PrecompiledHeaderThrough="stdpch.h" WarningLevel="3" DebugInformationFormat="3" + OmitDefaultLibName="true" /> @@ -232,7 +232,7 @@ OmitFramePointers="true" EnableFiberSafeOptimizations="true" AdditionalIncludeDirectories="..\..\client\src;..\..\common\src" - PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE" + PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE;LIBXML_STATIC" StringPooling="true" RuntimeLibrary="2" BufferSecurityCheck="false" @@ -325,7 +325,7 @@ OmitFramePointers="true" EnableFiberSafeOptimizations="true" AdditionalIncludeDirectories="..\..\client\src;..\..\common\src" - PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE" + PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE;LIBXML_STATIC" StringPooling="true" RuntimeLibrary="2" BufferSecurityCheck="false" diff --git a/code/ryzom/tools/sheets_packer/sheets_packer_cfg.cpp b/code/ryzom/tools/sheets_packer/sheets_packer_cfg.cpp index 92d87592f..77e05a7f7 100644 --- a/code/ryzom/tools/sheets_packer/sheets_packer_cfg.cpp +++ b/code/ryzom/tools/sheets_packer/sheets_packer_cfg.cpp @@ -147,15 +147,6 @@ const std::string ConfigFileName = "sheets_packer.cfg"; //--------------------------------------------------- CClientConfig::CClientConfig() { - SaveConfig = false; - DataPath.push_back("../../client/data/"); // Default Path for the Data. - DataPath.push_back("../../common/data_leveldesign/"); // Default Path for the Level Design Directory. - DataPath.push_back("../../common/data_common/"); // Default Path for the Level Design Directory. - UpdatePackedSheet = true; // Update packed sheet if needed - SceneName = ""; - IdFilePath = ""; - LanguageCode = "en"; // Default to english - FPExceptions = false; // Disable Floating Point Exceptions. }// CClientConfig // @@ -181,13 +172,14 @@ void setValues() } catch(EUnknownVar &) {nlwarning("Default value used for 'DataPath' !!!");} - // UpdatePackedSheet - READ_BOOL(UpdatePackedSheet) - - // SceneName - READ_STRING(SceneName) - // IdFile Path - READ_STRING(IdFilePath) + // World sheet name + READ_STRING(WorldSheet) + // Primitives path + READ_STRING(PrimitivesPath) + // Output data path + READ_STRING(OutputDataPath) + // Ligo primitive class + READ_STRING(LigoPrimitiveClass) ///////////// // FILTERS // @@ -219,13 +211,6 @@ void setValues() } } catch(EUnknownVar &) {} - - READ_STRING(LigoPrimitiveClass) - - // LanguageCode - READ_STRING(LanguageCode) - - READ_BOOL(FPExceptions) }// load // @@ -264,10 +249,4 @@ void CClientConfig::init(const std::string &configFileName) //----------------------------------------------- void CClientConfig::release () { - // Do we have to save the cfg file ? - if (AppCfg.SaveConfig) - { - // Save it - AppCfg.ConfigFile.save (); - } } diff --git a/code/ryzom/tools/sheets_packer/sheets_packer_cfg.h b/code/ryzom/tools/sheets_packer/sheets_packer_cfg.h index 169693af4..6c1f2e12a 100644 --- a/code/ryzom/tools/sheets_packer/sheets_packer_cfg.h +++ b/code/ryzom/tools/sheets_packer/sheets_packer_cfg.h @@ -41,24 +41,18 @@ struct CClientConfig void init (const std::string &configFileName); - /// Save the cfg file when exit the client ? - bool SaveConfig; - /// Data Path. std::vector DataPath; - /// True if we want the packed sheet to be updated if needed - bool UpdatePackedSheet; - /// Name of the scene to play. - std::string SceneName; - /// Path for the Id file. - std::string IdFilePath; - // Enable/disable Floating Point Exceptions - bool FPExceptions; + + /// World sheet name + std::string WorldSheet; + /// Path where to find .primitive files + std::string PrimitivesPath; + /// Path where to create lmconts.packed + std::string OutputDataPath; std::string LigoPrimitiveClass; -// TODO - std::string LanguageCode; public: /// Constructor. diff --git a/code/ryzom/tools/sheets_packer/sheets_packer_init.cpp b/code/ryzom/tools/sheets_packer/sheets_packer_init.cpp index f429aa634..02f115d03 100644 --- a/code/ryzom/tools/sheets_packer/sheets_packer_init.cpp +++ b/code/ryzom/tools/sheets_packer/sheets_packer_init.cpp @@ -92,13 +92,14 @@ bool init() // load packed sheets nlinfo("Loading sheets..."); IProgressCallback callback; + SheetMngr.setOutputDataPath(AppCfg.OutputDataPath); SheetMngr.load (callback, true, true); // Make the lmconts.packed file if (!LigoConfig.readPrimitiveClass (AppCfg.LigoPrimitiveClass.c_str(), false)) nlwarning ("Can't load primitive class file %s", AppCfg.LigoPrimitiveClass.c_str()); NLLIGO::CPrimitiveContext::instance().CurrentLigoConfig = &LigoConfig; - buildLMConts(); + buildLMConts(AppCfg.WorldSheet, AppCfg.PrimitivesPath, AppCfg.OutputDataPath); // The init is a success. return true; diff --git a/code/ryzom/tools/sheets_packer/stdpch.h b/code/ryzom/tools/sheets_packer/stdpch.h index 81db6e40c..d0135ae17 100644 --- a/code/ryzom/tools/sheets_packer/stdpch.h +++ b/code/ryzom/tools/sheets_packer/stdpch.h @@ -1,4 +1,3 @@ - #include #include @@ -35,7 +34,6 @@ //#include #ifdef NL_OS_WINDOWS +#define NOMINMAX #include -#undef min -#undef max #endif // NL_OS_WINDOWS diff --git a/code/snowballs2/server/position/src/CMakeLists.txt b/code/snowballs2/server/position/src/CMakeLists.txt index 229f402ed..034d5edd4 100644 --- a/code/snowballs2/server/position/src/CMakeLists.txt +++ b/code/snowballs2/server/position/src/CMakeLists.txt @@ -1,14 +1,11 @@ FILE(GLOB SRC *.cpp *.h) -ADD_EXECUTABLE(sno_position ${SRC}) +ADD_EXECUTABLE(sno_position WIN32 ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${NELMISC_INCLUDE_DIRS}) -TARGET_LINK_LIBRARIES(sno_position ${PLATFORM_LINKFLAGS} ${LIBXML2_LIBRARIES} ${NELMISC_LIBRARY} ${NELNET_LIBRARY}) -IF(WIN32) - SET_TARGET_PROPERTIES(sno_position PROPERTIES - LINK_FLAGS "/NODEFAULTLIB:libcmt /SUBSYSTEM:WINDOWS" - PROJECT_LABEL "Services: Snowballs Position") -ENDIF(WIN32) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +INCLUDE_DIRECTORIES(${NELMISC_INCLUDE_DIRS}) + +TARGET_LINK_LIBRARIES(sno_position ${PLATFORM_LINKFLAGS} ${NELMISC_LIBRARY} ${NELNET_LIBRARY}) +NL_DEFAULT_PROPS(sno_position "Services: Snowballs Position") +NL_ADD_RUNTIME_FLAGS(sno_position) INSTALL(TARGETS sno_position RUNTIME DESTINATION sbin COMPONENT services)