MODIFIED: #1471 Merged mainline default to this branch.

This commit is contained in:
dfighter1985 2012-11-25 05:22:40 +01:00
commit 421582d386
1508 changed files with 19524 additions and 5021 deletions

View file

@ -153,6 +153,7 @@ code/nelns/build/*
code/snowballs/build/*
code/ryzom/build/*
code/build/*
code/build-2010/*
build/*
install/*

View file

@ -48,9 +48,6 @@ SET(NL_VERSION_MINOR 8)
SET(NL_VERSION_PATCH 0)
SET(NL_VERSION "${NL_VERSION_MAJOR}.${NL_VERSION_MINOR}.${NL_VERSION_PATCH}")
NL_SETUP_BUILD()
NL_SETUP_BUILD_FLAGS()
#-----------------------------------------------------------------------------
# Redirect output files
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
@ -87,6 +84,9 @@ RYZOM_SETUP_PREFIX_PATHS()
NL_CONFIGURE_CHECKS()
NL_SETUP_BUILD()
NL_SETUP_BUILD_FLAGS()
#-----------------------------------------------------------------------------
#Platform specifics
@ -111,10 +111,11 @@ IF(WITH_STATIC)
SET(LIBXML2_DEFINITIONS ${LIBXML2_DEFINITIONS} -DLIBXML_STATIC)
SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${WINSOCK2_LIB})
# on Mac OS X libxml2 requieres iconv
# on Mac OS X libxml2 requires iconv and liblzma
IF(APPLE)
FIND_PACKAGE(Iconv REQUIRED)
SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${ICONV_LIBRARIES})
FIND_PACKAGE(LibLZMA REQUIRED)
SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${ICONV_LIBRARIES} ${LIBLZMA_LIBRARIES})
INCLUDE_DIRECTORIES(${ICONV_INCLUDE_DIR})
ENDIF(APPLE)
ENDIF(WITH_STATIC)
@ -230,7 +231,7 @@ IF(WIN32)
"${QT_LIBRARY_DIR}/../bin/QtGuid4.dll"
"${QT_LIBRARY_DIR}/../bin/QtXmld4.dll"
"${QT_LIBRARY_DIR}/../bin/QtCored4.dll"
DESTINATION bin)
DESTINATION ${NL_BIN_PREFIX})
ENDIF(WITH_QT)
ELSE(NOT CMAKE_BUILD_TYPE STREQUAL "Release")
IF(WITH_QT)
@ -239,18 +240,18 @@ IF(WIN32)
"${QT_LIBRARY_DIR}/../bin/QtGui4.dll"
"${QT_LIBRARY_DIR}/../bin/QtXml4.dll"
"${QT_LIBRARY_DIR}/../bin/QtCore4.dll"
DESTINATION bin)
DESTINATION ${NL_BIN_PREFIX})
ENDIF(WITH_QT)
ENDIF(NOT CMAKE_BUILD_TYPE STREQUAL "Release")
# Install CEGUI and its dependencies.
IF(WITH_NEL_CEGUI)
INSTALL(FILES "${CEGUI_LIB_DIR}/CEGUIBase.dll" DESTINATION bin)
INSTALL(FILES "${CEGUI_LIB_DIR}/CEGUIDevilImageCodec.dll" DESTINATION bin)
INSTALL(FILES "${CEGUI_LIB_DIR}/CEGUIExpatParser.dll" DESTINATION bin)
INSTALL(FILES "${CEGUI_LIB_DIR}/CEGUIFalagardWRBase.dll" DESTINATION bin)
INSTALL(FILES "${CEGUI_LIB_DIR}/Devil.dll" DESTINATION bin)
INSTALL(FILES "${CEGUI_LIB_DIR}/ILU.dll" DESTINATION bin)
INSTALL(FILES "${CEGUI_LIB_DIR}/CEGUIBase.dll" DESTINATION ${NL_BIN_PREFIX})
INSTALL(FILES "${CEGUI_LIB_DIR}/CEGUIDevilImageCodec.dll" DESTINATION ${NL_BIN_PREFIX})
INSTALL(FILES "${CEGUI_LIB_DIR}/CEGUIExpatParser.dll" DESTINATION ${NL_BIN_PREFIX})
INSTALL(FILES "${CEGUI_LIB_DIR}/CEGUIFalagardWRBase.dll" DESTINATION ${NL_BIN_PREFIX})
INSTALL(FILES "${CEGUI_LIB_DIR}/Devil.dll" DESTINATION ${NL_BIN_PREFIX})
INSTALL(FILES "${CEGUI_LIB_DIR}/ILU.dll" DESTINATION ${NL_BIN_PREFIX})
ENDIF(WITH_NEL_CEGUI)
# Only the tools require MFC.

View file

@ -60,7 +60,7 @@ IF(Mercurial_HG_EXECUTABLE)
"\\1" Mercurial_VERSION_HG "${Mercurial_VERSION_HG}")
MACRO(Mercurial_WC_INFO dir prefix)
EXECUTE_PROCESS(COMMAND ${Mercurial_HG_EXECUTABLE} tip
EXECUTE_PROCESS(COMMAND ${Mercurial_HG_EXECUTABLE} tip --template "{rev};{node};{tags};{author}"
WORKING_DIRECTORY ${dir}
OUTPUT_VARIABLE ${prefix}_WC_INFO
ERROR_VARIABLE Mercurial_hg_info_error
@ -70,18 +70,18 @@ IF(Mercurial_HG_EXECUTABLE)
IF(NOT ${Mercurial_hg_info_result} EQUAL 0)
MESSAGE(SEND_ERROR "Command \"${Mercurial_HG_EXECUTABLE} tip\" failed with output:\n${Mercurial_hg_info_error}")
ELSE(NOT ${Mercurial_hg_info_result} EQUAL 0)
STRING(REGEX REPLACE "^(.*\n)?Repository Root: ([^\n]+).*"
"\\2" ${prefix}_WC_ROOT "${${prefix}_WC_INFO}")
STRING(REGEX REPLACE "^(.*\n)?changeset: *([0-9]+).*"
"\\2" ${prefix}_WC_REVISION "${${prefix}_WC_INFO}")
STRING(REGEX REPLACE "^(.*\n)?Last Changed Author: ([^\n]+).*"
"\\2" ${prefix}_WC_LAST_CHANGED_AUTHOR "${${prefix}_WC_INFO}")
STRING(REGEX REPLACE "^(.*\n)?Last Changed Rev: ([^\n]+).*"
"\\2" ${prefix}_WC_LAST_CHANGED_REV "${${prefix}_WC_INFO}")
STRING(REGEX REPLACE "^(.*\n)?Last Changed Date: ([^\n]+).*"
"\\2" ${prefix}_WC_LAST_CHANGED_DATE "${${prefix}_WC_INFO}")
LIST(LENGTH ${prefix}_WC_INFO _COUNT)
IF(_COUNT EQUAL 4)
LIST(GET ${prefix}_WC_INFO 0 ${prefix}_WC_REVISION)
LIST(GET ${prefix}_WC_INFO 1 ${prefix}_WC_CHANGESET)
LIST(GET ${prefix}_WC_INFO 2 ${prefix}_WC_BRANCH)
LIST(GET ${prefix}_WC_INFO 3 ${prefix}_WC_LAST_CHANGED_AUTHOR)
ELSE(_COUNT EQUAL 4)
MESSAGE(STATUS "Bad output from HG")
SET(${prefix}_WC_REVISION "unknown")
SET(${prefix}_WC_CHANGESET "unknown")
SET(${prefix}_WC_BRANCH "unknown")
ENDIF(_COUNT EQUAL 4)
ENDIF(NOT ${Mercurial_hg_info_result} EQUAL 0)
ENDMACRO(Mercurial_WC_INFO)

View file

@ -67,6 +67,11 @@ IF(SQUISH_FOUND)
IF(NOT SQUISH_FIND_QUIETLY)
MESSAGE(STATUS "Found Squish: ${SQUISH_LIBRARIES}")
ENDIF(NOT SQUISH_FIND_QUIETLY)
FILE(STRINGS ${SQUISH_INCLUDE_DIR}/squish.h METRIC REGEX "metric = 0")
IF(METRIC)
SET(SQUISH_COMPRESS_HAS_METRIC ON)
SET(SQUISH_DEFINITIONS -DSQUISH_COMPRESS_HAS_METRIC)
ENDIF(METRIC)
ELSE(SQUISH_FOUND)
IF(NOT SQUISH_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find Squish!")

View file

@ -3,20 +3,24 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3)
# ROOT_DIR should be set to root of the repository (where to find the .svn or .hg directory)
# SOURCE_DIR should be set to root of your code (where to find CMakeLists.txt)
# Replace spaces by semi-columns
IF(CMAKE_MODULE_PATH)
IF(SOURCE_DIR)
# Replace spaces by semi-columns
IF(CMAKE_MODULE_PATH)
STRING(REPLACE " " ";" CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
ENDIF(CMAKE_MODULE_PATH)
ENDIF(CMAKE_MODULE_PATH)
SET(CMAKE_MODULE_PATH ${SOURCE_DIR}/CMakeModules ${CMAKE_MODULE_PATH})
SET(CMAKE_MODULE_PATH ${SOURCE_DIR}/CMakeModules ${CMAKE_MODULE_PATH})
IF(NOT ROOT_DIR AND SOURCE_DIR)
IF(NOT ROOT_DIR AND SOURCE_DIR)
SET(ROOT_DIR ${SOURCE_DIR})
ENDIF(NOT ROOT_DIR AND SOURCE_DIR)
ENDIF(NOT ROOT_DIR AND SOURCE_DIR)
IF(NOT SOURCE_DIR AND ROOT_DIR)
IF(NOT SOURCE_DIR AND ROOT_DIR)
SET(SOURCE_DIR ${ROOT_DIR})
ENDIF(NOT SOURCE_DIR AND ROOT_DIR)
ENDIF(NOT SOURCE_DIR AND ROOT_DIR)
ELSE(SOURCE_DIR)
SET(ROOT_DIR ${CMAKE_SOURCE_DIR})
ENDIF(SOURCE_DIR)
MACRO(NOW RESULT)
IF (WIN32)
@ -53,10 +57,11 @@ IF(EXISTS "${ROOT_DIR}/.hg/")
ENDIF(MERCURIAL_FOUND)
ENDIF(EXISTS "${ROOT_DIR}/.hg/")
IF(DEFINED REVISION)
IF(SOURCE_DIR AND DEFINED REVISION)
IF(EXISTS ${SOURCE_DIR}/revision.h.in)
MESSAGE(STATUS "Revision: ${REVISION}")
NOW(BUILD_DATE)
CONFIGURE_FILE(${SOURCE_DIR}/revision.h.in revision.h.txt)
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy revision.h.txt revision.h) # copy_if_different
ENDIF(EXISTS ${SOURCE_DIR}/revision.h.in)
ENDIF(DEFINED REVISION)
ENDIF(SOURCE_DIR AND DEFINED REVISION)

View file

@ -34,18 +34,18 @@ ENDIF(MSVC)
MACRO(_PCH_GET_COMPILE_FLAGS _out_compile_flags)
STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name)
SET(${_out_compile_flags} ${${_flags_var_name}} )
SET(_FLAGS ${${_flags_var_name}} )
IF(NOT MSVC)
GET_TARGET_PROPERTY(_targetType ${_PCH_current_target} TYPE)
IF(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY)
LIST(APPEND ${_out_compile_flags} "-fPIC")
LIST(APPEND _FLAGS "-fPIC")
ENDIF(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY)
ENDIF(NOT MSVC)
GET_DIRECTORY_PROPERTY(DIRINC INCLUDE_DIRECTORIES )
FOREACH(item ${DIRINC})
LIST(APPEND ${_out_compile_flags} " ${_PCH_include_prefix}\"${item}\"")
LIST(APPEND _FLAGS " ${_PCH_include_prefix}\"${item}\"")
ENDFOREACH(item)
# Required for CMake 2.6
@ -57,13 +57,32 @@ MACRO(_PCH_GET_COMPILE_FLAGS _out_compile_flags)
GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS)
GET_DIRECTORY_PROPERTY(_directory_definitions DIRECTORY ${CMAKE_SOURCE_DIR} DEFINITIONS)
LIST(APPEND ${_out_compile_flags} ${GLOBAL_DEFINITIONS})
LIST(APPEND ${_out_compile_flags} ${_directory_flags})
LIST(APPEND ${_out_compile_flags} ${_directory_definitions})
LIST(APPEND ${_out_compile_flags} ${CMAKE_CXX_FLAGS})
LIST(APPEND _FLAGS ${GLOBAL_DEFINITIONS})
LIST(APPEND _FLAGS ${_directory_flags})
LIST(APPEND _FLAGS ${_directory_definitions})
LIST(APPEND _FLAGS ${CMAKE_CXX_FLAGS})
# Format definitions
SEPARATE_ARGUMENTS(${_out_compile_flags})
SEPARATE_ARGUMENTS(_FLAGS)
IF(CLANG)
SET(_IGNORE_NEXT OFF)
FOREACH(item ${_FLAGS})
IF(_IGNORE_NEXT)
SET(_IGNORE_NEXT OFF)
ELSE(_IGNORE_NEXT)
IF(item MATCHES "^-Xarch")
SET(_IGNORE_NEXT ON)
ELSEIF(item MATCHES "^-arch")
SET(_IGNORE_NEXT ON)
ELSE(item MATCHES "^-Xarch")
LIST(APPEND ${_out_compile_flags} ${item})
ENDIF(item MATCHES "^-Xarch")
ENDIF(_IGNORE_NEXT)
ENDFOREACH(item)
ELSE(CLANG)
SET(${_out_compile_flags} ${_FLAGS})
ENDIF(CLANG)
ENDMACRO(_PCH_GET_COMPILE_FLAGS)
MACRO(_PCH_GET_PDB_FILENAME out_filename _target)

View file

@ -13,11 +13,7 @@ ENDIF(NOT CMAKE_BUILD_TYPE)
MACRO(NL_GEN_PC name)
IF(NOT WIN32 AND WITH_INSTALL_LIBRARIES)
CONFIGURE_FILE(${name}.in "${CMAKE_CURRENT_BINARY_DIR}/${name}")
IF(CMAKE_LIBRARY_ARCHITECTURE)
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/${name}" DESTINATION lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig)
ELSE(CMAKE_LIBRARY_ARCHITECTURE)
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/${name}" DESTINATION lib/pkgconfig)
ENDIF(CMAKE_LIBRARY_ARCHITECTURE)
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/${name}" DESTINATION ${NL_LIB_PREFIX}/pkgconfig)
ENDIF(NOT WIN32 AND WITH_INSTALL_LIBRARIES)
ENDMACRO(NL_GEN_PC)
@ -26,16 +22,39 @@ ENDMACRO(NL_GEN_PC)
###
MACRO(NL_GEN_REVISION_H)
IF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h.in)
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})
ADD_DEFINITIONS(-DHAVE_REVISION_H)
SET(HAVE_REVISION_H ON)
SET(TOOL_FOUND OFF)
IF(EXISTS "${CMAKE_SOURCE_DIR}/../.svn/")
FIND_PACKAGE(Subversion)
IF(SUBVERSION_FOUND)
SET(TOOL_FOUND ON)
ENDIF(SUBVERSION_FOUND)
ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/../.svn/")
IF(EXISTS "${CMAKE_SOURCE_DIR}/../.hg/")
FIND_PACKAGE(Mercurial)
IF(MERCURIAL_FOUND)
SET(TOOL_FOUND ON)
ENDIF(MERCURIAL_FOUND)
ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/../.hg/")
# if already generated
IF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h)
# copy it
MESSAGE(STATUS "Copying provided revision.h...")
FILE(COPY ${CMAKE_SOURCE_DIR}/revision.h DESTINATION ${CMAKE_BINARY_DIR})
SET(HAVE_REVISION_H ON)
ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h)
IF(TOOL_FOUND)
# a custom target that is always built
ADD_CUSTOM_TARGET(revision ALL
DEPENDS ${CMAKE_BINARY_DIR}/revision.h)
ADD_CUSTOM_TARGET(revision ALL)
# creates revision.h using cmake script
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_BINARY_DIR}/revision.h
ADD_CUSTOM_COMMAND(TARGET revision
PRE_BUILD
COMMAND ${CMAKE_COMMAND}
-DSOURCE_DIR=${CMAKE_SOURCE_DIR}
-DROOT_DIR=${CMAKE_SOURCE_DIR}/..
@ -45,6 +64,13 @@ MACRO(NL_GEN_REVISION_H)
SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/revision.h
PROPERTIES GENERATED TRUE
HEADER_FILE_ONLY TRUE)
SET(HAVE_REVISION_H ON)
ENDIF(TOOL_FOUND)
IF(HAVE_REVISION_H)
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})
ADD_DEFINITIONS(-DHAVE_REVISION_H)
ENDIF(HAVE_REVISION_H)
ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h.in)
ENDMACRO(NL_GEN_REVISION_H)
@ -243,16 +269,7 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS)
###
# Optional support
###
# Check if CMake is launched from a Debian packaging script
SET(DEB_HOST_GNU_CPU $ENV{DEB_HOST_GNU_CPU})
# Don't strip if generating a .deb
IF(DEB_HOST_GNU_CPU)
OPTION(WITH_SYMBOLS "Keep debug symbols in binaries" ON )
ELSE(DEB_HOST_GNU_CPU)
OPTION(WITH_SYMBOLS "Keep debug symbols in binaries" OFF)
ENDIF(DEB_HOST_GNU_CPU)
IF(WIN32)
OPTION(WITH_STLPORT "With STLport support." ON )
@ -333,6 +350,11 @@ MACRO(NL_SETUP_SNOWBALLS_DEFAULT_OPTIONS)
OPTION(WITH_SNOWBALLS_SERVER "Build Snowballs Services" ON )
ENDMACRO(NL_SETUP_SNOWBALLS_DEFAULT_OPTIONS)
MACRO(ADD_PLATFORM_FLAGS _FLAGS)
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} ${_FLAGS}")
SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} ${_FLAGS}")
ENDMACRO(ADD_PLATFORM_FLAGS)
MACRO(NL_SETUP_BUILD)
#-----------------------------------------------------------------------------
@ -365,9 +387,6 @@ MACRO(NL_SETUP_BUILD)
ENDIF(HOST_CPU MATCHES "amd64")
# Determine target CPU
IF(NOT TARGET_CPU)
SET(TARGET_CPU $ENV{DEB_HOST_GNU_CPU})
ENDIF(NOT TARGET_CPU)
# If not specified, use the same CPU as host
IF(NOT TARGET_CPU)
@ -380,9 +399,6 @@ MACRO(NL_SETUP_BUILD)
SET(TARGET_CPU "x86")
ENDIF(TARGET_CPU MATCHES "amd64")
# DEB_HOST_ARCH_ENDIAN is 'little' or 'big'
# DEB_HOST_ARCH_BITS is '32' or '64'
IF(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
SET(CLANG ON)
MESSAGE(STATUS "Using Clang compiler")
@ -419,71 +435,121 @@ MACRO(NL_SETUP_BUILD)
MESSAGE(STATUS "Compiling on ${HOST_CPU} for ${TARGET_CPU}")
ENDIF("${HOST_CPU}" STREQUAL "${TARGET_CPU}")
# Use values from environment variables
SET(PLATFORM_CFLAGS "$ENV{CFLAGS} $ENV{CPPFLAGS} ${PLATFORM_CFLAGS}")
SET(PLATFORM_CXXFLAGS "$ENV{CXXFLAGS} $ENV{CPPFLAGS} ${PLATFORM_CXXFLAGS}")
SET(PLATFORM_LINKFLAGS "$ENV{LDFLAGS} ${PLATFORM_LINKFLAGS}")
# Remove -g and -O flag because we are managing them ourself
STRING(REPLACE "-g" "" PLATFORM_CFLAGS ${PLATFORM_CFLAGS})
STRING(REPLACE "-g" "" PLATFORM_CXXFLAGS ${PLATFORM_CXXFLAGS})
STRING(REGEX REPLACE "-O[0-9s]" "" PLATFORM_CFLAGS ${PLATFORM_CFLAGS})
STRING(REGEX REPLACE "-O[0-9s]" "" PLATFORM_CXXFLAGS ${PLATFORM_CXXFLAGS})
# Strip spaces
STRING(STRIP ${PLATFORM_CFLAGS} PLATFORM_CFLAGS)
STRING(STRIP ${PLATFORM_CXXFLAGS} PLATFORM_CXXFLAGS)
STRING(STRIP ${PLATFORM_LINKFLAGS} PLATFORM_LINKFLAGS)
IF(NOT CMAKE_OSX_ARCHITECTURES)
IF(TARGET_CPU STREQUAL "x86_64")
SET(TARGET_X64 1)
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DHAVE_X86_64")
ELSEIF(TARGET_CPU STREQUAL "x86")
SET(TARGET_X86 1)
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DHAVE_X86")
ELSEIF(TARGET_CPU STREQUAL "armv7s")
SET(TARGET_ARM 1)
SET(TARGET_ARMV7S 1)
ELSEIF(TARGET_CPU STREQUAL "armv7")
SET(TARGET_ARM 1)
SET(TARGET_ARMV7 1)
ELSEIF(TARGET_CPU STREQUAL "armv6")
SET(TARGET_ARM 1)
SET(TARGET_ARMV6 1)
ELSEIF(TARGET_CPU STREQUAL "armv5")
SET(TARGET_ARM 1)
SET(TARGET_ARMV5 1)
ELSEIF(TARGET_CPU STREQUAL "arm")
SET(TARGET_ARM 1)
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DHAVE_ARM")
ENDIF(TARGET_CPU STREQUAL "x86_64")
ENDIF(NOT CMAKE_OSX_ARCHITECTURES)
# Fix library paths suffixes for Debian MultiArch
SET(DEBIAN_MULTIARCH $ENV{DEB_HOST_MULTIARCH})
IF(DEBIAN_MULTIARCH)
SET(CMAKE_LIBRARY_ARCHITECTURE ${DEBIAN_MULTIARCH})
ENDIF(DEBIAN_MULTIARCH)
IF(CMAKE_LIBRARY_ARCHITECTURE)
SET(CMAKE_LIBRARY_PATH /lib/${CMAKE_LIBRARY_ARCHITECTURE} /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} ${CMAKE_LIBRARY_PATH})
IF(LIBRARY_ARCHITECTURE)
SET(CMAKE_LIBRARY_PATH /lib/${LIBRARY_ARCHITECTURE} /usr/lib/${LIBRARY_ARCHITECTURE} ${CMAKE_LIBRARY_PATH})
IF(TARGET_X64)
SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /lib64 /usr/lib64)
ENDIF(TARGET_X64)
IF(TARGET_X86)
SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /lib32 /usr/lib32)
ENDIF(TARGET_X86)
ENDIF(CMAKE_LIBRARY_ARCHITECTURE)
ENDIF(LIBRARY_ARCHITECTURE)
IF(APPLE AND NOT IOS)
SET(CMAKE_INCLUDE_PATH /opt/local/include ${CMAKE_INCLUDE_PATH})
SET(CMAKE_LIBRARY_PATH /opt/local/lib ${CMAKE_LIBRARY_PATH})
ENDIF(APPLE AND NOT IOS)
IF(TARGET_ARM)
IF(TARGET_ARMV7)
ADD_PLATFORM_FLAGS("-DHAVE_ARMV7")
ENDIF(TARGET_ARMV7)
IF(TARGET_ARMV6)
ADD_PLATFORM_FLAGS("-HAVE_ARMV6")
ENDIF(TARGET_ARMV6)
ADD_PLATFORM_FLAGS("-DHAVE_ARM")
ENDIF(TARGET_ARM)
IF(TARGET_X86)
ADD_PLATFORM_FLAGS("-DHAVE_X86")
ENDIF(TARGET_X86)
IF(TARGET_X64)
ADD_PLATFORM_FLAGS("-DHAVE_X64 -DHAVE_X86_64")
ENDIF(TARGET_X64)
IF(WITH_LOGGING)
ADD_PLATFORM_FLAGS("-DENABLE_LOGS")
ENDIF(WITH_LOGGING)
IF(MSVC)
IF(MSVC10)
ADD_PLATFORM_FLAGS("/Gy- /MP")
# /Ox is working with VC++ 2010, but custom optimizations don't exist
SET(SPEED_OPTIMIZATIONS "/Ox /GF /GS-")
SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}")
# without inlining it's unusable, use custom optimizations again
SET(MIN_OPTIMIZATIONS "/Od /Ob1")
SET(DEBUG_CFLAGS "/Od /Ob1 /GF- ${DEBUG_CFLAGS}")
ELSEIF(MSVC90)
ADD_PLATFORM_FLAGS("/Gy- /MP")
# don't use a /O[012x] flag if you want custom optimizations
SET(SPEED_OPTIMIZATIONS "/Ob2 /Oi /Ot /Oy /GT /GF /GS-")
SET(RELEASE_CFLAGS "/Ob2 /Oi /Ot /Oy /GT /GF /GS- ${RELEASE_CFLAGS}")
# without inlining it's unusable, use custom optimizations again
SET(MIN_OPTIMIZATIONS "/Ob1")
SET(DEBUG_CFLAGS "/Ob1 /GF- ${DEBUG_CFLAGS}")
ELSEIF(MSVC80)
ADD_PLATFORM_FLAGS("/Gy- /Wp64")
# don't use a /O[012x] flag if you want custom optimizations
SET(SPEED_OPTIMIZATIONS "/Ox /GF /GS-")
SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}")
# without inlining it's unusable, use custom optimizations again
SET(MIN_OPTIMIZATIONS "/Od /Ob1")
SET(DEBUG_CFLAGS "/Od /Ob1 ${DEBUG_CFLAGS}")
ELSE(MSVC10)
MESSAGE(FATAL_ERROR "Can't determine compiler version ${MSVC_VERSION}")
ENDIF(MSVC10)
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /DWIN32 /D_WINDOWS /W3 /Zm1000 /MP /Gy-")
# Common link flags
SET(PLATFORM_LINKFLAGS "")
ADD_PLATFORM_FLAGS("/D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /DWIN32 /D_WINDOWS /Zm1000 /wd4250")
IF(TARGET_X64)
# Fix a bug with Intellisense
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} /D_WIN64")
ADD_PLATFORM_FLAGS("/D_WIN64")
# Fix a compilation error for some big C++ files
SET(MIN_OPTIMIZATIONS "${MIN_OPTIMIZATIONS} /bigobj")
SET(RELEASE_CFLAGS "${RELEASE_CFLAGS} /bigobj")
ELSE(TARGET_X64)
# Allows 32 bits applications to use 3 GB of RAM
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /LARGEADDRESSAWARE")
ENDIF(TARGET_X64)
# Exceptions are only set for C++
SET(PLATFORM_CXXFLAGS "${PLATFORM_CFLAGS} /EHa")
SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} /EHa")
IF(WITH_SYMBOLS)
SET(NL_RELEASE_CFLAGS "/Zi ${NL_RELEASE_CFLAGS}")
@ -492,54 +558,146 @@ MACRO(NL_SETUP_BUILD)
SET(NL_RELEASE_LINKFLAGS "/RELEASE ${NL_RELEASE_LINKFLAGS}")
ENDIF(WITH_SYMBOLS)
SET(NL_DEBUG_CFLAGS "/Zi /MDd /RTC1 /D_DEBUG ${MIN_OPTIMIZATIONS} ${NL_DEBUG_CFLAGS}")
SET(NL_RELEASE_CFLAGS "/MD /DNDEBUG ${SPEED_OPTIMIZATIONS} ${NL_RELEASE_CFLAGS}")
SET(NL_DEBUG_CFLAGS "/Zi /MDd /RTC1 /D_DEBUG ${DEBUG_CFLAGS} ${NL_DEBUG_CFLAGS}")
SET(NL_RELEASE_CFLAGS "/MD /DNDEBUG ${RELEASE_CFLAGS} ${NL_RELEASE_CFLAGS}")
SET(NL_DEBUG_LINKFLAGS "/DEBUG /OPT:NOREF /OPT:NOICF /NODEFAULTLIB:msvcrt /INCREMENTAL:YES ${NL_DEBUG_LINKFLAGS}")
SET(NL_RELEASE_LINKFLAGS "/OPT:REF /OPT:ICF /INCREMENTAL:NO ${NL_RELEASE_LINKFLAGS}")
IF(WITH_WARNINGS)
SET(DEBUG_CFLAGS "/W4 ${DEBUG_CFLAGS}")
ELSE(WITH_WARNINGS)
SET(DEBUG_CFLAGS "/W3 ${DEBUG_CFLAGS}")
ENDIF(WITH_WARNINGS)
ELSE(MSVC)
IF(WIN32)
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DWIN32 -D_WIN32")
ADD_PLATFORM_FLAGS("-DWIN32 -D_WIN32")
IF(CLANG)
ADD_PLATFORM_FLAGS("-nobuiltininc")
ENDIF(CLANG)
ENDIF(WIN32)
IF(APPLE)
IF(TARGET_CPU STREQUAL "x86")
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -arch i386")
ENDIF(TARGET_CPU STREQUAL "x86")
IF(TARGET_CPU STREQUAL "x86_64")
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -arch x86_64")
ENDIF(TARGET_CPU STREQUAL "x86_64")
ELSE(APPLE)
IF(HOST_CPU STREQUAL "x86_64" AND TARGET_CPU STREQUAL "x86")
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -m32 -march=i686")
ENDIF(HOST_CPU STREQUAL "x86_64" AND TARGET_CPU STREQUAL "x86")
IF(HOST_CPU STREQUAL "x86" AND TARGET_CPU STREQUAL "x86_64")
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -m64")
ENDIF(HOST_CPU STREQUAL "x86" AND TARGET_CPU STREQUAL "x86_64")
ENDIF(APPLE)
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -D_REENTRANT -pipe -ftemplate-depth-48 -Wall -W -Wpointer-arith -Wsign-compare -Wno-deprecated-declarations -Wno-multichar -Wno-unused -fno-strict-aliasing")
IF(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -ansi")
ENDIF(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
IF(WITH_COVERAGE)
SET(PLATFORM_CFLAGS "-fprofile-arcs -ftest-coverage ${PLATFORM_CFLAGS}")
ENDIF(WITH_COVERAGE)
IF(TARGET_ARM)
ADD_PLATFORM_FLAGS("-mthumb")
ENDIF(TARGET_ARM)
IF(APPLE)
SET(PLATFORM_CFLAGS "-gdwarf-2 ${PLATFORM_CFLAGS}")
ENDIF(APPLE)
IF(APPLE AND XCODE)
SET(CMAKE_OSX_SYSROOT "macosx" CACHE PATH "" FORCE)
ELSEIF(APPLE AND NOT XCODE)
IF(IOS)
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.7" CACHE PATH "" FORCE)
ELSE(IOS)
IF(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.6")
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.6" CACHE PATH "" FORCE)
ENDIF(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
ENDIF(IOS)
IF(XCODE)
IF(IOS)
SET(CMAKE_OSX_SYSROOT "iphoneos" CACHE PATH "" FORCE)
ELSE(IOS)
# SET(CMAKE_OSX_SYSROOT "macosx" CACHE PATH "" FORCE)
ENDIF(IOS)
ELSE(XCODE)
IF(CMAKE_OSX_ARCHITECTURES)
SET(TARGETS_COUNT 0)
SET(_ARCHS)
FOREACH(_ARCH ${CMAKE_OSX_ARCHITECTURES})
IF(_ARCH STREQUAL "i386")
SET(_ARCHS "${_ARCHS} i386")
SET(TARGET_X86 1)
MATH(EXPR TARGETS_COUNT "${TARGETS_COUNT}+1")
ELSEIF(_ARCH STREQUAL "x86_64")
SET(_ARCHS "${_ARCHS} x86_64")
SET(TARGET_X64 1)
MATH(EXPR TARGETS_COUNT "${TARGETS_COUNT}+1")
ELSEIF(_ARCH STREQUAL "armv7")
SET(_ARCHS "${_ARCHS} armv7")
SET(TARGET_ARMV7 1)
SET(TARGET_ARM 1)
MATH(EXPR TARGETS_COUNT "${TARGETS_COUNT}+1")
ELSEIF(_ARCH STREQUAL "armv6")
SET(_ARCHS "${_ARCHS} armv6")
SET(TARGET_ARMV6 1)
SET(TARGET_ARM 1)
MATH(EXPR TARGETS_COUNT "${TARGETS_COUNT}+1")
ELSE(_ARCH STREQUAL "i386")
SET(_ARCHS "${_ARCHS} unknwon(${_ARCH})")
ENDIF(_ARCH STREQUAL "i386")
ENDFOREACH(_ARCH)
MESSAGE(STATUS "Compiling under Mac OS X for ${TARGETS_COUNT} architectures: ${_ARCHS}")
ELSE(CMAKE_OSX_ARCHITECTURES)
SET(TARGETS_COUNT 1)
ENDIF(CMAKE_OSX_ARCHITECTURES)
IF(TARGETS_COUNT EQUAL 1)
IF(TARGET_ARM)
IF(TARGET_ARMV7S)
ADD_PLATFORM_FLAGS("-arch armv7s")
ENDIF(TARGET_ARMV7S)
IF(TARGET_ARMV7)
ADD_PLATFORM_FLAGS("-arch armv7")
ENDIF(TARGET_ARMV7)
IF(TARGET_ARMV6)
ADD_PLATFORM_FLAGS("-arch armv6")
ENDIF(TARGET_ARMV6)
IF(TARGET_ARMV5)
ADD_PLATFORM_FLAGS("-arch armv5")
ENDIF(TARGET_ARMV5)
ENDIF(TARGET_ARM)
IF(TARGET_X86)
ADD_PLATFORM_FLAGS("-arch i386")
ENDIF(TARGET_X86)
IF(TARGET_X64)
ADD_PLATFORM_FLAGS("-arch x86_64")
ENDIF(TARGET_X64)
ELSE(TARGETS_COUNT EQUAL 1)
IF(TARGET_ARMV6)
ADD_PLATFORM_FLAGS("-Xarch_armv6 -mthumb -Xarch_armv6 -DHAVE_ARM -Xarch_armv6 -DHAVE_ARMV6")
ENDIF(TARGET_ARMV6)
IF(TARGET_ARMV7)
ADD_PLATFORM_FLAGS("-Xarch_armv7 -mthumb -Xarch_armv7 -DHAVE_ARM -Xarch_armv7 -DHAVE_ARMV7")
ENDIF(TARGET_ARMV7)
IF(TARGET_X86)
ADD_PLATFORM_FLAGS("-arch i386 -Xarch_i386 -DHAVE_X86")
ENDIF(TARGET_X86)
IF(TARGET_X64)
ADD_PLATFORM_FLAGS("-arch x86_64 -Xarch_x86_64 -DHAVE_X64 -Xarch_x86_64 -DHAVE_X86_64")
ENDIF(TARGET_X64)
ENDIF(TARGETS_COUNT EQUAL 1)
IF(IOS)
IF(IOS_VERSION)
PARSE_VERSION_STRING(${IOS_VERSION} IOS_VERSION_MAJOR IOS_VERSION_MINOR IOS_VERSION_PATCH)
CONVERT_VERSION_NUMBER(${IOS_VERSION_MAJOR} ${IOS_VERSION_MINOR} ${IOS_VERSION_PATCH} IOS_VERSION_NUMBER)
ADD_PLATFORM_FLAGS("-D__IPHONE_OS_VERSION_MIN_REQUIRED=${IOS_VERSION_NUMBER}")
ENDIF(IOS_VERSION)
IF(CMAKE_IOS_SYSROOT)
ADD_PLATFORM_FLAGS("-isysroot${CMAKE_IOS_SYSROOT}")
ADD_PLATFORM_FLAGS("-miphoneos-version-min=${IOS_VERSION}")
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-iphoneos_version_min,${IOS_VERSION}")
ENDIF(CMAKE_IOS_SYSROOT)
IF(CMAKE_IOS_SIMULATOR_SYSROOT AND TARGET_X86)
IF(TARGETS_COUNT EQUAL 1)
ADD_PLATFORM_FLAGS("-arch i386")
ELSE(TARGETS_COUNT EQUAL 1)
SET(XARCH "-Xarch_i386 ")
ENDIF(TARGETS_COUNT EQUAL 1)
# Always force -mmacosx-version-min to override environement variable
ADD_PLATFORM_FLAGS("${XARCH}-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-macosx_version_min,${CMAKE_OSX_DEPLOYMENT_TARGET}")
ENDIF(CMAKE_IOS_SIMULATOR_SYSROOT AND TARGET_X86)
ELSE(IOS)
FOREACH(_SDK ${_CMAKE_OSX_SDKS})
IF(${_SDK} MATCHES "MacOSX${CMAKE_OSX_DEPLOYMENT_TARGET}\\.sdk")
SET(CMAKE_OSX_SYSROOT ${_SDK} CACHE PATH "" FORCE)
@ -547,33 +705,57 @@ MACRO(NL_SETUP_BUILD)
ENDFOREACH(_SDK)
IF(CMAKE_OSX_SYSROOT)
SET(PLATFORM_CFLAGS "-isysroot ${CMAKE_OSX_SYSROOT} ${PLATFORM_CFLAGS}")
ADD_PLATFORM_FLAGS("-isysroot ${CMAKE_OSX_SYSROOT}")
ELSE(CMAKE_OSX_SYSROOT)
MESSAGE(FATAL_ERROR "CMAKE_OSX_SYSROOT can't be determinated")
ENDIF(CMAKE_OSX_SYSROOT)
IF(CMAKE_OSX_ARCHITECTURES)
FOREACH(_ARCH ${CMAKE_OSX_ARCHITECTURES})
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -arch ${_ARCH}")
ENDFOREACH(_ARCH)
ENDIF(CMAKE_OSX_ARCHITECTURES)
IF(CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG)
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
ENDIF(CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG)
# Always force -mmacosx-version-min to override environement variable
ADD_PLATFORM_FLAGS("-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-macosx_version_min,${CMAKE_OSX_DEPLOYMENT_TARGET}")
ENDIF(IOS)
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-headerpad_max_install_names")
IF(HAVE_FLAG_SEARCH_PATHS_FIRST)
SET(PLATFORM_LINKFLAGS "-Wl,-search_paths_first ${PLATFORM_LINKFLAGS}")
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-search_paths_first")
ENDIF(HAVE_FLAG_SEARCH_PATHS_FIRST)
ENDIF(APPLE AND XCODE)
ENDIF(XCODE)
ELSE(APPLE)
IF(HOST_CPU STREQUAL "x86_64" AND TARGET_CPU STREQUAL "x86")
ADD_PLATFORM_FLAGS("-m32 -march=i686")
ENDIF(HOST_CPU STREQUAL "x86_64" AND TARGET_CPU STREQUAL "x86")
IF(HOST_CPU STREQUAL "x86" AND TARGET_CPU STREQUAL "x86_64")
ADD_PLATFORM_FLAGS("-m64")
ENDIF(HOST_CPU STREQUAL "x86" AND TARGET_CPU STREQUAL "x86_64")
ENDIF(APPLE)
ADD_PLATFORM_FLAGS("-D_REENTRANT -pipe -fno-strict-aliasing")
IF(WITH_COVERAGE)
ADD_PLATFORM_FLAGS("-fprofile-arcs -ftest-coverage")
ENDIF(WITH_COVERAGE)
IF(WITH_WARNINGS)
ADD_PLATFORM_FLAGS("-Wall -W -Wpointer-arith -Wsign-compare -Wno-deprecated-declarations -Wno-multichar -Wno-unused")
IF(CLANG)
ADD_PLATFORM_FLAGS("-std=gnu99")
ELSE(CLANG)
ADD_PLATFORM_FLAGS("-ansi")
ENDIF(CLANG)
ENDIF(WITH_WARNINGS)
IF(APPLE)
ADD_PLATFORM_FLAGS("-gdwarf-2")
ENDIF(APPLE)
# Fix "relocation R_X86_64_32 against.." error on x64 platforms
IF(TARGET_X64 AND WITH_STATIC AND NOT WITH_STATIC_DRIVERS)
SET(PLATFORM_CFLAGS "-fPIC ${PLATFORM_CFLAGS}")
ADD_PLATFORM_FLAGS("-fPIC")
ENDIF(TARGET_X64 AND WITH_STATIC AND NOT WITH_STATIC_DRIVERS)
SET(PLATFORM_CXXFLAGS ${PLATFORM_CFLAGS})
SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} -ftemplate-depth-48")
IF(NOT APPLE)
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,--no-undefined -Wl,--as-needed")
@ -613,125 +795,146 @@ MACRO(NL_SETUP_BUILD_FLAGS)
SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${PLATFORM_LINKFLAGS} ${NL_RELEASE_LINKFLAGS}" CACHE STRING "" FORCE)
ENDMACRO(NL_SETUP_BUILD_FLAGS)
# Macro to create x_ABSOLUTE_PREFIX from x_PREFIX
MACRO(NL_MAKE_ABSOLUTE_PREFIX NAME_RELATIVE NAME_ABSOLUTE)
IF(IS_ABSOLUTE "${${NAME_RELATIVE}}")
SET(${NAME_ABSOLUTE} ${${NAME_RELATIVE}})
ELSE(IS_ABSOLUTE "${${{NAME_RELATIVE}}")
IF(WIN32)
SET(${NAME_ABSOLUTE} ${${NAME_RELATIVE}})
ELSE(WIN32)
SET(${NAME_ABSOLUTE} ${CMAKE_INSTALL_PREFIX}/${${NAME_RELATIVE}})
ENDIF(WIN32)
ENDIF(IS_ABSOLUTE "${${NAME_RELATIVE}}")
ENDMACRO(NL_MAKE_ABSOLUTE_PREFIX)
MACRO(NL_SETUP_PREFIX_PATHS)
## Allow override of install_prefix/etc path.
IF(NOT NL_ETC_PREFIX)
IF(WIN32)
SET(NL_ETC_PREFIX "../etc/nel" CACHE PATH "Installation path for configurations")
SET(NL_ETC_PREFIX "." CACHE PATH "Installation path for configurations")
ELSE(WIN32)
SET(NL_ETC_PREFIX "${CMAKE_INSTALL_PREFIX}/etc/nel" CACHE PATH "Installation path for configurations")
SET(NL_ETC_PREFIX "etc/nel" CACHE PATH "Installation path for configurations")
ENDIF(WIN32)
ENDIF(NOT NL_ETC_PREFIX)
NL_MAKE_ABSOLUTE_PREFIX(NL_ETC_PREFIX NL_ETC_ABSOLUTE_PREFIX)
## Allow override of install_prefix/share path.
IF(NOT NL_SHARE_PREFIX)
IF(WIN32)
SET(NL_SHARE_PREFIX "../share/nel" CACHE PATH "Installation path for data.")
SET(NL_SHARE_PREFIX "." CACHE PATH "Installation path for data.")
ELSE(WIN32)
SET(NL_SHARE_PREFIX "${CMAKE_INSTALL_PREFIX}/share/nel" CACHE PATH "Installation path for data.")
SET(NL_SHARE_PREFIX "share/nel" CACHE PATH "Installation path for data.")
ENDIF(WIN32)
ENDIF(NOT NL_SHARE_PREFIX)
NL_MAKE_ABSOLUTE_PREFIX(NL_SHARE_PREFIX NL_SHARE_ABSOLUTE_PREFIX)
## Allow override of install_prefix/sbin path.
IF(NOT NL_SBIN_PREFIX)
IF(WIN32)
SET(NL_SBIN_PREFIX "../sbin" CACHE PATH "Installation path for admin tools and services.")
SET(NL_SBIN_PREFIX "." CACHE PATH "Installation path for admin tools and services.")
ELSE(WIN32)
SET(NL_SBIN_PREFIX "${CMAKE_INSTALL_PREFIX}/sbin" CACHE PATH "Installation path for admin tools and services.")
SET(NL_SBIN_PREFIX "sbin" CACHE PATH "Installation path for admin tools and services.")
ENDIF(WIN32)
ENDIF(NOT NL_SBIN_PREFIX)
NL_MAKE_ABSOLUTE_PREFIX(NL_SBIN_PREFIX NL_SBIN_ABSOLUTE_PREFIX)
## Allow override of install_prefix/bin path.
IF(NOT NL_BIN_PREFIX)
IF(WIN32)
SET(NL_BIN_PREFIX "../bin" CACHE PATH "Installation path for tools and applications.")
SET(NL_BIN_PREFIX "." CACHE PATH "Installation path for tools and applications.")
ELSE(WIN32)
SET(NL_BIN_PREFIX "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation path for tools and applications.")
SET(NL_BIN_PREFIX "bin" CACHE PATH "Installation path for tools and applications.")
ENDIF(WIN32)
ENDIF(NOT NL_BIN_PREFIX)
NL_MAKE_ABSOLUTE_PREFIX(NL_BIN_PREFIX NL_BIN_ABSOLUTE_PREFIX)
## Allow override of install_prefix/lib path.
IF(NOT NL_LIB_PREFIX)
IF(WIN32)
SET(NL_LIB_PREFIX "../lib" CACHE PATH "Installation path for libraries.")
ELSE(WIN32)
IF(CMAKE_LIBRARY_ARCHITECTURE)
SET(NL_LIB_PREFIX "${CMAKE_INSTALL_PREFIX}/lib/${CMAKE_LIBRARY_ARCHITECTURE}" CACHE PATH "Installation path for libraries.")
ELSE(CMAKE_LIBRARY_ARCHITECTURE)
SET(NL_LIB_PREFIX "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation path for libraries.")
ENDIF(CMAKE_LIBRARY_ARCHITECTURE)
ENDIF(WIN32)
IF(LIBRARY_ARCHITECTURE)
SET(NL_LIB_PREFIX "lib/${LIBRARY_ARCHITECTURE}" CACHE PATH "Installation path for libraries.")
ELSE(LIBRARY_ARCHITECTURE)
SET(NL_LIB_PREFIX "lib" CACHE PATH "Installation path for libraries.")
ENDIF(LIBRARY_ARCHITECTURE)
ENDIF(NOT NL_LIB_PREFIX)
NL_MAKE_ABSOLUTE_PREFIX(NL_LIB_PREFIX NL_LIB_ABSOLUTE_PREFIX)
## Allow override of install_prefix/lib path.
IF(NOT NL_DRIVER_PREFIX)
IF(WIN32)
SET(NL_DRIVER_PREFIX "../lib" CACHE PATH "Installation path for drivers.")
SET(NL_DRIVER_PREFIX "." CACHE PATH "Installation path for drivers.")
ELSE(WIN32)
IF(CMAKE_LIBRARY_ARCHITECTURE)
SET(NL_DRIVER_PREFIX "${CMAKE_INSTALL_PREFIX}/lib/${CMAKE_LIBRARY_ARCHITECTURE}/nel" CACHE PATH "Installation path for drivers.")
ELSE(CMAKE_LIBRARY_ARCHITECTURE)
SET(NL_DRIVER_PREFIX "${CMAKE_INSTALL_PREFIX}/lib/nel" CACHE PATH "Installation path for drivers.")
ENDIF(CMAKE_LIBRARY_ARCHITECTURE)
IF(LIBRARY_ARCHITECTURE)
SET(NL_DRIVER_PREFIX "lib/${LIBRARY_ARCHITECTURE}/nel" CACHE PATH "Installation path for drivers.")
ELSE(LIBRARY_ARCHITECTURE)
SET(NL_DRIVER_PREFIX "lib/nel" CACHE PATH "Installation path for drivers.")
ENDIF(LIBRARY_ARCHITECTURE)
ENDIF(WIN32)
ENDIF(NOT NL_DRIVER_PREFIX)
NL_MAKE_ABSOLUTE_PREFIX(NL_DRIVER_PREFIX NL_DRIVER_ABSOLUTE_PREFIX)
ENDMACRO(NL_SETUP_PREFIX_PATHS)
MACRO(RYZOM_SETUP_PREFIX_PATHS)
## Allow override of install_prefix path.
IF(NOT RYZOM_PREFIX)
IF(WIN32)
SET(RYZOM_PREFIX "." CACHE PATH "Installation path")
ELSE(WIN32)
SET(RYZOM_PREFIX "${CMAKE_INSTALL_PREFIX}" CACHE PATH "Installation path")
ENDIF(WIN32)
ENDIF(NOT RYZOM_PREFIX)
## Allow override of install_prefix/etc path.
IF(NOT RYZOM_ETC_PREFIX)
IF(WIN32)
SET(RYZOM_ETC_PREFIX "." CACHE PATH "Installation path for configurations")
ELSE(WIN32)
SET(RYZOM_ETC_PREFIX "${RYZOM_PREFIX}/etc/ryzom" CACHE PATH "Installation path for configurations")
SET(RYZOM_ETC_PREFIX "etc/ryzom" CACHE PATH "Installation path for configurations")
ENDIF(WIN32)
ENDIF(NOT RYZOM_ETC_PREFIX)
NL_MAKE_ABSOLUTE_PREFIX(RYZOM_ETC_PREFIX RYZOM_ETC_ABSOLUTE_PREFIX)
## Allow override of install_prefix/share path.
IF(NOT RYZOM_SHARE_PREFIX)
IF(WIN32)
SET(RYZOM_SHARE_PREFIX "." CACHE PATH "Installation path for data.")
ELSE(WIN32)
SET(RYZOM_SHARE_PREFIX "${RYZOM_PREFIX}/share/ryzom" CACHE PATH "Installation path for data.")
SET(RYZOM_SHARE_PREFIX "share/ryzom" CACHE PATH "Installation path for data.")
ENDIF(WIN32)
ENDIF(NOT RYZOM_SHARE_PREFIX)
NL_MAKE_ABSOLUTE_PREFIX(RYZOM_SHARE_PREFIX RYZOM_SHARE_ABSOLUTE_PREFIX)
## Allow override of install_prefix/sbin path.
IF(NOT RYZOM_SBIN_PREFIX)
IF(WIN32)
SET(RYZOM_SBIN_PREFIX "." CACHE PATH "Installation path for admin tools and services.")
ELSE(WIN32)
SET(RYZOM_SBIN_PREFIX "${RYZOM_PREFIX}/sbin" CACHE PATH "Installation path for admin tools and services.")
SET(RYZOM_SBIN_PREFIX "sbin" CACHE PATH "Installation path for admin tools and services.")
ENDIF(WIN32)
ENDIF(NOT RYZOM_SBIN_PREFIX)
NL_MAKE_ABSOLUTE_PREFIX(RYZOM_SBIN_PREFIX RYZOM_SBIN_ABSOLUTE_PREFIX)
## Allow override of install_prefix/bin path.
IF(NOT RYZOM_BIN_PREFIX)
IF(WIN32)
SET(RYZOM_BIN_PREFIX "." CACHE PATH "Installation path for tools and applications.")
ELSE(WIN32)
SET(RYZOM_BIN_PREFIX "${RYZOM_PREFIX}/bin" CACHE PATH "Installation path for tools.")
SET(RYZOM_BIN_PREFIX "bin" CACHE PATH "Installation path for tools.")
ENDIF(WIN32)
ENDIF(NOT RYZOM_BIN_PREFIX)
NL_MAKE_ABSOLUTE_PREFIX(RYZOM_BIN_PREFIX RYZOM_BIN_ABSOLUTE_PREFIX)
## Allow override of install_prefix/lib path.
IF(NOT RYZOM_LIB_PREFIX)
IF(LIBRARY_ARCHITECTURE)
SET(RYZOM_LIB_PREFIX "lib/${LIBRARY_ARCHITECTURE}" CACHE PATH "Installation path for libraries.")
ELSE(LIBRARY_ARCHITECTURE)
SET(RYZOM_LIB_PREFIX "lib" CACHE PATH "Installation path for libraries.")
ENDIF(LIBRARY_ARCHITECTURE)
ENDIF(NOT RYZOM_LIB_PREFIX)
NL_MAKE_ABSOLUTE_PREFIX(RYZOM_LIB_PREFIX RYZOM_LIB_ABSOLUTE_PREFIX)
## Allow override of install_prefix/games path.
IF(NOT RYZOM_GAMES_PREFIX)
IF(WIN32)
SET(RYZOM_GAMES_PREFIX "." CACHE PATH "Installation path for tools and applications.")
ELSE(WIN32)
SET(RYZOM_GAMES_PREFIX "${RYZOM_PREFIX}/games" CACHE PATH "Installation path for client.")
SET(RYZOM_GAMES_PREFIX "games" CACHE PATH "Installation path for client.")
ENDIF(WIN32)
ENDIF(NOT RYZOM_GAMES_PREFIX)
NL_MAKE_ABSOLUTE_PREFIX(RYZOM_GAMES_PREFIX RYZOM_GAMES_ABSOLUTE_PREFIX)
ENDMACRO(RYZOM_SETUP_PREFIX_PATHS)
@ -743,6 +946,10 @@ MACRO(SETUP_EXTERNAL)
IF(WIN32)
FIND_PACKAGE(External REQUIRED)
IF(NOT VC_DIR)
SET(VC_DIR $ENV{VC_DIR})
ENDIF(NOT VC_DIR)
IF(MSVC10)
IF(NOT MSVC10_REDIST_DIR)
# If you have VC++ 2010 Express, put x64/Microsoft.VC100.CRT/*.dll in ${EXTERNAL_PATH}/redist
@ -756,7 +963,10 @@ MACRO(SETUP_EXTERNAL)
IF(VC_ROOT_DIR MATCHES "registry")
GET_FILENAME_COMPONENT(VC_ROOT_DIR "[HKEY_CURRENT_USER\\Software\\Microsoft\\VCExpress\\10.0_Config;InstallDir]" ABSOLUTE)
IF(VC_ROOT_DIR MATCHES "registry")
FILE(TO_CMAKE_PATH $ENV{VS100COMNTOOLS} VC_ROOT_DIR)
SET(VS100COMNTOOLS $ENV{VS100COMNTOOLS})
IF(VS100COMNTOOLS)
FILE(TO_CMAKE_PATH ${VS100COMNTOOLS} VC_ROOT_DIR)
ENDIF(VS100COMNTOOLS)
IF(NOT VC_ROOT_DIR)
MESSAGE(FATAL_ERROR "Unable to find VC++ 2010 directory!")
ENDIF(NOT VC_ROOT_DIR)

View file

@ -43,15 +43,14 @@
#cmakedefine NL_DSOUND_AVAILABLE ${NL_DSOUND_AVAILABLE}
#cmakedefine NL_XAUDIO2_AVAILABLE ${NL_XAUDIO2_AVAILABLE}
#cmakedefine NL_BIN_PREFIX "${NL_BIN_PREFIX}"
#cmakedefine NL_ETC_PREFIX "${NL_ETC_PREFIX}"
#cmakedefine NL_SHARE_PREFIX "${NL_SHARE_PREFIX}"
#cmakedefine NL_LIB_PREFIX "${NL_LIB_PREFIX}"
#cmakedefine NL_DRIVER_PREFIX "${NL_DRIVER_PREFIX}"
#cmakedefine NL_BIN_PREFIX "${NL_BIN_ABSOLUTE_PREFIX}"
#cmakedefine NL_ETC_PREFIX "${NL_ETC_ABSOLUTE_PREFIX}"
#cmakedefine NL_SHARE_PREFIX "${NL_SHARE_ABSOLUTE_PREFIX}"
#cmakedefine NL_LIB_PREFIX "${NL_LIB_ABSOLUTE_PREFIX}"
#cmakedefine NL_DRIVER_PREFIX "${NL_DRIVER_ABSOLUTE_PREFIX}"
#cmakedefine RYZOM_PREFIX "${RYZOM_PREFIX}"
#cmakedefine RYZOM_BIN_PREFIX "${RYZOM_BIN_PREFIX}"
#cmakedefine RYZOM_ETC_PREFIX "${RYZOM_ETC_PREFIX}"
#cmakedefine RYZOM_SHARE_PREFIX "${RYZOM_SHARE_PREFIX}"
#cmakedefine RYZOM_BIN_PREFIX "${RYZOM_BIN_ABSOLUTE_PREFIX}"
#cmakedefine RYZOM_ETC_PREFIX "${RYZOM_ETC_ABSOLUTE_PREFIX}"
#cmakedefine RYZOM_SHARE_PREFIX "${RYZOM_SHARE_ABSOLUTE_PREFIX}"
#endif // CONFIG_H

View file

@ -44,8 +44,8 @@ ENDIF(WITH_GTK)
IF(WITH_INSTALL_LIBRARIES)
IF(UNIX)
SET(prefix ${CMAKE_INSTALL_PREFIX})
SET(exec_prefix ${CMAKE_INSTALL_PREFIX}/bin)
SET(libdir ${CMAKE_INSTALL_PREFIX}/lib)
SET(exec_prefix ${NL_BIN_ABSOLUTE_PREFIX})
SET(libdir ${NL_LIB_ABSOLUTE_PREFIX})
SET(includedir ${CMAKE_INSTALL_PREFIX}/include)
SET(enable_ligo ${WITH_LIGO})
SET(enable_logic ${WITH_LOGIC})
@ -56,7 +56,7 @@ IF(WITH_INSTALL_LIBRARIES)
SET(enable_sound ${WITH_SOUND})
CONFIGURE_FILE(nel-config.in ${CMAKE_CURRENT_BINARY_DIR}/nel-config)
INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/nel-config DESTINATION bin)
INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/nel-config DESTINATION ${NL_BIN_PREFIX})
ENDIF(UNIX)
ADD_SUBDIRECTORY(include)

View file

@ -293,6 +293,11 @@ public:
*/
virtual void forceDXTCCompression(bool dxtcComp)=0;
/** if different from 0, enable anisotropic filter on textures. -1 enables max value.
* Default is 0.
*/
virtual void setAnisotropicFilter(sint filter)=0;
/** if !=1, force mostly all the textures (but TextureFonts lightmaps, interfaces etc..)
* to be divided by Divisor (2, 4, 8...)
* Default is 1.

View file

@ -471,6 +471,7 @@ public:
virtual void delete3dMouseListener (U3dMouseListener *listener);
virtual TPolygonMode getPolygonMode ();
virtual void forceDXTCCompression(bool dxtcComp);
virtual void setAnisotropicFilter(sint filter);
virtual void forceTextureResize(uint divisor);
virtual void forceNativeFragmentPrograms(bool nativeOnly);
virtual bool setMonitorColorProperties (const CMonitorColorProperties &properties);

View file

@ -660,6 +660,11 @@ public:
*/
virtual void forceDXTCCompression(bool dxtcComp)=0;
/** if different from 0, enable anisotropic filter on textures. -1 enables max value.
* Default is 0.
*/
virtual void setAnisotropicFilter(sint filter)=0;
/** if !=1, force mostly all the textures (but TextureFonts lightmaps, interfaces etc..)
* to be divided by Divisor (2, 4, 8...)
* Default is 1.

View file

@ -40,7 +40,7 @@ namespace NLGUI
public:
CInterfaceTrack();
~CInterfaceTrack();
virtual ~CInterfaceTrack();
virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup);
@ -93,7 +93,7 @@ namespace NLGUI
public:
CInterfaceAnim();
~CInterfaceAnim();
virtual ~CInterfaceAnim();
virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup);

View file

@ -142,11 +142,7 @@ namespace NLGUI
// Optional ucstring modifier
IOnReceiveTextId *_StringModifier;
#if defined(NL_DEBUG)
std::string _DBPath;
#endif
static IViewTextProvider* getTextProvider(){ return textProvider; }
private:

View file

@ -297,8 +297,8 @@ public:
void swap(CBitmap &other);
/**
* Read a bitmap(TGA or DDS) from an IStream.
* Bitmap supported are DDS (DXTC1, DXTC1 with Alpha, DXTC3, DXTC5, and
* Read a bitmap(TGA, JPEG, PNG or DDS) from an IStream.
* Bitmap supported are DDS (DXTC1, DXTC1 with Alpha, DXTC3, DXTC5), PNG, JPEG and
* uncompressed TGA (24 and 32 bits).
* \param IStream The stream must be in reading mode.
* \param mipMapSkip if the file is a DDS with mipMap. N=mipMapSkip mipmaps are skipped.
@ -310,7 +310,7 @@ public:
/**
* Determinate the bitmap size from a bitmap(TGA or DDS) from an IStream. load just header of the file.
* Bitmap supported are DDS (DXTC1, DXTC1 with Alpha, DXTC3, DXTC5, and
* Bitmap supported are DDS (DXTC1, DXTC1 with Alpha, DXTC3, DXTC5), PNG, JPEG and
* uncompressed TGA (24 and 32 bits).
* NB: at the end, f is seeked to begin.
* \param IStream The stream must be in reading mode.

View file

@ -241,7 +241,7 @@ private:
LogicalXor, // ^^
OperatorCount, //
NotOperator, // This is not an operator
ExtOperator, // This is a 2 charcters operator
ExtOperator, // This is a 2 characters operator
};
// Functions

View file

@ -48,6 +48,19 @@ typedef sint64 TTicks;
class CTime
{
public:
struct CTimerInfo
{
/// Returns if there is a high precision timer that can be used.
bool IsHighPrecisionAvailable;
/// If a CPU specific timer is used and the values are not consistent accross threads.
bool RequiresSingleCore;
/// The resolution of the high resolution timer.
TTicks HighPrecisionResolution;
};
/** Get advanced information on the used timers.
*/
static void probeTimerInfo(CTimerInfo &result);
/** Return the number of second since midnight (00:00:00), January 1, 1970,
* coordinated universal time, according to the system clock.
@ -71,9 +84,9 @@ public:
* the value can jump backwards if the system time is changed by a user or a NTP time sync process.
* The value is different on 2 different computers; use the CUniTime class to get a universal
* time that is the same on all computers.
* \warning On Win32, the value is on 32 bits only. It wraps around to 0 every about 49.71 days.
* \warning On Win32, the value is on 32 bits only, and uses the low-res timer unless probeTimerInfo was called and a high resolution timer can be used. It wraps around to 0 every about 49.71 days.
*/
static TTime getLocalTime ();
static TTime getLocalTime();
/** Return the time in processor ticks. Use it for profile purpose.
* If the performance time is not supported on this hardware, it returns 0.

View file

@ -79,7 +79,7 @@ struct TMessageRecord
stream.serial( s_event );
uint32 sockId;
stream.serialHex( sockId );
SockId = (NLNET::TSockId)sockId;
SockId = (NLNET::TSockId)(size_t)sockId;
len = Message.length();
stream.serial( len );
stream.serialBuffer( const_cast<uint8*>(Message.buffer()), len ); // assumes the message contains plain text

View file

@ -142,7 +142,7 @@ public:
for (i=0; i<num; ++i)
{
std::string fname = NLMISC::CPath::lookup(_NamePrefix + "_" + NLMISC::toString(i) + ".lr", false, true);
if (fname == "")
if (fname.empty())
continue;
NLMISC::CIFile f(fname);

View file

@ -2,7 +2,7 @@ FILE(GLOB SRC *.cpp *.h)
ADD_EXECUTABLE(nl_sample_cegui WIN32 ${SRC})
ADD_DEFINITIONS(-DCEGUI_DATA_DIR="\\"${NL_SHARE_PREFIX}/nl_sample_cegui/datafiles/\\"")
ADD_DEFINITIONS(-DCEGUI_DATA_DIR="\\"${NL_SHARE_ABSOLUTE_PREFIX}/nl_sample_cegui/datafiles/\\"")
INCLUDE_DIRECTORIES(${CEGUI_INCLUDE_DIRS})
@ -10,9 +10,9 @@ TARGET_LINK_LIBRARIES(nl_sample_cegui ${CEGUI_LIBRARY} nelmisc nel3d)
NL_DEFAULT_PROPS(nl_sample_cegui "NeL, Samples, 3D: NeL CEGUI Demo")
NL_ADD_RUNTIME_FLAGS(nl_sample_cegui)
INSTALL(TARGETS nl_sample_cegui RUNTIME DESTINATION bin COMPONENT samples3d)
INSTALL(TARGETS nl_sample_cegui RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT samples3d)
INSTALL(DIRECTORY datafiles/
DESTINATION share/nel/nl_sample_cegui/datafiles
DESTINATION ${NL_SHARE_PREFIX}/nl_sample_cegui/datafiles
COMPONENT samples3d
PATTERN "CVS" EXCLUDE
PATTERN ".svn" EXCLUDE

View file

@ -2,34 +2,34 @@ FILE(GLOB SRC *.cpp)
ADD_EXECUTABLE(nl_sample_clusterview WIN32 ${SRC})
ADD_DEFINITIONS(-DCV_DIR="\\"${NL_SHARE_PREFIX}/nl_sample_clusterview/\\"")
ADD_DEFINITIONS(-DCV_DIR="\\"${NL_SHARE_ABSOLUTE_PREFIX}/nl_sample_clusterview/\\"")
TARGET_LINK_LIBRARIES(nl_sample_clusterview nelmisc nel3d)
NL_ADD_RUNTIME_FLAGS(nl_sample_clusterview)
NL_DEFAULT_PROPS(nl_sample_clusterview "NeL, Samples, 3D: Cluster Viewer")
INSTALL(TARGETS nl_sample_clusterview RUNTIME DESTINATION bin COMPONENT samples3d)
INSTALL(FILES main.cvs readme.txt DESTINATION share/nel/nl_sample_clusterview COMPONENT samples3d)
INSTALL(TARGETS nl_sample_clusterview RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT samples3d)
INSTALL(FILES main.cvs readme.txt DESTINATION ${NL_SHARE_PREFIX}/nl_sample_clusterview COMPONENT samples3d)
INSTALL(DIRECTORY groups/
DESTINATION share/nel/nl_sample_clusterview/groups
DESTINATION ${NL_SHARE_PREFIX}/nl_sample_clusterview/groups
COMPONENT samples3d
PATTERN "CVS" EXCLUDE
PATTERN ".svn" EXCLUDE
PATTERN "Makefile*" EXCLUDE)
INSTALL(DIRECTORY fonts/
DESTINATION share/nel/nl_sample_clusterview/fonts
DESTINATION ${NL_SHARE_PREFIX}/nl_sample_clusterview/fonts
COMPONENT samples3d
PATTERN "CVS" EXCLUDE
PATTERN ".svn" EXCLUDE
PATTERN "Makefile*" EXCLUDE)
INSTALL(DIRECTORY max/
DESTINATION share/nel/nl_sample_clusterview/max
DESTINATION ${NL_SHARE_PREFIX}/nl_sample_clusterview/max
COMPONENT samples3d
PATTERN "CVS" EXCLUDE
PATTERN ".svn" EXCLUDE
PATTERN "Makefile*" EXCLUDE)
INSTALL(DIRECTORY shapes/
DESTINATION share/nel/nl_sample_clusterview/shapes
DESTINATION ${NL_SHARE_PREFIX}/nl_sample_clusterview/shapes
COMPONENT samples3d
PATTERN "CVS" EXCLUDE
PATTERN ".svn" EXCLUDE

View file

@ -2,11 +2,11 @@ FILE(GLOB SRC *.cpp)
ADD_EXECUTABLE(nl_sample_font WIN32 ${SRC})
ADD_DEFINITIONS(-DFONT_DIR="\\"${NL_SHARE_PREFIX}/nl_sample_font/\\"")
ADD_DEFINITIONS(-DFONT_DIR="\\"${NL_SHARE_ABSOLUTE_PREFIX}/nl_sample_font/\\"")
TARGET_LINK_LIBRARIES(nl_sample_font nelmisc nel3d)
NL_DEFAULT_PROPS(nl_sample_font "NeL, Samples, 3D: Font")
NL_ADD_RUNTIME_FLAGS(nl_sample_font)
INSTALL(TARGETS nl_sample_font RUNTIME DESTINATION bin COMPONENT samples3d)
INSTALL(FILES beteckna.ttf DESTINATION share/nel/nl_sample_font COMPONENT samples3d)
INSTALL(TARGETS nl_sample_font RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT samples3d)
INSTALL(FILES beteckna.ttf DESTINATION ${NL_SHARE_PREFIX}/nl_sample_font COMPONENT samples3d)

View file

@ -27,5 +27,5 @@ NL_ADD_RUNTIME_FLAGS(qtnel)
ADD_DEFINITIONS(${QT_DEFINITIONS})
INSTALL(TARGETS qtnel RUNTIME DESTINATION bin COMPONENT samples3d)
INSTALL(TARGETS qtnel RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT samples3d)

View file

@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(nl_sample_shapeview nelmisc nel3d)
NL_DEFAULT_PROPS(nl_sample_shapeview "NeL, Samples, 3D: Shape Viewer")
NL_ADD_RUNTIME_FLAGS(nl_sample_shapeview)
INSTALL(TARGETS nl_sample_shapeview RUNTIME DESTINATION bin COMPONENT samples3d)
INSTALL(TARGETS nl_sample_shapeview RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT samples3d)

View file

@ -2,12 +2,12 @@ FILE(GLOB SRC *.cpp)
ADD_EXECUTABLE(nl_sample_georges ${SRC})
ADD_DEFINITIONS(-DGF_DIR="\\"${NL_SHARE_PREFIX}/nl_sample_georges/\\"")
ADD_DEFINITIONS(-DGF_DIR="\\"${NL_SHARE_ABSOLUTE_PREFIX}/nl_sample_georges/\\"")
TARGET_LINK_LIBRARIES(nl_sample_georges nelgeorges nelmisc)
NL_DEFAULT_PROPS(nl_sample_georges "NeL, Samples: Georges")
NL_ADD_RUNTIME_FLAGS(nl_sample_georges)
INSTALL(TARGETS nl_sample_georges RUNTIME DESTINATION bin COMPONENT samplesgeorges)
INSTALL(TARGETS nl_sample_georges RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT samplesgeorges)
INSTALL(FILES boolean.typ coolfilesinfo.dfn default.sample_config int.typ positiondata.dfn sample_config.dfn string.typ sheet_id.bin
DESTINATION share/nel/nl_sample_georges/ COMPONENT samplesgeorges)
DESTINATION ${NL_SHARE_PREFIX}/nl_sample_georges/ COMPONENT samplesgeorges)

View file

@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(nl_sample_command nelmisc)
NL_DEFAULT_PROPS(nl_sample_command "NeL, Samples, Misc: Commands")
NL_ADD_RUNTIME_FLAGS(nl_sample_command)
INSTALL(TARGETS nl_sample_command RUNTIME DESTINATION bin COMPONENT samplesmisc)
INSTALL(TARGETS nl_sample_command RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT samplesmisc)

View file

@ -2,11 +2,11 @@ FILE(GLOB SRC *.cpp)
ADD_EXECUTABLE(nl_sample_configfile ${SRC})
ADD_DEFINITIONS(-DNL_SAMPLE_CFG="\\"${NL_SHARE_PREFIX}/nl_sample_configfile/\\"")
ADD_DEFINITIONS(-DNL_SAMPLE_CFG="\\"${NL_SHARE_ABSOLUTE_PREFIX}/nl_sample_configfile/\\"")
TARGET_LINK_LIBRARIES(nl_sample_configfile nelmisc)
NL_DEFAULT_PROPS(nl_sample_configfile "NeL, Samples, Misc: Config Files")
NL_ADD_RUNTIME_FLAGS(nl_sample_configfile)
INSTALL(TARGETS nl_sample_configfile RUNTIME DESTINATION bin COMPONENT samplesmisc)
INSTALL(FILES simpletest.txt DESTINATION share/nel/nl_sample_configfile COMPONENT samplesmisc)
INSTALL(TARGETS nl_sample_configfile RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT samplesmisc)
INSTALL(FILES simpletest.txt DESTINATION ${NL_SHARE_PREFIX}/nl_sample_configfile COMPONENT samplesmisc)

View file

@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(nl_sample_debug nelmisc)
NL_DEFAULT_PROPS(nl_sample_debug "NeL, Samples, Misc: Debugging")
NL_ADD_RUNTIME_FLAGS(nl_sample_debug)
INSTALL(TARGETS nl_sample_debug RUNTIME DESTINATION bin COMPONENT samplesmisc)
INSTALL(TARGETS nl_sample_debug RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT samplesmisc)

View file

@ -2,11 +2,11 @@ FILE(GLOB SRC *.cpp)
ADD_EXECUTABLE(nl_sample_i18n ${SRC})
ADD_DEFINITIONS(-DNL_LANG_DATA="\\"${NL_SHARE_PREFIX}/nl_sample_i18n/\\"")
ADD_DEFINITIONS(-DNL_LANG_DATA="\\"${NL_SHARE_ABSOLUTE_PREFIX}/nl_sample_i18n/\\"")
TARGET_LINK_LIBRARIES(nl_sample_i18n nelmisc)
NL_DEFAULT_PROPS(nl_sample_i18n "NeL, Samples, Misc: I18N")
NL_ADD_RUNTIME_FLAGS(nl_sample_i18n)
INSTALL(TARGETS nl_sample_i18n RUNTIME DESTINATION bin COMPONENT samplesmisc)
INSTALL(FILES de.uxt en.uxt fr.uxt DESTINATION share/nel/nl_sample_i18n COMPONENT samplesmisc)
INSTALL(TARGETS nl_sample_i18n RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT samplesmisc)
INSTALL(FILES de.uxt en.uxt fr.uxt DESTINATION ${NL_SHARE_PREFIX}/nl_sample_i18n COMPONENT samplesmisc)

View file

@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(nl_sample_log nelmisc)
NL_DEFAULT_PROPS(nl_sample_log "NeL, Samples, Misc: Logging")
NL_ADD_RUNTIME_FLAGS(nl_sample_log)
INSTALL(TARGETS nl_sample_log RUNTIME DESTINATION bin COMPONENT samplesmisc)
INSTALL(TARGETS nl_sample_log RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT samplesmisc)

View file

@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(nl_sample_strings nelmisc)
NL_DEFAULT_PROPS(nl_sample_strings "NeL, Samples, Misc: Strings")
NL_ADD_RUNTIME_FLAGS(nl_sample_strings)
INSTALL(TARGETS nl_sample_strings RUNTIME DESTINATION bin COMPONENT samplesmisc)
INSTALL(TARGETS nl_sample_strings RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT samplesmisc)

View file

@ -6,4 +6,4 @@ TARGET_LINK_LIBRARIES(nl_sample_types_check nelmisc)
NL_DEFAULT_PROPS(nl_sample_types_check "Samples, MISC: Types check sample")
NL_ADD_RUNTIME_FLAGS(nl_sample_types_check)
INSTALL(TARGETS nl_sample_types_check RUNTIME DESTINATION bin COMPONENT samplesmisc)
INSTALL(TARGETS nl_sample_types_check RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT samplesmisc)

View file

@ -2,7 +2,7 @@ ADD_EXECUTABLE(nl_sample_chatclient client.cpp kbhit.cpp kbhit.h)
ADD_EXECUTABLE(nl_sample_chatserver WIN32 server.cpp)
ADD_DEFINITIONS(-DCHAT_DIR="\\"${NL_SHARE_PREFIX}/nl_sample_chat/\\"")
ADD_DEFINITIONS(-DCHAT_DIR="\\"${NL_SHARE_ABSOLUTE_PREFIX}/nl_sample_chat/\\"")
TARGET_LINK_LIBRARIES(nl_sample_chatclient nelmisc nelnet)
NL_DEFAULT_PROPS(nl_sample_chatclient "NeL, Samples, Net, Chat: Chat Client")
@ -12,5 +12,5 @@ TARGET_LINK_LIBRARIES(nl_sample_chatserver nelmisc nelnet)
NL_DEFAULT_PROPS(nl_sample_chatserver "NeL, Samples, Net, Chat: Chat Server")
NL_ADD_RUNTIME_FLAGS(nl_sample_chatserver)
INSTALL(TARGETS nl_sample_chatclient nl_sample_chatserver RUNTIME DESTINATION bin COMPONENT samplesnet)
INSTALL(FILES chat_service.cfg client.cfg DESTINATION share/nel/nl_sample_chat COMPONENT samplesnet)
INSTALL(TARGETS nl_sample_chatclient nl_sample_chatserver RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT samplesnet)
INSTALL(FILES chat_service.cfg client.cfg DESTINATION ${NL_SHARE_PREFIX}/nl_sample_chat COMPONENT samplesnet)

View file

@ -2,7 +2,7 @@ ADD_EXECUTABLE(nl_sample_ct_ai_service WIN32 ai_service.cpp)
ADD_EXECUTABLE(nl_sample_ct_gd_service WIN32 gd_service.cpp)
ADD_DEFINITIONS(-DNL_CT_CFG="\\"${NL_SHARE_PREFIX}/nl_sample_class_transport/\\"")
ADD_DEFINITIONS(-DNL_CT_CFG="\\"${NL_SHARE_ABSOLUTE_PREFIX}/nl_sample_class_transport/\\"")
TARGET_LINK_LIBRARIES(nl_sample_ct_ai_service nelmisc nelnet)
NL_DEFAULT_PROPS(nl_sample_ct_ai_service "NeL, Samples, Net, Class Transport: AI Service")
@ -12,5 +12,5 @@ TARGET_LINK_LIBRARIES(nl_sample_ct_gd_service nelmisc nelnet)
NL_DEFAULT_PROPS(nl_sample_ct_gd_service "NeL, Samples, Net, Class Transport: GD Service")
NL_ADD_RUNTIME_FLAGS(nl_sample_ct_gd_service)
INSTALL(TARGETS nl_sample_ct_ai_service nl_sample_ct_gd_service RUNTIME DESTINATION bin COMPONENT samplesnet)
INSTALL(FILES ai_service.cfg gd_service.cfg DESTINATION share/nel/nl_sample_class_transport COMPONENT samplesnet)
INSTALL(TARGETS nl_sample_ct_ai_service nl_sample_ct_gd_service RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT samplesnet)
INSTALL(FILES ai_service.cfg gd_service.cfg DESTINATION ${NL_SHARE_PREFIX}/nl_sample_class_transport COMPONENT samplesnet)

View file

@ -2,7 +2,7 @@ ADD_EXECUTABLE(nl_sample_ls_client client.cpp)
ADD_EXECUTABLE(nl_sample_ls_fes WIN32 frontend_service.cpp)
ADD_DEFINITIONS(-DNL_LS_CFG="\\"${NL_SHARE_PREFIX}/nl_sample_login_system/\\"")
ADD_DEFINITIONS(-DNL_LS_CFG="\\"${NL_SHARE_ABSOLUTE_PREFIX}/nl_sample_login_system/\\"")
TARGET_LINK_LIBRARIES(nl_sample_ls_client nelmisc nelnet)
NL_DEFAULT_PROPS(nl_sample_ls_client "NeL, Samples, Net, Login Service: LS Client")
@ -12,5 +12,5 @@ TARGET_LINK_LIBRARIES(nl_sample_ls_fes nelmisc nelnet)
NL_DEFAULT_PROPS(nl_sample_ls_fes "NeL, Samples, Net, Login Service: LS Frontend")
NL_ADD_RUNTIME_FLAGS(nl_sample_ls_fes)
INSTALL(TARGETS nl_sample_ls_client nl_sample_ls_fes RUNTIME DESTINATION bin COMPONENT samplesnet)
INSTALL(FILES frontend_service.cfg client.cfg DESTINATION share/nel/nl_sample_login_system COMPONENT samplesnet)
INSTALL(TARGETS nl_sample_ls_client nl_sample_ls_fes RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT samplesnet)
INSTALL(FILES frontend_service.cfg client.cfg DESTINATION ${NL_SHARE_PREFIX}/nl_sample_login_system COMPONENT samplesnet)

View file

@ -4,7 +4,7 @@ ADD_EXECUTABLE(nl_sample_udpclient client.cpp graph.cpp graph.h simlag.cpp simla
ADD_EXECUTABLE(nl_sample_udpserver WIN32 bench_service.cpp receive_task.cpp receive_task.h)
ADD_DEFINITIONS(-DUDP_DIR="\\"${NL_SHARE_PREFIX}/nl_sample_udp/\\"")
ADD_DEFINITIONS(-DUDP_DIR="\\"${NL_SHARE_ABSOLUTE_PREFIX}/nl_sample_udp/\\"")
IF(WITH_3D)
ADD_DEFINITIONS(-DUSE_3D)
@ -17,9 +17,9 @@ NL_DEFAULT_PROPS(nl_sample_udpserver "NeL, Samples, Net, UDP: UDP Server")
NL_ADD_RUNTIME_FLAGS(nl_sample_udpclient)
NL_ADD_RUNTIME_FLAGS(nl_sample_udpserver)
INSTALL(TARGETS nl_sample_udpclient nl_sample_udpserver RUNTIME DESTINATION bin COMPONENT samplesnet)
INSTALL(FILES bench_service.cfg client.cfg readme.txt DESTINATION share/nel/nl_sample_udp COMPONENT samplesnet)
INSTALL(TARGETS nl_sample_udpclient nl_sample_udpserver RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT samplesnet)
INSTALL(FILES bench_service.cfg client.cfg readme.txt DESTINATION ${NL_SHARE_PREFIX}/nl_sample_udp COMPONENT samplesnet)
IF(WITH_3D)
INSTALL(FILES n019003l.pfb DESTINATION share/nel/nl_sample_udp COMPONENT samplesnet)
INSTALL(FILES n019003l.pfb DESTINATION ${NL_SHARE_PREFIX}/nl_sample_udp COMPONENT samplesnet)
ENDIF(WITH_3D)

View file

@ -2,16 +2,16 @@ FILE(GLOB SRC *.cpp *.h)
ADD_EXECUTABLE(nl_sample_pacs WIN32 ${SRC})
ADD_DEFINITIONS(-DNL_PACS_DATA="\\"${NL_SHARE_PREFIX}/nl_sample_pacs/\\"")
ADD_DEFINITIONS(-DNL_PACS_DATA="\\"${NL_SHARE_ABSOLUTE_PREFIX}/nl_sample_pacs/\\"")
TARGET_LINK_LIBRARIES(nl_sample_pacs nelmisc nelpacs nel3d)
NL_DEFAULT_PROPS(nl_sample_pacs "NeL, Samples: PACS")
NL_ADD_RUNTIME_FLAGS(nl_sample_pacs)
INSTALL(TARGETS nl_sample_pacs RUNTIME DESTINATION bin COMPONENT samplespacs)
INSTALL(FILES readme.txt DESTINATION share/nel/nl_sample_pacs COMPONENT samplespacs)
INSTALL(TARGETS nl_sample_pacs RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT samplespacs)
INSTALL(FILES readme.txt DESTINATION ${NL_SHARE_PREFIX}/nl_sample_pacs COMPONENT samplespacs)
INSTALL(DIRECTORY shapes/
DESTINATION share/nel/nl_sample_pacs/shapes
DESTINATION ${NL_SHARE_PREFIX}/nl_sample_pacs/shapes
COMPONENT samplespacs
PATTERN "CVS" EXCLUDE
PATTERN ".svn" EXCLUDE

View file

@ -2,7 +2,7 @@ FILE(GLOB SRC *.cpp *.h)
ADD_EXECUTABLE(nl_sample_sound_sources ${SRC})
ADD_DEFINITIONS(-DNL_SOUND_DATA="\\"${NL_SHARE_PREFIX}/nl_sample_sound/\\"" ${LIBXML2_DEFINITIONS})
ADD_DEFINITIONS(-DNL_SOUND_DATA="\\"${NL_SHARE_ABSOLUTE_PREFIX}/nl_sample_sound/\\"" ${LIBXML2_DEFINITIONS})
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
@ -10,9 +10,9 @@ TARGET_LINK_LIBRARIES(nl_sample_sound_sources nelmisc nelsound)
NL_DEFAULT_PROPS(nl_sample_sound_sources "NeL, Samples: Sound: Sound Sources")
NL_ADD_RUNTIME_FLAGS(nl_sample_sound_sources)
INSTALL(TARGETS nl_sample_sound_sources RUNTIME DESTINATION bin COMPONENT samplessound)
INSTALL(TARGETS nl_sample_sound_sources RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT samplessound)
INSTALL(DIRECTORY data/
DESTINATION share/nel/nl_sample_sound/data
DESTINATION ${NL_SHARE_PREFIX}/nl_sample_sound/data
COMPONENT samplespacs
PATTERN "CVS" EXCLUDE
PATTERN ".svn" EXCLUDE

View file

@ -8,5 +8,5 @@ TARGET_LINK_LIBRARIES(nl_sample_stream_file nelmisc nelsound)
NL_DEFAULT_PROPS(nl_sample_stream_file "NeL, Samples: Sound: Stream File")
NL_ADD_RUNTIME_FLAGS(nl_sample_stream_file)
INSTALL(TARGETS nl_sample_stream_file RUNTIME DESTINATION bin COMPONENT samplessound)
INSTALL(TARGETS nl_sample_stream_file RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT samplessound)

View file

@ -8,5 +8,5 @@ TARGET_LINK_LIBRARIES(nl_sample_stream_ogg_vorbis nelmisc nelsound)
NL_DEFAULT_PROPS(nl_sample_stream_ogg_vorbis "NeL, Samples: Sound: Stream OGG Vorbis")
NL_ADD_RUNTIME_FLAGS(nl_sample_stream_ogg_vorbis)
INSTALL(TARGETS nl_sample_stream_ogg_vorbis RUNTIME DESTINATION bin COMPONENT samplessound)
INSTALL(TARGETS nl_sample_stream_ogg_vorbis RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT samplessound)

View file

@ -708,7 +708,7 @@ ENDIF(WITH_PCH)
NL_GEN_PC(nel-3d.pc)
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
INSTALL(TARGETS nel3d LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries)
INSTALL(TARGETS nel3d LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries)
ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
ADD_SUBDIRECTORY(driver)

View file

@ -193,7 +193,7 @@ void SCloudTextureClamp::init (uint32 nWidth, uint32 nHeight, uint32 nDepth, con
Mem = new uint8[NbW*Width*NbH*Height];
uint32 i, j;
if (filename == "")
if (filename.empty())
{
// No filename so init with default
for (i = 0; i < NbW; ++i)

View file

@ -307,7 +307,7 @@ void CCluster::serial (NLMISC::IStream&f)
_SoundGroupId = CStringMapper::map(soundGroup);
f.serial(envFxName);
if (envFxName == "")
if (envFxName.empty())
envFxName = "no fx";
_EnvironmentFxId = CStringMapper::map(envFxName);
}

View file

@ -33,7 +33,7 @@ namespace NL3D
{
// ***************************************************************************
const uint32 IDriver::InterfaceVersion = 0x6a; // added cursors methods
const uint32 IDriver::InterfaceVersion = 0x6b; // added anisotropic filter
// ***************************************************************************
IDriver::IDriver() : _SyncTexDrvInfos( "IDriver::_SyncTexDrvInfos" )

View file

@ -17,7 +17,7 @@ IF(WITH_PCH)
ENDIF(WITH_PCH)
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC_DRIVERS) OR NOT WITH_STATIC_DRIVERS)
INSTALL(TARGETS nel_drv_direct3d_win LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib RUNTIME DESTINATION bin COMPONENT drivers3d)
INSTALL(TARGETS nel_drv_direct3d_win LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_DRIVER_PREFIX} COMPONENT drivers3d)
IF(WITH_MAXPLUGIN)
INSTALL(TARGETS nel_drv_direct3d_win RUNTIME DESTINATION maxplugin COMPONENT drivers3d)
ENDIF(WITH_MAXPLUGIN)

View file

@ -292,6 +292,11 @@ CDriverD3D::CDriverD3D()
_CurrIndexBufferFormat = CIndexBuffer::IndicesUnknownFormat;
_IsGeforce = false;
_NonPowerOfTwoTexturesSupported = false;
_MaxAnisotropy = 0;
_AnisotropicMinSupported = false;
_AnisotropicMagSupported = false;
_AnisotropicMinCubeSupported = false;
_AnisotropicMagCubeSupported = false;
_FrustumLeft= -1.f;
_FrustumRight= 1.f;
@ -1493,6 +1498,11 @@ bool CDriverD3D::setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool r
_MaxVertexIndex = caps.MaxVertexIndex;
_IsGeforce = !(caps.DevCaps & D3DDEVCAPS_NPATCHES) && (caps.PixelShaderVersion >= D3DPS_VERSION(2, 0) || caps.PixelShaderVersion < D3DPS_VERSION(1, 4));
_NonPowerOfTwoTexturesSupported = !(caps.TextureCaps & D3DPTEXTURECAPS_POW2) || (caps.TextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL);
_MaxAnisotropy = caps.MaxAnisotropy;
_AnisotropicMinSupported = (caps.TextureFilterCaps & D3DPTFILTERCAPS_MINFANISOTROPIC) != 0;
_AnisotropicMagSupported = (caps.TextureFilterCaps & D3DPTFILTERCAPS_MAGFANISOTROPIC) != 0;
_AnisotropicMinCubeSupported = (caps.CubeTextureFilterCaps & D3DPTFILTERCAPS_MINFANISOTROPIC) != 0;
_AnisotropicMagCubeSupported = (caps.CubeTextureFilterCaps & D3DPTFILTERCAPS_MAGFANISOTROPIC) != 0;
}
else
{
@ -1506,6 +1516,11 @@ bool CDriverD3D::setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool r
_MaxVertexIndex = 0xffff;
_IsGeforce = false;
_NonPowerOfTwoTexturesSupported = false;
_MaxAnisotropy = 0;
_AnisotropicMinSupported = false;
_AnisotropicMagSupported = false;
_AnisotropicMinCubeSupported = false;
_AnisotropicMagCubeSupported = false;
}
// If 16 bits vertices only, build a vb for quads rendering
if (_MaxVertexIndex <= 0xffff)
@ -1607,6 +1622,7 @@ bool CDriverD3D::setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool r
// Init some variables
_ForceDXTCCompression = false;
_AnisotropicFilter = 0;
_ForceTextureResizePower = 0;
_FogEnabled = false;
@ -2049,6 +2065,25 @@ void CDriverD3D::forceDXTCCompression(bool dxtcComp)
// ***************************************************************************
void CDriverD3D::setAnisotropicFilter(sint filter)
{
H_AUTO_D3D(CDriverD3D_setAnisotropicFilter);
// anisotropic filter not supported
if (_MaxAnisotropy < 2) return;
if (filter < 0 || filter > _MaxAnisotropy)
{
_AnisotropicFilter = _MaxAnisotropy;
}
else
{
_AnisotropicFilter = filter;
}
}
// ***************************************************************************
void CDriverD3D::forceTextureResize(uint divisor)
{
H_AUTO_D3D(CDriverD3D_forceTextureResize);
@ -2715,6 +2750,8 @@ bool CDriverD3D::fillPresentParameter (D3DPRESENT_PARAMETERS &parameters, D3DFOR
// Choose a zbuffer format
D3DFORMAT zbufferFormats[]=
{
//uncomment to save zbuffer D3DFMT_D32F_LOCKABLE,
//uncomment to save zbuffer D3DFMT_D16_LOCKABLE,
/*D3DFMT_D32,
D3DFMT_D24X8,*/
D3DFMT_D24S8,

