Merge with default

--HG--
branch : multipass-stereo
This commit is contained in:
kaetemi 2013-10-06 15:50:49 +02:00
commit af621187f1
142 changed files with 2631 additions and 2236 deletions

View file

@ -134,7 +134,7 @@ IF(FINAL_VERSION)
ENDIF(FINAL_VERSION) ENDIF(FINAL_VERSION)
IF(WITH_QT) IF(WITH_QT)
FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtXml REQUIRED) FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtXml QtOpenGL REQUIRED)
ENDIF(WITH_QT) ENDIF(WITH_QT)
IF(WITH_NEL) IF(WITH_NEL)
@ -144,11 +144,6 @@ IF(WITH_NEL)
IF(WITH_GUI) IF(WITH_GUI)
FIND_PACKAGE(Libwww REQUIRED) FIND_PACKAGE(Libwww REQUIRED)
IF(WITH_LUA51)
FIND_PACKAGE(Lua51 REQUIRED)
ELSE(WITH_LUA51)
FIND_PACKAGE(Lua50 REQUIRED)
ENDIF(WITH_LUA51)
FIND_PACKAGE(Luabind REQUIRED) FIND_PACKAGE(Luabind REQUIRED)
FIND_PACKAGE(CURL REQUIRED) FIND_PACKAGE(CURL REQUIRED)

View file

@ -0,0 +1,81 @@
# Locate Lua library
# This module defines
# LUA52_FOUND, if false, do not try to link to Lua
# LUA_LIBRARIES
# LUA_INCLUDE_DIR, where to find lua.h
# LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
#
# Note that the expected include convention is
# #include "lua.h"
# and not
# #include <lua/lua.h>
# This is because, the lua location is not standardized and may exist
# in locations other than lua/
#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
find_path(LUA_INCLUDE_DIR lua.h
HINTS
ENV LUA_DIR
PATH_SUFFIXES include/lua52 include/lua5.2 include/lua-5.2 include/lua include
PATHS
~/Library/Frameworks
/Library/Frameworks
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
)
find_library(LUA_LIBRARY
NAMES lua52 lua5.2 lua-5.2 lua
HINTS
ENV LUA_DIR
PATH_SUFFIXES lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/sw
/opt/local
/opt/csw
/opt
)
if(LUA_LIBRARY)
# include the math library for Unix
if(UNIX AND NOT APPLE AND NOT BEOS)
find_library(LUA_MATH_LIBRARY m)
set( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
# For Windows and Mac, don't need to explicitly include the math library
else()
set( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries")
endif()
endif()
if(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
file(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"")
string(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" LUA_VERSION_STRING "${lua_version_str}")
unset(lua_version_str)
endif()
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua52
REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
VERSION_VAR LUA_VERSION_STRING)
mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY)

View file

@ -4,6 +4,48 @@
# LUABIND_FOUND, if false, do not try to link to LUABIND # LUABIND_FOUND, if false, do not try to link to LUABIND
# LUABIND_INCLUDE_DIR, where to find headers. # LUABIND_INCLUDE_DIR, where to find headers.
MACRO(FIND_CORRECT_LUA_VERSION)
# Check Lua version linked to Luabind under Linux
IF(LUABIND_LIBRARY_RELEASE MATCHES "\\.so")
INCLUDE(CheckDepends)
SET(LUA52_LIBRARY "liblua5.2")
CHECK_LINKED_LIBRARY(LUABIND_LIBRARY_RELEASE LUA52_LIBRARY LUALIB_FOUND)
IF(LUALIB_FOUND)
MESSAGE(STATUS "Luabind is using Lua 5.2")
FIND_PACKAGE(Lua52 REQUIRED)
ELSE(LUALIB_FOUND)
SET(LUA51_LIBRARY "liblua5.1")
CHECK_LINKED_LIBRARY(LUABIND_LIBRARY_RELEASE LUA51_LIBRARY LUALIB_FOUND)
IF(LUALIB_FOUND)
MESSAGE(STATUS "Luabind is using Lua 5.1")
FIND_PACKAGE(Lua51 REQUIRED)
ELSE(LUALIB_FOUND)
SET(LUA50_LIBRARY "liblua5.0")
CHECK_LINKED_LIBRARY(LUABIND_LIBRARY_RELEASE LUA50_LIBRARY LUALIB_FOUND)
IF(LUALIB_FOUND)
MESSAGE(STATUS "Luabind is using Lua 5.0")
FIND_PACKAGE(Lua50 REQUIRED)
ELSE(LUALIB_FOUND)
MESSAGE(FATAL_ERROR "Can't determine Lua version used by Luabind")
ENDIF(LUALIB_FOUND)
ENDIF(LUALIB_FOUND)
ENDIF(LUALIB_FOUND)
ELSE(LUABIND_LIBRARY_RELEASE MATCHES "\\.so")
# TODO: find a way to detect Lua version
IF(WITH_LUA52)
FIND_PACKAGE(Lua52 REQUIRED)
ELSEIF(WITH_LUA51)
FIND_PACKAGE(Lua51 REQUIRED)
ELSE(WITH_LUA52)
FIND_PACKAGE(Lua50 REQUIRED)
ENDIF(WITH_LUA52)
ENDIF(LUABIND_LIBRARY_RELEASE MATCHES "\\.so")
ENDMACRO(FIND_CORRECT_LUA_VERSION)
IF(LUABIND_LIBRARIES AND LUABIND_INCLUDE_DIR) IF(LUABIND_LIBRARIES AND LUABIND_INCLUDE_DIR)
# in cache already # in cache already
SET(Luabind_FIND_QUIETLY TRUE) SET(Luabind_FIND_QUIETLY TRUE)
@ -84,6 +126,9 @@ IF(LUABIND_FOUND)
IF(LUABIND_VERSION_FILE) IF(LUABIND_VERSION_FILE)
SET(LUABIND_DEFINITIONS "-DHAVE_LUABIND_VERSION") SET(LUABIND_DEFINITIONS "-DHAVE_LUABIND_VERSION")
ENDIF(LUABIND_VERSION_FILE) ENDIF(LUABIND_VERSION_FILE)
FIND_CORRECT_LUA_VERSION()
IF(NOT Luabind_FIND_QUIETLY) IF(NOT Luabind_FIND_QUIETLY)
MESSAGE(STATUS "Found Luabind: ${LUABIND_LIBRARIES}") MESSAGE(STATUS "Found Luabind: ${LUABIND_LIBRARIES}")
ENDIF(NOT Luabind_FIND_QUIETLY) ENDIF(NOT Luabind_FIND_QUIETLY)

View file

@ -19,8 +19,13 @@ MACRO(DETECT_VC_VERSION_HELPER _ROOT _VERSION)
IF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry") IF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry")
SET(VC${_VERSION}_FOUND ON) SET(VC${_VERSION}_FOUND ON)
DETECT_EXPRESS_VERSION(${_VERSION})
IF(NOT MSVC_FIND_QUIETLY) IF(NOT MSVC_FIND_QUIETLY)
MESSAGE(STATUS "Found Visual C++ ${_VERSION} in ${VC${_VERSION}_DIR}") SET(_VERSION_STR ${_VERSION})
IF(MSVC_EXPRESS)
SET(_VERSION_STR "${_VERSION_STR} Express")
ENDIF(MSVC_EXPRESS)
MESSAGE(STATUS "Found Visual C++ ${_VERSION_STR} in ${VC${_VERSION}_DIR}")
ENDIF(NOT MSVC_FIND_QUIETLY) ENDIF(NOT MSVC_FIND_QUIETLY)
ELSEIF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry") ELSEIF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry")
SET(VC${_VERSION}_FOUND OFF) SET(VC${_VERSION}_FOUND OFF)
@ -36,13 +41,28 @@ MACRO(DETECT_VC_VERSION _VERSION)
DETECT_VC_VERSION_HELPER("HKEY_LOCAL_MACHINE" ${_VERSION}) DETECT_VC_VERSION_HELPER("HKEY_LOCAL_MACHINE" ${_VERSION})
ENDIF(NOT VC${_VERSION}_FOUND) ENDIF(NOT VC${_VERSION}_FOUND)
IF(NOT VC${_VERSION}_FOUND) IF(VC${_VERSION}_FOUND)
SET(VC_FOUND ON) SET(VC_FOUND ON)
SET(VC_DIR "${VC${_VERSION}_DIR}") SET(VC_DIR "${VC${_VERSION}_DIR}")
ENDIF(NOT VC${_VERSION}_FOUND) ENDIF(VC${_VERSION}_FOUND)
ENDMACRO(DETECT_VC_VERSION) ENDMACRO(DETECT_VC_VERSION)
IF(MSVC11) MACRO(DETECT_EXPRESS_VERSION _VERSION)
GET_FILENAME_COMPONENT(MSVC_EXPRESS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\${_VERSION}\\Setup\\VC;ProductDir]" ABSOLUTE)
IF(MSVC_EXPRESS AND NOT MSVC_EXPRESS STREQUAL "/registry")
SET(MSVC_EXPRESS ON)
ENDIF(MSVC_EXPRESS AND NOT MSVC_EXPRESS STREQUAL "/registry")
ENDMACRO(DETECT_EXPRESS_VERSION)
IF(MSVC12)
DETECT_VC_VERSION("12.0")
IF(NOT MSVC12_REDIST_DIR)
# If you have VC++ 2013 Express, put x64/Microsoft.VC120.CRT/*.dll in ${EXTERNAL_PATH}/redist
SET(MSVC12_REDIST_DIR "${EXTERNAL_PATH}/redist")
ENDIF(NOT MSVC11_REDIST_DIR)
ELSEIF(MSVC11)
DETECT_VC_VERSION("11.0") DETECT_VC_VERSION("11.0")
IF(NOT MSVC11_REDIST_DIR) IF(NOT MSVC11_REDIST_DIR)
@ -60,7 +80,7 @@ ELSEIF(MSVC90)
DETECT_VC_VERSION("9.0") DETECT_VC_VERSION("9.0")
ELSEIF(MSVC80) ELSEIF(MSVC80)
DETECT_VC_VERSION("8.0") DETECT_VC_VERSION("8.0")
ENDIF(MSVC11) ENDIF(MSVC12)
# If you plan to use VC++ compilers with WINE, set VC_DIR environment variable # If you plan to use VC++ compilers with WINE, set VC_DIR environment variable
IF(NOT VC_DIR) IF(NOT VC_DIR)

View file

