Merge with default

This commit is contained in:
kaetemi 2013-10-06 15:50:49 +02:00
parent d39c6b8e1b
commit b6ca251a8d
142 changed files with 2631 additions and 2236 deletions

View file

@ -134,7 +134,7 @@ IF(FINAL_VERSION)
ENDIF(FINAL_VERSION)
IF(WITH_QT)
FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtXml REQUIRED)
FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtXml QtOpenGL REQUIRED)
ENDIF(WITH_QT)
IF(WITH_NEL)
@ -144,11 +144,6 @@ IF(WITH_NEL)
IF(WITH_GUI)
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(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_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)
# in cache already
SET(Luabind_FIND_QUIETLY TRUE)
@ -84,6 +126,9 @@ IF(LUABIND_FOUND)
IF(LUABIND_VERSION_FILE)
SET(LUABIND_DEFINITIONS "-DHAVE_LUABIND_VERSION")
ENDIF(LUABIND_VERSION_FILE)
FIND_CORRECT_LUA_VERSION()
IF(NOT Luabind_FIND_QUIETLY)
MESSAGE(STATUS "Found Luabind: ${LUABIND_LIBRARIES}")
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")
SET(VC${_VERSION}_FOUND ON)
DETECT_EXPRESS_VERSION(${_VERSION})
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)
ELSEIF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry")
SET(VC${_VERSION}_FOUND OFF)
@ -36,13 +41,28 @@ MACRO(DETECT_VC_VERSION _VERSION)
DETECT_VC_VERSION_HELPER("HKEY_LOCAL_MACHINE" ${_VERSION})
ENDIF(NOT VC${_VERSION}_FOUND)
IF(NOT VC${_VERSION}_FOUND)
IF(VC${_VERSION}_FOUND)
SET(VC_FOUND ON)
SET(VC_DIR "${VC${_VERSION}_DIR}")
ENDIF(NOT VC${_VERSION}_FOUND)
ENDIF(VC${_VERSION}_FOUND)
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")
IF(NOT MSVC11_REDIST_DIR)
@ -60,7 +80,7 @@ ELSEIF(MSVC90)
DETECT_VC_VERSION("9.0")
ELSEIF(MSVC80)
DETECT_VC_VERSION("8.0")
ENDIF(MSVC11)
ENDIF(MSVC12)
# If you plan to use VC++ compilers with WINE, set VC_DIR environment variable
IF(NOT VC_DIR)

View file

@ -11,6 +11,7 @@ IF(WINSDK_FOUND)
RETURN()
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")
MACRO(DETECT_WINSDK_VERSION_HELPER _ROOT _VERSION)
@ -22,7 +23,7 @@ MACRO(DETECT_WINSDK_VERSION_HELPER _ROOT _VERSION)
IF(NOT WindowsSDK_FIND_QUIETLY)
MESSAGE(STATUS "Found Windows SDK ${_VERSION} in ${WINSDK${_VERSION}_DIR}")
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 "")
ENDIF(WINSDK${_VERSION}_DIR AND NOT WINSDK${_VERSION}_DIR STREQUAL "/registry")
ENDMACRO(DETECT_WINSDK_VERSION_HELPER)
@ -30,17 +31,22 @@ ENDMACRO(DETECT_WINSDK_VERSION_HELPER)
MACRO(DETECT_WINSDK_VERSION _VERSION)
SET(WINSDK${_VERSION}_FOUND OFF)
DETECT_WINSDK_VERSION_HELPER("HKEY_CURRENT_USER" ${_VERSION})
IF(NOT WINSDK${_VERSION}_FOUND)
DETECT_WINSDK_VERSION_HELPER("HKEY_LOCAL_MACHINE" ${_VERSION})
ENDIF(NOT WINSDK${_VERSION}_FOUND)
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
FOREACH(_VERSION ${WINSDK_VERSIONS})
DETECT_WINSDK_VERSION(${_VERSION})
IF(WINSDK${_VERSION}_FOUND)
LIST(APPEND WINSDK_DETECTED_VERSIONS ${_VERSION})
ENDIF(WINSDK${_VERSION}_FOUND)
ENDFOREACH(_VERSION)
SET(WINSDK_SUFFIX)
@ -54,51 +60,186 @@ ELSEIF(TARGET_X86)
SET(WINSDK8_SUFFIX "x86")
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(NOT WindowsSDK_FIND_QUIETLY)
# MESSAGE(STATUS "Current version is ${WINSDKCURRENT_VERSION}")
ENDIF(NOT WindowsSDK_FIND_QUIETLY)
ENDIF(WINSDKCURRENT_VERSION AND NOT WINSDKCURRENT_VERSION STREQUAL "/registry")
IF(WINSDKCURRENT_VERSION_INCLUDE)
FILE(TO_CMAKE_PATH "${WINSDKCURRENT_VERSION_INCLUDE}" WINSDKCURRENT_VERSION_INCLUDE)
ENDIF(WINSDKCURRENT_VERSION_INCLUDE)
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)
IF(WINSDKENV_DIR)
SET(WINSDK_VERSION "")
SET(WINSDK_VERSION_FULL "")
SET(WINSDK_DIR "")
SET(WINSDK_VERSION "")
SET(WINSDK_VERSION_FULL "")
# Use WINSDK environment variable
IF(WINSDKENV_DIR AND EXISTS ${WINSDKENV_DIR}/include/Windows.h)
SET(WINSDK_DIR ${WINSDKENV_DIR})
FOREACH(_VERSION ${WINSDK_VERSIONS})
IF(WINSDK_DIR STREQUAL WINSDK${_VERSION}_DIR)
SET(WINSDK_VERSION ${_VERSION})
SET(WINSDK_VERSION_FULL "${WINSDK${_VERSION}_VERSION_FULL}")
ENDIF(WINSDKENV_DIR AND EXISTS ${WINSDKENV_DIR}/include/Windows.h)
# Use INCLUDE environment variable
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()
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)
ELSE(WINSDKENV_DIR)
# Windows SDK 7.0A doesn't provide 64bits compilers, use SDK 7.1 for 64 bits
IF(WINSDKCURRENT_VERSION STREQUAL WINSDK7.0A_VERSION_FULL)
IF(TARGET_X64)
SET(WINSDK_VERSION "7.1")
SET(WINSDK_VERSION_FULL ${WINSDK7.1_VERSION_FULL})
SET(WINSDK_DIR ${WINSDK7.1_DIR})
ELSE(TARGET_X64)
FIND_WINSDK_VERSION_HEADERS()
ENDIF(WINSDK_DIR)
IF(NOT WINSDK_DIR)
# Use Windows SDK versions installed with VC++ when possible
IF(MSVC12)
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_FULL ${WINSDK7.0A_VERSION_FULL})
SET(WINSDK_DIR ${WINSDK7.0A_DIR})
ENDIF(TARGET_X64)
ELSE(WINSDKCURRENT_VERSION STREQUAL WINSDK7.0A_VERSION_FULL)
FOREACH(_VERSION ${WINSDK_VERSIONS})
IF(WINSDKCURRENT_VERSION STREQUAL WINSDK${_VERSION}_VERSION)
SET(WINSDK_VERSION ${_VERSION})
SET(WINSDK_VERSION_FULL "${WINSDK${_VERSION}_VERSION_FULL}")
SET(WINSDK_DIR "${WINSDK${_VERSION}_DIR}")
BREAK()
ENDIF(WINSDKCURRENT_VERSION STREQUAL WINSDK${_VERSION}_VERSION)
ENDFOREACH(_VERSION)
ENDIF(WINSDKCURRENT_VERSION STREQUAL WINSDK7.0A_VERSION_FULL)
ENDIF(WINSDKENV_DIR)
ENDIF(NOT TARGET_X64 OR NOT MSVC_EXPRESS)
ELSEIF(MSVC90)
IF(NOT MSVC_EXPRESS)
SET(WINSDK_VERSION "6.0A")
ENDIF(NOT MSVC_EXPRESS)
ELSEIF(MSVC80)
IF(NOT MSVC_EXPRESS)
# TODO: fix this version
SET(WINSDK_VERSION "5.2A")
ENDIF(NOT MSVC_EXPRESS)
ELSE(MSVC12)
MESSAGE(FATAL_ERROR "Your compiler is either too old or too recent, please update this CMake module.")
ENDIF(MSVC12)
# 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)
IF(WINSDK_VERSION STREQUAL "CURRENT")

View file

@ -273,15 +273,22 @@ MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName)
# Ninja PCH Support
# http://public.kitware.com/pipermail/cmake-developers/2012-March/003653.html
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES OBJECT_DEPENDS "${PCH_OUTPUT}")
# 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
GET_TARGET_PROPERTY(DEPS ${_targetName} LINK_LIBRARIES)
if (NOT DEPS)
set (DEPS)
endif ()
list (INSERT DEPS 0 "${PCH_OUTPUT}.obj")
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES LINK_LIBRARIES "${DEPS}")
GET_TARGET_PROPERTY(_STATIC_LIBRARY_FLAGS ${_targetName} STATIC_LIBRARY_FLAGS)
IF(NOT _STATIC_LIBRARY_FLAGS)
SET(_STATIC_LIBRARY_FLAGS)
ENDIF(NOT _STATIC_LIBRARY_FLAGS)
SET(_STATIC_LIBRARY_FLAGS "${PCH_OUTPUT}.obj ${_STATIC_LIBRARY_FLAGS}")
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)
# for use with distcc and gcc >4.0.1 if preprocessed files are accessible
# 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}")
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)
IF(NOT PCHSupport_FOUND)
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
IF(CMAKE_GENERATOR MATCHES "Visual Studio")
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")
SET(PCH_METHOD 2)
ELSE(CMAKE_GENERATOR MATCHES "Visual Studio")

View file

@ -345,7 +345,8 @@ MACRO(NL_SETUP_RYZOM_DEFAULT_OPTIONS)
###
# 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)
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;
// This Version may be used if you want to use the serialVersion() system in loadForm()
const uint32 PACKED_SHEET_VERSION_COMPATIBLE = 0;

View file

@ -53,6 +53,13 @@ class CMemStream;
# 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)
// 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.

View file

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

View file