View file

@ -777,6 +777,7 @@ public:
virtual void disableHardwareVertexArrayAGP();
virtual void disableHardwareTextureShader();
virtual void forceDXTCCompression(bool dxtcComp);
virtual void setAnisotropicFilter(sint filter);
virtual void forceTextureResize(uint divisor);
virtual void forceNativeFragmentPrograms(bool /* nativeOnly */) {} // ignored
@ -1521,6 +1522,7 @@ public:
setSamplerState (stage, D3DSAMP_MAGFILTER, d3dtext->MagFilter);
setSamplerState (stage, D3DSAMP_MINFILTER, d3dtext->MinFilter);
setSamplerState (stage, D3DSAMP_MIPFILTER, d3dtext->MipFilter);
setSamplerState (stage, D3DSAMP_MAXANISOTROPY, _AnisotropicFilter);
// Profile, log the use of this texture
if (_SumTextureMemoryUsed)
@ -2205,6 +2207,11 @@ private:
bool _CubbedMipMapSupported;
bool _IsGeforce;
bool _NonPowerOfTwoTexturesSupported;
uint _MaxAnisotropy;
bool _AnisotropicMinSupported;
bool _AnisotropicMagSupported;
bool _AnisotropicMinCubeSupported;
bool _AnisotropicMagCubeSupported;
uint _NbNeLTextureStages; // Number of texture stage for NeL (max IDRV_MAT_MAXTEXTURES)
uint _MaxVerticesByVertexBufferHard;
uint _MaxLight;
@ -2411,6 +2418,7 @@ private:
bool _MustRestoreLight;
D3DXMATRIX _D3DMatrixIdentity;
DWORD _FogColor;
uint _AnisotropicFilter;
// stencil buffer
bool _CurStencilTest;

