From 1a00dec5c34b855ef7542faade172e352cf3bb51 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 2 Jan 2016 22:23:04 +0100 Subject: [PATCH 1/4] Changed: Unused code --HG-- branch : develop --- code/nel/src/misc/bitmap.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/code/nel/src/misc/bitmap.cpp b/code/nel/src/misc/bitmap.cpp index 2d92cd354..107f79e55 100644 --- a/code/nel/src/misc/bitmap.cpp +++ b/code/nel/src/misc/bitmap.cpp @@ -2163,13 +2163,11 @@ uint8 CBitmap::readTGA( NLMISC::IStream &f) // Determining whether file is in Original or New TGA format - bool newTgaFormat; uint32 extAreaOffset; uint32 devDirectoryOffset; char signature[16]; f.seek (0, f.end); - newTgaFormat = false; if (f.getPos() >= 26) { f.seek (-26, f.end); @@ -2179,8 +2177,6 @@ uint8 CBitmap::readTGA( NLMISC::IStream &f) { f.serial(signature[i]); } - if(strncmp(signature,"TRUEVISION-XFILE",16)==0) - newTgaFormat = true; } From de0df1645b3dda1779ee3751c3e8622f8e0ae700 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 2 Jan 2016 22:23:49 +0100 Subject: [PATCH 2/4] Changed: Don't create bundle for Ryzom client tools (we will try to package them in same bundle) --HG-- branch : develop --- code/nel/tools/misc/crash_report/CMakeLists.txt | 3 +-- code/ryzom/tools/client/client_config_qt/CMakeLists.txt | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/code/nel/tools/misc/crash_report/CMakeLists.txt b/code/nel/tools/misc/crash_report/CMakeLists.txt index d230177f8..c1dc661ae 100644 --- a/code/nel/tools/misc/crash_report/CMakeLists.txt +++ b/code/nel/tools/misc/crash_report/CMakeLists.txt @@ -37,11 +37,10 @@ SOURCE_GROUP(QtGeneratedMocQrcSrc FILES ${CRASHREPORT_MOC_SRC}) SOURCE_GROUP("source files" FILES ${CRASHREPORT_SRC}) SOURCE_GROUP("header files" FILES ${CRASHREPORT_HDR}) -ADD_EXECUTABLE(crash_report WIN32 MACOSX_BUNDLE ${CRASHREPORT_SRC} ${CRASHREPORT_HDR} ${CRASHREPORT_MOC_SRC} ${CRASHREPORT_UI_HDR}) +ADD_EXECUTABLE(crash_report WIN32 ${CRASHREPORT_SRC} ${CRASHREPORT_HDR} ${CRASHREPORT_MOC_SRC} ${CRASHREPORT_UI_HDR}) TARGET_LINK_LIBRARIES(crash_report ${QT_LIBRARIES}) NL_DEFAULT_PROPS(crash_report "NeL, Tools, Misc: Crash Report") NL_ADD_RUNTIME_FLAGS(crash_report) INSTALL(TARGETS crash_report RUNTIME DESTINATION ${NL_BIN_PREFIX}) - diff --git a/code/ryzom/tools/client/client_config_qt/CMakeLists.txt b/code/ryzom/tools/client/client_config_qt/CMakeLists.txt index 83b07623c..f0bb295b3 100644 --- a/code/ryzom/tools/client/client_config_qt/CMakeLists.txt +++ b/code/ryzom/tools/client/client_config_qt/CMakeLists.txt @@ -58,7 +58,7 @@ SOURCE_GROUP("Forms" FILES ${CLIENT_CONFIG_UIS}) SOURCE_GROUP("Generated Files" FILES ${CLIENT_CONFIG_UI_HDRS} ${CLIENT_CONFIG_MOC_SRC}) SOURCE_GROUP("Translation Files" FILES ${CLIENT_CONFIG_TRANS} ) -ADD_EXECUTABLE(ryzom_configuration_qt WIN32 MACOSX_BUNDLE ${SRC} ${CLIENT_CONFIG_MOC_SRC} ${CLIENT_CONFIG_UI_HDRS} ${CLIENT_CONFIG_RC_SRCS} ${CLIENT_CONFIG_TRANS} ${CLIENT_CONFIG_QM}) +ADD_EXECUTABLE(ryzom_configuration_qt WIN32 ${SRC} ${CLIENT_CONFIG_MOC_SRC} ${CLIENT_CONFIG_UI_HDRS} ${CLIENT_CONFIG_RC_SRCS} ${CLIENT_CONFIG_TRANS} ${CLIENT_CONFIG_QM}) NL_DEFAULT_PROPS(ryzom_configuration_qt "Ryzom, Tools: Ryzom Configuration Qt" ) NL_ADD_RUNTIME_FLAGS( ryzom_configuration_qt ) NL_ADD_LIB_SUFFIX( ryzom_configuration_qt ) @@ -68,5 +68,4 @@ IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(ryzom_configuration_qt ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) ENDIF() -INSTALL(TARGETS ryzom_configuration_qt RUNTIME DESTINATION ${RYZOM_GAMES_PREFIX} COMPONENT client BUNDLE DESTINATION /Applications) - +INSTALL(TARGETS ryzom_configuration_qt RUNTIME DESTINATION ${RYZOM_GAMES_PREFIX} COMPONENT client) From 12c4adf9438098255c008e22e1e510d3bedab57e Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 2 Jan 2016 22:24:16 +0100 Subject: [PATCH 3/4] Changed: Minor changes --HG-- branch : develop --- code/nel/src/3d/font_manager.cpp | 3 - code/ryzom/client/src/CMakeLists.txt | 294 +++++++++++++-------------- 2 files changed, 146 insertions(+), 151 deletions(-) diff --git a/code/nel/src/3d/font_manager.cpp b/code/nel/src/3d/font_manager.cpp index 45a097b3b..7b503099b 100644 --- a/code/nel/src/3d/font_manager.cpp +++ b/code/nel/src/3d/font_manager.cpp @@ -304,9 +304,6 @@ void CFontManager::computeStringInfo ( const ucstring &s, // *************************************************************************** string CFontManager::getCacheInformation() const { -// stringstream ss; -// ss << "MaxMemory: " << (uint) _MaxMemory << " MemSize: " << (uint) _MemSize << " NbChar: " << (uint) _NbChar; -// return ss.str(); string str; str = "MaxMemory: " + NLMISC::toString(_MaxMemory) + " MemSize: " + NLMISC::toString(_MemSize) + " NbChar: " + NLMISC::toString(_NbChar); return str; diff --git a/code/ryzom/client/src/CMakeLists.txt b/code/ryzom/client/src/CMakeLists.txt index ef08de45c..588073d7d 100644 --- a/code/ryzom/client/src/CMakeLists.txt +++ b/code/ryzom/client/src/CMakeLists.txt @@ -2,170 +2,168 @@ ADD_SUBDIRECTORY(client_sheets) IF(WITH_RYZOM_CLIENT) + # These are Windows/MFC apps + SET(SEVENZIP_LIBRARY "ryzom_sevenzip") -# These are Windows/MFC apps -SET(SEVENZIP_LIBRARY "ryzom_sevenzip") + ADD_SUBDIRECTORY(seven_zip) -ADD_SUBDIRECTORY(seven_zip) + IF(WITH_RYZOM_PATCH) + ADD_DEFINITIONS(-DRZ_USE_PATCH) -IF(WITH_RYZOM_PATCH) - ADD_DEFINITIONS(-DRZ_USE_PATCH) - - IF(WITH_RYZOM_CUSTOM_PATCH_SERVER) - ADD_DEFINITIONS(-DRZ_USE_CUSTOM_PATCH_SERVER) - ENDIF() -ENDIF() - -FILE(GLOB CFG ../*.cfg) -FILE(GLOB SRC *.cpp *.h motion/*.cpp motion/*.h client.rc) -FILE(GLOB SRC_INTERFACE interface_v3/*.h interface_v3/*.cpp) -FILE(GLOB SRC_MODE motion/modes/*.cpp motion/modes/*.h) -FILE(GLOB SRC_R2 r2/*.h r2/*.cpp r2/dmc/*.h r2/dmc/*.cpp) - -# Filter out the source files not actually compiled. -LIST(REMOVE_ITEM SRC - ${CMAKE_CURRENT_SOURCE_DIR}/animated_scene_object.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/animated_scene_object.h - ${CMAKE_CURRENT_SOURCE_DIR}/animation_fx_sheet.h - ${CMAKE_CURRENT_SOURCE_DIR}/animation_fx_sheet.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/3d_notes.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/3d_notes.h - ${CMAKE_CURRENT_SOURCE_DIR}/rosace_functions.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/rosace_functions.h - ${CMAKE_CURRENT_SOURCE_DIR}/scene_parser.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/scene_parser.h) -LIST(REMOVE_ITEM SRC_MODE - ${CMAKE_CURRENT_SOURCE_DIR}/motion/modes/free_head.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/motion/modes/free_head.h) -LIST(REMOVE_ITEM SRC_INTERFACE - ${CMAKE_CURRENT_SOURCE_DIR}/interface_v3/lua_dll.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/interface_v3/lua_dll.h - ${CMAKE_CURRENT_SOURCE_DIR}/interface_v3/view_bitmap_progress.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/interface_v3/view_bitmap_progress.h) - -SOURCE_GROUP("" FILES ${SRC}) -SOURCE_GROUP("cfg" FILES ${CFG}) -SOURCE_GROUP("interface_v3" FILES ${SRC_INTERFACE}) -SOURCE_GROUP("mode" FILES ${SRC_MODE}) -SOURCE_GROUP("r2" FILES ${SRC_R2}) - -# on Mac, create a .App Bundle -if(APPLE) - SET(MACOSX_BUNDLE_INFO_STRING "Ryzom Core Client") - SET(MACOSX_BUNDLE_ICON_FILE "ryzom.icns") - SET(MACOSX_BUNDLE_GUI_IDENTIFIER "") - SET(MACOSX_BUNDLE_LONG_VERSION_STRING ${RYZOM_VERSION}) - SET(MACOSX_BUNDLE_BUNDLE_NAME "Ryzom Core Client") - SET(MACOSX_BUNDLE_SHORT_VERSION_STRING ${RYZOM_VERSION}) - SET(MACOSX_BUNDLE_BUNDLE_VERSION "1.0") - SET(MACOSX_BUNDLE_COPYRIGHT ${COPYRIGHT}) - SET(RYZOM_OUTPUT_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${MACOSX_BUNDLE_BUNDLE_NAME}.app) - SET(RYZOM_CONTENTS_DIR ${RYZOM_OUTPUT_DIR}/Contents) - SET(RYZOM_RESOURCES_DIR ${RYZOM_CONTENTS_DIR}/Resources) - SET(MAC_RESOURCES_DIR ${CMAKE_SOURCE_DIR}/ryzom/client/macosx) -ENDIF() - -ADD_EXECUTABLE(ryzom_client WIN32 MACOSX_BUNDLE ${SRC} ${SRC_INTERFACE} ${SRC_MODE} ${SRC_R2}) - -IF(APPLE) - SET_TARGET_PROPERTIES(ryzom_client PROPERTIES OUTPUT_NAME ${MACOSX_BUNDLE_BUNDLE_NAME}) - SET_TARGET_PROPERTIES(ryzom_client PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${MAC_RESOURCES_DIR}/Info.plist) - ADD_CUSTOM_COMMAND(TARGET ryzom_client PRE_BUILD COMMAND mkdir -p ${RYZOM_RESOURCES_DIR}) - ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp ARGS -p ${MAC_RESOURCES_DIR}/PkgInfo ${RYZOM_CONTENTS_DIR}) - ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp ARGS -p ${MAC_RESOURCES_DIR}/ryzom.icns ${RYZOM_RESOURCES_DIR}) - ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp ARGS -p ${CMAKE_SOURCE_DIR}/ryzom/client/client_default.cfg ${RYZOM_RESOURCES_DIR}) - - IF(RYZOM_DATA_DIR) - ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp ARGS -RpX ${RYZOM_DATA_DIR} ${RYZOM_RESOURCES_DIR}) - ENDIF() - - IF(APPLE_CERTIFICATE) - # Find codesign_allocate - - # Xcode 7.0 and later versions - SET(CODESIGN_ALLOCATE ${OSX_DEVELOPER_ROOT}/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate) - - IF(NOT EXISTS "${CODESIGN_ALLOCATE}") - # Xcode 6.4 and previous versions - SET(CODESIGN_ALLOCATE ${CMAKE_OSX_SYSROOT}/usr/bin/codesign_allocate) - ENDIF() - - IF(NOT EXISTS "${CODESIGN_ALLOCATE}") - # System path - SET(CODESIGN_ALLOCATE /usr/bin/codesign_allocate) - ENDIF() - - IF(NOT EXISTS "${CODESIGN_ALLOCATE}") - MESSAGE(WARNING "Unable to find codesign_allocate in standard directories") - ELSE() - ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign -fs "${APPLE_CERTIFICATE}" "${RYZOM_OUTPUT_DIR}" COMMENT "Signing bundle...") + IF(WITH_RYZOM_CUSTOM_PATCH_SERVER) + ADD_DEFINITIONS(-DRZ_USE_CUSTOM_PATCH_SERVER) ENDIF() ENDIF() -ENDIF() -INCLUDE_DIRECTORIES( - ${CMAKE_CURRENT_SOURCE_DIR} - ${LIBXML2_INCLUDE_DIR} - ${LUA_INCLUDE_DIR} - ${LUABIND_INCLUDE_DIR} - ${CURL_INCLUDE_DIRS} - ${ZLIB_INCLUDE_DIR} -) + FILE(GLOB CFG ../*.cfg) + FILE(GLOB SRC *.cpp *.h motion/*.cpp motion/*.h client.rc) + FILE(GLOB SRC_INTERFACE interface_v3/*.h interface_v3/*.cpp) + FILE(GLOB SRC_MODE motion/modes/*.cpp motion/modes/*.h) + FILE(GLOB SRC_R2 r2/*.h r2/*.cpp r2/dmc/*.h r2/dmc/*.cpp) -TARGET_LINK_LIBRARIES(ryzom_client - nelmisc - nelnet - nelligo - nelgeorges - nel3d - nelgui - nelsound - ryzom_clientsheets - ryzom_gameshare - nelpacs - ${LIBXML2_LIBRARIES} - ${LUA_LIBRARIES} - ${LUABIND_LIBRARIES} - ${CURL_LIBRARIES} - ${SEVENZIP_LIBRARY} -) + # Filter out the source files not actually compiled. + LIST(REMOVE_ITEM SRC + ${CMAKE_CURRENT_SOURCE_DIR}/animated_scene_object.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/animated_scene_object.h + ${CMAKE_CURRENT_SOURCE_DIR}/animation_fx_sheet.h + ${CMAKE_CURRENT_SOURCE_DIR}/animation_fx_sheet.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/3d_notes.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/3d_notes.h + ${CMAKE_CURRENT_SOURCE_DIR}/rosace_functions.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rosace_functions.h + ${CMAKE_CURRENT_SOURCE_DIR}/scene_parser.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/scene_parser.h) + LIST(REMOVE_ITEM SRC_MODE + ${CMAKE_CURRENT_SOURCE_DIR}/motion/modes/free_head.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/motion/modes/free_head.h) + LIST(REMOVE_ITEM SRC_INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR}/interface_v3/lua_dll.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/interface_v3/lua_dll.h + ${CMAKE_CURRENT_SOURCE_DIR}/interface_v3/view_bitmap_progress.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/interface_v3/view_bitmap_progress.h) -IF(NOT APPLE AND NOT WIN32) - TARGET_LINK_LIBRARIES(ryzom_client ${X11_LIBRARIES}) -ENDIF() + SOURCE_GROUP("" FILES ${SRC}) + SOURCE_GROUP("cfg" FILES ${CFG}) + SOURCE_GROUP("interface_v3" FILES ${SRC_INTERFACE}) + SOURCE_GROUP("mode" FILES ${SRC_MODE}) + SOURCE_GROUP("r2" FILES ${SRC_R2}) -IF(APPLE) - FIND_LIBRARY(FOUNDATION_LIBRARY Foundation) - TARGET_LINK_LIBRARIES(ryzom_client ${FOUNDATION_LIBRARY}) -ENDIF() + # on Mac, create a .App Bundle + if(APPLE) + SET(MACOSX_BUNDLE_INFO_STRING "Ryzom Core Client") + SET(MACOSX_BUNDLE_ICON_FILE "ryzom.icns") + SET(MACOSX_BUNDLE_GUI_IDENTIFIER "") + SET(MACOSX_BUNDLE_LONG_VERSION_STRING ${RYZOM_VERSION}) + SET(MACOSX_BUNDLE_BUNDLE_NAME "Ryzom Core Client") + SET(MACOSX_BUNDLE_SHORT_VERSION_STRING ${RYZOM_VERSION}) + SET(MACOSX_BUNDLE_BUNDLE_VERSION "1.0") + SET(MACOSX_BUNDLE_COPYRIGHT ${COPYRIGHT}) + SET(RYZOM_OUTPUT_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${MACOSX_BUNDLE_BUNDLE_NAME}.app) + SET(RYZOM_CONTENTS_DIR ${RYZOM_OUTPUT_DIR}/Contents) + SET(RYZOM_RESOURCES_DIR ${RYZOM_CONTENTS_DIR}/Resources) + SET(MAC_RESOURCES_DIR ${CMAKE_SOURCE_DIR}/ryzom/client/macosx) + ENDIF() -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} ${CURL_DEFINITIONS} ${LUABIND_DEFINITIONS}) + ADD_EXECUTABLE(ryzom_client WIN32 MACOSX_BUNDLE ${SRC} ${SRC_INTERFACE} ${SRC_MODE} ${SRC_R2}) -NL_DEFAULT_PROPS(ryzom_client "Ryzom, Client: Ryzom Core Client") -NL_ADD_RUNTIME_FLAGS(ryzom_client) + IF(APPLE) + SET_TARGET_PROPERTIES(ryzom_client PROPERTIES OUTPUT_NAME ${MACOSX_BUNDLE_BUNDLE_NAME}) + SET_TARGET_PROPERTIES(ryzom_client PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${MAC_RESOURCES_DIR}/Info.plist) + ADD_CUSTOM_COMMAND(TARGET ryzom_client PRE_BUILD COMMAND mkdir -p ${RYZOM_RESOURCES_DIR}) + ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp ARGS -p ${MAC_RESOURCES_DIR}/PkgInfo ${RYZOM_CONTENTS_DIR}) + ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp ARGS -p ${MAC_RESOURCES_DIR}/ryzom.icns ${RYZOM_RESOURCES_DIR}) + ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp ARGS -p ${CMAKE_SOURCE_DIR}/ryzom/client/client_default.cfg ${RYZOM_RESOURCES_DIR}) -IF(FINAL_VERSION) - NL_ADD_LIB_SUFFIX(ryzom_client) -ELSE() - IF(WIN32) - SET_TARGET_PROPERTIES(ryzom_client PROPERTIES DEBUG_POSTFIX "_dev_d" RELEASE_POSTFIX "_dev_r") + IF(RYZOM_DATA_DIR) + ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp ARGS -RpX ${RYZOM_DATA_DIR} ${RYZOM_RESOURCES_DIR}) + ENDIF() + + IF(APPLE_CERTIFICATE) + # Find codesign_allocate + + # Xcode 7.0 and later versions + SET(CODESIGN_ALLOCATE ${OSX_DEVELOPER_ROOT}/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate) + + IF(NOT EXISTS "${CODESIGN_ALLOCATE}") + # Xcode 6.4 and previous versions + SET(CODESIGN_ALLOCATE ${CMAKE_OSX_SYSROOT}/usr/bin/codesign_allocate) + ENDIF() + + IF(NOT EXISTS "${CODESIGN_ALLOCATE}") + # System path + SET(CODESIGN_ALLOCATE /usr/bin/codesign_allocate) + ENDIF() + + IF(NOT EXISTS "${CODESIGN_ALLOCATE}") + MESSAGE(WARNING "Unable to find codesign_allocate in standard directories") + ELSE() + ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign -fs "${APPLE_CERTIFICATE}" "${RYZOM_OUTPUT_DIR}" COMMENT "Signing bundle...") + ENDIF() + ENDIF() + ENDIF() + + INCLUDE_DIRECTORIES( + ${CMAKE_CURRENT_SOURCE_DIR} + ${LIBXML2_INCLUDE_DIR} + ${LUA_INCLUDE_DIR} + ${LUABIND_INCLUDE_DIR} + ${CURL_INCLUDE_DIRS} + ${ZLIB_INCLUDE_DIR} + ) + + TARGET_LINK_LIBRARIES(ryzom_client + nelmisc + nelnet + nelligo + nelgeorges + nel3d + nelgui + nelsound + ryzom_clientsheets + ryzom_gameshare + nelpacs + ${LIBXML2_LIBRARIES} + ${LUA_LIBRARIES} + ${LUABIND_LIBRARIES} + ${CURL_LIBRARIES} + ${SEVENZIP_LIBRARY} + ) + + IF(NOT APPLE AND NOT WIN32) + TARGET_LINK_LIBRARIES(ryzom_client ${X11_LIBRARIES}) + ENDIF() + + IF(APPLE) + FIND_LIBRARY(FOUNDATION_LIBRARY Foundation) + TARGET_LINK_LIBRARIES(ryzom_client ${FOUNDATION_LIBRARY}) + ENDIF() + + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} ${CURL_DEFINITIONS} ${LUABIND_DEFINITIONS}) + + NL_DEFAULT_PROPS(ryzom_client "Ryzom, Client: Ryzom Core Client") + NL_ADD_RUNTIME_FLAGS(ryzom_client) + + IF(FINAL_VERSION) + NL_ADD_LIB_SUFFIX(ryzom_client) ELSE() - SET_TARGET_PROPERTIES(ryzom_client PROPERTIES POSTFIX "_dev") + IF(WIN32) + SET_TARGET_PROPERTIES(ryzom_client PROPERTIES DEBUG_POSTFIX "_dev_d" RELEASE_POSTFIX "_dev_r") + ELSE() + SET_TARGET_PROPERTIES(ryzom_client PROPERTIES POSTFIX "_dev") + ENDIF() ENDIF() -ENDIF() -IF(WITH_RYZOM_CLIENT_UAC) - IF(CMAKE_GENERATOR MATCHES "Visual Studio") - SET_PROPERTY(TARGET ryzom_client PROPERTY LINK_FLAGS_RELEASE "/level='requireAdministrator'") - ELSEIF(CMAKE_GENERATOR MATCHES "NMake Makefiles") - SET_PROPERTY(TARGET ryzom_client PROPERTY LINK_FLAGS_RELEASE "/MANIFESTUAC:\"level='requireAdministrator' uiAccess='false'\"") + IF(WITH_RYZOM_CLIENT_UAC) + IF(CMAKE_GENERATOR MATCHES "Visual Studio") + SET_PROPERTY(TARGET ryzom_client PROPERTY LINK_FLAGS_RELEASE "/level='requireAdministrator'") + ELSEIF(CMAKE_GENERATOR MATCHES "NMake Makefiles") + SET_PROPERTY(TARGET ryzom_client PROPERTY LINK_FLAGS_RELEASE "/MANIFESTUAC:\"level='requireAdministrator' uiAccess='false'\"") + ENDIF() ENDIF() -ENDIF() -IF(WITH_PCH AND (NOT MINGW OR NOT WITH_SYMBOLS)) - ADD_NATIVE_PRECOMPILED_HEADER(ryzom_client ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) -ENDIF() - -INSTALL(TARGETS ryzom_client RUNTIME DESTINATION ${RYZOM_GAMES_PREFIX} COMPONENT client BUNDLE DESTINATION /Applications) + IF(WITH_PCH AND (NOT MINGW OR NOT WITH_SYMBOLS)) + ADD_NATIVE_PRECOMPILED_HEADER(ryzom_client ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) + ENDIF() + INSTALL(TARGETS ryzom_client RUNTIME DESTINATION ${RYZOM_GAMES_PREFIX} COMPONENT client BUNDLE DESTINATION /Applications) ENDIF() From 697ac2221c4fe2b2f0767a5ef6a98e423625b442 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 2 Jan 2016 22:28:49 +0100 Subject: [PATCH 4/4] Changed: Allow to specify CPUMask in client.cfg to force the use of some cores --HG-- branch : develop --- code/ryzom/client/src/client_cfg.cpp | 53 +++++++++++++++++ code/ryzom/client/src/init.cpp | 88 +++++++++------------------- 2 files changed, 82 insertions(+), 59 deletions(-) diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index 3510db428..5cdd2b860 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -254,6 +254,43 @@ extern NL3D::UDriver *Driver; extern CRyzomTime RT; extern string Cookie; extern string FSAddr; + +extern uint64 Debug_OldCPUMask; +extern uint64 Debug_NewCPUMask; + +// For multi cpu, active only one CPU for the main thread +void setCPUMask(uint64 userCPUMask) +{ + uint64 cpuMask = IProcess::getCurrentProcess()->getCPUMask(); + Debug_OldCPUMask = cpuMask; + + // if user CPU mask is valid + if (cpuMask & userCPUMask) + { + // use it + IProcess::getCurrentProcess ()->setCPUMask(cpuMask & userCPUMask); + } + else + { + // else get first available CPU + + // get the processor to allow process + uint i = 0; + while ((i < 64) && ((cpuMask & (UINT64_CONSTANT(1) << i)) == 0)) + i++; + + // Set the CPU mask + if (i < 64) + { + IProcess::getCurrentProcess ()->setCPUMask(UINT64_CONSTANT(1) << i); + } + } + + // check + cpuMask = IProcess::getCurrentProcess ()->getCPUMask(); + Debug_NewCPUMask = cpuMask; +} + #endif ///////////// @@ -1673,6 +1710,22 @@ void CClientConfig::setValues() SetPriorityClass (GetCurrentProcess(), priority[index]); #endif // NL_OS_WINDOWS + sint cpuMask; + + if (ClientCfg.CPUMask < 1) + { + CTime::CTimerInfo timerInfo; + NLMISC::CTime::probeTimerInfo(timerInfo); + + cpuMask = timerInfo.RequiresSingleCore ? 1:0; + } + else + { + cpuMask = ClientCfg.CPUMask; + } + + if (cpuMask) setCPUMask(cpuMask); + // Init Verbose Modes (at the beginning to be able to display them as soon as possible). ::VerboseVP = ClientCfg.VerboseVP; ::VerboseAnimUser = ClientCfg.VerboseAnimUser; diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index dfcb81832..6e81a4203 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -374,30 +374,8 @@ void outOfMemory() nlstopex (("OUT OF MEMORY")); } -// For multi cpu, active only one CPU for the main thread -uint64 Debug_OldCPUMask= 0; -uint64 Debug_NewCPUMask= 0; -void setCPUMask () -{ - uint64 cpuMask = IProcess::getCurrentProcess ()->getCPUMask(); - Debug_OldCPUMask= cpuMask; - - // get the processor to allow process - uint i = 0; - while ((i<64) && ((cpuMask&(SINT64_CONSTANT(1)<setCPUMask(1<setCPUMask (1<getCPUMask(); - Debug_NewCPUMask= cpuMask; -} +uint64 Debug_OldCPUMask = 0; +uint64 Debug_NewCPUMask = 0; void displayCPUInfo() { @@ -791,14 +769,25 @@ void prelogInit() { try { + H_AUTO ( RZ_Client_Init ); + // Assert if no more memory - // NLMEMORY::SetOutOfMemoryHook(outOfMemory); + set_new_handler(outOfMemory); + + NLMISC_REGISTER_CLASS(CStage); + NLMISC_REGISTER_CLASS(CStageSet); + NLMISC_REGISTER_CLASS(CEntityManager); + NLMISC_REGISTER_CLASS(CCharacterCL); + NLMISC_REGISTER_CLASS(CPlayerCL); + NLMISC_REGISTER_CLASS(CUserEntity); + NLMISC_REGISTER_CLASS(CFxCL); + NLMISC_REGISTER_CLASS(CItemCL); + NLMISC_REGISTER_CLASS(CNamedEntityPositionState); + NLMISC_REGISTER_CLASS(CAnimalPositionState); // Progress bar for init() and connection() ProgressBar.reset (BAR_STEP_INIT_CONNECTION); - set_new_handler(outOfMemory); - // save screen saver state and disable it LastScreenSaverEnabled = CSystemUtils::isScreensaverEnabled(); @@ -813,37 +802,16 @@ void prelogInit() _control87 (_EM_INVALID|_EM_DENORMAL/*|_EM_ZERODIVIDE|_EM_OVERFLOW*/|_EM_UNDERFLOW|_EM_INEXACT, _MCW_EM); #endif // NL_OS_WINDOWS - CTime::CTimerInfo timerInfo; - NLMISC::CTime::probeTimerInfo(timerInfo); - if (timerInfo.RequiresSingleCore) // TODO: Also have a FV configuration value to force single core. - setCPUMask(); - FPU_CHECKER_ONCE NLMISC::TTime initStart = ryzomGetLocalTime (); - H_AUTO ( RZ_Client_Init ); - - NLMISC_REGISTER_CLASS(CStage); - NLMISC_REGISTER_CLASS(CStageSet); - NLMISC_REGISTER_CLASS(CEntityManager); - NLMISC_REGISTER_CLASS(CCharacterCL); - NLMISC_REGISTER_CLASS(CPlayerCL); - NLMISC_REGISTER_CLASS(CUserEntity); - NLMISC_REGISTER_CLASS(CFxCL); - NLMISC_REGISTER_CLASS(CItemCL); - NLMISC_REGISTER_CLASS(CNamedEntityPositionState); - NLMISC_REGISTER_CLASS(CAnimalPositionState); - // _CrtSetDbgFlag( _CRTDBG_CHECK_CRT_DF ); // Init XML Lib allocator // Due to Bug #906, we disable the stl xml allocation // nlverify (xmlMemSetup (XmlFree4NeL, XmlMalloc4NeL, XmlRealloc4NeL, XmlStrdup4NeL) == 0); - // Init the debug memory - initDebugMemory(); - // Add a displayer for Debug Infos. createDebug(); @@ -856,14 +824,24 @@ void prelogInit() ErrorLog->addDisplayer (ClientLogDisplayer); AssertLog->addDisplayer (ClientLogDisplayer); + // Display the client version. + nlinfo("RYZOM VERSION : %s", getDebugVersion().c_str()); + + // Init the debug memory + initDebugMemory(); + + // Load the application configuration. + ucstring nmsg("Loading config file..."); + ProgressBar.newMessage (nmsg); + + ClientCfg.init(ConfigFileName); + CLoginProgressPostThread::getInstance().init(ClientCfg.ConfigFile); + setCrashCallback(crashCallback); // Display Some Info On CPU displayCPUInfo(); - // Display the client version. - nlinfo("RYZOM VERSION : %s", getDebugVersion().c_str()); - FPU_CHECKER_ONCE // Set default email value for reporting error @@ -881,14 +859,6 @@ void prelogInit() //ICommand::execute("iFileAccessLogStart",*NLMISC::InfoLog); #endif - // Load the application configuration. - ucstring nmsg("Loading config file..."); - ProgressBar.newMessage (nmsg); - - ClientCfg.init(ConfigFileName); - - CLoginProgressPostThread::getInstance().init(ClientCfg.ConfigFile); - // check "BuildName" in ClientCfg //nlassert(!ClientCfg.BuildName.empty()); // TMP comment by nico do not commit