@ -185,9 +185,9 @@ void CAnimationSet::serial (NLMISC::IStream& f)
nlassert(!_AnimHeaderOptimisation);
// Serial an header
f.serialCheck ((uint32)'_LEN');
f.serialCheck ((uint32)'MINA');
f.serialCheck ((uint32)'TES_');
f.serialCheck (NELID("_LEN"));
f.serialCheck (NELID("MINA"));
f.serialCheck (NELID("TES_"));
// Serial a version
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);
#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]
*/
if (_Extensions.EXTVertexShader && !_Extensions.NVVertexProgram && !_Extensions.ARBVertexProgram)
@ -1425,6 +1426,8 @@ void CDriverGL::setupFog(float start, float end, CRGBA color)
}
}
}
#endif
_FogStart = start;
_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
};
const uint numCubeMap = sizeof(expToCubeMap) / sizeof(float);
const uint numCubeMap = sizeof(cubeMapExp) / sizeof(float);
static bool tableBuilt = false;
if (!tableBuilt)

View file

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

View file

@ -23,6 +23,7 @@
#include <X11/Xatom.h>
#include <X11/keysym.h>
#include <X11/Xutil.h>
#include <X11/XKBlib.h>
#include "nel/misc/debug.h"
@ -566,7 +567,7 @@ bool CUnixEventEmitter::processMessage (XEvent &event, CEventServer *server)
}
else
{
k = XKeycodeToKeysym(_dpy, keyCode, 0);
k = XkbKeycodeToKeysym(_dpy, keyCode, 0, 0);
}
// 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)
{
// NEL_CLODBULD
f.serialCheck((uint32)'_LEN');
f.serialCheck((uint32)'DOLC');
f.serialCheck((uint32)'DLUB');
f.serialCheck(NELID("_LEN"));
f.serialCheck(NELID("DOLC"));
f.serialCheck(NELID("DLUB"));
/*
Version 1:
@ -525,9 +525,9 @@ void CLodCharacterShape::CBoneInfluence::serial(NLMISC::IStream &f)
void CLodCharacterShape::serial(NLMISC::IStream &f)
{
// NEL_CLODSHAP
f.serialCheck((uint32)'_LEN');
f.serialCheck((uint32)'DOLC');
f.serialCheck((uint32)'PAHS');
f.serialCheck(NELID("_LEN"));
f.serialCheck(NELID("DOLC"));
f.serialCheck(NELID("PAHS"));
/*
Version 1:

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -192,10 +192,10 @@ void CVegetableShape::serial(NLMISC::IStream &f)
- BestSidedPreComputeLighting
*/
sint ver= f.serialVersion(1);
f.serialCheck((uint32)'_LEN');
f.serialCheck((uint32)'GEV_');
f.serialCheck((uint32)'BATE');
f.serialCheck((uint32)'__EL');
f.serialCheck(NELID("_LEN"));
f.serialCheck(NELID("GEV_"));
f.serialCheck(NELID("BATE"));
f.serialCheck(NELID("__EL"));
f.serial(Lighted);
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
if (instrStr != 'ARL ')
if (instrStr != NELID("ARL"))
{
if (instr.Dest.Type == CVPOperand::AddressRegister)
{

View file

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

View file

@ -6,26 +6,15 @@ SOURCE_GROUP("src" FILES ${SRC})
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 "")
NL_DEFAULT_PROPS(nelgui "NeL, Library: NeL GUI")
NL_ADD_RUNTIME_FLAGS(nelgui)
INCLUDE_DIRECTORIES(${LUA_INCLUDE_DIR} ${LUABIND_INCLUDE_DIR} ${LIBWWW_INCLUDE_DIR})
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})
IF(WITH_PCH)
@ -33,5 +22,5 @@ IF(WITH_PCH)
ENDIF(WITH_PCH)
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)

View file

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

View file

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

View file

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

View file

@ -244,29 +244,29 @@ namespace NLGUI
// read modal option
CXMLAutoPtr prop;
prop = xmlGetProp (cur, (xmlChar*)"mouse_pos");
if ( prop ) SpawnOnMousePos= convertBool(prop);
if (prop) SpawnOnMousePos= convertBool(prop);
prop = xmlGetProp (cur, (xmlChar*)"exit_click_out");
if ( prop ) ExitClickOut= convertBool(prop);
if (prop) ExitClickOut= convertBool(prop);
prop = xmlGetProp (cur, (xmlChar*)"exit_click_l");
if ( prop ) ExitClickL= convertBool(prop);
if (prop) ExitClickL= convertBool(prop);
prop = xmlGetProp (cur, (xmlChar*)"exit_click_r");
if ( prop ) ExitClickR= convertBool(prop);
if (prop) ExitClickR= convertBool(prop);
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");
if ( prop ) ForceInsideScreen= convertBool(prop);
if (prop) ForceInsideScreen= convertBool(prop);
prop = xmlGetProp (cur, (xmlChar*)"category");
if ( prop ) Category= (const char *) prop;
if (prop) Category= (const char *) prop;
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");
if ( prop ) OnClickOutParams = (const char *) prop;
if (prop) OnClickOutParams = (const char *) prop;
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");
if ( prop ) OnPostClickOutParams = (const char *) prop;
if (prop) OnPostClickOutParams = (const char *) prop;
prop = xmlGetProp (cur, (xmlChar*)"exit_key_pushed");
if ( prop ) ExitKeyPushed= convertBool(prop);
if (prop) ExitKeyPushed= convertBool(prop);
// Force parent hotspot for spawn on mouse
if(SpawnOnMousePos)

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -231,7 +231,14 @@ string CSystemInfo::getOS()
}
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 )
OSString += " Windows 7";

View file

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

View file

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

View file

@ -15,35 +15,35 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef EXPANDABLE_HEADERVIEW_H
#define EXPANDABLE_HEADERVIEW_H
// Qt includes
#include <QHeaderView>
namespace GeorgesQt
{
class ExpandableHeaderView : public QHeaderView
{
Q_OBJECT
public:
ExpandableHeaderView(Qt::Orientation orientation, QWidget * parent = 0);
bool* expanded() { return &m_expanded; }
protected:
void paintSection(QPainter *painter, const QRect &rect, int logicalIndex) const;
bool isPointInDecoration(int section, QPoint pos)const;
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
private:
bool m_expanded;
bool m_inDecoration;
Q_SIGNALS:
void headerClicked(int);
};
} /* namespace NLQT */
#endif // EXPANDABLE_HEADERVIEW_H
#define EXPANDABLE_HEADERVIEW_H
// Qt includes
#include <QHeaderView>
namespace GeorgesQt
{
class ExpandableHeaderView : public QHeaderView
{
Q_OBJECT
public:
ExpandableHeaderView(Qt::Orientation orientation, QWidget * parent = 0);
bool* expanded() { return &m_expanded; }
protected:
void paintSection(QPainter *painter, const QRect &rect, int logicalIndex) const;
bool isPointInDecoration(int section, QPoint pos)const;
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
private:
bool m_expanded;
bool m_inDecoration;
Q_SIGNALS:
void headerClicked(int);
};
} /* namespace NLQT */
#endif // EXPANDABLE_HEADERVIEW_H

View file

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

View file