View file

@ -442,7 +442,7 @@ bool CDriverD3D::generateD3DTexture (ITexture& tex, bool textureDegradation, D3D
if (d3dtext->Texture == NULL)
{
// profiling: count TextureMemory usage.
uint32 textureMeory = computeTextureMemoryUsage (width, height, levels, destFormat, cube);
uint32 textureMemory = computeTextureMemoryUsage (width, height, levels, destFormat, cube);
// Create the texture
bool createSuccess;
@ -454,6 +454,7 @@ bool CDriverD3D::generateD3DTexture (ITexture& tex, bool textureDegradation, D3D
}
else
{
/*
// textures with mipmaps doesn't support not power of two sizes
// only DXTC formats are beginning with a 'D'
if (supportNonPowerOfTwoTextures() && (!isPowerOf2(width) || !isPowerOf2(height)) && levels == 1)
@ -464,8 +465,16 @@ bool CDriverD3D::generateD3DTexture (ITexture& tex, bool textureDegradation, D3D
_DeviceInterface->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
_DeviceInterface->SetSamplerState(0, D3DSAMP_ADDRESSW, D3DTADDRESS_CLAMP);
}
*/
createSuccess = _DeviceInterface->CreateTexture (width, height, levels, renderTarget?D3DUSAGE_RENDERTARGET:0, destFormat, renderTarget?D3DPOOL_DEFAULT:D3DPOOL_MANAGED, &(d3dtext->Texture2d), NULL) == D3D_OK;
HRESULT hr = _DeviceInterface->CreateTexture (width, height, levels, renderTarget?D3DUSAGE_RENDERTARGET:0, destFormat, renderTarget?D3DPOOL_DEFAULT:D3DPOOL_MANAGED, &(d3dtext->Texture2d), NULL);
if (hr != D3D_OK)
{
nlwarning("CreateTexture failed with code 0x%x for texture %s in %ux%u", hr, tex.getShareName().c_str(), width, height);
}
createSuccess = hr == D3D_OK;
d3dtext->Texture = d3dtext->Texture2d;
}
@ -473,7 +482,7 @@ bool CDriverD3D::generateD3DTexture (ITexture& tex, bool textureDegradation, D3D
return false;
// Stats
d3dtext->TextureMemory = textureMeory;
d3dtext->TextureMemory = textureMemory;
_AllocatedTextureMemory += d3dtext->TextureMemory;
// Copy parameters
@ -499,6 +508,19 @@ inline void CDriverD3D::setupTextureWrapMode(ITexture& tex)
d3dtext->MagFilter = RemapMagTextureFilterTypeNeL2D3D[tex.getMagFilter()];
d3dtext->MinFilter = RemapMinTextureFilterTypeNeL2D3D[tex.getMinFilter()];
d3dtext->MipFilter = RemapMipTextureFilterTypeNeL2D3D[tex.getMinFilter()];
// only enable for min filter, because it's never supported for mag filter
if (_AnisotropicFilter > 1 && tex.getMinFilter() > ITexture::NearestMipMapLinear)
{
if (tex.isTextureCube())
{
if (_AnisotropicMinCubeSupported) d3dtext->MinFilter = D3DTEXF_ANISOTROPIC;
}
else
{
if (_AnisotropicMinSupported) d3dtext->MinFilter = D3DTEXF_ANISOTROPIC;
}
}
}
@ -868,6 +890,13 @@ bool CDriverD3D::uploadTextureInternal (ITexture& tex, CRect& rect, uint8 destMi
D3DFORMAT destFormat, D3DFORMAT srcFormat)
{
H_AUTO_D3D(CDriverD3D_uploadTextureInternal)
if (rect.Width == 0 || rect.Height == 0)
{
nlwarning("Rectangle width or height cannot be 0");
return false;
}
// The D3D texture
CTextureDrvInfosD3D* d3dtext = getTextureD3D(tex);

View file

@ -74,7 +74,7 @@ IF(WITH_PCH)
ENDIF(WITH_PCH)
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC_DRIVERS) OR NOT WITH_STATIC_DRIVERS)
INSTALL(TARGETS ${NLDRV_OGL_LIB} LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib RUNTIME DESTINATION bin COMPONENT drivers3d)
INSTALL(TARGETS ${NLDRV_OGL_LIB} LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_DRIVER_PREFIX} COMPONENT drivers3d)
IF(WITH_MAXPLUGIN)
INSTALL(TARGETS ${NLDRV_OGL_LIB} RUNTIME DESTINATION maxplugin COMPONENT drivers3d)
ENDIF(WITH_MAXPLUGIN)