@ -11,6 +11,7 @@ IF(WINSDK_FOUND)
RETURN() RETURN()
ENDIF(WINSDK_FOUND) ENDIF(WINSDK_FOUND)
# Values can be CURRENT or any existing versions 7.1, 8.0A, etc...
SET(WINSDK_VERSION "CURRENT" CACHE STRING "Windows SDK version to prefer") SET(WINSDK_VERSION "CURRENT" CACHE STRING "Windows SDK version to prefer")
MACRO(DETECT_WINSDK_VERSION_HELPER _ROOT _VERSION) MACRO(DETECT_WINSDK_VERSION_HELPER _ROOT _VERSION)
@ -22,7 +23,7 @@ MACRO(DETECT_WINSDK_VERSION_HELPER _ROOT _VERSION)
IF(NOT WindowsSDK_FIND_QUIETLY) IF(NOT WindowsSDK_FIND_QUIETLY)
MESSAGE(STATUS "Found Windows SDK ${_VERSION} in ${WINSDK${_VERSION}_DIR}") MESSAGE(STATUS "Found Windows SDK ${_VERSION} in ${WINSDK${_VERSION}_DIR}")
ENDIF(NOT WindowsSDK_FIND_QUIETLY) ENDIF(NOT WindowsSDK_FIND_QUIETLY)
ELSEIF(WINSDK${_VERSION}_DIR AND NOT WINSDK${_VERSION}_DIR STREQUAL "/registry") ELSE(WINSDK${_VERSION}_DIR AND NOT WINSDK${_VERSION}_DIR STREQUAL "/registry")
SET(WINSDK${_VERSION}_DIR "") SET(WINSDK${_VERSION}_DIR "")
ENDIF(WINSDK${_VERSION}_DIR AND NOT WINSDK${_VERSION}_DIR STREQUAL "/registry") ENDIF(WINSDK${_VERSION}_DIR AND NOT WINSDK${_VERSION}_DIR STREQUAL "/registry")
ENDMACRO(DETECT_WINSDK_VERSION_HELPER) ENDMACRO(DETECT_WINSDK_VERSION_HELPER)
@ -36,11 +37,16 @@ MACRO(DETECT_WINSDK_VERSION _VERSION)
ENDIF(NOT WINSDK${_VERSION}_FOUND) ENDIF(NOT WINSDK${_VERSION}_FOUND)
ENDMACRO(DETECT_WINSDK_VERSION) ENDMACRO(DETECT_WINSDK_VERSION)
SET(WINSDK_VERSIONS "8.0" "8.0A" "7.1" "7.0A" "6.1" "6.0" "6.0A") SET(WINSDK_VERSIONS "8.0" "8.0A" "7.1" "7.1A" "7.0" "7.0A" "6.1" "6.0" "6.0A")
SET(WINSDK_DETECTED_VERSIONS)
# Search all supported Windows SDKs # Search all supported Windows SDKs
FOREACH(_VERSION ${WINSDK_VERSIONS}) FOREACH(_VERSION ${WINSDK_VERSIONS})
DETECT_WINSDK_VERSION(${_VERSION}) DETECT_WINSDK_VERSION(${_VERSION})
IF(WINSDK${_VERSION}_FOUND)
LIST(APPEND WINSDK_DETECTED_VERSIONS ${_VERSION})
ENDIF(WINSDK${_VERSION}_FOUND)
ENDFOREACH(_VERSION) ENDFOREACH(_VERSION)
SET(WINSDK_SUFFIX) SET(WINSDK_SUFFIX)
@ -54,51 +60,186 @@ ELSEIF(TARGET_X86)
SET(WINSDK8_SUFFIX "x86") SET(WINSDK8_SUFFIX "x86")
ENDIF(TARGET_ARM) ENDIF(TARGET_ARM)
GET_FILENAME_COMPONENT(WINSDKCURRENT_VERSION "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentVersion]" NAME) SET(WINSDKCURRENT_VERSION_INCLUDE $ENV{INCLUDE})
IF(WINSDKCURRENT_VERSION AND NOT WINSDKCURRENT_VERSION STREQUAL "/registry") IF(WINSDKCURRENT_VERSION_INCLUDE)
IF(NOT WindowsSDK_FIND_QUIETLY) FILE(TO_CMAKE_PATH "${WINSDKCURRENT_VERSION_INCLUDE}" WINSDKCURRENT_VERSION_INCLUDE)
# MESSAGE(STATUS "Current version is ${WINSDKCURRENT_VERSION}") ENDIF(WINSDKCURRENT_VERSION_INCLUDE)
ENDIF(NOT WindowsSDK_FIND_QUIETLY)
ENDIF(WINSDKCURRENT_VERSION AND NOT WINSDKCURRENT_VERSION STREQUAL "/registry")
SET(WINSDKENV_DIR $ENV{WINSDK_DIR}) SET(WINSDKENV_DIR $ENV{WINSDK_DIR})
MACRO(FIND_WINSDK_VERSION_HEADERS)
IF(WINSDK_DIR AND NOT WINSDK_VERSION)
# Search version in headers
IF(EXISTS ${WINSDK_DIR}/include/Msi.h)
SET(_MSI_FILE ${WINSDK_DIR}/include/Msi.h)
ENDIF(EXISTS ${WINSDK_DIR}/include/Msi.h)
IF(_MSI_FILE)
# Look for Windows SDK 8.0
FILE(STRINGS ${_MSI_FILE} _CONTENT REGEX "^#ifndef NTDDI_WIN8")
IF(_CONTENT)
SET(WINSDK_VERSION "8.0")
ENDIF(_CONTENT)
IF(NOT WINSDK_VERSION)
# Look for Windows SDK 7.0
FILE(STRINGS ${_MSI_FILE} _CONTENT REGEX "^#ifndef NTDDI_WIN7")
IF(_CONTENT)
IF(EXISTS ${WINSDK_DIR}/include/winsdkver.h)
SET(_WINSDKVER_FILE ${WINSDK_DIR}/include/winsdkver.h)
ELSEIF(EXISTS ${WINSDK_DIR}/include/WinSDKVer.h)
SET(_WINSDKVER_FILE ${WINSDK_DIR}/include/WinSDKVer.h)
ENDIF(EXISTS ${WINSDK_DIR}/include/winsdkver.h)
IF(_WINSDKVER_FILE)
# Load WinSDKVer.h content
FILE(STRINGS ${_WINSDKVER_FILE} _CONTENT REGEX "^#define NTDDI_MAXVER")
# Get NTDDI_MAXVER value
STRING(REGEX REPLACE "^.*0x([0-9A-Fa-f]+).*$" "\\1" _WINSDKVER "${_CONTENT}")
# In Windows SDK 7.1, NTDDI_MAXVER is wrong
IF(_WINSDKVER STREQUAL "06010000")
SET(WINSDK_VERSION "7.1")
ELSEIF(_WINSDKVER STREQUAL "0601")
SET(WINSDK_VERSION "7.0A")
ELSE(_WINSDKVER STREQUAL "06010000")
MESSAGE(FATAL_ERROR "Can't determine Windows SDK version with NTDDI_MAXVER 0x${_WINSDKVER}")
ENDIF(_WINSDKVER STREQUAL "06010000")
ELSE(_WINSDKVER_FILE)
SET(WINSDK_VERSION "7.0")
ENDIF(_WINSDKVER_FILE)
ENDIF(_CONTENT)
ENDIF(NOT WINSDK_VERSION)
IF(NOT WINSDK_VERSION)
# Look for Windows SDK 6.0
FILE(STRINGS ${_MSI_FILE} _CONTENT REGEX "^#ifndef NTDDI_VISTA")
IF(_CONTENT)
SET(WINSDK_VERSION "6.0")
ENDIF(_CONTENT)
ENDIF(NOT WINSDK_VERSION)
IF(NOT WINSDK_VERSION)
# Look for Windows SDK 5.2
FILE(STRINGS ${_MSI_FILE} _CONTENT REGEX "^#ifndef NTDDI_WS03SP1")
IF(_CONTENT)
SET(WINSDK_VERSION "5.2")
ENDIF(_CONTENT)
ENDIF(NOT WINSDK_VERSION)
IF(NOT WINSDK_VERSION)
# Look for Windows SDK 5.1
FILE(STRINGS ${_MSI_FILE} _CONTENT REGEX "^#ifndef NTDDI_WINXP")
IF(_CONTENT)
SET(WINSDK_VERSION "5.1")
ENDIF(_CONTENT)
ENDIF(NOT WINSDK_VERSION)
IF(NOT WINSDK_VERSION)
# Look for Windows SDK 5.0
FILE(STRINGS ${_MSI_FILE} _CONTENT REGEX "^#ifndef NTDDI_WIN2K")
IF(_CONTENT)
SET(WINSDK_VERSION "5.0")
ENDIF(_CONTENT)
ENDIF(NOT WINSDK_VERSION)
ELSE(_MSI_FILE)
MESSAGE(FATAL_ERROR "Unable to find Msi.h in ${WINSDK_DIR}")
ENDIF(_MSI_FILE)
ENDIF(WINSDK_DIR AND NOT WINSDK_VERSION)
ENDMACRO(FIND_WINSDK_VERSION_HEADERS)
MACRO(USE_CURRENT_WINSDK) MACRO(USE_CURRENT_WINSDK)
IF(WINSDKENV_DIR) SET(WINSDK_DIR "")
SET(WINSDK_VERSION "") SET(WINSDK_VERSION "")
SET(WINSDK_VERSION_FULL "") SET(WINSDK_VERSION_FULL "")
# Use WINSDK environment variable
IF(WINSDKENV_DIR AND EXISTS ${WINSDKENV_DIR}/include/Windows.h)
SET(WINSDK_DIR ${WINSDKENV_DIR}) SET(WINSDK_DIR ${WINSDKENV_DIR})
FOREACH(_VERSION ${WINSDK_VERSIONS}) ENDIF(WINSDKENV_DIR AND EXISTS ${WINSDKENV_DIR}/include/Windows.h)
IF(WINSDK_DIR STREQUAL WINSDK${_VERSION}_DIR)
SET(WINSDK_VERSION ${_VERSION}) # Use INCLUDE environment variable
SET(WINSDK_VERSION_FULL "${WINSDK${_VERSION}_VERSION_FULL}") IF(NOT WINSDK_DIR AND WINSDKCURRENT_VERSION_INCLUDE)
FOREACH(_INCLUDE ${WINSDKCURRENT_VERSION_INCLUDE})
FILE(TO_CMAKE_PATH ${_INCLUDE} _INCLUDE)
# Look for Windows.h because there are several paths
IF(EXISTS ${_INCLUDE}/Windows.h)
STRING(REGEX REPLACE "/(include|INCLUDE|Include)" "" WINSDK_DIR ${_INCLUDE})
MESSAGE(STATUS "Found Windows SDK environment variable in ${WINSDK_DIR}")
BREAK() BREAK()
ENDIF(WINSDK_DIR STREQUAL WINSDK${_VERSION}_DIR) ENDIF(EXISTS ${_INCLUDE}/Windows.h)
ENDFOREACH(_INCLUDE)
ENDIF(NOT WINSDK_DIR AND WINSDKCURRENT_VERSION_INCLUDE)
IF(WINSDK_DIR)
# Compare WINSDK_DIR with registered Windows SDKs
FOREACH(_VERSION ${WINSDK_DETECTED_VERSIONS})
IF(WINSDK_DIR STREQUAL "${WINSDK${_VERSION}_DIR}")
SET(WINSDK_VERSION ${_VERSION})
SET(WINSDK_VERSION_FULL "${WINSDK${WINSDK_VERSION}_VERSION_FULL}")
BREAK()
ENDIF(WINSDK_DIR STREQUAL "${WINSDK${_VERSION}_DIR}")
ENDFOREACH(_VERSION) ENDFOREACH(_VERSION)
ELSE(WINSDKENV_DIR)
# Windows SDK 7.0A doesn't provide 64bits compilers, use SDK 7.1 for 64 bits FIND_WINSDK_VERSION_HEADERS()
IF(WINSDKCURRENT_VERSION STREQUAL WINSDK7.0A_VERSION_FULL) ENDIF(WINSDK_DIR)
IF(TARGET_X64)
SET(WINSDK_VERSION "7.1") IF(NOT WINSDK_DIR)
SET(WINSDK_VERSION_FULL ${WINSDK7.1_VERSION_FULL}) # Use Windows SDK versions installed with VC++ when possible
SET(WINSDK_DIR ${WINSDK7.1_DIR}) IF(MSVC12)
ELSE(TARGET_X64) SET(WINSDK_VERSION "8.1A")
ELSEIF(MSVC11)
SET(WINSDK_VERSION "8.0A")
ELSEIF(MSVC10)
IF(NOT TARGET_X64 OR NOT MSVC_EXPRESS)
SET(WINSDK_VERSION "7.0A") SET(WINSDK_VERSION "7.0A")
SET(WINSDK_VERSION_FULL ${WINSDK7.0A_VERSION_FULL}) ENDIF(NOT TARGET_X64 OR NOT MSVC_EXPRESS)
SET(WINSDK_DIR ${WINSDK7.0A_DIR}) ELSEIF(MSVC90)
ENDIF(TARGET_X64) IF(NOT MSVC_EXPRESS)
ELSE(WINSDKCURRENT_VERSION STREQUAL WINSDK7.0A_VERSION_FULL) SET(WINSDK_VERSION "6.0A")
FOREACH(_VERSION ${WINSDK_VERSIONS}) ENDIF(NOT MSVC_EXPRESS)
IF(WINSDKCURRENT_VERSION STREQUAL WINSDK${_VERSION}_VERSION) ELSEIF(MSVC80)
SET(WINSDK_VERSION ${_VERSION}) IF(NOT MSVC_EXPRESS)
SET(WINSDK_VERSION_FULL "${WINSDK${_VERSION}_VERSION_FULL}") # TODO: fix this version
SET(WINSDK_DIR "${WINSDK${_VERSION}_DIR}") SET(WINSDK_VERSION "5.2A")
BREAK() ENDIF(NOT MSVC_EXPRESS)
ENDIF(WINSDKCURRENT_VERSION STREQUAL WINSDK${_VERSION}_VERSION) ELSE(MSVC12)
ENDFOREACH(_VERSION) MESSAGE(FATAL_ERROR "Your compiler is either too old or too recent, please update this CMake module.")
ENDIF(WINSDKCURRENT_VERSION STREQUAL WINSDK7.0A_VERSION_FULL) ENDIF(MSVC12)
ENDIF(WINSDKENV_DIR)
# Use installed Windows SDK
IF(NOT WINSDK_VERSION)
IF(WINSDK7.1_FOUND)
SET(WINSDK_VERSION "7.1")
ELSEIF(WINSDK7.0_FOUND)
SET(WINSDK_VERSION "7.0")
ELSEIF(WINSDK6.1_FOUND)
SET(WINSDK_VERSION "6.1")
ELSEIF(WINSDK6.0_FOUND)
SET(WINSDK_VERSION "6.0")
ELSE(WINSDK7.1_FOUND)
MESSAGE(FATAL_ERROR "You have no compatible Windows SDK installed.")
ENDIF(WINSDK7.1_FOUND)
ENDIF(NOT WINSDK_VERSION)
# Look for correct registered Windows SDK version
FOREACH(_VERSION ${WINSDK_DETECTED_VERSIONS})
IF(WINSDK_VERSION STREQUAL _VERSION)
SET(WINSDK_VERSION_FULL "${WINSDK${WINSDK_VERSION}_VERSION_FULL}")
SET(WINSDK_DIR "${WINSDK${WINSDK_VERSION}_DIR}")
BREAK()
ENDIF(WINSDK_VERSION STREQUAL _VERSION)
ENDFOREACH(_VERSION)
ENDIF(NOT WINSDK_DIR)
ENDMACRO(USE_CURRENT_WINSDK) ENDMACRO(USE_CURRENT_WINSDK)
IF(WINSDK_VERSION STREQUAL "CURRENT") IF(WINSDK_VERSION STREQUAL "CURRENT")

View file

@ -276,12 +276,19 @@ MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName)
# NMAKE-VS2012 Error LNK2011 (NMAKE-VS2010 do not complain) # NMAKE-VS2012 Error LNK2011 (NMAKE-VS2010 do not complain)
# we need to link the pch.obj file, see http://msdn.microsoft.com/en-us/library/3ay26wa2(v=vs.110).aspx # we need to link the pch.obj file, see http://msdn.microsoft.com/en-us/library/3ay26wa2(v=vs.110).aspx
GET_TARGET_PROPERTY(DEPS ${_targetName} LINK_LIBRARIES) GET_TARGET_PROPERTY(_STATIC_LIBRARY_FLAGS ${_targetName} STATIC_LIBRARY_FLAGS)
if (NOT DEPS) IF(NOT _STATIC_LIBRARY_FLAGS)
set (DEPS) SET(_STATIC_LIBRARY_FLAGS)
endif () ENDIF(NOT _STATIC_LIBRARY_FLAGS)
list (INSERT DEPS 0 "${PCH_OUTPUT}.obj") SET(_STATIC_LIBRARY_FLAGS "${PCH_OUTPUT}.obj ${_STATIC_LIBRARY_FLAGS}")
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES LINK_LIBRARIES "${DEPS}")
GET_TARGET_PROPERTY(_LINK_FLAGS ${_targetName} LINK_FLAGS)
IF(NOT _LINK_FLAGS)
SET(_LINK_FLAGS)
ENDIF(NOT _LINK_FLAGS)
SET(_LINK_FLAGS "${PCH_OUTPUT}.obj ${_LINK_FLAGS}")
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES STATIC_LIBRARY_FLAGS ${_STATIC_LIBRARY_FLAGS} LINK_FLAGS ${_LINK_FLAGS})
ELSE(MSVC) ELSE(MSVC)
# for use with distcc and gcc >4.0.1 if preprocessed files are accessible # for use with distcc and gcc >4.0.1 if preprocessed files are accessible
# on all remote machines set # on all remote machines set
@ -369,17 +376,6 @@ MACRO(ADD_PRECOMPILED_HEADER _targetName _inputh _inputcpp)
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${PCH_OUTPUTS}") SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${PCH_OUTPUTS}")
ENDMACRO(ADD_PRECOMPILED_HEADER) ENDMACRO(ADD_PRECOMPILED_HEADER)
# Macro to move PCH creation file to the front of files list
# or remove .cpp from library/executable to avoid warning
MACRO(FIX_PRECOMPILED_HEADER _files _pch)
# Remove .cpp creating PCH from the list
LIST(REMOVE_ITEM ${_files} ${_pch})
IF(MSVC)
# Prepend .cpp creating PCH to the list
LIST(INSERT ${_files} 0 ${_pch})
ENDIF(MSVC)
ENDMACRO(FIX_PRECOMPILED_HEADER)
MACRO(ADD_NATIVE_PRECOMPILED_HEADER _targetName _inputh _inputcpp) MACRO(ADD_NATIVE_PRECOMPILED_HEADER _targetName _inputh _inputcpp)
IF(NOT PCHSupport_FOUND) IF(NOT PCHSupport_FOUND)
MESSAGE(STATUS "PCH disabled because compiler doesn't support them") MESSAGE(STATUS "PCH disabled because compiler doesn't support them")
@ -391,10 +387,6 @@ MACRO(ADD_NATIVE_PRECOMPILED_HEADER _targetName _inputh _inputcpp)
# 2 => setting PCH for XCode project, works for XCode projects # 2 => setting PCH for XCode project, works for XCode projects
IF(CMAKE_GENERATOR MATCHES "Visual Studio") IF(CMAKE_GENERATOR MATCHES "Visual Studio")
SET(PCH_METHOD 1) SET(PCH_METHOD 1)
ELSEIF(CMAKE_GENERATOR MATCHES "NMake Makefiles" AND MFC_FOUND AND CMAKE_MFC_FLAG)
# To fix a bug with MFC
# Don't forget to use FIX_PRECOMPILED_HEADER before creating the target
# SET(PCH_METHOD 1)
ELSEIF(CMAKE_GENERATOR MATCHES "Xcode") ELSEIF(CMAKE_GENERATOR MATCHES "Xcode")
SET(PCH_METHOD 2) SET(PCH_METHOD 2)
ELSE(CMAKE_GENERATOR MATCHES "Visual Studio") ELSE(CMAKE_GENERATOR MATCHES "Visual Studio")