@ -1,191 +1,191 @@
// Object Viewer Qt - Log Plugin - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2011 Adrian Jaekel <aj at elane2k dot com>
//
// 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 <http://www.gnu.org/licenses/>.
// Project includes
#include "log_plugin.h"
#include "log_settings_page.h"
#include "qt_displayer.h"
#include "../core/icore.h"
#include "../core/core_constants.h"
#include "../core/menu_manager.h"
#include "../../extension_system/iplugin_spec.h"
// Qt includes
#include <QtCore/QObject>
#include <QtGui/QMessageBox>
#include <QtGui/QMainWindow>
#include <QtGui/QMenu>
#include <QtGui/QAction>
#include <QtGui/QMenuBar>
#include <QtGui/QWidget>
#include <QFile>
#include <QDateTime>
#include <QTextStream>
// NeL includes
#include <nel/misc/debug.h>
namespace Plugin
{
CLogPlugin::CLogPlugin(QWidget *parent): QDockWidget(parent)
{
m_ui.setupUi(this);
}
CLogPlugin::~CLogPlugin()
{
Q_FOREACH(QObject *obj, m_autoReleaseObjects)
{
m_plugMan->removeObject(obj);
}
qDeleteAll(m_autoReleaseObjects);
m_autoReleaseObjects.clear();
NLMISC::ErrorLog->removeDisplayer(m_displayer);
NLMISC::WarningLog->removeDisplayer(m_displayer);
NLMISC::DebugLog->removeDisplayer(m_displayer);
NLMISC::AssertLog->removeDisplayer(m_displayer);
NLMISC::InfoLog->removeDisplayer(m_displayer);
delete m_displayer;
}
bool CLogPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString)
{
Q_UNUSED(errorString);
m_plugMan = pluginManager;
m_logSettingsPage = new CLogSettingsPage(this, this);
addAutoReleasedObject(m_logSettingsPage);
return true;
}
void CLogPlugin::extensionsInitialized()
{
setDisplayers();
Core::ICore *core = Core::ICore::instance();
Core::MenuManager *menuManager = core->menuManager();
QMenu *viewMenu = menuManager->menu(Core::Constants::M_VIEW);
QMainWindow *wnd = Core::ICore::instance()->mainWindow();
wnd->addDockWidget(Qt::RightDockWidgetArea, this);
hide();
viewMenu->addAction(this->toggleViewAction());
}
void CLogPlugin::setNelContext(NLMISC::INelContext *nelContext)
{
#ifdef NL_OS_WINDOWS
// Ensure that a context doesn't exist yet.
// This only applies to platforms without PIC, e.g. Windows.
nlassert(!NLMISC::INelContext::isContextInitialised());
#endif // fdef NL_OS_WINDOWS^M
m_libContext = new NLMISC::CLibraryContext(*nelContext);
m_displayer = new NLQT::CQtDisplayer(m_ui.plainTextEdit);
}
QString CLogPlugin::name() const
{
return "LogPlugin";
}
QString CLogPlugin::version() const
{
return "1.1";
}
QString CLogPlugin::vendor() const
{
return "aquiles";
}
QString CLogPlugin::description() const
{
return tr("DockWidget to display all log messages from NeL.");
}
QStringList CLogPlugin::dependencies() const
{
QStringList list;
list.append(Core::Constants::OVQT_CORE_PLUGIN);
return list;
}
void CLogPlugin::addAutoReleasedObject(QObject *obj)
{
m_plugMan->addObject(obj);
m_autoReleaseObjects.prepend(obj);
}
void CLogPlugin::setDisplayers()
{
QSettings *settings = Core::ICore::instance()->settings();
settings->beginGroup(Core::Constants::LOG_SECTION);
// Object Viewer Qt - Log Plugin - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2011 Adrian Jaekel <aj at elane2k dot com>
//
// 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 <http://www.gnu.org/licenses/>.
// Project includes
#include "log_plugin.h"
#include "log_settings_page.h"
#include "qt_displayer.h"
#include "../core/icore.h"
#include "../core/core_constants.h"
#include "../core/menu_manager.h"
#include "../../extension_system/iplugin_spec.h"
// Qt includes
#include <QtCore/QObject>
#include <QtGui/QMessageBox>
#include <QtGui/QMainWindow>
#include <QtGui/QMenu>
#include <QtGui/QAction>
#include <QtGui/QMenuBar>
#include <QtGui/QWidget>
#include <QFile>
#include <QDateTime>
#include <QTextStream>
// NeL includes
#include <nel/misc/debug.h>
namespace Plugin
{
CLogPlugin::CLogPlugin(QWidget *parent): QDockWidget(parent)
{
m_ui.setupUi(this);
}
CLogPlugin::~CLogPlugin()
{
Q_FOREACH(QObject *obj, m_autoReleaseObjects)
{
m_plugMan->removeObject(obj);
}
qDeleteAll(m_autoReleaseObjects);
m_autoReleaseObjects.clear();
NLMISC::ErrorLog->removeDisplayer(m_displayer);
NLMISC::WarningLog->removeDisplayer(m_displayer);
NLMISC::DebugLog->removeDisplayer(m_displayer);
NLMISC::AssertLog->removeDisplayer(m_displayer);
NLMISC::InfoLog->removeDisplayer(m_displayer);
delete m_displayer;
}
bool CLogPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString)
{
Q_UNUSED(errorString);
m_plugMan = pluginManager;
m_logSettingsPage = new CLogSettingsPage(this, this);
addAutoReleasedObject(m_logSettingsPage);
return true;
}
void CLogPlugin::extensionsInitialized()
{
setDisplayers();
Core::ICore *core = Core::ICore::instance();
Core::MenuManager *menuManager = core->menuManager();
QMenu *viewMenu = menuManager->menu(Core::Constants::M_VIEW);
QMainWindow *wnd = Core::ICore::instance()->mainWindow();
wnd->addDockWidget(Qt::RightDockWidgetArea, this);
hide();
viewMenu->addAction(this->toggleViewAction());
}
void CLogPlugin::setNelContext(NLMISC::INelContext *nelContext)
{
#ifdef NL_OS_WINDOWS
// Ensure that a context doesn't exist yet.
// This only applies to platforms without PIC, e.g. Windows.
nlassert(!NLMISC::INelContext::isContextInitialised());
#endif // fdef NL_OS_WINDOWS^M
m_libContext = new NLMISC::CLibraryContext(*nelContext);
m_displayer = new NLQT::CQtDisplayer(m_ui.plainTextEdit);
}
QString CLogPlugin::name() const
{
return "LogPlugin";
}
QString CLogPlugin::version() const
{
return "1.1";
}
QString CLogPlugin::vendor() const
{
return "aquiles";
}
QString CLogPlugin::description() const
{
return tr("DockWidget to display all log messages from NeL.");
}
QStringList CLogPlugin::dependencies() const
{
QStringList list;
list.append(Core::Constants::OVQT_CORE_PLUGIN);
return list;
}
void CLogPlugin::addAutoReleasedObject(QObject *obj)
{
m_plugMan->addObject(obj);
m_autoReleaseObjects.prepend(obj);
}
void CLogPlugin::setDisplayers()
{
QSettings *settings = Core::ICore::instance()->settings();
settings->beginGroup(Core::Constants::LOG_SECTION);
bool error = settings->value(Core::Constants::LOG_ERROR, true).toBool();
bool warning = settings->value(Core::Constants::LOG_WARNING, true).toBool();
bool debug = settings->value(Core::Constants::LOG_DEBUG, true).toBool();
bool assert = settings->value(Core::Constants::LOG_ASSERT, true).toBool();
bool info = settings->value(Core::Constants::LOG_INFO, true).toBool();
settings->endGroup();
if (error) {
if (!NLMISC::ErrorLog->attached(m_displayer))
NLMISC::ErrorLog->addDisplayer(m_displayer);
} else {
if (m_displayer) {
NLMISC::ErrorLog->removeDisplayer(m_displayer);
}
}
if (warning) {
if (!NLMISC::WarningLog->attached(m_displayer))
NLMISC::WarningLog->addDisplayer(m_displayer);
} else {
if (m_displayer) {
NLMISC::WarningLog->removeDisplayer(m_displayer);
}
}
if (debug) {
if (!NLMISC::DebugLog->attached(m_displayer))
NLMISC::DebugLog->addDisplayer(m_displayer);
} else {
if (m_displayer) {
NLMISC::DebugLog->removeDisplayer(m_displayer);
}
}
if (assert) {
if (!NLMISC::AssertLog->attached(m_displayer))
NLMISC::AssertLog->addDisplayer(m_displayer);
} else {
if (m_displayer) {
NLMISC::AssertLog->removeDisplayer(m_displayer);
}
}
if (info) {
if (!NLMISC::InfoLog->attached(m_displayer))
NLMISC::InfoLog->addDisplayer(m_displayer);
} else {
if (m_displayer) {
NLMISC::InfoLog->removeDisplayer(m_displayer);
}
}
}
}
Q_EXPORT_PLUGIN(Plugin::CLogPlugin)
bool info = settings->value(Core::Constants::LOG_INFO, true).toBool();
settings->endGroup();
if (error) {
if (!NLMISC::ErrorLog->attached(m_displayer))
NLMISC::ErrorLog->addDisplayer(m_displayer);
} else {
if (m_displayer) {
NLMISC::ErrorLog->removeDisplayer(m_displayer);
}
}
if (warning) {
if (!NLMISC::WarningLog->attached(m_displayer))
NLMISC::WarningLog->addDisplayer(m_displayer);
} else {
if (m_displayer) {
NLMISC::WarningLog->removeDisplayer(m_displayer);
}
}
if (debug) {
if (!NLMISC::DebugLog->attached(m_displayer))
NLMISC::DebugLog->addDisplayer(m_displayer);
} else {
if (m_displayer) {
NLMISC::DebugLog->removeDisplayer(m_displayer);
}
}
if (assert) {
if (!NLMISC::AssertLog->attached(m_displayer))
NLMISC::AssertLog->addDisplayer(m_displayer);
} else {
if (m_displayer) {
NLMISC::AssertLog->removeDisplayer(m_displayer);
}
}
if (info) {
if (!NLMISC::InfoLog->attached(m_displayer))
NLMISC::InfoLog->addDisplayer(m_displayer);
} else {
if (m_displayer) {
NLMISC::InfoLog->removeDisplayer(m_displayer);
}
}
}
}
Q_EXPORT_PLUGIN(Plugin::CLogPlugin)

View file