View file

@ -305,6 +305,8 @@ CDriverGL::CDriverGL()
_NVTextureShaderEnabled = false;
_AnisotropicFilter = 0.f;
// Compute the Flag which say if one texture has been changed in CMaterial.
_MaterialAllTextureTouchedFlag= 0;
for(i=0; i < IDRV_MAT_MAXTEXTURES; i++)
@ -1337,11 +1339,7 @@ void CDriverGL::copyFrameBufferToTexture(ITexture *tex,
{
if(_Extensions.ARBTextureCubeMap)
{
#ifdef USE_OPENGLES
glBindTexture(GL_TEXTURE_CUBE_MAP_OES, gltext->ID);
#else
glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, gltext->ID);
#endif
glCopyTexSubImage2D(NLCubeFaceToGLCubeFace[cubeFace], level, offsetx, offsety, x, y, width, height);
}
}
@ -2626,11 +2624,10 @@ void CDriverGL::checkTextureOn() const
GLboolean flagCM;
GLboolean flagTR;
glGetBooleanv(GL_TEXTURE_2D, &flag2D);
glGetBooleanv(GL_TEXTURE_CUBE_MAP_ARB, &flagCM);
#ifdef USE_OPENGLES
glGetBooleanv(GL_TEXTURE_CUBE_MAP_OES, &flagCM);
flagTR = true; // always true in OpenGL ES
#else
glGetBooleanv(GL_TEXTURE_CUBE_MAP_ARB, &flagCM);
glGetBooleanv(GL_TEXTURE_RECTANGLE_NV, &flagTR);
#endif
switch(dgs.getTextureMode())