View file

@ -345,7 +345,8 @@ MACRO(NL_SETUP_RYZOM_DEFAULT_OPTIONS)
### ###
# Optional support # Optional support
### ###
OPTION(WITH_LUA51 "Build Ryzom Core using Lua51" ON ) OPTION(WITH_LUA51 "Build Ryzom Core using Lua 5.1" ON )
OPTION(WITH_LUA52 "Build Ryzom Core using Lua 5.2" OFF)
ENDMACRO(NL_SETUP_RYZOM_DEFAULT_OPTIONS) ENDMACRO(NL_SETUP_RYZOM_DEFAULT_OPTIONS)
MACRO(NL_SETUP_SNOWBALLS_DEFAULT_OPTIONS) MACRO(NL_SETUP_SNOWBALLS_DEFAULT_OPTIONS)

View file

@ -109,7 +109,7 @@ struct TLoadFormDicoEntry
} }
}; };
*/ */
const uint32 PACKED_SHEET_HEADER = 'PKSH'; const uint32 PACKED_SHEET_HEADER = NELID("PKSH");
const uint32 PACKED_SHEET_VERSION = 5; const uint32 PACKED_SHEET_VERSION = 5;
// This Version may be used if you want to use the serialVersion() system in loadForm() // This Version may be used if you want to use the serialVersion() system in loadForm()
const uint32 PACKED_SHEET_VERSION_COMPATIBLE = 0; const uint32 PACKED_SHEET_VERSION_COMPATIBLE = 0;

View file

@ -53,6 +53,13 @@ class CMemStream;
# endif # endif
# define NLMISC_BSWAP64(src) (src) = (((src)>>56)&0xFF) | ((((src)>>48)&0xFF)<<8) | ((((src)>>40)&0xFF)<<16) | ((((src)>>32)&0xFF)<<24) | ((((src)>>24)&0xFF)<<32) | ((((src)>>16)&0xFF)<<40) | ((((src)>>8)&0xFF)<<48) | (((src)&0xFF)<<56) # define NLMISC_BSWAP64(src) (src) = (((src)>>56)&0xFF) | ((((src)>>48)&0xFF)<<8) | ((((src)>>40)&0xFF)<<16) | ((((src)>>32)&0xFF)<<24) | ((((src)>>24)&0xFF)<<32) | ((((src)>>16)&0xFF)<<40) | ((((src)>>8)&0xFF)<<48) | (((src)&0xFF)<<56)
// convert a 4 characters string to uint32
#ifdef NL_LITTLE_ENDIAN
# define NELID(x) (uint32((x[0] << 24) | (x[1] << 16) | (x[2] << 8) | (x[3])))
#else
# define NELID(x) (uint32((x[3] << 24) | (x[2] << 16) | (x[1] << 8) | (x[0])))
#endif
// ====================================================================================================== // ======================================================================================================
/** /**
* Stream Exception. * Stream Exception.

View file

@ -89,8 +89,8 @@ void CAnimation::serial (NLMISC::IStream& f)
nlassert(_IdByChannelId.empty()); nlassert(_IdByChannelId.empty());
// Serial a header // Serial a header
f.serialCheck ((uint32)'_LEN'); f.serialCheck (NELID("_LEN"));
f.serialCheck ((uint32)'MINA'); f.serialCheck (NELID("MINA"));
// Serial a version // Serial a version
sint version=f.serialVersion (2); sint version=f.serialVersion (2);

View file

@ -185,9 +185,9 @@ void CAnimationSet::serial (NLMISC::IStream& f)
nlassert(!_AnimHeaderOptimisation); nlassert(!_AnimHeaderOptimisation);
// Serial an header // Serial an header
f.serialCheck ((uint32)'_LEN'); f.serialCheck (NELID("_LEN"));
f.serialCheck ((uint32)'MINA'); f.serialCheck (NELID("MINA"));
f.serialCheck ((uint32)'TES_'); f.serialCheck (NELID("TES_"));
// Serial a version // Serial a version
uint ver= f.serialVersion (1); uint ver= f.serialVersion (1);

View file

@ -1406,6 +1406,7 @@ void CDriverGL::setupFog(float start, float end, CRGBA color)
glFogfv(GL_FOG_COLOR, _CurrentFogColor); glFogfv(GL_FOG_COLOR, _CurrentFogColor);
#ifndef USE_OPENGLES
/** Special : with vertex program, using the extension EXT_vertex_shader, fog is emulated using 1 more constant to scale result to [0, 1] /** Special : with vertex program, using the extension EXT_vertex_shader, fog is emulated using 1 more constant to scale result to [0, 1]
*/ */
if (_Extensions.EXTVertexShader && !_Extensions.NVVertexProgram && !_Extensions.ARBVertexProgram) if (_Extensions.EXTVertexShader && !_Extensions.NVVertexProgram && !_Extensions.ARBVertexProgram)
@ -1425,6 +1426,8 @@ void CDriverGL::setupFog(float start, float end, CRGBA color)
} }
} }
} }
#endif
_FogStart = start; _FogStart = start;
_FogEnd = end; _FogEnd = end;
} }

View file

@ -1502,7 +1502,7 @@ CTextureCube *CDriverGL::getSpecularCubeMap(uint exp)
{ {
1.f, 4.f, 8.f, 24.f, 48.f, 128.f, 256.f, 511.f 1.f, 4.f, 8.f, 24.f, 48.f, 128.f, 256.f, 511.f
}; };
const uint numCubeMap = sizeof(expToCubeMap) / sizeof(float); const uint numCubeMap = sizeof(cubeMapExp) / sizeof(float);
static bool tableBuilt = false; static bool tableBuilt = false;
if (!tableBuilt) if (!tableBuilt)

View file

