From 0cd51d59c7049a35e47c4d13947413697bd8e4f4 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Fri, 10 Jul 2015 02:31:04 +0200 Subject: [PATCH 01/11] Fix VS2013 64bit compiler error C1128: number of sections exceeded object file format limit : compile with /bigobj --HG-- branch : develop --- code/ryzom/server/src/entities_game_service/CMakeLists.txt | 4 ++++ code/ryzom/server/src/shard_unifier_service/CMakeLists.txt | 4 ++++ code/ryzom/tools/sheets_packer_shard/CMakeLists.txt | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/code/ryzom/server/src/entities_game_service/CMakeLists.txt b/code/ryzom/server/src/entities_game_service/CMakeLists.txt index 15e7794a4..886f5eee9 100644 --- a/code/ryzom/server/src/entities_game_service/CMakeLists.txt +++ b/code/ryzom/server/src/entities_game_service/CMakeLists.txt @@ -111,6 +111,10 @@ NL_ADD_RUNTIME_FLAGS(ryzom_entities_game_service) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +IF(MSVC) + SET_TARGET_PROPERTIES(ryzom_entities_game_service PROPERTIES COMPILE_FLAGS "/bigobj") +ENDIF(MSVC) + IF(WITH_PCH AND NOT MINGW) # FIXME: PCH too large (> 130MB), crashes cc1plus under MinGW ADD_NATIVE_PRECOMPILED_HEADER(ryzom_entities_game_service ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) ENDIF(WITH_PCH AND NOT MINGW) diff --git a/code/ryzom/server/src/shard_unifier_service/CMakeLists.txt b/code/ryzom/server/src/shard_unifier_service/CMakeLists.txt index 4ba320e09..08ca313c4 100644 --- a/code/ryzom/server/src/shard_unifier_service/CMakeLists.txt +++ b/code/ryzom/server/src/shard_unifier_service/CMakeLists.txt @@ -20,6 +20,10 @@ NL_ADD_RUNTIME_FLAGS(ryzom_shard_unifier_service) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +IF(MSVC) + SET_TARGET_PROPERTIES(ryzom_shard_unifier_service PROPERTIES COMPILE_FLAGS "/bigobj") +ENDIF(MSVC) + IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(ryzom_shard_unifier_service ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) ENDIF(WITH_PCH) diff --git a/code/ryzom/tools/sheets_packer_shard/CMakeLists.txt b/code/ryzom/tools/sheets_packer_shard/CMakeLists.txt index 3e9f2a17f..a16353cdd 100644 --- a/code/ryzom/tools/sheets_packer_shard/CMakeLists.txt +++ b/code/ryzom/tools/sheets_packer_shard/CMakeLists.txt @@ -12,6 +12,7 @@ ADD_EXECUTABLE(sheets_packer_shard ${SRC} ${EGSSHEETS} ${CMAKE_SOURCE_DIR}/ryzom/server/src/ai_service/sheets.h ${CMAKE_SOURCE_DIR}/ryzom/server/src/ai_service/commands_mlf.cpp) + INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/ryzom/common/src ${CMAKE_SOURCE_DIR}/ryzom/server/src ${CMAKE_SOURCE_DIR}/ryzom/tools/sheets_packer_shard ${CMAKE_SOURCE_DIR}/ryzom/server/src/entities_game_service) TARGET_LINK_LIBRARIES(sheets_packer_shard ryzom_gameshare @@ -31,4 +32,8 @@ NL_ADD_RUNTIME_FLAGS(sheets_packer_shard) ADD_DEFINITIONS(-DNO_EGS_VARS) ADD_DEFINITIONS(-DNO_AI_COMP) +IF(MSVC) + SET_TARGET_PROPERTIES(sheets_packer_shard PROPERTIES COMPILE_FLAGS "/bigobj") +ENDIF(MSVC) + INSTALL(TARGETS sheets_packer_shard RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT tools) From cac661dbca9400a41f42f6f2cbcaeb0003faa7a6 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Fri, 10 Jul 2015 05:50:05 +0200 Subject: [PATCH 02/11] SDK 8.1 support --HG-- branch : develop --- code/CMakeModules/FindWindowsSDK.cmake | 37 +++++++++++++++++++------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/code/CMakeModules/FindWindowsSDK.cmake b/code/CMakeModules/FindWindowsSDK.cmake index 31288eb03..4b7d03f0b 100644 --- a/code/CMakeModules/FindWindowsSDK.cmake +++ b/code/CMakeModules/FindWindowsSDK.cmake @@ -37,7 +37,7 @@ MACRO(DETECT_WINSDK_VERSION _VERSION) ENDIF(NOT WINSDK${_VERSION}_FOUND) ENDMACRO(DETECT_WINSDK_VERSION) -SET(WINSDK_VERSIONS "8.0" "8.0A" "7.1" "7.1A" "7.0" "7.0A" "6.1" "6.0" "6.0A") +SET(WINSDK_VERSIONS "8.1" "8.0" "8.0A" "7.1" "7.1A" "7.0" "7.0A" "6.1" "6.0" "6.0A") SET(WINSDK_DETECTED_VERSIONS) # Search all supported Windows SDKs @@ -82,12 +82,23 @@ MACRO(FIND_WINSDK_VERSION_HEADERS) ) IF(_MSI_FILE) - # Look for Windows SDK 8.0 - FILE(STRINGS ${_MSI_FILE} _CONTENT REGEX "^#ifndef NTDDI_WIN8") + IF(NOT WINSDK_VERSION) + # Look for Windows SDK 8.1 + FILE(STRINGS ${_MSI_FILE} _CONTENT REGEX "^#ifndef NTDDI_WINBLUE") - IF(_CONTENT) - SET(WINSDK_VERSION "8.0") - ENDIF(_CONTENT) + IF(_CONTENT) + SET(WINSDK_VERSION "8.1") + ENDIF(_CONTENT) + ENDIF(NOT WINSDK_VERSION) + + IF(NOT WINSDK_VERSION) + # Look for Windows SDK 8.0 + FILE(STRINGS ${_MSI_FILE} _CONTENT REGEX "^#ifndef NTDDI_WIN8") + + IF(_CONTENT) + SET(WINSDK_VERSION "8.0") + ENDIF(_CONTENT) + ENDIF(NOT WINSDK_VERSION) IF(NOT WINSDK_VERSION) # Look for Windows SDK 7.0 @@ -206,9 +217,9 @@ MACRO(USE_CURRENT_WINSDK) IF(NOT WINSDK_DIR) # Use Windows SDK versions installed with VC++ when possible IF(MSVC12) - SET(WINSDK_VERSION "8.1A") + SET(WINSDK_VERSION "8.1") ELSEIF(MSVC11) - SET(WINSDK_VERSION "8.0A") + SET(WINSDK_VERSION "8.0") ELSEIF(MSVC10) IF(NOT TARGET_X64 OR NOT MSVC_EXPRESS) SET(WINSDK_VERSION "7.0A") @@ -228,7 +239,11 @@ MACRO(USE_CURRENT_WINSDK) # Use installed Windows SDK IF(NOT WINSDK_VERSION) - IF(WINSDK7.1_FOUND) + IF(WINSDK8.1_FOUND) + SET(WINSDK_VERSION "8.1") + ELSEIF(WINSDK8.0_FOUND) + SET(WINSDK_VERSION "8.0") + ELSEIF(WINSDK7.1_FOUND) SET(WINSDK_VERSION "7.1") ELSEIF(WINSDK7.0_FOUND) SET(WINSDK_VERSION "7.0") @@ -286,6 +301,7 @@ FIND_PATH(WINSDK_SHARED_INCLUDE_DIR d3d9.h # directory where OpenGL headers are found FIND_PATH(WINSDK_OPENGL_INCLUDE_DIR GL.h HINTS + ${WINSDK_DIR}/Include/um/gl ${WINSDK_DIR}/Include/gl ${WINSDK_DIR}/Include ) @@ -293,6 +309,7 @@ FIND_PATH(WINSDK_OPENGL_INCLUDE_DIR GL.h # directory where all libraries are found FIND_PATH(WINSDK_LIBRARY_DIR ComCtl32.lib HINTS + ${WINSDK_DIR}/Lib/winv6.3/um/${WINSDK8_SUFFIX} ${WINSDK_DIR}/Lib/win8/um/${WINSDK8_SUFFIX} ${WINSDK_DIR}/Lib/${WINSDK_SUFFIX} ) @@ -300,6 +317,7 @@ FIND_PATH(WINSDK_LIBRARY_DIR ComCtl32.lib # signtool is used to sign executables FIND_PROGRAM(WINSDK_SIGNTOOL signtool HINTS + ${WINSDK_DIR}/Bin/${WINSDK8_SUFFIX} ${WINSDK_DIR}/Bin/x86 ${WINSDK_DIR}/Bin ) @@ -307,6 +325,7 @@ FIND_PROGRAM(WINSDK_SIGNTOOL signtool # midl is used to generate IDL interfaces FIND_PROGRAM(WINSDK_MIDL midl HINTS + ${WINSDK_DIR}/Bin/${WINSDK8_SUFFIX} ${WINSDK_DIR}/Bin/x86 ${WINSDK_DIR}/Bin ) From 9a10f1413b86078fbe892ee65e982967be32e7de Mon Sep 17 00:00:00 2001 From: kaetemi Date: Fri, 10 Jul 2015 06:16:19 +0200 Subject: [PATCH 03/11] Fix DXSDK include order --HG-- branch : develop --- code/CMakeModules/nel.cmake | 8 ++++++++ code/nel/CMakeLists.txt | 4 ---- code/nel/src/3d/driver/direct3d/CMakeLists.txt | 2 +- code/nel/src/3d/driver/opengl/CMakeLists.txt | 2 +- code/nel/src/3d/driver/opengles/CMakeLists.txt | 2 +- code/nel/src/misc/CMakeLists.txt | 2 +- code/nel/src/sound/driver/dsound/CMakeLists.txt | 2 +- code/nel/src/sound/driver/xaudio2/CMakeLists.txt | 2 +- .../leveldesign/georges_plugin_sound/CMakeLists.txt | 11 ----------- 9 files changed, 14 insertions(+), 21 deletions(-) diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index 70113e11b..52ee640e9 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -1147,6 +1147,14 @@ MACRO(SETUP_EXTERNAL) INCLUDE_DIRECTORIES(${STLPORT_INCLUDE_DIR}) ENDIF(WITH_STLPORT) + IF(WIN32) + # Must include DXSDK before WINSDK + FIND_PACKAGE(DirectXSDK REQUIRED) + # IF(DXSDK_INCLUDE_DIR) + # INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) + # ENDIF() + ENDIF(WIN32) + IF(MSVC) FIND_PACKAGE(MSVC REQUIRED) FIND_PACKAGE(WindowsSDK REQUIRED) diff --git a/code/nel/CMakeLists.txt b/code/nel/CMakeLists.txt index 16a8166fe..f283eaecb 100644 --- a/code/nel/CMakeLists.txt +++ b/code/nel/CMakeLists.txt @@ -4,11 +4,7 @@ IF(WITH_STATIC_DRIVERS) ADD_DEFINITIONS(-DNL_STATIC) ENDIF(WITH_STATIC_DRIVERS) -# On Windows we need to find DirectInput for NLMISC. -# This is how we get events. IF(WIN32) - FIND_PACKAGE(DirectXSDK REQUIRED) - # On Win32 we can also build the MAX plugins. IF(WITH_NEL_MAXPLUGIN) FIND_PACKAGE(3dsMaxSDK) diff --git a/code/nel/src/3d/driver/direct3d/CMakeLists.txt b/code/nel/src/3d/driver/direct3d/CMakeLists.txt index ccdb8cb10..b76e20f52 100644 --- a/code/nel/src/3d/driver/direct3d/CMakeLists.txt +++ b/code/nel/src/3d/driver/direct3d/CMakeLists.txt @@ -2,7 +2,7 @@ FILE(GLOB SRC *.cpp *.h *.def) NL_TARGET_DRIVER(nel_drv_direct3d_win ${SRC}) -INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(BEFORE ${DXSDK_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nel_drv_direct3d_win nel3d nelmisc ${DXSDK_D3DX9_LIBRARY} ${DXSDK_D3D9_LIBRARY} ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY}) diff --git a/code/nel/src/3d/driver/opengl/CMakeLists.txt b/code/nel/src/3d/driver/opengl/CMakeLists.txt index 12e20fbb3..74f3cb78a 100644 --- a/code/nel/src/3d/driver/opengl/CMakeLists.txt +++ b/code/nel/src/3d/driver/opengl/CMakeLists.txt @@ -35,7 +35,7 @@ NL_ADD_LIB_SUFFIX(${NLDRV_OGL_LIB}) NL_ADD_RUNTIME_FLAGS(${NLDRV_OGL_LIB}) IF(WIN32) - INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) + INCLUDE_DIRECTORIES(BEFORE ${DXSDK_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY}) ADD_DEFINITIONS(-DDRIVER_OPENGL_EXPORTS) ENDIF(WIN32) diff --git a/code/nel/src/3d/driver/opengles/CMakeLists.txt b/code/nel/src/3d/driver/opengles/CMakeLists.txt index 74f0ddff3..e8d5a7979 100644 --- a/code/nel/src/3d/driver/opengles/CMakeLists.txt +++ b/code/nel/src/3d/driver/opengles/CMakeLists.txt @@ -38,7 +38,7 @@ NL_ADD_LIB_SUFFIX(${NLDRV_OGLES_LIB}) NL_ADD_RUNTIME_FLAGS(${NLDRV_OGLES_LIB}) IF(WIN32) - INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) + INCLUDE_DIRECTORIES(BEFORE ${DXSDK_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(${NLDRV_OGLES_LIB} ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY}) ADD_DEFINITIONS(/DDRIVER_OPENGLES_EXPORTS) ENDIF(WIN32) diff --git a/code/nel/src/misc/CMakeLists.txt b/code/nel/src/misc/CMakeLists.txt index f40517f5b..8cdbf0fe6 100644 --- a/code/nel/src/misc/CMakeLists.txt +++ b/code/nel/src/misc/CMakeLists.txt @@ -196,7 +196,7 @@ ENDIF(WITH_STATIC OR WIN32) # For DirectInput (di_event_emitter) IF(WIN32) - INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) + INCLUDE_DIRECTORIES(BEFORE ${DXSDK_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nelmisc ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY} winmm dbghelp) ENDIF(WIN32) diff --git a/code/nel/src/sound/driver/dsound/CMakeLists.txt b/code/nel/src/sound/driver/dsound/CMakeLists.txt index 74d431084..1563a871a 100644 --- a/code/nel/src/sound/driver/dsound/CMakeLists.txt +++ b/code/nel/src/sound/driver/dsound/CMakeLists.txt @@ -2,7 +2,7 @@ FILE(GLOB SRC *.cpp *.h *.def) NL_TARGET_DRIVER(nel_drv_dsound_win ${SRC}) -INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(BEFORE ${DXSDK_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nel_drv_dsound_win nelmisc nelsnd_lowlevel ${DXSDK_DSOUND_LIBRARY} ${DXSDK_GUID_LIBRARY}) NL_DEFAULT_PROPS(nel_drv_dsound_win "NeL, Driver, Sound: DirectSound") diff --git a/code/nel/src/sound/driver/xaudio2/CMakeLists.txt b/code/nel/src/sound/driver/xaudio2/CMakeLists.txt index 9113bd022..d6c1a7143 100644 --- a/code/nel/src/sound/driver/xaudio2/CMakeLists.txt +++ b/code/nel/src/sound/driver/xaudio2/CMakeLists.txt @@ -28,7 +28,7 @@ SOURCE_GROUP(efx FILES NL_TARGET_DRIVER(nel_drv_xaudio2_win ${SRC}) -INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(BEFORE ${DXSDK_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nel_drv_xaudio2_win nelmisc nelsnd_lowlevel ${DXSDK_XAUDIO_LIBRARY} ${DXSDK_GUID_LIBRARY}) diff --git a/code/ryzom/tools/leveldesign/georges_plugin_sound/CMakeLists.txt b/code/ryzom/tools/leveldesign/georges_plugin_sound/CMakeLists.txt index c88246a98..0add6656c 100644 --- a/code/ryzom/tools/leveldesign/georges_plugin_sound/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/georges_plugin_sound/CMakeLists.txt @@ -1,17 +1,6 @@ FILE(GLOB SRC *.cpp *.h) -# Bugfix... -IF (NOT DXSDK_INCLUDE_DIR) - IF (DXSDK_DIR) - SET(DXSDK_INCLUDE_DIR "${DXSDK_DIR}/Include") - ENDIF (DXSDK_DIR) -ENDIF (NOT DXSDK_INCLUDE_DIR) - -IF (NOT DXSDK_INCLUDE_DIR) - message(FATAL_ERROR "Configuration bad, cannot find DirectX include.") -ENDIF (NOT DXSDK_INCLUDE_DIR) - ADD_LIBRARY(georges_plugin_sound SHARED ${SRC}) INCLUDE_DIRECTORIES(georges_plugin_sound ${NEL_INCLUDE_DIR} ${DXSDK_INCLUDE_DIR}) From edebe18d6c54ab456ebe1817e3f6a6f7a7f341ef Mon Sep 17 00:00:00 2001 From: kaetemi Date: Fri, 10 Jul 2015 06:24:17 +0200 Subject: [PATCH 04/11] MFC now requires XP or higher --HG-- branch : develop --- code/nel/tools/3d/object_viewer/std_afx.h | 2 +- code/nel/tools/3d/object_viewer_exe/std_afx.h | 3 ++- code/nel/tools/logic/logic_editor_dll/StdAfx.h | 2 +- code/nel/tools/misc/branch_patcher/StdAfx.h | 2 ++ code/nel/tools/misc/data_mirror/StdAfx.h | 2 ++ code/nel/tools/misc/log_analyser/StdAfx.h | 2 ++ code/nel/tools/misc/words_dic/StdAfx.h | 2 ++ code/ryzom/tools/leveldesign/georges_dll/stdafx.h | 2 +- .../tools/leveldesign/georges_plugin_sound/std_sound_plugin.h | 2 +- code/ryzom/tools/leveldesign/mission_compiler_fe/StdAfx.h | 2 +- .../ryzom/tools/leveldesign/world_editor/world_editor/stdafx.h | 2 +- .../world_editor/world_editor_fauna_graph_plugin/StdAfx.h | 2 +- .../world_editor/world_editor_graph_plugin/StdAfx.h | 2 +- .../world_editor_primitive_plugin/primitive_plugin.h | 2 ++ .../world_editor/world_editor_shard_monitor_plugin/StdAfx.h | 2 +- .../world_editor/world_editor_sound_plugin/StdAfx.h | 2 +- 16 files changed, 22 insertions(+), 11 deletions(-) diff --git a/code/nel/tools/3d/object_viewer/std_afx.h b/code/nel/tools/3d/object_viewer/std_afx.h index 26839edd2..0cf664508 100644 --- a/code/nel/tools/3d/object_viewer/std_afx.h +++ b/code/nel/tools/3d/object_viewer/std_afx.h @@ -23,8 +23,8 @@ #endif // _MSC_VER > 1000 #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers - #define NOMINMAX +#define _WIN32_WINNT 0x0501 #include // MFC core and standard components #include // MFC extensions diff --git a/code/nel/tools/3d/object_viewer_exe/std_afx.h b/code/nel/tools/3d/object_viewer_exe/std_afx.h index d083067e7..953342427 100644 --- a/code/nel/tools/3d/object_viewer_exe/std_afx.h +++ b/code/nel/tools/3d/object_viewer_exe/std_afx.h @@ -23,8 +23,9 @@ #endif // _MSC_VER > 1000 #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers - #define NOMINMAX +#define _WIN32_WINNT 0x0501 + #include #endif diff --git a/code/nel/tools/logic/logic_editor_dll/StdAfx.h b/code/nel/tools/logic/logic_editor_dll/StdAfx.h index 5b5e991ce..7aec1acb4 100644 --- a/code/nel/tools/logic/logic_editor_dll/StdAfx.h +++ b/code/nel/tools/logic/logic_editor_dll/StdAfx.h @@ -11,8 +11,8 @@ #endif // _MSC_VER > 1000 #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers - #define NOMINMAX +#define _WIN32_WINNT 0x0501 #include // MFC core and standard components #include // MFC extensions diff --git a/code/nel/tools/misc/branch_patcher/StdAfx.h b/code/nel/tools/misc/branch_patcher/StdAfx.h index d9bd15ce4..b85f337a0 100644 --- a/code/nel/tools/misc/branch_patcher/StdAfx.h +++ b/code/nel/tools/misc/branch_patcher/StdAfx.h @@ -22,6 +22,8 @@ #endif // _MSC_VER > 1000 #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers +#define NOMINMAX +#define _WIN32_WINNT 0x0501 #include // MFC core and standard components #include // MFC extensions diff --git a/code/nel/tools/misc/data_mirror/StdAfx.h b/code/nel/tools/misc/data_mirror/StdAfx.h index a065be4ed..697fe2127 100644 --- a/code/nel/tools/misc/data_mirror/StdAfx.h +++ b/code/nel/tools/misc/data_mirror/StdAfx.h @@ -11,6 +11,8 @@ #endif // _MSC_VER > 1000 #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers +#define NOMINMAX +#define _WIN32_WINNT 0x0501 #include // MFC core and standard components #include // MFC extensions diff --git a/code/nel/tools/misc/log_analyser/StdAfx.h b/code/nel/tools/misc/log_analyser/StdAfx.h index dc6dd46cf..7fdcd1587 100644 --- a/code/nel/tools/misc/log_analyser/StdAfx.h +++ b/code/nel/tools/misc/log_analyser/StdAfx.h @@ -27,6 +27,8 @@ #endif // _MSC_VER > 1000 #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers +#define NOMINMAX +#define _WIN32_WINNT 0x0501 #include // MFC core and standard components #include // MFC extensions diff --git a/code/nel/tools/misc/words_dic/StdAfx.h b/code/nel/tools/misc/words_dic/StdAfx.h index 5cc2d3e5b..9290bdfce 100644 --- a/code/nel/tools/misc/words_dic/StdAfx.h +++ b/code/nel/tools/misc/words_dic/StdAfx.h @@ -22,6 +22,8 @@ #endif // _MSC_VER > 1000 #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers +#define NOMINMAX +#define _WIN32_WINNT 0x0501 #include // MFC core and standard components #include // MFC extensions diff --git a/code/ryzom/tools/leveldesign/georges_dll/stdafx.h b/code/ryzom/tools/leveldesign/georges_dll/stdafx.h index b5d7d2705..3ed671a13 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/stdafx.h +++ b/code/ryzom/tools/leveldesign/georges_dll/stdafx.h @@ -27,7 +27,7 @@ #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers #define NOMINMAX -#define _WIN32_WINNT 0x0500 +#define _WIN32_WINNT 0x0501 #include // MFC core and standard components #include // MFC extensions diff --git a/code/ryzom/tools/leveldesign/georges_plugin_sound/std_sound_plugin.h b/code/ryzom/tools/leveldesign/georges_plugin_sound/std_sound_plugin.h index 9122d1f49..8fb65c948 100644 --- a/code/ryzom/tools/leveldesign/georges_plugin_sound/std_sound_plugin.h +++ b/code/ryzom/tools/leveldesign/georges_plugin_sound/std_sound_plugin.h @@ -19,7 +19,7 @@ #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers #define NOMINMAX -#define _WIN32_WINNT 0x0500 +#define _WIN32_WINNT 0x0501 #include // MFC core and standard components #include // MFC extensions diff --git a/code/ryzom/tools/leveldesign/mission_compiler_fe/StdAfx.h b/code/ryzom/tools/leveldesign/mission_compiler_fe/StdAfx.h index 3732ca0f8..b8693c571 100644 --- a/code/ryzom/tools/leveldesign/mission_compiler_fe/StdAfx.h +++ b/code/ryzom/tools/leveldesign/mission_compiler_fe/StdAfx.h @@ -28,7 +28,7 @@ #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers #define NOMINMAX -#define _WIN32_WINNT 0x0500 +#define _WIN32_WINNT 0x0501 #include // MFC core and standard components #include // MFC extensions diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor/stdafx.h b/code/ryzom/tools/leveldesign/world_editor/world_editor/stdafx.h index d57756cb8..c8b41e3fd 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor/stdafx.h +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor/stdafx.h @@ -26,7 +26,7 @@ #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers #define NOMINMAX -#define _WIN32_WINNT 0x0500 +#define _WIN32_WINNT 0x0501 #include // MFC core and standard components #include // MFC extensions diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor_fauna_graph_plugin/StdAfx.h b/code/ryzom/tools/leveldesign/world_editor/world_editor_fauna_graph_plugin/StdAfx.h index ce6eca86c..58043f752 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor_fauna_graph_plugin/StdAfx.h +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor_fauna_graph_plugin/StdAfx.h @@ -28,7 +28,7 @@ #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers #define NOMINMAX -#define _WIN32_WINNT 0x0500 +#define _WIN32_WINNT 0x0501 #include diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor_graph_plugin/StdAfx.h b/code/ryzom/tools/leveldesign/world_editor/world_editor_graph_plugin/StdAfx.h index 1d240ae08..9beea91c6 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor_graph_plugin/StdAfx.h +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor_graph_plugin/StdAfx.h @@ -28,7 +28,7 @@ #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers #define NOMINMAX -#define _WIN32_WINNT 0x0500 +#define _WIN32_WINNT 0x0501 #include diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor_primitive_plugin/primitive_plugin.h b/code/ryzom/tools/leveldesign/world_editor/world_editor_primitive_plugin/primitive_plugin.h index 104f9d007..8b452cd80 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor_primitive_plugin/primitive_plugin.h +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor_primitive_plugin/primitive_plugin.h @@ -18,6 +18,8 @@ #define PRIMITIVE_PLUGIN_H #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers +#define NOMINMAX +#define _WIN32_WINNT 0x0501 #include // MFC core and standard components #include // MFC extensions diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor_shard_monitor_plugin/StdAfx.h b/code/ryzom/tools/leveldesign/world_editor/world_editor_shard_monitor_plugin/StdAfx.h index 9b8256d5e..c62c05e5b 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor_shard_monitor_plugin/StdAfx.h +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor_shard_monitor_plugin/StdAfx.h @@ -30,7 +30,7 @@ #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers #define NOMINMAX -#define _WIN32_WINNT 0x0500 +#define _WIN32_WINNT 0x0501 #include // MFC core and standard components #include // MFC extensions diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor_sound_plugin/StdAfx.h b/code/ryzom/tools/leveldesign/world_editor/world_editor_sound_plugin/StdAfx.h index 23a0b70ad..33e78a8b1 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor_sound_plugin/StdAfx.h +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor_sound_plugin/StdAfx.h @@ -30,7 +30,7 @@ #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers #define NOMINMAX -#define _WIN32_WINNT 0x0500 +#define _WIN32_WINNT 0x0501 #include // MFC core and standard components #include // MFC extensions From 5e428761c53f68dd9098bab4a7764391fe5a9fe3 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Fri, 10 Jul 2015 06:30:20 +0200 Subject: [PATCH 05/11] Fix freetype include order WINSDK added a fttypes.h header... --HG-- branch : develop --- code/nel/src/3d/CMakeLists.txt | 3 ++- code/nel/src/cegui/CMakeLists.txt | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/code/nel/src/3d/CMakeLists.txt b/code/nel/src/3d/CMakeLists.txt index 21184eb12..0082c22d5 100644 --- a/code/nel/src/3d/CMakeLists.txt +++ b/code/nel/src/3d/CMakeLists.txt @@ -715,7 +715,8 @@ SOURCE_GROUP(Stereo FILES NL_TARGET_LIB(nel3d ${HEADERS} ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${FREETYPE_INCLUDE_DIRS} ${LIBOVR_INCLUDE_DIR} ${LIBVR_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(BEFORE ${FREETYPE_INCLUDE_DIRS}) +INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${LIBOVR_INCLUDE_DIR} ${LIBVR_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nel3d nelmisc ${FREETYPE_LIBRARIES} ${LIBOVR_LIBRARIES} ${LIBVR_LIBRARY}) SET_TARGET_PROPERTIES(nel3d PROPERTIES LINK_INTERFACE_LIBRARIES "") diff --git a/code/nel/src/cegui/CMakeLists.txt b/code/nel/src/cegui/CMakeLists.txt index b815eb139..20fbb60d8 100644 --- a/code/nel/src/cegui/CMakeLists.txt +++ b/code/nel/src/cegui/CMakeLists.txt @@ -3,7 +3,8 @@ FILE(GLOB HEADERS ../../include/nel/cegui/*.h) ADD_LIBRARY(nelceguirenderer SHARED ${HEADERS} ${SRC} nelceguirenderer.def) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${FREETYPE_INC} ${CEGUI_INCLUDE_DIRS}) +INCLUDE_DIRECTORIES(BEFORE ${FREETYPE_INCLUDE_DIRS}) +INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${CEGUI_INCLUDE_DIRS}) TARGET_LINK_LIBRARIES(nelceguirenderer nelmisc nel3d ${CEGUI_LIBRARY}) NL_DEFAULT_PROPS(nelceguirenderer "NeL, Library: CEGUI Renderer") NL_ADD_RUNTIME_FLAGS(nelceguirenderer) From 96116c6ebaecd97d487a679eb29d8398efee19f9 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Fri, 10 Jul 2015 06:33:14 +0200 Subject: [PATCH 06/11] Todo note --HG-- branch : develop --- code/CMakeModules/FindWindowsSDK.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/CMakeModules/FindWindowsSDK.cmake b/code/CMakeModules/FindWindowsSDK.cmake index 4b7d03f0b..dbcb48931 100644 --- a/code/CMakeModules/FindWindowsSDK.cmake +++ b/code/CMakeModules/FindWindowsSDK.cmake @@ -37,7 +37,7 @@ MACRO(DETECT_WINSDK_VERSION _VERSION) ENDIF(NOT WINSDK${_VERSION}_FOUND) ENDMACRO(DETECT_WINSDK_VERSION) -SET(WINSDK_VERSIONS "8.1" "8.0" "8.0A" "7.1" "7.1A" "7.0" "7.0A" "6.1" "6.0" "6.0A") +SET(WINSDK_VERSIONS "8.1" "8.0" "7.1" "7.1A" "7.0" "7.0A" "6.1" "6.0" "6.0A") SET(WINSDK_DETECTED_VERSIONS) # Search all supported Windows SDKs @@ -334,7 +334,7 @@ IF(WINSDK_INCLUDE_DIR) SET(WINSDK_FOUND ON) SET(WINSDK_INCLUDE_DIRS ${WINSDK_INCLUDE_DIR} ${WINSDK_SHARED_INCLUDE_DIR} ${WINSDK_OPENGL_INCLUDE_DIR}) SET(CMAKE_LIBRARY_PATH ${WINSDK_LIBRARY_DIR} ${CMAKE_LIBRARY_PATH}) - INCLUDE_DIRECTORIES(${WINSDK_INCLUDE_DIRS}) + INCLUDE_DIRECTORIES(${WINSDK_INCLUDE_DIRS}) # TODO: Move this after all other includes somehow... # Fix for using Windows SDK 7.1 with Visual C++ 2012 IF(WINSDK_VERSION STREQUAL "7.1" AND MSVC11) From 7d53552979835951ef73c988ecf20326c89c25a8 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Fri, 10 Jul 2015 07:54:34 +0200 Subject: [PATCH 07/11] Fix object viewer include issue --HG-- branch : develop --- code/nel/src/3d/font_generator.cpp | 5 ++++- code/nel/tools/3d/object_viewer/object_viewer.cpp | 9 +++++++-- code/nel/tools/3d/object_viewer/particle_dlg.cpp | 1 - 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/code/nel/src/3d/font_generator.cpp b/code/nel/src/3d/font_generator.cpp index 3c73a0a20..21453ba82 100644 --- a/code/nel/src/3d/font_generator.cpp +++ b/code/nel/src/3d/font_generator.cpp @@ -76,7 +76,10 @@ const char *CFontGenerator::getFT2Error(FT_Error fte) return ukn; } - +CFontGenerator *newCFontGenerator(const std::string &fontFileName) +{ + return new CFontGenerator(fontFileName); +} /* * Constructor diff --git a/code/nel/tools/3d/object_viewer/object_viewer.cpp b/code/nel/tools/3d/object_viewer/object_viewer.cpp index d79090662..c6f163146 100644 --- a/code/nel/tools/3d/object_viewer/object_viewer.cpp +++ b/code/nel/tools/3d/object_viewer/object_viewer.cpp @@ -36,7 +36,6 @@ #include "nel/3d/scene_group.h" #include "nel/3d/animation_playlist.h" #include "nel/3d/track_keyframer.h" -#include "nel/3d/font_generator.h" #include "nel/3d/register_3d.h" #include "nel/3d/seg_remanence.h" @@ -592,6 +591,12 @@ void CObjectViewer::initCamera () // *************************************************************************** +namespace NL3D { + CFontGenerator *newCFontGenerator(const std::string &fontFileName); +} + +// *************************************************************************** + bool CObjectViewer::initUI (HWND parent) { AFX_MANAGE_STATE(AfxGetStaticModuleState()); @@ -616,7 +621,7 @@ bool CObjectViewer::initUI (HWND parent) _FontPath+="\\fonts\\arial.ttf"; // The font generator - _FontGenerator = new NL3D::CFontGenerator ( _FontPath ); + _FontGenerator = NL3D::newCFontGenerator ( _FontPath ); delete[] wd; // The viewport diff --git a/code/nel/tools/3d/object_viewer/particle_dlg.cpp b/code/nel/tools/3d/object_viewer/particle_dlg.cpp index 7ee628da4..f56bfa1dd 100644 --- a/code/nel/tools/3d/object_viewer/particle_dlg.cpp +++ b/code/nel/tools/3d/object_viewer/particle_dlg.cpp @@ -44,7 +44,6 @@ #include "nel/3d/texture_grouped.h" #include "nel/3d/nelu.h" #include "nel/3d/font_manager.h" -#include "nel/3d/font_generator.h" // #include "nel/misc/file.h" #include "start_stop_particle_system.h" From 08e5345e144db495f02848dd352d2812e3f7cb73 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Tue, 11 Aug 2015 19:35:27 +0300 Subject: [PATCH 08/11] Fix 'ah:' urls for untrusted domains --HG-- branch : develop --- code/nel/src/gui/group_html.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 0c9ee58a0..f2df454cb 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -709,10 +709,12 @@ namespace NLGUI if (present[MY_HTML_A_HREF] && value[MY_HTML_A_HREF]) { string suri = value[MY_HTML_A_HREF]; - if(_TrustedDomain && suri.find("ah:") == 0) + if(suri.find("ah:") == 0) { - // in ah: command we don't respect the uri standard so the HTAnchor_address doesn't work correctly - _Link.push_back (suri); + if (_TrustedDomain) + _Link.push_back (suri); + else + _Link.push_back (""); } else if (_TrustedDomain && suri[0] == '#') { From 9459224f23f4fe200b8a652c460120148c1fe052 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 22 Sep 2015 09:43:24 +0200 Subject: [PATCH 09/11] Fixed: GetVersionEx deprecated under Windows 8.1+ and returns wrong version, replace it by RtlGetVersion from kernel --HG-- branch : develop --- code/nel/src/misc/system_info.cpp | 39 ++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/code/nel/src/misc/system_info.cpp b/code/nel/src/misc/system_info.cpp index 8524939c8..a5b78c08b 100644 --- a/code/nel/src/misc/system_info.cpp +++ b/code/nel/src/misc/system_info.cpp @@ -185,11 +185,12 @@ string CSystemInfo::getOS() typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO); typedef BOOL (WINAPI *PGPI)(DWORD, DWORD, DWORD, DWORD, PDWORD); + typedef LONG (WINAPI* pRtlGetVersion)(OSVERSIONINFOEXA*); SYSTEM_INFO si; PGNSI pGNSI; PGPI pGPI; - OSVERSIONINFOEX osvi; + OSVERSIONINFOEXA osvi; BOOL bOsVersionInfoEx; const int BUFSIZE = 80; @@ -197,15 +198,26 @@ string CSystemInfo::getOS() // If that fails, try using the OSVERSIONINFO structure. ZeroMemory(&si, sizeof(SYSTEM_INFO)); - ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); + ZeroMemory(&osvi, sizeof(osvi)); + osvi.dwOSVersionInfoSize = sizeof(osvi); - bOsVersionInfoEx = GetVersionExA ((OSVERSIONINFO *) &osvi); + HMODULE hNtDll = GetModuleHandleA("ntdll.dll"); + pRtlGetVersion RtlGetVersion = (pRtlGetVersion)GetProcAddress(hNtDll, "RtlGetVersion"); + + if (RtlGetVersion) + { + bOsVersionInfoEx = RtlGetVersion(&osvi) == 0; + } if(!bOsVersionInfoEx) { - osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); - if (! GetVersionExA ( (OSVERSIONINFO *) &osvi) ) + bOsVersionInfoEx = GetVersionExA ((OSVERSIONINFOA *) &osvi); + } + + if(!bOsVersionInfoEx) + { + osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFOA); + if (! GetVersionExA ( (OSVERSIONINFOA *) &osvi) ) return OSString+" Can't GetVersionEx()"; } @@ -223,13 +235,24 @@ string CSystemInfo::getOS() { OSString = "Microsoft"; - if ( osvi.dwMajorVersion > 6 ) + if ( osvi.dwMajorVersion > 10 ) { OSString += " Windows (not released)"; } + else if ( osvi.dwMajorVersion == 10 ) + { + OSString += " Windows 10"; + } else if ( osvi.dwMajorVersion == 6 ) { - if ( osvi.dwMinorVersion == 2 ) + if ( osvi.dwMinorVersion == 3 ) + { + if( osvi.wProductType == VER_NT_WORKSTATION ) + OSString += " Windows 8.1"; + else + OSString += " Windows Server 2012 R2"; + } + else if ( osvi.dwMinorVersion == 2 ) { if( osvi.wProductType == VER_NT_WORKSTATION ) OSString += " Windows 8"; From 00c36d3ac4ebffa8bc4921f2f6519485949d7702 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 22 Sep 2015 09:46:51 +0200 Subject: [PATCH 10/11] Changed: If Width and Height are invalid, use current screen mode --HG-- branch : develop --- code/ryzom/client/src/init.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index a6883eacd..9b5e5ca10 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -953,6 +953,22 @@ void prelogInit() return; } + if (ClientCfg.Width <= 0 || ClientCfg.Height <= 0) + { + UDriver::CMode mode; + + if (!ClientCfg.Windowed && Driver->getCurrentScreenMode(mode)) + { + ClientCfg.Width = mode.Width; + ClientCfg.Height = mode.Height; + } + else + { + ClientCfg.Width = 1024; + ClientCfg.Height = 768; + } + } + CLoginProgressPostThread::getInstance().step(CLoginStep(LoginStep_VideoModeSetup, "login_step_video_mode_setup")); FPU_CHECKER_ONCE From 67c6edc9ae77c95a11873f54ddd57c0b037b7c05 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 22 Sep 2015 09:55:06 +0200 Subject: [PATCH 11/11] Changed: Use invalid screen mode by default (will be overridden by config files) --HG-- branch : develop --- code/ryzom/client/src/client_cfg.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index 6cde86cba..ff86b5091 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -295,8 +295,8 @@ CClientConfig::CClientConfig() SelectedSlot = 0; // Default is slot 0 Windowed = false; // Default is windowed mode. - Width = 800; // Default Width for the window. - Height = 600; // Default Height for the window. + Width = 0; // Default Width for the window (0 = current screen resolution). + Height = 0; // Default Height for the window (0 = current screen resolution). Depth = 32; // Default Bit per Pixel. Driver3D = DrvAuto; // Select best driver depending on hardware. Contrast = 0.f; // Default Monitor Contrast. @@ -1747,7 +1747,7 @@ void CClientConfig::setValues() // Allow warning display only first time. DisplayCFGWarning= false; - // If it is the load time, bkup the ClientCfg into LastClientCfg + // If it is the load time, backup the ClientCfg into LastClientCfg if(firstTimeSetValues) LastClientCfg = ClientCfg;