@ -1,33 +1,33 @@
/*
Log Plugin Qt
Copyright (C) 2011 Adrian Jaekel <aj at elane2k dot com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
/*
Log Plugin Qt
Copyright (C) 2011 Adrian Jaekel <aj at elane2k dot com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LOG_PLUGIN_H
#define LOG_PLUGIN_H
// Project includes
// Project includes
#include "ui_log_form.h"
#include "../../extension_system/iplugin.h"
// NeL includes
#include "nel/misc/app_context.h"
// Qt includes
// Qt includes
#include <QDockWidget>
namespace NLMISC
@ -54,7 +54,7 @@ namespace Plugin
Q_OBJECT
Q_INTERFACES(ExtensionSystem::IPlugin)
public:
CLogPlugin(QWidget *parent = 0);
CLogPlugin(QWidget *parent = 0);
~CLogPlugin();
bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString);
@ -63,26 +63,26 @@ namespace Plugin
void setNelContext(NLMISC::INelContext *nelContext);
NLQT::CQtDisplayer* displayer() { return m_displayer; }
QString name() const;
QString version() const;
QString vendor() const;
QString name() const;
QString version() const;
QString vendor() const;
QString description() const;
QStringList dependencies() const;
void addAutoReleasedObject(QObject *obj);
void setDisplayers();
protected:
NLMISC::CLibraryContext *m_libContext;
QStringList dependencies() const;
void addAutoReleasedObject(QObject *obj);
void setDisplayers();
protected:
NLMISC::CLibraryContext *m_libContext;
private:
ExtensionSystem::IPluginManager *m_plugMan;
QList<QObject *> m_autoReleaseObjects;
CLogSettingsPage *m_logSettingsPage;
Ui::CLogPlugin m_ui;
Ui::CLogPlugin m_ui;
NLQT::CQtDisplayer *m_displayer;
};

View file

@ -1,133 +1,133 @@
// Object Viewer Qt - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010 Winch Gate Property Limited
// Copyright (C) 2011 Adrian Jaekel <aj at elane2k dot com>
//
// 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 <http://www.gnu.org/licenses/>.
// Project includes
#include "log_settings_page.h"
#include "log_plugin.h"
#include "../core/core_constants.h"
#include "../core/icore.h"
#include "../../extension_system/plugin_manager.h"
// NeL includes
// Qt includes
#include <QtGui/QWidget>
#include <QtCore/QSettings>
// Object Viewer Qt - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010 Winch Gate Property Limited
// Copyright (C) 2011 Adrian Jaekel <aj at elane2k dot com>
//
// 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 <http://www.gnu.org/licenses/>.
// Project includes
#include "log_settings_page.h"
#include "log_plugin.h"
#include "../core/core_constants.h"
#include "../core/icore.h"
#include "../../extension_system/plugin_manager.h"
// NeL includes
// Qt includes
#include <QtGui/QWidget>
#include <QtCore/QSettings>
namespace ExtensionSystem
{
class IPluginManager;
}
namespace Plugin
{
class CLogPlugin;
CLogSettingsPage::CLogSettingsPage(CLogPlugin *logPlugin, QObject *parent)
: IOptionsPage(parent),
m_logPlugin(logPlugin),
m_currentPage(NULL),
class IPluginManager;
}
namespace Plugin
{
class CLogPlugin;
CLogSettingsPage::CLogSettingsPage(CLogPlugin *logPlugin, QObject *parent)
: IOptionsPage(parent),
m_logPlugin(logPlugin),
m_currentPage(NULL),
m_error(true),
m_warning(true),
m_debug(true),
m_assert(true),
m_info(true)
{
}
QString CLogSettingsPage::id() const
{
return QLatin1String("log");
}
QString CLogSettingsPage::trName() const
{
return tr("Log");
}
QString CLogSettingsPage::category() const
{
return QLatin1String(Core::Constants::SETTINGS_CATEGORY_GENERAL);
}
QString CLogSettingsPage::trCategory() const
{
return tr(Core::Constants::SETTINGS_TR_CATEGORY_GENERAL);
}
QIcon CLogSettingsPage::categoryIcon() const
{
return QIcon();
}
QWidget *CLogSettingsPage::createPage(QWidget *parent)
{
m_currentPage = new QWidget(parent);
m_ui.setupUi(m_currentPage);
readSettings();
m_ui.errorCheck->setChecked(m_error);
m_ui.warningCheck->setChecked(m_warning);
m_ui.debugCheck->setChecked(m_debug);
m_ui.assertCheck->setChecked(m_assert);
m_ui.infoCheck->setChecked(m_info);
return m_currentPage;
}
void CLogSettingsPage::apply()
{
m_error = m_ui.errorCheck->isChecked();
m_warning = m_ui.warningCheck->isChecked();
m_debug = m_ui.debugCheck->isChecked();
m_assert = m_ui.assertCheck->isChecked();
m_info = m_ui.infoCheck->isChecked();
writeSettings();
m_logPlugin->setDisplayers();
}
void CLogSettingsPage::readSettings()
{
QSettings *settings = Core::ICore::instance()->settings();
settings->beginGroup(Core::Constants::LOG_SECTION);
m_info(true)
{
}
QString CLogSettingsPage::id() const
{
return QLatin1String("log");
}
QString CLogSettingsPage::trName() const
{
return tr("Log");
}
QString CLogSettingsPage::category() const
{
return QLatin1String(Core::Constants::SETTINGS_CATEGORY_GENERAL);
}
QString CLogSettingsPage::trCategory() const
{
return tr(Core::Constants::SETTINGS_TR_CATEGORY_GENERAL);
}
QIcon CLogSettingsPage::categoryIcon() const
{
return QIcon();
}
QWidget *CLogSettingsPage::createPage(QWidget *parent)
{
m_currentPage = new QWidget(parent);
m_ui.setupUi(m_currentPage);
readSettings();
m_ui.errorCheck->setChecked(m_error);
m_ui.warningCheck->setChecked(m_warning);
m_ui.debugCheck->setChecked(m_debug);
m_ui.assertCheck->setChecked(m_assert);
m_ui.infoCheck->setChecked(m_info);
return m_currentPage;
}
void CLogSettingsPage::apply()
{
m_error = m_ui.errorCheck->isChecked();
m_warning = m_ui.warningCheck->isChecked();
m_debug = m_ui.debugCheck->isChecked();
m_assert = m_ui.assertCheck->isChecked();
m_info = m_ui.infoCheck->isChecked();
writeSettings();
m_logPlugin->setDisplayers();
}
void CLogSettingsPage::readSettings()
{
QSettings *settings = Core::ICore::instance()->settings();
settings->beginGroup(Core::Constants::LOG_SECTION);
m_error = settings->value(Core::Constants::LOG_ERROR, true).toBool();
m_warning = settings->value(Core::Constants::LOG_WARNING, true).toBool();
m_debug = settings->value(Core::Constants::LOG_DEBUG, true).toBool();
m_assert = settings->value(Core::Constants::LOG_ASSERT, true).toBool();
m_info = settings->value(Core::Constants::LOG_INFO, true).toBool();
settings->endGroup();
}
void CLogSettingsPage::writeSettings()
{
QSettings *settings = Core::ICore::instance()->settings();
settings->beginGroup(Core::Constants::LOG_SECTION);
settings->setValue(Core::Constants::LOG_ERROR, m_error);
settings->setValue(Core::Constants::LOG_WARNING, m_warning);
settings->setValue(Core::Constants::LOG_DEBUG, m_debug);
settings->setValue(Core::Constants::LOG_ASSERT, m_assert);
settings->setValue(Core::Constants::LOG_INFO, m_info);
settings->endGroup();
settings->sync();
}
m_info = settings->value(Core::Constants::LOG_INFO, true).toBool();
settings->endGroup();
}
void CLogSettingsPage::writeSettings()
{
QSettings *settings = Core::ICore::instance()->settings();
settings->beginGroup(Core::Constants::LOG_SECTION);
settings->setValue(Core::Constants::LOG_ERROR, m_error);
settings->setValue(Core::Constants::LOG_WARNING, m_warning);
settings->setValue(Core::Constants::LOG_DEBUG, m_debug);
settings->setValue(Core::Constants::LOG_ASSERT, m_assert);
settings->setValue(Core::Constants::LOG_INFO, m_info);
settings->endGroup();
settings->sync();
}
} /* namespace Plugin */

View file

@ -1,56 +1,56 @@
#ifndef MISSION_COMPILER_MAIN_WINDOW_H
#define MISSION_COMPILER_MAIN_WINDOW_H
#include <QMainWindow>
#include <QTimer>
#include <QLabel>
#include <QAction>
#include <QtGui/QUndoStack>
#include <QStringListModel>
#include <QSortFilterProxyModel>
#include <QRegExp>
#include <nel/ligo/ligo_config.h>
#include <nel/ligo/primitive.h>
namespace Ui {
class MissionCompilerMainWindow;
}
struct CMission;
class MissionCompilerMainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MissionCompilerMainWindow(QWidget *parent = 0);
~MissionCompilerMainWindow();
void loadConfig();
void saveConfig();
QUndoStack *getUndoStack() { return m_undoStack; }
typedef std::map<std::string, CMission> TMissionContainer;
public Q_SLOTS:
void handleFilterChanged(const QString &text);
void handleValidation();
void handleCompile();
void handlePublish();
void handleAllDoubleClick(const QModelIndex &index);
void handleSelDoubleClick(const QModelIndex &index);
void handleMoveSelectedRight();
void handleMoveSelectedLeft();
void handleMoveAllRight();
void handleMoveAllLeft();
void handleDataDirButton();
void handleDataDirChanged(const QString &text);
void handleResetFiltersButton();
void handleChangedSettings();
private:
Ui::MissionCompilerMainWindow *ui;
#ifndef MISSION_COMPILER_MAIN_WINDOW_H
#define MISSION_COMPILER_MAIN_WINDOW_H
#include <QMainWindow>
#include <QTimer>
#include <QLabel>
#include <QAction>
#include <QtGui/QUndoStack>
#include <QStringListModel>
#include <QSortFilterProxyModel>
#include <QRegExp>
#include <nel/ligo/ligo_config.h>
#include <nel/ligo/primitive.h>
namespace Ui {
class MissionCompilerMainWindow;
}
struct CMission;
class MissionCompilerMainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MissionCompilerMainWindow(QWidget *parent = 0);
~MissionCompilerMainWindow();
void loadConfig();
void saveConfig();
QUndoStack *getUndoStack() { return m_undoStack; }
typedef std::map<std::string, CMission> TMissionContainer;
public Q_SLOTS:
void handleFilterChanged(const QString &text);
void handleValidation();
void handleCompile();
void handlePublish();
void handleAllDoubleClick(const QModelIndex &index);
void handleSelDoubleClick(const QModelIndex &index);
void handleMoveSelectedRight();
void handleMoveSelectedLeft();
void handleMoveAllRight();
void handleMoveAllLeft();
void handleDataDirButton();
void handleDataDirChanged(const QString &text);
void handleResetFiltersButton();
void handleChangedSettings();
private:
Ui::MissionCompilerMainWindow *ui;
void updateCompileLog();
void populateAllPrimitives(const QString &dataDir = QString());
@ -60,16 +60,16 @@ private:
void applyCheckboxes(const QStringList &servers);
QMenu *_toolModeMenu;
QUndoStack *m_undoStack;
QStringListModel *m_allPrimitivesModel;
QStringListModel *m_selectedPrimitivesModel;
QSortFilterProxyModel *m_filteredProxyModel;
QRegExp *m_regexpFilter;
QString m_compileLog;
QString m_lastDir;
NLLIGO::CLigoConfig m_ligoConfig;
};
#endif // MISSION_COMPILER_MAIN_WINDOW_H
QMenu *_toolModeMenu;
QUndoStack *m_undoStack;
QStringListModel *m_allPrimitivesModel;
QStringListModel *m_selectedPrimitivesModel;
QSortFilterProxyModel *m_filteredProxyModel;
QRegExp *m_regexpFilter;
QString m_compileLog;
QString m_lastDir;
NLLIGO::CLigoConfig m_ligoConfig;
};
#endif // MISSION_COMPILER_MAIN_WINDOW_H

View file

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

View file