@ -54,6 +54,8 @@ namespace NLDRIVERGL {
CPixelProgamDrvInfosGL::CPixelProgamDrvInfosGL (CDriverGL *drv, ItGPUPrgDrvInfoPtrList it) : IProgramDrvInfos (drv, it) CPixelProgamDrvInfosGL::CPixelProgamDrvInfosGL (CDriverGL *drv, ItGPUPrgDrvInfoPtrList it) : IProgramDrvInfos (drv, it)
{ {
H_AUTO_OGL(CPixelProgamDrvInfosGL_CPixelProgamDrvInfosGL) H_AUTO_OGL(CPixelProgamDrvInfosGL_CPixelProgamDrvInfosGL)
#ifndef USE_OPENGLES
// Extension must exist // Extension must exist
nlassert(drv->_Extensions.ARBFragmentProgram); nlassert(drv->_Extensions.ARBFragmentProgram);
@ -61,6 +63,7 @@ CPixelProgamDrvInfosGL::CPixelProgamDrvInfosGL (CDriverGL *drv, ItGPUPrgDrvInfoP
{ {
nglGenProgramsARB(1, &ID); nglGenProgramsARB(1, &ID);
} }
#endif
} }
// *************************************************************************** // ***************************************************************************
@ -96,6 +99,7 @@ bool CDriverGL::activePixelProgram(CPixelProgram *program)
bool CDriverGL::compilePixelProgram(NL3D::CPixelProgram *program) bool CDriverGL::compilePixelProgram(NL3D::CPixelProgram *program)
{ {
#ifndef USE_OPENGLES
// Program setuped ? // Program setuped ?
if (program->m_DrvInfo == NULL) if (program->m_DrvInfo == NULL)
{ {
@ -121,6 +125,9 @@ bool CDriverGL::compilePixelProgram(NL3D::CPixelProgram *program)
} }
return true; return true;
#else
return false;
#endif
} }
// *************************************************************************** // ***************************************************************************
@ -129,6 +136,7 @@ bool CDriverGL::activeARBPixelProgram(CPixelProgram *program)
{ {
H_AUTO_OGL(CDriverGL_activeARBPixelProgram) H_AUTO_OGL(CDriverGL_activeARBPixelProgram)
#ifndef USE_OPENGLES
// Setup or unsetup ? // Setup or unsetup ?
if (program) if (program)
{ {
@ -151,14 +159,18 @@ bool CDriverGL::activeARBPixelProgram(CPixelProgram *program)
} }
return true; return true;
#else
return false;
#endif
} }
// *************************************************************************** // ***************************************************************************
bool CDriverGL::setupPixelProgram(CPixelProgram *program, GLuint id/*, bool &specularWritten*/) bool CDriverGL::setupPixelProgram(CPixelProgram *program, GLuint id/*, bool &specularWritten*/)
{ {
H_AUTO_OGL(CDriverGL_setupARBPixelProgram) H_AUTO_OGL(CDriverGL_setupARBPixelProgram);
#ifndef USE_OPENGLES
CPixelProgamDrvInfosGL *drvInfo = static_cast<CPixelProgamDrvInfosGL *>((IProgramDrvInfos *)program->m_DrvInfo); CPixelProgamDrvInfosGL *drvInfo = static_cast<CPixelProgamDrvInfosGL *>((IProgramDrvInfos *)program->m_DrvInfo);
// Find a supported pixel program profile // Find a supported pixel program profile
@ -227,6 +239,9 @@ bool CDriverGL::setupPixelProgram(CPixelProgram *program, GLuint id/*, bool &spe
program->buildInfo(source); program->buildInfo(source);
return true; return true;
#else
return false;
#endif
} }
#ifdef NL_STATIC #ifdef NL_STATIC

View file

@ -23,6 +23,7 @@
#include <X11/Xatom.h> #include <X11/Xatom.h>
#include <X11/keysym.h> #include <X11/keysym.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <X11/XKBlib.h>
#include "nel/misc/debug.h" #include "nel/misc/debug.h"
@ -566,7 +567,7 @@ bool CUnixEventEmitter::processMessage (XEvent &event, CEventServer *server)
} }
else else
{ {
k = XKeycodeToKeysym(_dpy, keyCode, 0); k = XkbKeycodeToKeysym(_dpy, keyCode, 0, 0);
} }
// send CEventKeyDown event only if keyCode is defined // send CEventKeyDown event only if keyCode is defined

View file

@ -264,9 +264,9 @@ void CLodCharacterShapeBuild::compile(const std::vector<bool> &triangleSelection
void CLodCharacterShapeBuild::serial(NLMISC::IStream &f) void CLodCharacterShapeBuild::serial(NLMISC::IStream &f)
{ {
// NEL_CLODBULD // NEL_CLODBULD
f.serialCheck((uint32)'_LEN'); f.serialCheck(NELID("_LEN"));
f.serialCheck((uint32)'DOLC'); f.serialCheck(NELID("DOLC"));
f.serialCheck((uint32)'DLUB'); f.serialCheck(NELID("DLUB"));
/* /*
Version 1: Version 1:
@ -525,9 +525,9 @@ void CLodCharacterShape::CBoneInfluence::serial(NLMISC::IStream &f)
void CLodCharacterShape::serial(NLMISC::IStream &f) void CLodCharacterShape::serial(NLMISC::IStream &f)
{ {
// NEL_CLODSHAP // NEL_CLODSHAP
f.serialCheck((uint32)'_LEN'); f.serialCheck(NELID("_LEN"));
f.serialCheck((uint32)'DOLC'); f.serialCheck(NELID("DOLC"));
f.serialCheck((uint32)'PAHS'); f.serialCheck(NELID("PAHS"));
/* /*
Version 1: Version 1:

View file

@ -152,7 +152,7 @@ void CPackedWorld::getZones(std::vector<TPackedZoneBaseSPtr> &zones)
void CPackedWorld::serialZoneNames(NLMISC::IStream &f) throw(NLMISC::EStream) void CPackedWorld::serialZoneNames(NLMISC::IStream &f) throw(NLMISC::EStream)
{ {
f.serialVersion(1); f.serialVersion(1);
f.serialCheck((uint32) 'OWPA'); f.serialCheck(NELID("OWPA"));
f.serialCont(ZoneNames); f.serialCont(ZoneNames);
} }

View file

@ -73,7 +73,7 @@ CPSLocated::CPSLocated() : /*_MaxNumFaces(0),*/
_ParametricMotion(false), _ParametricMotion(false),
_TriggerOnDeath(false), _TriggerOnDeath(false),
_LastForever(true), _LastForever(true),
_TriggerID((uint32) 'NONE'), _TriggerID(NELID("NONE")),
_NonIntegrableForceNbRefs(0), _NonIntegrableForceNbRefs(0),
_NumIntegrableForceWithDifferentBasis(0) _NumIntegrableForceWithDifferentBasis(0)
{ {

View file

@ -405,7 +405,7 @@ void CInstanceGroup::serial (NLMISC::IStream& f)
* ***********************************************/ * ***********************************************/
// Serial a header // Serial a header
f.serialCheck ((uint32)'TPRG'); f.serialCheck (NELID("TPRG"));
/* /*
Version 5: Version 5:

View file

@ -116,7 +116,7 @@ IShape* CShapeStream::getShapePointer () const
void CShapeStream::serial(NLMISC::IStream &f) throw(NLMISC::EStream) void CShapeStream::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
{ {
// First, serial an header or checking if it is correct // First, serial an header or checking if it is correct
f.serialCheck ((uint32)'PAHS'); f.serialCheck (NELID("PAHS"));
// Then, serial the shape // Then, serial the shape
f.serialPolyPtr (_Shape); f.serialPolyPtr (_Shape);

View file

@ -60,7 +60,7 @@ void CSkeletonWeight::build (const TNodeArray& array)
void CSkeletonWeight::serial (NLMISC::IStream& f) void CSkeletonWeight::serial (NLMISC::IStream& f)
{ {
// Serial a header // Serial a header
f.serialCheck ((uint32)'TWKS'); f.serialCheck (NELID("TWKS"));
// Serial a version number // Serial a version number
(void)f.serialVersion (0); (void)f.serialVersion (0);

View file

@ -104,8 +104,8 @@ const sint CTileFarBank::_Version=0x0;
void CTileFarBank::serial(NLMISC::IStream &f) throw(NLMISC::EStream) void CTileFarBank::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
{ {
// Write/Check "FAR_BANK" in header of the stream // Write/Check "FAR_BANK" in header of the stream
f.serialCheck ((uint32)'_RAF'); f.serialCheck (NELID("_RAF"));
f.serialCheck ((uint32)'KNAB'); f.serialCheck (NELID("KNAB"));
// Serial version // Serial version
(void)f.serialVersion(_Version); (void)f.serialVersion(_Version);

View file

@ -192,10 +192,10 @@ void CVegetableShape::serial(NLMISC::IStream &f)
- BestSidedPreComputeLighting - BestSidedPreComputeLighting
*/ */
sint ver= f.serialVersion(1); sint ver= f.serialVersion(1);
f.serialCheck((uint32)'_LEN'); f.serialCheck(NELID("_LEN"));
f.serialCheck((uint32)'GEV_'); f.serialCheck(NELID("GEV_"));
f.serialCheck((uint32)'BATE'); f.serialCheck(NELID("BATE"));
f.serialCheck((uint32)'__EL'); f.serialCheck(NELID("__EL"));
f.serial(Lighted); f.serial(Lighted);
f.serial(DoubleSided); f.serial(DoubleSided);

View file

@ -885,7 +885,7 @@ bool CVPParser::parseInstruction(CVPInstruction &instr, std::string &errorOutput
} }
// it is not allowed to write to an adress register except for ARL // it is not allowed to write to an adress register except for ARL
if (instrStr != 'ARL ') if (instrStr != NELID("ARL"))
{ {
if (instr.Dest.Type == CVPOperand::AddressRegister) if (instr.Dest.Type == CVPOperand::AddressRegister)
{ {

View file

@ -458,7 +458,7 @@ void CZone::serial(NLMISC::IStream &f)
throw EOlderStream(f); throw EOlderStream(f);
} }
f.serialCheck((uint32)'ENOZ'); f.serialCheck(NELID("ENOZ"));
f.xmlSerial (ZoneId, "ZONE_ID"); f.xmlSerial (ZoneId, "ZONE_ID");
f.xmlSerial (ZoneBB, "BB"); f.xmlSerial (ZoneBB, "BB");

View file

@ -6,26 +6,15 @@ SOURCE_GROUP("src" FILES ${SRC})
NL_TARGET_LIB(nelgui ${SRC} ${HEADERS}) NL_TARGET_LIB(nelgui ${SRC} ${HEADERS})
INCLUDE_DIRECTORIES(${LUA_INCLUDE_DIR} ${LUABIND_INCLUDE_DIR} ${LIBWWW_INCLUDE_DIR})
TARGET_LINK_LIBRARIES(nelgui nelmisc nel3d ${LUA_LIBRARIES} ${LUABIND_LIBRARIES} ${LIBXML2_LIBRARIES} ${LIBWWW_LIBRARIES} ${CURL_LIBRARIES})
SET_TARGET_PROPERTIES(nelgui PROPERTIES LINK_INTERFACE_LIBRARIES "") SET_TARGET_PROPERTIES(nelgui PROPERTIES LINK_INTERFACE_LIBRARIES "")
NL_DEFAULT_PROPS(nelgui "NeL, Library: NeL GUI") NL_DEFAULT_PROPS(nelgui "NeL, Library: NeL GUI")
NL_ADD_RUNTIME_FLAGS(nelgui) NL_ADD_RUNTIME_FLAGS(nelgui)
INCLUDE_DIRECTORIES(${LUA_INCLUDE_DIR} ${LUABIND_INCLUDE_DIR} ${LIBWWW_INCLUDE_DIR})
NL_ADD_LIB_SUFFIX(nelgui) NL_ADD_LIB_SUFFIX(nelgui)
#MESSAGE( "libww libs: ${LIBWWW_LIBRARIES}" )
TARGET_LINK_LIBRARIES( nelgui
nelmisc
nel3d
${LUA_LIBRARIES}
${LUABIND_LIBRARIES}
${LIBXML2_LIBRARIES}
${LIBWWW_LIBRARIES}
${CURL_LIBRARIES}
)
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} ${CURL_DEFINITIONS} ${LUABIND_DEFINITIONS}) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} ${CURL_DEFINITIONS} ${LUABIND_DEFINITIONS})
IF(WITH_PCH) IF(WITH_PCH)
@ -33,5 +22,5 @@ IF(WITH_PCH)
ENDIF(WITH_PCH) ENDIF(WITH_PCH)
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
INSTALL(TARGETS nelgui LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) INSTALL(TARGETS nelgui LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries)
ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)

View file

@ -549,27 +549,27 @@ namespace NLGUI
if( editorMode ) if( editorMode )
{ {
prop = (char*) xmlGetProp( cur, BAD_CAST "onover" ); prop = (char*) xmlGetProp( cur, BAD_CAST "onover" );
if( prop != NULL ) if (prop)
mapAHString( "onover", std::string( (const char*)prop ) ); mapAHString( "onover", std::string( (const char*)prop ) );
prop = (char*) xmlGetProp( cur, BAD_CAST "onclick_l" ); prop = (char*) xmlGetProp( cur, BAD_CAST "onclick_l" );
if( prop != NULL ) if (prop)
mapAHString( "onclick_l", std::string( (const char*)prop ) ); mapAHString( "onclick_l", std::string( (const char*)prop ) );
prop = (char*) xmlGetProp( cur, BAD_CAST "ondblclick_l" ); prop = (char*) xmlGetProp( cur, BAD_CAST "ondblclick_l" );
if( prop != NULL ) if (prop)
mapAHString( "ondblclick_l", std::string( (const char*)prop ) ); mapAHString( "ondblclick_l", std::string( (const char*)prop ) );
prop = (char*) xmlGetProp( cur, BAD_CAST "onclick_r" ); prop = (char*) xmlGetProp( cur, BAD_CAST "onclick_r" );
if( prop != NULL ) if (prop)
mapAHString( "onclick_r", std::string( (const char*)prop ) ); mapAHString( "onclick_r", std::string( (const char*)prop ) );
prop = (char*) xmlGetProp( cur, BAD_CAST "onlongclick_l" ); prop = (char*) xmlGetProp( cur, BAD_CAST "onlongclick_l" );
if( prop != NULL ) if (prop)
mapAHString( "onlongclick_l", std::string( (const char*)prop ) ); mapAHString( "onlongclick_l", std::string( (const char*)prop ) );
prop = (char*) xmlGetProp( cur, BAD_CAST "onclock_tick" ); prop = (char*) xmlGetProp( cur, BAD_CAST "onclock_tick" );
if( prop != NULL ) if (prop)
mapAHString( "onclock_tick", std::string( (const char*)prop ) ); mapAHString( "onclock_tick", std::string( (const char*)prop ) );
} }

View file

@ -2233,35 +2233,35 @@ namespace NLGUI
if( editorMode ) if( editorMode )
{ {
ptr = xmlGetProp( cur, BAD_CAST "on_open" ); ptr = xmlGetProp( cur, BAD_CAST "on_open" );
if( ptr != NULL ) if( ptr )
mapAHString( "on_open", std::string( (const char*)ptr ) ); mapAHString( "on_open", std::string( (const char*)ptr ) );
ptr = xmlGetProp( cur, BAD_CAST "on_close" ); ptr = xmlGetProp( cur, BAD_CAST "on_close" );
if( ptr != NULL ) if( ptr )
mapAHString( "on_close", std::string( (const char*)ptr ) ); mapAHString( "on_close", std::string( (const char*)ptr ) );
ptr = xmlGetProp( cur, BAD_CAST "on_close_button" ); ptr = xmlGetProp( cur, BAD_CAST "on_close_button" );
if( ptr != NULL ) if( ptr )
mapAHString( "on_close_button", std::string( (const char*)ptr ) ); mapAHString( "on_close_button", std::string( (const char*)ptr ) );
ptr = xmlGetProp( cur, BAD_CAST "on_move" ); ptr = xmlGetProp( cur, BAD_CAST "on_move" );
if( ptr != NULL ) if( ptr )
mapAHString( "on_move", std::string( (const char*)ptr ) ); mapAHString( "on_move", std::string( (const char*)ptr ) );
ptr = xmlGetProp( cur, BAD_CAST "on_deactive_check" ); ptr = xmlGetProp( cur, BAD_CAST "on_deactive_check" );
if( ptr != NULL ) if( ptr )
mapAHString( "on_deactive_check", std::string( (const char*)ptr ) ); mapAHString( "on_deactive_check", std::string( (const char*)ptr ) );
ptr = xmlGetProp( cur, BAD_CAST "on_resize" ); ptr = xmlGetProp( cur, BAD_CAST "on_resize" );
if( ptr != NULL ) if( ptr )
mapAHString( "on_resize", std::string( (const char*)ptr ) ); mapAHString( "on_resize", std::string( (const char*)ptr ) );
ptr = xmlGetProp( cur, BAD_CAST "on_alpha_settings_changed" ); ptr = xmlGetProp( cur, BAD_CAST "on_alpha_settings_changed" );
if( ptr != NULL ) if( ptr )
mapAHString( "on_alpha_settings_changed", std::string( (const char*)ptr ) ); mapAHString( "on_alpha_settings_changed", std::string( (const char*)ptr ) );
ptr = xmlGetProp( cur, BAD_CAST "on_begin_move" ); ptr = xmlGetProp( cur, BAD_CAST "on_begin_move" );
if( ptr != NULL ) if( ptr )
mapAHString( "on_begin_move", std::string( (const char*)ptr ) ); mapAHString( "on_begin_move", std::string( (const char*)ptr ) );
} }

View file

@ -540,7 +540,7 @@ namespace NLGUI
if( editorMode ) if( editorMode )
{ {
prop = (char*) xmlGetProp( cur, BAD_CAST "onenter" ); prop = (char*) xmlGetProp( cur, BAD_CAST "onenter" );
if( prop != NULL ) if (prop)
mapAHString( "onenter", std::string( (const char*)prop ) ); mapAHString( "onenter", std::string( (const char*)prop ) );
} }

View file

@ -244,29 +244,29 @@ namespace NLGUI
// read modal option // read modal option
CXMLAutoPtr prop; CXMLAutoPtr prop;
prop = xmlGetProp (cur, (xmlChar*)"mouse_pos"); prop = xmlGetProp (cur, (xmlChar*)"mouse_pos");
if ( prop ) SpawnOnMousePos= convertBool(prop); if (prop) SpawnOnMousePos= convertBool(prop);
prop = xmlGetProp (cur, (xmlChar*)"exit_click_out"); prop = xmlGetProp (cur, (xmlChar*)"exit_click_out");
if ( prop ) ExitClickOut= convertBool(prop); if (prop) ExitClickOut= convertBool(prop);
prop = xmlGetProp (cur, (xmlChar*)"exit_click_l"); prop = xmlGetProp (cur, (xmlChar*)"exit_click_l");
if ( prop ) ExitClickL= convertBool(prop); if (prop) ExitClickL= convertBool(prop);
prop = xmlGetProp (cur, (xmlChar*)"exit_click_r"); prop = xmlGetProp (cur, (xmlChar*)"exit_click_r");
if ( prop ) ExitClickR= convertBool(prop); if (prop) ExitClickR= convertBool(prop);
prop = xmlGetProp (cur, (xmlChar*)"exit_click_b"); prop = xmlGetProp (cur, (xmlChar*)"exit_click_b");
if ( prop ) ExitClickR= ExitClickL= convertBool(prop); if (prop) ExitClickR= ExitClickL= convertBool(prop);
prop = xmlGetProp (cur, (xmlChar*)"force_inside_screen"); prop = xmlGetProp (cur, (xmlChar*)"force_inside_screen");
if ( prop ) ForceInsideScreen= convertBool(prop); if (prop) ForceInsideScreen= convertBool(prop);
prop = xmlGetProp (cur, (xmlChar*)"category"); prop = xmlGetProp (cur, (xmlChar*)"category");
if ( prop ) Category= (const char *) prop; if (prop) Category= (const char *) prop;
prop = xmlGetProp (cur, (xmlChar*)"onclick_out"); prop = xmlGetProp (cur, (xmlChar*)"onclick_out");
if ( prop ) OnClickOut = (const char *) prop; if (prop) OnClickOut = (const char *) prop;
prop = xmlGetProp (cur, (xmlChar*)"onclick_out_params"); prop = xmlGetProp (cur, (xmlChar*)"onclick_out_params");
if ( prop ) OnClickOutParams = (const char *) prop; if (prop) OnClickOutParams = (const char *) prop;
prop = xmlGetProp (cur, (xmlChar*)"onpostclick_out"); prop = xmlGetProp (cur, (xmlChar*)"onpostclick_out");
if ( prop ) OnPostClickOut = (const char *) prop; if (prop) OnPostClickOut = (const char *) prop;
prop = xmlGetProp (cur, (xmlChar*)"onpostclick_out_params"); prop = xmlGetProp (cur, (xmlChar*)"onpostclick_out_params");
if ( prop ) OnPostClickOutParams = (const char *) prop; if (prop) OnPostClickOutParams = (const char *) prop;
prop = xmlGetProp (cur, (xmlChar*)"exit_key_pushed"); prop = xmlGetProp (cur, (xmlChar*)"exit_key_pushed");
if ( prop ) ExitKeyPushed= convertBool(prop); if (prop) ExitKeyPushed= convertBool(prop);
// Force parent hotspot for spawn on mouse // Force parent hotspot for spawn on mouse
if(SpawnOnMousePos) if(SpawnOnMousePos)

View file

@ -119,11 +119,11 @@ namespace NLGUI
if( editorMode ) if( editorMode )
{ {
CXMLAutoPtr ptr( (char*) xmlGetProp( cur, BAD_CAST "on_wheel_up" ) ); CXMLAutoPtr ptr( (char*) xmlGetProp( cur, BAD_CAST "on_wheel_up" ) );
if( ptr != NULL ) if( ptr )
mapAHString( "on_wheel_up", std::string( (const char*)ptr ) ); mapAHString( "on_wheel_up", std::string( (const char*)ptr ) );
ptr = (char*) xmlGetProp( cur, BAD_CAST "on_wheel_down" ); ptr = (char*) xmlGetProp( cur, BAD_CAST "on_wheel_down" );
if( ptr != NULL ) if( ptr )
mapAHString( "on_wheel_down", std::string( (const char*)ptr ) ); mapAHString( "on_wheel_down", std::string( (const char*)ptr ) );
} }

View file

@ -349,27 +349,27 @@ namespace NLGUI
if( editorMode ) if( editorMode )
{ {
ptr = (char*) xmlGetProp( cur, BAD_CAST "on_active" ); ptr = (char*) xmlGetProp( cur, BAD_CAST "on_active" );
if( ptr != NULL ) if( ptr )
mapAHString( "on_active", std::string( (const char*)ptr ) ); mapAHString( "on_active", std::string( (const char*)ptr ) );
ptr = (char*) xmlGetProp( cur, BAD_CAST "on_deactive" ); ptr = (char*) xmlGetProp( cur, BAD_CAST "on_deactive" );
if( ptr != NULL ) if( ptr )
mapAHString( "on_deactive", std::string( (const char*)ptr ) ); mapAHString( "on_deactive", std::string( (const char*)ptr ) );
ptr = (char*) xmlGetProp( cur, BAD_CAST "group_onclick_r" ); ptr = (char*) xmlGetProp( cur, BAD_CAST "group_onclick_r" );
if( ptr != NULL ) if( ptr )
mapAHString( "group_onclick_r", std::string( (const char*)ptr ) ); mapAHString( "group_onclick_r", std::string( (const char*)ptr ) );
ptr = (char*) xmlGetProp( cur, BAD_CAST "group_onclick_l" ); ptr = (char*) xmlGetProp( cur, BAD_CAST "group_onclick_l" );
if( ptr != NULL ) if( ptr )
mapAHString( "group_onclick_l", std::string( (const char*)ptr ) ); mapAHString( "group_onclick_l", std::string( (const char*)ptr ) );
ptr = (char*) xmlGetProp( cur, BAD_CAST "on_enter" ); ptr = (char*) xmlGetProp( cur, BAD_CAST "on_enter" );
if( ptr != NULL ) if( ptr )
mapAHString( "on_enter", std::string( (const char*)ptr ) ); mapAHString( "on_enter", std::string( (const char*)ptr ) );
ptr = (char*) xmlGetProp( cur, BAD_CAST "on_escape" ); ptr = (char*) xmlGetProp( cur, BAD_CAST "on_escape" );
if( ptr != NULL ) if( ptr )
mapAHString( "on_escape", std::string( (const char*)ptr ) ); mapAHString( "on_escape", std::string( (const char*)ptr ) );
} }

View file

@ -41,7 +41,7 @@
#ifdef LUA_NEVRAX_VERSION #ifdef LUA_NEVRAX_VERSION
#include "lua_ide_dll_nevrax/include/lua_ide_dll/ide_interface.h" // external debugger #include "lua_ide_dll_nevrax/include/lua_ide_dll/ide_interface.h" // external debugger
#endif #endif
const uint32 UI_CACHE_SERIAL_CHECK = (uint32) 'IUG_'; const uint32 UI_CACHE_SERIAL_CHECK = NELID("IUG_");
using namespace NLMISC; using namespace NLMISC;
using namespace std; using namespace std;
@ -1001,7 +1001,7 @@ namespace NLGUI
ptr = (char*) xmlGetProp (cur, (xmlChar*)"target"); ptr = (char*) xmlGetProp (cur, (xmlChar*)"target");
std::string target; std::string target;
if( ptr != NULL ) if( ptr )
{ {
target = std::string( (const char*)ptr ); target = std::string( (const char*)ptr );
if( !editorMode ) if( !editorMode )
@ -1136,17 +1136,17 @@ namespace NLGUI
VariableData data; VariableData data;
ptr = xmlGetProp( cur, BAD_CAST "entry" ); ptr = xmlGetProp( cur, BAD_CAST "entry" );
if( ptr != NULL ) if( ptr )
data.entry = std::string( (const char*)ptr ); data.entry = std::string( (const char*)ptr );
data.type = type; data.type = type;
ptr = xmlGetProp( cur, BAD_CAST "value" ); ptr = xmlGetProp( cur, BAD_CAST "value" );
if( ptr != NULL ) if( ptr )
data.value = std::string( (const char*)ptr ); data.value = std::string( (const char*)ptr );
ptr = xmlGetProp( cur, BAD_CAST "size" ); ptr = xmlGetProp( cur, BAD_CAST "size" );
if( ptr != NULL ) if( ptr )
fromString( std::string( (const char*)ptr ), data.size ); fromString( std::string( (const char*)ptr ), data.size );
variableCache[ data.entry ] = data; variableCache[ data.entry ] = data;

View file

@ -80,7 +80,7 @@ void CMaterial::serial (NLMISC::IStream &s)
s.xmlPush ("LIGO_MATERIAL"); s.xmlPush ("LIGO_MATERIAL");
// Serial the header // Serial the header
s.serialCheck ((uint32)'TMOL'); s.serialCheck (NELID("TMOL"));
// Serial the version // Serial the version
/*sint ver =*/ s.serialVersion (0); /*sint ver =*/ s.serialVersion (0);

View file

@ -199,7 +199,7 @@ void CTransition::serial (NLMISC::IStream &s)
s.xmlPush ("LIGO_TRANSITION"); s.xmlPush ("LIGO_TRANSITION");
// Serial the header // Serial the header
s.serialCheck ((uint32)'STGL'); s.serialCheck (NELID("STGL"));
// Serial the version // Serial the version
/*sint ver =*/ s.serialVersion (0); /*sint ver =*/ s.serialVersion (0);

View file

@ -153,7 +153,7 @@ void CZoneRegion::serial (NLMISC::IStream &f)
f.xmlPush ("LAND"); f.xmlPush ("LAND");
sint32 version = f.serialVersion (1); sint32 version = f.serialVersion (1);
f.serialCheck ((uint32)'DNAL'); f.serialCheck (NELID("DNAL"));
f.xmlSerial (_MinX, "MIN_X"); f.xmlSerial (_MinX, "MIN_X");
f.xmlSerial (_MinY, "MIN_Y"); f.xmlSerial (_MinY, "MIN_Y");

View file

@ -231,7 +231,14 @@ string CSystemInfo::getOS()
} }
else if ( osvi.dwMajorVersion == 6 ) else if ( osvi.dwMajorVersion == 6 )
{ {
if ( osvi.dwMinorVersion == 1 ) if ( osvi.dwMinorVersion == 2 )
{
if( osvi.wProductType == VER_NT_WORKSTATION )
OSString += " Windows 8";
else
OSString += " Windows Server 2012";
}
else if ( osvi.dwMinorVersion == 1 )
{ {
if( osvi.wProductType == VER_NT_WORKSTATION ) if( osvi.wProductType == VER_NT_WORKSTATION )
OSString += " Windows 7"; OSString += " Windows 7";

View file

@ -16,6 +16,7 @@
#include "stdpacs.h" #include "stdpacs.h"
#include "nel/misc/i_xml.h" #include "nel/misc/i_xml.h"
#include "nel/misc/stream.h"
#include "nel/pacs/primitive_block.h" #include "nel/pacs/primitive_block.h"
@ -85,7 +86,7 @@ void CPrimitiveBlock::serial (NLMISC::IStream &s)
s.xmlPush ("PRIMITIVE_BLOCK"); s.xmlPush ("PRIMITIVE_BLOCK");
// Serial checks // Serial checks
s.serialCheck ((uint32)'KBRP'); s.serialCheck (NELID("KBRP"));
// Serial the version // Serial the version
(void)s.serialVersion (0); (void)s.serialVersion (0);

View file

@ -1711,8 +1711,8 @@ void CObjectViewer::serial (NLMISC::IStream& f)
{ {
// version 4: include particle workspace infos // version 4: include particle workspace infos
// serial "OBJV_CFG" // serial "OBJV_CFG"
f.serialCheck ((uint32)'VJBO'); f.serialCheck (NELID("VJBO"));
f.serialCheck ((uint32)'GFC_'); f.serialCheck (NELID("GFC_"));
// serial the version // serial the version
int ver=f.serialVersion (4); int ver=f.serialVersion (4);

View file

@ -1,7 +1,8 @@
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${LIBXML2_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR}
${QT_INCLUDES}) ${QT_INCLUDES}
${LUA_INCLUDE_DIR})
FILE(GLOB SRC *.cpp *.h) FILE(GLOB SRC *.cpp *.h)
@ -71,6 +72,7 @@ TARGET_LINK_LIBRARIES(
nelgui nelgui
${QT_LIBRARIES} ${QT_LIBRARIES}
${QT_QTOPENGL_LIBRARY} ${QT_QTOPENGL_LIBRARY}
${LIBXML2_LIBRARIES}
qt_property_browser qt_property_browser
) )

View file

@ -253,10 +253,7 @@
</layout> </layout>
</item> </item>
</layout> </layout>
<zorder>horizontalLayoutWidget</zorder>
<zorder>dataDirLabel</zorder> <zorder>dataDirLabel</zorder>
<zorder>horizontalLayoutWidget</zorder>
<zorder></zorder>
</widget> </widget>
</item> </item>
</layout> </layout>

View file

@ -50,8 +50,8 @@ void CSchemeManager::getSchemes(const std::string &type, std::vector<TSchemeInfo
void CSchemeManager::serial(NLMISC::IStream &f) throw(NLMISC::EStream) void CSchemeManager::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
{ {
f.serialCheck((uint32) '_GNM'); f.serialCheck(NELID("_GNM"));
f.serialCheck((uint32) 'MHCS'); f.serialCheck(NELID("MHCS"));
f.serialVersion(1); f.serialVersion(1);
if (!f.isReading()) if (!f.isReading())
{ {

View file

@ -42,15 +42,15 @@ static void compressMipMap(uint8 *pixSrc, sint width, sint height, vector<uint8
case DXT1: case DXT1:
case DXT1A: case DXT1A:
flags |= squish::kDxt1; flags |= squish::kDxt1;
dest.ddpf.dwFourCC = MAKEFOURCC('D','X', 'T', '1'); dest.ddpf.dwFourCC = MAKEFOURCC('D', 'X', 'T', '1');
break; break;
case DXT3: case DXT3:
flags |= squish::kDxt3; flags |= squish::kDxt3;
dest.ddpf.dwFourCC = MAKEFOURCC('D','X', 'T', '3'); dest.ddpf.dwFourCC = MAKEFOURCC('D', 'X', 'T', '3');
break; break;
case DXT5: case DXT5:
flags |= squish::kDxt5; flags |= squish::kDxt5;
dest.ddpf.dwFourCC = MAKEFOURCC('D','X', 'T', '5'); dest.ddpf.dwFourCC = MAKEFOURCC('D', 'X', 'T', '5');
break; break;
} }

View file

@ -154,7 +154,7 @@ private:
/// Serializes /// Serializes
void serial(NLMISC::IStream &f) void serial(NLMISC::IStream &f)
{ {
f.serialCheck((uint32)('PCHK')); f.serialCheck(NELID("PCHK"));
f.serialVersion(0); f.serialVersion(0);
if (f.isReading()) if (f.isReading())

View file

@ -1,5 +1,4 @@
FIND_PACKAGE(MySQL) FIND_PACKAGE(MySQL)
FIND_PACKAGE(CURL)
IF(WITH_NELNS_SERVER) IF(WITH_NELNS_SERVER)
ADD_SUBDIRECTORY(admin_executor_service) ADD_SUBDIRECTORY(admin_executor_service)

View file

@ -10,7 +10,7 @@ TARGET_LINK_LIBRARIES(nel_launcher_ext2
nelnet nelnet
nelmisc nelmisc
${ZLIB_LIBRARY} ${ZLIB_LIBRARY}
${CURL_LIBRARY}) ${CURL_LIBRARIES})
NL_DEFAULT_PROPS(nel_launcher_ext2 "NeLNS, Launcher: NeL Launcher Ext2") NL_DEFAULT_PROPS(nel_launcher_ext2 "NeLNS, Launcher: NeL Launcher Ext2")
NL_ADD_RUNTIME_FLAGS(nel_launcher_ext2) NL_ADD_RUNTIME_FLAGS(nel_launcher_ext2)

View file

@ -24,15 +24,9 @@ IF(WITH_RYZOM_TOOLS)
ADD_SUBDIRECTORY(tools) ADD_SUBDIRECTORY(tools)
ENDIF(WITH_RYZOM_TOOLS) ENDIF(WITH_RYZOM_TOOLS)
IF(WITH_RYZOM_SERVER) IF(WITH_RYZOM_SERVER OR WITH_RYZOM_TOOLS)
FIND_PACKAGE(MySQL REQUIRED)
ADD_SUBDIRECTORY(server)
ELSEIF(WITH_RYZOM_TOOLS)
# Need servershare for build packed collision tool # Need servershare for build packed collision tool
# Need aishare for build wmap tool # Need aishare for build wmap tool
FIND_PACKAGE(MySQL REQUIRED)
ADD_SUBDIRECTORY(server) ADD_SUBDIRECTORY(server)
ENDIF(WITH_RYZOM_SERVER OR WITH_RYZOM_TOOLS)
ENDIF(WITH_RYZOM_SERVER)

View file

@ -488,7 +488,7 @@ void CCharacterCL::stopAttachedFXForCurrrentAnim(bool stopLoopingFX)
{ {
if(!(*tmpItAttached)->FX.empty()) if(!(*tmpItAttached)->FX.empty())
{ {
if (!(*tmpItAttached)->FX.removeByID('STOP') && !(*tmpItAttached)->FX.removeByID('main')) if (!(*tmpItAttached)->FX.removeByID(NELID("STOP")) && !(*tmpItAttached)->FX.removeByID(NELID("main")))
{ {
(*tmpItAttached)->FX.activateEmitters(false); (*tmpItAttached)->FX.activateEmitters(false);
} }
@ -9373,7 +9373,7 @@ void CCharacterCL::CWornItem::enableAdvantageFX(NL3D::UInstance parent)
if (!enabled) if (!enabled)
{ {
// well, it is unlikely that player will loses its ability to master an item after he gained it, but manage the case anyway. // well, it is unlikely that player will loses its ability to master an item after he gained it, but manage the case anyway.
if (!AdvantageFX.removeByID('STOP') && !AdvantageFX.removeByID('main')) if (!AdvantageFX.removeByID(NELID("STOP")) && !AdvantageFX.removeByID(NELID("main")))
{ {
AdvantageFX.activateEmitters(false); AdvantageFX.activateEmitters(false);
} }

View file

@ -263,7 +263,7 @@ CFxCL::~CFxCL()
// Stop emitters // Stop emitters
UParticleSystemInstance fxInst; UParticleSystemInstance fxInst;
fxInst.cast (_Instance); fxInst.cast (_Instance);
if (!fxInst.removeByID( 'STOP' ) && !fxInst.removeByID( 'main' ) ) if (!fxInst.removeByID(NELID("STOP")) && !fxInst.removeByID(NELID("main")))
{ {
fxInst.activateEmitters( false ); fxInst.activateEmitters( false );
} }

View file

@ -77,7 +77,7 @@ protected:
float TimeOut; float TimeOut;
bool TestNoMoreParticles; bool TestNoMoreParticles;
public: public:
CFX2Remove(NL3D::UParticleSystemInstance instance=NL3D::UParticleSystemInstance(), float timeOut = NULL, bool testNoMoreParticles = false) CFX2Remove(NL3D::UParticleSystemInstance instance=NL3D::UParticleSystemInstance(), float timeOut = 0.f, bool testNoMoreParticles = false)
{ {
Instance = instance; Instance = instance;
TimeOut = timeOut; TimeOut = timeOut;

View file

@ -47,8 +47,8 @@ void CHairSet::init (NLMISC::IProgressCallback &progress)
const CItemSheet *item = SheetMngr.getItem(SLOTTYPE::HEAD_SLOT, k); const CItemSheet *item = SheetMngr.getItem(SLOTTYPE::HEAD_SLOT, k);
if( (item) && (!item->getShape().empty()) ) if( (item) && (!item->getShape().empty()) )
{ {
std::string itemName = item->getShape(); std::string itemName = NLMISC::toLower(item->getShape());
itemName = NLMISC::strlwr(itemName);
if (item->getShape().find("cheveux", 0) != std::string::npos) if (item->getShape().find("cheveux", 0) != std::string::npos)
{ {
// get race // get race

View file

@ -64,7 +64,7 @@ bool CPositionState::getPos(sint32 &px, sint32 &py)
// *************************************************************************** // ***************************************************************************
void CPositionState::serialNodeLeaf(NLMISC::IStream &f, CCDBNodeLeaf *&dbNode) void CPositionState::serialNodeLeaf(NLMISC::IStream &f, CCDBNodeLeaf *&dbNode)
{ {
f.serialCheck((uint32) 'NL__'); f.serialCheck(NELID("NL__"));
f.serialVersion(0); f.serialVersion(0);
std::string dbPath; std::string dbPath;
if (f.isReading()) if (f.isReading())
@ -85,18 +85,18 @@ void CPositionState::serialNodeLeaf(NLMISC::IStream &f, CCDBNodeLeaf *&dbNode)
} }
f.serial(dbPath); f.serial(dbPath);
} }
f.serialCheck((uint32) 'END_'); f.serialCheck(NELID("END_"));
} }
// *************************************************************************** // ***************************************************************************
void CUIDEntityPositionState::serial(NLMISC::IStream &f) void CUIDEntityPositionState::serial(NLMISC::IStream &f)
{ {
f.serialCheck((uint32) 'UIDE'); f.serialCheck(NELID("UIDE"));
f.serialVersion(0); f.serialVersion(0);
serialNodeLeaf(f, _DBPos); serialNodeLeaf(f, _DBPos);
serialNodeLeaf(f, _Uid); serialNodeLeaf(f, _Uid);
f.serialCheck((uint32) '_END'); f.serialCheck(NELID("_END"));
} }
// *************************************************************************** // ***************************************************************************
@ -241,11 +241,11 @@ bool CAnimalPositionState::getPos(sint32 &px, sint32 &py)
// *************************************************************************** // ***************************************************************************
void CAnimalPositionState::serial(NLMISC::IStream &f) void CAnimalPositionState::serial(NLMISC::IStream &f)
{ {
f.serialCheck((uint32) 'APS_'); f.serialCheck(NELID("APS_"));
f.serialVersion(0); f.serialVersion(0);
CUIDEntityPositionState::serial(f); CUIDEntityPositionState::serial(f);
serialNodeLeaf(f, _Status); serialNodeLeaf(f, _Status);
f.serialCheck((uint32) 'END_'); f.serialCheck(NELID("END_"));
} }
@ -257,7 +257,7 @@ void CAnimalPositionState::serial(NLMISC::IStream &f)
// *************************************************************************** // ***************************************************************************
CEntityCL *CNamedEntityPositionState::getEntity() CEntityCL *CNamedEntityPositionState::getEntity()
{ {
if (!dbOk()) return false; if (!dbOk()) return NULL;
return EntitiesMngr.getEntityByName(_Name->getValue32()); return EntitiesMngr.getEntityByName(_Name->getValue32());
} }
@ -299,11 +299,11 @@ bool CDialogEntityPositionState::getDbPos(sint32 &px, sint32 &py)
// *************************************************************************** // ***************************************************************************
void CNamedEntityPositionState::serial(NLMISC::IStream &f) void CNamedEntityPositionState::serial(NLMISC::IStream &f)
{ {
f.serialCheck((uint32) 'NEPS'); f.serialCheck(NELID("NEPS"));
f.serialVersion(0); f.serialVersion(0);
serialNodeLeaf(f, _Name); serialNodeLeaf(f, _Name);
serialNodeLeaf(f, _X); serialNodeLeaf(f, _X);
serialNodeLeaf(f, _Y); serialNodeLeaf(f, _Y);
f.serialCheck((uint32) 'END_'); f.serialCheck(NELID("END_"));
} }

View file

@ -591,7 +591,7 @@ bool CDBCtrlSheet::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup)
return false; return false;
prop = (char*) xmlGetProp( cur, (xmlChar*)"dragable" ); prop = (char*) xmlGetProp( cur, (xmlChar*)"dragable" );
if( prop != NULL ) if (prop)
setDraggable( CInterfaceElement::convertBool(prop) ); setDraggable( CInterfaceElement::convertBool(prop) );
else else
setDraggable( false ); setDraggable( false );

View file

@ -110,7 +110,7 @@ bool CDBGroupListSheet::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup)
// value // value
prop = xmlGetProp (cur, (xmlChar*)"value"); prop = xmlGetProp (cur, (xmlChar*)"value");
if ( prop ) if (prop)
{ {
// get a branch in the database. // get a branch in the database.
CCDBNodeBranch *branch= NLGUI::CDBManager::getInstance()->getDbBranch(prop); CCDBNodeBranch *branch= NLGUI::CDBManager::getInstance()->getDbBranch(prop);

View file

@ -94,7 +94,7 @@ bool CDBGroupListSheetText::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup)
// value // value
prop = xmlGetProp (cur, (xmlChar*)"value"); prop = xmlGetProp (cur, (xmlChar*)"value");
if ( prop ) if (prop)
{ {
// get a branch in the database. // get a branch in the database.
CCDBNodeBranch *branch= NLGUI::CDBManager::getInstance()->getDbBranch(prop); CCDBNodeBranch *branch= NLGUI::CDBManager::getInstance()->getDbBranch(prop);

View file

@ -23,7 +23,7 @@
void CFilteredChatSummary::serial(NLMISC::IStream &f) throw(NLMISC::EStream) void CFilteredChatSummary::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
{ {
sint ver= f.serialVersion(2); sint ver= f.serialVersion(2);
f.serialCheck((uint32) 'USHC'); f.serialCheck(NELID("USHC"));
f.serial(SrcGuild); f.serial(SrcGuild);
f.serial(SrcTeam); f.serial(SrcTeam);
f.serial(SrcAroundMe); f.serial(SrcAroundMe);
@ -42,7 +42,7 @@ void CFilteredChatSummary::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
void CFilteredDynChatSummary::serial(NLMISC::IStream &f) throw(NLMISC::EStream) void CFilteredDynChatSummary::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
{ {
sint ver = f.serialVersion(0); sint ver = f.serialVersion(0);
f.serialCheck((uint32) 'USHC'); f.serialCheck(NELID("USHC"));
if (ver >= 0) if (ver >= 0)
{ {
for (uint8 i = 0; i < CChatGroup::MaxDynChanPerPlayer; i++) for (uint8 i = 0; i < CChatGroup::MaxDynChanPerPlayer; i++)

View file

@ -68,7 +68,7 @@ void CCompassTarget::serial(NLMISC::IStream &f)
return; return;
} }
} }
f.serialCheck((uint32) 'CTAR'); f.serialCheck(NELID("CTAR"));
f.serialVersion(0); f.serialVersion(0);
f.serial(Pos); f.serial(Pos);
// for the name, try to save a string identifier if possible, because language may be changed between // for the name, try to save a string identifier if possible, because language may be changed between
@ -95,7 +95,7 @@ void CCompassTarget::serial(NLMISC::IStream &f)
_PositionState = NULL; _PositionState = NULL;
} }
} }
f.serialCheck((uint32) '_END'); f.serialCheck(NELID("_END"));
// if language has been modified, then we are not able to display correctly the name, so just // if language has been modified, then we are not able to display correctly the name, so just
// reset the compass to north to avoid incoherency // reset the compass to north to avoid incoherency
if (f.isReading()) if (f.isReading())
@ -811,18 +811,19 @@ void CGroupCompasMenu::setActive (bool state)
uint nbUserLandMarks = std::min( uint(currCont->UserLandMarks.size()), CContinent::getMaxNbUserLandMarks() ); uint nbUserLandMarks = std::min( uint(currCont->UserLandMarks.size()), CContinent::getMaxNbUserLandMarks() );
// Sort the landmarks // Sort the landmarks
std::sort(currCont->UserLandMarks.begin(), currCont->UserLandMarks.end(), UserLandMarksSortPredicate); std::vector<CUserLandMark> sortedLandmarks(currCont->UserLandMarks);
std::sort(sortedLandmarks.begin(), sortedLandmarks.end(), UserLandMarksSortPredicate);
for(k = 0; k < nbUserLandMarks; ++k) for(k = 0; k < nbUserLandMarks; ++k)
{ {
if (currCont->UserLandMarks[k].Type < CUserLandMark::UserLandMarkTypeCount) if (sortedLandmarks[k].Type < CUserLandMark::UserLandMarkTypeCount)
{ {
CCompassTarget ct; CCompassTarget ct;
ct.setType(CCompassTarget::UserLandMark); ct.setType(CCompassTarget::UserLandMark);
ct.Pos = currCont->UserLandMarks[k].Pos; ct.Pos = sortedLandmarks[k].Pos;
ct.Name = currCont->UserLandMarks[k].Title; ct.Name = sortedLandmarks[k].Title;
Targets.push_back(ct); Targets.push_back(ct);
landMarkSubMenus[currCont->UserLandMarks[k].Type]->addLine(ct.Name, "set_compas", toString("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str())); landMarkSubMenus[sortedLandmarks[k].Type]->addLine(ct.Name, "set_compas", toString("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str()));
selectable= true; selectable= true;
} }
} }

View file

@ -1663,7 +1663,7 @@ bool CInterfaceManager::loadConfig (const string &filename)
// serial user chats info (serial it before position of windows so that they can be updated properly) // serial user chats info (serial it before position of windows so that they can be updated properly)
if (ver >= 1) if (ver >= 1)
{ {
f.serialCheck(uint32('_ICU')); f.serialCheck(NELID("_ICU"));
if (!PeopleInterraction.loadUserChatsInfos(f)) if (!PeopleInterraction.loadUserChatsInfos(f))
{ {
nlwarning("Bad user chat saving"); nlwarning("Bad user chat saving");
@ -1671,7 +1671,7 @@ bool CInterfaceManager::loadConfig (const string &filename)
} }
// header // header
f.serialCheck(uint32('GFCI')); f.serialCheck(NELID("GFCI"));
f.serial(nNbMode); f.serial(nNbMode);
f.serial(_CurrentMode); f.serial(_CurrentMode);
if(ver>=10) if(ver>=10)
@ -1897,7 +1897,7 @@ bool CInterfaceManager::saveConfig (const string &filename)
f.serialVersion(ICFG_STREAM_VERSION); f.serialVersion(ICFG_STREAM_VERSION);
// serial user chats info (serial it before position of windows so that they can be updated properly) // serial user chats info (serial it before position of windows so that they can be updated properly)
f.serialCheck(uint32('_ICU')); f.serialCheck(NELID("_ICU"));
if (!PeopleInterraction.saveUserChatsInfos(f)) if (!PeopleInterraction.saveUserChatsInfos(f))
{ {
nlwarning("Config saving failed"); nlwarning("Config saving failed");
@ -1907,7 +1907,7 @@ bool CInterfaceManager::saveConfig (const string &filename)
} }
// header // header
f.serialCheck(uint32('GFCI')); f.serialCheck(NELID("GFCI"));
f.serial(i); f.serial(i);
f.serial(_CurrentMode); f.serial(_CurrentMode);
f.serial(_LastInGameScreenW); f.serial(_LastInGameScreenW);

View file

@ -1695,14 +1695,14 @@ bool CPeopleInterraction::saveUserChatsInfos(NLMISC::IStream &f)
try try
{ {
sint ver= f.serialVersion(USER_CHATS_INFO_VERSION); sint ver= f.serialVersion(USER_CHATS_INFO_VERSION);
f.serialCheck((uint32) 'TAHC'); f.serialCheck(NELID("TAHC"));
//saveFilteredChat(f, MainChat); //saveFilteredChat(f, MainChat);
saveFilteredChat(f, ChatGroup); saveFilteredChat(f, ChatGroup);
for(uint k = 0; k < MaxNumUserChats; ++k) for(uint k = 0; k < MaxNumUserChats; ++k)
{ {
saveFilteredChat(f, UserChat[k]); saveFilteredChat(f, UserChat[k]);
} }
f.serialCheck((uint32) 'TAHC'); f.serialCheck(NELID("TAHC"));
if (ver>=1) if (ver>=1)
{ {
CChatGroupWindow *pCGW = PeopleInterraction.getChatGroupWindow(); CChatGroupWindow *pCGW = PeopleInterraction.getChatGroupWindow();
@ -1732,7 +1732,7 @@ bool CPeopleInterraction::saveUserDynChatsInfos(NLMISC::IStream &f)
try try
{ {
sint ver = f.serialVersion(USER_DYN_CHATS_INFO_VERSION); sint ver = f.serialVersion(USER_DYN_CHATS_INFO_VERSION);
f.serialCheck((uint32) 'OMGY'); f.serialCheck(NELID("OMGY"));
if (ver >= 1) if (ver >= 1)
{ {
saveFilteredDynChat(f, TheUserChat); saveFilteredDynChat(f, TheUserChat);
@ -1755,7 +1755,7 @@ bool CPeopleInterraction::loadUserChatsInfos(NLMISC::IStream &f)
{ {
bool present; bool present;
sint ver = f.serialVersion(USER_CHATS_INFO_VERSION); sint ver = f.serialVersion(USER_CHATS_INFO_VERSION);
f.serialCheck((uint32) 'TAHC'); f.serialCheck(NELID("TAHC"));
f.serial(present); f.serial(present);
if (!present) if (!present)
{ {
@ -1777,7 +1777,7 @@ bool CPeopleInterraction::loadUserChatsInfos(NLMISC::IStream &f)
setupUserChatFromSummary(fcs, UserChat[k]); setupUserChatFromSummary(fcs, UserChat[k]);
} }
} }
f.serialCheck((uint32) 'TAHC'); f.serialCheck(NELID("TAHC"));
if (ver>=1) if (ver>=1)
{ {
// CChatGroupWindow *pCGW = PeopleInterraction.getChatGroupWindow(); // CChatGroupWindow *pCGW = PeopleInterraction.getChatGroupWindow();
@ -1819,7 +1819,7 @@ bool CPeopleInterraction::loadUserDynChatsInfos(NLMISC::IStream &f)
{ {
bool present; bool present;
sint ver = f.serialVersion(USER_DYN_CHATS_INFO_VERSION); sint ver = f.serialVersion(USER_DYN_CHATS_INFO_VERSION);
f.serialCheck((uint32) 'OMGY'); f.serialCheck(NELID("OMGY"));
f.serial(present); f.serial(present);
if (!present) if (!present)
{ {

View file

@ -1943,16 +1943,21 @@ class CAHInitResLod : public IActionHandler
VideoModes.clear(); VideoModes.clear();
StringModeList.clear(); StringModeList.clear();
StringModeList.push_back("uiConfigWindowed");
CurrentMode = getRyzomModes(VideoModes, StringModeList); CurrentMode = getRyzomModes(VideoModes, StringModeList);
// getRyzomModes() expects empty list, so we need to insert 'Windowed' after mode list is filled
StringModeList.insert(StringModeList.begin(), "uiConfigWindowed");
// If the client is in windowed mode, still in windowed mode and do not change anything // If the client is in windowed mode, still in windowed mode and do not change anything
if (ClientCfg.Windowed) if (ClientCfg.Windowed)
CurrentMode = 0; CurrentMode = 0;
// If we have not found the mode so it can be an error or machine change, so propose the first available // If we have not found the mode so it can be an error or machine change, so propose the first available
else if (CurrentMode == -1) else if (CurrentMode == -1)
CurrentMode = 1; CurrentMode = 1;
// We inserted 'Windowed' as first mode, so index needs to move too
else
++CurrentMode;
CInterfaceManager *pIM = CInterfaceManager::getInstance(); CInterfaceManager *pIM = CInterfaceManager::getInstance();
CViewText *pVT = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId("ui:login:checkpass:content:res_value")); CViewText *pVT = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId("ui:login:checkpass:content:res_value"));
@ -2111,7 +2116,12 @@ class CAHUninitResLod : public IActionHandler
//nlinfo("CAHUninitResLod called"); //nlinfo("CAHUninitResLod called");
// If the mode requested is a windowed mode do nothnig // If the mode requested is a windowed mode do nothnig
if (CurrentMode != 0) if (CurrentMode == 0)
{
ClientCfg.Windowed = true;
ClientCfg.writeBool("FullScreen", false);
}
else
{ {
ClientCfg.Windowed = false; ClientCfg.Windowed = false;
// Get W, H // Get W, H
@ -2125,6 +2135,10 @@ class CAHUninitResLod : public IActionHandler
} }
ClientCfg.Width = w; ClientCfg.Width = w;
ClientCfg.Height = h; ClientCfg.Height = h;
ClientCfg.writeBool("FullScreen", true);
ClientCfg.writeInt("Width", w);
ClientCfg.writeInt("Height", h);
} }
if (CurrentPreset != 4) // CInterfaceDDX::CustomPreset if (CurrentPreset != 4) // CInterfaceDDX::CustomPreset

View file

@ -648,7 +648,7 @@ void CProjectileManager::CProjectile::shutDown(CCharacterCL *target)
target->buildAlignMatrix(userMatrix); target->buildAlignMatrix(userMatrix);
FX[k].forceSetUserMatrix(userMatrix); FX[k].forceSetUserMatrix(userMatrix);
} }
if (!FX[k].removeByID('STOP') && !FX[k].removeByID('main')) if (!FX[k].removeByID(NELID("STOP")) && !FX[k].removeByID(NELID("main")))
{ {
FX[k].activateEmitters(false); FX[k].activateEmitters(false);
//nlwarning("Projectile with a particle system that has no 'STOP' emitter"); //nlwarning("Projectile with a particle system that has no 'STOP' emitter");

View file

@ -429,7 +429,7 @@ CPackedWorld *CIslandCollision::reloadPackedIsland(const CScenarioEntryPoints::C
try try
{ {
CIFile f(CPath::lookup(islandDesc.Island + ".island_hm")); CIFile f(CPath::lookup(islandDesc.Island + ".island_hm"));
f.serialCheck((uint32) 'MHSI'); f.serialCheck(NELID("MHSI"));
f.serial(_HeightMap); f.serial(_HeightMap);
} }
catch(const Exception &e) catch(const Exception &e)

View file

@ -468,8 +468,6 @@ void releaseOutGame()
// flush the server string cache // flush the server string cache
STRING_MANAGER::CStringManagerClient::instance()->flushStringCache(); STRING_MANAGER::CStringManagerClient::instance()->flushStringCache();
ClientCfg.release ();
// Disconnect the client from the server. // Disconnect the client from the server.
NetMngr.disconnect(); NetMngr.disconnect();

View file

@ -341,8 +341,8 @@ private:
void serial(NLMISC::IStream &f) void serial(NLMISC::IStream &f)
{ {
f.serialCheck((uint32)'_RTS'); f.serialCheck(NELID("_RTS"));
f.serialCheck((uint32)'KCAP'); f.serialCheck(NELID("KCAP"));
f.serialVersion(0); f.serialVersion(0);
f.serial(PackedVersion); f.serial(PackedVersion);
f.serial(LanguageCode); f.serial(LanguageCode);

View file

@ -544,7 +544,7 @@ void CTimedFXManager::CManagedFX::shutDown(NL3D::UScene *scene, CFXManager &fxMa
// fx isn't spwaned, so must tell fx to stop its emitters // fx isn't spwaned, so must tell fx to stop its emitters
if (Instance.isSystemPresent() && Instance.isValid()) if (Instance.isSystemPresent() && Instance.isValid())
{ {
if (!Instance.removeByID('main') && !Instance.removeByID('STOP')) if (!Instance.removeByID(NELID("main")) && !Instance.removeByID(NELID("STOP")))
{ {
// if a specific emitter has not be tagged, just stop all emitters if there's no better solution // if a specific emitter has not be tagged, just stop all emitters if there's no better solution
Instance.activateEmitters(false); Instance.activateEmitters(false);

View file

@ -325,9 +325,11 @@ static _TOKENS_CLASSNAME _TOKENS_OBJNAME;
#else #else
#ifdef NL_OS_WINDOWS
#pragma message( " ") #pragma message( " ")
#pragma message( "NON-OPTIMISED: Persistent data class " NL_MACRO_TO_STR(PERSISTENT_CLASS) " not using a token family") #pragma message( "NON-OPTIMISED: Persistent data class " NL_MACRO_TO_STR(PERSISTENT_CLASS) " not using a token family")
#pragma message( " ") #pragma message( " ")
#endif
#endif #endif

View file

@ -43,7 +43,7 @@ void CSecurityCheckForFastDisconnection::forwardSecurityCode(NLMISC::IStream& ms
} }
// //
CSecurityCode CSecurityCheckForFastDisconnection::encode(char *passPhrase) CSecurityCode CSecurityCheckForFastDisconnection::encode(const char *passPhrase)
{ {
if (!passPhrase) if (!passPhrase)
throw Exception("Null passPhrase"); throw Exception("Null passPhrase");
@ -56,7 +56,7 @@ CSecurityCode CSecurityCheckForFastDisconnection::encode(char *passPhrase)
} }
// //
void CSecurityCheckForFastDisconnection::check(char *passPhrase) void CSecurityCheckForFastDisconnection::check(const char *passPhrase)
{ {
if (SecurityCode != encode(passPhrase)) if (SecurityCode != encode(passPhrase))
throw Exception("Check not passed"); throw Exception("Check not passed");

View file

@ -61,9 +61,9 @@ public:
/// Set cookie /// Set cookie
void setCookie(const NLNET::CLoginCookie& cookie) { Block.Cookie.set(cookie.getUserAddr(), cookie.getUserKey(), cookie.getUserId()); } // don't use the default generated bitwise assignment operator, because of padding junk that would be copied void setCookie(const NLNET::CLoginCookie& cookie) { Block.Cookie.set(cookie.getUserAddr(), cookie.getUserKey(), cookie.getUserId()); } // don't use the default generated bitwise assignment operator, because of padding junk that would be copied
/// Return the security code /// Return the security code
CSecurityCode encode(char *passPhrase); CSecurityCode encode(const char *passPhrase);
/// Check the security code /// Check the security code
void check(char *passPhrase); void check(const char *passPhrase);
/// Read some data from stream /// Read some data from stream
void receiveSecurityCode(NLMISC::IStream& msgin); void receiveSecurityCode(NLMISC::IStream& msgin);

View file

@ -2277,7 +2277,7 @@ public:
sint32 xmax = (sint32) max.x(); sint32 xmax = (sint32) max.x();
sint32 ymin = (sint32) (sint16) min.y(); sint32 ymin = (sint32) (sint16) min.y();
sint32 ymax = (sint32) (sint16) max.y(); sint32 ymax = (sint32) (sint16) max.y();
output.serialCheck((uint32) 'OBSI'); output.serialCheck(NELID("OBSI"));
output.serial(xmin); output.serial(xmin);
output.serial(xmax); output.serial(xmax);
output.serial(ymin); output.serial(ymin);

View file

@ -1700,7 +1700,7 @@ NLMISC_COMMAND(scriptHex,"execute a hex-encoded script for a group in the given
return true; return true;
} }
static char* hexEncoderTcl = static const char* hexEncoderTcl =
"proc copy_encoded {} {" "proc copy_encoded {} {"
" # Get the args from the text fields" " # Get the args from the text fields"
" set group [ .group.name get 1.0 end ]" " set group [ .group.name get 1.0 end ]"

View file

@ -553,7 +553,7 @@ void CWorldMap::clear()
void CWorldMap::serial(NLMISC::IStream &f) void CWorldMap::serial(NLMISC::IStream &f)
{ {
f.serialCheck((uint32)'WMAP'); f.serialCheck(NELID("WMAP"));
// Version // Version
// 0: initial version // 0: initial version

View file

@ -1633,18 +1633,27 @@ CTopology::CTopology()
{ {
} }
// convert a 2 characters string to uint16
#ifdef NL_LITTLE_ENDIAN
# define NELID16(x) (uint16((x[0] << 8) | (x[1])))
#else
# define NELID16(x) (uint16((x[1] << 8) | (x[0])))
#endif
inline inline
void CTopology::serial(NLMISC::IStream& f) void CTopology::serial(NLMISC::IStream& f)
{ {
uint version = 0; uint version = 0;
uint16 check = (uint16)'Tp'; uint16 check = NELID16("Tp");
f.serial(check); f.serial(check);
if (check != (uint16)'TP') if (check != NELID16("TP"))
{ {
nlassert(check == (uint16)'Tp'); nlassert(check == NELID16("Tp"));
version = f.serialVersion(3); version = f.serialVersion(3);
} }
@ -2285,7 +2294,7 @@ sint CWhiteCell::getHeight(CWorldPosition const& wpos) const
inline inline
void CWhiteCell::serial(NLMISC::IStream& f) void CWhiteCell::serial(NLMISC::IStream& f)
{ {
f.serialCheck((uint16)'WC'); f.serialCheck(NELID16("WC"));
if (f.isReading()) if (f.isReading())
_HeightMap = I16x16Layer::load(f); _HeightMap = I16x16Layer::load(f);
else else

View file

@ -21,7 +21,7 @@
namespace EGSPD namespace EGSPD
{ {
static const struct { char* Name; CFameTrend::TFameTrend Value; } TFameTrendConvert[] = static const struct { const char* Name; CFameTrend::TFameTrend Value; } TFameTrendConvert[] =
{ {
{ "FameUpward", CFameTrend::FameUpward }, { "FameUpward", CFameTrend::FameUpward },
{ "FameDownward", CFameTrend::FameDownward }, { "FameDownward", CFameTrend::FameDownward },

View file

@ -494,7 +494,7 @@ bool CGuildMemberModule::canAffectGrade(EGSPD::CGuildGrade::TGuildGrade)const
CMissionGuild * CGuildMemberModule::pickMission( TAIAlias alias ) CMissionGuild * CGuildMemberModule::pickMission( TAIAlias alias )
{ {
/// todo guild mission /// todo guild mission
return false; return NULL;
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------

View file

@ -1270,7 +1270,7 @@ bool forageTestDoExtract(
testSource->extractMaterial( req, abs, ForageQualityCeilingFactor.get(), ForageQualitySlowFactor.get(), res, successFactor, 0, row, propDrop ); testSource->extractMaterial( req, abs, ForageQualityCeilingFactor.get(), ForageQualitySlowFactor.get(), res, successFactor, 0, row, propDrop );
fprintf( f, "%g;%g;%g;%g;%g;%g;%g;%g;%g;%u;%u;\n", fprintf( f, "%g;%g;%g;%g;%g;%g;%g;%g;%g;%u;%u;\n",
res[CHarvestSource::A], res[CHarvestSource::Q], res[CHarvestSource::A], res[CHarvestSource::Q],
testSource->getD(), testSource->getE(), 0 /*testSource->getC()*/, testSource->getD(), testSource->getE(), 0.f /*testSource->getC()*/,
reqS, reqA, reqQ, reqS, reqA, reqQ,
testSource->quantity(), testSource->getImpactScheme()*5, 127 ); testSource->quantity(), testSource->getImpactScheme()*5, 127 );
if ( (!eventD) && (testSource->getD() > 127) ) if ( (!eventD) && (testSource->getD() > 127) )

View file

@ -29,10 +29,7 @@ CCombatAction * CCombatAIActionFactory::buildAiAction(const CStaticAiAction *aiA
nlassert(phrase); nlassert(phrase);
#endif #endif
const AI_ACTION::TAiActionType actionType = aiAction->getType(); const AI_ACTION::TAiActionType actionType = aiAction->getType();
if (actionType != AI_ACTION::Melee && actionType != AI_ACTION::Range) if (actionType != AI_ACTION::Melee && actionType != AI_ACTION::Range) return NULL;
{
return false;
}
AI_ACTION::TAiEffectType effectType = aiAction->getData().Combat.EffectFamily; AI_ACTION::TAiEffectType effectType = aiAction->getData().Combat.EffectFamily;

View file

@ -1936,7 +1936,7 @@ void CDepositMapsBatchTask::run()
CSString res; CSString res;
disp.write( res ); disp.write( res );
res = res.replace( "\n", "<BR>\n" ); res = res.replace( "\n", "<BR>\n" );
fprintf( outputF, res.c_str() ); fprintf( outputF, "%s", res.c_str() );
// Close files // Close files
fclose( inputF ); fclose( inputF );

View file

@ -22,13 +22,17 @@ class CEntityState;
class COfflineEntityState; class COfflineEntityState;
class CCharacterRespawnPoints; class CCharacterRespawnPoints;
class CFarPosition; class CFarPosition;
class NLNET::CMessage;
class CModuleParent; class CModuleParent;
namespace NLNET
{
class CMessage;
}
namespace R2 namespace R2
{ {
struct TUserRole; struct TUserRole;
}; }
class CRingRewardPoints; class CRingRewardPoints;

View file

@ -349,13 +349,13 @@ static std::string getActiveOutputPath()
if (TheCharScanScriptFile==NULL) if (TheCharScanScriptFile==NULL)
{ {
nlwarning("There is no active script file right now from which to extract output directory"); nlwarning("There is no active script file right now from which to extract output directory");
return false; return "";
} }
bool isOK=true; bool isOK=true;
// write the current script file to a tmp file // write the current script file to a tmp file
isOK=TheCharScanScriptFile->writeToFile(TmpScriptFileName); isOK=TheCharScanScriptFile->writeToFile(TmpScriptFileName);
if (!isOK) return false; if (!isOK) return "";
// create a new script object and assign the tmp file to it // create a new script object and assign the tmp file to it
CCharScanScript script; CCharScanScript script;

View file

@ -336,7 +336,7 @@ void cbImpulsionFilter( CMessage& msgin, const string &serviceName, TServiceId s
} // impulsionFilter // } // impulsionFilter //
static char*DebugChatModeName[] = static const char* DebugChatModeName[] =
{ {
"say", "say",
"shout", "shout",

View file

@ -42,7 +42,7 @@ extern CVariable<bool> VerboseStringManager;
#define LOG if (!VerboseStringManager) {} else nlinfo #define LOG if (!VerboseStringManager) {} else nlinfo
char *OperatorNames[] = const char *OperatorNames[] =
{ {
"equal", "equal",
"notEqual", "notEqual",

View file

@ -521,9 +521,7 @@ public:
BsiGlobal); BsiGlobal);
saveFile.FileName = threadResult.OutputFilename; saveFile.FileName = threadResult.OutputFilename;
char *newLine="\n"; const char *newLine="\n";
list<string>::const_iterator first(threadResult.Lines->begin()), last(threadResult.Lines->end()); list<string>::const_iterator first(threadResult.Lines->begin()), last(threadResult.Lines->end());
for (uint32 localCounter = 0; first != last; ++first, ++localCounter) for (uint32 localCounter = 0; first != last; ++first, ++localCounter)

View file

@ -259,7 +259,7 @@ bool CDBDeltaFile::preload()
*/ */
bool CDBDeltaFile::serialHeader() bool CDBDeltaFile::serialHeader()
{ {
serialCheck((uint32)'DbDt'); serialCheck(NELID("DbDt"));
uint version = serialVersion(0); uint version = serialVersion(0);
if (isReading()) if (isReading())
@ -280,7 +280,7 @@ bool CDBDeltaFile::serialHeader()
serial(_Header); serial(_Header);
} }
serialCheck((uint32)'Data'); serialCheck(NELID("Data"));
_DataStart = ftell(_File); _DataStart = ftell(_File);

View file

@ -189,7 +189,7 @@ private:
void serial(NLMISC::IStream& s) void serial(NLMISC::IStream& s)
{ {
s.serialCheck((uint32)'DHdr'); s.serialCheck(NELID("DHdr"));
uint version = s.serialVersion(0); uint version = s.serialVersion(0);
s.serial(RowSize); s.serial(RowSize);

View file

@ -483,7 +483,7 @@ bool CDBReferenceFile::read(uint32 index, uint8* rowdata)
*/ */
bool CDBReferenceFile::serialHeader() bool CDBReferenceFile::serialHeader()
{ {
serialCheck((uint32)'DbRf'); serialCheck(NELID("DbRf"));
uint version = serialVersion(0); uint version = serialVersion(0);
if (isReading()) if (isReading())
@ -504,7 +504,7 @@ bool CDBReferenceFile::serialHeader()
serial(_Header); serial(_Header);
} }
serialCheck((uint32)'Data'); serialCheck(NELID("Data"));
_DataStart = ftell(_File); _DataStart = ftell(_File);

View file

@ -199,7 +199,7 @@ private:
void serial(NLMISC::IStream& s) void serial(NLMISC::IStream& s)
{ {
s.serialCheck((uint32)'RHdr'); s.serialCheck(NELID("RHdr"));
uint version = s.serialVersion(0); uint version = s.serialVersion(0);
s.serial(BaseIndex); s.serial(BaseIndex);

View file

@ -1436,7 +1436,7 @@ inline uint32 CDbMessage::getMessageHeaderSize()
*/ */
inline void CUpdateLog::serial(NLMISC::IStream& f) inline void CUpdateLog::serial(NLMISC::IStream& f)
{ {
f.serialCheck((uint32)'ULOG'); f.serialCheck(NELID("ULOG"));
uint version = f.serialVersion(1); uint version = f.serialVersion(1);

View file

@ -331,7 +331,7 @@ void CDatabaseState::serial(NLMISC::IStream& s)
{ {
s.xmlPush("database_state"); s.xmlPush("database_state");
s.serialCheck((uint32)'DBST'); s.serialCheck(NELID("DBST"));
uint version = s.serialVersion(0); uint version = s.serialVersion(0);
s.xmlPush("name"); s.xmlPush("name");

View file

@ -60,7 +60,7 @@ public:
{ {
s.xmlPush("reference"); s.xmlPush("reference");
s.serialCheck((uint32)'RIDX'); s.serialCheck(NELID("RIDX"));
uint version = s.serialVersion(0); uint version = s.serialVersion(0);
s.xmlPush("database"); s.xmlPush("database");

View file

@ -73,7 +73,7 @@ void CPDStringMapper::setMapping(const std::string& str, uint32 id)
*/ */
void CPDStringMapper::serial(NLMISC::IStream& f) void CPDStringMapper::serial(NLMISC::IStream& f)
{ {
f.serialCheck((uint32)'PDSM'); f.serialCheck(NELID("PDSM"));
uint version = f.serialVersion(0); uint version = f.serialVersion(0);

View file

@ -714,7 +714,7 @@ public:
void serial(NLMISC::IStream& f) void serial(NLMISC::IStream& f)
{ {
f.serialCheck((uint32)'IALC'); f.serialCheck(NELID("IALC"));
f.serialVersion(0); f.serialVersion(0);
f.serial(_NextIndex); f.serial(_NextIndex);

View file

@ -104,7 +104,7 @@ public:
FILE* fileHandle= fopen(DailyActivityLogFileName,"ab"); FILE* fileHandle= fopen(DailyActivityLogFileName,"ab");
nlassert(fileHandle!=NULL); nlassert(fileHandle!=NULL);
fprintf(fileHandle,"%02u/%02u/%u CDailyTaskScheduler: Started: %02u:%02u, Finished: %02u:%02u, Executed %u commands Started %u Jobs\n", fprintf(fileHandle,"%02u/%02u/%u CDailyTaskScheduler: Started: %02u:%02u, Finished: %02u:%02u, Executed %u commands Started %u Jobs\n",
ptm->tm_mday, ptm->tm_mon+1, ptm->tm_year+1900, startTime/3600%24, startTime/60%60, endTime/3600%24, endTime/60%60, commandsVar==NULL?0:commandsVar->size(), jobsRemaining ); ptm->tm_mday, ptm->tm_mon+1, ptm->tm_year+1900, (uint)startTime/3600%24, (uint)startTime/60%60, (uint)endTime/3600%24, (uint)endTime/60%60, commandsVar==NULL?0:commandsVar->size(), jobsRemaining );
nlinfo("JobManager state: %s",CJobManager::getInstance()->getStatus().c_str()); nlinfo("JobManager state: %s",CJobManager::getInstance()->getStatus().c_str());
fclose(fileHandle); fclose(fileHandle);
} }

View file

@ -518,13 +518,13 @@ static std::string getActiveOutputPath()
if (TheCharScanScriptFile==NULL) if (TheCharScanScriptFile==NULL)
{ {
nlwarning("There is no active script file right now from which to extract output directory"); nlwarning("There is no active script file right now from which to extract output directory");
return false; return "";
} }
bool isOK=true; bool isOK=true;
// write the current script file to a tmp file // write the current script file to a tmp file
isOK=TheCharScanScriptFile->writeToFile(TmpScriptFileName); isOK=TheCharScanScriptFile->writeToFile(TmpScriptFileName);
if (!isOK) return false; if (!isOK) return "";
// create a new script object and assign the tmp file to it // create a new script object and assign the tmp file to it
CCharScanScriptFile script; CCharScanScriptFile script;

View file

@ -176,7 +176,7 @@ CTimestamp CDbManager::_LastUpdateTime;
*/ */
CDatabase* CDbManager::createDatabase(TDatabaseId id, CLog* log) CDatabase* CDbManager::createDatabase(TDatabaseId id, CLog* log)
{ {
CHECK_DB_MGR_INIT(createDatabase, false); CHECK_DB_MGR_INIT(createDatabase, NULL);
// check db doesn't exist yet // check db doesn't exist yet
CDatabase* db = getDatabase(id); CDatabase* db = getDatabase(id);
@ -229,7 +229,7 @@ bool CDbManager::deleteDatabase(TDatabaseId id, CLog* log)
*/ */
CDatabase* CDbManager::loadDatabase(TDatabaseId id, const string& description, CLog* log) CDatabase* CDbManager::loadDatabase(TDatabaseId id, const string& description, CLog* log)
{ {
CHECK_DB_MGR_INIT(loadDatabase, false); CHECK_DB_MGR_INIT(loadDatabase, NULL);
nlinfo("CDbManager::loadDatabase(): load/setup database '%d'", id); nlinfo("CDbManager::loadDatabase(): load/setup database '%d'", id);

View file

@ -1195,7 +1195,7 @@ CDatabase* CDatabase::adapt(const string& description)
if (!buildReference()) if (!buildReference())
{ {
PDS_WARNING("adapt(): failed to buildReference()"); PDS_WARNING("adapt(): failed to buildReference()");
return false; return NULL;
} }
} }

View file

@ -194,7 +194,7 @@ string CType::getIndexName(TEnumValue value, bool verbose) const
if (!isIndex()) if (!isIndex())
{ {
PDS_WARNING("getIndexName(): type is not an index"); PDS_WARNING("getIndexName(): type is not an index");
return false; return "";
} }
if (isEnum()) if (isEnum())

View file

@ -114,7 +114,7 @@ void CLightIGLoader::loadIG(const string &filename)
// Serial a header // Serial a header
_File.serialCheck ((uint32)'TPRG'); _File.serialCheck (NELID("TPRG"));
// Serial a version number // Serial a version number
sint version = _File.serialVersion (5); sint version = _File.serialVersion (5);

View file

@ -1187,9 +1187,14 @@ bool CNameManager::loadForbiddenNames()
while (true) while (true)
{ {
char str[512]; char str[512];
fgets(str, 511, fp); char *fgres = fgets(str, 511, fp);
if(feof(fp)) if(feof(fp))
break; break;
if (fgres == NULL)
{
nlwarning("NAMEMGR: Error reading file");
break;
}
if (strlen(str) > 0) if (strlen(str) > 0)
{ {
str[strlen(str)-1] = '\0'; str[strlen(str)-1] = '\0';

View file

@ -208,7 +208,7 @@ namespace RSMGR
public: public:
CRingSessionManager() CRingSessionManager()
: _DontUsePerm(false), : _DontUsePerm(false),
_CharSync(false) _CharSync(NULL)
{ {
CRingSessionManagerSkel::init(this); CRingSessionManagerSkel::init(this);
CWelcomeServiceClientSkel::init(this); CWelcomeServiceClientSkel::init(this);

View file

@ -1,6 +1,5 @@
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${NEL_INCLUDE_DIR} ${QT_INCLUDES})
${CMAKE_CURRENT_SOURCE_DIR} INCLUDE( ${QT_USE_FILE} )
${QT_INCLUDES} )
FILE( GLOB SRC *.cpp *.h ) FILE( GLOB SRC *.cpp *.h )
@ -36,9 +35,6 @@ SET( CLIENT_CONFIG_TRANS
CONFIGURE_FILE( translations/translations.qrc ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc COPYONLY ) CONFIGURE_FILE( translations/translations.qrc ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc COPYONLY )
SET( CLIENT_CONFIG_RCS resources.qrc ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc ) SET( CLIENT_CONFIG_RCS resources.qrc ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc )
SET( QT_USE_QTGUI TRUE )
SET( QT_USE_QTOPENGL TRUE )
SET( QT_USE_QTCORE TRUE )
QT4_ADD_TRANSLATION( CLIENT_CONFIG_QM ${CLIENT_CONFIG_TRANS} ) QT4_ADD_TRANSLATION( CLIENT_CONFIG_QM ${CLIENT_CONFIG_TRANS} )
QT4_ADD_RESOURCES( CLIENT_CONFIG_RC_SRCS ${CLIENT_CONFIG_RCS} ) QT4_ADD_RESOURCES( CLIENT_CONFIG_RC_SRCS ${CLIENT_CONFIG_RCS} )
QT4_WRAP_CPP( CLIENT_CONFIG_MOC_SRC ${CLIENT_CONFIG_HDR} ) QT4_WRAP_CPP( CLIENT_CONFIG_MOC_SRC ${CLIENT_CONFIG_HDR} )
@ -52,6 +48,11 @@ ADD_EXECUTABLE( ryzom_configuration_qt WIN32 MACOSX_BUNDLE ${SRC} ${CLIENT_CONFI
NL_DEFAULT_PROPS( ryzom_configuration_qt "Ryzom, Tools: Ryzom Configuration Qt" ) NL_DEFAULT_PROPS( ryzom_configuration_qt "Ryzom, Tools: Ryzom Configuration Qt" )
NL_ADD_RUNTIME_FLAGS( ryzom_configuration_qt ) NL_ADD_RUNTIME_FLAGS( ryzom_configuration_qt )
NL_ADD_LIB_SUFFIX( ryzom_configuration_qt ) NL_ADD_LIB_SUFFIX( ryzom_configuration_qt )
TARGET_LINK_LIBRARIES( ryzom_configuration_qt nelmisc nel3d ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${OPENGL_gl_LIBRARY} ) TARGET_LINK_LIBRARIES( ryzom_configuration_qt nelmisc nel3d ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY})
INSTALL( TARGETS ryzom_configuration_qt RUNTIME DESTINATION games COMPONENT client BUNDLE DESTINATION /Applications )
IF(WITH_PCH)
ADD_NATIVE_PRECOMPILED_HEADER(ryzom_configuration_qt ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp)
ENDIF(WITH_PCH)
INSTALL(TARGETS ryzom_configuration_qt RUNTIME DESTINATION games COMPONENT client BUNDLE DESTINATION /Applications)

Some files were not shown because too many files have changed in this diff Show more