View file

@ -364,6 +364,7 @@ public:
virtual bool uploadTextureCube (ITexture& tex, NLMISC::CRect& rect, uint8 nNumMipMap, uint8 nNumFace);
virtual void forceDXTCCompression(bool dxtcComp);
virtual void setAnisotropicFilter(sint filter);
virtual void forceTextureResize(uint divisor);
@ -955,6 +956,8 @@ private:
bool _NVTextureShaderEnabled;
// Which stages support EMBM
bool _StageSupportEMBM[IDRV_MAT_MAXTEXTURES];
// Anisotropic filtering value
float _AnisotropicFilter;
// Prec settings for material.
CDriverGLStates _DriverGLStates;

View file

@ -628,7 +628,7 @@ static bool setupARBTextureNonPowerOfTwo(const char *glext)
{
H_AUTO_OGL(setupARBTextureCompression);
#ifndef USE_OPENGL_ES
#ifndef USE_OPENGLES
CHECK_EXT("GL_ARB_texture_non_power_of_two");
#endif
@ -805,20 +805,20 @@ static bool setupARBTextureCubeMap(const char *glext)
#ifdef USE_OPENGLES
CHECK_EXT("OES_texture_cube_map");
CHECK_ADDRESS(NEL_PFNGLTEXGENFOESPROC, glTexGenfOES);
CHECK_ADDRESS(NEL_PFNGLTEXGENFVOESPROC, glTexGenfvOES);
CHECK_ADDRESS(NEL_PFNGLTEXGENIOESPROC, glTexGeniOES);
CHECK_ADDRESS(NEL_PFNGLTEXGENIVOESPROC, glTexGenivOES);
CHECK_ADDRESS(NEL_PFNGLTEXGENXOESPROC, glTexGenxOES);
CHECK_ADDRESS(NEL_PFNGLTEXGENXVOESPROC, glTexGenxvOES);
CHECK_ADDRESS(NEL_PFNGLGETTEXGENFVOESPROC, glGetTexGenfvOES);
CHECK_ADDRESS(NEL_PFNGLGETTEXGENIVOESPROC, glGetTexGenivOES);
CHECK_ADDRESS(NEL_PFNGLGETTEXGENXVOESPROC, glGetTexGenxvOES);
#else
CHECK_EXT("GL_ARB_texture_cube_map");
#endif
// CHECK_ADDRESS(NEL_PFNGLTEXGENFOESPROC, glTexGenfOES);
// CHECK_ADDRESS(NEL_PFNGLTEXGENFVOESPROC, glTexGenfvOES);
// CHECK_ADDRESS(NEL_PFNGLTEXGENIOESPROC, glTexGeniOES);
// CHECK_ADDRESS(NEL_PFNGLTEXGENIVOESPROC, glTexGenivOES);
// CHECK_ADDRESS(NEL_PFNGLTEXGENXOESPROC, glTexGenxOES);
// CHECK_ADDRESS(NEL_PFNGLTEXGENXVOESPROC, glTexGenxvOES);
// CHECK_ADDRESS(NEL_PFNGLGETTEXGENFVOESPROC, glGetTexGenfvOES);
// CHECK_ADDRESS(NEL_PFNGLGETTEXGENIVOESPROC, glGetTexGenivOES);
// CHECK_ADDRESS(NEL_PFNGLGETTEXGENXVOESPROC, glGetTexGenxvOES);
return true;
}
@ -1499,11 +1499,7 @@ void registerGlExtensions(CGlExtensions &ext)
ext.ARBMultiTexture= setupARBMultiTexture(glext);
if(ext.ARBMultiTexture)
{
#ifdef USE_OPENGLES
glGetIntegerv(GL_MAX_TEXTURE_UNITS, &ntext);
#else
glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &ntext);
#endif
// We could have more than IDRV_MAT_MAXTEXTURES but the interface only
// support IDRV_MAT_MAXTEXTURES texture stages so take min
ext.NbTextureStages= (ntext<((GLint)IDRV_MAT_MAXTEXTURES)?ntext:IDRV_MAT_MAXTEXTURES);