@ -1,63 +1,63 @@
// Object Viewer Qt - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010 Winch Gate Property Limited
// Copyright (C) 2011 Dzmitry Kamiahin <dnk-88@tut.by>
//
// 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 <http://www.gnu.org/licenses/>.
// Project includes
#include "server_entry_dialog.h"
#include "ui_server_entry_dialog.h"
// NeL includes
// Qt includes
#include <QFileDialog>
namespace MissionCompiler
{
ServerEntryDialog::ServerEntryDialog(QWidget *parent)
: QDialog(parent),
m_ui(new Ui::ServerEntryDialog)
{
m_ui->setupUi(this);
connect(m_ui->serverTextPathButton, SIGNAL(clicked()), this, SLOT(lookupTextPath()));
connect(m_ui->serverPrimPathButton, SIGNAL(clicked()), this, SLOT(lookupPrimPath()));
}
ServerEntryDialog::~ServerEntryDialog()
{
delete m_ui;
}
// Object Viewer Qt - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010 Winch Gate Property Limited
// Copyright (C) 2011 Dzmitry Kamiahin <dnk-88@tut.by>
//
// 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 <http://www.gnu.org/licenses/>.
// Project includes
#include "server_entry_dialog.h"
#include "ui_server_entry_dialog.h"
// NeL includes
// Qt includes
#include <QFileDialog>
namespace MissionCompiler
{
ServerEntryDialog::ServerEntryDialog(QWidget *parent)
: QDialog(parent),
m_ui(new Ui::ServerEntryDialog)
{
m_ui->setupUi(this);
connect(m_ui->serverTextPathButton, SIGNAL(clicked()), this, SLOT(lookupTextPath()));
connect(m_ui->serverPrimPathButton, SIGNAL(clicked()), this, SLOT(lookupPrimPath()));
}
ServerEntryDialog::~ServerEntryDialog()
{
delete m_ui;
}
QString ServerEntryDialog::getServerName()
{
return m_ui->serverNameEdit->text();
}
QString ServerEntryDialog::getTextPath()
{
return m_ui->serverTextPathEdit->text();
}
QString ServerEntryDialog::getPrimPath()
{
return m_ui->serverPrimPathEdit->text();
}
QString ServerEntryDialog::getTextPath()
{
return m_ui->serverTextPathEdit->text();
}
QString ServerEntryDialog::getPrimPath()
{
return m_ui->serverPrimPathEdit->text();
}
void ServerEntryDialog::setServerName(QString name)
{
m_ui->serverNameEdit->setText(name);
@ -68,22 +68,22 @@ void ServerEntryDialog::setTextPath(QString path)
m_ui->serverTextPathEdit->setText(path);
}
void ServerEntryDialog::setPrimPath(QString path)
{
m_ui->serverPrimPathEdit->setText(path);
}
void ServerEntryDialog::lookupTextPath()
{
QString curPath = m_ui->serverTextPathEdit->text();
QString path = QFileDialog::getExistingDirectory(this, "", curPath);
m_ui->serverTextPathEdit->setText(path);
}
void ServerEntryDialog::lookupPrimPath()
{
QString curPath = m_ui->serverPrimPathEdit->text();
QString path = QFileDialog::getExistingDirectory(this, "", curPath);
m_ui->serverPrimPathEdit->setText(path);
}
void ServerEntryDialog::setPrimPath(QString path)
{
m_ui->serverPrimPathEdit->setText(path);
}
void ServerEntryDialog::lookupTextPath()
{
QString curPath = m_ui->serverTextPathEdit->text();
QString path = QFileDialog::getExistingDirectory(this, "", curPath);
m_ui->serverTextPathEdit->setText(path);
}
void ServerEntryDialog::lookupPrimPath()
{
QString curPath = m_ui->serverPrimPathEdit->text();
QString path = QFileDialog::getExistingDirectory(this, "", curPath);
m_ui->serverPrimPathEdit->setText(path);
}
} /* namespace MissionCompiler */

View file

@ -21,8 +21,8 @@
#include <QDialog>
namespace Ui {
class ServerEntryDialog;
namespace Ui {
class ServerEntryDialog;
}
namespace MissionCompiler

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)
{
f.serialCheck((uint32) '_GNM');
f.serialCheck((uint32) 'MHCS');
f.serialCheck(NELID("_GNM"));
f.serialCheck(NELID("MHCS"));
f.serialVersion(1);
if (!f.isReading())
{

View file

@ -1,155 +1,155 @@
#include "zone_painter_main_window.h"
#include "ui_zone_painter_main_window.h"
#include <QMenu>
#include <QSignalMapper>
#include <QColor>
#include <QColorDialog>
#include <QSettings>
#include "qnel_widget.h"
#include "painter_dock_widget.h"
#include "../core/icore.h"
#include "../core/menu_manager.h"
#include "../core/core_constants.h"
ZonePainterMainWindow::ZonePainterMainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::ZonePainterMainWindow)
{
ui->setupUi(this);
m_nelWidget = new NLQT::QNLWidget(this);
setCentralWidget(m_nelWidget);
// Load the settings.
loadConfig();
// Set up dock widget(s) and toolbar.
m_painterDockWidget = new PainterDockWidget(this);
addDockWidget(Qt::RightDockWidgetArea, m_painterDockWidget);
m_painterDockWidget->setVisible(true);
// Insert tool modes
_toolModeMenu = new QMenu(tr("Tool Mode"), ui->painterToolBar);
_toolModeMenu->setIcon(QIcon(":/painterTools/images/draw-brush.png"));
ui->painterToolBar->addAction(_toolModeMenu->menuAction());
//connect(_renderModeMenu->menuAction(), SIGNAL(triggered()), this, SLOT(setRenderMode()));
QSignalMapper *modeMapper = new QSignalMapper(this);
_toolPaintModeAction = _toolModeMenu->addAction(tr("Paint Mode"));
_toolPaintModeAction->setIcon(QIcon(":/painterTools/images/draw-brush.png"));
_toolPaintModeAction->setStatusTip(tr("Set paint mode"));
connect(_toolPaintModeAction, SIGNAL(triggered()), modeMapper, SLOT(map()));
modeMapper->setMapping(_toolPaintModeAction, 0);
_toolFillModeAction = _toolModeMenu->addAction(tr("Fill Mode"));
_toolFillModeAction->setStatusTip(tr("Set fill mode"));
_toolFillModeAction->setIcon(QIcon(":/painterTools/images/color-fill.png"));
connect(_toolFillModeAction, SIGNAL(triggered()), modeMapper, SLOT(map()));
modeMapper->setMapping(_toolFillModeAction, 1);
_toolSelectModeAction = _toolModeMenu->addAction(tr("Select mode"));
_toolSelectModeAction->setIcon(QIcon(":/painterTools/images/go-jump-4.png"));
_toolSelectModeAction->setStatusTip(tr("Set select mode"));
connect(_toolSelectModeAction, SIGNAL(triggered()), modeMapper, SLOT(map()));
modeMapper->setMapping(_toolSelectModeAction, 2);
_toolPickModeAction = _toolModeMenu->addAction(tr("Pick mode"));
_toolPickModeAction->setIcon(QIcon(":/painterTools/images/color-picker-black.png"));
_toolPickModeAction->setStatusTip(tr("Set color picking mode"));
connect(_toolPickModeAction, SIGNAL(triggered()), modeMapper, SLOT(map()));
modeMapper->setMapping(_toolPickModeAction, 2);
connect(modeMapper, SIGNAL(mapped(int)), this, SLOT(setToolMode(int)));
m_statusBarTimer = new QTimer(this);
connect(m_statusBarTimer, SIGNAL(timeout()), this, SLOT(updateStatusBar()));
m_statusInfo = new QLabel(this);
m_statusInfo->hide();
// Set Background Color Toolbar
connect(ui->actionBackground_Dlg, SIGNAL(triggered()), this, SLOT(setBackgroundColor()));
Core::ICore::instance()->mainWindow()->statusBar()->addPermanentWidget(m_statusInfo);
m_undoStack = new QUndoStack(this);
}
void ZonePainterMainWindow::showEvent(QShowEvent *showEvent)
{
QMainWindow::showEvent(showEvent);
m_statusBarTimer->start(1000);
m_statusInfo->show();
}
void ZonePainterMainWindow::hideEvent(QHideEvent *hideEvent)
{
m_statusBarTimer->stop();
m_statusInfo->hide();
QMainWindow::hideEvent(hideEvent);
}
void ZonePainterMainWindow::updateStatusBar()
{
m_statusInfo->setText(QString("Tool Mode: Paint Mode"));
}
void ZonePainterMainWindow::setToolMode(int value)
{
switch (value)
{
case 0:
//Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Point);
break;
case 1:
//Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Line);
break;
case 2:
//Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Filled);
break;
}
}
void ZonePainterMainWindow::setToolMode()
{
//switch (Modules::objView().getDriver()->getPolygonMode())
//{
//case NL3D::UDriver::Filled:
// Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Line);
// break;
//case NL3D::UDriver::Line:
// Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Point);
// break;
//case NL3D::UDriver::Point:
// Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Filled);
// break;
//}
}
void ZonePainterMainWindow::setBackgroundColor() {
QColor color = QColorDialog::getColor(QColor(m_nelWidget->backgroundColor().R,
m_nelWidget->backgroundColor().G,
m_nelWidget->backgroundColor().B));
if (color.isValid())
m_nelWidget->setBackgroundColor(NLMISC::CRGBA(color.red(), color.green(), color.blue()));
}
void ZonePainterMainWindow::loadConfig() {
#include "zone_painter_main_window.h"
#include "ui_zone_painter_main_window.h"
#include <QMenu>
#include <QSignalMapper>
#include <QColor>
#include <QColorDialog>
#include <QSettings>
#include "qnel_widget.h"
#include "painter_dock_widget.h"
#include "../core/icore.h"
#include "../core/menu_manager.h"
#include "../core/core_constants.h"
ZonePainterMainWindow::ZonePainterMainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::ZonePainterMainWindow)
{
ui->setupUi(this);
m_nelWidget = new NLQT::QNLWidget(this);
setCentralWidget(m_nelWidget);
// Load the settings.
loadConfig();
// Set up dock widget(s) and toolbar.
m_painterDockWidget = new PainterDockWidget(this);
addDockWidget(Qt::RightDockWidgetArea, m_painterDockWidget);
m_painterDockWidget->setVisible(true);
// Insert tool modes
_toolModeMenu = new QMenu(tr("Tool Mode"), ui->painterToolBar);
_toolModeMenu->setIcon(QIcon(":/painterTools/images/draw-brush.png"));
ui->painterToolBar->addAction(_toolModeMenu->menuAction());
//connect(_renderModeMenu->menuAction(), SIGNAL(triggered()), this, SLOT(setRenderMode()));
QSignalMapper *modeMapper = new QSignalMapper(this);
_toolPaintModeAction = _toolModeMenu->addAction(tr("Paint Mode"));
_toolPaintModeAction->setIcon(QIcon(":/painterTools/images/draw-brush.png"));
_toolPaintModeAction->setStatusTip(tr("Set paint mode"));
connect(_toolPaintModeAction, SIGNAL(triggered()), modeMapper, SLOT(map()));
modeMapper->setMapping(_toolPaintModeAction, 0);
_toolFillModeAction = _toolModeMenu->addAction(tr("Fill Mode"));
_toolFillModeAction->setStatusTip(tr("Set fill mode"));
_toolFillModeAction->setIcon(QIcon(":/painterTools/images/color-fill.png"));
connect(_toolFillModeAction, SIGNAL(triggered()), modeMapper, SLOT(map()));
modeMapper->setMapping(_toolFillModeAction, 1);
_toolSelectModeAction = _toolModeMenu->addAction(tr("Select mode"));
_toolSelectModeAction->setIcon(QIcon(":/painterTools/images/go-jump-4.png"));
_toolSelectModeAction->setStatusTip(tr("Set select mode"));
connect(_toolSelectModeAction, SIGNAL(triggered()), modeMapper, SLOT(map()));
modeMapper->setMapping(_toolSelectModeAction, 2);
_toolPickModeAction = _toolModeMenu->addAction(tr("Pick mode"));
_toolPickModeAction->setIcon(QIcon(":/painterTools/images/color-picker-black.png"));
_toolPickModeAction->setStatusTip(tr("Set color picking mode"));
connect(_toolPickModeAction, SIGNAL(triggered()), modeMapper, SLOT(map()));
modeMapper->setMapping(_toolPickModeAction, 2);
connect(modeMapper, SIGNAL(mapped(int)), this, SLOT(setToolMode(int)));
m_statusBarTimer = new QTimer(this);
connect(m_statusBarTimer, SIGNAL(timeout()), this, SLOT(updateStatusBar()));
m_statusInfo = new QLabel(this);
m_statusInfo->hide();
// Set Background Color Toolbar
connect(ui->actionBackground_Dlg, SIGNAL(triggered()), this, SLOT(setBackgroundColor()));
Core::ICore::instance()->mainWindow()->statusBar()->addPermanentWidget(m_statusInfo);
m_undoStack = new QUndoStack(this);
}
void ZonePainterMainWindow::showEvent(QShowEvent *showEvent)
{
QMainWindow::showEvent(showEvent);
m_statusBarTimer->start(1000);
m_statusInfo->show();
}
void ZonePainterMainWindow::hideEvent(QHideEvent *hideEvent)
{
m_statusBarTimer->stop();
m_statusInfo->hide();
QMainWindow::hideEvent(hideEvent);
}
void ZonePainterMainWindow::updateStatusBar()
{
m_statusInfo->setText(QString("Tool Mode: Paint Mode"));
}
void ZonePainterMainWindow::setToolMode(int value)
{
switch (value)
{
case 0:
//Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Point);
break;
case 1:
//Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Line);
break;
case 2:
//Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Filled);
break;
}
}
void ZonePainterMainWindow::setToolMode()
{
//switch (Modules::objView().getDriver()->getPolygonMode())
//{
//case NL3D::UDriver::Filled:
// Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Line);
// break;
//case NL3D::UDriver::Line:
// Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Point);
// break;
//case NL3D::UDriver::Point:
// Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Filled);
// break;
//}
}
void ZonePainterMainWindow::setBackgroundColor() {
QColor color = QColorDialog::getColor(QColor(m_nelWidget->backgroundColor().R,
m_nelWidget->backgroundColor().G,
m_nelWidget->backgroundColor().B));
if (color.isValid())
m_nelWidget->setBackgroundColor(NLMISC::CRGBA(color.red(), color.green(), color.blue()));
}
void ZonePainterMainWindow::loadConfig() {
QSettings *settings = Core::ICore::instance()->settings();
settings->beginGroup("ZonePainter");
QColor color;
color = settings->value("BackgroundColor", QColor(80, 80, 80)).value<QColor>();
settings->endGroup();
m_nelWidget->setBackgroundColor(NLMISC::CRGBA(color.red(), color.green(), color.blue(), color.alpha()));
}
void ZonePainterMainWindow::saveConfig() {
m_nelWidget->setBackgroundColor(NLMISC::CRGBA(color.red(), color.green(), color.blue(), color.alpha()));
}
void ZonePainterMainWindow::saveConfig() {
QSettings *settings = Core::ICore::instance()->settings();
settings->beginGroup("ZonePainter" );
@ -157,12 +157,12 @@ void ZonePainterMainWindow::saveConfig() {
settings->setValue("BackgroundColor", color);
settings->endGroup();
settings->sync();
}
ZonePainterMainWindow::~ZonePainterMainWindow()
{
delete ui;
delete m_nelWidget;
delete m_painterDockWidget;
}
settings->sync();
}
ZonePainterMainWindow::~ZonePainterMainWindow()
{
delete ui;
delete m_nelWidget;
delete m_painterDockWidget;
}

View file

@ -1,57 +1,57 @@
#ifndef ZONE_PAINTER_MAIN_WINDOW_H
#define ZONE_PAINTER_MAIN_WINDOW_H
#include <QMainWindow>
#include <QTimer>
#include <QLabel>
#include <QAction>
#include <QtGui/QUndoStack>
namespace NLQT {
class QNLWidget;
}
namespace Ui {
class ZonePainterMainWindow;
}
class PainterDockWidget;
class ZonePainterMainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit ZonePainterMainWindow(QWidget *parent = 0);
~ZonePainterMainWindow();
void loadConfig();
void saveConfig();
QUndoStack *getUndoStack() { return m_undoStack; }
public Q_SLOTS:
#ifndef ZONE_PAINTER_MAIN_WINDOW_H
#define ZONE_PAINTER_MAIN_WINDOW_H
#include <QMainWindow>
#include <QTimer>
#include <QLabel>
#include <QAction>
#include <QtGui/QUndoStack>
namespace NLQT {
class QNLWidget;
}
namespace Ui {
class ZonePainterMainWindow;
}
class PainterDockWidget;
class ZonePainterMainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit ZonePainterMainWindow(QWidget *parent = 0);
~ZonePainterMainWindow();
void loadConfig();
void saveConfig();
QUndoStack *getUndoStack() { return m_undoStack; }
public Q_SLOTS:
void setToolMode(int value);
void setToolMode();
void updateStatusBar();
void setBackgroundColor();
protected:
virtual void showEvent(QShowEvent *showEvent);
virtual void hideEvent(QHideEvent *hideEvent);
private:
Ui::ZonePainterMainWindow *ui;
NLQT::QNLWidget *m_nelWidget;
PainterDockWidget *m_painterDockWidget;
QTimer *m_statusBarTimer;
QLabel *m_statusInfo;
void setToolMode();
void updateStatusBar();
void setBackgroundColor();
protected:
virtual void showEvent(QShowEvent *showEvent);
virtual void hideEvent(QHideEvent *hideEvent);
private:
Ui::ZonePainterMainWindow *ui;
NLQT::QNLWidget *m_nelWidget;
PainterDockWidget *m_painterDockWidget;
QTimer *m_statusBarTimer;
QLabel *m_statusInfo;
QAction *_toolPaintModeAction;
QAction *_toolFillModeAction;
QAction *_toolSelectModeAction;
QAction *_toolPickModeAction;
QMenu *_toolModeMenu;
QUndoStack *m_undoStack;
//QAction *m_setBackColorAction;
};
#endif // ZONE_PAINTER_MAIN_WINDOW_H
QMenu *_toolModeMenu;
QUndoStack *m_undoStack;
//QAction *m_setBackColorAction;
};
#endif // ZONE_PAINTER_MAIN_WINDOW_H

