Merged mainline default branch changes.

--HG--
branch : gsoc2012-gui-editor
This commit is contained in:
dfighter1985 2013-02-14 10:47:10 +01:00
commit fcb736c387
846 changed files with 67710 additions and 1669 deletions

View file

@ -2,47 +2,86 @@
# Find the Windows includes # Find the Windows includes
# #
# WINSDK_INCLUDE_DIR - where to find Windows.h # WINSDK_INCLUDE_DIR - where to find Windows.h
# WINSDK_INCLUDE_DIRS - where to find all Windows headers
# WINSDK_LIBRARY_DIR - where to find libraries
# WINSDK_FOUND - True if Windows SDK found. # WINSDK_FOUND - True if Windows SDK found.
IF(WINSDK_INCLUDE_DIR) IF(WINSDK_INCLUDE_DIR)
# Already in cache, be silent # Already in cache, be silent
SET(WINSDK_FIND_QUIETLY TRUE) SET(WindowsSDK_FIND_QUIETLY TRUE)
ENDIF(WINSDK_INCLUDE_DIR) ENDIF(WINSDK_INCLUDE_DIR)
# TODO: add the possibility to use a specific Windows SDK
IF(MSVC11)
GET_FILENAME_COMPONENT(WINSDK8_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]" ABSOLUTE CACHE)
GET_FILENAME_COMPONENT(WINSDK8_VERSION "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;ProductVersion]" NAME)
IF(WINSDK8_DIR)
IF(NOT WindowsSDK_FIND_QUIETLY)
MESSAGE(STATUS "Found Windows SDK ${WINSDK8_VERSION} in ${WINSDK8_DIR}")
ENDIF(NOT WindowsSDK_FIND_QUIETLY)
IF(TARGET_ARM)
SET(WINSDK8_SUFFIX "arm")
ELSEIF(TARGET_X64)
SET(WINSDK8_SUFFIX "x64")
ELSEIF(TARGET_X86)
SET(WINSDK8_SUFFIX "x86")
ENDIF(TARGET_ARM)
ENDIF(WINSDK8_DIR)
ENDIF(MSVC11)
GET_FILENAME_COMPONENT(WINSDK71_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.1;InstallationFolder]" ABSOLUTE CACHE) GET_FILENAME_COMPONENT(WINSDK71_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.1;InstallationFolder]" ABSOLUTE CACHE)
GET_FILENAME_COMPONENT(WINSDK71_VERSION "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.1;ProductVersion]" NAME) GET_FILENAME_COMPONENT(WINSDK71_VERSION "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.1;ProductVersion]" NAME)
IF(WINSDK71_DIR) IF(WINSDK71_DIR)
IF(NOT WINSDK_FIND_QUIETLY) IF(NOT WindowsSDK_FIND_QUIETLY)
MESSAGE(STATUS "Found Windows SDK ${WINSDK71_VERSION} in ${WINSDK71_DIR}") MESSAGE(STATUS "Found Windows SDK ${WINSDK71_VERSION} in ${WINSDK71_DIR}")
ENDIF(NOT WINSDK_FIND_QUIETLY) ENDIF(NOT WindowsSDK_FIND_QUIETLY)
ENDIF(WINSDK71_DIR) ENDIF(WINSDK71_DIR)
GET_FILENAME_COMPONENT(WINSDKCURRENT_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" ABSOLUTE CACHE) GET_FILENAME_COMPONENT(WINSDKCURRENT_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" ABSOLUTE CACHE)
GET_FILENAME_COMPONENT(WINSDKCURRENT_VERSION "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentVersion]" NAME) GET_FILENAME_COMPONENT(WINSDKCURRENT_VERSION "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentVersion]" NAME)
IF(WINSDKCURRENT_DIR) IF(WINSDKCURRENT_DIR)
IF(NOT WINSDK_FIND_QUIETLY) IF(NOT WindowsSDK_FIND_QUIETLY)
MESSAGE(STATUS "Found Windows SDK ${WINSDKCURRENT_VERSION} in ${WINSDKCURRENT_DIR}") MESSAGE(STATUS "Found Windows SDK ${WINSDKCURRENT_VERSION} in ${WINSDKCURRENT_DIR}")
ENDIF(NOT WINSDK_FIND_QUIETLY) ENDIF(NOT WindowsSDK_FIND_QUIETLY)
ENDIF(WINSDKCURRENT_DIR) ENDIF(WINSDKCURRENT_DIR)
FIND_PATH(WINSDK_INCLUDE_DIR Windows.h FIND_PATH(WINSDK_INCLUDE_DIR Windows.h
PATHS HINTS
${WINSDK8_DIR}/Include/um
${WINSDK71_DIR}/Include ${WINSDK71_DIR}/Include
${WINSDKCURRENT_DIR}/Include ${WINSDKCURRENT_DIR}/Include
) )
FIND_PATH(WINSDK_SHARED_INCLUDE_DIR d3d9.h
HINTS
${WINSDK8_DIR}/Include/shared
${WINSDK71_DIR}/Include
${WINSDKCURRENT_DIR}/Include
)
FIND_PATH(WINSDK_LIBRARY_DIR ComCtl32.lib
HINTS
${WINSDK8_DIR}/Lib/win8/um/${WINSDK8_SUFFIX}
${WINSDK71_DIR}/Lib
${WINSDKCURRENT_DIR}/Lib
)
FIND_PROGRAM(WINSDK_SIGNTOOL signtool FIND_PROGRAM(WINSDK_SIGNTOOL signtool
PATHS HINTS
${WINSDK8_DIR}/Bin/x86
${WINSDK71_DIR}/Bin ${WINSDK71_DIR}/Bin
${WINSDKCURRENT_DIR}/Bin ${WINSDKCURRENT_DIR}/Bin
) )
IF(WINSDK_INCLUDE_DIR) IF(WINSDK_INCLUDE_DIR)
SET(WINSDK_FOUND TRUE) SET(WINSDK_FOUND TRUE)
SET(WINSDK_INCLUDE_DIRS ${WINSDK_INCLUDE_DIR} ${WINSDK_SHARED_INCLUDE_DIR})
ELSE(WINSDK_INCLUDE_DIR) ELSE(WINSDK_INCLUDE_DIR)
IF(NOT WINSDK_FIND_QUIETLY) IF(NOT WindowsSDK_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find Windows SDK!") MESSAGE(STATUS "Warning: Unable to find Windows SDK!")
ENDIF(NOT WINSDK_FIND_QUIETLY) ENDIF(NOT WindowsSDK_FIND_QUIETLY)
ENDIF(WINSDK_INCLUDE_DIR) ENDIF(WINSDK_INCLUDE_DIR)

View file

@ -17,13 +17,11 @@ ELSE(MSVC)
ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
OUTPUT_VARIABLE gcc_compiler_version) OUTPUT_VARIABLE gcc_compiler_version)
IF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]") IF(gcc_compiler_version MATCHES "^4\\.1(\\.[0-9]+)?")
SET(PCHSupport_FOUND FALSE)
ELSEIF(gcc_compiler_version MATCHES "^4\\.[0-9]+(\\.[0-9]+)?")
SET(PCHSupport_FOUND TRUE) SET(PCHSupport_FOUND TRUE)
ELSE(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]") ENDIF(gcc_compiler_version MATCHES "^4\\.1(\\.[0-9]+)?")
IF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]")
SET(PCHSupport_FOUND TRUE)
ENDIF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]")
ENDIF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
ELSE(CMAKE_COMPILER_IS_GNUCXX) ELSE(CMAKE_COMPILER_IS_GNUCXX)
# TODO: make tests for other compilers than GCC # TODO: make tests for other compilers than GCC
SET(PCHSupport_FOUND TRUE) SET(PCHSupport_FOUND TRUE)
@ -32,60 +30,123 @@ ELSE(MSVC)
SET(_PCH_include_prefix "-I") SET(_PCH_include_prefix "-I")
ENDIF(MSVC) ENDIF(MSVC)
MACRO(_PCH_GET_COMPILE_FLAGS _out_compile_flags) # Set PCH_FLAGS for common flags, PCH_ARCH_XXX_FLAGS for specific archs flags and PCH_ARCHS for archs
STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name) MACRO(PCH_SET_COMPILE_FLAGS _target)
SET(_FLAGS ${${_flags_var_name}} ) SET(PCH_FLAGS)
SET(PCH_ARCHS)
SET(FLAGS)
LIST(APPEND _FLAGS ${CMAKE_CXX_FLAGS})
STRING(TOUPPER "${CMAKE_BUILD_TYPE}" _UPPER_BUILD)
LIST(APPEND _FLAGS " ${CMAKE_CXX_FLAGS_${_UPPER_BUILD}}")
IF(NOT MSVC) IF(NOT MSVC)
GET_TARGET_PROPERTY(_targetType ${_PCH_current_target} TYPE) GET_TARGET_PROPERTY(_targetType ${_target} TYPE)
IF(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY) IF(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY)
LIST(APPEND _FLAGS "-fPIC") LIST(APPEND _FLAGS " -fPIC")
ENDIF(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY) ENDIF(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY)
ENDIF(NOT MSVC) ENDIF(NOT MSVC)
GET_DIRECTORY_PROPERTY(DIRINC INCLUDE_DIRECTORIES ) GET_DIRECTORY_PROPERTY(DIRINC INCLUDE_DIRECTORIES)
FOREACH(item ${DIRINC}) FOREACH(item ${DIRINC})
LIST(APPEND _FLAGS " ${_PCH_include_prefix}\"${item}\"") LIST(APPEND _FLAGS " ${_PCH_include_prefix}\"${item}\"")
ENDFOREACH(item) ENDFOREACH(item)
# Required for CMake 2.6 # Required for CMake 2.6
SET(GLOBAL_DEFINITIONS "") SET(GLOBAL_DEFINITIONS)
GET_DIRECTORY_PROPERTY(DEFINITIONS COMPILE_DEFINITIONS) GET_DIRECTORY_PROPERTY(DEFINITIONS COMPILE_DEFINITIONS)
FOREACH(item ${DEFINITIONS}) FOREACH(item ${DEFINITIONS})
LIST(APPEND GLOBAL_DEFINITIONS -D${item}) LIST(APPEND GLOBAL_DEFINITIONS " -D${item}")
ENDFOREACH(item) ENDFOREACH(item)
GET_DIRECTORY_PROPERTY(DEFINITIONS COMPILE_DEFINITIONS_${_UPPER_BUILD})
FOREACH(item ${DEFINITIONS})
LIST(APPEND GLOBAL_DEFINITIONS " -D${item}")
ENDFOREACH(item)
GET_TARGET_PROPERTY(oldProps ${_target} COMPILE_FLAGS)
IF(oldProps)
LIST(APPEND _FLAGS " ${oldProps}")
ENDIF(oldProps)
GET_TARGET_PROPERTY(oldPropsBuild ${_target} COMPILE_FLAGS_${_UPPER_BUILD})
IF(oldPropsBuild)
LIST(APPEND _FLAGS " ${oldPropsBuild}")
ENDIF(oldPropsBuild)
GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS) GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS)
GET_DIRECTORY_PROPERTY(_directory_definitions DIRECTORY ${CMAKE_SOURCE_DIR} DEFINITIONS) GET_DIRECTORY_PROPERTY(_directory_definitions DIRECTORY ${CMAKE_SOURCE_DIR} DEFINITIONS)
LIST(APPEND _FLAGS ${GLOBAL_DEFINITIONS}) LIST(APPEND _FLAGS " ${GLOBAL_DEFINITIONS}")
LIST(APPEND _FLAGS ${_directory_flags}) LIST(APPEND _FLAGS " ${_directory_flags}")
LIST(APPEND _FLAGS ${_directory_definitions}) LIST(APPEND _FLAGS " ${_directory_definitions}")
LIST(APPEND _FLAGS ${CMAKE_CXX_FLAGS})
STRING(REGEX REPLACE " +" " " _FLAGS ${_FLAGS})
# Format definitions # Format definitions
SEPARATE_ARGUMENTS(_FLAGS) SEPARATE_ARGUMENTS(_FLAGS)
IF(CLANG) IF(CLANG)
SET(_IGNORE_NEXT OFF) # Determining all architectures and get common flags
SET(_ARCH_NEXT)
SET(_XARCH_NEXT)
FOREACH(item ${_FLAGS}) FOREACH(item ${_FLAGS})
IF(_IGNORE_NEXT) IF(_ARCH_NEXT)
SET(_IGNORE_NEXT OFF) LIST(FIND PCH_ARCHS ${item} ITEM_FOUND)
ELSE(_IGNORE_NEXT) IF(ITEM_FOUND EQUAL -1)
IF(item MATCHES "^-Xarch") LIST(APPEND PCH_ARCHS ${item})
SET(_IGNORE_NEXT ON) STRING(TOUPPER "${item}" _UPPER_ARCH)
ELSEIF(item MATCHES "^-arch") SET(PCH_ARCH_${_UPPER_ARCH}_FLAGS "-arch" ${item})
SET(_IGNORE_NEXT ON) ENDIF(ITEM_FOUND EQUAL -1)
ELSE(item MATCHES "^-Xarch") SET(_ARCH_NEXT OFF)
LIST(APPEND ${_out_compile_flags} ${item}) ELSEIF(_XARCH_NEXT)
ENDIF(item MATCHES "^-Xarch") SET(_XARCH_NEXT OFF)
ENDIF(_IGNORE_NEXT) ELSE(_ARCH_NEXT)
IF(item MATCHES "^-arch")
SET(_ARCH_NEXT ON)
ELSEIF(item MATCHES "^-Xarch_")
STRING(REGEX REPLACE "-Xarch_([a-z0-9_]+)" "\\1" item ${item})
LIST(FIND PCH_ARCHS ${item} ITEM_FOUND)
IF(ITEM_FOUND EQUAL -1)
LIST(APPEND PCH_ARCHS ${item})
STRING(TOUPPER "${item}" _UPPER_ARCH)
SET(PCH_ARCH_${_UPPER_ARCH}_FLAGS "-arch" ${item})
ENDIF(ITEM_FOUND EQUAL -1)
SET(_XARCH_NEXT ON)
ELSE(item MATCHES "^-arch")
LIST(APPEND PCH_FLAGS ${item})
ENDIF(item MATCHES "^-arch")
ENDIF(_ARCH_NEXT)
ENDFOREACH(item) ENDFOREACH(item)
ELSE(CLANG)
SET(${_out_compile_flags} ${_FLAGS})
ENDIF(CLANG)
ENDMACRO(_PCH_GET_COMPILE_FLAGS)
MACRO(_PCH_GET_PDB_FILENAME out_filename _target) # Get architcture specific flags
SET(_XARCH_NEXT)
FOREACH(item ${_FLAGS})
IF(_XARCH_NEXT)
STRING(TOUPPER "${_XARCH_NEXT}" _UPPER_XARCH)
LIST(APPEND PCH_ARCH_${_UPPER_XARCH}_FLAGS ${item})
SET(_XARCH_NEXT OFF)
ELSE(_XARCH_NEXT)
IF(item MATCHES "^-Xarch_")
STRING(SUBSTRING "${item}" 7 -1 _XARCH_NEXT)
ENDIF(item MATCHES "^-Xarch_")
ENDIF(_XARCH_NEXT)
ENDFOREACH(item)
# Remove duplicated architectures
IF(_ARCHS AND PCH_ARCHS)
LIST(REMOVE_DUPLICATES PCH_ARCHS)
ENDIF(_ARCHS AND PCH_ARCHS)
ELSE(CLANG)
SET(PCH_FLAGS ${_FLAGS})
ENDIF(CLANG)
IF(PCH_FLAGS)
LIST(REMOVE_DUPLICATES PCH_FLAGS)
ENDIF(PCH_FLAGS)
ENDMACRO(PCH_SET_COMPILE_FLAGS)
MACRO(GET_PDB_FILENAME _out_filename _target)
# determine output directory based on target type # determine output directory based on target type
GET_TARGET_PROPERTY(_targetType ${_target} TYPE) GET_TARGET_PROPERTY(_targetType ${_target} TYPE)
IF(${_targetType} STREQUAL EXECUTABLE) IF(${_targetType} STREQUAL EXECUTABLE)
@ -103,10 +164,10 @@ MACRO(_PCH_GET_PDB_FILENAME out_filename _target)
SET(_targetPostfix "") SET(_targetPostfix "")
ENDIF(${_targetPostfix} MATCHES NOTFOUND) ENDIF(${_targetPostfix} MATCHES NOTFOUND)
SET(${out_filename} "${_targetOutput}/${_target}${_targetPostfix}.pdb") SET(${_out_filename} "${_targetOutput}/${_target}${_targetPostfix}.pdb")
ENDMACRO(_PCH_GET_PDB_FILENAME) ENDMACRO(GET_PDB_FILENAME)
MACRO(_PCH_GET_COMPILE_COMMAND out_command _input _inputcpp _output) MACRO(PCH_SET_COMPILE_COMMAND _inputcpp _compile_FLAGS)
IF(CMAKE_CXX_COMPILER_ARG1) IF(CMAKE_CXX_COMPILER_ARG1)
# remove leading space in compiler argument # remove leading space in compiler argument
STRING(REGEX REPLACE "^ +" "" pchsupport_compiler_cxx_arg1 ${CMAKE_CXX_COMPILER_ARG1}) STRING(REGEX REPLACE "^ +" "" pchsupport_compiler_cxx_arg1 ${CMAKE_CXX_COMPILER_ARG1})
@ -115,56 +176,117 @@ MACRO(_PCH_GET_COMPILE_COMMAND out_command _input _inputcpp _output)
ENDIF(CMAKE_CXX_COMPILER_ARG1) ENDIF(CMAKE_CXX_COMPILER_ARG1)
IF(MSVC) IF(MSVC)
_PCH_GET_PDB_FILENAME(PDB_FILE ${_PCH_current_target}) GET_PDB_FILENAME(PDB_FILE ${_PCH_current_target})
SET(${out_command} ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} /Yc /Fp\"${_output}\" ${_inputcpp} /c /Fd\"${PDB_FILE}\") SET(PCH_COMMAND ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} /Yc /Fp"${PCH_OUTPUT}" ${_inputcpp} /Fd"${PDB_FILE}" /c /Fo"${PCH_OUTPUT}.obj")
ELSE(MSVC) ELSE(MSVC)
SET(HEADER_FORMAT "c++-header") SET(HEADER_FORMAT "c++-header")
SET(_FLAGS "")
IF(APPLE) IF(APPLE)
SET(HEADER_FORMAT "objective-${HEADER_FORMAT}") SET(HEADER_FORMAT "objective-${HEADER_FORMAT}")
SET(_FLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch)
ENDIF(APPLE) ENDIF(APPLE)
SET(${out_command} ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} -x ${HEADER_FORMAT} -o ${_output} -c ${_input}) SET(PCH_COMMAND ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} ${_FLAGS} -x ${HEADER_FORMAT} -o ${PCH_OUTPUT} -c ${PCH_INPUT})
ENDIF(MSVC) ENDIF(MSVC)
ENDMACRO(_PCH_GET_COMPILE_COMMAND) ENDMACRO(PCH_SET_COMPILE_COMMAND)
MACRO(PCH_SET_PRECOMPILED_HEADER_OUTPUT _targetName _input _arch _language)
SET(_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${_targetName}_pch")
MACRO(GET_PRECOMPILED_HEADER_OUTPUT _targetName _input _output)
IF(MSVC) IF(MSVC)
FILE(MAKE_DIRECTORY ${_OUTPUT_DIR})
GET_FILENAME_COMPONENT(_name ${_input} NAME_WE) GET_FILENAME_COMPONENT(_name ${_input} NAME_WE)
SET(_output "${CMAKE_CURRENT_BINARY_DIR}/${_name}.pch") SET(PCH_INPUT ${_input})
SET(PCH_OUTPUT "${_OUTPUT_DIR}/${_name}.pch")
ELSE(MSVC) ELSE(MSVC)
GET_FILENAME_COMPONENT(_name ${_input} NAME) IF(NOT "${_arch}" STREQUAL "")
SET(_output "${CMAKE_CURRENT_BINARY_DIR}/${_name}.gch") SET(_OUTPUT_DIR "${_OUTPUT_DIR}_${_arch}")
ENDIF(MSVC) ENDIF(NOT "${_arch}" STREQUAL "")
ENDMACRO(GET_PRECOMPILED_HEADER_OUTPUT _targetName _input)
MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName _input _pch_output_to_use ) IF(NOT "${_language}" STREQUAL "")
SET(_OUTPUT_DIR "${_OUTPUT_DIR}_${_language}")
ENDIF(NOT "${_language}" STREQUAL "")
GET_FILENAME_COMPONENT(_name ${_input} NAME)
# Copy .h to output dir
SET(PCH_INPUT "${_OUTPUT_DIR}/${_name}")
ADD_CUSTOM_COMMAND(OUTPUT ${PCH_INPUT}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${_input} ${PCH_INPUT}
DEPENDS ${_input}
COMMENT "[${_targetName}] Update precompiled header - done"
)
IF(CLANG)
SET(PCH_EXT "pth")
ELSE(CLANG)
SET(PCH_EXT "gch")
ENDIF(CLANG)
# For GCC and Clang, PCH needs to be in the same directory as .h
SET(PCH_OUTPUT "${_OUTPUT_DIR}/${_name}.${PCH_EXT}")
ENDIF(MSVC)
ENDMACRO(PCH_SET_PRECOMPILED_HEADER_OUTPUT)
# Add common flags
MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName)
GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS) GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS)
IF(${oldProps} MATCHES NOTFOUND) IF(${oldProps} MATCHES NOTFOUND)
SET(oldProps "") SET(oldProps "")
ENDIF(${oldProps} MATCHES NOTFOUND) ENDIF(${oldProps} MATCHES NOTFOUND)
IF(MSVC) IF(MSVC)
SET(_target_cflags "${oldProps} /Yu\"${_input}\" /FI\"${_input}\" /Fp\"${_pch_output_to_use}\"") SET(_target_cflags "${oldProps} /Yu\"${PCH_INPUT}\" /FI\"${PCH_INPUT}\" /Fp\"${PCH_OUTPUT}\"")
ELSE(MSVC) ELSE(MSVC)
# to do: test whether compiler flags match between target _targetName
# and _pch_output_to_use
FILE(TO_NATIVE_PATH ${_pch_output_to_use} _native_pch_path)
# for use with distcc and gcc >4.0.1 if preprocessed files are accessible # for use with distcc and gcc >4.0.1 if preprocessed files are accessible
# on all remote machines set # on all remote machines set
# PCH_ADDITIONAL_COMPILER_FLAGS to -fpch-preprocess # PCH_ADDITIONAL_COMPILER_FLAGS to -fpch-preprocess
SET(_target_cflags "${oldProps} ${PCH_ADDITIONAL_COMPILER_FLAGS}-include ${_input} -Winvalid-pch") SET(PCH_ADDITIONAL_COMPILER_FLAGS)
LIST(LENGTH PCH_ARCHS PCH_ARCHS_COUNT)
# If no arch is specified, create common flags
IF(PCH_ARCHS_COUNT LESS 2)
SET(PCH_ADDITIONAL_COMPILER_FLAGS "-include ${PCH_INPUT} ${PCH_ADDITIONAL_COMPILER_FLAGS}")
ENDIF(PCH_ARCHS_COUNT LESS 2)
IF(APPLE)
SET(PCH_ADDITIONAL_COMPILER_FLAGS "-fobjc-abi-version=2 -fobjc-legacy-dispatch -x objective-c++ ${PCH_ADDITIONAL_COMPILER_FLAGS}")
ENDIF(APPLE)
IF(WITH_PCH_DEBUG)
SET(PCH_ADDITIONAL_COMPILER_FLAGS "-H ${PCH_ADDITIONAL_COMPILER_FLAGS}")
ENDIF(WITH_PCH_DEBUG)
SET(_target_cflags "${oldProps} ${PCH_ADDITIONAL_COMPILER_FLAGS} -Winvalid-pch")
ENDIF(MSVC) ENDIF(MSVC)
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS ${_target_cflags}) SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS ${_target_cflags})
IF(oldProps)
SET_TARGET_PROPERTIES(${_targetName}_pch_dephelp PROPERTIES COMPILE_FLAGS ${oldProps})
ENDIF(oldProps)
ADD_CUSTOM_TARGET(pch_Generate_${_targetName} DEPENDS ${_pch_output_to_use})
ADD_DEPENDENCIES(${_targetName} pch_Generate_${_targetName})
ENDMACRO(ADD_PRECOMPILED_HEADER_TO_TARGET) ENDMACRO(ADD_PRECOMPILED_HEADER_TO_TARGET)
MACRO(ADD_PRECOMPILED_HEADER _targetName _inputh _inputcpp) # Add specific flags for an arch
MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET_ARCH _targetName _arch)
LIST(LENGTH PCH_ARCHS PCH_ARCHS_COUNT)
IF(PCH_ARCHS_COUNT GREATER 1)
GET_TARGET_PROPERTY(_FLAGS ${_targetName} COMPILE_FLAGS)
IF(${_FLAGS} MATCHES NOTFOUND)
SET(_FLAGS "")
ENDIF(${_FLAGS} MATCHES NOTFOUND)
SET(_FLAGS "${_FLAGS} -Xarch_${_arch} -include${PCH_INPUT}")
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS ${_FLAGS})
ENDIF(PCH_ARCHS_COUNT GREATER 1)
ENDMACRO(ADD_PRECOMPILED_HEADER_TO_TARGET_ARCH)
MACRO(PCH_CREATE_TARGET _targetName _targetNamePCH)
ADD_CUSTOM_COMMAND(OUTPUT ${PCH_OUTPUT} COMMAND ${PCH_COMMAND} COMMENT "Generating ${_targetNamePCH}" DEPENDS ${PCH_INPUT})
ADD_CUSTOM_TARGET(${_targetNamePCH} DEPENDS ${PCH_INPUT} ${PCH_OUTPUT})
ADD_DEPENDENCIES(${_targetName} ${_targetNamePCH})
ENDMACRO(PCH_CREATE_TARGET _targetName _inputh _inputcpp)
MACRO(ADD_PRECOMPILED_HEADER _targetName _inputh _inputcpp)
SET(_PCH_current_target ${_targetName}) SET(_PCH_current_target ${_targetName})
IF(NOT CMAKE_BUILD_TYPE) IF(NOT CMAKE_BUILD_TYPE)
@ -174,38 +296,50 @@ MACRO(ADD_PRECOMPILED_HEADER _targetName _inputh _inputcpp)
) )
ENDIF(NOT CMAKE_BUILD_TYPE) ENDIF(NOT CMAKE_BUILD_TYPE)
GET_PRECOMPILED_HEADER_OUTPUT( ${_targetName} ${_inputh} _output) PCH_SET_COMPILE_FLAGS(${_targetName})
GET_TARGET_PROPERTY(_targetType ${_PCH_current_target} TYPE) IF(PCH_ARCHS)
SET(PCH_OUTPUTS)
FOREACH(_ARCH ${PCH_ARCHS})
STRING(TOUPPER "${_ARCH}" _UPPER_ARCH)
# always build static library because it doesn't need linking PCH_SET_PRECOMPILED_HEADER_OUTPUT(${_targetName} ${_inputh} ${_ARCH} "")
ADD_LIBRARY(${_targetName}_pch_dephelp STATIC ${_inputcpp}) LIST(APPEND PCH_OUTPUTS ${PCH_OUTPUT})
_PCH_GET_COMPILE_FLAGS(_compile_FLAGS) PCH_SET_COMPILE_COMMAND(${_inputcpp} "${PCH_ARCH_${_UPPER_ARCH}_FLAGS};${PCH_FLAGS}")
PCH_CREATE_TARGET(${_targetName} ${_targetName}_pch_${_ARCH})
SET_SOURCE_FILES_PROPERTIES(${_inputh} PROPERTIES GENERATED 1) ADD_PRECOMPILED_HEADER_TO_TARGET_ARCH(${_targetName} ${_ARCH})
ENDFOREACH(_ARCH)
ELSE(PCH_ARCHS)
PCH_SET_PRECOMPILED_HEADER_OUTPUT(${_targetName} ${_inputh} "" "")
LIST(APPEND PCH_OUTPUTS ${PCH_OUTPUT})
_PCH_GET_COMPILE_COMMAND(_command ${_inputh} ${_inputcpp} ${_output}) PCH_SET_COMPILE_COMMAND(${_inputcpp} "${PCH_FLAGS}")
PCH_CREATE_TARGET(${_targetName} ${_targetName}_pch)
ENDIF(PCH_ARCHS)
ADD_CUSTOM_COMMAND( ADD_PRECOMPILED_HEADER_TO_TARGET(${_targetName})
OUTPUT ${_output}
COMMAND ${_command}
DEPENDS ${_inputh} ${_targetName}_pch_dephelp
)
ADD_PRECOMPILED_HEADER_TO_TARGET(${_targetName} ${_inputh} ${_output}) SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${PCH_OUTPUTS}")
ENDMACRO(ADD_PRECOMPILED_HEADER) ENDMACRO(ADD_PRECOMPILED_HEADER)
# Macro to move PCH creation file to the front of files list # 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) MACRO(FIX_PRECOMPILED_HEADER _files _pch)
# Remove .cpp creating PCH from the list # Remove .cpp creating PCH from the list
LIST(REMOVE_ITEM ${_files} ${_pch}) LIST(REMOVE_ITEM ${_files} ${_pch})
IF(MSVC)
# Prepend .cpp creating PCH to the list # Prepend .cpp creating PCH to the list
LIST(INSERT ${_files} 0 ${_pch}) LIST(INSERT ${_files} 0 ${_pch})
ENDIF(MSVC)
ENDMACRO(FIX_PRECOMPILED_HEADER) ENDMACRO(FIX_PRECOMPILED_HEADER)
MACRO(ADD_NATIVE_PRECOMPILED_HEADER _targetName _inputh _inputcpp) MACRO(ADD_NATIVE_PRECOMPILED_HEADER _targetName _inputh _inputcpp)
SET(PCH_METHOD 0) IF(NOT PCHSupport_FOUND)
MESSAGE(STATUS "PCH disabled because compiler doesn't support them")
RETURN()
ENDIF(NOT PCHSupport_FOUND)
# 0 => creating a new target for PCH, works for all makefiles # 0 => creating a new target for PCH, works for all makefiles
# 1 => setting PCH for VC++ project, works for VC++ projects # 1 => setting PCH for VC++ project, works for VC++ projects
@ -218,6 +352,8 @@ MACRO(ADD_NATIVE_PRECOMPILED_HEADER _targetName _inputh _inputcpp)
# SET(PCH_METHOD 1) # SET(PCH_METHOD 1)
ELSEIF(CMAKE_GENERATOR MATCHES "Xcode") ELSEIF(CMAKE_GENERATOR MATCHES "Xcode")
SET(PCH_METHOD 2) SET(PCH_METHOD 2)
ELSE(CMAKE_GENERATOR MATCHES "Visual Studio")
SET(PCH_METHOD 0)
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio") ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio")
IF(PCH_METHOD EQUAL 1) IF(PCH_METHOD EQUAL 1)
@ -239,11 +375,6 @@ MACRO(ADD_NATIVE_PRECOMPILED_HEADER _targetName _inputh _inputcpp)
# For Xcode, cmake needs my patch to process # For Xcode, cmake needs my patch to process
# GCC_PREFIX_HEADER and GCC_PRECOMPILE_PREFIX_HEADER as target properties # GCC_PREFIX_HEADER and GCC_PRECOMPILE_PREFIX_HEADER as target properties
GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS)
IF(${oldProps} MATCHES NOTFOUND)
SET(oldProps "")
ENDIF(${oldProps} MATCHES NOTFOUND)
# When buiding out of the tree, precompiled may not be located # When buiding out of the tree, precompiled may not be located
# Use full path instead. # Use full path instead.
GET_FILENAME_COMPONENT(fullPath ${_inputh} ABSOLUTE) GET_FILENAME_COMPONENT(fullPath ${_inputh} ABSOLUTE)
@ -255,4 +386,7 @@ MACRO(ADD_NATIVE_PRECOMPILED_HEADER _targetName _inputh _inputcpp)
ADD_PRECOMPILED_HEADER(${_targetName} ${_inputh} ${_inputcpp}) ADD_PRECOMPILED_HEADER(${_targetName} ${_inputh} ${_inputcpp})
ENDIF(PCH_METHOD EQUAL 1) ENDIF(PCH_METHOD EQUAL 1)
IF(TARGET ${_targetName}_static)
ADD_NATIVE_PRECOMPILED_HEADER(${_targetName}_static ${_inputh} ${_inputcpp})
ENDIF(TARGET ${_targetName}_static)
ENDMACRO(ADD_NATIVE_PRECOMPILED_HEADER) ENDMACRO(ADD_NATIVE_PRECOMPILED_HEADER)