View file

@ -157,7 +157,7 @@ public:
NVTextureRectangle = false;
EXTTextureRectangle = false;
EXTTextureFilterAnisotropic = false;
EXTTextureFilterAnisotropicMaximum = 1.f;
EXTTextureFilterAnisotropicMaximum = 0.f;
ARBTextureRectangle = false;
ARBTextureNonPowerOfTwo = false;
ARBMultisample = false;
@ -781,3 +781,4 @@ extern NEL_PFNGLSAMPLECOVERAGEARBPROC nglSampleCoverageARB;
#endif // USE_OPENGLES
#endif // NL_OPENGL_EXTENSION_H

View file

@ -63,6 +63,20 @@ typedef void (APIENTRY * NEL_PFNGLGETTEXGENFVOESPROC) (GLenum coord, GLenum pnam
typedef void (APIENTRY * NEL_PFNGLGETTEXGENIVOESPROC) (GLenum coord, GLenum pname, GLint *params);
typedef void (APIENTRY * NEL_PFNGLGETTEXGENXVOESPROC) (GLenum coord, GLenum pname, GLfixed *params);
#define GL_MULTISAMPLE_ARB GL_MULTISAMPLE
#define GL_TEXTURE_CUBE_MAP_ARB GL_TEXTURE_CUBE_MAP_OES
#define GL_NONE 0
#define GL_MAX_TEXTURE_UNITS_ARB GL_MAX_TEXTURE_UNITS
#define GL_REFLECTION_MAP_ARB GL_REFLECTION_MAP_OES
#define GL_RGB_SCALE_EXT GL_RGB_SCALE
#define GL_REFLECTION_MAP_ARB GL_REFLECTION_MAP_OES
#define GL_PREVIOUS_EXT GL_PREVIOUS
#define GL_PRIMARY_COLOR_EXT GL_PRIMARY_COLOR
#define GL_CONSTANT_EXT GL_CONSTANT
#define GL_ADD_SIGNED_EXT GL_ADD_SIGNED
#define GL_INTERPOLATE_EXT GL_INTERPOLATE
#define GL_BUMP_ENVMAP_ATI GL_INTERPOLATE
#else
// ***************************************************************************

View file

@ -17,7 +17,7 @@
#include "stdopengl.h"
#include "driver_opengl.h"
#ifdef NL_OS_UNIX
#if defined(NL_OS_UNIX) && !defined(NL_OS_MAC)
# include <X11/Xatom.h>
# ifdef HAVE_XRENDER
# include <X11/extensions/Xrender.h>
@ -25,7 +25,7 @@
# ifdef HAVE_XCURSOR
# include <X11/Xcursor/Xcursor.h>
# endif // HAVE_XCURSOR
#endif // NL_OS_UNIX
#endif // defined(NL_OS_UNIX) && !defined(NL_OS_MAC)
#include "nel/misc/mouse_device.h"
#include "nel/misc/di_event_emitter.h"

View file

@ -87,10 +87,9 @@ static inline void convTexAddr(ITexture *tex, CMaterial::TTexAddressingMode mode
nlassert(mode < CMaterial::TexAddrCount);
static const GLenum glTex2dAddrModesNV[] =
{
#ifdef USE_OPENGLES
0, GL_TEXTURE_2D
#else
GL_NONE, GL_TEXTURE_2D, GL_PASS_THROUGH_NV, GL_CULL_FRAGMENT_NV,
GL_NONE, GL_TEXTURE_2D,
#ifndef USE_OPENGLES
GL_PASS_THROUGH_NV, GL_CULL_FRAGMENT_NV,
GL_OFFSET_TEXTURE_2D_NV, GL_OFFSET_TEXTURE_2D_SCALE_NV,
GL_DEPENDENT_AR_TEXTURE_2D_NV, GL_DEPENDENT_GB_TEXTURE_2D_NV,
GL_DOT_PRODUCT_NV, GL_DOT_PRODUCT_TEXTURE_2D_NV, GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV,
@ -101,10 +100,9 @@ static inline void convTexAddr(ITexture *tex, CMaterial::TTexAddressingMode mode
static const GLenum glTexCubeAddrModesNV[] =
{
#ifdef USE_OPENGLES
0, GL_TEXTURE_CUBE_MAP_OES
#else
GL_NONE, GL_TEXTURE_CUBE_MAP_ARB, GL_PASS_THROUGH_NV, GL_CULL_FRAGMENT_NV,
GL_NONE, GL_TEXTURE_CUBE_MAP_ARB,
#ifndef USE_OPENGLES
GL_PASS_THROUGH_NV, GL_CULL_FRAGMENT_NV,
GL_OFFSET_TEXTURE_2D_NV, GL_OFFSET_TEXTURE_2D_SCALE_NV,
GL_DEPENDENT_AR_TEXTURE_2D_NV, GL_DEPENDENT_GB_TEXTURE_2D_NV,
GL_DOT_PRODUCT_NV, GL_DOT_PRODUCT_TEXTURE_2D_NV, GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV,
@ -147,11 +145,7 @@ void CDriverGL::setTextureEnvFunction(uint stage, CMaterial& mat)
{
// Cubic or normal ?
if (text->isTextureCube ())
#ifdef USE_OPENGLES
_DriverGLStates.setTexGenMode (stage, GL_REFLECTION_MAP_OES);
#else
_DriverGLStates.setTexGenMode (stage, GL_REFLECTION_MAP_ARB);
#endif
else
#ifdef USE_OPENGLES
_DriverGLStates.setTexGenMode (stage, GL_TEXTURE_CUBE_MAP_OES);
@ -974,11 +968,7 @@ void CDriverGL::setupLightMapPass(uint pass)
if (mat._LightMapsMulx2)
{
// Multiply x 2
#ifdef USE_OPENGLES
glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE, 2);
#else
glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE_EXT, 2);
#endif
}
}
}
@ -1087,11 +1077,7 @@ void CDriverGL::endLightMapMultiPass()
for (uint32 i = 0; i < (_NLightMapPerPass+1); ++i)
{
_DriverGLStates.activeTextureARB(i);
#ifdef USE_OPENGLES
glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE, 1);
#else
glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE_EXT, 1);
#endif
}
}
}
@ -1165,12 +1151,7 @@ void CDriverGL::setupSpecularBegin()
// todo hulud remove
// _DriverGLStates.setTextureMode(CDriverGLStates::TextureCubeMap);
#ifdef USE_OPENGLES
_DriverGLStates.setTexGenMode (1, GL_REFLECTION_MAP_OES);
#else
_DriverGLStates.setTexGenMode (1, GL_REFLECTION_MAP_ARB);
#endif
// setup the good matrix for stage 1.
glMatrixMode(GL_TEXTURE);