View file

@ -1,229 +1,229 @@
/*
Object Viewer Qt Widget
Copyright (C) 2010 Adrian Jaekel <aj at elane2k dot com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OBJECT_VIEWER_WIDGET_H
#define OBJECT_VIEWER_WIDGET_H
// STL includes
// Qt includes
#include <QtOpenGL/QGLWidget>
#include <QTimer>
// NeL includes
#include <nel/misc/rgba.h>
#include <nel/misc/aabbox.h>
// Project includes
#include "entity.h"
#include "interfaces.h"
namespace NL3D
{
class UDriver;
class UScene;
class ULight;
class UInstance;
class UCamera;
class USkeleton;
class UPlayListManager;
class U3dMouseListener;
}
class QIcon;
/**
namespace NLQT
@brief namespace NLQT
*/
namespace NLQT
{
class CObjectViewerWidget:
public QWidget,
public IObjectViewer
{
Q_OBJECT
Q_INTERFACES(NLQT::IObjectViewer)
public:
/// Default constructor.
CObjectViewerWidget(QWidget *parent = 0);
virtual ~CObjectViewerWidget();
virtual QPaintEngine* paintEngine() const { return NULL; }
virtual void showEvent ( QShowEvent * event );
void setNelContext(NLMISC::INelContext &nelContext);
static CObjectViewerWidget &objViewWid() { return *_objectViewerWidget; }
/// Init a driver and create scene.
void init();
/// Release class.
void release();
/// Update mouse and keyboard events. And update camera matrix.
void updateInput();
/// Render Driver (clear all buffers and set background color).
void renderDriver();
/// Render current scene.
void renderScene();
/// Render Debug 2D (stuff for dev).
void renderDebug2D();
/// Make a screenshot of the current scene and save.
void saveScreenshot(const std::string &nameFile, bool jpg, bool png, bool tga);
/// Load a mesh or particle system and add to current scene.
/// @param meshFileName - name loading shape or ps file.
/// @param skelFileName - name loading skeletin file.
/// @return true if file have been loaded, false if file have not been loaded.
bool loadMesh (const std::string &meshFileName, const std::string &skelFileName);
/// Reset current scene.
void resetScene();
/// Set the background color.
/// @param backgroundColor - background color.
void setBackgroundColor(NLMISC::CRGBA backgroundColor);
/// Set type driver.
/// @param Direct3D - type driver (true - Direct3D) or (false -OpenGL)
void setGraphicsDriver(bool Direct3D);
/// Set size viewport for correct set perspective
/// @param w - width window.
/// @param h - height window.
void setSizeViewport(uint16 w, uint16 h);
void setBloomEffect(bool enabled) { _BloomEffect = enabled; }
/// Select instance from the scene
/// @param name - name instance, "" if no instance edited
void setCurrentObject(const std::string &name);
/// Get current instance from the scene
/// @return name current instance, "" if no instance edited
const std::string& getCurrentObject() { return _CurrentInstance; }
/// Get entity from the scene
/// @return ref Entity
CEntity& getEntity(const std::string &name);
/// Get full list instances from the scene
/// @param listObj - ref of return list instances
void getListObjects(std::vector<std::string> &listObj);
/// Get value background color.
/// @return background color.
NLMISC::CRGBA getBackgroundColor() { return _BackgroundColor; }
/// Get type driver.
/// @return true if have used Direct3D driver, false OpenGL driver.
inline bool getDirect3D() { return _Direct3D; }
inline bool getBloomEffect() const { return _BloomEffect; }
/// Get a pointer to the driver.
/// @return pointer to the driver.
inline NL3D::UDriver *getDriver() { return _Driver; }
/// Get a pointer to the scene.
/// @return pointer to the scene.
inline NL3D::UScene *getScene() { return _Scene; }
/// Get a manager of playlist
/// @return pointer to the UPlayListManager
inline NL3D::UPlayListManager *getPlayListManager() { return _PlayListManager; }
void setCamera(NL3D::UScene *scene, NLMISC::CAABBox &bbox, NL3D::UTransform &entity, bool high_z=false);
bool setupLight(const NLMISC::CVector &position, const NLMISC::CVector &direction);
QIcon* saveOneImage(std::string shapename);
virtual void setVisible(bool visible);
QWidget* getWidget() {return this;}
virtual QString name() const {return ("ObjectViewerWidget");}
protected:
#if defined(NL_OS_WINDOWS)
virtual bool winEvent(MSG * message, long * result);
#elif defined(NL_OS_MAC)
virtual bool macEvent(EventHandlerCallRef caller, EventRef event);
#elif defined(NL_OS_UNIX)
virtual bool x11Event(XEvent *event);
#endif
private Q_SLOTS:
void updateRender();
private:
/*
Object Viewer Qt Widget
Copyright (C) 2010 Adrian Jaekel <aj at elane2k dot com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OBJECT_VIEWER_WIDGET_H
#define OBJECT_VIEWER_WIDGET_H
// STL includes
// Qt includes
#include <QtOpenGL/QGLWidget>
#include <QTimer>
// NeL includes
#include <nel/misc/rgba.h>
#include <nel/misc/aabbox.h>
// Project includes
#include "entity.h"
#include "interfaces.h"
namespace NL3D
{
class UDriver;
class UScene;
class ULight;
class UInstance;
class UCamera;
class USkeleton;
class UPlayListManager;
class U3dMouseListener;
}
class QIcon;
/**
namespace NLQT
@brief namespace NLQT
*/
namespace NLQT
{
class CObjectViewerWidget:
public QWidget,
public IObjectViewer
{
Q_OBJECT
Q_INTERFACES(NLQT::IObjectViewer)
public:
/// Default constructor.
CObjectViewerWidget(QWidget *parent = 0);
virtual ~CObjectViewerWidget();
virtual QPaintEngine* paintEngine() const { return NULL; }
virtual void showEvent ( QShowEvent * event );
void setNelContext(NLMISC::INelContext &nelContext);
static CObjectViewerWidget &objViewWid() { return *_objectViewerWidget; }
/// Init a driver and create scene.
void init();
/// Release class.
void release();
/// Update mouse and keyboard events. And update camera matrix.
void updateInput();
/// Render Driver (clear all buffers and set background color).
void renderDriver();
/// Render current scene.
void renderScene();
/// Render Debug 2D (stuff for dev).
void renderDebug2D();
/// Make a screenshot of the current scene and save.
void saveScreenshot(const std::string &nameFile, bool jpg, bool png, bool tga);
/// Load a mesh or particle system and add to current scene.
/// @param meshFileName - name loading shape or ps file.
/// @param skelFileName - name loading skeletin file.
/// @return true if file have been loaded, false if file have not been loaded.
bool loadMesh (const std::string &meshFileName, const std::string &skelFileName);
/// Reset current scene.
void resetScene();
/// Set the background color.
/// @param backgroundColor - background color.
void setBackgroundColor(NLMISC::CRGBA backgroundColor);
/// Set type driver.
/// @param Direct3D - type driver (true - Direct3D) or (false -OpenGL)
void setGraphicsDriver(bool Direct3D);
/// Set size viewport for correct set perspective
/// @param w - width window.
/// @param h - height window.
void setSizeViewport(uint16 w, uint16 h);
void setBloomEffect(bool enabled) { _BloomEffect = enabled; }
/// Select instance from the scene
/// @param name - name instance, "" if no instance edited
void setCurrentObject(const std::string &name);
/// Get current instance from the scene
/// @return name current instance, "" if no instance edited
const std::string& getCurrentObject() { return _CurrentInstance; }
/// Get entity from the scene
/// @return ref Entity
CEntity& getEntity(const std::string &name);
/// Get full list instances from the scene
/// @param listObj - ref of return list instances
void getListObjects(std::vector<std::string> &listObj);
/// Get value background color.
/// @return background color.
NLMISC::CRGBA getBackgroundColor() { return _BackgroundColor; }
/// Get type driver.
/// @return true if have used Direct3D driver, false OpenGL driver.
inline bool getDirect3D() { return _Direct3D; }
inline bool getBloomEffect() const { return _BloomEffect; }
/// Get a pointer to the driver.
/// @return pointer to the driver.
inline NL3D::UDriver *getDriver() { return _Driver; }
/// Get a pointer to the scene.
/// @return pointer to the scene.
inline NL3D::UScene *getScene() { return _Scene; }
/// Get a manager of playlist
/// @return pointer to the UPlayListManager
inline NL3D::UPlayListManager *getPlayListManager() { return _PlayListManager; }
void setCamera(NL3D::UScene *scene, NLMISC::CAABBox &bbox, NL3D::UTransform &entity, bool high_z=false);
bool setupLight(const NLMISC::CVector &position, const NLMISC::CVector &direction);
QIcon* saveOneImage(std::string shapename);
virtual void setVisible(bool visible);
QWidget* getWidget() {return this;}
virtual QString name() const {return ("ObjectViewerWidget");}
protected:
#if defined(NL_OS_WINDOWS)
virtual bool winEvent(MSG * message, long * result);
#elif defined(NL_OS_MAC)
virtual bool macEvent(EventHandlerCallRef caller, EventRef event);
#elif defined(NL_OS_UNIX)
virtual bool x11Event(XEvent *event);
#endif
private Q_SLOTS:
void updateRender();
private:
/// Update the animation time for Particle System animation.
/// @param deltaTime - set the manual animation time.
void updateAnimatePS(uint64 deltaTime = 0);
static CObjectViewerWidget *_objectViewerWidget;
NLMISC::CLibraryContext *_LibContext;
// render stuff
QTimer *_mainTimer;
bool _isGraphicsInitialized, _isGraphicsEnabled;
void updateInitialization(bool visible);
void deleteEntity (CEntity &entity);
/// Delete all entities
void deleteEntities();
NLMISC::CRGBA _BackgroundColor;
NL3D::UDriver *_Driver;
NL3D::UScene *_Scene;
NL3D::UPlayListManager *_PlayListManager;
NL3D::ULight *_Light;
NL3D::UCamera *_Camera;
NL3D::U3dMouseListener *_MouseListener;
// The entities storage
CEntities _Entities;
/// Camera parameters.
float _phi, _psi, _dist;
float _CameraFocal;
bool _Direct3D;
bool _BloomEffect;
std::string _CurrentInstance;
// a temporary solution, and later remove
friend class CAnimationSetDialog;
};/* class CObjectViewerWidget */
} /* namespace NLQT */
#endif // OBJECT_VIEWER_WIDGET_H
void updateAnimatePS(uint64 deltaTime = 0);
static CObjectViewerWidget *_objectViewerWidget;
NLMISC::CLibraryContext *_LibContext;
// render stuff
QTimer *_mainTimer;
bool _isGraphicsInitialized, _isGraphicsEnabled;
void updateInitialization(bool visible);
void deleteEntity (CEntity &entity);
/// Delete all entities
void deleteEntities();
NLMISC::CRGBA _BackgroundColor;
NL3D::UDriver *_Driver;
NL3D::UScene *_Scene;
NL3D::UPlayListManager *_PlayListManager;
NL3D::ULight *_Light;
NL3D::UCamera *_Camera;
NL3D::U3dMouseListener *_MouseListener;
// The entities storage
CEntities _Entities;
/// Camera parameters.
float _phi, _psi, _dist;
float _CameraFocal;
bool _Direct3D;
bool _BloomEffect;
std::string _CurrentInstance;
// a temporary solution, and later remove
friend class CAnimationSetDialog;
};/* class CObjectViewerWidget */
} /* namespace NLQT */
#endif // OBJECT_VIEWER_WIDGET_H