View file

@ -50,14 +50,11 @@ MACRO(NL_GEN_REVISION_H)
IF(TOOL_FOUND) IF(TOOL_FOUND)
# a custom target that is always built # a custom target that is always built
ADD_CUSTOM_TARGET(revision ALL) ADD_CUSTOM_TARGET(revision ALL
# creates revision.h using cmake script
ADD_CUSTOM_COMMAND(TARGET revision
PRE_BUILD
COMMAND ${CMAKE_COMMAND} COMMAND ${CMAKE_COMMAND}
-DSOURCE_DIR=${CMAKE_SOURCE_DIR} -DSOURCE_DIR=${CMAKE_SOURCE_DIR}
-DROOT_DIR=${CMAKE_SOURCE_DIR}/.. -DROOT_DIR=${CMAKE_SOURCE_DIR}/..
-DCMAKE_MODULE_PATH=${CMAKE_SOURCE_DIR}/CMakeModules
-P ${CMAKE_SOURCE_DIR}/CMakeModules/GetRevision.cmake) -P ${CMAKE_SOURCE_DIR}/CMakeModules/GetRevision.cmake)
# revision.h is a generated file # revision.h is a generated file
@ -102,6 +99,11 @@ ENDMACRO(NL_TARGET_DRIVER)
# Argument: # Argument:
### ###
MACRO(NL_DEFAULT_PROPS name label) MACRO(NL_DEFAULT_PROPS name label)
IF(HAVE_REVISION_H)
# explicitly say that the target depends on revision.h
ADD_DEPENDENCIES(${name} revision)
ENDIF(HAVE_REVISION_H)
# Note: This is just a workaround for a CMake bug generating VS10 files with a colon in the project name. # Note: This is just a workaround for a CMake bug generating VS10 files with a colon in the project name.
# CMake Bug ID: http://www.cmake.org/Bug/view.php?id=11819 # CMake Bug ID: http://www.cmake.org/Bug/view.php?id=11819
STRING(REGEX REPLACE "\\:" " -" proj_label ${label}) STRING(REGEX REPLACE "\\:" " -" proj_label ${label})
@ -410,7 +412,7 @@ MACRO(NL_SETUP_BUILD)
ENDIF(CMAKE_GENERATOR MATCHES "Xcode") ENDIF(CMAKE_GENERATOR MATCHES "Xcode")
# If target and host CPU are the same # If target and host CPU are the same
IF("${HOST_CPU}" STREQUAL "${TARGET_CPU}") IF("${HOST_CPU}" STREQUAL "${TARGET_CPU}" AND NOT CMAKE_CROSSCOMPILING)
# x86-compatible CPU # x86-compatible CPU
IF(HOST_CPU MATCHES "x86") IF(HOST_CPU MATCHES "x86")
IF(NOT CMAKE_SIZEOF_VOID_P) IF(NOT CMAKE_SIZEOF_VOID_P)
@ -431,9 +433,9 @@ MACRO(NL_SETUP_BUILD)
MESSAGE(STATUS "Unknown architecture: ${HOST_CPU}") MESSAGE(STATUS "Unknown architecture: ${HOST_CPU}")
ENDIF(HOST_CPU MATCHES "x86") ENDIF(HOST_CPU MATCHES "x86")
# TODO: add checks for PPC # TODO: add checks for PPC
ELSE("${HOST_CPU}" STREQUAL "${TARGET_CPU}") ELSE("${HOST_CPU}" STREQUAL "${TARGET_CPU}" AND NOT CMAKE_CROSSCOMPILING)
MESSAGE(STATUS "Compiling on ${HOST_CPU} for ${TARGET_CPU}") MESSAGE(STATUS "Compiling on ${HOST_CPU} for ${TARGET_CPU}")
ENDIF("${HOST_CPU}" STREQUAL "${TARGET_CPU}") ENDIF("${HOST_CPU}" STREQUAL "${TARGET_CPU}" AND NOT CMAKE_CROSSCOMPILING)
# Use values from environment variables # Use values from environment variables
SET(PLATFORM_CFLAGS "$ENV{CFLAGS} $ENV{CPPFLAGS} ${PLATFORM_CFLAGS}") SET(PLATFORM_CFLAGS "$ENV{CFLAGS} $ENV{CPPFLAGS} ${PLATFORM_CFLAGS}")
@ -454,6 +456,7 @@ MACRO(NL_SETUP_BUILD)
IF(NOT CMAKE_OSX_ARCHITECTURES) IF(NOT CMAKE_OSX_ARCHITECTURES)
IF(TARGET_CPU STREQUAL "x86_64") IF(TARGET_CPU STREQUAL "x86_64")
SET(TARGET_X64 1) SET(TARGET_X64 1)
SET(TARGET_X86 1)
ELSEIF(TARGET_CPU STREQUAL "x86") ELSEIF(TARGET_CPU STREQUAL "x86")
SET(TARGET_X86 1) SET(TARGET_X86 1)
ELSEIF(TARGET_CPU STREQUAL "armv7s") ELSEIF(TARGET_CPU STREQUAL "armv7s")
@ -470,26 +473,15 @@ MACRO(NL_SETUP_BUILD)
SET(TARGET_ARMV5 1) SET(TARGET_ARMV5 1)
ELSEIF(TARGET_CPU STREQUAL "arm") ELSEIF(TARGET_CPU STREQUAL "arm")
SET(TARGET_ARM 1) SET(TARGET_ARM 1)
ELSEIF(TARGET_CPU STREQUAL "mips")
SET(TARGET_MIPS 1)
ENDIF(TARGET_CPU STREQUAL "x86_64") ENDIF(TARGET_CPU STREQUAL "x86_64")
ENDIF(NOT CMAKE_OSX_ARCHITECTURES)
# Fix library paths suffixes for Debian MultiArch
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(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_ARM)
IF(TARGET_ARMV7S)
ADD_PLATFORM_FLAGS("-DHAVE_ARMV7S")
ENDIF(TARGET_ARMV7S)
IF(TARGET_ARMV7) IF(TARGET_ARMV7)
ADD_PLATFORM_FLAGS("-DHAVE_ARMV7") ADD_PLATFORM_FLAGS("-DHAVE_ARMV7")
ENDIF(TARGET_ARMV7) ENDIF(TARGET_ARMV7)
@ -509,12 +501,42 @@ MACRO(NL_SETUP_BUILD)
ADD_PLATFORM_FLAGS("-DHAVE_X64 -DHAVE_X86_64") ADD_PLATFORM_FLAGS("-DHAVE_X64 -DHAVE_X86_64")
ENDIF(TARGET_X64) ENDIF(TARGET_X64)
IF(TARGET_MIPS)
ADD_PLATFORM_FLAGS("-DHAVE_MIPS")
ENDIF(TARGET_MIPS)
ENDIF(NOT CMAKE_OSX_ARCHITECTURES)
# Fix library paths suffixes for Debian MultiArch
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)
ELSEIF(TARGET_X86)
SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /lib32 /usr/lib32)
ENDIF(TARGET_X64)
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(WITH_LOGGING) IF(WITH_LOGGING)
ADD_PLATFORM_FLAGS("-DENABLE_LOGS") ADD_PLATFORM_FLAGS("-DENABLE_LOGS")
ENDIF(WITH_LOGGING) ENDIF(WITH_LOGGING)
IF(MSVC) IF(MSVC)
IF(MSVC10) IF(MSVC_VERSION EQUAL "1700" AND NOT MSVC11)
SET(MSVC11 ON)
ENDIF(MSVC_VERSION EQUAL "1700" AND NOT MSVC11)
IF(MSVC11)
ADD_PLATFORM_FLAGS("/Gy- /MP")
# /Ox is working with VC++ 2010, but custom optimizations don't exist
SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}")
# without inlining it's unusable, use custom optimizations again
SET(DEBUG_CFLAGS "/Od /Ob1 /GF- ${DEBUG_CFLAGS}")
ELSEIF(MSVC10)
ADD_PLATFORM_FLAGS("/Gy- /MP") ADD_PLATFORM_FLAGS("/Gy- /MP")
# /Ox is working with VC++ 2010, but custom optimizations don't exist # /Ox is working with VC++ 2010, but custom optimizations don't exist
SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}") SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}")
@ -532,9 +554,9 @@ MACRO(NL_SETUP_BUILD)
SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}") SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}")
# without inlining it's unusable, use custom optimizations again # without inlining it's unusable, use custom optimizations again
SET(DEBUG_CFLAGS "/Od /Ob1 ${DEBUG_CFLAGS}") SET(DEBUG_CFLAGS "/Od /Ob1 ${DEBUG_CFLAGS}")
ELSE(MSVC10) ELSE(MSVC11)
MESSAGE(FATAL_ERROR "Can't determine compiler version ${MSVC_VERSION}") MESSAGE(FATAL_ERROR "Can't determine compiler version ${MSVC_VERSION}")
ENDIF(MSVC10) ENDIF(MSVC11)
ADD_PLATFORM_FLAGS("/D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /DWIN32 /D_WINDOWS /Zm1000 /wd4250") ADD_PLATFORM_FLAGS("/D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /DWIN32 /D_WINDOWS /Zm1000 /wd4250")
@ -577,13 +599,10 @@ MACRO(NL_SETUP_BUILD)
ENDIF(CLANG) ENDIF(CLANG)
ENDIF(WIN32) ENDIF(WIN32)
IF(TARGET_ARM)
ADD_PLATFORM_FLAGS("-mthumb")
ENDIF(TARGET_ARM)
IF(APPLE) IF(APPLE)
IF(IOS) IF(IOS)
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.7" CACHE PATH "" FORCE) # Disable CMAKE_OSX_DEPLOYMENT_TARGET for iOS
SET(CMAKE_OSX_DEPLOYMENT_TARGET "" CACHE PATH "" FORCE)
ELSE(IOS) ELSE(IOS)
IF(NOT CMAKE_OSX_DEPLOYMENT_TARGET) IF(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.6" CACHE PATH "" FORCE) SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.6" CACHE PATH "" FORCE)
@ -609,6 +628,11 @@ MACRO(NL_SETUP_BUILD)
SET(_ARCHS "${_ARCHS} x86_64") SET(_ARCHS "${_ARCHS} x86_64")
SET(TARGET_X64 1) SET(TARGET_X64 1)
MATH(EXPR TARGETS_COUNT "${TARGETS_COUNT}+1") MATH(EXPR TARGETS_COUNT "${TARGETS_COUNT}+1")
ELSEIF(_ARCH STREQUAL "armv7s")
SET(_ARCHS "${_ARCHS} armv7s")
SET(TARGET_ARMV7S 1)
SET(TARGET_ARM 1)
MATH(EXPR TARGETS_COUNT "${TARGETS_COUNT}+1")
ELSEIF(_ARCH STREQUAL "armv7") ELSEIF(_ARCH STREQUAL "armv7")
SET(_ARCHS "${_ARCHS} armv7") SET(_ARCHS "${_ARCHS} armv7")
SET(TARGET_ARMV7 1) SET(TARGET_ARMV7 1)
@ -619,16 +643,51 @@ MACRO(NL_SETUP_BUILD)
SET(TARGET_ARMV6 1) SET(TARGET_ARMV6 1)
SET(TARGET_ARM 1) SET(TARGET_ARM 1)
MATH(EXPR TARGETS_COUNT "${TARGETS_COUNT}+1") MATH(EXPR TARGETS_COUNT "${TARGETS_COUNT}+1")
ELSEIF(_ARCH STREQUAL "mips")
SET(_ARCHS "${_ARCHS} mips")
SET(TARGET_MIPS 1)
MATH(EXPR TARGETS_COUNT "${TARGETS_COUNT}+1")
ELSE(_ARCH STREQUAL "i386") ELSE(_ARCH STREQUAL "i386")
SET(_ARCHS "${_ARCHS} unknwon(${_ARCH})") SET(_ARCHS "${_ARCHS} unknwon(${_ARCH})")
ENDIF(_ARCH STREQUAL "i386") ENDIF(_ARCH STREQUAL "i386")
ENDFOREACH(_ARCH) ENDFOREACH(_ARCH)
MESSAGE(STATUS "Compiling under Mac OS X for ${TARGETS_COUNT} architectures: ${_ARCHS}") MESSAGE(STATUS "Compiling under Mac OS X for ${TARGETS_COUNT} architectures: ${_ARCHS}")
ELSE(CMAKE_OSX_ARCHITECTURES) ELSE(CMAKE_OSX_ARCHITECTURES)
SET(TARGETS_COUNT 1) SET(TARGETS_COUNT 0)
ENDIF(CMAKE_OSX_ARCHITECTURES) ENDIF(CMAKE_OSX_ARCHITECTURES)
IF(TARGETS_COUNT EQUAL 1) IF(TARGETS_COUNT EQUAL 1)
IF(TARGET_ARM)
IF(TARGET_ARMV7S)
ADD_PLATFORM_FLAGS("-arch armv7s -DHAVE_ARMV7S")
ENDIF(TARGET_ARMV7S)
IF(TARGET_ARMV7)
ADD_PLATFORM_FLAGS("-arch armv7 -DHAVE_ARMV7")
ENDIF(TARGET_ARMV7)
IF(TARGET_ARMV6)
ADD_PLATFORM_FLAGS("-arch armv6 -DHAVE_ARMV6")
ENDIF(TARGET_ARMV6)
IF(TARGET_ARMV5)
ADD_PLATFORM_FLAGS("-arch armv5 -DHAVE_ARMV5")
ENDIF(TARGET_ARMV5)
ADD_PLATFORM_FLAGS("-mthumb -DHAVE_ARM")
ENDIF(TARGET_ARM)
IF(TARGET_X64)
ADD_PLATFORM_FLAGS("-arch x86_64 -DHAVE_X64 -DHAVE_X86_64 -DHAVE_X86")
ELSEIF(TARGET_X86)
ADD_PLATFORM_FLAGS("-arch i386 -DHAVE_X86")
ENDIF(TARGET_X64)
IF(TARGET_MIPS)
ADD_PLATFORM_FLAGS("-arch mips -DHAVE_MIPS")
ENDIF(TARGET_MIPS)
ELSEIF(TARGETS_COUNT EQUAL 0)
# Not using CMAKE_OSX_ARCHITECTURES, HAVE_XXX already defined before
IF(TARGET_ARM) IF(TARGET_ARM)
IF(TARGET_ARMV7S) IF(TARGET_ARMV7S)
ADD_PLATFORM_FLAGS("-arch armv7s") ADD_PLATFORM_FLAGS("-arch armv7s")
@ -645,15 +704,19 @@ MACRO(NL_SETUP_BUILD)
IF(TARGET_ARMV5) IF(TARGET_ARMV5)
ADD_PLATFORM_FLAGS("-arch armv5") ADD_PLATFORM_FLAGS("-arch armv5")
ENDIF(TARGET_ARMV5) ENDIF(TARGET_ARMV5)
ENDIF(TARGET_ARM)
IF(TARGET_X86) ADD_PLATFORM_FLAGS("-mthumb")
ADD_PLATFORM_FLAGS("-arch i386") ENDIF(TARGET_ARM)
ENDIF(TARGET_X86)
IF(TARGET_X64) IF(TARGET_X64)
ADD_PLATFORM_FLAGS("-arch x86_64") ADD_PLATFORM_FLAGS("-arch x86_64")
ELSEIF(TARGET_X86)
ADD_PLATFORM_FLAGS("-arch i386")
ENDIF(TARGET_X64) ENDIF(TARGET_X64)
IF(TARGET_MIPS)
ADD_PLATFORM_FLAGS("-arch mips")
ENDIF(TARGET_MIPS)
ELSE(TARGETS_COUNT EQUAL 1) ELSE(TARGETS_COUNT EQUAL 1)
IF(TARGET_ARMV6) IF(TARGET_ARMV6)
ADD_PLATFORM_FLAGS("-Xarch_armv6 -mthumb -Xarch_armv6 -DHAVE_ARM -Xarch_armv6 -DHAVE_ARMV6") ADD_PLATFORM_FLAGS("-Xarch_armv6 -mthumb -Xarch_armv6 -DHAVE_ARM -Xarch_armv6 -DHAVE_ARMV6")
@ -664,15 +727,21 @@ MACRO(NL_SETUP_BUILD)
ENDIF(TARGET_ARMV7) ENDIF(TARGET_ARMV7)
IF(TARGET_X86) IF(TARGET_X86)
ADD_PLATFORM_FLAGS("-arch i386 -Xarch_i386 -DHAVE_X86") ADD_PLATFORM_FLAGS("-Xarch_i386 -DHAVE_X86")
ENDIF(TARGET_X86) ENDIF(TARGET_X86)
IF(TARGET_X64) IF(TARGET_X64)
ADD_PLATFORM_FLAGS("-arch x86_64 -Xarch_x86_64 -DHAVE_X64 -Xarch_x86_64 -DHAVE_X86_64") ADD_PLATFORM_FLAGS("-Xarch_x86_64 -DHAVE_X64 -Xarch_x86_64 -DHAVE_X86_64")
ENDIF(TARGET_X64) ENDIF(TARGET_X64)
IF(TARGET_MIPS)
ADD_PLATFORM_FLAGS("-Xarch_mips -DHAVE_MIPS")
ENDIF(TARGET_MIPS)
ENDIF(TARGETS_COUNT EQUAL 1) ENDIF(TARGETS_COUNT EQUAL 1)
IF(IOS) IF(IOS)
SET(CMAKE_OSX_SYSROOT "" CACHE PATH "" FORCE)
IF(IOS_VERSION) IF(IOS_VERSION)
PARSE_VERSION_STRING(${IOS_VERSION} IOS_VERSION_MAJOR IOS_VERSION_MINOR IOS_VERSION_PATCH) 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) CONVERT_VERSION_NUMBER(${IOS_VERSION_MAJOR} ${IOS_VERSION_MINOR} ${IOS_VERSION_PATCH} IOS_VERSION_NUMBER)
@ -681,20 +750,44 @@ MACRO(NL_SETUP_BUILD)
ENDIF(IOS_VERSION) ENDIF(IOS_VERSION)
IF(CMAKE_IOS_SYSROOT) IF(CMAKE_IOS_SYSROOT)
ADD_PLATFORM_FLAGS("-isysroot${CMAKE_IOS_SYSROOT}") IF(TARGET_ARMV7S)
ADD_PLATFORM_FLAGS("-miphoneos-version-min=${IOS_VERSION}") IF(TARGETS_COUNT GREATER 1)
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-iphoneos_version_min,${IOS_VERSION}") SET(XARCH "-Xarch_armv7s ")
ENDIF(TARGETS_COUNT GREATER 1)
ADD_PLATFORM_FLAGS("${XARCH}-isysroot${CMAKE_IOS_SYSROOT}")
ADD_PLATFORM_FLAGS("${XARCH}-miphoneos-version-min=${IOS_VERSION}")
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-iphoneos_version_min,${IOS_VERSION}")
ENDIF(TARGET_ARMV7S)
IF(TARGET_ARMV7)
IF(TARGETS_COUNT GREATER 1)
SET(XARCH "-Xarch_armv7 ")
ENDIF(TARGETS_COUNT GREATER 1)
ADD_PLATFORM_FLAGS("${XARCH}-isysroot${CMAKE_IOS_SYSROOT}")
ADD_PLATFORM_FLAGS("${XARCH}-miphoneos-version-min=${IOS_VERSION}")
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-iphoneos_version_min,${IOS_VERSION}")
ENDIF(TARGET_ARMV7)
IF(TARGET_ARMV6)
IF(TARGETS_COUNT GREATER 1)
SET(XARCH "-Xarch_armv6 ")
ENDIF(TARGETS_COUNT GREATER 1)
ADD_PLATFORM_FLAGS("${XARCH}-isysroot${CMAKE_IOS_SYSROOT}")
ADD_PLATFORM_FLAGS("${XARCH}-miphoneos-version-min=${IOS_VERSION}")
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-iphoneos_version_min,${IOS_VERSION}")
ENDIF(TARGET_ARMV6)
ENDIF(CMAKE_IOS_SYSROOT) ENDIF(CMAKE_IOS_SYSROOT)
IF(CMAKE_IOS_SIMULATOR_SYSROOT AND TARGET_X86) IF(CMAKE_IOS_SIMULATOR_SYSROOT AND TARGET_X86)
IF(TARGETS_COUNT EQUAL 1) IF(TARGETS_COUNT GREATER 1)
ADD_PLATFORM_FLAGS("-arch i386")
ELSE(TARGETS_COUNT EQUAL 1)
SET(XARCH "-Xarch_i386 ") SET(XARCH "-Xarch_i386 ")
ENDIF(TARGETS_COUNT EQUAL 1) ENDIF(TARGETS_COUNT GREATER 1)
# Always force -mmacosx-version-min to override environement variable ADD_PLATFORM_FLAGS("${XARCH}-isysroot${CMAKE_IOS_SIMULATOR_SYSROOT}")
ADD_PLATFORM_FLAGS("${XARCH}-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}") ADD_PLATFORM_FLAGS("${XARCH}-mios-simulator-version-min=${IOS_VERSION}")
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-macosx_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) ENDIF(CMAKE_IOS_SIMULATOR_SYSROOT AND TARGET_X86)
ELSE(IOS) ELSE(IOS)
@ -746,6 +839,46 @@ MACRO(NL_SETUP_BUILD)
ENDIF(CLANG) ENDIF(CLANG)
ENDIF(WITH_WARNINGS) ENDIF(WITH_WARNINGS)
IF(ANDROID)
ADD_PLATFORM_FLAGS("--sysroot=${PLATFORM_ROOT}")
ADD_PLATFORM_FLAGS("-ffunction-sections -funwind-tables")
ADD_PLATFORM_FLAGS("-DANDROID")
ADD_PLATFORM_FLAGS("-Wa,--noexecstack")
IF(TARGET_ARM)
ADD_PLATFORM_FLAGS("-fpic -fstack-protector")
ADD_PLATFORM_FLAGS("-D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__")
IF(TARGET_ARMV7)
ADD_PLATFORM_FLAGS("-march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16")
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -march=armv7-a -Wl,--fix-cortex-a8")
ELSEIF(TARGET_ARMV5)
ADD_PLATFORM_FLAGS("-march=armv5te -mtune=xscale -msoft-float")
ENDIF(TARGET_ARMV7)
SET(TARGET_THUMB ON)
IF(TARGET_THUMB)
ADD_PLATFORM_FLAGS("-mthumb -fno-strict-aliasing -finline-limit=64")
SET(DEBUG_CFLAGS "${DEBUG_CFLAGS} -marm")
ELSE(TARGET_THUMB)
ADD_PLATFORM_FLAGS("-funswitch-loops -finline-limit=300")
SET(DEBUG_CFLAGS "${DEBUG_CFLAGS} -fno-strict-aliasing")
SET(RELEASE_CFLAGS "${RELEASE_CFLAGS} -fstrict-aliasing")
ENDIF(TARGET_THUMB)
ELSEIF(TARGET_X86)
# Optimizations for Intel Atom
ADD_PLATFORM_FLAGS("-march=i686 -mtune=atom -mstackrealign -msse3 -mfpmath=sse -m32 -flto -ffast-math -funroll-loops")
ADD_PLATFORM_FLAGS("-fstack-protector -funswitch-loops -finline-limit=300")
SET(RELEASE_CFLAGS "${RELEASE_CFLAGS} -fstrict-aliasing")
SET(DEBUG_CFLAGS "${DEBUG_CFLAGS} -fno-strict-aliasing")
ELSEIF(TARGET_MIPS)
ADD_PLATFORM_FLAGS("-fpic -finline-functions -fmessage-length=0 -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers -fno-strict-aliasing")
SET(RELEASE_CFLAGS "${RELEASE_CFLAGS} -funswitch-loops -finline-limit=300")
ENDIF(TARGET_ARM)
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now")
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -L${PLATFORM_ROOT}/usr/lib")
ENDIF(ANDROID)
IF(APPLE) IF(APPLE)
ADD_PLATFORM_FLAGS("-gdwarf-2") ADD_PLATFORM_FLAGS("-gdwarf-2")
ENDIF(APPLE) ENDIF(APPLE)
@ -799,7 +932,7 @@ ENDMACRO(NL_SETUP_BUILD_FLAGS)
MACRO(NL_MAKE_ABSOLUTE_PREFIX NAME_RELATIVE NAME_ABSOLUTE) MACRO(NL_MAKE_ABSOLUTE_PREFIX NAME_RELATIVE NAME_ABSOLUTE)
IF(IS_ABSOLUTE "${${NAME_RELATIVE}}") IF(IS_ABSOLUTE "${${NAME_RELATIVE}}")
SET(${NAME_ABSOLUTE} ${${NAME_RELATIVE}}) SET(${NAME_ABSOLUTE} ${${NAME_RELATIVE}})
ELSE(IS_ABSOLUTE "${${{NAME_RELATIVE}}") ELSE(IS_ABSOLUTE "${${NAME_RELATIVE}}")
IF(WIN32) IF(WIN32)
SET(${NAME_ABSOLUTE} ${${NAME_RELATIVE}}) SET(${NAME_ABSOLUTE} ${${NAME_RELATIVE}})
ELSE(WIN32) ELSE(WIN32)
@ -950,11 +1083,37 @@ MACRO(SETUP_EXTERNAL)
SET(VC_DIR $ENV{VC_DIR}) SET(VC_DIR $ENV{VC_DIR})
ENDIF(NOT VC_DIR) ENDIF(NOT VC_DIR)
IF(MSVC10) IF(MSVC11)
IF(NOT MSVC10_REDIST_DIR) IF(NOT MSVC_REDIST_DIR)
# If you have VC++ 2012 Express, put x64/Microsoft.VC110.CRT/*.dll in ${EXTERNAL_PATH}/redist
SET(MSVC_REDIST_DIR "${EXTERNAL_PATH}/redist")
ENDIF(NOT MSVC_REDIST_DIR)
IF(NOT VC_DIR)
IF(NOT VC_ROOT_DIR)
GET_FILENAME_COMPONENT(VC_ROOT_DIR "[HKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\11.0_Config;InstallDir]" ABSOLUTE)
# VC_ROOT_DIR is set to "registry" when a key is not found
IF(VC_ROOT_DIR MATCHES "registry")
GET_FILENAME_COMPONENT(VC_ROOT_DIR "[HKEY_CURRENT_USER\\Software\\Microsoft\\WDExpress\\11.0_Config\\Setup\\VC;InstallDir]" ABSOLUTE)
IF(VC_ROOT_DIR MATCHES "registry")
SET(VS110COMNTOOLS $ENV{VS110COMNTOOLS})
IF(VS110COMNTOOLS)
FILE(TO_CMAKE_PATH ${VS110COMNTOOLS} VC_ROOT_DIR)
ENDIF(VS110COMNTOOLS)
IF(NOT VC_ROOT_DIR)
MESSAGE(FATAL_ERROR "Unable to find VC++ 2012 directory!")
ENDIF(NOT VC_ROOT_DIR)
ENDIF(VC_ROOT_DIR MATCHES "registry")
ENDIF(VC_ROOT_DIR MATCHES "registry")
ENDIF(NOT VC_ROOT_DIR)
# convert IDE fullpath to VC++ path
STRING(REGEX REPLACE "Common7/.*" "VC" VC_DIR ${VC_ROOT_DIR})
ENDIF(NOT VC_DIR)
ELSEIF(MSVC10)
IF(NOT MSVC_REDIST_DIR)
# If you have VC++ 2010 Express, put x64/Microsoft.VC100.CRT/*.dll in ${EXTERNAL_PATH}/redist # If you have VC++ 2010 Express, put x64/Microsoft.VC100.CRT/*.dll in ${EXTERNAL_PATH}/redist
SET(MSVC10_REDIST_DIR "${EXTERNAL_PATH}/redist") SET(MSVC_REDIST_DIR "${EXTERNAL_PATH}/redist")
ENDIF(NOT MSVC10_REDIST_DIR) ENDIF(NOT MSVC_REDIST_DIR)
IF(NOT VC_DIR) IF(NOT VC_DIR)
IF(NOT VC_ROOT_DIR) IF(NOT VC_ROOT_DIR)
@ -976,7 +1135,7 @@ MACRO(SETUP_EXTERNAL)
# convert IDE fullpath to VC++ path # convert IDE fullpath to VC++ path
STRING(REGEX REPLACE "Common7/.*" "VC" VC_DIR ${VC_ROOT_DIR}) STRING(REGEX REPLACE "Common7/.*" "VC" VC_DIR ${VC_ROOT_DIR})
ENDIF(NOT VC_DIR) ENDIF(NOT VC_DIR)
ELSE(MSVC10) ELSE(MSVC11)
IF(NOT VC_DIR) IF(NOT VC_DIR)
IF(${CMAKE_MAKE_PROGRAM} MATCHES "Common7") IF(${CMAKE_MAKE_PROGRAM} MATCHES "Common7")
# convert IDE fullpath to VC++ path # convert IDE fullpath to VC++ path
@ -986,7 +1145,7 @@ MACRO(SETUP_EXTERNAL)
STRING(REGEX REPLACE "VC/bin/.+" "VC" VC_DIR ${CMAKE_CXX_COMPILER}) STRING(REGEX REPLACE "VC/bin/.+" "VC" VC_DIR ${CMAKE_CXX_COMPILER})
ENDIF(${CMAKE_MAKE_PROGRAM} MATCHES "Common7") ENDIF(${CMAKE_MAKE_PROGRAM} MATCHES "Common7")
ENDIF(NOT VC_DIR) ENDIF(NOT VC_DIR)
ENDIF(MSVC10) ENDIF(MSVC11)
ELSE(WIN32) ELSE(WIN32)
IF(APPLE) IF(APPLE)
IF(WITH_STATIC_EXTERNAL) IF(WITH_STATIC_EXTERNAL)
@ -1011,7 +1170,7 @@ MACRO(SETUP_EXTERNAL)
FIND_PACKAGE(WindowsSDK REQUIRED) FIND_PACKAGE(WindowsSDK REQUIRED)
# use VC++ and Windows SDK include paths # use VC++ and Windows SDK include paths
INCLUDE_DIRECTORIES(${VC_INCLUDE_DIR} ${WINSDK_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${VC_INCLUDE_DIR} ${WINSDK_INCLUDE_DIRS})
ENDIF(MSVC) ENDIF(MSVC)
ENDIF(WITH_STLPORT) ENDIF(WITH_STLPORT)
ENDMACRO(SETUP_EXTERNAL) ENDMACRO(SETUP_EXTERNAL)

View file

@ -71,7 +71,7 @@ public:
// For clipTrav. cleared at beginning of CClipTrav::traverse // For clipTrav. cleared at beginning of CClipTrav::traverse
void clearVisibleList(); void clearVisibleList();
// For ClipTrav only. NB: list is cleared at begining of traverse(). NB: only CTransform are supported // For ClipTrav only. NB: list is cleared at begininng of traverse(). NB: only CTransform are supported
void addVisibleModel(CTransform *model) void addVisibleModel(CTransform *model)
{ {
_VisibleList[_CurrentNumVisibleModels]= model; _VisibleList[_CurrentNumVisibleModels]= model;

View file

@ -68,7 +68,7 @@ public:
class CCamera : public CTransform class CCamera : public CTransform
{ {
public: public:
/// Call at the begining of the program, to register the model /// Call at the beginning of the program, to register the model
static void registerBasic(); static void registerBasic();

View file

@ -93,7 +93,7 @@ public:
/// \name Visible List mgt. Those visible models are updated each traverse(). /// \name Visible List mgt. Those visible models are updated each traverse().
//@{ //@{
// NB: list is cleared at begining of traverse(). // NB: list is cleared at beginning of traverse().
void addVisibleModel(CTransform *model) void addVisibleModel(CTransform *model)
{ {
model->_IndexInVisibleList= _CurrentNumVisibleModels; model->_IndexInVisibleList= _CurrentNumVisibleModels;

View file

@ -81,14 +81,14 @@ class IDriver;
class CLandscapeGlobals class CLandscapeGlobals
{ {
public: public:
// LANDSCAPE RENDERING CONTEXT. Landscape must setup it at the begining at refine()/render(). // LANDSCAPE RENDERING CONTEXT. Landscape must setup it at the beginning at refine()/render().
// The current date of LandScape for refine only. // The current date of LandScape for refine only.
static sint CurrentDate; static sint CurrentDate;
// The current date of LandScape for render only. // The current date of LandScape for render only.
static sint CurrentRenderDate; static sint CurrentRenderDate;
// The center view for refinement. // The center view for refinement.
static CVector RefineCenter; static CVector RefineCenter;
// What is the treshold for tessellation. // What is the threshold for tessellation.
static float RefineThreshold; static float RefineThreshold;
// Guess. // Guess.
static float OORefineThreshold; static float OORefineThreshold;
@ -143,7 +143,7 @@ public:
static CLandscapeVBAllocator *CurrentTileVBAllocator; static CLandscapeVBAllocator *CurrentTileVBAllocator;
// PATCH GLOBAL INTERFACE. patch must setup them at the begining at refine()/render(). // PATCH GLOBAL INTERFACE. patch must setup them at the beginning at refine()/render().
// NO!!! REMIND: can't have any patch global, since a propagated split()/updateErrorMetric() // NO!!! REMIND: can't have any patch global, since a propagated split()/updateErrorMetric()
// can arise. must use Patch pointer. // can arise. must use Patch pointer.
@ -158,7 +158,7 @@ public:
// *************************************************************************** // ***************************************************************************
// Out of CLandscapeGlobals, because myabe used in __asm{} // Out of CLandscapeGlobals, because maybe used in __asm{}
extern uint NL3D_LandscapeGlobals_PassNTri; extern uint NL3D_LandscapeGlobals_PassNTri;
extern void *NL3D_LandscapeGlobals_PassTriCurPtr; extern void *NL3D_LandscapeGlobals_PassTriCurPtr;
extern CIndexBuffer::TFormat NL3D_LandscapeGlobals_PassTriFormat; extern CIndexBuffer::TFormat NL3D_LandscapeGlobals_PassTriFormat;

View file

@ -42,7 +42,7 @@ const NLMISC::CClassId LandscapeModelId=NLMISC::CClassId(0x5a573b55, 0x6b395829
class CLandscapeModel : public CTransform class CLandscapeModel : public CTransform
{ {
public: public:
/// Call at the begining of the program, to register the model /// Call at the beginning of the program, to register the model
static void registerBasic(); static void registerBasic();
public: public:

View file

@ -165,7 +165,7 @@ public:
// For clipTrav. cleared at beginning of CClipTrav::traverse // For clipTrav. cleared at beginning of CClipTrav::traverse
void clearVisibleList(); void clearVisibleList();
// For ClipTrav only. NB: list is cleared at begining of traverse(). // For ClipTrav only. NB: list is cleared at beginning of traverse().
void addVisibleModel(CTransform *model) void addVisibleModel(CTransform *model)
{ {
_VisibleList[_CurrentNumVisibleModels]= model; _VisibleList[_CurrentNumVisibleModels]= model;

View file

@ -53,7 +53,7 @@ const NLMISC::CClassId MeshBaseInstanceId=NLMISC::CClassId(0xef44331, 0x739f6bc
class CMeshBaseInstance : public CTransformShape class CMeshBaseInstance : public CTransformShape
{ {
public: public:
/// Call at the begining of the program, to register the model /// Call at the beginning of the program, to register the model
static void registerBasic(); static void registerBasic();
public: public:

View file

@ -49,7 +49,7 @@ const NLMISC::CClassId MeshInstanceId=NLMISC::CClassId(0x6bfe0a34, 0x23b26dc9);
class CMeshInstance : public CMeshBaseInstance class CMeshInstance : public CMeshBaseInstance
{ {
public: public:
/// Call at the begining of the program, to register the model /// Call at the beginning of the program, to register the model
static void registerBasic(); static void registerBasic();
public: public:

View file

@ -49,7 +49,7 @@ const NLMISC::CClassId MeshMRMInstanceId=NLMISC::CClassId(0xec608f3, 0x1111c33)
class CMeshMRMInstance : public CMeshBaseInstance class CMeshMRMInstance : public CMeshBaseInstance
{ {
public: public:
/// Call at the begining of the program, to register the model /// Call at the beginning of the program, to register the model
static void registerBasic(); static void registerBasic();
protected: protected:

View file

@ -49,7 +49,7 @@ const NLMISC::CClassId MeshMRMSkinnedInstanceId=NLMISC::CClassId(0x6cfd2619, 0x
class CMeshMRMSkinnedInstance : public CMeshBaseInstance class CMeshMRMSkinnedInstance : public CMeshBaseInstance
{ {
public: public:
/// Call at the begining of the program, to register the model /// Call at the beginning of the program, to register the model
static void registerBasic(); static void registerBasic();
protected: protected:

View file

@ -61,7 +61,7 @@ public:
Lod0Blend = 0x1, Lod0Blend = 0x1,
}; };
/// Call at the begining of the program, to register the model /// Call at the beginning of the program, to register the model
static void registerBasic(); static void registerBasic();
/// Last Matrix date for Lods /// Last Matrix date for Lods

View file

@ -29,7 +29,7 @@ namespace NL3D {
/** /**
* This vertex program is used to perform perpixel lighting with meshs. Its ouputs are : * This vertex program is used to perform perpixel lighting with meshs. Its outputs are :
* *
* Coord Tex 0 : duplicate the tex Coord 0 set from the v.b. * Coord Tex 0 : duplicate the tex Coord 0 set from the v.b.
* Coord Tex 1 : The light vector in tangent space. * Coord Tex 1 : The light vector in tangent space.

View file

@ -808,7 +808,7 @@ private:
CTessFarVertex BaseFarVertices[4]; CTessFarVertex BaseFarVertices[4];
// Local info for CTessFace tiles. CPatch must setup them at the begining at refine()/render(). // Local info for CTessFace tiles. CPatch must setup them at the beginning at refine()/render().
// For Far Texture coordinates. // For Far Texture coordinates.
float Far0UScale, Far0VScale, Far0UBias, Far0VBias; float Far0UScale, Far0VScale, Far0UBias, Far0VBias;
float Far1UScale, Far1VScale, Far1UBias, Far1VBias; float Far1UScale, Far1VScale, Far1UBias, Far1VBias;

View file

@ -55,7 +55,7 @@ const NLMISC::CClassId PointLightModelId=NLMISC::CClassId(0x7e842eba, 0x140b6c6
class CPointLightModel : public CTransform class CPointLightModel : public CTransform
{ {
public: public:
/// Call at the begining of the program, to register the model /// Call at the beginning of the program, to register the model
static void registerBasic(); static void registerBasic();

View file

@ -29,7 +29,7 @@ namespace NL3D {
/* /*
* In this file, we define several template that helps to create attributes maker such as gradient (of float, int, vector etc) * In this file, we define several template that helps to create attributes maker such as gradient (of float, int, vector etc)
* attributes maker are used in the particle system to generate values, such as size, color etc. see ps_attrib_maker.h * attributes maker are used in the particle system to generate values, such as size, color etc. see ps_attrib_maker.h
* for more informations * for more information
*/ */

View file

@ -55,7 +55,7 @@ const NLMISC::CClassId QuadGridClipManagerId=NLMISC::CClassId(0x1ffb079a, 0x6c5
class CQuadGridClipManager : public CTransform class CQuadGridClipManager : public CTransform
{ {
public: public:
/// Call at the begining of the program, to register the model /// Call at the beginning of the program, to register the model
static void registerBasic(); static void registerBasic();
public: public:

View file

@ -227,7 +227,7 @@ public:
enum {MaxVPLight= 4}; enum {MaxVPLight= 4};
/** reset the lighting setup in the driver (all lights are disabled). /** reset the lighting setup in the driver (all lights are disabled).
* called at begining of traverse(). Must be called by any model (before and after rendering) * called at beginning of traverse(). Must be called by any model (before and after rendering)
* that wish to use CDriver::setLight() instead of the standard behavior with changeLightSetup() * that wish to use CDriver::setLight() instead of the standard behavior with changeLightSetup()
*/ */
void resetLightSetup(); void resetLightSetup();

View file

@ -39,7 +39,7 @@ const NLMISC::CClassId RootModelId=NLMISC::CClassId(0x25f0505d, 0x75c69f9);
class CRootModel : public CTransform class CRootModel : public CTransform
{ {
public: public:
/// Call at the begining of the program, to register the model /// Call at the beginning of the program, to register the model
static void registerBasic(); static void registerBasic();

View file

@ -54,7 +54,7 @@ public:
CSegRemanence(CSegRemanence &other); CSegRemanence(CSegRemanence &other);
CSegRemanence &operator = (CSegRemanence &other); CSegRemanence &operator = (CSegRemanence &other);
//@} //@}
/// Call at the begining of the program, to register the model /// Call at the beginning of the program, to register the model
static void registerBasic(); static void registerBasic();
/// to instanciate that model from a scene /// to instanciate that model from a scene
static CTransform *creator() { return new CSegRemanence; } static CTransform *creator() { return new CSegRemanence; }

View file

@ -79,7 +79,7 @@ public:
/// max number of bones supported in skeleton /// max number of bones supported in skeleton
enum { MaxNumBones = 256 }; enum { MaxNumBones = 256 };
/// Call at the begining of the program, to register the model /// Call at the beginning of the program, to register the model
static void registerBasic(); static void registerBasic();
public: public:

View file

@ -90,7 +90,7 @@ const NLMISC::CClassId TransformId=NLMISC::CClassId(0x174750cb, 0xf952024);
class CTransform : public ITransformable class CTransform : public ITransformable
{ {
public: public:
/// Call at the begining of the program, to register the model /// Call at the beginning of the program, to register the model
static void registerBasic(); static void registerBasic();
/// get the scene which has created us /// get the scene which has created us
@ -113,7 +113,7 @@ public:
/** /**
* Extra init for a model. this method is called by the framework at the very end of CScene::createModel() * Extra init for a model. this method is called by the framework at the very end of CScene::createModel()
* Warning! if the model is a CTransformShape, then when initModel() is called, Shape and other related member/setup * Warning! if the model is a CTransformShape, then when initModel() is called, Shape and other related member/setup
* of IShape::createInstance() are not yet done (because createModel() is called at the begining in createInstance()). * of IShape::createInstance() are not yet done (because createModel() is called at the beginning in createInstance()).
* *
* Because initModel() is called at the very end, deriver could implement anything like creating other models, * Because initModel() is called at the very end, deriver could implement anything like creating other models,
* but not deleting this model... * but not deleting this model...

View file

@ -55,7 +55,7 @@ const NLMISC::CClassId TransformShapeId=NLMISC::CClassId(0x1e6115e6, 0x63502517
class CTransformShape : public CTransform class CTransformShape : public CTransform
{ {
public: public:
/// Call at the begining of the program, to register the model /// Call at the beginning of the program, to register the model
static void registerBasic(); static void registerBasic();
public: public:

View file

@ -48,7 +48,7 @@ const NLMISC::CClassId VegetableBlendLayerModelId=NLMISC::CClassId(0x77375163,
class CVegetableBlendLayerModel : public CTransform class CVegetableBlendLayerModel : public CTransform
{ {
public: public:
/// Call at the begining of the program, to register the model /// Call at the beginning of the program, to register the model
static void registerBasic(); static void registerBasic();
public: public:

View file

@ -188,7 +188,7 @@ public:
* \warning: Only syntax is checked. It doesn't check that a register has been initialised before use. * \warning: Only syntax is checked. It doesn't check that a register has been initialised before use.
* \param src The input text of a vertex program, in OpenGL format. * \param src The input text of a vertex program, in OpenGL format.
* \param result The result program. * \param result The result program.
* \param errorOuput If parsing failed, contains the reason * \param errorOutput If parsing failed, contains the reason
* \result true if the parsing succeeded * \result true if the parsing succeeded
*/ */
bool parse(const char *src, TProgram &result, std::string &errorOutput); bool parse(const char *src, TProgram &result, std::string &errorOutput);

View file

@ -19,6 +19,9 @@
#include "nel/misc/types_nl.h" #include "nel/misc/types_nl.h"
// Include from libxml2
#include <libxml/parser.h>
namespace NLGEORGES namespace NLGEORGES
{ {

View file

@ -59,9 +59,12 @@ namespace NLGUI
void setText(uint i, const ucstring &text); void setText(uint i, const ucstring &text);
void insertText(uint i, const ucstring &text); void insertText(uint i, const ucstring &text);
const ucstring &getText(uint i) const; const ucstring &getText(uint i) const;
const uint &getTextId(uint i) const;
uint getTextPos(uint nId) const;
const ucstring &getTexture(uint i) const; const ucstring &getTexture(uint i) const;
void removeText(uint i); void removeText(uint nPos);
uint getNumTexts() const {return (uint)_Texts.size();} uint getNumTexts() const {return (uint)_Texts.size();}
void sortText();
// selection // selection
void setSelection(sint32 val); void setSelection(sint32 val);
@ -126,7 +129,7 @@ namespace NLGUI
// sint32 // sint32
CInterfaceProperty _Selection; CInterfaceProperty _Selection;
sint32 _NotLinkedToDBSelection; sint32 _NotLinkedToDBSelection;
std::vector<ucstring> _Texts; std::vector<std::pair<uint, ucstring> > _Texts;
std::vector<ucstring> _Textures; std::vector<ucstring> _Textures;
// Action Handler called on combo click // Action Handler called on combo click

View file

@ -19,6 +19,7 @@
#include "types_nl.h" #include "types_nl.h"
#include "tds.h" #include "tds.h"
#include "singleton.h"
namespace NLMISC { namespace NLMISC {

View file

@ -17,6 +17,7 @@
#ifndef NL_CONTIGUOUS_BLOCK_ALLOCATOR_H #ifndef NL_CONTIGUOUS_BLOCK_ALLOCATOR_H
#define NL_CONTIGUOUS_BLOCK_ALLOCATOR_H #define NL_CONTIGUOUS_BLOCK_ALLOCATOR_H
#include "types_nl.h"
namespace NLMISC namespace NLMISC
{ {

View file

@ -17,14 +17,14 @@
#ifndef NL_DEBUG_H #ifndef NL_DEBUG_H
#define NL_DEBUG_H #define NL_DEBUG_H
#include <cstdio>
#include "common.h" #include "common.h"
#include "log.h" #include "log.h"
#include "mutex.h" #include "mutex.h"
#include "mem_displayer.h" #include "mem_displayer.h"
#include "displayer.h" #include "displayer.h"
#include "app_context.h" #include "app_context.h"
#include <cstdio>
#include <set> #include <set>
namespace NLMISC namespace NLMISC
@ -169,7 +169,7 @@ void setCrashAlreadyReported(bool state);
*\endcode *\endcode
*/ */
#ifdef NL_NO_DEBUG #ifdef NL_NO_DEBUG
# if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) # if defined(NL_COMP_VC) && NL_COMP_VC_VERSION >= 71
# define nldebug __noop # define nldebug __noop
# else # else
# define nldebug 0&& # define nldebug 0&&
@ -184,7 +184,7 @@ void setCrashAlreadyReported(bool state);
* Same as nldebug but it will be display in debug and in release mode. * Same as nldebug but it will be display in debug and in release mode.
*/ */
#ifdef NL_NO_DEBUG #ifdef NL_NO_DEBUG
# if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) # if defined(NL_COMP_VC) && NL_COMP_VC_VERSION >= 71
# define nlinfo __noop # define nlinfo __noop
# else # else
# define nlinfo 0&& # define nlinfo 0&&
@ -212,7 +212,7 @@ void setCrashAlreadyReported(bool state);
*/ */
#ifdef NL_NO_DEBUG #ifdef NL_NO_DEBUG
# if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) # if defined(NL_COMP_VC) && NL_COMP_VC_VERSION >= 71
# define nlwarning __noop # define nlwarning __noop
# else # else
# define nlwarning 0&& # define nlwarning 0&&
@ -478,7 +478,7 @@ do { \
#endif // NL_NO_DEBUG #endif // NL_NO_DEBUG
#define nlunreferenced(identifier) (identifier) #define nlunreferenced(identifier) (void)identifier
#define nlstop \ #define nlstop \
do { \ do { \

View file

@ -17,6 +17,7 @@
#ifndef NL_FILE_H #ifndef NL_FILE_H
#define NL_FILE_H #define NL_FILE_H
#include "types_nl.h"
#include "stream.h" #include "stream.h"

View file

@ -17,6 +17,7 @@
#ifndef NL_FIXED_SIZE_ALLOCATOR_H #ifndef NL_FIXED_SIZE_ALLOCATOR_H
#define NL_FIXED_SIZE_ALLOCATOR_H #define NL_FIXED_SIZE_ALLOCATOR_H
#include "types_nl.h"
namespace NLMISC namespace NLMISC
{ {

View file

@ -17,6 +17,8 @@
#ifndef _GRID_TRAVERSAL_H #ifndef _GRID_TRAVERSAL_H
#define _GRID_TRAVERSAL_H #define _GRID_TRAVERSAL_H
#include "types_nl.h"
namespace NLMISC namespace NLMISC
{ {

View file

@ -19,7 +19,7 @@
#include "types_nl.h" #include "types_nl.h"
#include "game_device.h" #include "game_device.h"
#include "common.h"
namespace NLMISC namespace NLMISC
{ {

View file

@ -17,6 +17,7 @@
#ifndef RY_INTER_WINDOW_MSG_QUEUE_H #ifndef RY_INTER_WINDOW_MSG_QUEUE_H
#define RY_INTER_WINDOW_MSG_QUEUE_H #define RY_INTER_WINDOW_MSG_QUEUE_H
#include "types_nl.h"
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS

View file

@ -586,7 +586,7 @@ extern uint32 NbMutexes;
/** /**
* This class ensure that the Value is accessed by only one thread. First you have to create a CSynchronized class with you type. * This class ensure that the Value is accessed by only one thread. First you have to create a CSynchronized class with your type.
* Then, if a thread want to modify or do anything on it, you create a CAccessor in a \b sub \b scope. You can modify the value * Then, if a thread want to modify or do anything on it, you create a CAccessor in a \b sub \b scope. You can modify the value
* of the CUnfairSynchronized using the value() function \b until the end of the scope. So you have to put the smaller scope as you can. * of the CUnfairSynchronized using the value() function \b until the end of the scope. So you have to put the smaller scope as you can.
* *

View file

@ -17,6 +17,7 @@
#ifndef NL_OBJECT_ARENA_ALLOCATOR_H #ifndef NL_OBJECT_ARENA_ALLOCATOR_H
#define NL_OBJECT_ARENA_ALLOCATOR_H #define NL_OBJECT_ARENA_ALLOCATOR_H
#include "types_nl.h"
#include "singleton.h" #include "singleton.h"
namespace NLMISC namespace NLMISC

View file

@ -17,9 +17,10 @@
#ifndef NL_P_THREAD_H #ifndef NL_P_THREAD_H
#define NL_P_THREAD_H #define NL_P_THREAD_H
#include "types_nl.h"
#ifdef NL_OS_UNIX #ifdef NL_OS_UNIX
#include "types_nl.h"
#include "thread.h" #include "thread.h"
#include <pthread.h> #include <pthread.h>

View file

@ -19,14 +19,13 @@
#include "types_nl.h" #include "types_nl.h"
#include "time_nl.h" #include "time_nl.h"
#include "common.h"
#include "string_mapper.h"
#include <map> #include <map>
#include <string> #include <string>
#include <vector> #include <vector>
#include "common.h"
#include "string_mapper.h"
namespace NLMISC { namespace NLMISC {
/// Exception throw when a find is not found in a lookup() call /// Exception throw when a find is not found in a lookup() call

View file

@ -21,6 +21,7 @@
#include "matrix.h" #include "matrix.h"
#include "stream.h" #include "stream.h"
#include "vector_2f.h" #include "vector_2f.h"
#include <vector> #include <vector>

View file

@ -18,6 +18,7 @@
#define NL_POOL_MEMORY_H #define NL_POOL_MEMORY_H
#include "types_nl.h" #include "types_nl.h"
#include <list> #include <list>
#include <vector> #include <vector>

View file

@ -20,6 +20,7 @@
#include "types_nl.h" #include "types_nl.h"
#include "vector.h" #include "vector.h"
#include "stream.h" #include "stream.h"
#include <cmath> #include <cmath>
namespace NLMISC namespace NLMISC
@ -232,8 +233,8 @@ inline bool CQuatT<T>::equal(const CQuatT<T>& a, float epsilon) const
template <class T> template <class T>
inline CQuatT<T> CQuatT<T>::operator*(const CQuatT<T>& o) const inline CQuatT<T> CQuatT<T>::operator*(const CQuatT<T>& o) const
{ {
// wres= ww´ - v·v´ // wres= ww' - v.v'
// vres= wv´ + w´v + v^v´ ] // vres= wv' + w'v + v^v' ]
return CQuatT<T>( return CQuatT<T>(
(w*o.x) +(x*o.w) + (y*o.z)-(z*o.y), (w*o.x) +(x*o.w) + (y*o.z)-(z*o.y),
(w*o.y) +(y*o.w) + (z*o.x)-(x*o.z), (w*o.y) +(y*o.w) + (z*o.x)-(x*o.z),

View file

@ -18,6 +18,8 @@
#ifndef NL_RESOURCE_PTR_INLINE_H #ifndef NL_RESOURCE_PTR_INLINE_H
#define NL_RESOURCE_PTR_INLINE_H #define NL_RESOURCE_PTR_INLINE_H
#include "types_nl.h"
namespace NLMISC namespace NLMISC
{ {

View file

@ -17,11 +17,11 @@
#ifndef NL_RGBA_H #ifndef NL_RGBA_H
#define NL_RGBA_H #define NL_RGBA_H
#include <algorithm>
#include "types_nl.h" #include "types_nl.h"
#include "common.h" #include "common.h"
#include <algorithm>
namespace NLMISC namespace NLMISC
{ {

View file

@ -17,11 +17,12 @@
#ifndef NL_SHA1_H #ifndef NL_SHA1_H
#define NL_SHA1_H #define NL_SHA1_H
#include <string> #include "types_nl.h"
#include "common.h" #include "common.h"
#include "stream.h" #include "stream.h"
#include <string>
struct CHashKey struct CHashKey
{ {
CHashKey () { HashKeyString.resize(20); } CHashKey () { HashKeyString.resize(20); }

View file

@ -352,7 +352,7 @@ public:
} }
}; };
#if defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) #if defined(NL_COMP_VC) && NL_COMP_VC_VERSION >= 80
// This operator only purpose is to compare with NULL value // This operator only purpose is to compare with NULL value
template <class T> template <class T>

View file

@ -18,6 +18,8 @@
#ifndef NL_SMARTPTR_INLINE_H #ifndef NL_SMARTPTR_INLINE_H
#define NL_SMARTPTR_INLINE_H #define NL_SMARTPTR_INLINE_H
#include "types_nl.h"
namespace NLMISC namespace NLMISC
{ {

View file

@ -44,7 +44,7 @@ namespace NLMISC {
* will assert when allocations will occur). * will assert when allocations will occur).
* *
* To construct a container which use this allocator, do like this: * To construct a container which use this allocator, do like this:
* list<uint, CSTLBlockAllocator<uint>> myList( ptrOnBlockMemory ); * list<uint, CSTLBlockAllocator<uint> > myList( ptrOnBlockMemory );
* *
* But see CSTLBlockList for easier list instanciation, because using it, you'll do like this: * But see CSTLBlockList for easier list instanciation, because using it, you'll do like this:
* CSTLBlockList<uint> myList(ptrOnBlockMemory); * CSTLBlockList<uint> myList(ptrOnBlockMemory);

View file

@ -19,6 +19,7 @@
#include "types_nl.h" #include "types_nl.h"
#include "stl_block_allocator.h" #include "stl_block_allocator.h"
#include <list> #include <list>

View file

@ -19,6 +19,7 @@
#include "types_nl.h" #include "types_nl.h"
#include "time_nl.h" #include "time_nl.h"
#include <deque> #include <deque>

View file

@ -21,6 +21,7 @@
#include "ucstring.h" #include "ucstring.h"
#include "class_registry.h" #include "class_registry.h"
#include "common.h" #include "common.h"
#include <utility> #include <utility>
#include <string> #include <string>
#include <vector> #include <vector>

View file

@ -17,10 +17,11 @@
#ifndef NL_STREAM_INLINE_H #ifndef NL_STREAM_INLINE_H
#define NL_STREAM_INLINE_H #define NL_STREAM_INLINE_H
#include <cstdio> #include "types_nl.h"
#include "debug.h" #include "debug.h"
#include <cstdio>
namespace NLMISC namespace NLMISC
{ {

View file

@ -19,6 +19,7 @@
#include "types_nl.h" #include "types_nl.h"
#include "common.h" #include "common.h"
#include <map> #include <map>
namespace NLMISC namespace NLMISC

View file

@ -18,6 +18,7 @@
#define NL_STRING_ID_ARRAY_H #define NL_STRING_ID_ARRAY_H
#include "types_nl.h" #include "types_nl.h"
#include "debug.h"
#include <cmath> #include <cmath>
#include <string> #include <string>
@ -25,8 +26,6 @@
#include <set> #include <set>
#include <algorithm> #include <algorithm>
#include "debug.h"
namespace NLMISC { namespace NLMISC {

View file

@ -18,13 +18,12 @@
#define STRING_MAPPER_H #define STRING_MAPPER_H
#include "types_nl.h" #include "types_nl.h"
#include "stream.h"
#include "mutex.h"
#include <vector> #include <vector>
#include <set> #include <set>
#include "stream.h"
#include "mutex.h"
namespace NLMISC namespace NLMISC
{ {

View file

@ -51,12 +51,20 @@
# ifndef _WIN32_WINNT # ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x0500 // Minimal OS = Windows 2000 (NeL is not supported on Windows 95/98) # define _WIN32_WINNT 0x0500 // Minimal OS = Windows 2000 (NeL is not supported on Windows 95/98)
# endif # endif
# if _MSC_VER >= 1600 # ifdef _MSC_VER
# define NL_COMP_VC
# if _MSC_VER >= 1700
# define NL_COMP_VC11
# define NL_COMP_VC_VERSION 110
# elif _MSC_VER >= 1600
# define NL_COMP_VC10 # define NL_COMP_VC10
# define NL_COMP_VC_VERSION 100
# elif _MSC_VER >= 1500 # elif _MSC_VER >= 1500
# define NL_COMP_VC9 # define NL_COMP_VC9
# define NL_COMP_VC_VERSION 90
# elif _MSC_VER >= 1400 # elif _MSC_VER >= 1400
# define NL_COMP_VC8 # define NL_COMP_VC8
# define NL_COMP_VC_VERSION 80
# undef nl_time # undef nl_time
# define nl_time _time32 // use the old 32 bit time function # define nl_time _time32 // use the old 32 bit time function
# undef nl_mktime # undef nl_mktime
@ -69,12 +77,16 @@
# define nl_difftime _difftime32 // use the old 32 bit time function # define nl_difftime _difftime32 // use the old 32 bit time function
# elif _MSC_VER >= 1310 # elif _MSC_VER >= 1310
# define NL_COMP_VC71 # define NL_COMP_VC71
# define NL_COMP_VC_VERSION 71
# elif _MSC_VER >= 1300 # elif _MSC_VER >= 1300
# define NL_COMP_VC7 # define NL_COMP_VC7
# define NL_COMP_VC_VERSION 70
# elif _MSC_VER >= 1200 # elif _MSC_VER >= 1200
# define NL_COMP_VC6 # define NL_COMP_VC6
# define NL_COMP_VC_VERSION 60
# define NL_COMP_NEED_PARAM_ON_METHOD # define NL_COMP_NEED_PARAM_ON_METHOD
# endif # endif
# endif
# if defined(_HAS_TR1) && (_HAS_TR1 + 0) // VC9 TR1 feature pack or later # if defined(_HAS_TR1) && (_HAS_TR1 + 0) // VC9 TR1 feature pack or later
# define NL_ISO_STDTR1_AVAILABLE # define NL_ISO_STDTR1_AVAILABLE
# define NL_ISO_STDTR1_HEADER(header) <header> # define NL_ISO_STDTR1_HEADER(header) <header>
@ -320,7 +332,7 @@ typedef unsigned int uint; // at least 32bits (depend of processor)
# define CHashMap std::tr1::unordered_map # define CHashMap std::tr1::unordered_map
# define CHashSet std::tr1::unordered_set # define CHashSet std::tr1::unordered_set
# define CHashMultiMap std::tr1::unordered_multimap # define CHashMultiMap std::tr1::unordered_multimap
#elif defined(NL_COMP_VC7) || defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) // VC7 through 9 #elif defined(NL_COMP_VC) && (NL_COMP_VC_VERSION >= 70 && NL_COMP_VC_VERSION <= 90) // VC7 through 9
# include <hash_map> # include <hash_map>
# include <hash_set> # include <hash_set>
# define CHashMap stdext::hash_map # define CHashMap stdext::hash_map
@ -366,7 +378,7 @@ typedef uint16 ucchar;
// To define a 64bits constant; ie: UINT64_CONSTANT(0x123456781234) // To define a 64bits constant; ie: UINT64_CONSTANT(0x123456781234)
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
# if defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) # if defined(NL_COMP_VC) && (NL_COMP_VC_VERSION >= 80)
# define INT64_CONSTANT(c) (c##LL) # define INT64_CONSTANT(c) (c##LL)
# define SINT64_CONSTANT(c) (c##LL) # define SINT64_CONSTANT(c) (c##LL)
# define UINT64_CONSTANT(c) (c##LL) # define UINT64_CONSTANT(c) (c##LL)

View file

@ -17,6 +17,7 @@
#ifndef NL_WIN32_UTIL_H #ifndef NL_WIN32_UTIL_H
#define NL_WIN32_UTIL_H #define NL_WIN32_UTIL_H
#include "types_nl.h"
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS

View file

@ -69,7 +69,7 @@ namespace NLMISC
* return true and advance the it iterator if match is found. * return true and advance the it iterator if match is found.
*/ */
bool matchString(std::string::iterator &it, std::string::iterator end, const char *text); bool matchString(std::string::iterator &it, std::string::iterator end, const char *text);
/// Advance up to the begining of the next line, incrementing the in/out param lineCount /// Advance up to the beginning of the next line, incrementing the in/out param lineCount
void skipLine(std::string::iterator &it, std::string::iterator end, uint32 &lineCount); void skipLine(std::string::iterator &it, std::string::iterator end, uint32 &lineCount);
///@} ///@}

View file

@ -5,7 +5,7 @@
# nel-config # nel-config
# #
# Script printing NeL's install library/include paths and some other # Script printing NeL's install library/include paths and some other
# informations like NeL's version # information like NeL's version
# #
prefix=@prefix@ prefix=@prefix@

View file

@ -12,7 +12,7 @@ This sample show:
- Managing several dynamic world image - Managing several dynamic world image
- Moving PACS primitives - Moving PACS primitives
- Managing collisions - Managing collisions
- Get triggered informations by collisions (flashes) - Get triggered information by collisions (flashes)
---------------- ----------------

View file

@ -640,7 +640,7 @@ public:
void *lock (uint size, uint stride, uint &offset); void *lock (uint size, uint stride, uint &offset);
void unlock (); void unlock ();
// Runtime reset (called at the begining of the frame rendering), blocking lock here. // Runtime reset (called at the beginning of the frame rendering), blocking lock here.
void reset (); void reset ();
}; };
@ -670,7 +670,7 @@ public:
void *lock (uint size, uint &offset); void *lock (uint size, uint &offset);
void unlock (); void unlock ();
// Runtime reset (called at the begining of the frame rendering), blocking lock here. // Runtime reset (called at the beginning of the frame rendering), blocking lock here.
void reset (); void reset ();
}; };

View file

@ -355,8 +355,8 @@ bool CDriverD3D::activeShader(CShader *shd)
// Assemble the shader // Assemble the shader
LPD3DXBUFFER pErrorMsgs; LPD3DXBUFFER pErrorMsgs;
if (D3DXCreateEffect(_DeviceInterface, shd->getText(), (UINT)strlen(shd->getText())+1, NULL, NULL, 0, NULL, &(shaderInfo->Effect), &pErrorMsgs) HRESULT hr = D3DXCreateEffect(_DeviceInterface, shd->getText(), (UINT)strlen(shd->getText())+1, NULL, NULL, 0, NULL, &(shaderInfo->Effect), &pErrorMsgs);
== D3D_OK) if (hr == D3D_OK)
{ {
// Get the texture handle // Get the texture handle
uint i; uint i;
@ -374,7 +374,7 @@ bool CDriverD3D::activeShader(CShader *shd)
} }
else else
{ {
nlwarning ("Can't create shader '%s':", shd->getName()); nlwarning ("Can't create shader '%s' (0x%x):", shd->getName(), hr);
if (pErrorMsgs) if (pErrorMsgs)
nlwarning ((const char*)pErrorMsgs->GetBufferPointer()); nlwarning ((const char*)pErrorMsgs->GetBufferPointer());
shd->_ShaderChanged = false; shd->_ShaderChanged = false;

View file

@ -27,7 +27,7 @@ ENDIF(WIN32)
NL_TARGET_DRIVER(${NLDRV_OGL_LIB} ${SRC}) NL_TARGET_DRIVER(${NLDRV_OGL_LIB} ${SRC})
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} nel3d nelmisc ${OPENGL_gl_LIBRARY}) TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} nel3d nelmisc ${OPENGL_gl_LIBRARY})
NL_DEFAULT_PROPS(${NLDRV_OGL_LIB} "NeL, Driver, Video: OpenGL") NL_DEFAULT_PROPS(${NLDRV_OGL_LIB} "NeL, Driver, Video: OpenGL")

View file

@ -34,8 +34,8 @@ extern "C" {
/* Header file version number */ /* Header file version number */
/* Current version at http://www.khronos.org/registry/egl/ */ /* Current version at http://www.khronos.org/registry/egl/ */
/* $Revision: 17614 $ on $Date: 2012-04-26 06:56:02 -0700 (Thu, 26 Apr 2012) $ */ /* $Revision: 19332 $ on $Date: 2012-09-28 17:56:20 -0700 (Fri, 28 Sep 2012) $ */
#define EGL_EGLEXT_VERSION 12 #define EGL_EGLEXT_VERSION 14
#ifndef EGL_KHR_config_attribs #ifndef EGL_KHR_config_attribs
#define EGL_KHR_config_attribs 1 #define EGL_KHR_config_attribs 1
@ -293,6 +293,25 @@ EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface sur
typedef EGLBoolean (EGLAPIENTRYP PFNEGLPOSTSUBBUFFERNVPROC) (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height); typedef EGLBoolean (EGLAPIENTRYP PFNEGLPOSTSUBBUFFERNVPROC) (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height);
#endif #endif
#ifndef EGL_ANDROID_image_native_buffer
#define EGL_ANDROID_image_native_buffer 1
struct ANativeWindowBuffer;
#define EGL_NATIVE_BUFFER_ANDROID 0x3140 /* eglCreateImageKHR target */
#endif
#ifndef EGL_ANDROID_swap_rectangle
#define EGL_ANDROID_swap_rectangle 1
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglSetSwapRectangleANDROID (EGLDisplay dpy, EGLSurface draw, EGLint left, EGLint top, EGLint width, EGLint height);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETSWAPRECTANGLEANDROIDPROC) (EGLDisplay dpy, EGLSurface draw, EGLint left, EGLint top, EGLint width, EGLint height);
#endif
#ifndef EGL_ANDROID_recordable
#define EGL_ANDROID_recordable 1
#define EGL_RECORDABLE_ANDROID 0x3142 /* EGLConfig attribute */
#endif
#ifndef EGL_ANGLE_query_surface_pointer #ifndef EGL_ANGLE_query_surface_pointer
#define EGL_ANGLE_query_surface_pointer 1 #define EGL_ANGLE_query_surface_pointer 1
#ifdef EGL_EGLEXT_PROTOTYPES #ifdef EGL_EGLEXT_PROTOTYPES
@ -351,13 +370,13 @@ EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamKHR(EGLDisplay dpy, const EGLint
EGLAPI EGLBoolean EGLAPIENTRY eglDestroyStreamKHR(EGLDisplay dpy, EGLStreamKHR stream); EGLAPI EGLBoolean EGLAPIENTRY eglDestroyStreamKHR(EGLDisplay dpy, EGLStreamKHR stream);
EGLAPI EGLBoolean EGLAPIENTRY eglStreamAttribKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value); EGLAPI EGLBoolean EGLAPIENTRY eglStreamAttribKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value);
EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value); EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value);
EGLAPI EGLBoolean EGLAPIENTRY eglQueryStream64KHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value); EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamu64KHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value);
#endif /* EGL_EGLEXT_PROTOTYPES */ #endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMKHRPROC)(EGLDisplay dpy, const EGLint *attrib_list); typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMKHRPROC)(EGLDisplay dpy, const EGLint *attrib_list);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSTREAMKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream); typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSTREAMKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMATTRIBKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value); typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMATTRIBKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value); typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAM64KHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value); typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMU64KHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value);
#endif #endif
#endif #endif
@ -421,6 +440,47 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMTIMEKHRPROC)(EGLDisplay dpy, E
/* reuse EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE */ /* reuse EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE */
#endif #endif
#ifndef EGL_KHR_create_context
#define EGL_KHR_create_context 1
#define EGL_CONTEXT_MAJOR_VERSION_KHR EGL_CONTEXT_CLIENT_VERSION
#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB
#define EGL_CONTEXT_FLAGS_KHR 0x30FC
#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD
#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD
#define EGL_NO_RESET_NOTIFICATION_KHR 0x31BE
#define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF
#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001
#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002
#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004
#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001
#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002
#define EGL_OPENGL_ES3_BIT_KHR 0x00000040
#endif
#ifndef EGL_KHR_surfaceless_context
#define EGL_KHR_surfaceless_context 1
/* No tokens/entry points, just relaxes an error condition */
#endif
#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
#ifndef EGL_KHR_stream_cross_process_fd
#define EGL_KHR_stream_cross_process_fd 1
typedef int EGLNativeFileDescriptorKHR;
#define EGL_NO_FILE_DESCRIPTOR_KHR ((EGLNativeFileDescriptorKHR)(-1))
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLNativeFileDescriptorKHR EGLAPIENTRY eglGetStreamFileDescriptorKHR(EGLDisplay dpy, EGLStreamKHR stream);
EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamFromFileDescriptorKHR(EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLNativeFileDescriptorKHR (EGLAPIENTRYP PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC)(EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor);
#endif
#endif
#ifndef EGL_EXT_multiview_window
#define EGL_EXT_multiview_window 1
#define EGL_MULTIVIEW_VIEW_COUNT_EXT 0x3134
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

File diff suppressed because it is too large Load diff

View file

@ -444,6 +444,10 @@ extern "C" {
#define GLX_LATE_SWAPS_TEAR_EXT 0x20F3 #define GLX_LATE_SWAPS_TEAR_EXT 0x20F3
#endif #endif
#ifndef GLX_EXT_buffer_age
#define GLX_BACK_BUFFER_AGE_EXT 0x20F4
#endif
/*************************************************************/ /*************************************************************/
@ -993,6 +997,10 @@ typedef void ( * PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx,
#define GLX_EXT_swap_control_tear 1 #define GLX_EXT_swap_control_tear 1
#endif #endif
#ifndef GLX_EXT_buffer_age
#define GLX_EXT_buffer_age 1
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -1,7 +1,7 @@
#ifndef __glext_h_ #ifndef __glext_h_
#define __glext_h_ #define __glext_h_
/* $Revision: 16481 $ on $Date:: 2012-01-04 10:43:56 -0800 #$ */ /* $Revision: 19260 $ on $Date:: 2012-09-20 11:30:36 -0700 #$ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -165,6 +165,9 @@ typedef void* GLeglImageOES;
#define GL_DEPTH24_STENCIL8_OES 0x88F0 #define GL_DEPTH24_STENCIL8_OES 0x88F0
#endif #endif
/* GL_OES_required_internalformat */
/* No new tokens introduced by this extension. */
/* GL_OES_rgb8_rgba8 */ /* GL_OES_rgb8_rgba8 */
#ifndef GL_OES_rgb8_rgba8 #ifndef GL_OES_rgb8_rgba8
#define GL_RGB8_OES 0x8051 #define GL_RGB8_OES 0x8051
@ -240,7 +243,7 @@ typedef void* GLeglImageOES;
* APPLE extension tokens * APPLE extension tokens
*------------------------------------------------------------------------*/ *------------------------------------------------------------------------*/
/* GL_APPLE_texture_2D_limited_npot */ /* GL_APPLE_copy_texture_levels */
/* No new tokens introduced by this extension. */ /* No new tokens introduced by this extension. */
/* GL_APPLE_framebuffer_multisample */ /* GL_APPLE_framebuffer_multisample */
@ -254,6 +257,41 @@ typedef void* GLeglImageOES;
#define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA #define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA
#endif #endif
/* GL_APPLE_sync */
#ifndef GL_APPLE_sync
/* These types are defined with reference to <inttypes.h>
* in the Apple extension spec, but here we use the Khronos
* portable types in khrplatform.h, and assume those types
* are always defined.
* If any other extensions using these types are defined,
* the typedefs must move out of this block and be shared.
*/
typedef khronos_int64_t GLint64;
typedef khronos_uint64_t GLuint64;
typedef struct __GLsync *GLsync;
#define GL_SYNC_OBJECT_APPLE 0x8A53
#define GL_MAX_SERVER_WAIT_TIMEOUT_APPLE 0x9111
#define GL_OBJECT_TYPE_APPLE 0x9112
#define GL_SYNC_CONDITION_APPLE 0x9113
#define GL_SYNC_STATUS_APPLE 0x9114
#define GL_SYNC_FLAGS_APPLE 0x9115
#define GL_SYNC_FENCE_APPLE 0x9116
#define GL_SYNC_GPU_COMMANDS_COMPLETE_APPLE 0x9117
#define GL_UNSIGNALED_APPLE 0x9118
#define GL_SIGNALED_APPLE 0x9119
#define GL_ALREADY_SIGNALED_APPLE 0x911A
#define GL_TIMEOUT_EXPIRED_APPLE 0x911B
#define GL_CONDITION_SATISFIED_APPLE 0x911C
#define GL_WAIT_FAILED_APPLE 0x911D
#define GL_SYNC_FLUSH_COMMANDS_BIT_APPLE 0x00000001
#define GL_TIMEOUT_IGNORED_APPLE 0xFFFFFFFFFFFFFFFFull
#endif
/* GL_APPLE_texture_2D_limited_npot */
/* No new tokens introduced by this extension. */
/* GL_APPLE_texture_format_BGRA8888 */ /* GL_APPLE_texture_format_BGRA8888 */
#ifndef GL_APPLE_texture_format_BGRA8888 #ifndef GL_APPLE_texture_format_BGRA8888
#define GL_BGRA_EXT 0x80E1 #define GL_BGRA_EXT 0x80E1
@ -288,12 +326,23 @@ typedef void* GLeglImageOES;
#define GL_STENCIL_EXT 0x1802 #define GL_STENCIL_EXT 0x1802
#endif #endif
/* GL_EXT_map_buffer_range */
#ifndef GL_EXT_map_buffer_range
#define GL_MAP_READ_BIT_EXT 0x0001
#define GL_MAP_WRITE_BIT_EXT 0x0002
#define GL_MAP_INVALIDATE_RANGE_BIT_EXT 0x0004
#define GL_MAP_INVALIDATE_BUFFER_BIT_EXT 0x0008
#define GL_MAP_FLUSH_EXPLICIT_BIT_EXT 0x0010
#define GL_MAP_UNSYNCHRONIZED_BIT_EXT 0x0020
#endif
/* GL_EXT_multisampled_render_to_texture */ /* GL_EXT_multisampled_render_to_texture */
#ifndef GL_EXT_multisampled_render_to_texture #ifndef GL_EXT_multisampled_render_to_texture
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C
#define GL_RENDERBUFFER_SAMPLES_EXT 0x9133 /* reuse values from GL_EXT_framebuffer_multisample (desktop extension) */
#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x9134 #define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB
#define GL_MAX_SAMPLES_EXT 0x9135 #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56
#define GL_MAX_SAMPLES_EXT 0x8D57
#endif #endif
/* GL_EXT_multi_draw_arrays */ /* GL_EXT_multi_draw_arrays */
@ -771,6 +820,11 @@ typedef void (GL_APIENTRYP PFNGLWEIGHTPOINTEROESPROC) (GLint size, GLenum type,
#define GL_OES_packed_depth_stencil 1 #define GL_OES_packed_depth_stencil 1
#endif #endif
/* GL_OES_required_internalformat */
#ifndef GL_OES_required_internalformat
#define GL_OES_required_internalformat 1
#endif
/* GL_OES_query_matrix */ /* GL_OES_query_matrix */
#ifndef GL_OES_query_matrix #ifndef GL_OES_query_matrix
#define GL_OES_query_matrix 1 #define GL_OES_query_matrix 1
@ -892,9 +946,13 @@ typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array);
* APPLE extension functions * APPLE extension functions
*------------------------------------------------------------------------*/ *------------------------------------------------------------------------*/
/* GL_APPLE_texture_2D_limited_npot */ /* GL_APPLE_copy_texture_levels */
#ifndef GL_APPLE_texture_2D_limited_npot #ifndef GL_APPLE_copy_texture_levels
#define GL_APPLE_texture_2D_limited_npot 1 #define GL_APPLE_copy_texture_levels 1
#ifdef GL_GLEXT_PROTOTYPES
GL_API void GL_APIENTRY glCopyTextureLevelsAPPLE (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount);
#endif
typedef void (GL_APIENTRYP PFNGLCOPYTEXTURELEVELSAPPLEPROC) (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount);
#endif #endif
/* GL_APPLE_framebuffer_multisample */ /* GL_APPLE_framebuffer_multisample */
@ -908,6 +966,32 @@ typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum
typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void); typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void);
#endif #endif
/* GL_APPLE_sync */
#ifndef GL_APPLE_sync
#define GL_APPLE_sync 1
#ifdef GL_GLEXT_PROTOTYPES
GL_API GLsync GL_APIENTRY glFenceSyncAPPLE (GLenum condition, GLbitfield flags);
GL_API GLboolean GL_APIENTRY glIsSyncAPPLE (GLsync sync);
GL_API void GL_APIENTRY glDeleteSyncAPPLE (GLsync sync);
GL_API GLenum GL_APIENTRY glClientWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout);
GL_API void GL_APIENTRY glWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout);
GL_API void GL_APIENTRY glGetInteger64vAPPLE (GLenum pname, GLint64 *params);
GL_API void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
#endif
typedef GLsync (GL_APIENTRYP PFNGLFENCESYNCAPPLEPROC) (GLenum condition, GLbitfield flags);
typedef GLboolean (GL_APIENTRYP PFNGLISSYNCAPPLEPROC) (GLsync sync);
typedef void (GL_APIENTRYP PFNGLDELETESYNCAPPLEPROC) (GLsync sync);
typedef GLenum (GL_APIENTRYP PFNGLCLIENTWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
typedef void (GL_APIENTRYP PFNGLWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
typedef void (GL_APIENTRYP PFNGLGETINTEGER64VAPPLEPROC) (GLenum pname, GLint64 *params);
typedef void (GL_APIENTRYP PFNGLGETSYNCIVAPPLEPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
#endif
/* GL_APPLE_texture_2D_limited_npot */
#ifndef GL_APPLE_texture_2D_limited_npot
#define GL_APPLE_texture_2D_limited_npot 1
#endif
/* GL_APPLE_texture_format_BGRA8888 */ /* GL_APPLE_texture_format_BGRA8888 */
#ifndef GL_APPLE_texture_format_BGRA8888 #ifndef GL_APPLE_texture_format_BGRA8888
#define GL_APPLE_texture_format_BGRA8888 1 #define GL_APPLE_texture_format_BGRA8888 1
@ -945,6 +1029,17 @@ GL_API void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttac
typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments); typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
#endif #endif
/* GL_EXT_map_buffer_range */
#ifndef GL_EXT_map_buffer_range
#define GL_EXT_map_buffer_range 1
#ifdef GL_GLEXT_PROTOTYPES
GL_API void GL_APIENTRY *glMapBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
GL_API void GL_APIENTRY glFlushMappedBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length);
#endif
typedef void* (GL_APIENTRYP PFNGLMAPBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
typedef void (GL_APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
#endif
/* GL_EXT_multisampled_render_to_texture */ /* GL_EXT_multisampled_render_to_texture */
#ifndef GL_EXT_multisampled_render_to_texture #ifndef GL_EXT_multisampled_render_to_texture
#define GL_EXT_multisampled_render_to_texture 1 #define GL_EXT_multisampled_render_to_texture 1
@ -1068,8 +1163,8 @@ typedef void (GL_APIENTRYP PFNGLCLIPPLANEXIMGPROC) (GLenum p, const GLfixed *eqn
GL_API void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum, GLsizei, GLenum, GLsizei, GLsizei); GL_API void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum, GLsizei, GLenum, GLsizei, GLsizei);
GL_API void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum, GLenum, GLenum, GLuint, GLint, GLsizei); GL_API void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum, GLenum, GLenum, GLuint, GLint, GLsizei);
#endif #endif
typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMG) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMGPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMG) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
#endif #endif
/*------------------------------------------------------------------------* /*------------------------------------------------------------------------*

View file

@ -161,21 +161,12 @@ const uint CDriverGL::_EVSNumConstant = 97;
GLenum CDriverGL::NLCubeFaceToGLCubeFace[6] = GLenum CDriverGL::NLCubeFaceToGLCubeFace[6] =
{ {
#ifdef USE_OPENGLES
GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES,
GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES,
GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES,
GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES,
GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES,
GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES
#else
GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB, GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB,
GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB, GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB,
GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB,
GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB, GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB,
GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB, GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB,
GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB
#endif
}; };
// *************************************************************************** // ***************************************************************************

View file

@ -77,6 +77,13 @@ typedef void (APIENTRY * NEL_PFNGLGETTEXGENXVOESPROC) (GLenum coord, GLenum pnam
#define GL_INTERPOLATE_EXT GL_INTERPOLATE #define GL_INTERPOLATE_EXT GL_INTERPOLATE
#define GL_BUMP_ENVMAP_ATI GL_INTERPOLATE #define GL_BUMP_ENVMAP_ATI GL_INTERPOLATE
#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES
#else #else
// *************************************************************************** // ***************************************************************************

View file

@ -205,8 +205,8 @@ bool CDriverGL::activeNVVertexProgram (CVertexProgram *program)
return false; return false;
} }
// *************************************************************************** // ***************************************************************************
#ifndef USE_OPENGLES
static static
inline GLenum convSwizzleToGLFormat(CVPSwizzle::EComp comp, bool negate) inline GLenum convSwizzleToGLFormat(CVPSwizzle::EComp comp, bool negate)
{ {
@ -216,16 +216,11 @@ inline GLenum convSwizzleToGLFormat(CVPSwizzle::EComp comp, bool negate)
{ {
switch(comp) switch(comp)
{ {
#ifdef USE_OPENGLES
case CVPSwizzle::X: return GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES;
case CVPSwizzle::Y: return GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES;
case CVPSwizzle::Z: return GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES;
#else
case CVPSwizzle::X: return GL_X_EXT; case CVPSwizzle::X: return GL_X_EXT;
case CVPSwizzle::Y: return GL_Y_EXT; case CVPSwizzle::Y: return GL_Y_EXT;
case CVPSwizzle::Z: return GL_Z_EXT; case CVPSwizzle::Z: return GL_Z_EXT;
case CVPSwizzle::W: return GL_W_EXT; case CVPSwizzle::W: return GL_W_EXT;
#endif
default: default:
nlstop; nlstop;
return 0; return 0;
@ -236,16 +231,11 @@ inline GLenum convSwizzleToGLFormat(CVPSwizzle::EComp comp, bool negate)
{ {
switch(comp) switch(comp)
{ {
#ifdef USE_OPENGLES
case CVPSwizzle::X: return GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES;
case CVPSwizzle::Y: return GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES;
case CVPSwizzle::Z: return GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES;
#else
case CVPSwizzle::X: return GL_NEGATIVE_X_EXT; case CVPSwizzle::X: return GL_NEGATIVE_X_EXT;
case CVPSwizzle::Y: return GL_NEGATIVE_Y_EXT; case CVPSwizzle::Y: return GL_NEGATIVE_Y_EXT;
case CVPSwizzle::Z: return GL_NEGATIVE_Z_EXT; case CVPSwizzle::Z: return GL_NEGATIVE_Z_EXT;
case CVPSwizzle::W: return GL_NEGATIVE_W_EXT; case CVPSwizzle::W: return GL_NEGATIVE_W_EXT;
#endif
default: default:
nlstop; nlstop;
return 0; return 0;
@ -253,6 +243,7 @@ inline GLenum convSwizzleToGLFormat(CVPSwizzle::EComp comp, bool negate)
} }
} }
} }
#endif
// *************************************************************************** // ***************************************************************************
/** Convert an output register to a EXTVertexShader register /** Convert an output register to a EXTVertexShader register

View file

@ -209,7 +209,7 @@ static bool isTextKeyEvent(NSEvent* event)
/* /*
TODO check why iswprint(character) does not solve it. TODO check why iswprint(character) does not solve it.
it always returns false, even for π, é, ... it always returns false, even for non-ASCII characters
*/ */
// characters > 127 but not printable // characters > 127 but not printable
if( nelKey == NLMISC::KeyF1 || nelKey == NLMISC::KeyF2 || if( nelKey == NLMISC::KeyF1 || nelKey == NLMISC::KeyF2 ||

View file

@ -109,7 +109,7 @@ CRGBA CFastHLSModifier::convert(uint H, uint L, uint S)
return col; return col;
} }
#if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) #if defined(NL_COMP_VC) && NL_COMP_VC_VERSION >= 71
# pragma warning( push ) # pragma warning( push )
# pragma warning( disable : 4799 ) # pragma warning( disable : 4799 )
#endif #endif
@ -262,7 +262,7 @@ uint16 CFastHLSModifier::applyHLSMod(uint16 colorIn, uint8 dHue, uint dLum, uin
#pragma managed(pop) #pragma managed(pop)
#endif #endif
#if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10) #if defined(NL_COMP_VC) && NL_COMP_VC_VERSION >= 71
# pragma warning( pop ) # pragma warning( pop )
#endif #endif

View file

@ -173,7 +173,7 @@ void CParticleSystemShape::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
///=========================================================================== ///===========================================================================
void CParticleSystemShape::buildFromPS(const CParticleSystem &ps) void CParticleSystemShape::buildFromPS(const CParticleSystem &ps)
{ {
// must be sure that we are writting in the stream // must be sure that we are writing in the stream
if (_ParticleSystemProto.isReading()) if (_ParticleSystemProto.isReading())
{ {
_ParticleSystemProto.invert(); _ParticleSystemProto.invert();

View file

@ -202,7 +202,7 @@ CTessFace::~CTessFace()
// *************************************************************************** // ***************************************************************************
float CTessFace::computeNearLimit() float CTessFace::computeNearLimit()
{ {
// General formula for Level, function of Size, treshold etc...: // General formula for Level, function of Size, threshold etc...:
// WantedLevel= log2(BaseSize / sqrdist / RefineThreshold); // WantedLevel= log2(BaseSize / sqrdist / RefineThreshold);
// <=> WantedLevel= log2( CurSize*2^Level / sqrdist / RefineThreshold). // <=> WantedLevel= log2( CurSize*2^Level / sqrdist / RefineThreshold).
// <=> WantedLevel= log2( ProjectedSize* 2^Level / RefineThreshold). // <=> WantedLevel= log2( ProjectedSize* 2^Level / RefineThreshold).
@ -1774,7 +1774,7 @@ void CTessFace::refineAll()
/* /*
if(ps<RefineThreshold), the face must be merged (ie have no leaves). if(ps<RefineThreshold), the face must be merged (ie have no leaves).
if(ps E [RefineThreshold, RefineTreshold*2]), the face must be splitted (ave leaves), and is geomorphed. if(ps E [RefineThreshold, RefineThreshold*2]), the face must be splitted (ave leaves), and is geomorphed.
if(ps>RefineThreshold*2), the face is fully splitted/geomoprhed (tests reported on sons...). if(ps>RefineThreshold*2), the face is fully splitted/geomoprhed (tests reported on sons...).
*/ */
@ -1831,7 +1831,7 @@ void CTessFace::refineAll()
// Split or merge, and meaning of errorMetric: // Split or merge, and meaning of errorMetric:
/* /*
if(errorMetric<RefineThreshold), the face must be merged (ie have no leaves). if(errorMetric<RefineThreshold), the face must be merged (ie have no leaves).
if(errorMetric E [RefineThreshold, RefineTreshold*2]), the face must be splitted (ave leaves), and is geomorphed. if(errorMetric E [RefineThreshold, RefineThreshold*2]), the face must be splitted (ave leaves), and is geomorphed.
if(errorMetric>RefineThreshold*2), the face is fully splitted/geomoprhed. if(errorMetric>RefineThreshold*2), the face is fully splitted/geomoprhed.
*/ */

View file

@ -1418,7 +1418,7 @@ void CTransform::forceCompute()
} }
else else
{ {
// force to compûte the father // force to compute the father
if (_HrcParent) if (_HrcParent)
{ {
_HrcParent->forceCompute(); _HrcParent->forceCompute();

View file

@ -146,7 +146,7 @@ bool CVPParser::parseOperand(CVPOperand &operand, bool outputOperand, std::strin
break; break;
case 'A': result = parseAddressRegister(operand, errorOutput); break; case 'A': result = parseAddressRegister(operand, errorOutput); break;
case '-': case '-':
errorOutput = "Negation not allowed on ouput register."; errorOutput = "Negation not allowed on output register.";
return false; return false;
default: default:
errorOutput = "Output, Address, or Temporary register expected as an output operand."; errorOutput = "Output, Address, or Temporary register expected as an output operand.";
@ -365,7 +365,7 @@ bool CVPParser::parseOutputRegister(CVPOperand &operand, std::string &errorOutpu
operand.Type = CVPOperand::OutputRegister; operand.Type = CVPOperand::OutputRegister;
if (*_CurrChar != '[') if (*_CurrChar != '[')
{ {
errorOutput = "'[' expected when parsing an ouput register."; errorOutput = "'[' expected when parsing an output register.";
return false; return false;
} }
++_CurrChar; ++_CurrChar;
@ -565,7 +565,7 @@ bool CVPParser::parseAddressRegister(CVPOperand &operand, std::string &errorOutp
bool CVPParser::parseOp2(CVPInstruction &instr,std::string &errorOutput) bool CVPParser::parseOp2(CVPInstruction &instr,std::string &errorOutput)
{ {
skipSpacesAndComments(); skipSpacesAndComments();
// parse ouput // parse output
if (!parseOperand(instr.Dest, true, errorOutput)) return false; if (!parseOperand(instr.Dest, true, errorOutput)) return false;
// Can't write in input or consant register // Can't write in input or consant register
if (instr.Dest.Type == CVPOperand::Constant || instr.Dest.Type == CVPOperand::InputRegister) if (instr.Dest.Type == CVPOperand::Constant || instr.Dest.Type == CVPOperand::InputRegister)

View file

@ -127,7 +127,7 @@ void CZone::build(const CZoneInfo &zoneInfo, uint32 numVertices)
// Compute the bbox and the bias/scale. // Compute the bbox and the bias/scale.
//===================================== //=====================================
CAABBox bb; CAABBox bb;
if(patchs.size()) if(!patchs.empty())
bb.setCenter(patchs[0].Patch.Vertices[0]); bb.setCenter(patchs[0].Patch.Vertices[0]);
bb.setHalfSize(CVector::Null); bb.setHalfSize(CVector::Null);
for(j=0;j<(sint)patchs.size();j++) for(j=0;j<(sint)patchs.size();j++)

View file

@ -2781,7 +2781,7 @@ void CZoneLighter::computeTileFlagsOnly (CLandscape &landscape, CZone& output, u
// can't copy tile flags // can't copy tile flags
if(!ok) if(!ok)
throw Exception("The input zonew, and ouput zonel are too different: not same patchs!!"); throw Exception("The input zonew, and output zonel are too different: not same patchs!!");
/// copy the tiles flags from the zone to light to the output zone /// copy the tiles flags from the zone to light to the output zone
copyTileFlags(output, zonew); copyTileFlags(output, zonew);

View file

@ -31,6 +31,11 @@ NLMISC_REGISTER_OBJECT(CViewBase, CDBGroupComboBox, std::string, "combo_box");
namespace NLGUI namespace NLGUI
{ {
// Compare strings
static inline bool lt_text(const std::pair<int,ucstring> &s1, const std::pair<int,ucstring> &s2)
{
return toLower(s1.second) < toLower(s2.second);
}
std::string CDBGroupComboBox::measureMenu; std::string CDBGroupComboBox::measureMenu;
std::string CDBGroupComboBox::selectMenu; std::string CDBGroupComboBox::selectMenu;
@ -228,7 +233,7 @@ namespace NLGUI
} }
else else
{ {
_ViewText->setText(_Texts[_CacheSelection]); _ViewText->setText(_Texts[_CacheSelection].second);
} }
} }
} }
@ -260,7 +265,7 @@ namespace NLGUI
void CDBGroupComboBox::addText(const ucstring &text) void CDBGroupComboBox::addText(const ucstring &text)
{ {
dirt(); dirt();
_Texts.push_back(text); _Texts.push_back(make_pair(_Texts.size(), text));
_Textures.push_back(std::string()); _Textures.push_back(std::string());
} }
@ -269,7 +274,7 @@ namespace NLGUI
{ {
dirt(); dirt();
if(i<_Texts.size()) if(i<_Texts.size())
_Texts[i]= text; _Texts[i].second= text;
} }
// *************************************************************************** // ***************************************************************************
@ -278,14 +283,14 @@ namespace NLGUI
dirt(); dirt();
if(i<_Texts.size()) if(i<_Texts.size())
{ {
addText(_Texts[_Texts.size()-1]); addText(_Texts[_Texts.size()-1].second);
for(uint t=i; t<_Texts.size()-1; t++) for(uint t=i; t<_Texts.size()-1; t++)
{ {
_Texts[t+1] = _Texts[t]; _Texts[t+1] = _Texts[t];
_Textures[t+1] = _Textures[t]; _Textures[t+1] = _Textures[t];
} }
_Texts[i]= text; _Texts[i] = make_pair(i, text);
_Textures[i] = std::string(); _Textures[i] = std::string();
} }
else if(i==_Texts.size()) else if(i==_Texts.size())
@ -301,13 +306,13 @@ namespace NLGUI
} }
// *************************************************************************** // ***************************************************************************
void CDBGroupComboBox::removeText(uint i) void CDBGroupComboBox::removeText(uint nPos)
{ {
dirt(); dirt();
if(i<_Texts.size()) if(nPos<_Texts.size())
{ {
_Texts.erase( _Texts.begin()+i ); _Texts.erase( _Texts.begin()+nPos );
_Textures.erase( _Textures.begin()+i ); _Textures.erase( _Textures.begin()+nPos );
} }
} }
@ -316,11 +321,37 @@ namespace NLGUI
{ {
static ucstring null; static ucstring null;
if(i<_Texts.size()) if(i<_Texts.size())
return _Texts[i]; return _Texts[i].second;
else else
return null; return null;
} }
// ***************************************************************************
const uint &CDBGroupComboBox::getTextId(uint i) const
{
static uint null = 0;
if(i<_Texts.size())
return _Texts[i].first;
else
return null;
}
// ***************************************************************************
uint CDBGroupComboBox::getTextPos(uint nId) const
{
for(uint i=0; i<_Texts.size(); i++)
{
if(nId == _Texts[i].first) {return i;}
}
return 0;
}
// ***************************************************************************
void CDBGroupComboBox::sortText()
{
sort(_Texts.begin(), _Texts.end(), lt_text);
}
// *************************************************************************** // ***************************************************************************
const ucstring &CDBGroupComboBox::getTexture(uint i) const const ucstring &CDBGroupComboBox::getTexture(uint i) const
{ {

View file

@ -440,7 +440,7 @@ namespace NLGUI
///////////////////////////////// /////////////////////////////////
static DECLARE_INTERFACE_USER_FCT(userFctMax) static DECLARE_INTERFACE_USER_FCT(userFctMax)
{ {
// compute type of ouput // compute type of output
if (!promoteToNumericalBestType(args)) if (!promoteToNumericalBestType(args))
{ {
nlwarning("max : invalid entry"); nlwarning("max : invalid entry");
@ -472,7 +472,7 @@ namespace NLGUI
///////////////////////////////// /////////////////////////////////
static DECLARE_INTERFACE_USER_FCT(userFctMin) static DECLARE_INTERFACE_USER_FCT(userFctMin)
{ {
// compute type of ouput // compute type of output
if (!promoteToNumericalBestType(args)) if (!promoteToNumericalBestType(args))
{ {
nlwarning("max : invalid entry"); nlwarning("max : invalid entry");

View file

@ -1418,7 +1418,7 @@ namespace NLGUI
} }
} }
// Detect change of wordFormat at the begining of the word // Detect change of wordFormat at the beginning of the word
if(isFormatTagChange((uint)spaceEnd, formatTagIndex)) if(isFormatTagChange((uint)spaceEnd, formatTagIndex))
{ {
getFormatTagChange((uint)spaceEnd, formatTagIndex, wordFormat); getFormatTagChange((uint)spaceEnd, formatTagIndex, wordFormat);

View file

@ -426,7 +426,7 @@ void CLogicStateMachine::setVerbose( string varName, bool b )
filter = 1; filter = 1;
} }
else else
// xxx* => we look for a string with xxx at the begining // xxx* => we look for a string with xxx at the beginning
if( varName[varName.size()-1]=='*' ) if( varName[varName.size()-1]=='*' )
{ {
motif = varName.substr(0,varName.size()-1); motif = varName.substr(0,varName.size()-1);

View file

@ -21,6 +21,10 @@
#include "nel/misc/bsphere.h" #include "nel/misc/bsphere.h"
#include "nel/misc/matrix.h" #include "nel/misc/matrix.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC { namespace NLMISC {

View file

@ -21,6 +21,9 @@
using namespace std; using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC namespace NLMISC
{ {

View file

@ -19,6 +19,10 @@
#include "nel/misc/dynloadlib.h" #include "nel/misc/dynloadlib.h"
#include "nel/misc/command.h" #include "nel/misc/command.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC namespace NLMISC
{ {

View file

@ -23,6 +23,10 @@
using namespace std; using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC namespace NLMISC
{ {

View file

@ -22,6 +22,9 @@
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC { namespace NLMISC {

View file

@ -25,6 +25,9 @@
using namespace std; using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC { namespace NLMISC {

View file

@ -20,6 +20,9 @@
using namespace std; using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC namespace NLMISC
{ {

View file

@ -26,6 +26,9 @@
using namespace std; using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC namespace NLMISC
{ {

View file

@ -32,6 +32,9 @@ extern "C"
using namespace std; using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC namespace NLMISC
{ {

View file

@ -27,6 +27,9 @@
using namespace std; using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC namespace NLMISC
{ {

View file

@ -21,6 +21,9 @@
// remove stupid VC6 warnings // remove stupid VC6 warnings
void foo_block_memory_cpp() {} void foo_block_memory_cpp() {}
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC namespace NLMISC
{ {

View file

@ -21,6 +21,9 @@
using namespace NLMISC; using namespace NLMISC;
using namespace std; using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC { namespace NLMISC {

View file

@ -26,6 +26,10 @@ using namespace std;
// if 0, don't stat the time of different function // if 0, don't stat the time of different function
#define STAT_FIFO 1 #define STAT_FIFO 1
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC { namespace NLMISC {
#ifdef BUFFIFO_TRACK_ALL_BUFFERS #ifdef BUFFIFO_TRACK_ALL_BUFFERS

View file

@ -20,6 +20,9 @@
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC namespace NLMISC
{ {

View file

@ -17,9 +17,14 @@
#include "stdmisc.h" #include "stdmisc.h"
#include "nel/misc/class_registry.h" #include "nel/misc/class_registry.h"
#include "nel/misc/debug.h"
using namespace std; using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC namespace NLMISC
{ {

View file

@ -24,6 +24,10 @@
#include "nel/misc/cmd_args.h" #include "nel/misc/cmd_args.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC namespace NLMISC
{ {

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