View file

@ -94,6 +94,7 @@ void CDriverGLStates::forceDefaults(uint nbStages)
_CurLighting= false;
_CurZWrite= true;
_CurStencilTest=false;
_CurMultisample= false;
// setup GLStates.
glDisable(GL_FOG);
@ -102,6 +103,7 @@ void CDriverGLStates::forceDefaults(uint nbStages)
glDisable(GL_ALPHA_TEST);
glDisable(GL_LIGHTING);
glDepthMask(GL_TRUE);
glDisable(GL_MULTISAMPLE_ARB);
// Func.
_CurBlendSrc= GL_SRC_ALPHA;
@ -163,11 +165,9 @@ void CDriverGLStates::forceDefaults(uint nbStages)
if(_TextureCubeMapSupported)
{
#ifdef USE_OPENGLES
glDisable(GL_TEXTURE_CUBE_MAP_OES);
glDisable(GL_TEXTURE_GEN_STR_OES);
#else
glDisable(GL_TEXTURE_CUBE_MAP_ARB);
#ifdef USE_OPENGLES
glDisable(GL_TEXTURE_GEN_STR_OES);
#endif
}
@ -379,6 +379,26 @@ void CDriverGLStates::enableStencilTest(bool enable)
}
}
// ***************************************************************************
void CDriverGLStates::enableMultisample(bool enable)
{
H_AUTO_OGL(CDriverGLStates_enableMultisample);
// If different from current setup, update.
#ifndef NL3D_GLSTATE_DISABLE_CACHE
if( enable != _CurMultisample )
#endif
{
// new state.
_CurMultisample= enable;
// Setup GLState.
if(_CurMultisample)
glEnable(GL_MULTISAMPLE_ARB);
else
glDisable(GL_MULTISAMPLE_ARB);
}
}
// ***************************************************************************
void CDriverGLStates::blendFunc(GLenum src, GLenum dst)
@ -665,7 +685,7 @@ void CDriverGLStates::setTexGenMode (uint stage, GLint mode)
else
{
#ifdef USE_OPENGLES
// nglTexGeniOES(GL_TEXTURE_GEN_STR_OES, GL_TEXTURE_GEN_MODE_OES, mode);
nglTexGeniOES(GL_TEXTURE_GEN_STR_OES, GL_TEXTURE_GEN_MODE_OES, mode);
#else
glTexGeni( GL_S, GL_TEXTURE_GEN_MODE, mode);
glTexGeni( GL_T, GL_TEXTURE_GEN_MODE, mode);
@ -681,8 +701,8 @@ void CDriverGLStates::setTexGenMode (uint stage, GLint mode)
#ifdef USE_OPENGLES
// if(mode==GL_OBJECT_LINEAR || mode==GL_EYE_LINEAR)
// {
nglTexGeniOES(GL_TEXTURE_GEN_STR_OES, GL_TEXTURE_GEN_MODE_OES, mode);
glEnable(GL_TEXTURE_GEN_STR_OES);
// nglTexGeniOES(GL_TEXTURE_GEN_STR_OES, GL_TEXTURE_GEN_MODE_OES, mode);
// glEnable(GL_TEXTURE_GEN_STR_OES);
// }
// else
// {
@ -721,11 +741,7 @@ void CDriverGLStates::resetTextureMode()
if (_TextureCubeMapSupported)
{
#ifdef USE_OPENGLES
glDisable(GL_TEXTURE_CUBE_MAP_OES);
#else
glDisable(GL_TEXTURE_CUBE_MAP_ARB);
#endif
}
#ifndef USE_OPENGLES
@ -768,11 +784,7 @@ void CDriverGLStates::setTextureMode(TTextureMode texMode)
{
if(_TextureCubeMapSupported)
{
#ifdef USE_OPENGLES
glDisable(GL_TEXTURE_CUBE_MAP_OES);
#else
glDisable(GL_TEXTURE_CUBE_MAP_ARB);
#endif
}
else
{
@ -802,11 +814,7 @@ void CDriverGLStates::setTextureMode(TTextureMode texMode)
{
if(_TextureCubeMapSupported)
{
#ifdef USE_OPENGLES
glEnable(GL_TEXTURE_CUBE_MAP_OES);
#else
glEnable(GL_TEXTURE_CUBE_MAP_ARB);
#endif
}
else
{
@ -851,11 +859,11 @@ void CDriverGLStates::forceActiveTextureARB(uint stage)
_CurrentActiveTextureARB= stage;
}
// ***************************************************************************
void CDriverGLStates::enableVertexArray(bool enable)
{
H_AUTO_OGL(CDriverGLStates_enableVertexArray)
H_AUTO_OGL(CDriverGLStates_enableVertexArray);
if(_VertexArrayEnabled != enable)
{
if(enable)
@ -1017,7 +1025,7 @@ void CDriverGLStates::enableVertexAttribArrayARB(uint glIndex,bool enable)
// ***************************************************************************
void CDriverGLStates::enableVertexAttribArrayForEXTVertexShader(uint glIndex, bool enable, uint *variants)
{
H_AUTO_OGL(CDriverGLStates_enableVertexAttribArrayForEXTVertexShader)
H_AUTO_OGL(CDriverGLStates_enableVertexAttribArrayForEXTVertexShader);
if(_VertexAttribArrayEnabled[glIndex] != enable)
{

View file

@ -44,6 +44,7 @@ namespace NLDRIVERGL {
- GL_TEXTURE_GEN_S, GL_TEXTURE_GEN_T, GL_TEXTURE_GEN_R
- GL_COLOR_MATERIAL
- GL_FOG
- GL_MULTISAMPLE_ARB
- glActiveTextureARB()
- glClientActiveTextureARB()
- glEnableClientState() glDisableClientState() with:
@ -99,6 +100,9 @@ public:
/// enable/disable stencil test
void enableStencilTest(bool enable);
bool isStencilTestEnabled() const { return _CurStencilTest; }
/// enable/disable multisample
void enableMultisample(bool enable);
bool isMultisampleEnabled() const { return _CurMultisample; }
// @}
/// glBlendFunc.
@ -197,6 +201,7 @@ private:
bool _CurLighting;
bool _CurZWrite;
bool _CurStencilTest;
bool _CurMultisample;
GLenum _CurBlendSrc;
GLenum _CurBlendDst;

View file

@ -781,11 +781,7 @@ void CDriverGL::bindTextureWithMode(ITexture &tex)
{
_DriverGLStates.setTextureMode(CDriverGLStates::TextureCubeMap);
// Bind this texture
#ifdef USE_OPENGLES
glBindTexture(GL_TEXTURE_CUBE_MAP_OES, gltext->ID);
#else
glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, gltext->ID);
#endif
}
}
else
@ -820,19 +816,16 @@ void CDriverGL::setupTextureBasicParameters(ITexture &tex)
{
if (_Extensions.ARBTextureCubeMap)
{
#ifdef USE_OPENGLES
glTexParameteri(GL_TEXTURE_CUBE_MAP_OES,GL_TEXTURE_WRAP_S, translateWrapToGl(ITexture::Clamp, _Extensions));
glTexParameteri(GL_TEXTURE_CUBE_MAP_OES,GL_TEXTURE_WRAP_T, translateWrapToGl(ITexture::Clamp, _Extensions));
// glTexParameteri(GL_TEXTURE_CUBE_MAP_OES,GL_TEXTURE_WRAP_R, translateWrapToGl(ITexture::Clamp, _Extensions));
glTexParameteri(GL_TEXTURE_CUBE_MAP_OES,GL_TEXTURE_MAG_FILTER, translateMagFilterToGl(gltext));
glTexParameteri(GL_TEXTURE_CUBE_MAP_OES,GL_TEXTURE_MIN_FILTER, translateMinFilterToGl(gltext));
#else
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_WRAP_S, translateWrapToGl(ITexture::Clamp, _Extensions));
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_WRAP_T, translateWrapToGl(ITexture::Clamp, _Extensions));
#ifndef USE_OPENGLES
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_WRAP_R, translateWrapToGl(ITexture::Clamp, _Extensions));
#endif
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_MAG_FILTER, translateMagFilterToGl(gltext));
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_MIN_FILTER, translateMinFilterToGl(gltext));
#endif
if (_AnisotropicFilter > 1.f && gltext->MinFilter > ITexture::NearestMipMapLinear)
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_MAX_ANISOTROPY_EXT, _AnisotropicFilter);
}
}
else
@ -841,6 +834,9 @@ void CDriverGL::setupTextureBasicParameters(ITexture &tex)
glTexParameteri(gltext->TextureMode,GL_TEXTURE_WRAP_T, translateWrapToGl(gltext->WrapT, _Extensions));
glTexParameteri(gltext->TextureMode,GL_TEXTURE_MAG_FILTER, translateMagFilterToGl(gltext));
glTexParameteri(gltext->TextureMode,GL_TEXTURE_MIN_FILTER, translateMinFilterToGl(gltext));
if (_AnisotropicFilter > 1.f && gltext->MinFilter > ITexture::NearestMipMapLinear)
glTexParameteri(gltext->TextureMode, GL_TEXTURE_MAX_ANISOTROPY_EXT, _AnisotropicFilter);
}
//
tex.clearFilterOrWrapModeTouched();
@ -1516,31 +1512,19 @@ bool CDriverGL::activateTexture(uint stage, ITexture *tex)
_CurrentTextureInfoGL[stage]= gltext;
// setup this texture
#ifdef USE_OPENGLES
glBindTexture(GL_TEXTURE_CUBE_MAP_OES, gltext->ID);
#else
glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, gltext->ID);
#endif
// Change parameters of texture, if necessary.
//============================================
if(gltext->MagFilter!= tex->getMagFilter())
{
gltext->MagFilter= tex->getMagFilter();
#ifdef USE_OPENGLES
glTexParameteri(GL_TEXTURE_CUBE_MAP_OES,GL_TEXTURE_MAG_FILTER, translateMagFilterToGl(gltext));
#else
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_MAG_FILTER, translateMagFilterToGl(gltext));
#endif
}
if(gltext->MinFilter!= tex->getMinFilter())
{
gltext->MinFilter= tex->getMinFilter();
#ifdef USE_OPENGLES
glTexParameteri(GL_TEXTURE_CUBE_MAP_OES,GL_TEXTURE_MIN_FILTER, translateMinFilterToGl(gltext));
#else
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_MIN_FILTER, translateMinFilterToGl(gltext));
#endif
}
}
}
@ -1617,34 +1601,16 @@ bool CDriverGL::activateTexture(uint stage, ITexture *tex)
// This maps the CMaterial::TTexOperator
static const GLenum OperatorLUT[9]= { GL_REPLACE, GL_MODULATE, GL_ADD,
#ifdef USE_OPENGLES
GL_ADD_SIGNED, GL_INTERPOLATE, GL_INTERPOLATE, GL_INTERPOLATE, GL_INTERPOLATE, GL_INTERPOLATE
#else
GL_ADD_SIGNED_EXT, GL_INTERPOLATE_EXT, GL_INTERPOLATE_EXT, GL_INTERPOLATE_EXT, GL_INTERPOLATE_EXT, GL_BUMP_ENVMAP_ATI
#endif
};
static const GLenum OperatorLUT[9]= { GL_REPLACE, GL_MODULATE, GL_ADD, GL_ADD_SIGNED_EXT, GL_INTERPOLATE_EXT, GL_INTERPOLATE_EXT, GL_INTERPOLATE_EXT, GL_INTERPOLATE_EXT, GL_BUMP_ENVMAP_ATI };
// This maps the CMaterial::TTexSource
static const GLenum SourceLUT[4]= { GL_TEXTURE,
#ifdef USE_OPENGLES
GL_PREVIOUS, GL_PRIMARY_COLOR, GL_CONSTANT
#else
GL_PREVIOUS_EXT, GL_PRIMARY_COLOR_EXT, GL_CONSTANT_EXT
#endif
};
static const GLenum SourceLUT[4]= { GL_TEXTURE, GL_PREVIOUS_EXT, GL_PRIMARY_COLOR_EXT, GL_CONSTANT_EXT };
// This maps the CMaterial::TTexOperand
static const GLenum OperandLUT[4]= { GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA };
// This maps the CMaterial::TTexOperator, used for openGL Arg2 setup.
static const GLenum InterpolateSrcLUT[8]= { GL_TEXTURE, GL_TEXTURE, GL_TEXTURE, GL_TEXTURE, GL_TEXTURE,
#ifdef USE_OPENGLES
GL_PREVIOUS, GL_PRIMARY_COLOR, GL_CONSTANT
#else
GL_PREVIOUS_EXT, GL_PRIMARY_COLOR_EXT, GL_CONSTANT_EXT
#endif
};
static const GLenum InterpolateSrcLUT[8]= { GL_TEXTURE, GL_TEXTURE, GL_TEXTURE, GL_TEXTURE, GL_TEXTURE, GL_PREVIOUS_EXT, GL_PRIMARY_COLOR_EXT, GL_CONSTANT_EXT };
#ifndef USE_OPENGLES
@ -2224,6 +2190,25 @@ void CDriverGL::forceDXTCCompression(bool dxtcComp)
_ForceDXTCCompression= dxtcComp;
}
// ***************************************************************************
void CDriverGL::setAnisotropicFilter(sint filtering)
{
H_AUTO_OGL(CDriverGL_setAnisotropicFiltering);
if (!_Extensions.EXTTextureFilterAnisotropic) return;
if (filtering < 0 || filtering > _Extensions.EXTTextureFilterAnisotropicMaximum)
{
// set maximum value for anisotropic filter
_AnisotropicFilter = _Extensions.EXTTextureFilterAnisotropicMaximum;
}
else
{
// set specified value for anisotropic filter
_AnisotropicFilter = filtering;
}
}
// ***************************************************************************
void CDriverGL::forceTextureResize(uint divisor)
{

View file

@ -1542,7 +1542,7 @@ void CVertexBufferHardARB::unlock()
#ifdef NL_DEBUG
_Unmapping = true;
#endif
GLboolean unmapOk = false;
GLboolean unmapOk = GL_FALSE;
#ifdef USE_OPENGLES
if (_Driver->_Extensions.OESMapBuffer)
@ -1671,3 +1671,4 @@ void CVertexBufferHardARB::invalidate()
#endif
} // NL3D