View file

@ -1,5 +1,5 @@
/*
Object Viewer Qt Widget
Object Viewer Qt Widget
Copyright (C) 2010 Adrian Jaekel <aj at elane2k dot com>
This program is free software: you can redistribute it and/or modify

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -488,7 +488,7 @@ void CCharacterCL::stopAttachedFXForCurrrentAnim(bool stopLoopingFX)
{
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);
}
@ -9373,7 +9373,7 @@ void CCharacterCL::CWornItem::enableAdvantageFX(NL3D::UInstance parent)
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.
if (!AdvantageFX.removeByID('STOP') && !AdvantageFX.removeByID('main'))
if (!AdvantageFX.removeByID(NELID("STOP")) && !AdvantageFX.removeByID(NELID("main")))
{
AdvantageFX.activateEmitters(false);
}

View file

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

View file

@ -77,7 +77,7 @@ protected:
float TimeOut;
bool TestNoMoreParticles;
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;
TimeOut = timeOut;

View file

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

View file

@ -64,7 +64,7 @@ bool CPositionState::getPos(sint32 &px, sint32 &py)
// ***************************************************************************
void CPositionState::serialNodeLeaf(NLMISC::IStream &f, CCDBNodeLeaf *&dbNode)
{
f.serialCheck((uint32) 'NL__');
f.serialCheck(NELID("NL__"));
f.serialVersion(0);
std::string dbPath;
if (f.isReading())
@ -85,18 +85,18 @@ void CPositionState::serialNodeLeaf(NLMISC::IStream &f, CCDBNodeLeaf *&dbNode)
}
f.serial(dbPath);
}
f.serialCheck((uint32) 'END_');
f.serialCheck(NELID("END_"));
}
// ***************************************************************************
void CUIDEntityPositionState::serial(NLMISC::IStream &f)
{
f.serialCheck((uint32) 'UIDE');
f.serialCheck(NELID("UIDE"));
f.serialVersion(0);
serialNodeLeaf(f, _DBPos);
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)
{
f.serialCheck((uint32) 'APS_');
f.serialCheck(NELID("APS_"));
f.serialVersion(0);
CUIDEntityPositionState::serial(f);
serialNodeLeaf(f, _Status);
f.serialCheck((uint32) 'END_');
f.serialCheck(NELID("END_"));
}
@ -257,7 +257,7 @@ void CAnimalPositionState::serial(NLMISC::IStream &f)
// ***************************************************************************
CEntityCL *CNamedEntityPositionState::getEntity()
{
if (!dbOk()) return false;
if (!dbOk()) return NULL;
return EntitiesMngr.getEntityByName(_Name->getValue32());
}
@ -299,11 +299,11 @@ bool CDialogEntityPositionState::getDbPos(sint32 &px, sint32 &py)
// ***************************************************************************
void CNamedEntityPositionState::serial(NLMISC::IStream &f)
{
f.serialCheck((uint32) 'NEPS');
f.serialCheck(NELID("NEPS"));
f.serialVersion(0);
serialNodeLeaf(f, _Name);
serialNodeLeaf(f, _X);
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;
prop = (char*) xmlGetProp( cur, (xmlChar*)"dragable" );
if( prop != NULL )
if (prop)
setDraggable( CInterfaceElement::convertBool(prop) );
else
setDraggable( false );

View file

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

View file

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

View file

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

View file

@ -68,7 +68,7 @@ void CCompassTarget::serial(NLMISC::IStream &f)
return;
}
}
f.serialCheck((uint32) 'CTAR');
f.serialCheck(NELID("CTAR"));
f.serialVersion(0);
f.serial(Pos);
// 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;
}
}
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
// reset the compass to north to avoid incoherency
if (f.isReading())
@ -811,18 +811,19 @@ void CGroupCompasMenu::setActive (bool state)
uint nbUserLandMarks = std::min( uint(currCont->UserLandMarks.size()), CContinent::getMaxNbUserLandMarks() );
// 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)
{
if (currCont->UserLandMarks[k].Type < CUserLandMark::UserLandMarkTypeCount)
if (sortedLandmarks[k].Type < CUserLandMark::UserLandMarkTypeCount)
{
CCompassTarget ct;
ct.setType(CCompassTarget::UserLandMark);
ct.Pos = currCont->UserLandMarks[k].Pos;
ct.Name = currCont->UserLandMarks[k].Title;
ct.Pos = sortedLandmarks[k].Pos;
ct.Name = sortedLandmarks[k].Title;
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;
}
}

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)
if (ver >= 1)
{
f.serialCheck(uint32('_ICU'));
f.serialCheck(NELID("_ICU"));
if (!PeopleInterraction.loadUserChatsInfos(f))
{
nlwarning("Bad user chat saving");
@ -1671,7 +1671,7 @@ bool CInterfaceManager::loadConfig (const string &filename)
}
// header
f.serialCheck(uint32('GFCI'));
f.serialCheck(NELID("GFCI"));
f.serial(nNbMode);
f.serial(_CurrentMode);
if(ver>=10)
@ -1897,7 +1897,7 @@ bool CInterfaceManager::saveConfig (const string &filename)
f.serialVersion(ICFG_STREAM_VERSION);
// 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))
{
nlwarning("Config saving failed");
@ -1907,7 +1907,7 @@ bool CInterfaceManager::saveConfig (const string &filename)
}
// header
f.serialCheck(uint32('GFCI'));
f.serialCheck(NELID("GFCI"));
f.serial(i);
f.serial(_CurrentMode);
f.serial(_LastInGameScreenW);

View file

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

View file

@ -1943,16 +1943,21 @@ class CAHInitResLod : public IActionHandler
VideoModes.clear();
StringModeList.clear();
StringModeList.push_back("uiConfigWindowed");
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 (ClientCfg.Windowed)
CurrentMode = 0;
// 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)
CurrentMode = 1;
// We inserted 'Windowed' as first mode, so index needs to move too
else
++CurrentMode;
CInterfaceManager *pIM = CInterfaceManager::getInstance();
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");
// 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;
// Get W, H
@ -2125,6 +2135,10 @@ class CAHUninitResLod : public IActionHandler
}
ClientCfg.Width = w;
ClientCfg.Height = h;
ClientCfg.writeBool("FullScreen", true);
ClientCfg.writeInt("Width", w);
ClientCfg.writeInt("Height", h);
}
if (CurrentPreset != 4) // CInterfaceDDX::CustomPreset

View file

@ -648,7 +648,7 @@ void CProjectileManager::CProjectile::shutDown(CCharacterCL *target)
target->buildAlignMatrix(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);
//nlwarning("Projectile with a particle system that has no 'STOP' emitter");

View file

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

View file

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

View file

@ -341,8 +341,8 @@ private:
void serial(NLMISC::IStream &f)
{
f.serialCheck((uint32)'_RTS');
f.serialCheck((uint32)'KCAP');
f.serialCheck(NELID("_RTS"));
f.serialCheck(NELID("KCAP"));
f.serialVersion(0);
f.serial(PackedVersion);
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
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
Instance.activateEmitters(false);

View file

@ -325,9 +325,11 @@ static _TOKENS_CLASSNAME _TOKENS_OBJNAME;
#else
#ifdef NL_OS_WINDOWS
#pragma message( " ")
#pragma message( "NON-OPTIMISED: Persistent data class " NL_MACRO_TO_STR(PERSISTENT_CLASS) " not using a token family")
#pragma message( " ")
#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)
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))
throw Exception("Check not passed");

View file

@ -61,9 +61,9 @@ public:
/// 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
/// Return the security code
CSecurityCode encode(char *passPhrase);
CSecurityCode encode(const char *passPhrase);
/// Check the security code
void check(char *passPhrase);
void check(const char *passPhrase);
/// Read some data from stream
void receiveSecurityCode(NLMISC::IStream& msgin);

View file

@ -2277,7 +2277,7 @@ public:
sint32 xmax = (sint32) max.x();
sint32 ymin = (sint32) (sint16) min.y();
sint32 ymax = (sint32) (sint16) max.y();
output.serialCheck((uint32) 'OBSI');
output.serialCheck(NELID("OBSI"));
output.serial(xmin);
output.serial(xmax);
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;
}
static char* hexEncoderTcl =
static const char* hexEncoderTcl =
"proc copy_encoded {} {"
" # Get the args from the text fields"
" set group [ .group.name get 1.0 end ]"

View file

@ -1,59 +1,59 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// 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 <http://www.gnu.org/licenses/>.
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// 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 <http://www.gnu.org/licenses/>.
#ifndef RYAI_SPAWN_COMMANDS_H
#define RYAI_SPAWN_COMMANDS_H
#include "nel/misc/types_nl.h"
#include "nel/misc/debug.h"
#include <string>
//class CAISpawnCtrl
//{
//public:
// static bool spawn (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_spawn(aiInstance, name); }
// static bool spawnMap (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_spawnMap(aiInstance, name); }
// static bool spawnMgr (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_spawnMgr(aiInstance, name); }
// static bool spawnGrp (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_spawnGrp(aiInstance, name); }
// static bool spawnAll (int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_spawnAll(aiInstance); }
//
// static bool despawn (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_despawn(aiInstance, name); }
// static bool despawnMap (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_despawnMap(aiInstance, name); }
// static bool despawnMgr (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_despawnMgr(aiInstance, name); }
// static bool despawnGrp (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_despawnGrp(aiInstance, name); }
// static bool despawnAll (int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_despawnAll(aiInstance); }
//
//protected:
// virtual bool _spawn (int aiInstance, const std::string &name)=0;
// virtual bool _spawnMap (int aiInstance, const std::string &name)=0;
// virtual bool _spawnMgr (int aiInstance, const std::string &name)=0;
// virtual bool _spawnGrp (int aiInstance, const std::string &name)=0;
// virtual bool _spawnAll (int aiInstance)=0;
//
// virtual bool _despawn (int aiInstance, const std::string &name)=0;
// virtual bool _despawnMap (int aiInstance, const std::string &name)=0;
// virtual bool _despawnMgr (int aiInstance, const std::string &name)=0;
// virtual bool _despawnGrp (int aiInstance, const std::string &name)=0;
// virtual bool _despawnAll (int aiInstance)=0;
//
// static CAISpawnCtrl *_instance;
//};
#endif
#include "nel/misc/types_nl.h"
#include "nel/misc/debug.h"
#include <string>
//class CAISpawnCtrl
//{
//public:
// static bool spawn (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_spawn(aiInstance, name); }
// static bool spawnMap (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_spawnMap(aiInstance, name); }
// static bool spawnMgr (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_spawnMgr(aiInstance, name); }
// static bool spawnGrp (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_spawnGrp(aiInstance, name); }
// static bool spawnAll (int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_spawnAll(aiInstance); }
//
// static bool despawn (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_despawn(aiInstance, name); }
// static bool despawnMap (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_despawnMap(aiInstance, name); }
// static bool despawnMgr (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_despawnMgr(aiInstance, name); }
// static bool despawnGrp (const std::string &name, int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_despawnGrp(aiInstance, name); }
// static bool despawnAll (int aiInstance=-1) { nlassert(_instance!=NULL); return _instance->_despawnAll(aiInstance); }
//
//protected:
// virtual bool _spawn (int aiInstance, const std::string &name)=0;
// virtual bool _spawnMap (int aiInstance, const std::string &name)=0;
// virtual bool _spawnMgr (int aiInstance, const std::string &name)=0;
// virtual bool _spawnGrp (int aiInstance, const std::string &name)=0;
// virtual bool _spawnAll (int aiInstance)=0;
//
// virtual bool _despawn (int aiInstance, const std::string &name)=0;
// virtual bool _despawnMap (int aiInstance, const std::string &name)=0;
// virtual bool _despawnMgr (int aiInstance, const std::string &name)=0;
// virtual bool _despawnGrp (int aiInstance, const std::string &name)=0;
// virtual bool _despawnAll (int aiInstance)=0;
//
// static CAISpawnCtrl *_instance;
//};
#endif

View file

@ -553,7 +553,7 @@ void CWorldMap::clear()
void CWorldMap::serial(NLMISC::IStream &f)
{
f.serialCheck((uint32)'WMAP');
f.serialCheck(NELID("WMAP"));
// 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
void CTopology::serial(NLMISC::IStream& f)
{
uint version = 0;
uint16 check = (uint16)'Tp';
uint16 check = NELID16("Tp");
f.serial(check);
if (check != (uint16)'TP')
if (check != NELID16("TP"))
{
nlassert(check == (uint16)'Tp');
nlassert(check == NELID16("Tp"));
version = f.serialVersion(3);
}
@ -2285,7 +2294,7 @@ sint CWhiteCell::getHeight(CWorldPosition const& wpos) const
inline
void CWhiteCell::serial(NLMISC::IStream& f)
{
f.serialCheck((uint16)'WC');
f.serialCheck(NELID16("WC"));
if (f.isReading())
_HeightMap = I16x16Layer::load(f);
else

View file

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

View file

@ -494,7 +494,7 @@ bool CGuildMemberModule::canAffectGrade(EGSPD::CGuildGrade::TGuildGrade)const
CMissionGuild * CGuildMemberModule::pickMission( TAIAlias alias )
{
/// 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 );
fprintf( f, "%g;%g;%g;%g;%g;%g;%g;%g;%g;%u;%u;\n",
res[CHarvestSource::A], res[CHarvestSource::Q],
testSource->getD(), testSource->getE(), 0 /*testSource->getC()*/,
testSource->getD(), testSource->getE(), 0.f /*testSource->getC()*/,
reqS, reqA, reqQ,
testSource->quantity(), testSource->getImpactScheme()*5, 127 );
if ( (!eventD) && (testSource->getD() > 127) )

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

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