View file

@ -43,7 +43,8 @@ namespace NLDRIVERGL {
// ***************************************************************************
CVertexProgamDrvInfosGL::CVertexProgamDrvInfosGL (CDriverGL *drv, ItVtxPrgDrvInfoPtrList it) : IVertexProgramDrvInfos (drv, it)
{
H_AUTO_OGL(CVertexProgamDrvInfosGL_CVertexProgamDrvInfosGL)
H_AUTO_OGL(CVertexProgamDrvInfosGL_CVertexProgamDrvInfosGL);
// Extension must exist
nlassert (drv->_Extensions.NVVertexProgram
|| drv->_Extensions.EXTVertexShader
@ -87,7 +88,7 @@ bool CDriverGL::isVertexProgramEmulated () const
// ***************************************************************************
bool CDriverGL::activeNVVertexProgram (CVertexProgram *program)
{
H_AUTO_OGL(CVertexProgamDrvInfosGL_activeNVVertexProgram)
H_AUTO_OGL(CVertexProgamDrvInfosGL_activeNVVertexProgram);
#ifndef USE_OPENGLES
// Setup or unsetup ?
@ -209,7 +210,8 @@ bool CDriverGL::activeNVVertexProgram (CVertexProgram *program)
static
inline GLenum convSwizzleToGLFormat(CVPSwizzle::EComp comp, bool negate)
{
H_AUTO_OGL(convSwizzleToGLFormat)
H_AUTO_OGL(convSwizzleToGLFormat);
if (!negate)
{
switch(comp)
@ -1348,12 +1350,10 @@ static void ARBVertexProgramDumpInstr(const CVPInstruction &instr, std::string &
}
// ***************************************************************************
bool CDriverGL::setupARBVertexProgram (const CVPParser::TProgram &inParsedProgram, GLuint id, bool &specularWritten)
{
H_AUTO_OGL(CDriverGL_setupARBVertexProgram)
H_AUTO_OGL(CDriverGL_setupARBVertexProgram);
#ifndef USE_OPENGLES
// tmp
@ -1571,7 +1571,6 @@ bool CDriverGL::activeARBVertexProgram (CVertexProgram *program)
#endif
}
// ***************************************************************************
bool CDriverGL::activeEXTVertexShader (CVertexProgram *program)
{

View file

@ -6,7 +6,7 @@ includedir=${prefix}/include
Name: nel-driverogl
Version: 0.5.0
Description: NeL 0.5.0
Reqiures:
Requires:
Libs: -L${libdir}
Libs.private: -ldl -lpthread -lxml2 -lGL -lXxf86vm -lXmu
Cflags: -I${includedir} -DXF86VIDMODE

View file

@ -6,7 +6,7 @@ includedir=@includedir@
Name: nel-driverogl
Version: @VERSION@
Description: NeL @VERSION@
Reqiures:
Requires:
Libs: -L${libdir}
Libs.private: @LIBS@ @OPENGL_LIBS@ @XF86VIDMODE_LIBS@ -lXmu
Cflags: -I${includedir} @OPENGL_CFLAGS@ @XF86VIDMODE_CFLAGS@

View file

@ -77,7 +77,7 @@ IF(WITH_PCH)
ENDIF(WITH_PCH)
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC_DRIVERS) OR NOT WITH_STATIC_DRIVERS)
INSTALL(TARGETS ${NLDRV_OGLES_LIB} LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib RUNTIME DESTINATION bin COMPONENT drivers3d)
INSTALL(TARGETS ${NLDRV_OGLES_LIB} LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} RUNTIME DESTINATION ${NL_DRIVER_PREFIX} COMPONENT drivers3d)
IF(WITH_MAXPLUGIN)
INSTALL(TARGETS ${NLDRV_OGLES_LIB} RUNTIME DESTINATION maxplugin COMPONENT drivers3d)
ENDIF(WITH_MAXPLUGIN)

View file

@ -1469,12 +1469,21 @@ UDriver::TPolygonMode CDriverUser::getPolygonMode ()
return umode;
}
void CDriverUser::forceDXTCCompression(bool dxtcComp)
{
NL3D_HAUTO_UI_DRIVER;
_Driver->forceDXTCCompression(dxtcComp);
}
void CDriverUser::setAnisotropicFilter(sint filter)
{
NL3D_HAUTO_UI_DRIVER;
_Driver->setAnisotropicFilter(filter);
}
void CDriverUser::forceTextureResize(uint divisor)
{
NL3D_HAUTO_UI_DRIVER;

View file

@ -6,7 +6,7 @@ includedir=${prefix}/include
Name: nel-3d
Version: 0.5.0
Description: NeL 0.5.0
Reqiures:
Requires:
Libs: -L${libdir}
Libs.private: -ldl -lpthread -lxml2 -lfreetype -lz -lc
Cflags: -I${includedir} -I/usr/include/freetype2

View file

@ -6,7 +6,7 @@ includedir=@includedir@
Name: nel-3d
Version: @NL_VERSION@
Description: NeL @NL_VERSION@
Reqiures:
Requires:
Libs: -L${libdir}
Libs.private: @LIBS@ @FREETYPE_LIBS@ -lc
Cflags: -I${includedir} @FREETYPE_CFLAGS@

View file

@ -214,9 +214,9 @@ bool BuildTangentSpace(CMesh::CMeshBuild &outMeshBuild, const CMesh::CMeshBuild
if (!canShare) continue;
// Get indices of vertices of current tri
const uint indices[] = { f.Corner[0].Vertex,
f.Corner[1].Vertex,
f.Corner[2].Vertex };
const uint indices[] = { (uint)f.Corner[0].Vertex,
(uint)f.Corner[1].Vertex,
(uint)f.Corner[2].Vertex };
NLMISC::CTriangle tri;
// Build it
BuildTriFromMB(outMeshBuild, indices, tri);

View file

@ -237,7 +237,7 @@ void CZoneLoadingTask::run(void)
{
// Lookup the zone
string zonePathLookup = CPath::lookup (_ZoneName, false, false, true);
if (zonePathLookup == "")
if (zonePathLookup.empty())
zonePathLookup = _ZoneName;
CZone *ZoneTmp = new CZone;

View file

@ -12,5 +12,5 @@ NL_ADD_LIB_SUFFIX(nelceguirenderer)
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DNEL_CEGUIRENDERER_EXPORTS)
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
INSTALL(TARGETS nelceguirenderer RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries)
INSTALL(TARGETS nelceguirenderer RUNTIME DESTINATION ${NL_BIN_PREFIX} 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

@ -23,5 +23,5 @@ ENDIF(WITH_PCH)
NL_GEN_PC(nel-georges.pc)
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
INSTALL(TARGETS nelgeorges LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries)
INSTALL(TARGETS nelgeorges 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

@ -6,7 +6,7 @@ includedir=@includedir@
Name: nel-georges
Version: @NL_VERSION@
Description: NeL @NL_VERSION@
Reqiures:
Requires:
Libs: -L${libdir}
Libs.private: @LIBS@ -lc
Cflags: -I${includedir}

View file

@ -25,7 +25,6 @@
#include "nel/georges/form.h"
#include "nel/georges/form_elm.h"
#include "nel/georges/form_loader.h"
#include "nel/georges/type.h"
using namespace NLMISC;

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