From d3f705f02d3d06d4d6b5bd2cb37fb0e379ba6e9d Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 10 Jul 2010 13:22:12 +0200 Subject: [PATCH 01/52] Changed: #841 Change the wrong header in the source code --- code/ryzom/client/src/seven_zip/7zMain.cpp | 20 +++++-------------- .../collision/src/collision_service.cpp | 20 ++++++++++++++----- .../server/empty/src/empty_service.cpp | 20 ++++++++++++++----- .../server/empty/src/empty_service.h | 20 ++++++++++++++----- 4 files changed, 50 insertions(+), 30 deletions(-) diff --git a/code/ryzom/client/src/seven_zip/7zMain.cpp b/code/ryzom/client/src/seven_zip/7zMain.cpp index ee2ac82b7..6f2bf11c4 100644 --- a/code/ryzom/client/src/seven_zip/7zMain.cpp +++ b/code/ryzom/client/src/seven_zip/7zMain.cpp @@ -1,18 +1,8 @@ -// Ryzom - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . +/* +7zMain.c +Test application for 7z Decoder +LZMA SDK 4.43 Copyright (c) 1999-2006 Igor Pavlov (2006-06-04) +*/ #include #include diff --git a/code/snowballs2/server/collision/src/collision_service.cpp b/code/snowballs2/server/collision/src/collision_service.cpp index 8ef868258..fc48d02c3 100644 --- a/code/snowballs2/server/collision/src/collision_service.cpp +++ b/code/snowballs2/server/collision/src/collision_service.cpp @@ -1,8 +1,18 @@ -/* - * Snowballs collision service. Sends message when entity moves incorrectly. - * - * $Id: collision_service.cpp 415 2007-12-29 02:52:44Z Kaetemi $ - */ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . #include "collision_service.h" #include diff --git a/code/snowballs2/server/empty/src/empty_service.cpp b/code/snowballs2/server/empty/src/empty_service.cpp index 47e1f7d7a..3be5d0447 100644 --- a/code/snowballs2/server/empty/src/empty_service.cpp +++ b/code/snowballs2/server/empty/src/empty_service.cpp @@ -1,8 +1,18 @@ -/* - * Snowballs service. - * - * $Id: empty_service.cpp 409 2007-12-28 13:24:17Z Kaetemi $ - */ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . #include "empty_service.h" diff --git a/code/snowballs2/server/empty/src/empty_service.h b/code/snowballs2/server/empty/src/empty_service.h index 13d3ecce7..dabd27d4b 100644 --- a/code/snowballs2/server/empty/src/empty_service.h +++ b/code/snowballs2/server/empty/src/empty_service.h @@ -1,8 +1,18 @@ -/* - * Snowballs service. - * - * $Id: empty_service.h 409 2007-12-28 13:24:17Z Kaetemi $ - */ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . #ifndef SERVICE_EMPTY_SERVICE_H #define SERVICE_EMPTY_SERVICE_H From fbc00082ce3e056393a3ed41ea85ee9863c1edea Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 10 Jul 2010 13:23:15 +0200 Subject: [PATCH 02/52] Fixed: NeL compilation with automake --- code/nel/include/nel/misc/Makefile.am | 1 - 1 file changed, 1 deletion(-) diff --git a/code/nel/include/nel/misc/Makefile.am b/code/nel/include/nel/misc/Makefile.am index 89ca764e7..75bde6b95 100644 --- a/code/nel/include/nel/misc/Makefile.am +++ b/code/nel/include/nel/misc/Makefile.am @@ -25,7 +25,6 @@ include_HEADERS = aabbox.h \ config_file.h \ contiguous_block_allocator.h \ co_task.h \ - cpu_info.h \ cpu_time_stat.h \ debug.h \ di_event_emitter.h \ From f20b894851975c12a2828bff0d5b97c5399c631d Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 10 Jul 2010 13:27:40 +0200 Subject: [PATCH 03/52] Changed: #825 Remove all warning when compiling Ryzom --- code/nel/include/nel/3d/mesh_multi_lod.h | 3 ++- code/nel/src/3d/instance_lighter.cpp | 1 + code/nel/src/3d/lod_character_manager.cpp | 3 ++- code/nel/src/3d/packed_world.cpp | 2 +- code/nel/src/3d/patch_lightmap.cpp | 1 + code/nel/src/3d/texture_far.cpp | 2 ++ code/nel/src/misc/dynloadlib.cpp | 6 +++--- 7 files changed, 12 insertions(+), 6 deletions(-) diff --git a/code/nel/include/nel/3d/mesh_multi_lod.h b/code/nel/include/nel/3d/mesh_multi_lod.h index d56383f26..d057b40b6 100644 --- a/code/nel/include/nel/3d/mesh_multi_lod.h +++ b/code/nel/include/nel/3d/mesh_multi_lod.h @@ -56,12 +56,13 @@ public: class CMeshMultiLodBuild { public: + CMeshMultiLodBuild() : StaticLod(false) { } /// A slot of mesh for the build class CBuildSlot { public: - CBuildSlot() : MeshGeom(NULL) { } + CBuildSlot() : MeshGeom(NULL), DistMax(0.0f), BlendLength(0.0f), Flags(0) { } /** * Flags for the build of a slot * diff --git a/code/nel/src/3d/instance_lighter.cpp b/code/nel/src/3d/instance_lighter.cpp index 47c5dddf1..5fb2e2017 100644 --- a/code/nel/src/3d/instance_lighter.cpp +++ b/code/nel/src/3d/instance_lighter.cpp @@ -349,6 +349,7 @@ void CInstanceLighter::light (const CInstanceGroup &igIn, CInstanceGroup &igOut, CSurfaceLightGrid::CCellCorner defaultCellCorner; defaultCellCorner.SunContribution= 0; defaultCellCorner.Light[0]= 0xFF; + defaultCellCorner.Light[1]= 0xFF; defaultCellCorner.LocalAmbientId= 0xFF; // Init the grid. diff --git a/code/nel/src/3d/lod_character_manager.cpp b/code/nel/src/3d/lod_character_manager.cpp index b60b6e4ec..3a538afcf 100644 --- a/code/nel/src/3d/lod_character_manager.cpp +++ b/code/nel/src/3d/lod_character_manager.cpp @@ -373,7 +373,6 @@ bool CLodCharacterManager::addRenderCharacterKey(CLodCharacterInstance &instan float a00, a01, a02; float a10, a11, a12; float a20, a21, a22; - sint f8; uint64 blank= 0; CRGBA ambient= paramAmbient; CRGBA diffuse= paramDiffuse; @@ -502,6 +501,8 @@ bool CLodCharacterManager::addRenderCharacterKey(CLodCharacterInstance &instan if(numVertices) { + sint f8; + /* NB: order is important for AGP filling optimisation in dstPtr Pentium2+ optimisation notes: diff --git a/code/nel/src/3d/packed_world.cpp b/code/nel/src/3d/packed_world.cpp index 1f23b65c5..b989e2cf9 100644 --- a/code/nel/src/3d/packed_world.cpp +++ b/code/nel/src/3d/packed_world.cpp @@ -83,7 +83,7 @@ bool CPackedWorld::raytrace(const NLMISC::CVector &start, const NLMISC::CVector if (_ZoneGrid.empty()) return false; ++_RaytraceCounter; float bestDist = FLT_MAX; - NLMISC::CVector bestNormal; + CVector bestNormal(CVector::Null); CVector currEnd = end; CVector currInter; if (_RaytraceCounter == (uint32) ~0) diff --git a/code/nel/src/3d/patch_lightmap.cpp b/code/nel/src/3d/patch_lightmap.cpp index 01134793a..b5a6c8f8d 100644 --- a/code/nel/src/3d/patch_lightmap.cpp +++ b/code/nel/src/3d/patch_lightmap.cpp @@ -1525,6 +1525,7 @@ void CPatch::resetTileLightInfluences() { // Disable all light influence on this point. TileLightInfluences[i].Light[0]= 0xFF; + TileLightInfluences[i].Light[1]= 0xFF; } } diff --git a/code/nel/src/3d/texture_far.cpp b/code/nel/src/3d/texture_far.cpp index 632d2ac1d..bb3773f3f 100644 --- a/code/nel/src/3d/texture_far.cpp +++ b/code/nel/src/3d/texture_far.cpp @@ -1421,7 +1421,9 @@ extern "C" void NL3D_expandLightmap (const NL3D_CExpandLightmap* pLightmap) // Compute current color CRGBA color0; CRGBA color1; + color0.A = 255; color0.set565 (colorTilePtr[srcIndex].Color565); + color1.A = 255; color1.set565 (colorTilePtr[srcIndex+1].Color565); expandedUserColorLinePtr[u].blendFromui (color0, color1, srcIndexPixel&0xff); // Compute current TLI color diff --git a/code/nel/src/misc/dynloadlib.cpp b/code/nel/src/misc/dynloadlib.cpp index 705f4b4b3..fe46fa6f4 100644 --- a/code/nel/src/misc/dynloadlib.cpp +++ b/code/nel/src/misc/dynloadlib.cpp @@ -67,9 +67,9 @@ void *nlGetSymbolAddress(NL_LIB_HANDLE libHandle, const std::string &procName) #ifdef NL_OS_WINDOWS const string nlLibPrefix; // empty const string nlLibExt(".dll"); -#elif defined(NL_OS_MAC) - const string nlLibPrefix("lib"); - const string nlLibExt(".dylib"); +#elif defined(NL_OS_MAC) + const string nlLibPrefix("lib"); + const string nlLibExt(".dylib"); #elif defined(NL_OS_UNIX) const string nlLibPrefix("lib"); const string nlLibExt(".so"); From ee62571b3946a66ae48b8518e0868ad265254f97 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 10 Jul 2010 13:40:38 +0200 Subject: [PATCH 04/52] Changed: #880 Use PCH under Linux with CMake --- .../tools/3d/plugin_max/nel_3dsmax_shared/CMakeLists.txt | 4 ++++ code/nel/tools/3d/plugin_max/nel_mesh_lib/CMakeLists.txt | 4 ++++ .../nel/tools/3d/plugin_max/nel_patch_edit/CMakeLists.txt | 4 ++++ code/nel/tools/logic/logic_editor_dll/CMakeLists.txt | 4 +++- code/nel/tools/logic/logic_editor_exe/CMakeLists.txt | 4 +++- code/ryzom/server/src/ai_service/CMakeLists.txt | 5 +++++ code/ryzom/server/src/ai_share/CMakeLists.txt | 4 ++++ code/ryzom/server/src/frontend_service/CMakeLists.txt | 8 +++++--- code/ryzom/server/src/input_output_service/CMakeLists.txt | 5 +++++ code/ryzom/server/src/mail_forum_service/CMakeLists.txt | 4 ++++ code/ryzom/server/src/monitor_service/CMakeLists.txt | 5 +++++ code/ryzom/server/src/server_share/CMakeLists.txt | 4 ++++ .../ryzom/server/src/shard_unifier_service/CMakeLists.txt | 4 ++++ code/ryzom/tools/sheet_random_generator/CMakeLists.txt | 4 ++++ .../sheet_random_generator/sheet_random_generator.cpp | 2 +- code/ryzom/tools/sheets_packer/CMakeLists.txt | 4 ++++ 16 files changed, 63 insertions(+), 6 deletions(-) diff --git a/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/CMakeLists.txt index a20977bd2..27359b29d 100644 --- a/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/CMakeLists.txt @@ -22,4 +22,8 @@ SET_TARGET_PROPERTIES(nel_3dsmax_shared PROPERTIES ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DNEL_3DSMAX_SHARED_EXPORTS) +IF(WITH_PCH) + ADD_NATIVE_PRECOMPILED_HEADER(nel_3dsmax_shared ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.h ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.cpp) +ENDIF(WITH_PCH) + INSTALL(TARGETS nel_3dsmax_shared RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_mesh_lib/CMakeLists.txt index 7ed6460ab..3e55c015a 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/CMakeLists.txt @@ -15,4 +15,8 @@ SET_TARGET_PROPERTIES(nel_mesh_lib PROPERTIES ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +IF(WITH_PCH) + ADD_NATIVE_PRECOMPILED_HEADER(nel_mesh_lib ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.h ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.cpp) +ENDIF(WITH_PCH) + INSTALL(TARGETS nel_mesh_lib RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_patch_edit/CMakeLists.txt index 61049347e..b99689017 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/CMakeLists.txt @@ -25,4 +25,8 @@ SET_TARGET_PROPERTIES(nel_patch_edit PROPERTIES ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +IF(WITH_PCH) + ADD_NATIVE_PRECOMPILED_HEADER(nel_patch_edit ${CMAKE_CURRENT_SOURCE_DIR}/stdafx.h ${CMAKE_CURRENT_SOURCE_DIR}/stdafx.cpp) +ENDIF(WITH_PCH) + INSTALL(TARGETS nel_patch_edit RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) diff --git a/code/nel/tools/logic/logic_editor_dll/CMakeLists.txt b/code/nel/tools/logic/logic_editor_dll/CMakeLists.txt index 30fb836ac..5a89f28b2 100644 --- a/code/nel/tools/logic/logic_editor_dll/CMakeLists.txt +++ b/code/nel/tools/logic/logic_editor_dll/CMakeLists.txt @@ -24,6 +24,8 @@ ENDIF(WIN32) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -ADD_NATIVE_PRECOMPILED_HEADER(logic_editor_dll ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.h ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.cpp) +IF(WITH_PCH) + ADD_NATIVE_PRECOMPILED_HEADER(logic_editor_dll ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.h ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.cpp) +ENDIF(WITH_PCH) INSTALL(TARGETS logic_editor_dll LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT toolsmisc) diff --git a/code/nel/tools/logic/logic_editor_exe/CMakeLists.txt b/code/nel/tools/logic/logic_editor_exe/CMakeLists.txt index dd4b4c8c6..5f2a4779b 100644 --- a/code/nel/tools/logic/logic_editor_exe/CMakeLists.txt +++ b/code/nel/tools/logic/logic_editor_exe/CMakeLists.txt @@ -13,6 +13,8 @@ IF(WIN32) PROJECT_LABEL "Tools, Logic: Logic Editor") ENDIF(WIN32) -ADD_NATIVE_PRECOMPILED_HEADER(logic_editor ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.h ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.cpp) +IF(WITH_PCH) + ADD_NATIVE_PRECOMPILED_HEADER(logic_editor ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.h ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.cpp) +ENDIF(WITH_PCH) INSTALL(TARGETS logic_editor RUNTIME DESTINATION bin COMPONENT toolsmisc) diff --git a/code/ryzom/server/src/ai_service/CMakeLists.txt b/code/ryzom/server/src/ai_service/CMakeLists.txt index 40fedc860..f8b05c7b3 100644 --- a/code/ryzom/server/src/ai_service/CMakeLists.txt +++ b/code/ryzom/server/src/ai_service/CMakeLists.txt @@ -35,7 +35,12 @@ IF(WIN32) LINK_FLAGS "/NODEFAULTLIB:libcmt /SUBSYSTEM:WINDOWS" PROJECT_LABEL "Services: AI Service (AIS)") ENDIF(WIN32) + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +IF(WITH_PCH) + ADD_NATIVE_PRECOMPILED_HEADER(ai_service ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) +ENDIF(WITH_PCH) + INSTALL(TARGETS ai_service RUNTIME DESTINATION sbin COMPONENT services) diff --git a/code/ryzom/server/src/ai_share/CMakeLists.txt b/code/ryzom/server/src/ai_share/CMakeLists.txt index 99d15cef4..e9b043a07 100644 --- a/code/ryzom/server/src/ai_share/CMakeLists.txt +++ b/code/ryzom/server/src/ai_share/CMakeLists.txt @@ -22,4 +22,8 @@ ENDIF(WIN32) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +IF(WITH_PCH) + ADD_NATIVE_PRECOMPILED_HEADER(ai_share ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) +ENDIF(WITH_PCH) + INSTALL(TARGETS ai_share LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) diff --git a/code/ryzom/server/src/frontend_service/CMakeLists.txt b/code/ryzom/server/src/frontend_service/CMakeLists.txt index 94073d7c0..5fa67758e 100644 --- a/code/ryzom/server/src/frontend_service/CMakeLists.txt +++ b/code/ryzom/server/src/frontend_service/CMakeLists.txt @@ -9,9 +9,6 @@ LIST(REMOVE_ITEM SRC ${CMAKE_CURRENT_SOURCE_DIR}/pair_selector.cpp ADD_EXECUTABLE(frontend_service ${SRC}) - - - INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${MYSQL_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ${NEL_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(frontend_service admin_modules ryzom_gameshare ${PLATFORM_LINKFLAGS} ${LIBXML2_LIBRARIES} ${MYSQL_LIBRARIES} ${ZLIB_LIBRARIES} ${NELMISC_LIBRARY} ${NELNET_LIBRARY} ${NELGEORGES_LIBRARY} ${NELLIGO_LIBRARY}) IF(WIN32) @@ -19,7 +16,12 @@ IF(WIN32) LINK_FLAGS "/NODEFAULTLIB:libcmt /SUBSYSTEM:WINDOWS" PROJECT_LABEL "Services: Frontend Service (FS)") ENDIF(WIN32) + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +IF(WITH_PCH) + ADD_NATIVE_PRECOMPILED_HEADER(frontend_service ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) +ENDIF(WITH_PCH) + INSTALL(TARGETS frontend_service RUNTIME DESTINATION sbin COMPONENT services) diff --git a/code/ryzom/server/src/input_output_service/CMakeLists.txt b/code/ryzom/server/src/input_output_service/CMakeLists.txt index 142cf8205..b04f16562 100644 --- a/code/ryzom/server/src/input_output_service/CMakeLists.txt +++ b/code/ryzom/server/src/input_output_service/CMakeLists.txt @@ -28,8 +28,13 @@ IF(WIN32) LINK_FLAGS "/NODEFAULTLIB:libcmt /SUBSYSTEM:WINDOWS" PROJECT_LABEL "Services: Input Ouput Service (IOS)") ENDIF(WIN32) + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +IF(WITH_PCH) + ADD_NATIVE_PRECOMPILED_HEADER(ios_service ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) +ENDIF(WITH_PCH) + INSTALL(TARGETS ios_service RUNTIME DESTINATION sbin COMPONENT services) diff --git a/code/ryzom/server/src/mail_forum_service/CMakeLists.txt b/code/ryzom/server/src/mail_forum_service/CMakeLists.txt index 1d402104e..5cbafe41b 100644 --- a/code/ryzom/server/src/mail_forum_service/CMakeLists.txt +++ b/code/ryzom/server/src/mail_forum_service/CMakeLists.txt @@ -17,6 +17,10 @@ IF(WIN32) ENDIF(WIN32) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +IF(WITH_PCH) + ADD_NATIVE_PRECOMPILED_HEADER(mail_forum_service ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) +ENDIF(WITH_PCH) + INSTALL(TARGETS mail_forum_service RUNTIME DESTINATION sbin COMPONENT services) diff --git a/code/ryzom/server/src/monitor_service/CMakeLists.txt b/code/ryzom/server/src/monitor_service/CMakeLists.txt index ba68d184e..fa77c7d42 100644 --- a/code/ryzom/server/src/monitor_service/CMakeLists.txt +++ b/code/ryzom/server/src/monitor_service/CMakeLists.txt @@ -16,8 +16,13 @@ IF(WIN32) LINK_FLAGS "/NODEFAULTLIB:libcmt /SUBSYSTEM:WINDOWS" PROJECT_LABEL "Services: Monitor Service (MOS)") ENDIF(WIN32) + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +IF(WITH_PCH) + ADD_NATIVE_PRECOMPILED_HEADER(monitor_service ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) +ENDIF(WITH_PCH) + INSTALL(TARGETS monitor_service RUNTIME DESTINATION sbin COMPONENT services) diff --git a/code/ryzom/server/src/server_share/CMakeLists.txt b/code/ryzom/server/src/server_share/CMakeLists.txt index d4535389f..b5009204d 100644 --- a/code/ryzom/server/src/server_share/CMakeLists.txt +++ b/code/ryzom/server/src/server_share/CMakeLists.txt @@ -22,4 +22,8 @@ ENDIF(WIN32) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +IF(WITH_PCH) + ADD_NATIVE_PRECOMPILED_HEADER(server_share ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) +ENDIF(WITH_PCH) + INSTALL(TARGETS server_share LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) diff --git a/code/ryzom/server/src/shard_unifier_service/CMakeLists.txt b/code/ryzom/server/src/shard_unifier_service/CMakeLists.txt index 6efd5bdc8..ec0862d48 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 @@ IF(WIN32) ENDIF(WIN32) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +IF(WITH_PCH) + ADD_NATIVE_PRECOMPILED_HEADER(shard_unifier_service ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) +ENDIF(WITH_PCH) + INSTALL(TARGETS shard_unifier_service RUNTIME DESTINATION sbin COMPONENT services) diff --git a/code/ryzom/tools/sheet_random_generator/CMakeLists.txt b/code/ryzom/tools/sheet_random_generator/CMakeLists.txt index c4045b593..836b9223c 100644 --- a/code/ryzom/tools/sheet_random_generator/CMakeLists.txt +++ b/code/ryzom/tools/sheet_random_generator/CMakeLists.txt @@ -6,4 +6,8 @@ INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${NELMISC_INCLUDE_DIRS} ${NELGEORGES_ TARGET_LINK_LIBRARIES(sheet_random_generator ${PLATFORM_LINKFLAGS} ${LIBXML2_LIBRARIES} ${NELMISC_LIBRARY} ${NELGEORGES_LIBRARY}) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +IF(WITH_PCH) + ADD_NATIVE_PRECOMPILED_HEADER(sheet_random_generator ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.h ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.cpp) +ENDIF(WITH_PCH) + INSTALL(TARGETS sheet_random_generator RUNTIME DESTINATION bin COMPONENT tools) diff --git a/code/ryzom/tools/sheet_random_generator/sheet_random_generator.cpp b/code/ryzom/tools/sheet_random_generator/sheet_random_generator.cpp index ea647e1f6..a3d56f40d 100644 --- a/code/ryzom/tools/sheet_random_generator/sheet_random_generator.cpp +++ b/code/ryzom/tools/sheet_random_generator/sheet_random_generator.cpp @@ -16,7 +16,7 @@ -#include "stdafx.h" +#include "StdAfx.h" #include "srg_utilities.h" #include "game_share/protection_type.h" #include "nel/misc/string_conversion.h" diff --git a/code/ryzom/tools/sheets_packer/CMakeLists.txt b/code/ryzom/tools/sheets_packer/CMakeLists.txt index fc14987ce..abc3189da 100644 --- a/code/ryzom/tools/sheets_packer/CMakeLists.txt +++ b/code/ryzom/tools/sheets_packer/CMakeLists.txt @@ -19,4 +19,8 @@ TARGET_LINK_LIBRARIES(sheets_packer ryzom_clientsheets ${LIBXML2_LIBRARIES} ) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +IF(WITH_PCH) + ADD_NATIVE_PRECOMPILED_HEADER(sheets_packer ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) +ENDIF(WITH_PCH) + INSTALL(TARGETS sheets_packer RUNTIME DESTINATION bin COMPONENT tools) From 483851482f3b2fed7f02e82eaf06fdb608ed5ed3 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 10 Jul 2010 13:57:59 +0200 Subject: [PATCH 05/52] Changed: #880 Use PCH under Linux with CMake --- code/ryzom/server/src/entities_game_service/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/ryzom/server/src/entities_game_service/CMakeLists.txt b/code/ryzom/server/src/entities_game_service/CMakeLists.txt index 418b1af7f..8a0648419 100644 --- a/code/ryzom/server/src/entities_game_service/CMakeLists.txt +++ b/code/ryzom/server/src/entities_game_service/CMakeLists.txt @@ -65,5 +65,9 @@ IF(WIN32) ENDIF(WIN32) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +IF(WITH_PCH) + ADD_NATIVE_PRECOMPILED_HEADER(entities_game_service ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) +ENDIF(WITH_PCH) + INSTALL(TARGETS entities_game_service RUNTIME DESTINATION sbin COMPONENT services) From 2b5d2a5b914a7ad500a45750af3ed3c8571377d7 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 10 Jul 2010 13:59:45 +0200 Subject: [PATCH 06/52] Fixed: sort screen modes by width, height and frequency --- code/nel/src/3d/driver_user.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/code/nel/src/3d/driver_user.cpp b/code/nel/src/3d/driver_user.cpp index 5afebf8e3..ea8a44e83 100644 --- a/code/nel/src/3d/driver_user.cpp +++ b/code/nel/src/3d/driver_user.cpp @@ -286,7 +286,12 @@ struct CModeSorter { bool operator()(const UDriver::CMode &mode1, const UDriver::CMode &mode2) const { - if (mode1.Width == mode2.Width) return mode1.Height < mode2.Height; + if (mode1.Width == mode2.Width) + { + if (mode1.Height == mode2.Height) return mode1.Frequency < mode2.Frequency; + + return mode1.Height < mode2.Height; + } return mode1.Width < mode2.Width; } From 840179a65c94d90e0ed74dace966d986fa3c2090 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 10 Jul 2010 14:06:33 +0200 Subject: [PATCH 07/52] Changed: optimizations for PCH --- code/nel/src/net/stdnet.h | 2 ++ code/nel/src/net/udp_sock.cpp | 4 +--- .../client_sheets/automaton_list_sheet.cpp | 2 -- .../src/client_sheets/building_sheet.cpp | 2 -- .../src/client_sheets/emot_list_sheet.cpp | 2 -- .../src/client_sheets/forage_source_sheet.cpp | 1 - .../client_sheets/text_emot_list_sheet.cpp | 3 --- code/ryzom/client/src/ig_season_callback.cpp | 1 + .../src/interface_v3/bot_chat_page_trade.cpp | 2 -- code/ryzom/client/src/micro_life_manager.cpp | 2 -- .../ryzom/client/src/motion/user_controls.cpp | 9 --------- code/ryzom/client/src/net_manager.cpp | 4 ---- code/ryzom/client/src/network_connection.cpp | 3 --- code/ryzom/client/src/npc_icon.cpp | 1 - code/ryzom/client/src/pacs_client.cpp | 9 --------- .../client/src/precipitation_clip_grid.cpp | 10 ---------- code/ryzom/client/src/prim_file.cpp | 9 --------- code/ryzom/client/src/session_browser.cpp | 2 -- code/ryzom/client/src/sky.cpp | 7 ------- code/ryzom/client/src/sound_manager.cpp | 10 ---------- code/ryzom/client/src/stage.cpp | 4 +--- code/ryzom/client/src/stdpch.h | 20 +++++++++++++++++++ code/ryzom/client/src/time_client.cpp | 2 -- code/ryzom/client/src/timed_fx_manager.cpp | 2 -- .../client/src/weather_manager_client.cpp | 10 ---------- .../_backup_service_interface_singleton.cpp | 1 - code/ryzom/common/src/game_share/action.cpp | 13 ------------ .../common/src/game_share/action_factory.cpp | 13 ------------ .../common/src/game_share/action_generic.cpp | 13 ------------ .../common/src/game_share/action_position.cpp | 13 ------------ .../src/game_share/change_tracker_client.cpp | 2 -- .../src/game_share/continuous_action.cpp | 13 ------------ .../common/src/game_share/data_set_base.cpp | 2 -- code/ryzom/common/src/game_share/mirror.cpp | 5 ----- .../src/game_share/mirror_prop_value.cpp | 1 - code/ryzom/common/src/game_share/object.cpp | 14 +------------ .../common/src/game_share/persistent_data.cpp | 3 --- .../game_share/property_allocator_client.cpp | 2 -- code/ryzom/common/src/game_share/scenario.cpp | 4 ---- .../src/game_share/server_admin_module.cpp | 2 -- .../src/game_share/server_edition_module.cpp | 2 -- code/ryzom/common/src/game_share/simlag.cpp | 8 -------- .../common/src/game_share/slot_equipment.cpp | 2 -- code/ryzom/common/src/game_share/stdpch.h | 19 +++++++++++++++++- 44 files changed, 44 insertions(+), 211 deletions(-) diff --git a/code/nel/src/net/stdnet.h b/code/nel/src/net/stdnet.h index 1a2c52874..ec0748af4 100644 --- a/code/nel/src/net/stdnet.h +++ b/code/nel/src/net/stdnet.h @@ -41,6 +41,8 @@ #include #include +#include + #include "nel/misc/debug.h" #include "nel/misc/common.h" diff --git a/code/nel/src/net/udp_sock.cpp b/code/nel/src/net/udp_sock.cpp index 535e5550e..d8dab0c88 100644 --- a/code/nel/src/net/udp_sock.cpp +++ b/code/nel/src/net/udp_sock.cpp @@ -20,9 +20,7 @@ #include "nel/net/net_log.h" #ifdef NL_OS_WINDOWS -# if defined(NL_COMP_VC7) || defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) -# include -# endif +# include # define NOMINMAX # include # define socklen_t int diff --git a/code/ryzom/client/src/client_sheets/automaton_list_sheet.cpp b/code/ryzom/client/src/client_sheets/automaton_list_sheet.cpp index ae76b823b..2504dec51 100644 --- a/code/ryzom/client/src/client_sheets/automaton_list_sheet.cpp +++ b/code/ryzom/client/src/client_sheets/automaton_list_sheet.cpp @@ -29,8 +29,6 @@ #include "nel/georges/u_form_elm.h" #include "nel/georges/u_form_dfn.h" #include "nel/georges/u_form_loader.h" -// STD -#include /////////// // USING // diff --git a/code/ryzom/client/src/client_sheets/building_sheet.cpp b/code/ryzom/client/src/client_sheets/building_sheet.cpp index 176a9f0ec..b9d68991a 100644 --- a/code/ryzom/client/src/client_sheets/building_sheet.cpp +++ b/code/ryzom/client/src/client_sheets/building_sheet.cpp @@ -25,8 +25,6 @@ #include "building_sheet.h" // Georges #include "nel/georges/u_form_elm.h" -// STD -#include diff --git a/code/ryzom/client/src/client_sheets/emot_list_sheet.cpp b/code/ryzom/client/src/client_sheets/emot_list_sheet.cpp index 78a9a9f74..8dc789cff 100644 --- a/code/ryzom/client/src/client_sheets/emot_list_sheet.cpp +++ b/code/ryzom/client/src/client_sheets/emot_list_sheet.cpp @@ -29,8 +29,6 @@ #include "nel/georges/u_form_elm.h" #include "nel/georges/u_form_dfn.h" #include "nel/georges/u_form_loader.h" -// STD -#include /////////// // USING // diff --git a/code/ryzom/client/src/client_sheets/forage_source_sheet.cpp b/code/ryzom/client/src/client_sheets/forage_source_sheet.cpp index 018ad5f62..e35e8d58b 100644 --- a/code/ryzom/client/src/client_sheets/forage_source_sheet.cpp +++ b/code/ryzom/client/src/client_sheets/forage_source_sheet.cpp @@ -19,7 +19,6 @@ #include "stdpch.h" // First include for pre-compiled headers. #include "forage_source_sheet.h" #include "nel/georges/u_form_elm.h" -#include using namespace std; using namespace NLGEORGES; diff --git a/code/ryzom/client/src/client_sheets/text_emot_list_sheet.cpp b/code/ryzom/client/src/client_sheets/text_emot_list_sheet.cpp index 015d7b0a3..9c61ddec0 100644 --- a/code/ryzom/client/src/client_sheets/text_emot_list_sheet.cpp +++ b/code/ryzom/client/src/client_sheets/text_emot_list_sheet.cpp @@ -29,9 +29,6 @@ #include "nel/georges/u_form_elm.h" #include "nel/georges/u_form_dfn.h" #include "nel/georges/u_form_loader.h" -// STD -#include -#include /////////// // USING // diff --git a/code/ryzom/client/src/ig_season_callback.cpp b/code/ryzom/client/src/ig_season_callback.cpp index f2018977e..e8cb175ed 100644 --- a/code/ryzom/client/src/ig_season_callback.cpp +++ b/code/ryzom/client/src/ig_season_callback.cpp @@ -13,6 +13,7 @@ // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . + #include "stdpch.h" #include "ig_season_callback.h" diff --git a/code/ryzom/client/src/interface_v3/bot_chat_page_trade.cpp b/code/ryzom/client/src/interface_v3/bot_chat_page_trade.cpp index 1073d89b0..02a929772 100644 --- a/code/ryzom/client/src/interface_v3/bot_chat_page_trade.cpp +++ b/code/ryzom/client/src/interface_v3/bot_chat_page_trade.cpp @@ -48,8 +48,6 @@ #include "../sheet_manager.h" #include "../user_entity.h" #include "view_bitmap.h" -// -#include using namespace std::rel_ops; diff --git a/code/ryzom/client/src/micro_life_manager.cpp b/code/ryzom/client/src/micro_life_manager.cpp index 042b8dc1a..32c4b5a58 100644 --- a/code/ryzom/client/src/micro_life_manager.cpp +++ b/code/ryzom/client/src/micro_life_manager.cpp @@ -42,8 +42,6 @@ // #include "nel/misc/check_fpu.h" -#include - using namespace std::rel_ops; extern NLLIGO::CLigoConfig LigoConfig; diff --git a/code/ryzom/client/src/motion/user_controls.cpp b/code/ryzom/client/src/motion/user_controls.cpp index e5a3a58be..d681fd9cd 100644 --- a/code/ryzom/client/src/motion/user_controls.cpp +++ b/code/ryzom/client/src/motion/user_controls.cpp @@ -22,11 +22,6 @@ ////////////// // Includes // ////////////// -// 3D Interface. -#include "nel/3d/u_driver.h" -#include "nel/3d/u_scene.h" -#include "nel/3d/u_camera.h" -#include "nel/3d/u_transform.h" // GAME SHARE #include "game_share/bot_chat_types.h" // Client. @@ -39,10 +34,6 @@ #include "../entities.h" #include "../view.h" #include "../input.h" -// Misc -#include "nel/misc/mouse_device.h" -// Std -#include // #include "../r2/editor.h" diff --git a/code/ryzom/client/src/net_manager.cpp b/code/ryzom/client/src/net_manager.cpp index 5b68eb419..97cbd9c6d 100644 --- a/code/ryzom/client/src/net_manager.cpp +++ b/code/ryzom/client/src/net_manager.cpp @@ -21,10 +21,6 @@ // INCLUDE // ///////////// #include "stdpch.h" -// Misc -#include -#include -#include // Game Share #include "game_share/generic_xml_msg_mngr.h" #include "game_share/msg_client_server.h" diff --git a/code/ryzom/client/src/network_connection.cpp b/code/ryzom/client/src/network_connection.cpp index b309a9a99..687b7d14a 100644 --- a/code/ryzom/client/src/network_connection.cpp +++ b/code/ryzom/client/src/network_connection.cpp @@ -63,9 +63,6 @@ #include "../../../test/network/sb5000/client/graph.h" #endif -#include -#include - // *************************************************************************** // Smooth ServerTick setup diff --git a/code/ryzom/client/src/npc_icon.cpp b/code/ryzom/client/src/npc_icon.cpp index 788e5320f..99d0ed515 100644 --- a/code/ryzom/client/src/npc_icon.cpp +++ b/code/ryzom/client/src/npc_icon.cpp @@ -20,7 +20,6 @@ #include "game_share/generic_xml_msg_mngr.h" #include "entities.h" #include "net_manager.h" -#include using namespace std; using namespace NLMISC; diff --git a/code/ryzom/client/src/pacs_client.cpp b/code/ryzom/client/src/pacs_client.cpp index 739c95841..16147f0f9 100644 --- a/code/ryzom/client/src/pacs_client.cpp +++ b/code/ryzom/client/src/pacs_client.cpp @@ -21,20 +21,11 @@ // INCLUDE // ///////////// #include "stdpch.h" -#include -// Misc. -#include "nel/misc/vector.h" -// Pacs Interface. -#include "nel/pacs/u_retriever_bank.h" -#include "nel/pacs/u_global_retriever.h" -#include "nel/pacs/u_primitive_block.h" // Client. #include "pacs_client.h" #include "user_entity.h" #include "ig_callback.h" #include "ig_client.h" -// std -#include /////////// // USING // diff --git a/code/ryzom/client/src/precipitation_clip_grid.cpp b/code/ryzom/client/src/precipitation_clip_grid.cpp index 03cba6ec5..6bf8cfda0 100644 --- a/code/ryzom/client/src/precipitation_clip_grid.cpp +++ b/code/ryzom/client/src/precipitation_clip_grid.cpp @@ -19,17 +19,7 @@ #include "stdpch.h" -// TMP TMP - -#include "nel/pacs/u_global_retriever.h" -#include "nel/pacs/u_global_position.h" -#include "nel/3d/u_driver.h" -#include "nel/3d/u_visual_collision_manager.h" -#include "nel/misc/matrix.h" -#include "nel/misc/hierarchical_timer.h" -#include "nel/misc/system_info.h" #include "precipitation_clip_grid.h" -#include using namespace NLMISC; diff --git a/code/ryzom/client/src/prim_file.cpp b/code/ryzom/client/src/prim_file.cpp index 354eff459..c9839956e 100644 --- a/code/ryzom/client/src/prim_file.cpp +++ b/code/ryzom/client/src/prim_file.cpp @@ -22,17 +22,8 @@ ///////////// #include "stdpch.h" -// Misc. -#include "nel/misc/path.h" -#include "nel/misc/i_xml.h" -#include "nel/misc/file.h" -// 3D Interface. // game share #include "game_share/brick_types.h" -// PACS -#include "nel/pacs/u_global_position.h" -// std -#include // Client #include "prim_file.h" #include "client_cfg.h" diff --git a/code/ryzom/client/src/session_browser.cpp b/code/ryzom/client/src/session_browser.cpp index 290b15de5..e0be8ccf0 100644 --- a/code/ryzom/client/src/session_browser.cpp +++ b/code/ryzom/client/src/session_browser.cpp @@ -20,8 +20,6 @@ #include "game_share/r2_share_itf.h" -#include - using namespace std; using namespace NLMISC; using namespace NLNET; diff --git a/code/ryzom/client/src/sky.cpp b/code/ryzom/client/src/sky.cpp index d641d584f..560cf7313 100644 --- a/code/ryzom/client/src/sky.cpp +++ b/code/ryzom/client/src/sky.cpp @@ -15,13 +15,6 @@ // along with this program. If not, see . #include "stdpch.h" -#include -// -#include "nel/3d/u_driver.h" -#include "nel/3d/u_scene.h" -#include "nel/3d/u_animation_set.h" -#include "nel/3d/u_play_list.h" -#include "nel/3d/u_play_list_manager.h" // #include "sky.h" #include "client_sheets/sky_sheet.h" diff --git a/code/ryzom/client/src/sound_manager.cpp b/code/ryzom/client/src/sound_manager.cpp index 907acc1c5..47916f5fc 100644 --- a/code/ryzom/client/src/sound_manager.cpp +++ b/code/ryzom/client/src/sound_manager.cpp @@ -21,14 +21,6 @@ ////////////// // INCLUDES // ////////////// -// misc -#include "nel/misc/path.h" -#include "nel/misc/vector.h" -// 3D -#include "nel/3d/u_particle_system_sound.h" -// pacs -#include "nel/pacs/u_global_retriever.h" -#include "nel/pacs/u_global_position.h" // client #include "sound_manager.h" #include "pacs_client.h" @@ -41,8 +33,6 @@ #include "global.h" // game share #include "game_share/cst_loader.h" -// std. -#include // If you compile using the nel distrib and you don't have the source, you must undef this symbol #if !FINAL_VERSION diff --git a/code/ryzom/client/src/stage.cpp b/code/ryzom/client/src/stage.cpp index e2e773251..01d2c4c1a 100644 --- a/code/ryzom/client/src/stage.cpp +++ b/code/ryzom/client/src/stage.cpp @@ -20,11 +20,9 @@ // INCLUDE // ///////////// #include "stdpch.h" // First include for pre-compiled headers. -// Misc -#include "nel/misc/vectord.h" // Application #include "stage.h" -#include +#include "game_share/entity_types.h" /////////// diff --git a/code/ryzom/client/src/stdpch.h b/code/ryzom/client/src/stdpch.h index 2af740efb..bfc6f0236 100644 --- a/code/ryzom/client/src/stdpch.h +++ b/code/ryzom/client/src/stdpch.h @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -32,6 +33,8 @@ #include #include #include +#include +#include #include #include @@ -53,9 +56,21 @@ #include #include #include +#include #include #include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include #include #include @@ -66,6 +81,9 @@ #include #include #include +#include +#include +#include #include #include @@ -74,6 +92,8 @@ #include #include #include +#include +#include #include diff --git a/code/ryzom/client/src/time_client.cpp b/code/ryzom/client/src/time_client.cpp index 70c7fe0f7..94bbca554 100644 --- a/code/ryzom/client/src/time_client.cpp +++ b/code/ryzom/client/src/time_client.cpp @@ -33,8 +33,6 @@ #include "game_share/zc_shard_common.h" #include "weather.h" #include "game_share/light_cycle.h" -// Std. -#include /////////// diff --git a/code/ryzom/client/src/timed_fx_manager.cpp b/code/ryzom/client/src/timed_fx_manager.cpp index 958d84426..60c88e868 100644 --- a/code/ryzom/client/src/timed_fx_manager.cpp +++ b/code/ryzom/client/src/timed_fx_manager.cpp @@ -31,8 +31,6 @@ #include "fx_manager.h" #include "nel/misc/check_fpu.h" -#include - #if defined(NL_DEBUG) && defined(NL_OS_WINDOWS) #include diff --git a/code/ryzom/client/src/weather_manager_client.cpp b/code/ryzom/client/src/weather_manager_client.cpp index 5acad01f8..f4b94d4a8 100644 --- a/code/ryzom/client/src/weather_manager_client.cpp +++ b/code/ryzom/client/src/weather_manager_client.cpp @@ -16,16 +16,6 @@ #include "stdpch.h" -#include - -#include "nel/georges/u_form_loader.h" -#include "nel/georges/u_form.h" -#include "nel/misc/smart_ptr.h" -#include "nel/misc/matrix.h" -#include "nel/misc/random.h" -#include "nel/3d/u_scene.h" -#include "nel/3d/u_landscape.h" -#include "nel/3d/u_particle_system_instance.h" // #include "game_share/light_cycle.h" #include "game_share/time_weather_season/weather_predict.h" diff --git a/code/ryzom/common/src/game_share/_backup_service_interface_singleton.cpp b/code/ryzom/common/src/game_share/_backup_service_interface_singleton.cpp index 11e7312fa..cb7a58bd1 100644 --- a/code/ryzom/common/src/game_share/_backup_service_interface_singleton.cpp +++ b/code/ryzom/common/src/game_share/_backup_service_interface_singleton.cpp @@ -21,7 +21,6 @@ #include "stdpch.h" #include "_backup_service_interface_singleton.h" #include "utils.h" -#include "nel/net/service.h" //------------------------------------------------------------------------------------------------- diff --git a/code/ryzom/common/src/game_share/action.cpp b/code/ryzom/common/src/game_share/action.cpp index c103c4622..21032fe42 100644 --- a/code/ryzom/common/src/game_share/action.cpp +++ b/code/ryzom/common/src/game_share/action.cpp @@ -16,19 +16,6 @@ #include "stdpch.h" - -// -// Includes -// - -#include -#include - -#include -#include - -#include - #include "action.h" // diff --git a/code/ryzom/common/src/game_share/action_factory.cpp b/code/ryzom/common/src/game_share/action_factory.cpp index 94bc4f90a..8627152b8 100644 --- a/code/ryzom/common/src/game_share/action_factory.cpp +++ b/code/ryzom/common/src/game_share/action_factory.cpp @@ -17,19 +17,6 @@ #include "stdpch.h" - -// -// Includes -// - -#include -#include - -#include -#include - -#include - #include "action_factory.h" diff --git a/code/ryzom/common/src/game_share/action_generic.cpp b/code/ryzom/common/src/game_share/action_generic.cpp index 6edc28589..c0e2568b5 100644 --- a/code/ryzom/common/src/game_share/action_generic.cpp +++ b/code/ryzom/common/src/game_share/action_generic.cpp @@ -17,19 +17,6 @@ #include "stdpch.h" - -// -// Includes -// - -#include -#include - -#include -#include - -#include - #include "action_generic.h" // diff --git a/code/ryzom/common/src/game_share/action_position.cpp b/code/ryzom/common/src/game_share/action_position.cpp index 060c5e157..770bf8804 100644 --- a/code/ryzom/common/src/game_share/action_position.cpp +++ b/code/ryzom/common/src/game_share/action_position.cpp @@ -17,19 +17,6 @@ #include "stdpch.h" - -// -// Includes -// - -#include -#include - -#include -#include - -#include - #include "action_position.h" // diff --git a/code/ryzom/common/src/game_share/change_tracker_client.cpp b/code/ryzom/common/src/game_share/change_tracker_client.cpp index af880f46b..6d0d9dc5d 100644 --- a/code/ryzom/common/src/game_share/change_tracker_client.cpp +++ b/code/ryzom/common/src/game_share/change_tracker_client.cpp @@ -19,8 +19,6 @@ #include "stdpch.h" #include "change_tracker_client.h" -#include - using namespace NLMISC; diff --git a/code/ryzom/common/src/game_share/continuous_action.cpp b/code/ryzom/common/src/game_share/continuous_action.cpp index c396abce2..de3729270 100644 --- a/code/ryzom/common/src/game_share/continuous_action.cpp +++ b/code/ryzom/common/src/game_share/continuous_action.cpp @@ -17,19 +17,6 @@ #include "stdpch.h" - -// -// Includes -// - -#include -#include - -#include -#include - -#include - #include "continuous_action.h" // diff --git a/code/ryzom/common/src/game_share/data_set_base.cpp b/code/ryzom/common/src/game_share/data_set_base.cpp index e153b5d44..54b980d31 100644 --- a/code/ryzom/common/src/game_share/data_set_base.cpp +++ b/code/ryzom/common/src/game_share/data_set_base.cpp @@ -20,8 +20,6 @@ #include "data_set_base.h" #include -// Dependency on NLNET::IService only for config file access for TDataSetSheet::getConfigDataSetSize() -#include #include "ryzom_entity_id.h" using namespace std; diff --git a/code/ryzom/common/src/game_share/mirror.cpp b/code/ryzom/common/src/game_share/mirror.cpp index 1d2855678..31304614b 100644 --- a/code/ryzom/common/src/game_share/mirror.cpp +++ b/code/ryzom/common/src/game_share/mirror.cpp @@ -19,12 +19,7 @@ #include "stdpch.h" #include "mirror.h" #include "synchronised_message.h" -#include -#include -#include -#include #include "tick_proxy_time_measure.h" -#include using namespace NLMISC; using namespace NLNET; diff --git a/code/ryzom/common/src/game_share/mirror_prop_value.cpp b/code/ryzom/common/src/game_share/mirror_prop_value.cpp index 6e4b806b0..641baaae6 100644 --- a/code/ryzom/common/src/game_share/mirror_prop_value.cpp +++ b/code/ryzom/common/src/game_share/mirror_prop_value.cpp @@ -18,7 +18,6 @@ #include "stdpch.h" #include "mirror_prop_value.h" -#include sint32 NbAllocdListCells = 0; diff --git a/code/ryzom/common/src/game_share/object.cpp b/code/ryzom/common/src/game_share/object.cpp index f4330e75f..f395bcf7a 100644 --- a/code/ryzom/common/src/game_share/object.cpp +++ b/code/ryzom/common/src/game_share/object.cpp @@ -21,21 +21,9 @@ #include "stdpch.h" #include "object.h" -#include "nel/misc/debug.h" -#include "nel/misc/singleton.h" -#include "nel/misc/string_common.h" -#include "game_share/utils.h" +#include "utils.h" #include -#include "nel/misc/bit_mem_stream.h" - -#include -#include - -#include -#include -#include -#include namespace R2 { diff --git a/code/ryzom/common/src/game_share/persistent_data.cpp b/code/ryzom/common/src/game_share/persistent_data.cpp index 371cc367a..9d8f8a893 100644 --- a/code/ryzom/common/src/game_share/persistent_data.cpp +++ b/code/ryzom/common/src/game_share/persistent_data.cpp @@ -28,9 +28,6 @@ //------------------------------------------------------------------------- #include "stdpch.h" -#include "nel/misc/file.h" -#include "nel/misc/path.h" -#include "nel/misc/sstring.h" #include "utils.h" #include "persistent_data.h" #include "persistent_data_tree.h" diff --git a/code/ryzom/common/src/game_share/property_allocator_client.cpp b/code/ryzom/common/src/game_share/property_allocator_client.cpp index ef064d51b..b5cd00200 100644 --- a/code/ryzom/common/src/game_share/property_allocator_client.cpp +++ b/code/ryzom/common/src/game_share/property_allocator_client.cpp @@ -18,8 +18,6 @@ #include "stdpch.h" #include "property_allocator_client.h" -#include -#include #include "mirrored_data_set.h" using namespace NLMISC; diff --git a/code/ryzom/common/src/game_share/scenario.cpp b/code/ryzom/common/src/game_share/scenario.cpp index 74306ff71..0a25acddd 100644 --- a/code/ryzom/common/src/game_share/scenario.cpp +++ b/code/ryzom/common/src/game_share/scenario.cpp @@ -21,10 +21,6 @@ #include "stdpch.h" #include "scenario.h" - -#include -#include - #include "object.h" diff --git a/code/ryzom/common/src/game_share/server_admin_module.cpp b/code/ryzom/common/src/game_share/server_admin_module.cpp index 39833a859..b3743ad6c 100644 --- a/code/ryzom/common/src/game_share/server_admin_module.cpp +++ b/code/ryzom/common/src/game_share/server_admin_module.cpp @@ -48,8 +48,6 @@ #include "nel/misc/o_xml.h" #include "nel/misc/i_xml.h" -#include - using namespace std; using namespace NLMISC; diff --git a/code/ryzom/common/src/game_share/server_edition_module.cpp b/code/ryzom/common/src/game_share/server_edition_module.cpp index 0ef27648e..f1f03163f 100644 --- a/code/ryzom/common/src/game_share/server_edition_module.cpp +++ b/code/ryzom/common/src/game_share/server_edition_module.cpp @@ -23,8 +23,6 @@ #include "server_edition_module.h" -#include - #include "dms.h" #include "nel/net/unified_network.h" diff --git a/code/ryzom/common/src/game_share/simlag.cpp b/code/ryzom/common/src/game_share/simlag.cpp index 37486bd21..68c9e2c04 100644 --- a/code/ryzom/common/src/game_share/simlag.cpp +++ b/code/ryzom/common/src/game_share/simlag.cpp @@ -22,14 +22,6 @@ // Includes // -#include -#include - -#include -#include - -#include - // // Using // diff --git a/code/ryzom/common/src/game_share/slot_equipment.cpp b/code/ryzom/common/src/game_share/slot_equipment.cpp index 6c1259707..16414604c 100644 --- a/code/ryzom/common/src/game_share/slot_equipment.cpp +++ b/code/ryzom/common/src/game_share/slot_equipment.cpp @@ -21,8 +21,6 @@ #include "slot_equipment.h" #include "nel/misc/string_conversion.h" -#include - using namespace std; using namespace NLMISC; diff --git a/code/ryzom/common/src/game_share/stdpch.h b/code/ryzom/common/src/game_share/stdpch.h index b85276b65..94a05e8df 100644 --- a/code/ryzom/common/src/game_share/stdpch.h +++ b/code/ryzom/common/src/game_share/stdpch.h @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -27,10 +28,14 @@ #include #include #include -//#include +#include #include #include #include +#include +#include +#include +#include #include #include @@ -42,8 +47,20 @@ #include #include #include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include + #include "utils.h" From 23fddefef630e984c342c919c1ed8ec65c16e994 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 10 Jul 2010 15:02:07 +0200 Subject: [PATCH 08/52] Changed: optimizations for PCH --- .../client/src/interface_v3/action_handler_debug.cpp | 5 ----- .../client/src/interface_v3/action_handler_game.cpp | 5 ----- .../client/src/interface_v3/action_handler_help.cpp | 3 --- .../client/src/interface_v3/action_handler_phrase.cpp | 1 - .../client/src/interface_v3/action_phrase_faber.cpp | 1 - code/ryzom/client/src/interface_v3/add_on_manager.cpp | 2 -- code/ryzom/client/src/interface_v3/bonus_malus.cpp | 2 -- .../client/src/interface_v3/bot_chat_page_all.cpp | 2 -- .../src/interface_v3/bot_chat_page_dynamic_mission.cpp | 2 -- .../client/src/interface_v3/bot_chat_page_mission.cpp | 1 - code/ryzom/client/src/interface_v3/character_3d.cpp | 10 ---------- code/ryzom/client/src/interface_v3/chat_filter.cpp | 1 - .../client/src/interface_v3/chat_text_manager.cpp | 2 -- code/ryzom/client/src/interface_v3/chat_window.cpp | 4 ---- code/ryzom/client/src/interface_v3/ctrl_base.cpp | 2 -- code/ryzom/client/src/interface_v3/ctrl_polygon.cpp | 2 -- code/ryzom/client/src/interface_v3/ctrl_quad.cpp | 2 -- code/ryzom/client/src/interface_v3/custom_mouse.cpp | 1 - code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp | 1 - .../client/src/interface_v3/dbgroup_build_phrase.cpp | 1 - .../client/src/interface_v3/dbgroup_combo_box.cpp | 1 - .../interface_v3/dbgroup_list_sheet_icon_phrase.cpp | 3 --- .../interface_v3/dbgroup_list_sheet_text_phrase.cpp | 3 --- .../src/interface_v3/dbgroup_list_sheet_trade.cpp | 1 - code/ryzom/client/src/interface_v3/dbview_quantity.cpp | 2 -- .../ryzom/client/src/interface_v3/event_descriptor.cpp | 1 - code/ryzom/client/src/interface_v3/group_career.cpp | 2 -- code/ryzom/client/src/interface_v3/group_compas.cpp | 2 -- code/ryzom/client/src/interface_v3/group_container.cpp | 3 --- code/ryzom/client/src/interface_v3/group_editbox.cpp | 2 -- code/ryzom/client/src/interface_v3/group_frame.cpp | 2 -- code/ryzom/client/src/interface_v3/group_header.cpp | 2 -- code/ryzom/client/src/interface_v3/group_html.cpp | 3 --- code/ryzom/client/src/interface_v3/group_list.cpp | 4 ---- 34 files changed, 81 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/action_handler_debug.cpp b/code/ryzom/client/src/interface_v3/action_handler_debug.cpp index aac90d171..eaa24e354 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_debug.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_debug.cpp @@ -20,11 +20,6 @@ using namespace std; using namespace NLMISC; using namespace NL3D; -#include "nel/3d/landscapeig_manager.h" -#include "nel/3d/u_landscape.h" -#include "nel/misc/progress_callback.h" -#include "nel/misc/command.h" - #include "action_handler.h" #include "../misc.h" #include "../prim_file.h" diff --git a/code/ryzom/client/src/interface_v3/action_handler_game.cpp b/code/ryzom/client/src/interface_v3/action_handler_game.cpp index 903f37a0b..98decfedd 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_game.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_game.cpp @@ -78,13 +78,8 @@ #include "game_share/bot_chat_types.h" #include "game_share/constants.h" #include "game_share/scores.h" -// Commands -#include "nel/misc/command.h" -#include "nel/misc/algo.h" -#include "nel/misc/i18n.h" // Game Config -#include "nel/3d/u_driver.h" #include "dbgroup_combo_box.h" #include "ctrl_button.h" #include "../global.h" diff --git a/code/ryzom/client/src/interface_v3/action_handler_help.cpp b/code/ryzom/client/src/interface_v3/action_handler_help.cpp index 4de275c9b..23c9982c0 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_help.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_help.cpp @@ -57,9 +57,6 @@ #include "sbrick_manager.h" #include "sphrase_manager.h" #include "action_handler_help.h" -#include "nel/misc/i18n.h" -#include "nel/misc/algo.h" -#include "nel/net/email.h" #include "game_share/mission_desc.h" #include "game_share/inventories.h" #include "game_share/visual_slot_manager.h" diff --git a/code/ryzom/client/src/interface_v3/action_handler_phrase.cpp b/code/ryzom/client/src/interface_v3/action_handler_phrase.cpp index e7cef8885..4c7c081f8 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_phrase.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_phrase.cpp @@ -46,7 +46,6 @@ #include "../entities.h" #include "macrocmd_manager.h" #include "group_menu.h" -#include "nel/misc/algo.h" #include "group_tree.h" extern CSheetManager SheetMngr; diff --git a/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp b/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp index 10153faf3..b7b2afce2 100644 --- a/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp +++ b/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp @@ -25,7 +25,6 @@ #include "action_handler.h" #include "../client_cfg.h" #include "ctrl_base_button.h" -#include "nel/misc/algo.h" #include "group_container.h" #include "../string_manager_client.h" #include "../net_manager.h" diff --git a/code/ryzom/client/src/interface_v3/add_on_manager.cpp b/code/ryzom/client/src/interface_v3/add_on_manager.cpp index 7a508e059..dbec2856a 100644 --- a/code/ryzom/client/src/interface_v3/add_on_manager.cpp +++ b/code/ryzom/client/src/interface_v3/add_on_manager.cpp @@ -16,8 +16,6 @@ #include "stdpch.h" #include "add_on_manager.h" -#include "nel/misc/algo.h" -#include "nel/misc/path.h" using namespace NLMISC; diff --git a/code/ryzom/client/src/interface_v3/bonus_malus.cpp b/code/ryzom/client/src/interface_v3/bonus_malus.cpp index dea03b0b4..38f80d792 100644 --- a/code/ryzom/client/src/interface_v3/bonus_malus.cpp +++ b/code/ryzom/client/src/interface_v3/bonus_malus.cpp @@ -16,8 +16,6 @@ #include "stdpch.h" -#include "nel/misc/string_conversion.h" - #include "bonus_malus.h" using namespace std; diff --git a/code/ryzom/client/src/interface_v3/bot_chat_page_all.cpp b/code/ryzom/client/src/interface_v3/bot_chat_page_all.cpp index 220737296..457886640 100644 --- a/code/ryzom/client/src/interface_v3/bot_chat_page_all.cpp +++ b/code/ryzom/client/src/interface_v3/bot_chat_page_all.cpp @@ -32,8 +32,6 @@ #include "interface_manager.h" #include "../global.h" -#include "nel/misc/i18n.h" - CBotChatPageAll *BotChatPageAll = NULL; diff --git a/code/ryzom/client/src/interface_v3/bot_chat_page_dynamic_mission.cpp b/code/ryzom/client/src/interface_v3/bot_chat_page_dynamic_mission.cpp index af39d7d8d..fbddbbc49 100644 --- a/code/ryzom/client/src/interface_v3/bot_chat_page_dynamic_mission.cpp +++ b/code/ryzom/client/src/interface_v3/bot_chat_page_dynamic_mission.cpp @@ -27,8 +27,6 @@ #include "bot_chat_manager.h" #include "../client_cfg.h" #include "../net_manager.h" -// -#include "nel/misc/i18n.h" using namespace std; diff --git a/code/ryzom/client/src/interface_v3/bot_chat_page_mission.cpp b/code/ryzom/client/src/interface_v3/bot_chat_page_mission.cpp index 66d98277d..fff35b70a 100644 --- a/code/ryzom/client/src/interface_v3/bot_chat_page_mission.cpp +++ b/code/ryzom/client/src/interface_v3/bot_chat_page_mission.cpp @@ -27,7 +27,6 @@ #include "group_container.h" #include "dbctrl_sheet.h" #include "view_text_id.h" -#include "nel/misc/sheet_id.h" #include "../net_manager.h" using namespace std; diff --git a/code/ryzom/client/src/interface_v3/character_3d.cpp b/code/ryzom/client/src/interface_v3/character_3d.cpp index 244f5e278..a2624f87b 100644 --- a/code/ryzom/client/src/interface_v3/character_3d.cpp +++ b/code/ryzom/client/src/interface_v3/character_3d.cpp @@ -30,16 +30,6 @@ #include "../player_r2_cl.h" #include "../entities.h" -#include "nel/3d/u_scene.h" -#include "nel/3d/u_instance.h" -#include "nel/3d/u_camera.h" -#include "nel/3d/u_play_list_manager.h" -#include "nel/3d/u_play_list.h" -#include "nel/3d/u_animation_set.h" -#include "nel/3d/u_bone.h" -//#include "nel/3d/u_track.h" -//#include "nel/3d/u_instance_material.h" - #include "../r2/editor.h" #include "../client_cfg.h" diff --git a/code/ryzom/client/src/interface_v3/chat_filter.cpp b/code/ryzom/client/src/interface_v3/chat_filter.cpp index cd0f73943..7d8d8841e 100644 --- a/code/ryzom/client/src/interface_v3/chat_filter.cpp +++ b/code/ryzom/client/src/interface_v3/chat_filter.cpp @@ -20,7 +20,6 @@ #include "chat_filter.h" #include "../client_chat_manager.h" #include "people_list.h" -#include "nel/misc/i18n.h" #include "../client_cfg.h" #include "../net_manager.h" #include "interface_manager.h" diff --git a/code/ryzom/client/src/interface_v3/chat_text_manager.cpp b/code/ryzom/client/src/interface_v3/chat_text_manager.cpp index 6fbfcbe33..391898563 100644 --- a/code/ryzom/client/src/interface_v3/chat_text_manager.cpp +++ b/code/ryzom/client/src/interface_v3/chat_text_manager.cpp @@ -21,8 +21,6 @@ #include "chat_text_manager.h" #include "view_text.h" #include "interface_manager.h" -// nel -#include "nel/misc/ucstring.h" using namespace std; using namespace NLMISC; diff --git a/code/ryzom/client/src/interface_v3/chat_window.cpp b/code/ryzom/client/src/interface_v3/chat_window.cpp index 411c7789d..2affd9afe 100644 --- a/code/ryzom/client/src/interface_v3/chat_window.cpp +++ b/code/ryzom/client/src/interface_v3/chat_window.cpp @@ -20,10 +20,6 @@ // client #include "stdpch.h" -// nel -#include "nel/misc/command.h" -#include "nel/misc/i18n.h" - #include "game_share/shard_names.h" #include "../r2/editor.h" diff --git a/code/ryzom/client/src/interface_v3/ctrl_base.cpp b/code/ryzom/client/src/interface_v3/ctrl_base.cpp index 9b895ce09..85414ba6e 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_base.cpp +++ b/code/ryzom/client/src/interface_v3/ctrl_base.cpp @@ -22,8 +22,6 @@ #include "game_share/xml_auto_ptr.h" #include "interface_manager.h" -#include "nel/misc/i18n.h" - using namespace NLMISC; // *************************************************************************** diff --git a/code/ryzom/client/src/interface_v3/ctrl_polygon.cpp b/code/ryzom/client/src/interface_v3/ctrl_polygon.cpp index 459851037..078059960 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_polygon.cpp +++ b/code/ryzom/client/src/interface_v3/ctrl_polygon.cpp @@ -18,8 +18,6 @@ #include "ctrl_polygon.h" #include "view_renderer.h" #include "interface_manager.h" -// -#include "nel/misc/vector_2f.h" using namespace NLMISC; diff --git a/code/ryzom/client/src/interface_v3/ctrl_quad.cpp b/code/ryzom/client/src/interface_v3/ctrl_quad.cpp index 5eb8f1597..23b6069ad 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_quad.cpp +++ b/code/ryzom/client/src/interface_v3/ctrl_quad.cpp @@ -18,8 +18,6 @@ #include "ctrl_quad.h" #include "interface_group.h" #include "interface_manager.h" -// -#include "nel/misc/polygon.h" using namespace NLMISC; diff --git a/code/ryzom/client/src/interface_v3/custom_mouse.cpp b/code/ryzom/client/src/interface_v3/custom_mouse.cpp index 84db66c68..af1bb7209 100644 --- a/code/ryzom/client/src/interface_v3/custom_mouse.cpp +++ b/code/ryzom/client/src/interface_v3/custom_mouse.cpp @@ -17,7 +17,6 @@ #include "stdpch.h" #include "custom_mouse.h" // -#include "nel/misc/file.h" #include "../global.h" #include "../input.h" #include "input_handler_manager.h" diff --git a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp index bbdead11e..33f1e8400 100644 --- a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp +++ b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp @@ -26,7 +26,6 @@ #include "../client_sheets/pact_sheet.h" #include "../client_sheets/mission_icon_sheet.h" #include "../client_sheets/faction_sheet.h" -#include "nel/misc/algo.h" #include "game_share/skills.h" #include "game_share/inventories.h" #include "list_sheet_base.h" diff --git a/code/ryzom/client/src/interface_v3/dbgroup_build_phrase.cpp b/code/ryzom/client/src/interface_v3/dbgroup_build_phrase.cpp index 7e15b0551..752284d95 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_build_phrase.cpp +++ b/code/ryzom/client/src/interface_v3/dbgroup_build_phrase.cpp @@ -26,7 +26,6 @@ #include "ctrl_button.h" #include "group_editbox.h" #include "../client_cfg.h" -#include "nel/misc/algo.h" #include "view_text.h" #include "skill_manager.h" #include "../string_manager_client.h" diff --git a/code/ryzom/client/src/interface_v3/dbgroup_combo_box.cpp b/code/ryzom/client/src/interface_v3/dbgroup_combo_box.cpp index 04879ee99..0834fd392 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_combo_box.cpp +++ b/code/ryzom/client/src/interface_v3/dbgroup_combo_box.cpp @@ -24,7 +24,6 @@ #include "ctrl_button.h" #include "action_handler.h" #include "lua_ihm.h" -#include "nel/misc/i18n.h" #include "lua_ihm.h" diff --git a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_icon_phrase.cpp b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_icon_phrase.cpp index 049a707b8..0da2c8314 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_icon_phrase.cpp +++ b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_icon_phrase.cpp @@ -18,9 +18,6 @@ #include "stdpch.h" #include "dbgroup_list_sheet_icon_phrase.h" #include "sphrase_manager.h" -#include "nel/misc/i18n.h" -#include "nel/misc/common.h" -#include "nel/misc/algo.h" #include "interface_manager.h" using namespace std; diff --git a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text_phrase.cpp b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text_phrase.cpp index f4be870c9..f8009bb57 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text_phrase.cpp +++ b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text_phrase.cpp @@ -19,9 +19,6 @@ #include "stdpch.h" #include "dbgroup_list_sheet_text_phrase.h" #include "sphrase_manager.h" -#include "nel/misc/i18n.h" -#include "nel/misc/common.h" -#include "nel/misc/algo.h" #include "interface_manager.h" using namespace std; diff --git a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_trade.cpp b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_trade.cpp index 1ad6cf8d9..8fd33da9d 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_trade.cpp +++ b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_trade.cpp @@ -26,7 +26,6 @@ #include "view_text.h" #include "action_handler.h" #include "sphrase_manager.h" -#include "nel/misc/algo.h" #include "game_share/time_weather_season/time_and_season.h" #include "game_share/pvp_clan.h" #include "../string_manager_client.h" diff --git a/code/ryzom/client/src/interface_v3/dbview_quantity.cpp b/code/ryzom/client/src/interface_v3/dbview_quantity.cpp index 7bf09afe0..915fcebce 100644 --- a/code/ryzom/client/src/interface_v3/dbview_quantity.cpp +++ b/code/ryzom/client/src/interface_v3/dbview_quantity.cpp @@ -23,8 +23,6 @@ #include "interface_manager.h" #include "game_share/xml_auto_ptr.h" -#include "nel/misc/i18n.h" - using namespace std; using namespace NL3D; using namespace NLMISC; diff --git a/code/ryzom/client/src/interface_v3/event_descriptor.cpp b/code/ryzom/client/src/interface_v3/event_descriptor.cpp index 45d0b3531..e2178540a 100644 --- a/code/ryzom/client/src/interface_v3/event_descriptor.cpp +++ b/code/ryzom/client/src/interface_v3/event_descriptor.cpp @@ -19,7 +19,6 @@ #include "stdpch.h" #include "event_descriptor.h" -#include "nel/misc/events.h" void CEventDescriptorKey::init(const NLMISC::CEventKey &ev) { diff --git a/code/ryzom/client/src/interface_v3/group_career.cpp b/code/ryzom/client/src/interface_v3/group_career.cpp index d8c7391c6..f7dbe2cc9 100644 --- a/code/ryzom/client/src/interface_v3/group_career.cpp +++ b/code/ryzom/client/src/interface_v3/group_career.cpp @@ -27,8 +27,6 @@ using namespace std; -#include "nel/misc/i_xml.h" - NLMISC_REGISTER_OBJECT(CViewBase, CGroupCareer, std::string, "career"); NLMISC_REGISTER_OBJECT(CViewBase, CGroupJob, std::string, "job"); diff --git a/code/ryzom/client/src/interface_v3/group_compas.cpp b/code/ryzom/client/src/interface_v3/group_compas.cpp index 098e33b6a..0fa2b30e7 100644 --- a/code/ryzom/client/src/interface_v3/group_compas.cpp +++ b/code/ryzom/client/src/interface_v3/group_compas.cpp @@ -18,8 +18,6 @@ #include "stdpch.h" // -#include "nel/3d/u_instance_material.h" -// #include "game_share/xml_auto_ptr.h" // #include "group_compas.h" diff --git a/code/ryzom/client/src/interface_v3/group_container.cpp b/code/ryzom/client/src/interface_v3/group_container.cpp index 7002331fa..3defd1b29 100644 --- a/code/ryzom/client/src/interface_v3/group_container.cpp +++ b/code/ryzom/client/src/interface_v3/group_container.cpp @@ -36,9 +36,6 @@ #include "view_text.h" #include "view_bitmap.h" #include "../time_client.h" -#include "nel/misc/i18n.h" -#include "nel/3d/u_driver.h" -#include "nel/misc/algo.h" // *************************************************************************** diff --git a/code/ryzom/client/src/interface_v3/group_editbox.cpp b/code/ryzom/client/src/interface_v3/group_editbox.cpp index 402b83688..b2916b909 100644 --- a/code/ryzom/client/src/interface_v3/group_editbox.cpp +++ b/code/ryzom/client/src/interface_v3/group_editbox.cpp @@ -21,8 +21,6 @@ #include "group_editbox.h" #include "interface_manager.h" #include "input_handler_manager.h" -#include "nel/misc/command.h" -#include "nel/misc/system_utils.h" #include "view_text.h" #include "game_share/xml_auto_ptr.h" #include "interface_options.h" diff --git a/code/ryzom/client/src/interface_v3/group_frame.cpp b/code/ryzom/client/src/interface_v3/group_frame.cpp index 4b9b984fe..4b7e5cdcc 100644 --- a/code/ryzom/client/src/interface_v3/group_frame.cpp +++ b/code/ryzom/client/src/interface_v3/group_frame.cpp @@ -26,8 +26,6 @@ using namespace std; using namespace NLMISC; -#include "nel/misc/i_xml.h" - NLMISC_REGISTER_OBJECT(CViewBase, CGroupFrame, std::string, "frame"); // *************************************************************************** diff --git a/code/ryzom/client/src/interface_v3/group_header.cpp b/code/ryzom/client/src/interface_v3/group_header.cpp index 7526fcd02..d7b2969a1 100644 --- a/code/ryzom/client/src/interface_v3/group_header.cpp +++ b/code/ryzom/client/src/interface_v3/group_header.cpp @@ -22,8 +22,6 @@ #include "group_container.h" #include "group_header.h" #include "lua_ihm.h" -// -#include "nel/misc/smart_ptr.h" using namespace NLMISC; diff --git a/code/ryzom/client/src/interface_v3/group_html.cpp b/code/ryzom/client/src/interface_v3/group_html.cpp index 2615e2653..48becda66 100644 --- a/code/ryzom/client/src/interface_v3/group_html.cpp +++ b/code/ryzom/client/src/interface_v3/group_html.cpp @@ -45,9 +45,6 @@ extern "C" #include "lua_ihm.h" #include "../time_client.h" -#include "nel/misc/i18n.h" -#include "nel/misc/md5.h" -#include "nel/3d/texture_file.h" using namespace std; using namespace NLMISC; diff --git a/code/ryzom/client/src/interface_v3/group_list.cpp b/code/ryzom/client/src/interface_v3/group_list.cpp index ae6f2e673..7ccd5c51c 100644 --- a/code/ryzom/client/src/interface_v3/group_list.cpp +++ b/code/ryzom/client/src/interface_v3/group_list.cpp @@ -18,10 +18,6 @@ #include "stdpch.h" -#include "nel/misc/factory.h" -#include "nel/misc/i_xml.h" -#include "nel/misc/i18n.h" - #include "group_list.h" #include "interface_manager.h" #include "interface_element.h" From a1050b2edb80b2dc1f2b3ad7915e511903d0dce9 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 10 Jul 2010 15:08:21 +0200 Subject: [PATCH 09/52] Changed: #860 Remove/convert/update old projects --- code/nel/tools/all.sln | 8 + code/ryzom/client/src/client.vcproj | 8 +- .../common/src/game_share/game_share.vcproj | 148 ++++----- .../alias_synchronizer.vcproj | 312 ++++++------------ 4 files changed, 188 insertions(+), 288 deletions(-) diff --git a/code/nel/tools/all.sln b/code/nel/tools/all.sln index d5f8411ef..901dde140 100644 --- a/code/nel/tools/all.sln +++ b/code/nel/tools/all.sln @@ -400,6 +400,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shapes_exporter", "3d\shape {2B48BE83-108B-4E8E-8A55-6627CF09AC5A} = {2B48BE83-108B-4E8E-8A55-6627CF09AC5A} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "georges2csv", "georges\georges2csv\georges2csv.vcproj", "{885542B1-BE3C-401A-A2A4-DA49E48DF0AB}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -944,6 +946,12 @@ Global {F8607267-5BA2-4BE8-A674-26C3F7D0A9BB}.Release|Win32.Build.0 = Release|Win32 {F8607267-5BA2-4BE8-A674-26C3F7D0A9BB}.Release|x64.ActiveCfg = Release|x64 {F8607267-5BA2-4BE8-A674-26C3F7D0A9BB}.Release|x64.Build.0 = Release|x64 + {885542B1-BE3C-401A-A2A4-DA49E48DF0AB}.Debug|Win32.ActiveCfg = Debug|Win32 + {885542B1-BE3C-401A-A2A4-DA49E48DF0AB}.Debug|Win32.Build.0 = Debug|Win32 + {885542B1-BE3C-401A-A2A4-DA49E48DF0AB}.Debug|x64.ActiveCfg = Debug|Win32 + {885542B1-BE3C-401A-A2A4-DA49E48DF0AB}.Release|Win32.ActiveCfg = Release|Win32 + {885542B1-BE3C-401A-A2A4-DA49E48DF0AB}.Release|Win32.Build.0 = Release|Win32 + {885542B1-BE3C-401A-A2A4-DA49E48DF0AB}.Release|x64.ActiveCfg = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/code/ryzom/client/src/client.vcproj b/code/ryzom/client/src/client.vcproj index a8e226fc5..2ebfd3e72 100644 --- a/code/ryzom/client/src/client.vcproj +++ b/code/ryzom/client/src/client.vcproj @@ -1,7 +1,7 @@ - diff --git a/code/ryzom/common/src/game_share/game_share.vcproj b/code/ryzom/common/src/game_share/game_share.vcproj index 9c336674c..25d85a290 100644 --- a/code/ryzom/common/src/game_share/game_share.vcproj +++ b/code/ryzom/common/src/game_share/game_share.vcproj @@ -1,7 +1,7 @@ + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - @@ -1482,7 +1478,7 @@ /> - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - From 6a77b73cd86638446c81b43b40bd374014da17fc Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 10 Jul 2010 15:17:13 +0200 Subject: [PATCH 10/52] Changed: #991 Make sure all debug files are created in log directory --- code/nel/tools/3d/crash_log_analyser/main.cpp | 2 +- code/nel/tools/3d/file_info/main.cpp | 2 +- code/nel/tools/pacs/build_ig_boxes/main.cpp | 3 +-- code/nel/tools/pacs/build_rbank/main.cpp | 4 ++-- .../ryzom/server/src/entities_game_service/harvest_source.cpp | 4 ++-- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/code/nel/tools/3d/crash_log_analyser/main.cpp b/code/nel/tools/3d/crash_log_analyser/main.cpp index df4c4e766..592f09e19 100644 --- a/code/nel/tools/3d/crash_log_analyser/main.cpp +++ b/code/nel/tools/3d/crash_log_analyser/main.cpp @@ -194,7 +194,7 @@ void statRyzomBug(const char *dirSrc) CPath::getPathContent(dirSrc, false, false, true, fileList, NULL, true); // delete the log.log - CFile::deleteFile("log.log"); + CFile::deleteFile(getLogDirectory() + "log.log"); TStatStrMap senderMap; TStatMap shardMap; diff --git a/code/nel/tools/3d/file_info/main.cpp b/code/nel/tools/3d/file_info/main.cpp index ef8318f3b..1e243a545 100644 --- a/code/nel/tools/3d/file_info/main.cpp +++ b/code/nel/tools/3d/file_info/main.cpp @@ -661,7 +661,7 @@ int main(int argc, const char *argv[]) // Open log FILE *logStream; - logStream= fopen("C:/temp/file_info.log", "wt"); + logStream= fopen(std::string(getLogDirectory() + "file_info.log").c_str(), "wt"); // parse dir or file ?? diff --git a/code/nel/tools/pacs/build_ig_boxes/main.cpp b/code/nel/tools/pacs/build_ig_boxes/main.cpp index d840882c7..de308ed25 100644 --- a/code/nel/tools/pacs/build_ig_boxes/main.cpp +++ b/code/nel/tools/pacs/build_ig_boxes/main.cpp @@ -120,8 +120,6 @@ void init() } // -CFileDisplayer fd("evallog.log", true); - int main(int argc, char **argv) { // Filter addSearchPath @@ -129,6 +127,7 @@ int main(int argc, char **argv) InfoLog->addNegativeFilter("adding the path"); createDebug(); + CFileDisplayer fd(getLogDirectory() + "evallog.log", true); try { diff --git a/code/nel/tools/pacs/build_rbank/main.cpp b/code/nel/tools/pacs/build_rbank/main.cpp index 82e6a5724..3f4657d18 100644 --- a/code/nel/tools/pacs/build_rbank/main.cpp +++ b/code/nel/tools/pacs/build_rbank/main.cpp @@ -299,14 +299,14 @@ void moulineZones(vector &zoneNames) /****************************************************************\ MAIN \****************************************************************/ -CFileDisplayer fd("evallog.log", true); - int main(int argc, char **argv) { // Filter addSearchPath NLMISC::createDebug(); InfoLog->addNegativeFilter ("adding the path"); + CFileDisplayer fd(getLogDirectory() + "evallog.log", true); + #ifdef LOG_ALL_INFO_TO_FILE createDebug(); DebugLog->addDisplayer (&fd); diff --git a/code/ryzom/server/src/entities_game_service/harvest_source.cpp b/code/ryzom/server/src/entities_game_service/harvest_source.cpp index 222b0ca49..fea6f6e37 100644 --- a/code/ryzom/server/src/entities_game_service/harvest_source.cpp +++ b/code/ryzom/server/src/entities_game_service/harvest_source.cpp @@ -1233,8 +1233,8 @@ bool forageTestDoExtract( } // Request and output results - FILE *f = fopen( "forage_test.csv", "at" ); - FILE *f2 = fopen( "forage_test.log", "at" ); + FILE *f = fopen( std::string(getLogDirectory() + "forage_test.csv").c_str(), "at" ); + FILE *f2 = fopen( std::string(getLogDirectory() + "forage_test.log").c_str(), "at" ); float reqS = 1.0f / (reqPeriod * 10.0f); float req [CHarvestSource::NbPosRTProps]; float abs [CHarvestSource::NbPosRTProps]; From d49ff113258f4cade75b6df9f7e13c7c44307f6d Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 10 Jul 2010 15:23:19 +0200 Subject: [PATCH 11/52] Changed: optimizations for PCH --- code/ryzom/client/src/stdpch.h | 75 ++++++++++++++++++++-------------- 1 file changed, 44 insertions(+), 31 deletions(-) diff --git a/code/ryzom/client/src/stdpch.h b/code/ryzom/client/src/stdpch.h index bfc6f0236..aecd5b1c0 100644 --- a/code/ryzom/client/src/stdpch.h +++ b/code/ryzom/client/src/stdpch.h @@ -39,54 +39,67 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include +#include +#include #include +#include #include -#include -#include -#include -#include -#include +#include +#include #include -#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include +#include +#include +#include +#include +#include #include #include +#include #include #include From fb3d4f7a1979c902edb67ae879493245a8edf687 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 10 Jul 2010 16:13:31 +0200 Subject: [PATCH 12/52] Changed: #841 Change the wrong header in the source code --- .../tools/3d/tile_edit_qt/browser_model.cpp | 73 +++++++++------ .../3d/tile_edit_qt/tile_browser_dlg.cpp | 46 ++++++---- .../tools/3d/tile_edit_qt/tile_browser_dlg.h | 16 ++++ .../tools/3d/tile_edit_qt/tile_edit_dlg.cpp | 90 +++++++++++-------- .../nel/tools/3d/tile_edit_qt/tile_edit_dlg.h | 16 ++++ .../3d/tile_edit_qt/tile_listwidgetitem.cpp | 16 ++++ .../3d/tile_edit_qt/tile_listwidgetitem.h | 17 +++- .../3d/tile_edit_qt/tile_rotation_dlg.cpp | 16 ++++ .../tools/3d/tile_edit_qt/tile_rotation_dlg.h | 16 ++++ .../nel/tools/3d/tile_edit_qt/tiles_model.cpp | 20 ++++- 10 files changed, 242 insertions(+), 84 deletions(-) diff --git a/code/nel/tools/3d/tile_edit_qt/browser_model.cpp b/code/nel/tools/3d/tile_edit_qt/browser_model.cpp index c0b47662b..edf6068cb 100644 --- a/code/nel/tools/3d/tile_edit_qt/browser_model.cpp +++ b/code/nel/tools/3d/tile_edit_qt/browser_model.cpp @@ -1,3 +1,18 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . #include #include "browser_model.h" @@ -130,7 +145,7 @@ bool TileInfo::Load (int index, std::vector* Alpha) if ( !loadPixmapBuffer( path, Bits, Alpha, 0)) { bRes=false; - QMessageBox::information( NULL, "Can't load Diffuse file", QString( (path.c_str()) )); + QMessageBox::information( NULL, QObject::tr("Can't load Diffuse file"), QString( (path.c_str()) )); } else @@ -142,7 +157,7 @@ bool TileInfo::Load (int index, std::vector* Alpha) if (!loadPixmapBuffer( nightPath, nightBits, Alpha, 0)) { bRes=false; - QMessageBox::information( NULL, "Can't load Additive file", QString( nightPath.c_str() ) ); + QMessageBox::information( NULL, QObject::tr("Can't load Additive file"), QString( nightPath.c_str() ) ); } else nightLoaded=1; @@ -153,7 +168,7 @@ bool TileInfo::Load (int index, std::vector* Alpha) if (!loadPixmapBuffer( alphaPath, alphaBits, NULL, tileBankBrowser.getTile (index)->getRotAlpha ())) { bRes=false; - QMessageBox::information( NULL, "Can't load Alpha file", QString( alphaPath.c_str() ) ); + QMessageBox::information( NULL, QObject::tr("Can't load Alpha file"), QString( alphaPath.c_str() ) ); } else @@ -273,7 +288,7 @@ bool TileList::setTile128 (int tile, const std::string& name, NL3D::CTile::TBitm uint Height; if (!PIC_LoadPic(tileBankBrowser.getAbsPath ()+troncated, tampon, Width, Height)) { - return ( QMessageBox::Yes == QMessageBox::question( NULL, "Can't load bitmap.", QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No)); + return ( QMessageBox::Yes == QMessageBox::question( NULL, QObject::tr("Can't load bitmap."), QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No)); } else { @@ -290,8 +305,8 @@ bool TileList::setTile128 (int tile, const std::string& name, NL3D::CTile::TBitm if ((error!=CTileSet::ok)&&(error!=CTileSet::addFirstA128128)&&!zouille ()) { - QString pixelMessage = QString("%1\nPixel: %2(%3).\nContinue ?").arg(CTileSet::getErrorMessage (error)).arg(pixel).arg(comp[composante]); - return ( QMessageBox::Yes == QMessageBox::question( NULL, "Can't set Bitmap", pixelMessage, QMessageBox::Yes | QMessageBox::No) ); + QString pixelMessage = QObject::tr("%1\nPixel: %2(%3).\nContinue ?").arg(CTileSet::getErrorMessage (error)).arg(pixel).arg(comp[composante]); + return ( QMessageBox::Yes == QMessageBox::question( NULL, QObject::tr("Can't set Bitmap"), pixelMessage, QMessageBox::Yes | QMessageBox::No) ); } else { @@ -318,8 +333,8 @@ bool TileList::setTile128 (int tile, const std::string& name, NL3D::CTile::TBitm else { // Error: bitmap not in the absolute path.. - QString notInAbsolutePathMessage = QString("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str()); - return ( QMessageBox::Yes == QMessageBox::question( NULL, "Load error", notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No)); + QString notInAbsolutePathMessage = tr("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str()); + return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Load error"), notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No)); } return true; @@ -336,7 +351,7 @@ bool TileList::setTile256 (int tile, const std::string& name, NL3D::CTile::TBitm uint Height; if (!PIC_LoadPic(tileBankBrowser.getAbsPath ()+troncated, tampon, Width, Height)) { - return ( QMessageBox::Yes == QMessageBox::question( NULL, "Can't load bitmap.", QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) ); + return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Can't load bitmap."), QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) ); } else @@ -354,8 +369,8 @@ bool TileList::setTile256 (int tile, const std::string& name, NL3D::CTile::TBitm error=tileBankBrowser.getTileSet(_tileSet)->checkTile256 (type, border, pixel, composante); if ((error!=CTileSet::ok)&&!zouille()) { - QString pixelMessage = QString("%1\nPixel: %2(%3).\nContinue ?").arg(CTileSet::getErrorMessage (error)).arg(pixel).arg(comp[composante]); - return ( QMessageBox::Yes == QMessageBox::question( NULL, "Can't set Bitmap", pixelMessage, QMessageBox::Yes | QMessageBox::No) ); + QString pixelMessage = tr("%1\nPixel: %2(%3).\nContinue ?").arg(CTileSet::getErrorMessage (error)).arg(pixel).arg(comp[composante]); + return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Can't set Bitmap"), pixelMessage, QMessageBox::Yes | QMessageBox::No) ); } else { @@ -379,8 +394,8 @@ bool TileList::setTile256 (int tile, const std::string& name, NL3D::CTile::TBitm else { // Error: bitmap not in the absolute path.. - QString notInAbsolutePathMessage = QString("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str()); - return ( QMessageBox::Yes == QMessageBox::question( NULL, "Load error", notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No)); + QString notInAbsolutePathMessage = tr("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str()); + return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Load error"), notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No)); } return true; @@ -400,7 +415,7 @@ bool TileList::setTileTransition (int tile, const std::string& name, NL3D::CTile uint Height; if (!PIC_LoadPic(tileBankBrowser.getAbsPath ()+troncated, tampon, Width, Height)) { - return ( QMessageBox::Yes == QMessageBox::question( NULL, "Can't load bitmap.", QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) ); + return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Can't load bitmap."), QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) ); } else { @@ -416,8 +431,8 @@ bool TileList::setTileTransition (int tile, const std::string& name, NL3D::CTile error=tileBankBrowser.getTileSet(_tileSet)->checkTile128 (type, border, pixel, composante); if ((error!=CTileSet::ok)&&(error!=CTileSet::addFirstA128128)&&!zouille ()) { - QString pixelMessage = QString("%1\nPixel: %2(%3).\nContinue ?").arg(CTileSet::getErrorMessage (error)).arg(pixel).arg(comp[composante]); - return ( QMessageBox::Yes == QMessageBox::question( NULL, "Can't set Bitmap", pixelMessage, QMessageBox::Yes | QMessageBox::No) ); + QString pixelMessage = tr("%1\nPixel: %2(%3).\nContinue ?").arg(CTileSet::getErrorMessage (error)).arg(pixel).arg(comp[composante]); + return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Can't set Bitmap"), pixelMessage, QMessageBox::Yes | QMessageBox::No) ); } else { @@ -443,8 +458,8 @@ bool TileList::setTileTransition (int tile, const std::string& name, NL3D::CTile else { // Error: bitmap not in the absolute path.. - QString notInAbsolutePathMessage = QString("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str()); - return ( QMessageBox::Yes == QMessageBox::question( NULL, "Load error", notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No) ); + QString notInAbsolutePathMessage = tr("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str()); + return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Load error"), notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No) ); } return true; @@ -462,7 +477,7 @@ bool TileList::setDisplacement (int tile, const std::string& name, NL3D::CTile:: uint Height; if (!PIC_LoadPic(tileBankBrowser.getAbsPath ()+troncated, tampon, Width, Height)) { - return ( QMessageBox::Yes == QMessageBox::question( NULL, "Can't load bitmap.", QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) ); + return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Can't load bitmap"), QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) ); } else { @@ -470,7 +485,7 @@ bool TileList::setDisplacement (int tile, const std::string& name, NL3D::CTile:: if ( (Width!=32) || (Height!=32) ) { // Error message - return ( QMessageBox::Yes == QMessageBox::question( NULL, "Can't set Bitmap", QString( (troncated+"\nInvalid size: displacement map must be 32x32 8 bits.\nContinue ?").c_str()), QMessageBox::Yes | QMessageBox::No) ); + return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Can't set Bitmap"), QString( (troncated+"\nInvalid size: displacement map must be 32x32 8 bits.\nContinue ?").c_str()), QMessageBox::Yes | QMessageBox::No) ); } else { @@ -487,8 +502,8 @@ bool TileList::setDisplacement (int tile, const std::string& name, NL3D::CTile:: else { // Error: bitmap not in the absolute path.. - QString notInAbsolutePathMessage = QString("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str()); - return ( QMessageBox::Yes == QMessageBox::question( NULL, "Load error", notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No) ); + QString notInAbsolutePathMessage = tr("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str()); + return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Load error"), notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No) ); } return true; @@ -505,7 +520,7 @@ bool TileList::setTileTransitionAlpha (int tile, const std::string& name, int ro uint Height; if (!PIC_LoadPic(tileBankBrowser.getAbsPath ()+troncated, tampon, Width, Height)) { - return ( QMessageBox::Yes == QMessageBox::question( NULL, "Can't load bitmap", QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) ); + return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Can't load bitmap"), QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) ); } else { @@ -533,15 +548,15 @@ bool TileList::setTileTransitionAlpha (int tile, const std::string& name, int ro ||(error==CTileSet::topInterfaceProblem)) { if (indexError!=-1) - pixelMessage = QString("%1.\nIncompatible with tile nb %4.\nPixel: %2(%3).\nContinue ?").arg(CTileSet::getErrorMessage (error)).arg(pixel).arg(comp[composante]).arg(indexError); + pixelMessage = QObject::tr("%1.\nIncompatible with tile nb %4.\nPixel: %2(%3).\nContinue ?").arg(CTileSet::getErrorMessage (error)).arg(pixel).arg(comp[composante]).arg(indexError); else - pixelMessage = QString("%1.\nIncompatible with the 128x128 tile.\nPixel: %2(%3).\nContinue ?").arg(CTileSet::getErrorMessage (error)).arg(pixel).arg(comp[composante]); + pixelMessage = QObject::tr("%1.\nIncompatible with the 128x128 tile.\nPixel: %2(%3).\nContinue ?").arg(CTileSet::getErrorMessage (error)).arg(pixel).arg(comp[composante]); } else - pixelMessage = QString("%1.\nIncompatible filled tile.\nContinue ?").arg(CTileSet::getErrorMessage (error)); + pixelMessage = QObject::tr("%1.\nIncompatible filled tile.\nContinue ?").arg(CTileSet::getErrorMessage (error)); - return ( QMessageBox::Yes == QMessageBox::question( NULL, "Can't set Bitmap", pixelMessage, QMessageBox::Yes | QMessageBox::No) ); + return ( QMessageBox::Yes == QMessageBox::question( NULL, QObject::tr("Can't set Bitmap"), pixelMessage, QMessageBox::Yes | QMessageBox::No) ); } else { @@ -554,8 +569,8 @@ bool TileList::setTileTransitionAlpha (int tile, const std::string& name, int ro else { // Error: bitmap not in the absolute path.. - QString notInAbsolutePathMessage = QString("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str()); - return ( QMessageBox::Yes == QMessageBox::question( NULL, "Load error", notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No) ); + QString notInAbsolutePathMessage = QObject::tr("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str()); + return ( QMessageBox::Yes == QMessageBox::question( NULL, QObject::tr("Load error"), notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No) ); } return true; diff --git a/code/nel/tools/3d/tile_edit_qt/tile_browser_dlg.cpp b/code/nel/tools/3d/tile_edit_qt/tile_browser_dlg.cpp index 6bc43b7fa..1df1b3553 100644 --- a/code/nel/tools/3d/tile_edit_qt/tile_browser_dlg.cpp +++ b/code/nel/tools/3d/tile_edit_qt/tile_browser_dlg.cpp @@ -1,3 +1,19 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + #include #include #include @@ -390,7 +406,7 @@ void CTile_browser_dlg::on_batchLoadPushButton_clicked() { QFileDialog::Options options; QString selectedFilter; - QString fileName = QFileDialog::getOpenFileName(this, "Choose Bitmap", QString(tileBankBrowser.getAbsPath().c_str()) , "Targa Bitmap(*.tga);;All Files (*.*);;", &selectedFilter, options); + QString fileName = QFileDialog::getOpenFileName(this, tr("Choose Bitmap"), QString(tileBankBrowser.getAbsPath().c_str()) , tr("Targa Bitmap (*.tga);;PNG Image (*.png);;All Files (*.*);;"), &selectedFilter, options); QFileInfo fi(fileName); QString baseName = fi.baseName() ; @@ -402,7 +418,7 @@ void CTile_browser_dlg::on_batchLoadPushButton_clicked() //TODO titegus: What's the point in asking for rotation if Texture != Alpha ??? - bool rotate = (QMessageBox::Yes == QMessageBox::question(this, "Import rotated tiles", "Do you want to use rotation to reuse alpha tiles ?", QMessageBox::Yes | QMessageBox::No )); + bool rotate = (QMessageBox::Yes == QMessageBox::question(this, tr("Import rotated tiles"), tr("Do you want to use rotation to reuse alpha tiles?"), QMessageBox::Yes | QMessageBox::No )); for (int i=0; isetBorder ((CTile::TBitmap) tileTextureButtonGroup->checkedId(), border); // Message - QMessageBox::information (this, "Import border", "The border has been changed."); + QMessageBox::information (this, tr("Import border"), tr("The border has been changed.")); } } @@ -745,7 +761,7 @@ void CTile_browser_dlg::RefreshView() image = image.scaled(tileZoomButtonGroup->checkedId() * (tileTypeButtonGroup->checkedId()==_256x256 ? 2 : 1), tileZoomButtonGroup->checkedId() * (tileTypeButtonGroup->checkedId()==_256x256 ? 2 : 1)); - QString fileInfo = QString("%1").arg(p->getId()); + QString fileInfo = QString::number(p->getId()); if (tileLabelButtonGroup->checkedId() == CTile_browser_dlg::FileName) { QFileInfo fi = QFileInfo(QString( tilePath.c_str())); @@ -761,7 +777,7 @@ void CTile_browser_dlg::RefreshView() QString fileInfo; if (tileLabelButtonGroup->checkedId() == CTile_browser_dlg::Index) { - fileInfo = QString("%1").arg(p->getId()); + fileInfo = QString::number(p->getId()); } TileModel tile = TileModel(tileZoomButtonGroup->checkedId() * (tileTypeButtonGroup->checkedId()==_256x256 ? 2 : 1), fileInfo, p->getId()); tileViewModel->addTile(tile); @@ -785,7 +801,7 @@ void CTile_browser_dlg::LoadInThread(void) void CTile_browser_dlg::closeEvent(QCloseEvent *event) { - int reply = QMessageBox::question(this, "Quit", "Are you sure you want to Quit TileSet Edition without Saving?", QMessageBox::Yes | QMessageBox::No); + int reply = QMessageBox::question(this, tr("Quit"), tr("Are you sure you want to Quit TileSet Edition without Saving?"), QMessageBox::Yes | QMessageBox::No); if (reply == QMessageBox::Yes) { event->accept(); @@ -811,7 +827,7 @@ void CTile_browser_dlg::accept() void CTile_browser_dlg::reject() { - int reply = QMessageBox::question(this, "Quit", "Are you sure you want to Quit TileSet Edition without Saving?", QMessageBox::Yes | QMessageBox::No); + int reply = QMessageBox::question(this, tr("Quit"), tr("Are you sure you want to Quit TileSet Edition without Saving?"), QMessageBox::Yes | QMessageBox::No); if (reply == QMessageBox::Yes) { QDialog::reject(); diff --git a/code/nel/tools/3d/tile_edit_qt/tile_browser_dlg.h b/code/nel/tools/3d/tile_edit_qt/tile_browser_dlg.h index 7c384705f..97bdc1013 100644 --- a/code/nel/tools/3d/tile_edit_qt/tile_browser_dlg.h +++ b/code/nel/tools/3d/tile_edit_qt/tile_browser_dlg.h @@ -1,3 +1,19 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + #ifndef TILE_BROWSERDLG_H #define TILE_BROWSERDLG_H diff --git a/code/nel/tools/3d/tile_edit_qt/tile_edit_dlg.cpp b/code/nel/tools/3d/tile_edit_qt/tile_edit_dlg.cpp index 250ca267a..78f062840 100644 --- a/code/nel/tools/3d/tile_edit_qt/tile_edit_dlg.cpp +++ b/code/nel/tools/3d/tile_edit_qt/tile_edit_dlg.cpp @@ -1,3 +1,19 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + #include #include #include @@ -78,12 +94,12 @@ void CTile_edit_dlg::on_landListWidget_itemSelectionChanged() void CTile_edit_dlg::on_addLandPushButton_clicked() { bool ok; - QString text = QInputDialog::getText(this, "Add Land", "Enter land name:", QLineEdit::Normal, "", &ok); + QString text = QInputDialog::getText(this, tr("Add Land"), tr("Enter land name:"), QLineEdit::Normal, "", &ok); if (ok && !text.isEmpty()) { if (ui.landListWidget->findItems(text, Qt::MatchExactly).count() > 0) { - QMessageBox::information( this, "Error Adding Land", "This name already exists" ); + QMessageBox::information( this, tr("Error Adding Land"), tr("This name already exists") ); } else { @@ -110,7 +126,7 @@ void CTile_edit_dlg::on_editLandPushButton_clicked() } bool ok = false; - QStringList items = CItems_edit_dlg::getItems(this, "Edit Land", ui.landListWidget->item(nindex)->text(), availableTileSetList, landTileSetList, &ok); + QStringList items = CItems_edit_dlg::getItems(this, tr("Edit Land"), ui.landListWidget->item(nindex)->text(), availableTileSetList, landTileSetList, &ok); if (ok) { @@ -128,7 +144,7 @@ void CTile_edit_dlg::on_editLandPushButton_clicked() } else { - QMessageBox::information( this, "No Land Selected", "Please, select the Land to edit first ..." ); + QMessageBox::information( this, tr("No Land Selected"), tr("Please, select the Land to edit first ...") ); } } @@ -144,19 +160,19 @@ void CTile_edit_dlg::on_deleteLandPushButton_clicked() } else { - QMessageBox::information( this, "No Land Selected", "Please, select the Land to delete first ..." ); + QMessageBox::information( this, tr("No Land Selected"), tr("Please, select the Land to delete first ...") ); } } void CTile_edit_dlg::on_addTileSetPushButton_clicked() { bool ok; - QString text = QInputDialog::getText(this, "Add Tile Set", "Enter Tile Set name:", QLineEdit::Normal, "", &ok); + QString text = QInputDialog::getText(this, tr("Add Tile Set"), tr("Enter Tile Set name:"), QLineEdit::Normal, "", &ok); if (ok && !text.isEmpty()) { if (ui.tileSetListWidget->findItems(text, Qt::MatchExactly).count() > 0) { - QMessageBox::information( this, "Error Adding Tile Set", "This name already exists" ); + QMessageBox::information( this, tr("Error Adding Tile Set"), tr("This name already exists") ); } else { @@ -182,7 +198,7 @@ void CTile_edit_dlg::on_editTileSetPushButton_clicked() } else { - QMessageBox::information( this, "No Tile Set Selected", "Please, select a Tile Set to edit first ..." ); + QMessageBox::information( this, tr("No Tile Set Selected"), tr("Please, select a Tile Set to edit first ...") ); } } void CTile_edit_dlg::on_deleteTileSetPushButton_clicked() @@ -208,7 +224,7 @@ void CTile_edit_dlg::on_deleteTileSetPushButton_clicked() } else { - QMessageBox::information( this, "No Tile Set Selected", "Please, select a Tile Set to delete first ..." ); + QMessageBox::information( this, tr("No Tile Set Selected"), tr("Please, select a Tile Set to delete first ...") ); } } void CTile_edit_dlg::on_chooseVegetPushButton_clicked() @@ -218,7 +234,7 @@ void CTile_edit_dlg::on_chooseVegetPushButton_clicked() { QFileDialog::Options options; QString selectedFilter; - QString fileName = QFileDialog::getOpenFileName(this, "Choose Veget Set", ui.chooseVegetPushButton->text() , "NeL VegetSet Files (*.vegetset);;All Files (*.*);;", &selectedFilter, options); + QString fileName = QFileDialog::getOpenFileName(this, tr("Choose Veget Set"), ui.chooseVegetPushButton->text() , tr("NeL VegetSet Files (*.vegetset);;All Files (*.*);;"), &selectedFilter, options); if (!fileName.isEmpty()) { @@ -229,7 +245,7 @@ void CTile_edit_dlg::on_chooseVegetPushButton_clicked() } else { - QMessageBox::information( this, "No Tile Set Selected", "Please, select a Tile Set first ..." ); + QMessageBox::information( this, tr("No Tile Set Selected"), tr("Please, select a Tile Set first ...") ); } } void CTile_edit_dlg::on_resetVegetPushButton_clicked() @@ -242,7 +258,7 @@ void CTile_edit_dlg::on_resetVegetPushButton_clicked() } else { - QMessageBox::information( this, "No Tile Set Selected", "Please, select a Tile Set first ..." ); + QMessageBox::information( this, tr("No Tile Set Selected"), tr("Please, select a Tile Set first ...") ); } } @@ -262,7 +278,7 @@ void CTile_edit_dlg::on_surfaceDataLineEdit_textChanged() } else { - QMessageBox::information( this, "No Tile Set Selected", "Please, select a Tile Set first ..." ); + QMessageBox::information( this, tr("No Tile Set Selected"), tr("Please, select a Tile Set first ...") ); } } } @@ -278,7 +294,7 @@ void CTile_edit_dlg::on_orientedCheckBox_stateChanged ( int state ) } else { - QMessageBox::information( this, "No Tile Set Selected", "Please, select a Tile Set first ..." ); + QMessageBox::information( this, tr("No Tile Set Selected"), tr("Please, select a Tile Set first ...") ); } } } @@ -326,7 +342,7 @@ void CTile_edit_dlg::on_loadPushButton_clicked() { QFileDialog::Options options; QString selectedFilter; - QString fileName = QFileDialog::getOpenFileName(this, "Open Bank", ui.absolutePathPushButton->text() , "NeL tile bank files (*.bank);;All Files (*.*);;", &selectedFilter, options); + QString fileName = QFileDialog::getOpenFileName(this, tr("Open Bank"), ui.absolutePathPushButton->text() , tr("NeL tile bank files (*.bank);;All Files (*.*);;"), &selectedFilter, options); if (!fileName.isEmpty()) { @@ -374,20 +390,20 @@ void CTile_edit_dlg::on_savePushButton_clicked() if ( stream.open( fullPath.c_str() ) ) { tileBank.serial (stream); - QString s = QString("Bank %1 saved").arg( QString( fullPath.c_str() ) ); - QMessageBox::information(this, "Bank Saved", s); + QString s = tr("Bank %1 saved").arg( QString( fullPath.c_str() ) ); + QMessageBox::information(this, tr("Bank Saved"), s); return; } } - QMessageBox::information(this, "Error", "Can't Save Bank, check the path"); + QMessageBox::information(this, tr("Error"), tr("Can't Save Bank, check the path")); } void CTile_edit_dlg::on_saveAsPushButton_clicked() { QFileDialog::Options options; QString selectedFilter; - QString fileName = QFileDialog::getSaveFileName(this, "Save Bank", this->mainFile.absoluteFilePath(), "NeL tile bank files (*.bank);;All Files (*.*);;", &selectedFilter, options); + QString fileName = QFileDialog::getSaveFileName(this, tr("Save Bank"), this->mainFile.absoluteFilePath(), tr("NeL tile bank files (*.bank);;All Files (*.*);;"), &selectedFilter, options); if (!fileName.isEmpty()) { // Set MainFile @@ -402,13 +418,13 @@ void CTile_edit_dlg::on_saveAsPushButton_clicked() if ( stream.open( fullPath.c_str() ) ) { tileBank.serial (stream); - QString s = QString("Bank %1 saved").arg( QString( fullPath.c_str() ) ); - QMessageBox::information(this, "Bank Saved", s); + QString s = tr("Bank %1 saved").arg( QString( fullPath.c_str() ) ); + QMessageBox::information(this, tr("Bank Saved"), s); return; } } - QMessageBox::information(this, "Error", "Can't Save Bank, check the path"); + QMessageBox::information(this, tr("Error"), tr("Can't Save Bank, check the path")); } @@ -419,7 +435,7 @@ void CTile_edit_dlg::on_exportPushButton_clicked() { QFileDialog::Options options; QString selectedFilter; - QString fileName = QFileDialog::getSaveFileName(this, "Export Bank", this->mainFile.absolutePath() + QDir::separator() + "*.smallbank", "NeL tile small bank files (*.smallbank);;All Files (*.*);;", &selectedFilter, options); + QString fileName = QFileDialog::getSaveFileName(this, tr("Export Bank"), this->mainFile.absolutePath() + QDir::separator() + tr("*.smallbank"), tr("NeL tile small bank files (*.smallbank);;All Files (*.*);;"), &selectedFilter, options); if (!fileName.isEmpty()) { // Copy the bank @@ -436,13 +452,13 @@ void CTile_edit_dlg::on_exportPushButton_clicked() if ( stream.open( fullPath.c_str() ) ) { copy.serial (stream); - QString s = QString("Bank %1 exported").arg( QString( fullPath.c_str() ) ); - QMessageBox::information(this, "Bank Saved", s); + QString s = tr("Bank %1 exported").arg( QString( fullPath.c_str() ) ); + QMessageBox::information(this, tr("Bank Saved"), s); return; } } - QMessageBox::information(this, "Error", "Can't Export the Bank, check the path"); + QMessageBox::information(this, tr("Error"), tr("Can't Export the Bank, check the path")); } } @@ -450,7 +466,7 @@ void CTile_edit_dlg::on_absolutePathPushButton_clicked() { // Build the struct QFileDialog::Options options = QFileDialog::DontResolveSymlinks | QFileDialog::ShowDirsOnly; - QString directory = QFileDialog::getExistingDirectory(this, "Select the absolute base path of the bank", ui.absolutePathPushButton->text(), options); + QString directory = QFileDialog::getExistingDirectory(this, tr("Select the absolute base path of the bank"), ui.absolutePathPushButton->text(), options); // Select the path if (!directory.isEmpty()) @@ -467,8 +483,8 @@ void CTile_edit_dlg::on_absolutePathPushButton_clicked() //// Last check QMessageBox::StandardButton reply; - QString confirmMessage = QString("Do you really want to set %1 as base path of the bank ?").arg(path); - reply = QMessageBox::question(this, "Confirm Path", confirmMessage, QMessageBox::Yes | QMessageBox::No); + QString confirmMessage = tr("Do you really want to set %1 as base path of the bank?").arg(path); + reply = QMessageBox::question(this, tr("Confirm Path"), confirmMessage, QMessageBox::Yes | QMessageBox::No); if (reply == QMessageBox::Yes) { // Set as default path.. @@ -514,8 +530,8 @@ void CTile_edit_dlg::on_absolutePathPushButton_clicked() goodPath=false; // Message - QString continueMessage = QString("Path '%1' can't be found in bitmap '%2'. Continue ?").arg(path).arg(QString(bitmapPath.c_str())); - reply = QMessageBox::question(this, "Continue", continueMessage, QMessageBox::Yes | QMessageBox::No); + QString continueMessage = tr("Path '%1' can't be found in bitmap '%2'. Continue ?").arg(path).arg(QString(bitmapPath.c_str())); + reply = QMessageBox::question(this, tr("Continue"), continueMessage, QMessageBox::Yes | QMessageBox::No); if (reply == QMessageBox::No) break; } @@ -542,8 +558,8 @@ void CTile_edit_dlg::on_absolutePathPushButton_clicked() goodPath=false; // Message - QString continueMessage = QString("Path '%1' can't be found in bitmap '%2'. Continue ?").arg(path).arg(QString(bitmapPath)); - reply = QMessageBox::question(this, "Continue", continueMessage, QMessageBox::Yes | QMessageBox::No); + QString continueMessage = tr("Path '%1' can't be found in bitmap '%2'. Continue ?").arg(path).arg(QString(bitmapPath)); + reply = QMessageBox::question(this, tr("Continue"), continueMessage, QMessageBox::Yes | QMessageBox::No); if (reply == QMessageBox::No) break; } @@ -608,7 +624,7 @@ void CTile_edit_dlg::on_absolutePathPushButton_clicked() else { // Info message - QMessageBox::information(this, "Error", "Can't set the path."); + QMessageBox::information(this, tr("Error"), tr("Can't set the path.")); } } @@ -646,7 +662,7 @@ void CTile_edit_dlg::on_downPushButton_clicked() } else { - QMessageBox::information( this, "No Tile Set Selected", "Please, select a Tile Set first ..." ); + QMessageBox::information( this, tr("No Tile Set Selected"), tr("Please, select a Tile Set first ...") ); } } @@ -666,13 +682,13 @@ void CTile_edit_dlg::on_upPushButton_clicked() } else { - QMessageBox::information( this, "No Tile Set Selected", "Please, select a Tile Set first ..." ); + QMessageBox::information( this, tr("No Tile Set Selected"), tr("Please, select a Tile Set first ...") ); } } void CTile_edit_dlg::closeEvent(QCloseEvent *event) { - int reply = QMessageBox::question(this, "Quit", "Are you sure you want to quit?", QMessageBox::Yes | QMessageBox::No); + int reply = QMessageBox::question(this, tr("Quit"), tr("Are you sure you want to quit?"), QMessageBox::Yes | QMessageBox::No); if (reply == QMessageBox::Yes) { event->accept(); diff --git a/code/nel/tools/3d/tile_edit_qt/tile_edit_dlg.h b/code/nel/tools/3d/tile_edit_qt/tile_edit_dlg.h index d6ecf1a2a..0e36866d3 100644 --- a/code/nel/tools/3d/tile_edit_qt/tile_edit_dlg.h +++ b/code/nel/tools/3d/tile_edit_qt/tile_edit_dlg.h @@ -1,3 +1,19 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + #ifndef TILE_EDITDLG_H #define TILE_EDITDLG_H diff --git a/code/nel/tools/3d/tile_edit_qt/tile_listwidgetitem.cpp b/code/nel/tools/3d/tile_edit_qt/tile_listwidgetitem.cpp index 4be18a914..05dd59ec8 100644 --- a/code/nel/tools/3d/tile_edit_qt/tile_listwidgetitem.cpp +++ b/code/nel/tools/3d/tile_edit_qt/tile_listwidgetitem.cpp @@ -1,3 +1,19 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + #include "tile_listwidgetitem.h" //tile_listwidgetitem::tile_listwidgetitem(void) diff --git a/code/nel/tools/3d/tile_edit_qt/tile_listwidgetitem.h b/code/nel/tools/3d/tile_edit_qt/tile_listwidgetitem.h index 4ef283d3d..b12be6437 100644 --- a/code/nel/tools/3d/tile_edit_qt/tile_listwidgetitem.h +++ b/code/nel/tools/3d/tile_edit_qt/tile_listwidgetitem.h @@ -1,4 +1,19 @@ - +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + #ifndef TILE_WIDGET_H #define TILE_WIDGET_H diff --git a/code/nel/tools/3d/tile_edit_qt/tile_rotation_dlg.cpp b/code/nel/tools/3d/tile_edit_qt/tile_rotation_dlg.cpp index fbaa22a90..b6830e323 100644 --- a/code/nel/tools/3d/tile_edit_qt/tile_rotation_dlg.cpp +++ b/code/nel/tools/3d/tile_edit_qt/tile_rotation_dlg.cpp @@ -1,3 +1,19 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + #include "tile_rotation_dlg.h" CTile_rotation_dlg::CTile_rotation_dlg(QWidget *parent, Qt::WindowFlags flags) diff --git a/code/nel/tools/3d/tile_edit_qt/tile_rotation_dlg.h b/code/nel/tools/3d/tile_edit_qt/tile_rotation_dlg.h index 6ba30373d..564925f8a 100644 --- a/code/nel/tools/3d/tile_edit_qt/tile_rotation_dlg.h +++ b/code/nel/tools/3d/tile_edit_qt/tile_rotation_dlg.h @@ -1,3 +1,19 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + #ifndef TILE_ROTATIONDLG_H #define TILE_ROTATIONDLG_H diff --git a/code/nel/tools/3d/tile_edit_qt/tiles_model.cpp b/code/nel/tools/3d/tile_edit_qt/tiles_model.cpp index c3d789d8d..9d24e464a 100644 --- a/code/nel/tools/3d/tile_edit_qt/tiles_model.cpp +++ b/code/nel/tools/3d/tile_edit_qt/tiles_model.cpp @@ -1,3 +1,19 @@ +// NeL - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + #include #include "tiles_model.h" #include "tile_widget.h" @@ -9,7 +25,7 @@ bool caseInsensitiveLessThan(const TileModel &t1, const TileModel &t2) } -TileModel::TileModel():pixmapSide(128),tileLabel("Right-Click to select Bitmap"), index(-1) +TileModel::TileModel():pixmapSide(128),tileLabel(QObject::tr("Right-Click to select Bitmap")), index(-1) { } @@ -23,7 +39,7 @@ TileModel::TileModel(int pixmapSide, QString tileLabel, int index):pixmapSide(pi if (!tileLabel.isEmpty()) this->tileLabel = tileLabel; else - this->tileLabel = "Right-Click to select Bitmap"; + this->tileLabel = QObject::tr("Right-Click to select Bitmap"); } From e1c84d51b3b0dae5034dbdbe5f84d21fb893e0be Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 10 Jul 2010 16:52:06 +0200 Subject: [PATCH 13/52] Fixed: tile_edit_qt compilation --- code/nel/tools/3d/tile_edit/PIC/Pic_Manage.c | 9 +- .../tools/3d/tile_edit_qt/browser_model.cpp | 34 +-- .../tools/3d/tile_edit_qt/pic/PIC_System.c | 24 +-- .../tools/3d/tile_edit_qt/pic/Pic_Manage.c | 7 +- code/nel/tools/3d/tile_edit_qt/pic/Pic_TGA.c | 6 +- .../tools/3d/tile_edit_qt/pic/pic_private.h | 32 +-- .../tools/3d/tile_edit_qt/tile_edit.vcproj | 198 +----------------- 7 files changed, 57 insertions(+), 253 deletions(-) diff --git a/code/nel/tools/3d/tile_edit/PIC/Pic_Manage.c b/code/nel/tools/3d/tile_edit/PIC/Pic_Manage.c index da4de18ff..e22005d79 100644 --- a/code/nel/tools/3d/tile_edit/PIC/Pic_Manage.c +++ b/code/nel/tools/3d/tile_edit/PIC/Pic_Manage.c @@ -80,14 +80,15 @@ unsigned long PIC_Load(char* FileName, unsigned char Quantize) { type=1; } - if ( !strcmp(ext,"TGA") ) + else if ( !strcmp(ext,"TGA") ) { type=2; } - if ( !strcmp(ext,"BMP") ) + else if ( !strcmp(ext,"BMP") ) { type=3; } + switch(type) { // - JPG @@ -132,9 +133,7 @@ unsigned long PIC_Load(char* FileName, unsigned char Quantize) return(0); } } - else - { - } + // --- Create and place new pic struct pic=Pic_calloc(1,sizeof(PIC_PICTURE)); if (!pic) diff --git a/code/nel/tools/3d/tile_edit_qt/browser_model.cpp b/code/nel/tools/3d/tile_edit_qt/browser_model.cpp index edf6068cb..f1946d0f1 100644 --- a/code/nel/tools/3d/tile_edit_qt/browser_model.cpp +++ b/code/nel/tools/3d/tile_edit_qt/browser_model.cpp @@ -333,8 +333,8 @@ bool TileList::setTile128 (int tile, const std::string& name, NL3D::CTile::TBitm else { // Error: bitmap not in the absolute path.. - QString notInAbsolutePathMessage = tr("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str()); - return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Load error"), notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No)); + QString notInAbsolutePathMessage = QObject::tr("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str()); + return ( QMessageBox::Yes == QMessageBox::question( NULL, QObject::tr("Load error"), notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No)); } return true; @@ -351,7 +351,7 @@ bool TileList::setTile256 (int tile, const std::string& name, NL3D::CTile::TBitm uint Height; if (!PIC_LoadPic(tileBankBrowser.getAbsPath ()+troncated, tampon, Width, Height)) { - return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Can't load bitmap."), QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) ); + return ( QMessageBox::Yes == QMessageBox::question( NULL, QObject::tr("Can't load bitmap."), QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) ); } else @@ -369,8 +369,8 @@ bool TileList::setTile256 (int tile, const std::string& name, NL3D::CTile::TBitm error=tileBankBrowser.getTileSet(_tileSet)->checkTile256 (type, border, pixel, composante); if ((error!=CTileSet::ok)&&!zouille()) { - QString pixelMessage = tr("%1\nPixel: %2(%3).\nContinue ?").arg(CTileSet::getErrorMessage (error)).arg(pixel).arg(comp[composante]); - return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Can't set Bitmap"), pixelMessage, QMessageBox::Yes | QMessageBox::No) ); + QString pixelMessage = QObject::tr("%1\nPixel: %2(%3).\nContinue ?").arg(CTileSet::getErrorMessage (error)).arg(pixel).arg(comp[composante]); + return ( QMessageBox::Yes == QMessageBox::question( NULL, QObject::tr("Can't set Bitmap"), pixelMessage, QMessageBox::Yes | QMessageBox::No) ); } else { @@ -394,8 +394,8 @@ bool TileList::setTile256 (int tile, const std::string& name, NL3D::CTile::TBitm else { // Error: bitmap not in the absolute path.. - QString notInAbsolutePathMessage = tr("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str()); - return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Load error"), notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No)); + QString notInAbsolutePathMessage = QObject::tr("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str()); + return ( QMessageBox::Yes == QMessageBox::question( NULL, QObject::tr("Load error"), notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No)); } return true; @@ -415,7 +415,7 @@ bool TileList::setTileTransition (int tile, const std::string& name, NL3D::CTile uint Height; if (!PIC_LoadPic(tileBankBrowser.getAbsPath ()+troncated, tampon, Width, Height)) { - return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Can't load bitmap."), QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) ); + return ( QMessageBox::Yes == QMessageBox::question( NULL, QObject::tr("Can't load bitmap."), QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) ); } else { @@ -431,8 +431,8 @@ bool TileList::setTileTransition (int tile, const std::string& name, NL3D::CTile error=tileBankBrowser.getTileSet(_tileSet)->checkTile128 (type, border, pixel, composante); if ((error!=CTileSet::ok)&&(error!=CTileSet::addFirstA128128)&&!zouille ()) { - QString pixelMessage = tr("%1\nPixel: %2(%3).\nContinue ?").arg(CTileSet::getErrorMessage (error)).arg(pixel).arg(comp[composante]); - return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Can't set Bitmap"), pixelMessage, QMessageBox::Yes | QMessageBox::No) ); + QString pixelMessage = QObject::tr("%1\nPixel: %2(%3).\nContinue ?").arg(CTileSet::getErrorMessage (error)).arg(pixel).arg(comp[composante]); + return ( QMessageBox::Yes == QMessageBox::question( NULL, QObject::tr("Can't set Bitmap"), pixelMessage, QMessageBox::Yes | QMessageBox::No) ); } else { @@ -458,8 +458,8 @@ bool TileList::setTileTransition (int tile, const std::string& name, NL3D::CTile else { // Error: bitmap not in the absolute path.. - QString notInAbsolutePathMessage = tr("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str()); - return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Load error"), notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No) ); + QString notInAbsolutePathMessage = QObject::tr("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str()); + return ( QMessageBox::Yes == QMessageBox::question( NULL, QObject::tr("Load error"), notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No) ); } return true; @@ -477,7 +477,7 @@ bool TileList::setDisplacement (int tile, const std::string& name, NL3D::CTile:: uint Height; if (!PIC_LoadPic(tileBankBrowser.getAbsPath ()+troncated, tampon, Width, Height)) { - return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Can't load bitmap"), QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) ); + return ( QMessageBox::Yes == QMessageBox::question( NULL, QObject::tr("Can't load bitmap"), QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) ); } else { @@ -485,7 +485,7 @@ bool TileList::setDisplacement (int tile, const std::string& name, NL3D::CTile:: if ( (Width!=32) || (Height!=32) ) { // Error message - return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Can't set Bitmap"), QString( (troncated+"\nInvalid size: displacement map must be 32x32 8 bits.\nContinue ?").c_str()), QMessageBox::Yes | QMessageBox::No) ); + return ( QMessageBox::Yes == QMessageBox::question( NULL, QObject::tr("Can't set Bitmap"), QString( (troncated+"\nInvalid size: displacement map must be 32x32 8 bits.\nContinue ?").c_str()), QMessageBox::Yes | QMessageBox::No) ); } else { @@ -502,8 +502,8 @@ bool TileList::setDisplacement (int tile, const std::string& name, NL3D::CTile:: else { // Error: bitmap not in the absolute path.. - QString notInAbsolutePathMessage = tr("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str()); - return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Load error"), notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No) ); + QString notInAbsolutePathMessage = QObject::tr("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str()); + return ( QMessageBox::Yes == QMessageBox::question( NULL, QObject::tr("Load error"), notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No) ); } return true; @@ -520,7 +520,7 @@ bool TileList::setTileTransitionAlpha (int tile, const std::string& name, int ro uint Height; if (!PIC_LoadPic(tileBankBrowser.getAbsPath ()+troncated, tampon, Width, Height)) { - return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Can't load bitmap"), QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) ); + return ( QMessageBox::Yes == QMessageBox::question( NULL, QObject::tr("Can't load bitmap"), QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) ); } else { diff --git a/code/nel/tools/3d/tile_edit_qt/pic/PIC_System.c b/code/nel/tools/3d/tile_edit_qt/pic/PIC_System.c index f47bc7064..4ef946b2f 100644 --- a/code/nel/tools/3d/tile_edit_qt/pic/PIC_System.c +++ b/code/nel/tools/3d/tile_edit_qt/pic/PIC_System.c @@ -13,7 +13,7 @@ static unsigned long PIC_Sys_MEM_NbAllocs; #define _msize malloc_usable_size #endif /* __GNUC__ */ -/* ---------------------------------------------------------------------------------------------------------------------------------- */ +// ---------------------------------------------------------------------------------------------------------------------------------- void *Pic_malloc(unsigned long size) { @@ -26,7 +26,7 @@ void *Pic_malloc(unsigned long size) } return(mem); } -/* ----- */ +// ----- void *Pic_calloc(unsigned long count, unsigned long size) { void *mem; @@ -38,7 +38,7 @@ void *Pic_calloc(unsigned long count, unsigned long size) } return(mem); } -/* ----- */ +// ----- void Pic_free(void *memblock) { unsigned long size; @@ -47,23 +47,23 @@ void Pic_free(void *memblock) PIC_Sys_MEM_NbAllocs--; free(memblock); } -/* ----- */ +// ----- unsigned long Pic__msize(void *memblock) { return(_msize(memblock)); } -/* ----- */ +// ----- unsigned long PIC_GetMemNbAllocs(void) { return(PIC_Sys_MEM_NbAllocs); } -/* ----- */ +// ----- unsigned long PIC_GetMemAllocated(void) { return(PIC_Sys_MEM_Allocated); } -/* ---------------------------------------------------------------------------------------------------------------------------------- */ +// ---------------------------------------------------------------------------------------------------------------------------------- static unsigned char PIC_ErrorFlag; static unsigned char PIC_ErrorString[PIC_ERRSIZE]; @@ -95,23 +95,23 @@ void Pic_SetError(unsigned char *msg, ...) if (PIC_Sys_FnctActive) PIC_Sys_Fnct(); return; } -/* ----- */ +// ----- char* PIC_GetError(void) { return(PIC_ErrorString); } -/* ----- */ +// ----- unsigned char PIC_Error(void) { return(PIC_ErrorFlag); } -/* ----- */ +// ----- void PIC_ResetError(void) { strcpy(PIC_ErrorString,""); PIC_ErrorFlag=0; } -/* ----- */ +// ----- unsigned char PIC_OnErrorCall( void pFnct(void) ) { if (pFnct != NULL) @@ -126,5 +126,5 @@ unsigned char PIC_OnErrorCall( void pFnct(void) ) return(1); } -/* ---------------------------------------------------------------------------------------------------------------------------------- */ +// ---------------------------------------------------------------------------------------------------------------------------------- diff --git a/code/nel/tools/3d/tile_edit_qt/pic/Pic_Manage.c b/code/nel/tools/3d/tile_edit_qt/pic/Pic_Manage.c index 607b7508d..a972cccce 100644 --- a/code/nel/tools/3d/tile_edit_qt/pic/Pic_Manage.c +++ b/code/nel/tools/3d/tile_edit_qt/pic/Pic_Manage.c @@ -595,7 +595,7 @@ unsigned long PIC_Save(unsigned long id, char* FileName, unsigned long type, uns err=1; } break; - /* --- */ + // --- default: Pic_SetError("Save %s, unknow save format/type",FileName); err=1; @@ -608,7 +608,7 @@ unsigned long PIC_Save(unsigned long id, char* FileName, unsigned long type, uns return(err-1); } -/* ---------------------------------------------------------------------------------------------------------------------------------- */ +// ---------------------------------------------------------------------------------------------------------------------------------- unsigned long PIC_Destroy(unsigned long id) { @@ -651,5 +651,4 @@ unsigned long PIC_Destroy(unsigned long id) return(1); } -/* ---------------------------------------------------------------------------------------------------------------------------------- */ - +// ---------------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/code/nel/tools/3d/tile_edit_qt/pic/Pic_TGA.c b/code/nel/tools/3d/tile_edit_qt/pic/Pic_TGA.c index 5f598d4eb..441b1eaa9 100644 --- a/code/nel/tools/3d/tile_edit_qt/pic/Pic_TGA.c +++ b/code/nel/tools/3d/tile_edit_qt/pic/Pic_TGA.c @@ -5,7 +5,7 @@ #include "pic_private.h" #include "pic.h" -/* ---------------------------------------------------------------------------------------------------------------------------------- */ +// ---------------------------------------------------------------------------------------------------------------------------------- #pragma pack(1) typedef struct TGA_HEADER @@ -25,7 +25,7 @@ typedef struct TGA_HEADER } TGA_HEADER; #pragma pack() -/* ---------------------------------------------------------------------------------------------------------------------------------- */ +// ---------------------------------------------------------------------------------------------------------------------------------- unsigned long Pic_TGA_Read( unsigned char *FileName, unsigned char **ppPal, unsigned char **ppDatas, @@ -138,7 +138,7 @@ unsigned long Pic_TGA_Read( unsigned char *FileName, } -/* ---------------------------------------------------------------------------------------------------------------------------------- */ +// ---------------------------------------------------------------------------------------------------------------------------------- unsigned long Pic_TGA_Write( unsigned char *FileName, unsigned char *pPal,unsigned char *pDatas, diff --git a/code/nel/tools/3d/tile_edit_qt/pic/pic_private.h b/code/nel/tools/3d/tile_edit_qt/pic/pic_private.h index 43f784c71..18089e04e 100644 --- a/code/nel/tools/3d/tile_edit_qt/pic/pic_private.h +++ b/code/nel/tools/3d/tile_edit_qt/pic/pic_private.h @@ -4,7 +4,7 @@ extern "C" { #endif -/* ---------------------------------------------------------------------------------------------------------------------------------- */ +// ---------------------------------------------------------------------------------------------------------------------------------- typedef struct PIC_PICTURE { @@ -17,12 +17,12 @@ typedef struct PIC_PICTURE struct PIC_PICTURE *Next; } PIC_PICTURE; -/* ---------------------------------------------------------------------------------------------------------------------------------- */ +// ---------------------------------------------------------------------------------------------------------------------------------- -/* - * JPG - */ +// +// JPG +// extern unsigned long Pic_JPG_Read( unsigned char *FileName, @@ -33,9 +33,9 @@ extern unsigned long Pic_JPG_Write( unsigned char *FileName, unsigned long Qual, unsigned char *pDatas, unsigned long w, unsigned long h); -/* - * TGA - */ +// +// TGA +// extern unsigned long Pic_TGA_Read( unsigned char *FileName, unsigned char **ppPal, unsigned char **ppDatas, unsigned long *pWidth, unsigned long *pHeight, @@ -43,9 +43,9 @@ extern unsigned long Pic_TGA_Read( unsigned char *FileName, extern unsigned long Pic_TGA_Write( unsigned char *FileName, unsigned char *pPal,unsigned char *pDatas, unsigned long w, unsigned long h, unsigned long d); -/* - * BMP - */ +// +// BMP +// extern unsigned long Pic_BMP_Read( unsigned char *FileName, unsigned char **ppPal, unsigned char **ppDatas, unsigned long *pWidth, unsigned long *pHeight, @@ -54,18 +54,18 @@ extern unsigned long Pic_BMP_Read( unsigned char *FileName, extern unsigned long Pic_BMP_Write( unsigned char *FileName, unsigned char *pPal,unsigned char *pDatas, unsigned long w, unsigned long h, unsigned long d); -/* - * System - */ +// +// System +// extern void* Pic_malloc(unsigned long size); extern void* Pic_calloc(unsigned long count, unsigned long size); extern void Pic_free(void *memblock); extern unsigned long Pic__msize(void *memblock); extern void Pic_SetError(unsigned char *msg, ...); -/* ---------------------------------------------------------------------------------------------------------------------------------- */ +// ---------------------------------------------------------------------------------------------------------------------------------- #ifdef __cplusplus } #endif -#endif +#endif \ No newline at end of file diff --git a/code/nel/tools/3d/tile_edit_qt/tile_edit.vcproj b/code/nel/tools/3d/tile_edit_qt/tile_edit.vcproj index ca98218d0..a54243290 100644 --- a/code/nel/tools/3d/tile_edit_qt/tile_edit.vcproj +++ b/code/nel/tools/3d/tile_edit_qt/tile_edit.vcproj @@ -1,7 +1,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1174,7 +990,7 @@ Description="RCC $(InputName).qrc" CommandLine="rcc.exe -name $(InputName) $(InputName).qrc -o $(InputDir)\qrc_$(InputName).cpp " AdditionalDependencies="rcc.exe;nel.png;$(InputName).qrc" - Outputs="Release\qrc_$(InputName).cpp" + Outputs="Debug\qrc_$(InputName).cpp" /> - - - Date: Sat, 10 Jul 2010 16:57:53 +0200 Subject: [PATCH 14/52] Changed: #860 Remove/convert/update old projects --- code/nel/tools/all.sln | 6 +- .../georges/georges2csv/georges2csv.vcproj | 163 ++++++++++++++++++ 2 files changed, 167 insertions(+), 2 deletions(-) diff --git a/code/nel/tools/all.sln b/code/nel/tools/all.sln index 901dde140..044f17c1a 100644 --- a/code/nel/tools/all.sln +++ b/code/nel/tools/all.sln @@ -948,10 +948,12 @@ Global {F8607267-5BA2-4BE8-A674-26C3F7D0A9BB}.Release|x64.Build.0 = Release|x64 {885542B1-BE3C-401A-A2A4-DA49E48DF0AB}.Debug|Win32.ActiveCfg = Debug|Win32 {885542B1-BE3C-401A-A2A4-DA49E48DF0AB}.Debug|Win32.Build.0 = Debug|Win32 - {885542B1-BE3C-401A-A2A4-DA49E48DF0AB}.Debug|x64.ActiveCfg = Debug|Win32 + {885542B1-BE3C-401A-A2A4-DA49E48DF0AB}.Debug|x64.ActiveCfg = Debug|x64 + {885542B1-BE3C-401A-A2A4-DA49E48DF0AB}.Debug|x64.Build.0 = Debug|x64 {885542B1-BE3C-401A-A2A4-DA49E48DF0AB}.Release|Win32.ActiveCfg = Release|Win32 {885542B1-BE3C-401A-A2A4-DA49E48DF0AB}.Release|Win32.Build.0 = Release|Win32 - {885542B1-BE3C-401A-A2A4-DA49E48DF0AB}.Release|x64.ActiveCfg = Release|Win32 + {885542B1-BE3C-401A-A2A4-DA49E48DF0AB}.Release|x64.ActiveCfg = Release|x64 + {885542B1-BE3C-401A-A2A4-DA49E48DF0AB}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/code/nel/tools/georges/georges2csv/georges2csv.vcproj b/code/nel/tools/georges/georges2csv/georges2csv.vcproj index f5abf5e7e..5099fe41a 100644 --- a/code/nel/tools/georges/georges2csv/georges2csv.vcproj +++ b/code/nel/tools/georges/georges2csv/georges2csv.vcproj @@ -10,6 +10,9 @@ + @@ -172,6 +175,166 @@ Name="VCPostBuildEventTool" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 9d2232c3d8eebb1741bb57b1c7c1e01c1e651657 Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 12 Jul 2010 18:20:19 +0200 Subject: [PATCH 15/52] Changed: #860 Remove/convert/update old projects --- .../admin_executor_service.vcproj | 201 +++++++++--------- code/nelns/admin_service/admin_service.vcproj | 4 +- code/nelns/login_service/login_service.vcproj | 168 +++++++-------- .../nel_launcher_windows/nel_launcher.vcproj | 175 ++++++++------- .../naming_service/naming_service.vcproj | 165 +++++++------- .../welcome_service/welcome_service.vcproj | 165 +++++++------- 6 files changed, 437 insertions(+), 441 deletions(-) diff --git a/code/nelns/admin_executor_service/admin_executor_service.vcproj b/code/nelns/admin_executor_service/admin_executor_service.vcproj index 85695443a..b1eae7caa 100644 --- a/code/nelns/admin_executor_service/admin_executor_service.vcproj +++ b/code/nelns/admin_executor_service/admin_executor_service.vcproj @@ -67,10 +67,9 @@ /> + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - @@ -385,6 +375,15 @@ BasicRuntimeChecks="3" /> + + + @@ -427,15 +426,6 @@ BasicRuntimeChecks="3" /> - - - @@ -446,6 +436,15 @@ BasicRuntimeChecks="3" /> + + + diff --git a/code/nelns/admin_service/admin_service.vcproj b/code/nelns/admin_service/admin_service.vcproj index 03eee1df5..c146cff89 100644 --- a/code/nelns/admin_service/admin_service.vcproj +++ b/code/nelns/admin_service/admin_service.vcproj @@ -1,7 +1,7 @@ + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - Date: Mon, 12 Jul 2010 21:52:35 +0200 Subject: [PATCH 16/52] Fixed: #928 XRandR modesetting --- code/nel/CMakeLists.txt | 23 +- code/nel/CMakeModules/FindXRandR.cmake | 46 ++ code/nel/src/3d/driver/opengl/CMakeLists.txt | 13 +- code/nel/src/3d/driver/opengl/driver_opengl.h | 12 +- .../3d/driver/opengl/driver_opengl_window.cpp | 458 ++++++++++++++---- 5 files changed, 426 insertions(+), 126 deletions(-) create mode 100644 code/nel/CMakeModules/FindXRandR.cmake diff --git a/code/nel/CMakeLists.txt b/code/nel/CMakeLists.txt index 801466119..29af3e2b6 100644 --- a/code/nel/CMakeLists.txt +++ b/code/nel/CMakeLists.txt @@ -101,12 +101,13 @@ IF(WITH_3D) IF(NOT WITH_COCOA) FIND_PACKAGE(X11) FIND_PACKAGE(XF86VidMode) + FIND_PACKAGE(XRandR) ENDIF(NOT WITH_COCOA) ENDIF(NOT WIN32) ENDIF(WITH_DRIVER_OPENGL) IF(WITH_CEGUI) - FIND_PACKAGE(CEGUI) + FIND_PACKAGE(CEGUI) ENDIF(WITH_CEGUI) ENDIF(WITH_3D) @@ -119,7 +120,7 @@ IF(WITH_SOUND) IF(WITH_DRIVER_FMOD) FIND_PACKAGE(FMOD) ENDIF(WITH_DRIVER_FMOD) - + IF(WITH_DRIVER_XAUDIO2) FIND_PACKAGE(Ogg) FIND_PACKAGE(Vorbis) @@ -143,8 +144,8 @@ IF(WITH_TESTS) IF(BUILD_DASHBOARD) INCLUDE(Dart) SET(SVNCOMMAND svn) - SET(SVNSOURCEDIR http://dev.ryzom.com/svn/trunk/nel) - SET(GENERATELOGS svn2cl) + SET(SVNSOURCEDIR http://dev.ryzom.com/svn/trunk/nel) + SET(GENERATELOGS svn2cl) ENDIF(BUILD_DASHBOARD) ENDIF(WITH_TESTS) @@ -225,8 +226,8 @@ SET(CPACK_PACKAGE_ICON ${CMAKE_SOURCE_DIR}/resources\\\\nel.bmp) SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} NeL") SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\dev.ryzom.com") SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\dev.ryzom.com\\\\projects\\\\nel\\\\wiki") -SET(CPACK_NSIS_CONTACT "matt.raykowski@gmail.com") - +SET(CPACK_NSIS_CONTACT "matt.raykowski@gmail.com") + ## Source Packages SET(CPACK_PACKAGE_FILE_NAME "nel-${NL_VERSION}") SET(CPACK_SOURCE_PACKAGE_FILE_NAME "nel-${NL_VERSION}") @@ -250,8 +251,8 @@ IF(WIN32) SET(CMAKE_INSTALL_DEBUG_LIBRARIES TRUE) IF(WITH_QT) INCLUDE(${QT_USE_FILE}) - INSTALL(FILES - "${QT_LIBRARY_DIR}/QtGuid4.dll" + INSTALL(FILES + "${QT_LIBRARY_DIR}/QtGuid4.dll" "${QT_LIBRARY_DIR}/QtXmld4.dll" "${QT_LIBRARY_DIR}/QtCored4.dll" DESTINATION bin) @@ -259,8 +260,8 @@ IF(WIN32) ELSE(NOT CMAKE_BUILD_TYPE STREQUAL "Release") IF(WITH_QT) INCLUDE(${QT_USE_FILE}) - INSTALL(FILES - "${QT_LIBRARY_DIR}/QtGui4.dll" + INSTALL(FILES + "${QT_LIBRARY_DIR}/QtGui4.dll" "${QT_LIBRARY_DIR}/QtXml4.dll" "${QT_LIBRARY_DIR}/QtCore4.dll" DESTINATION bin) @@ -276,7 +277,7 @@ IF(WIN32) INSTALL(FILES "${CEGUI_LIB_DIR}/Devil.dll" DESTINATION bin) INSTALL(FILES "${CEGUI_LIB_DIR}/ILU.dll" DESTINATION bin) ENDIF(WITH_CEGUI) - + # Only the tools require MFC. IF(WITH_TOOLS) SET(CMAKE_INSTALL_MFC_LIBRARIES TRUE) diff --git a/code/nel/CMakeModules/FindXRandR.cmake b/code/nel/CMakeModules/FindXRandR.cmake new file mode 100644 index 000000000..5867e65eb --- /dev/null +++ b/code/nel/CMakeModules/FindXRandR.cmake @@ -0,0 +1,46 @@ +# - Locate XRandR library +# This module defines +# XRandR_LIBRARY, the library to link against +# XRandR_FOUND, if false, do not try to link to XRandR +# XRandR_INCLUDE_DIR, where to find headers. + +IF(XRandR_LIBRARY AND XRandR_INCLUDE_DIR) + # in cache already + SET(XRandR_FIND_QUIETLY TRUE) +ENDIF(XRandR_LIBRARY AND XRandR_INCLUDE_DIR) + + +FIND_PATH(XRandR_INCLUDE_DIR + Xrandr.h + PATHS + $ENV{XRandR_DIR}/include + /usr/include/X11/ + /usr/X11R6/include/ + PATH_SUFFIXES extensions +) + +FIND_LIBRARY(XRandR_LIBRARY + Xrandr + PATHS + $ENV{XRandR_DIR}/lib + /usr/X11R6/lib + /usr/lib + /sw/lib + /opt/local/lib + /opt/csw/lib + /opt/lib + /usr/freeware/lib64 +) + +IF(XRandR_LIBRARY AND XRandR_INCLUDE_DIR) + SET(XRandR_FOUND "YES") + SET(XRandR_DEFINITIONS -DXRANDR) + IF(NOT XRandR_FIND_QUIETLY) + MESSAGE(STATUS "Found XRandR: ${XRandR_LIBRARY}") + ENDIF(NOT XRandR_FIND_QUIETLY) +ELSE(XRandR_LIBRARY AND XRandR_INCLUDE_DIR) + IF(NOT XRandR_FIND_QUIETLY) + MESSAGE(STATUS "Warning: Unable to find XRandR!") + ENDIF(NOT XRandR_FIND_QUIETLY) +ENDIF(XRandR_LIBRARY AND XRandR_INCLUDE_DIR) + diff --git a/code/nel/src/3d/driver/opengl/CMakeLists.txt b/code/nel/src/3d/driver/opengl/CMakeLists.txt index c7827d820..6789bfaa0 100644 --- a/code/nel/src/3d/driver/opengl/CMakeLists.txt +++ b/code/nel/src/3d/driver/opengl/CMakeLists.txt @@ -14,7 +14,7 @@ ADD_LIBRARY(${NLDRV_OGL_LIB} SHARED ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} nel3d nelmisc ${OPENGL_LIBRARIES}) -SET_TARGET_PROPERTIES(${NLDRV_OGL_LIB} PROPERTIES +SET_TARGET_PROPERTIES(${NLDRV_OGL_LIB} PROPERTIES VERSION ${NL_VERSION} SOVERSION ${NL_VERSION_MAJOR} PROJECT_LABEL "Driver, Video: OpenGL") @@ -22,7 +22,7 @@ SET_TARGET_PROPERTIES(${NLDRV_OGL_LIB} PROPERTIES IF(WIN32) INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY}) - SET_TARGET_PROPERTIES(${NLDRV_OGL_LIB} PROPERTIES + SET_TARGET_PROPERTIES(${NLDRV_OGL_LIB} PROPERTIES DEBUG_POSTFIX "_d" RELEASE_POSTFIX "_r" LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" @@ -34,10 +34,10 @@ ELSE(WIN32) IF(WITH_COCOA) TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${COCOA}) ELSE(WITH_COCOA) - # NOTE: I know, those hardcoded things are evil. But FindOpenGL on Mac + # NOTE: I know, those hardcoded things are evil. But FindOpenGL on Mac # simply does not look for X11's OpenGL, just for the native one. INCLUDE_DIRECTORIES("/usr/X11/include") - TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} + TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} "-L/usr/X11/lib" "-lGL" ${X11_LIBRARIES}) ENDIF(WITH_COCOA) ELSE(APPLE) @@ -47,6 +47,11 @@ ELSE(WIN32) ADD_DEFINITIONS(${XF86VidMode_DEFINITIONS}) TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${XF86VidMode_LIBRARY}) ENDIF(XF86VidMode_FOUND) + IF(XRandR_FOUND) + INCLUDE_DIRECTORIES(${XRandR_INCLUDE_DIR}) + ADD_DEFINITIONS(${XRandR_DEFINITIONS}) + TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${XRandR_LIBRARY}) + ENDIF(XRandR_FOUND) ENDIF(APPLE) ENDIF(WIN32) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl.h b/code/nel/src/3d/driver/opengl/driver_opengl.h index fa1685d5b..44ce39c2c 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl.h +++ b/code/nel/src/3d/driver/opengl/driver_opengl.h @@ -686,11 +686,17 @@ private: Cursor _cursor; NLMISC::CUnixEventEmitter _EventEmitter; XVisualInfo* _visual_info; + uint32 _xrandr_version; + uint32 _xvidmode_version; + +#ifdef XRANDR + sint _OldSizeID; +#endif // XRANDR #ifdef XF86VIDMODE - int _OldDotClock; // old dotclock + sint _OldDotClock; // old dotclock XF86VidModeModeLine _OldScreenMode; // old modeline - int _OldX, _OldY; //Viewport settings + sint _OldX, _OldY; //Viewport settings #endif //XF86VIDMODE #endif // NL_OS_UNIX @@ -1252,10 +1258,8 @@ private: // Monitor color parameters backup -#ifdef WIN32 bool _NeedToRestaureGammaRamp; uint16 _GammaRampBackuped[3*256]; -#endif /// \fragment shaders diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp index 2024e26e6..a9e102dc1 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp @@ -32,6 +32,9 @@ #elif defined (NL_OS_UNIX) # include # include +# ifdef XRANDR +# include +# endif #endif // NL_OS_UNIX #include "nel/misc/mouse_device.h" @@ -201,6 +204,30 @@ bool CDriverGL::init (uint windowIcon, emptyProc exitFunc) nldebug("3D: XOpenDisplay on '%s' OK", getenv("DISPLAY")); } + _xrandr_version = 0; + +#ifdef XRANDR + _OldSizeID = 0; + sint xrandr_major, xrandr_minor; + if (XRRQueryVersion(_dpy, &xrandr_major, &xrandr_minor)) + { + _xrandr_version = xrandr_major * 100 + xrandr_minor; + nlinfo("3D: XRandR %d.%d found", xrandr_major, xrandr_minor); + } + +#endif + + _xvidmode_version = 0; + +#ifdef XF86VIDMODE + sint event = 0, error = -1, vm_major = 0, vm_minor = 0; + if (XF86VidModeQueryExtension(_dpy, &event, &error) && XF86VidModeQueryVersion(_dpy, &vm_major, &vm_minor)) + { + _xvidmode_version = vm_major * 100 + vm_minor; + nlinfo("3D: XF86VidMode %d.%d found", major, minor); + } +#endif + #endif return true; } @@ -756,12 +783,41 @@ bool CDriverGL::saveScreenMode() #elif defined(NL_OS_UNIX) + int screen = DefaultScreen(_dpy); + res = false; + +#ifdef XRANDR + + if (!res && _xrandr_version > 0) + { + XRRScreenConfiguration *screen_config = XRRGetScreenInfo(_dpy, RootWindow(_dpy, screen)); + + if (screen_config) + { + Rotation saved_rotation; + _OldSizeID = XRRConfigCurrentConfiguration(screen_config, &saved_rotation); + nlinfo("3D: current XRandR mode %d", _OldSizeID); + XRRFreeScreenConfigInfo(screen_config); + + res = true; + } + else + { + nlwarning("3D: XRRGetScreenInfo failed"); + } + } + +#endif // XRANDR + #if defined(XF86VIDMODE) - // Store old mode in order to restore it when leaving fullscreen - memset(&_OldScreenMode, 0, sizeof(XF86VidModeModeLine)); - XF86VidModeGetModeLine(_dpy, DefaultScreen(_dpy), &_OldDotClock, &_OldScreenMode); - res = XF86VidModeGetViewPort(_dpy, DefaultScreen(_dpy), &_OldX, &_OldY); + if (!res && _xvidmode_version > 0) + { + // Store old mode in order to restore it when leaving fullscreen + memset(&_OldScreenMode, 0, sizeof(XF86VidModeModeLine)); + XF86VidModeGetModeLine(_dpy, screen, &_OldDotClock, &_OldScreenMode); + res = XF86VidModeGetViewPort(_dpy, screen, &_OldX, &_OldY); + } #endif // XF86VIDMODE @@ -788,29 +844,62 @@ bool CDriverGL::restoreScreenMode() #elif defined(NL_OS_UNIX) + int screen = DefaultScreen(_dpy); + +#ifdef XRANDR + + if (!res && _xrandr_version > 0) + { + Window root = RootWindow(_dpy, screen); + + XRRScreenConfiguration *screen_config = XRRGetScreenInfo(_dpy, root); + + if (screen_config) + { + Rotation saved_rotation; + SizeID size = XRRConfigCurrentConfiguration(screen_config, &saved_rotation); + if (XRRSetScreenConfig(_dpy, screen_config, root, _OldSizeID, saved_rotation, CurrentTime) == RRSetConfigSuccess) + { + nlinfo("3D: Switching back to XRandR mode %d", _OldSizeID); + res = true; + } + + XRRFreeScreenConfigInfo(screen_config); + } + else + { + nlwarning("3D: XRRGetScreenInfo failed"); + } + } + +#endif // XRANDR + #if defined(XF86VIDMODE) - XF86VidModeModeInfo info; - nlinfo("3D: Switching back to original mode"); + if (!res && _xvidmode_version > 0) + { + XF86VidModeModeInfo info; + nlinfo("3D: Switching back to original mode"); - // This is UGLY - info.dotclock = _OldDotClock; - info.hdisplay = _OldScreenMode.hdisplay; - info.hsyncstart = _OldScreenMode.hsyncstart; - info.hsyncend = _OldScreenMode.hsyncend; - info.htotal = _OldScreenMode.htotal; - info.vdisplay = _OldScreenMode.vdisplay; - info.vsyncstart = _OldScreenMode.vsyncstart; - info.vsyncend = _OldScreenMode.vsyncend; - info.vtotal = _OldScreenMode.vtotal; - info.flags = _OldScreenMode.flags; - info.privsize = _OldScreenMode.privsize; - info.c_private = _OldScreenMode.c_private; + // This is UGLY + info.dotclock = _OldDotClock; + info.hdisplay = _OldScreenMode.hdisplay; + info.hsyncstart = _OldScreenMode.hsyncstart; + info.hsyncend = _OldScreenMode.hsyncend; + info.htotal = _OldScreenMode.htotal; + info.vdisplay = _OldScreenMode.vdisplay; + info.vsyncstart = _OldScreenMode.vsyncstart; + info.vsyncend = _OldScreenMode.vsyncend; + info.vtotal = _OldScreenMode.vtotal; + info.flags = _OldScreenMode.flags; + info.privsize = _OldScreenMode.privsize; + info.c_private = _OldScreenMode.c_private; - nlinfo("3D: Switching back mode to %dx%d", info.hdisplay, info.vdisplay); - XF86VidModeSwitchToMode(_dpy, DefaultScreen(_dpy), &info); - nlinfo("3D: Switching back viewport to %d,%d",_OldX, _OldY); - res = XF86VidModeSetViewPort(_dpy, DefaultScreen(_dpy), _OldX, _OldY); + nlinfo("3D: Switching back mode to %dx%d", info.hdisplay, info.vdisplay); + XF86VidModeSwitchToMode(_dpy, screen, &info); + nlinfo("3D: Switching back viewport to %d,%d",_OldX, _OldY); + res = XF86VidModeSetViewPort(_dpy, screen, _OldX, _OldY); + } #endif // XF86VIDMODE @@ -819,6 +908,14 @@ bool CDriverGL::restoreScreenMode() return res; } +// -------------------------------------------------- +#ifdef XF86VIDMODE +static sint modeInfoToFrequency(XF86VidModeModeInfo *info) +{ + return (info->htotal && info->vtotal) ? (1000 * info->dotclock / (info->htotal * info->vtotal)) : 0; +} +#endif // XF86VIDMODE + // -------------------------------------------------- bool CDriverGL::setScreenMode(const GfxMode &mode) { @@ -880,37 +977,89 @@ bool CDriverGL::setScreenMode(const GfxMode &mode) #elif defined(NL_OS_UNIX) -#if defined(XF86VIDMODE) - bool found = false; - // Find the requested mode and use it - XF86VidModeModeInfo **modes; - int nmodes; - if (XF86VidModeGetAllModeLines(_dpy, DefaultScreen(_dpy), &nmodes, &modes)) +#ifdef XRANDR + + if (!found && _xrandr_version > 0) { - for (int i = 0; i < nmodes; i++) + int screen = DefaultScreen(_dpy); + Window root = RootWindow(_dpy, screen); + + XRRScreenConfiguration *screen_config = XRRGetScreenInfo(_dpy, root); + + if (screen_config) { - nldebug("3D: Available mode - %dx%d", modes[i]->hdisplay, modes[i]->vdisplay); - if (modes[i]->hdisplay == mode.Width && modes[i]->vdisplay == mode.Height) + Rotation saved_rotation; + SizeID size = XRRConfigCurrentConfiguration(screen_config, &saved_rotation); + + sint nsizes; + XRRScreenSize *sizes = XRRConfigSizes(screen_config, &nsizes); + sint size = -1; + + for (sint i = 0; i < nsizes; ++i) { - if (XF86VidModeSwitchToMode(_dpy, DefaultScreen(_dpy), modes[i])) + if (sizes[i].width == mode.Width && sizes[i].height == mode.Height) { - nlinfo("3D: Switching to mode %dx%d", modes[i]->hdisplay, modes[i]->vdisplay); - XF86VidModeSetViewPort(_dpy, DefaultScreen(_dpy), 0, 0); - found = true; + size = i; + break; } - break; } + + if (size > -1 && XRRSetScreenConfig(_dpy, screen_config, root, size, saved_rotation, CurrentTime) == RRSetConfigSuccess) + { + nlinfo("3D: Switching to XRandR mode %d: %dx%d", size, sizes[size].width, sizes[size].height); + found = true; + } + else + { + nlwarning("3D: No corresponding screen mode or XRRSetScreenConfig failed"); + } + + XRRFreeScreenConfigInfo(screen_config); + } + else + { + nlwarning("3D: XRRGetScreenInfo failed"); } - XFree(modes); } +#endif + +#if defined(XF86VIDMODE) + + if (!found && _xvidmode_version > 0) + { + // Find the requested mode and use it + XF86VidModeModeInfo **modes; + int nmodes; + if (XF86VidModeGetAllModeLines(_dpy, DefaultScreen(_dpy), &nmodes, &modes)) + { + for (int i = 0; i < nmodes; i++) + { + const uint16 freq = modeInfoToFrequency(modes[i]); + + nldebug("3D: Available mode - %dx%d %d Hz", modes[i]->hdisplay, modes[i]->vdisplay, (int)freq); + if (modes[i]->hdisplay == mode.Width && modes[i]->vdisplay == mode.Height /* && freq == mode.Frequency */) + { + if (XF86VidModeSwitchToMode(_dpy, DefaultScreen(_dpy), modes[i])) + { + nlinfo("3D: XF86VidMode Switching to mode %dx%d", modes[i]->hdisplay, modes[i]->vdisplay); + XF86VidModeSetViewPort(_dpy, DefaultScreen(_dpy), 0, 0); + found = true; + } + break; + } + } + XFree(modes); + } + } + +#endif // XF86VIDMODE + if (!found) return false; -#endif // XF86VIDMODE - #endif // NL_OS_WINDOWS return true; @@ -1115,43 +1264,32 @@ bool CDriverGL::setWindowStyle(EWindowStyle windowStyle) #elif defined(NL_OS_UNIX) - XSetWindowAttributes attr; - -#ifdef XF86VIDMODE - // If we're going to attempt fullscreen, we need to set redirect to True, - // This basically places the window with no borders in the top left - // corner of the screen. - if (windowStyle == EWSWindowed) - { - attr.override_redirect = False; - } - else - { - attr.override_redirect = True; - } -#else - attr.override_redirect = False; -#endif - - int attr_flags = CWOverrideRedirect; - - XChangeWindowAttributes(_dpy, _win, attr_flags, &attr); - // x11 fullscreen is not working on mac os x + #if !defined(NL_OS_MAC) + // Toggle fullscreen if (windowStyle != getWindowStyle()) { XEvent xev; memset(&xev, 0, sizeof(xev)); xev.type = ClientMessage; +// xev.xclient.serial = 0; +// xev.xclient.send_event = True; +// xev.xclient.display = _dpy; xev.xclient.window = _win; xev.xclient.message_type = XInternAtom(_dpy, "_NET_WM_STATE", False); xev.xclient.format = 32; xev.xclient.data.l[0] = windowStyle == EWSFullscreen ? 1:0; xev.xclient.data.l[1] = XInternAtom(_dpy, "_NET_WM_STATE_FULLSCREEN", False); xev.xclient.data.l[2] = 0; - XSendEvent(_dpy, DefaultRootWindow(_dpy), False, SubstructureNotifyMask, &xev); + xev.xclient.data.l[3] = 0; + xev.xclient.data.l[4] = 0; + if (XSendEvent(_dpy, DefaultRootWindow(_dpy), False, SubstructureNotifyMask, &xev) != Success) + { + nlwarning("3D: Failed to toggle to fullscreen"); + return false; + } } #endif @@ -1222,32 +1360,84 @@ bool CDriverGL::getModes(std::vector &modes) #elif defined (NL_OS_UNIX) -# ifdef XF86VIDMODE + bool found = false; + int screen = DefaultScreen(_dpy); + +#if defined(XRANDR) + if (!found && _xrandr_version >= 100) + { + XRRScreenConfiguration *screen_config = XRRGetScreenInfo(_dpy, RootWindow(_dpy, screen)); + + if (screen_config) + { + // retrieve the list of resolutions + int nsizes = 0; + XRRScreenSize *sizes = XRRConfigSizes(screen_config, &nsizes); + + if (nsizes > 0) + { + nldebug("3D: %d available XRandR modes:", nsizes); + + for (sint i = 0; i < nsizes; ++i) + { + // Add this mode + GfxMode mode; + mode.Width = sizes[i].width; + mode.Height = sizes[i].height; + mode.Frequency = 0; + modes.push_back(mode); + + nldebug("3D: Mode %d: %dx%d", i, mode.Width, mode.Height); + } + + found = true; + } + else + { + nlwarning("3D: No XRandR modes available"); + } + + XRRFreeScreenConfigInfo(screen_config); + } + else + { + nlwarning("3D: XRRGetScreenInfo failed"); + } + } +#endif + +#ifdef XF86VIDMODE int nmodes; XF86VidModeModeInfo **ms; - Bool ok = XF86VidModeGetAllModeLines(_dpy, DefaultScreen(_dpy), &nmodes, &ms); - if(ok) + if (!found && XF86VidModeGetAllModeLines(_dpy, screen, &nmodes, &ms)) { - nldebug("3D: %d available modes:", nmodes); + nlinfo("3D: %d available XF86VidMode modes:", nmodes); for (int j = 0; j < nmodes; j++) { // Add this mode GfxMode mode; mode.Width = (uint16)ms[j]->hdisplay; mode.Height = (uint16)ms[j]->vdisplay; - const uint16 pixelsCount = ms[j]->htotal * ms[j]->vtotal; - mode.Frequency = pixelsCount ? 1000 * ms[j]->dotclock / pixelsCount:0; - nldebug("3D: Mode %d: %dx%d, %d Hz", j, mode.Width, mode.Height, mode.Frequency); + mode.Frequency = modeInfoToFrequency(ms[j]); + nlinfo("3D: Mode %d: %dx%d, %d Hz", j, mode.Width, mode.Height, mode.Frequency); modes.push_back (mode); } XFree(ms); } - else +#endif // XF86VIDMODE + + if (!found) { - nlwarning("XF86VidModeGetAllModeLines returns 0, cannot get available video mode"); - return false; + // Add current screen mode + GfxMode mode; + mode.Width = DisplayWidth(_dpy, screen); + mode.Height = DisplayHeight(_dpy, screen); + mode.Frequency = 0; + modes.push_back(mode); + + nldebug("3D: X11 available mode:"); + nldebug("3D: %dx%d", mode.Width, mode.Height); } -# endif #endif return true; @@ -1290,31 +1480,96 @@ bool CDriverGL::getCurrentScreenMode(GfxMode &mode) #elif defined(NL_OS_UNIX) -# ifdef XF86VIDMODE - sint pixelClock; - XF86VidModeModeLine xmode; - - if (!XF86VidModeGetModeLine(_dpy, DefaultScreen(_dpy), &pixelClock, &xmode)) - { - nlwarning("XF86VidModeGetModeLine returns 0, cannot get current video mode"); - return false; - } + bool found = false; + int screen = DefaultScreen(_dpy); // x11 fullscreen is not working on mac os x -#if !defined(NL_OS_MAC) - mode.Windowed = !_FullScreen; -#else +#if defined(NL_OS_MAC) mode.Windowed = true; + found = true; #endif - mode.OffScreen = false; - mode.Depth = (uint) DefaultDepth(_dpy, DefaultScreen(_dpy)); - mode.Frequency = 1000 * pixelClock / (xmode.htotal * xmode.vtotal) ; - mode.Width = xmode.hdisplay; - mode.Height = xmode.vdisplay; +#ifdef XRANDR - nldebug("Current mode : %dx%d, %d Hz, %dbit", mode.Width, mode.Height, mode.Frequency, mode.Depth); -# endif + if (!found && _xrandr_version > 0) + { + XRRScreenConfiguration *screen_config = XRRGetScreenInfo(_dpy, RootWindow(_dpy, screen)); + + if (screen_config) + { + int nsizes; + XRRScreenSize *sizes = XRRConfigSizes(screen_config, &nsizes); + if (nsizes > 0) + { + Rotation cur_rotation; + SizeID size = XRRConfigCurrentConfiguration(screen_config, &cur_rotation); + + mode.Windowed = !_FullScreen; + mode.OffScreen = false; + mode.Depth = (uint) DefaultDepth(_dpy, screen); + mode.Frequency = 0; + mode.Width = sizes[size].width; + mode.Height = sizes[size].height; + + found = true; + + nlinfo("3D: Current XRandR mode %d: %dx%d, %dbit", size, mode.Width, mode.Height, mode.Depth); + } + else + { + nlwarning("3D: No XRandR modes available"); + } + + XRRFreeScreenConfigInfo(screen_config); + } + else + { + nlwarning("3D: XRRGetScreenInfo failed"); + } + } + +#endif // XRANDR + +#ifdef XF86VIDMODE + + if (!found && _xvidmode_version > 0) + { + sint pixelClock; + XF86VidModeModeLine xmode; + + if (XF86VidModeGetModeLine(_dpy, screen, &pixelClock, &xmode)) + { + mode.Windowed = !_FullScreen; + mode.OffScreen = false; + mode.Depth = (uint) DefaultDepth(_dpy, screen); + mode.Frequency = 1000 * pixelClock / (xmode.htotal * xmode.vtotal) ; + mode.Width = xmode.hdisplay; + mode.Height = xmode.vdisplay; + nlinfo("3D: Current XF86VidMode mode: %dx%d, %d Hz, %dbit", mode.Width, mode.Height, mode.Frequency, mode.Depth); + + found = true; + } + else + { + nlwarning("3D: XF86VidModeGetModeLine failed, cannot get current video mode"); + } + } + +#endif + + if (!found) + { + mode.Windowed = !_FullScreen; + mode.OffScreen = _OffScreen; + mode.Depth = (uint) DefaultDepth(_dpy, screen); + mode.Frequency = 0; + mode.Width = DisplayWidth(_dpy, screen); + mode.Height = DisplayHeight(_dpy, screen); + + found = true; + + nldebug("Current mode: %dx%d, %d Hz, %dbit", mode.Width, mode.Height, mode.Frequency, mode.Depth); + } #endif return true; @@ -1379,7 +1634,7 @@ void CDriverGL::showWindow(bool show) #elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE) MAC::showWindow(show); - + #elif defined (NL_OS_UNIX) if (show) @@ -1649,19 +1904,8 @@ void CDriverGL::setWindowSize(uint32 width, uint32 height) XSetWMNormalHints(_dpy, _win, &size_hints); - // set position to (0, 0) if fullscreen - if (_FullScreen) - { - // move and resize the window - XMoveResizeWindow(_dpy, _win, 0, 0, width, height); - } - else - { - // resize the window - XResizeWindow(_dpy, _win, width, height); - } - -// XMapWindow(_dpy, _win); + // resize the window + XResizeWindow(_dpy, _win, width, height); _WindowWidth = width; _WindowHeight = height; From 5b4f2cc791b9735564bd59ee0630801827d5700c Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 12 Jul 2010 23:02:55 +0200 Subject: [PATCH 17/52] Fixed: #928 XRandR modesetting --- code/nel/src/3d/driver/opengl/driver_opengl_window.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp index a9e102dc1..acc84ef13 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp @@ -224,7 +224,7 @@ bool CDriverGL::init (uint windowIcon, emptyProc exitFunc) if (XF86VidModeQueryExtension(_dpy, &event, &error) && XF86VidModeQueryVersion(_dpy, &vm_major, &vm_minor)) { _xvidmode_version = vm_major * 100 + vm_minor; - nlinfo("3D: XF86VidMode %d.%d found", major, minor); + nlinfo("3D: XF86VidMode %d.%d found", vm_major, vm_minor); } #endif @@ -991,7 +991,7 @@ bool CDriverGL::setScreenMode(const GfxMode &mode) if (screen_config) { Rotation saved_rotation; - SizeID size = XRRConfigCurrentConfiguration(screen_config, &saved_rotation); + SizeID cur_size = XRRConfigCurrentConfiguration(screen_config, &saved_rotation); sint nsizes; XRRScreenSize *sizes = XRRConfigSizes(screen_config, &nsizes); From 1306f1d2d05f47cd26ba7601252dd4d35b82393f Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 13 Jul 2010 20:21:32 +0200 Subject: [PATCH 18/52] Fixed: #973 Add an internal method to set an icon for X11 window in OpenGL driver --- code/nel/src/3d/driver/opengl/driver_opengl.h | 2 + .../3d/driver/opengl/driver_opengl_window.cpp | 60 ++++++++++++++++++- 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl.h b/code/nel/src/3d/driver/opengl/driver_opengl.h index 44ce39c2c..2783c8bf3 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl.h +++ b/code/nel/src/3d/driver/opengl/driver_opengl.h @@ -850,6 +850,8 @@ private: bool createWindow(const GfxMode& mode); bool destroyWindow(); + void setWindowIcon(const std::vector &bitmaps); + enum EWindowStyle { EWSWindowed, EWSFullscreen }; void setWindowSize(uint32 width, uint32 height); diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp index acc84ef13..071d730be 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp @@ -35,11 +35,13 @@ # ifdef XRANDR # include # endif +# include #endif // NL_OS_UNIX #include "nel/misc/mouse_device.h" #include "nel/misc/di_event_emitter.h" #include "nel/3d/u_driver.h" +#include "nel/misc/file.h" using namespace std; using namespace NLMISC; @@ -296,6 +298,62 @@ bool CDriverGL::unInit() return true; } +void CDriverGL::setWindowIcon(const std::vector &bitmaps) +{ +#if defined(NL_OS_WINDOWS) + + // TODO + +#elif defined(NL_OS_MAC) + + // TODO + +#elif defined(NL_OS_UNIX) + + std::vector icon_data; + + if (!bitmaps.empty()) + { + // process each bitmap + for(uint i = 0; i < bitmaps.size(); ++i) + { + // get bitmap width and height + uint width = bitmaps[i].getWidth(); + uint height = bitmaps[i].getHeight(); + + // icon_data position for bitmap + uint pos = (uint)icon_data.size(); + + // extend icon_data size for bitmap + icon_data.resize(pos + 2 + width*height); + + // set bitmap width and height + icon_data[pos++] = width; + icon_data[pos++] = height; + + // convert RGBA to ARGB + CObjectVector pixels = bitmaps[i].getPixels(); + for(uint j = 0; j < pixels.size(); j+=4) + icon_data[pos++] = pixels[j] << 16 | pixels[j+1] << 8 | pixels[j+2] | pixels[j+3] << 24; + } + } + + Atom _NET_WM_ICON = XInternAtom(_dpy, "_NET_WM_ICON", False); + + if (!icon_data.empty()) + { + // change window icon + XChangeProperty(_dpy, _win, _NET_WM_ICON, XA_CARDINAL, 32, PropModeReplace, (const unsigned char *) &icon_data[0], icon_data.size()); + } + else + { + // delete window icon if no bitmap is available + XDeleteProperty(_dpy, _win, _NET_WM_ICON); + } + +#endif // NL_OS_WINDOWS +} + // -------------------------------------------------- bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool resizeable) throw(EBadDisplay) { @@ -967,7 +1025,7 @@ bool CDriverGL::setScreenMode(const GfxMode &mode) if (ChangeDisplaySettings(&devMode, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL) { - nlwarning("Fullscreen mode switch failed"); + nlwarning("3D: Fullscreen mode switch failed"); return false; } From c20188e90a7da9588827499a5ec10dd024a48a18 Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 14 Jul 2010 11:44:46 +0200 Subject: [PATCH 19/52] Changed: #927 Move OS specific code from client or server to NeL when it's possible --- code/nel/include/nel/misc/bitmap.h | 4 + code/nel/src/misc/bitmap.cpp | 75 ++++++++++++++++++- .../client/src/interface_v3/custom_mouse.cpp | 58 +------------- 3 files changed, 79 insertions(+), 58 deletions(-) diff --git a/code/nel/include/nel/misc/bitmap.h b/code/nel/include/nel/misc/bitmap.h index 99fa5527f..2a2361b55 100644 --- a/code/nel/include/nel/misc/bitmap.h +++ b/code/nel/include/nel/misc/bitmap.h @@ -621,6 +621,10 @@ public: void getDibData(uint8*& extractData); +#ifdef NL_OS_WINDOWS + HICON getHICON(sint iconWidth, sint iconHeight, sint iconDepth, const NLMISC::CRGBA &col = NLMISC::CRGBA::White, sint hotSpotX = 0, sint hotSpotY = 0, bool cursor = false) const; +#endif + CBitmap& operator= (const CBitmap& from) { if (&from == this) diff --git a/code/nel/src/misc/bitmap.cpp b/code/nel/src/misc/bitmap.cpp index 09631bb6b..1a25da141 100644 --- a/code/nel/src/misc/bitmap.cpp +++ b/code/nel/src/misc/bitmap.cpp @@ -1500,7 +1500,7 @@ uint32 CBitmap::getHeight(uint32 mipMap) const /*-------------------------------------------------------------------*\ - getHeight + getSize \*-------------------------------------------------------------------*/ uint32 CBitmap::getSize(uint32 numMipMap) const { @@ -4107,5 +4107,78 @@ void CBitmap::getDibData(uint8*& extractData) } +#ifdef NL_OS_WINDOWS + +HICON CBitmap::getHICON(sint iconWidth, sint iconHeight, sint iconDepth, const NLMISC::CRGBA &col, sint hotSpotX, sint hotSpotY, bool cursor) const +{ + HICON result = NULL; + CBitmap colorBm; + colorBm.resize(iconWidth, iconHeight, CBitmap::RGBA); + const CRGBA *srcColorPtr = (CRGBA *) &(getPixels()[0]); + const CRGBA *srcColorPtrLast = srcColorPtr + (iconWidth * iconHeight); + CRGBA *destColorPtr = (CRGBA *) &(colorBm.getPixels()[0]); + static volatile uint8 alphaThreshold = 127; + do + { + destColorPtr->modulateFromColor(*srcColorPtr, col); + std::swap(destColorPtr->R, destColorPtr->B); + ++ srcColorPtr; + ++ destColorPtr; + } + while (srcColorPtr != srcColorPtrLast); + // + HBITMAP colorHbm = NULL; + HBITMAP maskHbm = NULL; + // + if (iconDepth == 16) + { + std::vector colorBm16(iconWidth * iconHeight); + const CRGBA *src32 = (const CRGBA *) &colorBm.getPixels(0)[0]; + + for (uint k = 0; k < colorBm16.size(); ++k) + { + colorBm16[k] = ((uint16)(src32[k].R&0xf8)>>3) | ((uint16)(src32[k].G&0xfc)<<3) | ((uint16)(src32[k].B & 0xf8)<<8); + } + + colorHbm = CreateBitmap(iconWidth, iconHeight, 1, 16, &colorBm16[0]); + std::vector bitMask((iconWidth * iconHeight + 7) / 8, 0); + + for (uint k = 0;k < colorBm16.size(); ++k) + { + if (src32[k].A <= 120) + { + bitMask[k / 8] |= (0x80 >> (k & 7)); + } + } + + maskHbm = CreateBitmap(iconWidth, iconHeight, 1, 1, &bitMask[0]); + } + else + { + colorHbm = CreateBitmap(iconWidth, iconHeight, 1, 32, &colorBm.getPixels(0)[0]); + maskHbm = CreateBitmap(iconWidth, iconHeight, 1, 32, &colorBm.getPixels(0)[0]); + } + + ICONINFO iconInfo; + iconInfo.fIcon = cursor ? FALSE:TRUE; + iconInfo.xHotspot = (DWORD) hotSpotX; + iconInfo.yHotspot = (DWORD) hotSpotY; + iconInfo.hbmMask = maskHbm; + iconInfo.hbmColor = colorHbm; + + if (colorHbm && maskHbm) + { + result = CreateIconIndirect(&iconInfo); + } + + // + if (colorHbm) DeleteObject(colorHbm); + if (maskHbm) DeleteObject(maskHbm); + + return result; +} + +#endif + } // NLMISC diff --git a/code/ryzom/client/src/interface_v3/custom_mouse.cpp b/code/ryzom/client/src/interface_v3/custom_mouse.cpp index af1bb7209..c7d127803 100644 --- a/code/ryzom/client/src/interface_v3/custom_mouse.cpp +++ b/code/ryzom/client/src/interface_v3/custom_mouse.cpp @@ -370,7 +370,6 @@ HICON CCustomMouse::buildCursor(const CBitmap &src, NLMISC::CRGBA col, uint8 rot uint mouseH = GetSystemMetrics(SM_CYCURSOR); nlassert(src.getWidth() == mouseW); nlassert(src.getHeight() == mouseH); - HICON result = 0; CBitmap rotSrc = src; if (rot > 3) rot = 3; // mimic behavior of 'CViewRenderer::drawRotFlipBitmapTiled' (why not rot & 3 ??? ...) switch(rot) @@ -380,62 +379,7 @@ HICON CCustomMouse::buildCursor(const CBitmap &src, NLMISC::CRGBA col, uint8 rot case 2: rotSrc.rot90CW(); rotSrc.rot90CW(); break; case 3: rotSrc.rot90CCW(); break; } - CBitmap colorBm; - colorBm.resize(mouseW, mouseH, CBitmap::RGBA); - const CRGBA *srcColorPtr = (CRGBA *) &(rotSrc.getPixels()[0]); - const CRGBA *srcColorPtrLast = srcColorPtr + (mouseW * mouseH); - CRGBA *destColorPtr = (CRGBA *) &(colorBm.getPixels()[0]); - static volatile uint8 alphaThreshold = 127; - do - { - destColorPtr->modulateFromColor(*srcColorPtr, col); - std::swap(destColorPtr->R, destColorPtr->B); - ++ srcColorPtr; - ++ destColorPtr; - } - while (srcColorPtr != srcColorPtrLast); - // - HBITMAP colorHbm = 0; - HBITMAP maskHbm = 0; - // - if (_ColorDepth == ColorDepth16) - { - std::vector colorBm16(colorBm.getWidth() * colorBm.getHeight()); - const CRGBA *src32 = (const CRGBA *) &colorBm.getPixels(0)[0]; - for (uint k = 0;k < colorBm16.size(); ++k) - { - colorBm16[k] = ((uint16)(src32[k].R&0xf8)>>3) | ((uint16)(src32[k].G&0xfc)<<3) | ((uint16)(src32[k].B & 0xf8)<<8); - } - colorHbm = CreateBitmap(mouseW, mouseH, 1, 16, &colorBm16[0]); - std::vector bitMask((colorBm.getWidth() * colorBm.getHeight() + 7) / 8, 0); - for (uint k = 0;k < colorBm16.size(); ++k) - { - if (src32[k].A <= 120) - { - bitMask[k / 8] |= (0x80 >> (k & 7)); - } - } - maskHbm = CreateBitmap(mouseW, mouseH, 1, 1, &bitMask[0]); - } - else - { - colorHbm = CreateBitmap(mouseW, mouseH, 1, 32, &colorBm.getPixels(0)[0]); - maskHbm = CreateBitmap(mouseW, mouseH, 1, 32, &colorBm.getPixels(0)[0]); - } - ICONINFO iconInfo; - iconInfo.fIcon = FALSE; - iconInfo.xHotspot = (DWORD) hotSpotX; - iconInfo.yHotspot = (DWORD) hotSpotY; - iconInfo.hbmMask = maskHbm; - iconInfo.hbmColor = colorHbm; - if (colorHbm && maskHbm) - { - result = CreateIconIndirect(&iconInfo); - } - // - if (colorHbm) DeleteObject(colorHbm); - if (maskHbm) DeleteObject(maskHbm); - return result; + return rotSrc.getHICON(mouseW, mouseH, _ColorDepth == ColorDepth16 ? 16:32, col, hotSpotX, hotSpotY, true); } From 1cc6877502266e3d118d9c5a44e47900875c8bbc Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 14 Jul 2010 11:48:24 +0200 Subject: [PATCH 20/52] Fixed: #1018 Implement setWindowIcon for Win32 --- .../3d/driver/opengl/driver_opengl_window.cpp | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp index 071d730be..d698285aa 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp @@ -302,7 +302,39 @@ void CDriverGL::setWindowIcon(const std::vector &bitmaps) { #if defined(NL_OS_WINDOWS) - // TODO + static HICON winIconBig = NULL; + static HICON winIconSmall = NULL; + + if (winIconBig) + { + DestroyIcon(winIconBig); + winIconBig = NULL; + } + + if (winIconSmall) + { + DestroyIcon(winIconSmall); + winIconSmall = NULL; + } + + // first bitmap is the small icon + if (bitmaps.size() > 0) + winIconSmall = bitmaps[0].getHICON(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 32); + + // second bitmap is the big icon + if (bitmaps.size() > 1) + winIconBig = bitmaps[1].getHICON(GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), 32); + + if (winIconBig) + { + SendMessage(_win, WM_SETICON, 0 /* ICON_SMALL */, (LPARAM)winIconSmall); + SendMessage(_win, WM_SETICON, 1 /* ICON_BIG */, (LPARAM)winIconBig); + } + else + { + SendMessage(_win, WM_SETICON, 0 /* ICON_SMALL */, (LPARAM)winIconSmall); + SendMessage(_win, WM_SETICON, 1 /* ICON_BIG */, (LPARAM)winIconSmall); + } #elif defined(NL_OS_MAC) @@ -1193,6 +1225,10 @@ bool CDriverGL::destroyWindow() { H_AUTO_OGL(CDriverGL_destroyWindow) + // make sure window icons are deleted + std::vector bitmaps; + setWindowIcon(bitmaps); + #ifdef NL_OS_WINDOWS // Then delete. From 632c99d4f3f1e84631e26e3f1597974e017cc865 Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 14 Jul 2010 16:16:15 +0200 Subject: [PATCH 21/52] Fixed: #1019 Add public setWindowIcon method to UDriver --- code/nel/include/nel/3d/driver.h | 3 + code/nel/include/nel/3d/driver_user.h | 3 + code/nel/include/nel/3d/u_driver.h | 3 + code/nel/src/3d/driver.cpp | 2 +- .../3d/driver/direct3d/driver_direct3d.cpp | 71 +++++++++++++++++++ .../src/3d/driver/direct3d/driver_direct3d.h | 3 + code/nel/src/3d/driver/opengl/driver_opengl.h | 9 +-- .../3d/driver/opengl/driver_opengl_window.cpp | 43 +++++++++-- code/nel/src/3d/driver_user.cpp | 7 ++ code/nel/src/misc/bitmap.cpp | 8 ++- 10 files changed, 139 insertions(+), 13 deletions(-) diff --git a/code/nel/include/nel/3d/driver.h b/code/nel/include/nel/3d/driver.h index 6428baab5..2a0d061fd 100644 --- a/code/nel/include/nel/3d/driver.h +++ b/code/nel/include/nel/3d/driver.h @@ -186,6 +186,9 @@ public: /// Set the title of the NeL window virtual void setWindowTitle(const ucstring &title)=0; + /// Set icon(s) of the NeL window + virtual void setWindowIcon(const std::vector &bitmaps)=0; + /// Set the position of the NeL window virtual void setWindowPos(sint32 x, sint32 y)=0; diff --git a/code/nel/include/nel/3d/driver_user.h b/code/nel/include/nel/3d/driver_user.h index 1bda23c27..699691d89 100644 --- a/code/nel/include/nel/3d/driver_user.h +++ b/code/nel/include/nel/3d/driver_user.h @@ -148,6 +148,9 @@ public: /// Set the title of the NeL window virtual void setWindowTitle(const ucstring &title); + /// Set icon(s) of the NeL window + virtual void setWindowIcon(const std::vector &bitmaps); + /// Set the position of the NeL window virtual void setWindowPos(sint32 x, sint32 y); diff --git a/code/nel/include/nel/3d/u_driver.h b/code/nel/include/nel/3d/u_driver.h index 4e7b2eb05..ce421b46d 100644 --- a/code/nel/include/nel/3d/u_driver.h +++ b/code/nel/include/nel/3d/u_driver.h @@ -186,6 +186,9 @@ public: /// Set the title of the NeL window virtual void setWindowTitle(const ucstring &title)=0; + /// Set icon(s) of the NeL window + virtual void setWindowIcon(const std::vector &bitmaps)=0; + /// Set the position of the NeL window virtual void setWindowPos(sint32 x, sint32 y)=0; diff --git a/code/nel/src/3d/driver.cpp b/code/nel/src/3d/driver.cpp index d8a195c3a..39d72c7c3 100644 --- a/code/nel/src/3d/driver.cpp +++ b/code/nel/src/3d/driver.cpp @@ -34,7 +34,7 @@ namespace NL3D { // *************************************************************************** -const uint32 IDriver::InterfaceVersion = 0x67; // changed window pos from uint32 to sint32 +const uint32 IDriver::InterfaceVersion = 0x68; // added setWindowIcon // *************************************************************************** IDriver::IDriver() : _SyncTexDrvInfos( "IDriver::_SyncTexDrvInfos" ) diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp index 3986e8e26..e096a4d00 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp @@ -1712,6 +1712,10 @@ bool CDriverD3D::release() if (_HWnd) { + // make sure window icons are deleted + std::vector bitmaps; + setWindowIcon(bitmaps); + if (_DestroyWindow) DestroyWindow (_HWnd); _HWnd = NULL; @@ -2177,6 +2181,73 @@ void CDriverD3D::setWindowTitle(const ucstring &title) SetWindowTextW(_HWnd,(WCHAR*)title.c_str()); } +// *************************************************************************** +void CDriverD3D::setWindowIcon(const std::vector &bitmaps) +{ + if (!_HWnd) + return; + + static HICON winIconBig = NULL; + static HICON winIconSmall = NULL; + + if (winIconBig) + { + DestroyIcon(winIconBig); + winIconBig = NULL; + } + + if (winIconSmall) + { + DestroyIcon(winIconSmall); + winIconSmall = NULL; + } + + sint smallIndex = -1; + uint smallWidth = GetSystemMetrics(SM_CXSMICON); + uint smallHeight = GetSystemMetrics(SM_CYSMICON); + + sint bigIndex = -1; + uint bigWidth = GetSystemMetrics(SM_CXICON); + uint bigHeight = GetSystemMetrics(SM_CYICON); + + // find icons with the exact size + for(uint i = 0; i < bitmaps.size(); ++i) + { + if (smallIndex == -1 && bitmaps[i].getWidth() == smallWidth && bitmaps[i].getHeight() == smallHeight) + smallIndex = i; + + if (bigIndex == -1 && bitmaps[i].getWidth() == bigWidth && bitmaps[i].getHeight() == bigHeight) + bigIndex = i; + } + + // find icons with taller size (we will resize them) + for(uint i = 0; i < bitmaps.size(); ++i) + { + if (smallIndex == -1 && bitmaps[i].getWidth() >= smallWidth && bitmaps[i].getHeight() >= smallHeight) + smallIndex = i; + + if (bigIndex == -1 && bitmaps[i].getWidth() >= bigWidth && bitmaps[i].getHeight() >= bigHeight) + bigIndex = i; + } + + if (smallIndex > -1) + winIconSmall = bitmaps[smallIndex].getHICON(smallWidth, smallHeight, 32); + + if (bigIndex > -1) + winIconBig = bitmaps[bigIndex].getHICON(bigWidth, bigHeight, 32); + + if (winIconBig) + { + SendMessage(_HWnd, WM_SETICON, 0 /* ICON_SMALL */, (LPARAM)winIconSmall); + SendMessage(_HWnd, WM_SETICON, 1 /* ICON_BIG */, (LPARAM)winIconBig); + } + else + { + SendMessage(_HWnd, WM_SETICON, 0 /* ICON_SMALL */, (LPARAM)winIconSmall); + SendMessage(_HWnd, WM_SETICON, 1 /* ICON_BIG */, (LPARAM)winIconSmall); + } +} + // *************************************************************************** void CDriverD3D::setWindowPos(sint32 x, sint32 y) { diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d.h b/code/nel/src/3d/driver/direct3d/driver_direct3d.h index 52dca1dc5..ccd414782 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d.h +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d.h @@ -759,6 +759,9 @@ public: /// Set the title of the NeL window virtual void setWindowTitle(const ucstring &title); + /// Set icon(s) of the NeL window + virtual void setWindowIcon(const std::vector &bitmaps); + /// Set the position of the NeL window virtual void setWindowPos(sint32 x, sint32 y); diff --git a/code/nel/src/3d/driver/opengl/driver_opengl.h b/code/nel/src/3d/driver/opengl/driver_opengl.h index 2783c8bf3..18397d61b 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl.h +++ b/code/nel/src/3d/driver/opengl/driver_opengl.h @@ -294,10 +294,13 @@ public: virtual void beginDialogMode(); virtual void endDialogMode(); - /// Set the title of the NeL window + /// Set title of the NeL window virtual void setWindowTitle(const ucstring &title); - /// Set the position of the NeL window + /// Set icon(s) of the NeL window + virtual void setWindowIcon(const std::vector &bitmaps); + + /// Set position of the NeL window virtual void setWindowPos(sint32 x, sint32 y); /// Show or hide the NeL window @@ -850,8 +853,6 @@ private: bool createWindow(const GfxMode& mode); bool destroyWindow(); - void setWindowIcon(const std::vector &bitmaps); - enum EWindowStyle { EWSWindowed, EWSFullscreen }; void setWindowSize(uint32 width, uint32 height); diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp index d698285aa..3fecf8188 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp @@ -300,6 +300,9 @@ bool CDriverGL::unInit() void CDriverGL::setWindowIcon(const std::vector &bitmaps) { + if (_win == EmptyWindow) + return; + #if defined(NL_OS_WINDOWS) static HICON winIconBig = NULL; @@ -317,13 +320,39 @@ void CDriverGL::setWindowIcon(const std::vector &bitmaps) winIconSmall = NULL; } - // first bitmap is the small icon - if (bitmaps.size() > 0) - winIconSmall = bitmaps[0].getHICON(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 32); + sint smallIndex = -1; + uint smallWidth = GetSystemMetrics(SM_CXSMICON); + uint smallHeight = GetSystemMetrics(SM_CYSMICON); - // second bitmap is the big icon - if (bitmaps.size() > 1) - winIconBig = bitmaps[1].getHICON(GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), 32); + sint bigIndex = -1; + uint bigWidth = GetSystemMetrics(SM_CXICON); + uint bigHeight = GetSystemMetrics(SM_CYICON); + + // find icons with the exact size + for(uint i = 0; i < bitmaps.size(); ++i) + { + if (smallIndex == -1 && bitmaps[i].getWidth() == smallWidth && bitmaps[i].getHeight() == smallHeight) + smallIndex = i; + + if (bigIndex == -1 && bitmaps[i].getWidth() == bigWidth && bitmaps[i].getHeight() == bigHeight) + bigIndex = i; + } + + // find icons with taller size (we will resize them) + for(uint i = 0; i < bitmaps.size(); ++i) + { + if (smallIndex == -1 && bitmaps[i].getWidth() >= smallWidth && bitmaps[i].getHeight() >= smallHeight) + smallIndex = i; + + if (bigIndex == -1 && bitmaps[i].getWidth() >= bigWidth && bitmaps[i].getHeight() >= bigHeight) + bigIndex = i; + } + + if (smallIndex > -1) + winIconSmall = bitmaps[smallIndex].getHICON(smallWidth, smallHeight, 32); + + if (bigIndex > -1) + winIconBig = bitmaps[bigIndex].getHICON(bigWidth, bigHeight, 32); if (winIconBig) { @@ -338,7 +367,7 @@ void CDriverGL::setWindowIcon(const std::vector &bitmaps) #elif defined(NL_OS_MAC) - // TODO + // nothing to do #elif defined(NL_OS_UNIX) diff --git a/code/nel/src/3d/driver_user.cpp b/code/nel/src/3d/driver_user.cpp index ea8a44e83..523aaf4ba 100644 --- a/code/nel/src/3d/driver_user.cpp +++ b/code/nel/src/3d/driver_user.cpp @@ -332,6 +332,13 @@ void CDriverUser::setWindowTitle(const ucstring &title) _Driver->setWindowTitle(title); } +// *************************************************************************** +void CDriverUser::setWindowIcon(const std::vector &bitmaps) +{ + NL3D_HAUTO_UI_DRIVER; + _Driver->setWindowIcon(bitmaps); +} + // *************************************************************************** void CDriverUser::setWindowPos(sint32 x, sint32 y) { diff --git a/code/nel/src/misc/bitmap.cpp b/code/nel/src/misc/bitmap.cpp index 1a25da141..4a97a004d 100644 --- a/code/nel/src/misc/bitmap.cpp +++ b/code/nel/src/misc/bitmap.cpp @@ -4112,9 +4112,15 @@ void CBitmap::getDibData(uint8*& extractData) HICON CBitmap::getHICON(sint iconWidth, sint iconHeight, sint iconDepth, const NLMISC::CRGBA &col, sint hotSpotX, sint hotSpotY, bool cursor) const { HICON result = NULL; + CBitmap src = *this; + // resample bitmap if necessary + if (_Width != iconWidth || _Height != iconHeight) + { + src.resample(iconWidth, iconHeight); + } CBitmap colorBm; colorBm.resize(iconWidth, iconHeight, CBitmap::RGBA); - const CRGBA *srcColorPtr = (CRGBA *) &(getPixels()[0]); + const CRGBA *srcColorPtr = (CRGBA *) &(src.getPixels()[0]); const CRGBA *srcColorPtrLast = srcColorPtr + (iconWidth * iconHeight); CRGBA *destColorPtr = (CRGBA *) &(colorBm.getPixels()[0]); static volatile uint8 alphaThreshold = 127; From 6f2ac6201f7ebd64c43e709192bdc0b27d21a657 Mon Sep 17 00:00:00 2001 From: rti Date: Wed, 14 Jul 2010 16:52:15 +0200 Subject: [PATCH 22/52] Fixed: #1008 Modifier Key Information --- .../src/3d/driver/opengl/mac/cocoa_adapter.mm | 56 ++++++++----------- 1 file changed, 23 insertions(+), 33 deletions(-) diff --git a/code/nel/src/3d/driver/opengl/mac/cocoa_adapter.mm b/code/nel/src/3d/driver/opengl/mac/cocoa_adapter.mm index aa0cf9dbb..9ad145e1b 100644 --- a/code/nel/src/3d/driver/opengl/mac/cocoa_adapter.mm +++ b/code/nel/src/3d/driver/opengl/mac/cocoa_adapter.mm @@ -809,49 +809,46 @@ void submitEvents(NLMISC::CEventServer& server, continue; } + // convert the modifiers for nel to pass them with the events + NLMISC::TKeyButton modifiers = + modifierFlagsToNelKeyButton([event modifierFlags]); + switch(event.type) { case NSLeftMouseDown: { - /* - TODO modifiers with mouse events - */ server.postEvent(new NLMISC::CEventMouseDown( - mouseX, mouseY, NLMISC::leftButton /* modifiers */, eventEmitter)); + mouseX, mouseY, + (NLMISC::TMouseButton)(NLMISC::leftButton | modifiers), + eventEmitter)); } break; case NSLeftMouseUp: { - /* - TODO modifiers with mouse events - */ server.postEvent(new NLMISC::CEventMouseUp( - mouseX, mouseY, NLMISC::leftButton /* modifiers */, eventEmitter)); + mouseX, mouseY, + (NLMISC::TMouseButton)(NLMISC::leftButton | modifiers), + eventEmitter)); break; } case NSRightMouseDown: { - /* - TODO modifiers with mouse events - */ server.postEvent(new NLMISC::CEventMouseDown( - mouseX, mouseY, NLMISC::rightButton /* modifiers */, eventEmitter)); + mouseX, mouseY, + (NLMISC::TMouseButton)(NLMISC::rightButton | modifiers), + eventEmitter)); break; } case NSRightMouseUp: { - /* - TODO modifiers with mouse events - */ server.postEvent(new NLMISC::CEventMouseUp( - mouseX, mouseY, NLMISC::rightButton /* modifiers */, eventEmitter)); + mouseX, mouseY, + (NLMISC::TMouseButton)(NLMISC::rightButton | modifiers), + eventEmitter)); break; } case NSMouseMoved: { - /* - TODO modifiers with mouse events - */ NLMISC::CEvent* nelEvent; // when emulating raw mode, send the delta in a CGDMouseMove event @@ -861,17 +858,14 @@ void submitEvents(NLMISC::CEventServer& server, // normally send position in a CEventMouseMove else - nelEvent = new NLMISC::CEventMouseMove(mouseX, mouseY, - (NLMISC::TMouseButton)0 /* modifiers */, eventEmitter); + nelEvent = new NLMISC::CEventMouseMove( + mouseX, mouseY, (NLMISC::TMouseButton)modifiers, eventEmitter); server.postEvent(nelEvent); break; } case NSLeftMouseDragged: { - /* - TODO modifiers with mouse events - */ NLMISC::CEvent* nelEvent; // when emulating raw mode, send the delta in a CGDMouseMove event @@ -882,16 +876,14 @@ void submitEvents(NLMISC::CEventServer& server, // normally send position in a CEventMouseMove else nelEvent = new NLMISC::CEventMouseMove(mouseX, mouseY, - NLMISC::leftButton /* modifiers */, eventEmitter); + (NLMISC::TMouseButton)(NLMISC::leftButton | modifiers), + eventEmitter); server.postEvent(nelEvent); break; } case NSRightMouseDragged: { - /* - TODO modifiers with mouse events - */ NLMISC::CEvent* nelEvent; // when emulating raw mode, send the delta in a CGDMouseMove event @@ -902,7 +894,8 @@ void submitEvents(NLMISC::CEventServer& server, // normally send position in a CEventMouseMove else nelEvent = new NLMISC::CEventMouseMove(mouseX, mouseY, - NLMISC::rightButton /* modifiers */, eventEmitter); + (NLMISC::TMouseButton)(NLMISC::rightButton | modifiers), + eventEmitter); server.postEvent(nelEvent); break; @@ -951,12 +944,9 @@ void submitEvents(NLMISC::CEventServer& server, case NSCursorUpdate:break; case NSScrollWheel: { - /* - TODO modifiers with mouse events - */ if(fabs(event.deltaY) > 0.1) server.postEvent(new NLMISC::CEventMouseWheel( - mouseX, mouseY, (NLMISC::TMouseButton)0 /* modifiers */, + mouseX, mouseY, (NLMISC::TMouseButton)modifiers, (event.deltaY > 0), eventEmitter)); break; From 4f3ceccb18d10684aca2723d3f1c85e2ba87ea65 Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 14 Jul 2010 17:46:30 +0200 Subject: [PATCH 23/52] Fixed: GCC error with templates (by Naush) --- code/nel/include/nel/3d/ps_color.h | 2 +- code/nel/include/nel/3d/ps_float.h | 2 +- code/nel/include/nel/3d/ps_int.h | 2 +- code/nel/include/nel/3d/ps_plane_basis_maker.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/code/nel/include/nel/3d/ps_color.h b/code/nel/include/nel/3d/ps_color.h index 1c52d68e4..a46e2122a 100644 --- a/code/nel/include/nel/3d/ps_color.h +++ b/code/nel/include/nel/3d/ps_color.h @@ -34,7 +34,7 @@ namespace NL3D { template <> -const char *CPSAttribMaker::getType() { return "CRGBA"; } +inline const char *CPSAttribMaker::getType() { return "CRGBA"; } // Depending on the driver, the format of colors in vertex buffer may change. We don't want to change the format for each data that is (dynamically) in vertex buffer, so diff --git a/code/nel/include/nel/3d/ps_float.h b/code/nel/include/nel/3d/ps_float.h index 20878de27..8dcc732aa 100644 --- a/code/nel/include/nel/3d/ps_float.h +++ b/code/nel/include/nel/3d/ps_float.h @@ -28,7 +28,7 @@ namespace NL3D { template <> -const char *CPSAttribMaker::getType() { return "float"; } +inline const char *CPSAttribMaker::getType() { return "float"; } /// these are some attribute makers for float /// This is a float blender class. It just blend between 2 values diff --git a/code/nel/include/nel/3d/ps_int.h b/code/nel/include/nel/3d/ps_int.h index 1985ec6d7..d821ad7b9 100644 --- a/code/nel/include/nel/3d/ps_int.h +++ b/code/nel/include/nel/3d/ps_int.h @@ -26,7 +26,7 @@ namespace NL3D { template <> -const char *CPSAttribMaker::getType() { return "int32"; } +inline const char *CPSAttribMaker::getType() { return "int32"; } /// these are some attribute makers for int diff --git a/code/nel/include/nel/3d/ps_plane_basis_maker.h b/code/nel/include/nel/3d/ps_plane_basis_maker.h index b7ae6de29..51714a368 100644 --- a/code/nel/include/nel/3d/ps_plane_basis_maker.h +++ b/code/nel/include/nel/3d/ps_plane_basis_maker.h @@ -28,7 +28,7 @@ namespace NL3D { template <> -const char *CPSAttribMaker::getType() { return "CPlaneBasis";} +inline const char *CPSAttribMaker::getType() { return "CPlaneBasis";} /** these are some attribute makers for plane_basis * This is a plane basis class. It just blend between 2 plane by linearly interpolating the normal From 9b391a24fad5b72c79f7ee7881a1f90588c54df4 Mon Sep 17 00:00:00 2001 From: Matt Raykowski Date: Wed, 14 Jul 2010 12:13:07 -0500 Subject: [PATCH 24/52] Changed: #842 Added helper macros to cleanup files, removed useless DECORATE_NEL_LIB macro and started adding WITH_STATIC/WITH_STATIC_DRIVER support for full static linking. --- code/nel/CMakeLists.txt | 8 ++ code/nel/CMakeModules/nel.cmake | 86 +++++++++++++++---- .../samples/3d/cluster_viewer/CMakeLists.txt | 12 +-- code/nel/samples/3d/font/CMakeLists.txt | 12 +-- .../samples/3d/shape_viewer/CMakeLists.txt | 6 +- code/nel/samples/georges/CMakeLists.txt | 9 +- code/nel/samples/misc/command/CMakeLists.txt | 9 +- .../samples/misc/configfile/CMakeLists.txt | 9 +- code/nel/samples/misc/debug/CMakeLists.txt | 12 +-- code/nel/samples/misc/i18n/CMakeLists.txt | 9 +- code/nel/samples/misc/log/CMakeLists.txt | 12 +-- code/nel/samples/misc/strings/CMakeLists.txt | 9 +- .../samples/misc/types_check/CMakeLists.txt | 15 +--- code/nel/samples/net/udp/CMakeLists.txt | 25 ++---- code/nel/src/3d/CMakeLists.txt | 20 ++--- .../nel/src/3d/driver/direct3d/CMakeLists.txt | 22 ++--- code/nel/src/3d/driver/opengl/CMakeLists.txt | 16 ++-- code/nel/src/georges/CMakeLists.txt | 20 +---- code/nel/src/ligo/CMakeLists.txt | 21 +---- code/nel/src/logic/CMakeLists.txt | 17 +--- code/nel/src/misc/CMakeLists.txt | 21 +---- code/nel/src/net/CMakeLists.txt | 31 ++----- code/nel/src/pacs/CMakeLists.txt | 18 +--- code/nel/src/sound/CMakeLists.txt | 20 +---- code/nel/src/sound/driver/CMakeLists.txt | 15 +--- .../src/sound/driver/openal/CMakeLists.txt | 15 +--- code/nel/tools/nel_unit_test/CMakeLists.txt | 16 +--- 27 files changed, 176 insertions(+), 309 deletions(-) diff --git a/code/nel/CMakeLists.txt b/code/nel/CMakeLists.txt index 29af3e2b6..10b987724 100644 --- a/code/nel/CMakeLists.txt +++ b/code/nel/CMakeLists.txt @@ -75,6 +75,14 @@ FIND_PACKAGE(Jpeg) NL_SETUP_BUILD() +IF(WITH_STATIC_DRIVERS) + IF(WIN32) + ADD_DEFINITIONS(/DNL_STATIC) + ELSE(WIN32) + ADD_DEFINITIONS(-DNL_STATIC) + ENDIF(WIN32) +ENDIF(WITH_STATIC_DRIVERS) + # On Windows we need to find DirectInput for NLMISC. # This is how we get events. IF(WIN32) diff --git a/code/nel/CMakeModules/nel.cmake b/code/nel/CMakeModules/nel.cmake index f3e7162b7..9a03672be 100644 --- a/code/nel/CMakeModules/nel.cmake +++ b/code/nel/CMakeModules/nel.cmake @@ -1,27 +1,69 @@ ### -# Build Library Name +# Helper macro that generates .pc and installs it. +# Argument: name - the name of the .pc package, e.g. "nel-pacs.pc" +### +MACRO(NL_GEN_PC name) + IF(NOT WIN32) + CONFIGURE_FILE(${name}.in ${name}) + INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/${name}" DESTINATION lib/pkgconfig) + ENDIF(NOT WIN32) +ENDMACRO(NL_GEN_PC) + +### # -# Arguments: name - undecorated library name -# Sets: LIBNAME - decorated library name ### -MACRO(DECORATE_NEL_LIB name) +MACRO(NL_TARGET_LIB name) + IF(WITH_STATIC) + ADD_LIBRARY(${name} STATIC ${ARGN}) + ELSE(WITH_STATIC) + ADD_LIBRARY(${name} SHARED ${ARGN}) + ENDIF(WITH_STATIC) +ENDMACRO(NL_TARGET_LIB) +### +# +### +MACRO(NL_TARGET_DRIVER name) + IF(WITH_STATIC_DRIVERS) + ADD_LIBRARY(${name} STATIC ${ARGN}) + ELSE(WITH_STATIC_DRIVERS) + ADD_LIBRARY(${name} SHARED ${ARGN}) + ENDIF(WITH_STATIC_DRIVERS) +ENDMACRO(NL_TARGET_DRIVER) + +### +# Helper macro that sets the default library properties. +# Argument: name - the target name whose properties are being set +# Argument: +### +MACRO(NL_DEFAULT_PROPS name label) + SET_TARGET_PROPERTIES(${name} PROPERTIES + VERSION ${NL_VERSION} + SOVERSION ${NL_VERSION_MAJOR} + PROJECT_LABEL ${label}) +ENDMACRO(NL_DEFAULT_PROPS) + +### +# Adds the target suffix on Windows. +# Argument: name - the library's target name. +### +MACRO(NL_ADD_LIB_SUFFIX name) IF(WIN32) - IF(NL_BUILD_MODE MATCHES "NL_RELEASE_DEBUG") - SET(LIBNAME "${name}") - ELSE(NL_BUILD_MODE MATCHES "NL_RELEASE_DEBUG") - IF(NL_BUILD_MODE MATCHES "NL_DEBUG") - SET(LIBNAME "${name}") - ELSE(NL_BUILD_MODE MATCHES "NL_DEBUG") - SET(LIBNAME "${name}") - ENDIF(NL_BUILD_MODE MATCHES "NL_DEBUG") - ENDIF(NL_BUILD_MODE MATCHES "NL_RELEASE_DEBUG") - ELSE(WIN32) - SET(LIBNAME "${name}") + SET_TARGET_PROPERTIES(${name} PROPERTIES DEBUG_POSTFIX "_d" RELEASE_POSTFIX "_r") ENDIF(WIN32) +ENDMACRO(NL_ADD_LIB_SUFFIX) -ENDMACRO(DECORATE_NEL_LIB) - +### +# Adds the runtime link flags for Win32 binaries. +# Argument: name - the target to add the link flags to. +### +MACRO(NL_ADD_RUNTIME_FLAGS name) + IF(WIN32) + SET_TARGET_PROPERTIES(${name} PROPERTIES + LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" + LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}") + ENDIF(WIN32) +ENDMACRO(NL_ADD_RUNTIME_FLAGS) ### # Checks build vs. source location. Prevents In-Source builds. ### @@ -48,7 +90,15 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS) OPTION(WITH_LOGGING "With Logging" ON ) OPTION(WITH_COVERAGE "With Code Coverage Support" OFF) OPTION(WITH_PCH "With Precompiled Headers" ON ) - + + # Default to static building on Windows. + IF(WIN32) + OPTION(WITH_STATIC "With static libraries." ON ) + ELSE(WIN32) + OPTION(WITH_STATIC "With static libraries." OFF) + ENDIF(WIN32) + OPTION(WITH_STATIC_DRIVERS "With static drivers." OFF) + ### # Core libraries ### diff --git a/code/nel/samples/3d/cluster_viewer/CMakeLists.txt b/code/nel/samples/3d/cluster_viewer/CMakeLists.txt index 22691e258..16208dd28 100644 --- a/code/nel/samples/3d/cluster_viewer/CMakeLists.txt +++ b/code/nel/samples/3d/cluster_viewer/CMakeLists.txt @@ -1,18 +1,14 @@ FILE(GLOB SRC *.cpp) -ADD_EXECUTABLE(nl_sample_clusterview ${SRC}) +ADD_EXECUTABLE(nl_sample_clusterview WIN32 ${SRC}) ADD_DEFINITIONS(-DCV_DIR="\\"${NL_SHARE_PREFIX}/nl_sample_clusterview/\\"") INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nl_sample_clusterview ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc nel3d) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_clusterview PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - LINK_FLAGS "/SUBSYSTEM:WINDOWS" - PROJECT_LABEL "Samples, 3D: Cluster Viewer") -ENDIF(WIN32) +NL_ADD_RUNTIME_FLAGS(nl_sample_clusterview) +NL_DEFAULT_PROPS(nl_sample_clusterview "Samples, 3D: Cluster Viewer") + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) INSTALL(TARGETS nl_sample_clusterview RUNTIME DESTINATION bin COMPONENT samples3d) diff --git a/code/nel/samples/3d/font/CMakeLists.txt b/code/nel/samples/3d/font/CMakeLists.txt index be5294180..503fa3e7a 100644 --- a/code/nel/samples/3d/font/CMakeLists.txt +++ b/code/nel/samples/3d/font/CMakeLists.txt @@ -1,18 +1,14 @@ FILE(GLOB SRC *.cpp) -ADD_EXECUTABLE(nl_sample_font ${SRC}) +ADD_EXECUTABLE(nl_sample_font WIN32 ${SRC}) ADD_DEFINITIONS(-DFONT_DIR="\\"${NL_SHARE_PREFIX}/nl_sample_font/\\"") INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nl_sample_font ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc nel3d) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_font PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - LINK_FLAGS "/SUBSYSTEM:WINDOWS" - PROJECT_LABEL "Samples, 3D: Font") -ENDIF(WIN32) +NL_DEFAULT_PROPS(nl_sample_font "Samples, 3D: Font") +NL_ADD_RUNTIME_FLAGS(nl_sample_font) + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) INSTALL(TARGETS nl_sample_font RUNTIME DESTINATION bin COMPONENT samples3d) diff --git a/code/nel/samples/3d/shape_viewer/CMakeLists.txt b/code/nel/samples/3d/shape_viewer/CMakeLists.txt index 9f337e933..e0544ef1e 100644 --- a/code/nel/samples/3d/shape_viewer/CMakeLists.txt +++ b/code/nel/samples/3d/shape_viewer/CMakeLists.txt @@ -1,14 +1,16 @@ FILE(GLOB SRC *.cpp) -ADD_EXECUTABLE(nl_sample_shapeview ${SRC}) +ADD_EXECUTABLE(nl_sample_shapeview WIN32 ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nl_sample_shapeview ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc nel3d) +NL_DEFAULT_PROPS(nl_sample_shapeview "Samples, 3D: Font") +NL_ADD_RUNTIME_FLAGS(nl_sample_shapeview) + IF(WIN32) SET_TARGET_PROPERTIES(nl_sample_shapeview PROPERTIES LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - LINK_FLAGS "/SUBSYSTEM:WINDOWS" PROJECT_LABEL "Samples, 3D: Shape Viewer") ENDIF(WIN32) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) diff --git a/code/nel/samples/georges/CMakeLists.txt b/code/nel/samples/georges/CMakeLists.txt index b7ebc962e..abbeb60af 100644 --- a/code/nel/samples/georges/CMakeLists.txt +++ b/code/nel/samples/georges/CMakeLists.txt @@ -6,12 +6,9 @@ ADD_DEFINITIONS(-DGF_DIR="\\"${NL_SHARE_PREFIX}/nl_sample_georges/\\"") INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nl_sample_georges ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelgeorges nelmisc) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_georges PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - PROJECT_LABEL "Samples: Georges") -ENDIF(WIN32) +NL_DEFAULT_PROPS(nl_sample_georges "Samples: Georges") +NL_ADD_RUNTIME_FLAGS(nl_sample_georges) + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) INSTALL(TARGETS nl_sample_georges RUNTIME DESTINATION bin COMPONENT samplesgeorges) diff --git a/code/nel/samples/misc/command/CMakeLists.txt b/code/nel/samples/misc/command/CMakeLists.txt index 9f471c4c0..b49cc0511 100644 --- a/code/nel/samples/misc/command/CMakeLists.txt +++ b/code/nel/samples/misc/command/CMakeLists.txt @@ -4,12 +4,9 @@ ADD_EXECUTABLE(nl_sample_command ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nl_sample_command ${PLATFORM_LINKFLAGS} nelmisc) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_command PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - PROJECT_LABEL "Samples, Misc: Commands") -ENDIF(WIN32) +NL_DEFAULT_PROPS(nl_sample_command "Samples, Misc: Commands") +NL_ADD_RUNTIME_FLAGS(nl_sample_command) + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) INSTALL(TARGETS nl_sample_command RUNTIME DESTINATION bin COMPONENT samplesmisc) diff --git a/code/nel/samples/misc/configfile/CMakeLists.txt b/code/nel/samples/misc/configfile/CMakeLists.txt index bf71cf7fc..e0b16b701 100644 --- a/code/nel/samples/misc/configfile/CMakeLists.txt +++ b/code/nel/samples/misc/configfile/CMakeLists.txt @@ -6,12 +6,9 @@ ADD_DEFINITIONS(-DNL_SAMPLE_CFG="\\"${NL_SHARE_PREFIX}/nl_sample_configfile/\\"" INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nl_sample_configfile ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_configfile PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - PROJECT_LABEL "Samples, Misc: Config Files") -ENDIF(WIN32) +NL_DEFAULT_PROPS(nl_sample_configfile "Samples, Misc: Config Files") +NL_ADD_RUNTIME_FLAGS(nl_sample_configfile) + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) INSTALL(TARGETS nl_sample_configfile RUNTIME DESTINATION bin COMPONENT samplesmisc) diff --git a/code/nel/samples/misc/debug/CMakeLists.txt b/code/nel/samples/misc/debug/CMakeLists.txt index 66a06a968..4b0569045 100644 --- a/code/nel/samples/misc/debug/CMakeLists.txt +++ b/code/nel/samples/misc/debug/CMakeLists.txt @@ -1,18 +1,12 @@ FILE(GLOB SRC *.cpp) -DECORATE_NEL_LIB("nelmisc") -SET(NLMISC_LIB ${LIBNAME}) - ADD_EXECUTABLE(nl_sample_debug ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nl_sample_debug ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_debug PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - PROJECT_LABEL "Samples, Misc: Debugging") -ENDIF(WIN32) +NL_DEFAULT_PROPS(nl_sample_debug "Samples, Misc: Debugging") +NL_ADD_RUNTIME_FLAGS(nl_sample_debug) + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) INSTALL(TARGETS nl_sample_debug RUNTIME DESTINATION bin COMPONENT samplesmisc) diff --git a/code/nel/samples/misc/i18n/CMakeLists.txt b/code/nel/samples/misc/i18n/CMakeLists.txt index 9136a2503..9fc44db13 100644 --- a/code/nel/samples/misc/i18n/CMakeLists.txt +++ b/code/nel/samples/misc/i18n/CMakeLists.txt @@ -6,12 +6,9 @@ ADD_DEFINITIONS(-DNL_LANG_DATA="\\"${NL_SHARE_PREFIX}/nl_sample_i18n/\\"") INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nl_sample_i18n ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_i18n PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - PROJECT_LABEL "Samples, Misc: I18N") -ENDIF(WIN32) +NL_DEFAULT_PROPS(nl_sample_i18n "Samples, Misc: I18N") +NL_ADD_RUNTIME_FLAGS(nl_sample_i18n) + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) INSTALL(TARGETS nl_sample_i18n RUNTIME DESTINATION bin COMPONENT samplesmisc) diff --git a/code/nel/samples/misc/log/CMakeLists.txt b/code/nel/samples/misc/log/CMakeLists.txt index 6ee6ad078..7f7085c83 100644 --- a/code/nel/samples/misc/log/CMakeLists.txt +++ b/code/nel/samples/misc/log/CMakeLists.txt @@ -1,18 +1,12 @@ FILE(GLOB SRC *.cpp) -DECORATE_NEL_LIB("nelmisc") -SET(NLMISC_LIB ${LIBNAME}) - ADD_EXECUTABLE(nl_sample_log ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nl_sample_log ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_log PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - PROJECT_LABEL "Samples, Misc: Logging") -ENDIF(WIN32) +NL_DEFAULT_PROPS(nl_sample_log "Samples, Misc: Logging") +NL_ADD_RUNTIME_FLAGS(nl_sample_log) + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) INSTALL(TARGETS nl_sample_log RUNTIME DESTINATION bin COMPONENT samplesmisc) diff --git a/code/nel/samples/misc/strings/CMakeLists.txt b/code/nel/samples/misc/strings/CMakeLists.txt index 72b448b78..c0942fc2d 100644 --- a/code/nel/samples/misc/strings/CMakeLists.txt +++ b/code/nel/samples/misc/strings/CMakeLists.txt @@ -4,12 +4,9 @@ ADD_EXECUTABLE(nl_sample_strings ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nl_sample_strings ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_strings PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - PROJECT_LABEL "Samples, Misc: Strings") -ENDIF(WIN32) +NL_DEFAULT_PROPS(nl_sample_strings "Samples, Misc: Strings") +NL_ADD_RUNTIME_FLAGS(nl_sample_strings) + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) INSTALL(TARGETS nl_sample_strings RUNTIME DESTINATION bin COMPONENT samplesmisc) diff --git a/code/nel/samples/misc/types_check/CMakeLists.txt b/code/nel/samples/misc/types_check/CMakeLists.txt index d03fa394a..229a085f7 100644 --- a/code/nel/samples/misc/types_check/CMakeLists.txt +++ b/code/nel/samples/misc/types_check/CMakeLists.txt @@ -1,18 +1,11 @@ FILE(GLOB SRC *.cpp) -DECORATE_NEL_LIB("nelmisc") -SET(NLMISC_LIB ${LIBNAME}) - ADD_EXECUTABLE(nl_sample_types_check ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nl_sample_types_check ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} ${NLMISC_LIB}) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_types_check PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - ) -ENDIF(WIN32) +TARGET_LINK_LIBRARIES(nl_sample_types_check ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc) +NL_ADD_RUNTIME_FLAGS(nl_sample_types_check) + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -INSTALL(TARGETS nl_sample_types_check RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT samplesmisc) +INSTALL(TARGETS nl_sample_types_check RUNTIME DESTINATION bin COMPONENT samplesmisc) diff --git a/code/nel/samples/net/udp/CMakeLists.txt b/code/nel/samples/net/udp/CMakeLists.txt index 251211546..8b0511728 100644 --- a/code/nel/samples/net/udp/CMakeLists.txt +++ b/code/nel/samples/net/udp/CMakeLists.txt @@ -2,35 +2,22 @@ FILE(GLOB SRC *.cpp) ADD_EXECUTABLE(nl_sample_udpclient client.cpp graph.cpp graph.h simlag.cpp simlag.h) -IF(WIN32) - ADD_EXECUTABLE(nl_sample_udpserver WIN32 bench_service.cpp receive_task.cpp receive_task.h) -ELSE(WIN32) - ADD_EXECUTABLE(nl_sample_udpserver bench_service.cpp receive_task.cpp receive_task.h) -ENDIF(WIN32) +ADD_EXECUTABLE(nl_sample_udpserver WIN32 bench_service.cpp receive_task.cpp receive_task.h) ADD_DEFINITIONS(-DUDP_DIR="\\"${NL_SHARE_PREFIX}/nl_sample_udp/\\"") IF(WITH_3D) ADD_DEFINITIONS(-DUSE_3D) - DECORATE_NEL_LIB("nel3d") - SET(NL3D_LIB ${LIBNAME}) -ELSE(WITH_3D) - SET(NL3D_LIB "") ENDIF(WITH_3D) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nl_sample_udpclient ${PLATFORM_LINKFLAGS} nelmisc nelnet nel3d) TARGET_LINK_LIBRARIES(nl_sample_udpserver ${PLATFORM_LINKFLAGS} nelmisc nelnet) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_udpclient PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - PROJECT_LABEL "Samples, Net, UDP: UDP Client") - SET_TARGET_PROPERTIES(nl_sample_udpserver PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - PROJECT_LABEL "Samples, Net, UDP: UDP Server") -ENDIF(WIN32) +NL_DEFAULT_PROPS(nl_sample_udpclient "Samples, Net, UDP: UDP Client") +NL_DEFAULT_PROPS(nl_sample_udpserver "Samples, Net, UDP: UDP Server") +NL_ADD_RUNTIME_FLAGS(nl_sample_udpclient) +NL_ADD_RUNTIME_FLAGS(nl_sample_udpserver) + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) INSTALL(TARGETS nl_sample_udpclient nl_sample_udpserver RUNTIME DESTINATION bin COMPONENT samplesnet) diff --git a/code/nel/src/3d/CMakeLists.txt b/code/nel/src/3d/CMakeLists.txt index d32a1a6a5..82acc0f91 100644 --- a/code/nel/src/3d/CMakeLists.txt +++ b/code/nel/src/3d/CMakeLists.txt @@ -662,26 +662,15 @@ SOURCE_GROUP(Shadows FILES shadow_poly_receiver.cpp ../../include/nel/3d/shadow_poly_receiver.h) -IF(NOT WIN32) - ADD_LIBRARY(nel3d SHARED ${SRC}) - CONFIGURE_FILE(nel-3d.pc.in nel-3d.pc) - INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/nel-3d.pc" DESTINATION lib/pkgconfig) -ELSE(NOT WIN32) - ADD_LIBRARY(nel3d STATIC ${SRC}) -ENDIF(NOT WIN32) +NL_TARGET_LIB(nel3d ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${FREETYPE_INCLUDE_DIRS} ${JPEG_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nel3d nelmisc ${FREETYPE_LIBRARY} ${JPEG_LIBRARY}) -SET_TARGET_PROPERTIES(nel3d PROPERTIES - VERSION ${NL_VERSION} - SOVERSION ${NL_VERSION_MAJOR} - PROJECT_LABEL "Library: NeL 3D") +NL_DEFAULT_PROPS(nel3d "Library: NeL 3D") + +NL_ADD_LIB_SUFFIX(nel3d) IF(WIN32) - SET_TARGET_PROPERTIES(nel3d PROPERTIES - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r") - IF(JPEG_FOUND) ADD_DEFINITIONS(/DUSE_JPEG) ENDIF(JPEG_FOUND) @@ -697,6 +686,7 @@ IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nel3d ${CMAKE_CURRENT_SOURCE_DIR}/std3d.h ${CMAKE_CURRENT_SOURCE_DIR}/std3d.cpp) ENDIF(WITH_PCH) +NL_GEN_PC(nel-3d.pc) INSTALL(TARGETS nel3d LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) ADD_SUBDIRECTORY(driver) diff --git a/code/nel/src/3d/driver/direct3d/CMakeLists.txt b/code/nel/src/3d/driver/direct3d/CMakeLists.txt index f007893db..0bf8aa40f 100644 --- a/code/nel/src/3d/driver/direct3d/CMakeLists.txt +++ b/code/nel/src/3d/driver/direct3d/CMakeLists.txt @@ -1,23 +1,15 @@ FILE(GLOB SRC *.cpp *.h *.def) -DECORATE_NEL_LIB("nel_drv_direct3d_win") -SET(NLDRV_D3D_LIB ${LIBNAME}) -DECORATE_NEL_LIB("nel3d") -SET(NL3D_LIB ${LIBNAME}) - -ADD_LIBRARY(nel_drv_direct3d_win SHARED ${SRC}) +NL_TARGET_DRIVER(nel_drv_direct3d_win ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${FREETYPE_INC} ${DXSDK_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nel_drv_direct3d_win nel3d ${LIBXML2_LIBRARIES} ${FREETYPE_LIB} ${DXSDK_D3DX9_LIBRARY} ${DXSDK_D3D9_LIBRARY} ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY}) -SET_TARGET_PROPERTIES(nel_drv_direct3d_win PROPERTIES - VERSION ${NL_VERSION} - SOVERSION ${NL_VERSION_MAJOR} - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r" - PROJECT_LABEL "Driver, Video: Direct3D") + +NL_DEFAULT_PROPS(nel_drv_direct3d_win "Driver, Video: Direct3D") +NL_ADD_RUNTIME_FLAGS(nel_drv_direct3d_win) +NL_ADD_LIB_SUFFIX(nel_drv_direct3d_win) + ADD_DEFINITIONS(/Ddriver_direct3d_EXPORTS) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) @@ -26,7 +18,7 @@ IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nel_drv_direct3d_win ${CMAKE_CURRENT_SOURCE_DIR}/stddirect3d.h ${CMAKE_CURRENT_SOURCE_DIR}/stddirect3d.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS nel_drv_direct3d_win LIBRARY DESTINATION lib RUNTIME DESTINATION bin COMPONENT drivers3d) +INSTALL(TARGETS nel_drv_direct3d_win LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin COMPONENT drivers3d) IF(WITH_MAXPLUGIN) INSTALL(TARGETS nel_drv_direct3d_win RUNTIME DESTINATION maxplugin COMPONENT drivers3d) ENDIF(WITH_MAXPLUGIN) diff --git a/code/nel/src/3d/driver/opengl/CMakeLists.txt b/code/nel/src/3d/driver/opengl/CMakeLists.txt index 6789bfaa0..84788891e 100644 --- a/code/nel/src/3d/driver/opengl/CMakeLists.txt +++ b/code/nel/src/3d/driver/opengl/CMakeLists.txt @@ -10,23 +10,17 @@ ELSE(WIN32) SET(NLDRV_OGL_LIB "nel_drv_opengl") ENDIF(WIN32) -ADD_LIBRARY(${NLDRV_OGL_LIB} SHARED ${SRC}) +NL_TARGET_DRIVER(${NLDRV_OGL_LIB} ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} nel3d nelmisc ${OPENGL_LIBRARIES}) -SET_TARGET_PROPERTIES(${NLDRV_OGL_LIB} PROPERTIES - VERSION ${NL_VERSION} - SOVERSION ${NL_VERSION_MAJOR} - PROJECT_LABEL "Driver, Video: OpenGL") +NL_DEFAULT_PROPS(${NLDRV_OGL_LIB} "Driver, Video: OpenGL") +NL_ADD_LIB_SUFFIX(${NLDRV_OGL_LIB}) +NL_ADD_RUNTIME_FLAGS(${NLDRV_OGL_LIB}) IF(WIN32) INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY}) - SET_TARGET_PROPERTIES(${NLDRV_OGL_LIB} PROPERTIES - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r" - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}") ADD_DEFINITIONS(/DDRIVER_OPENGL_EXPORTS) ELSE(WIN32) IF(APPLE) @@ -61,7 +55,7 @@ IF(NOT WITH_COCOA AND WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(${NLDRV_OGL_LIB} ${CMAKE_CURRENT_SOURCE_DIR}/stdopengl.h ${CMAKE_CURRENT_SOURCE_DIR}/stdopengl.cpp) ENDIF(NOT WITH_COCOA AND WITH_PCH) -INSTALL(TARGETS ${NLDRV_OGL_LIB} LIBRARY DESTINATION lib RUNTIME DESTINATION bin COMPONENT drivers3d) +INSTALL(TARGETS ${NLDRV_OGL_LIB} LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin COMPONENT drivers3d) IF(WITH_MAXPLUGIN) INSTALL(TARGETS ${NLDRV_OGL_LIB} RUNTIME DESTINATION maxplugin COMPONENT drivers3d) ENDIF(WITH_MAXPLUGIN) diff --git a/code/nel/src/georges/CMakeLists.txt b/code/nel/src/georges/CMakeLists.txt index 7b46520eb..07bdeac61 100644 --- a/code/nel/src/georges/CMakeLists.txt +++ b/code/nel/src/georges/CMakeLists.txt @@ -4,26 +4,13 @@ FILE(GLOB PUB_H ../../include/nel/georges/*.h) SOURCE_GROUP(headers FILES ${PRIV_H} ${PUB_H}) -IF(NOT WIN32) - ADD_LIBRARY(nelgeorges SHARED ${SRC}) - CONFIGURE_FILE(nel-georges.pc.in nel-georges.pc) - INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/nel-georges.pc" DESTINATION lib/pkgconfig) -ELSE(NOT WIN32) - ADD_LIBRARY(nelgeorges STATIC ${SRC}) -ENDIF(NOT WIN32) +NL_TARGET_LIB(nelgeorges ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nelgeorges nelmisc) -SET_TARGET_PROPERTIES(nelgeorges PROPERTIES - VERSION ${NL_VERSION} - SOVERSION ${NL_VERSION_MAJOR} - PROJECT_LABEL "Library: NeL Georges") +NL_DEFAULT_PROPS(nelgeorges "Library: NeL Georges") -IF(WIN32) - SET_TARGET_PROPERTIES(nelgeorges PROPERTIES - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r") -ENDIF(WIN32) +NL_ADD_LIB_SUFFIX(nelgeorges) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) @@ -31,4 +18,5 @@ IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nelgeorges ${CMAKE_CURRENT_SOURCE_DIR}/stdgeorges.h ${CMAKE_CURRENT_SOURCE_DIR}/stdgeorges.cpp) ENDIF(WITH_PCH) +NL_GEN_PC(nel-georges.pc) INSTALL(TARGETS nelgeorges LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) diff --git a/code/nel/src/ligo/CMakeLists.txt b/code/nel/src/ligo/CMakeLists.txt index c1ddd5b27..0ee8ac180 100644 --- a/code/nel/src/ligo/CMakeLists.txt +++ b/code/nel/src/ligo/CMakeLists.txt @@ -1,27 +1,14 @@ FILE(GLOB SRC *.cpp *.h) -IF(NOT WIN32) - ADD_LIBRARY(nelligo SHARED ${SRC}) - CONFIGURE_FILE(nel-ligo.pc.in nel-ligo.pc) - INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/nel-ligo.pc" DESTINATION lib/pkgconfig) -ELSE(NOT WIN32) - ADD_LIBRARY(nelligo STATIC ${SRC}) -ENDIF(NOT WIN32) +NL_TARGET_LIB(nelligo ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nelligo ${LIBXML2_LIBRARIES} nelmisc) -SET_TARGET_PROPERTIES(nelligo PROPERTIES - VERSION ${NL_VERSION} - SOVERSION ${NL_VERSION_MAJOR} - PROJECT_LABEL "Library: NeL Ligo") - -IF(WIN32) - SET_TARGET_PROPERTIES(nelligo PROPERTIES - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r") -ENDIF(WIN32) +NL_DEFAULT_PROPS(nelligo "Library: NeL Ligo") +NL_ADD_LIB_SUFFIX(nelligo) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +NL_GEN_PC(nel-ligo.pc) INSTALL(TARGETS nelligo LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) diff --git a/code/nel/src/logic/CMakeLists.txt b/code/nel/src/logic/CMakeLists.txt index 806190233..0f01f0641 100644 --- a/code/nel/src/logic/CMakeLists.txt +++ b/code/nel/src/logic/CMakeLists.txt @@ -1,23 +1,12 @@ FILE(GLOB SRC *.cpp *.h) -IF(NOT WIN32) - ADD_LIBRARY(nellogic SHARED ${SRC}) -ELSE(NOT WIN32) - ADD_LIBRARY(nellogic STATIC ${SRC}) -ENDIF(NOT WIN32) +NL_TARGET_LIB(nellogic ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nellogic ${LIBXML2_LIBRARIES} nelmisc nelnet) -SET_TARGET_PROPERTIES(nellogic PROPERTIES - VERSION ${NL_VERSION} - SOVERSION ${NL_VERSION_MAJOR} - PROJECT_LABEL "Library: NeL Logic") +NL_DEFAULT_PROPS(nellogic "Library: NeL Logic") -IF(WIN32) - SET_TARGET_PROPERTIES(nellogic PROPERTIES - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r") -ENDIF(WIN32) +NL_ADD_LIB_SUFFIX(nellogic) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) diff --git a/code/nel/src/misc/CMakeLists.txt b/code/nel/src/misc/CMakeLists.txt index ab523536c..bb404f88a 100644 --- a/code/nel/src/misc/CMakeLists.txt +++ b/code/nel/src/misc/CMakeLists.txt @@ -1,12 +1,6 @@ FILE(GLOB SRC *.cpp *.h config_file/*.cpp config_file/*.h) -IF(NOT WIN32) - ADD_LIBRARY(nelmisc SHARED ${SRC}) - CONFIGURE_FILE(nel-misc.pc.in nel-misc.pc) - INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/nel-misc.pc" DESTINATION lib/pkgconfig) -ELSE(NOT WIN32) - ADD_LIBRARY(nelmisc STATIC ${SRC}) -ENDIF(NOT WIN32) +NL_TARGET_LIB(nelmisc ${SRC}) IF(WITH_GTK) IF(GTK2_FOUND) @@ -24,17 +18,9 @@ ENDIF(JPEG_FOUND) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${PNG_INCLUDE_DIR} config_file) TARGET_LINK_LIBRARIES(nelmisc ${LIBXML2_LIBRARIES} ${PNG_LIBRARIES} ${WINSOCK2_LIB}) -SET_TARGET_PROPERTIES(nelmisc PROPERTIES - VERSION ${NL_VERSION} - SOVERSION ${NL_VERSION_MAJOR} - PROJECT_LABEL "Library: NeL Misc") +NL_DEFAULT_PROPS(nelmisc "Library: NeL Misc") -IF(WIN32) - SET_TARGET_PROPERTIES(nelmisc PROPERTIES - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r") - INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) -ENDIF(WIN32) +NL_ADD_LIB_SUFFIX(nelmisc) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) @@ -42,4 +28,5 @@ IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nelmisc ${CMAKE_CURRENT_SOURCE_DIR}/stdmisc.h ${CMAKE_CURRENT_SOURCE_DIR}/stdmisc.cpp) ENDIF(WITH_PCH) +NL_GEN_PC(nel-misc.pc) INSTALL(TARGETS nelmisc LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) diff --git a/code/nel/src/net/CMakeLists.txt b/code/nel/src/net/CMakeLists.txt index 712ce0e5a..fa6e35e05 100644 --- a/code/nel/src/net/CMakeLists.txt +++ b/code/nel/src/net/CMakeLists.txt @@ -2,18 +2,7 @@ FILE(GLOB SRC "*.cpp") FILE(GLOB NET_MANAGER "net_manager.*") LIST(REMOVE_ITEM SRC ${NET_MANAGER}) -DECORATE_NEL_LIB("nelmisc") -SET(NLMISC_LIB ${LIBNAME}) -DECORATE_NEL_LIB("nelnet") -SET(NLNET_LIB ${LIBNAME}) - -IF(NOT WIN32) - ADD_LIBRARY(nelnet SHARED ${SRC}) - CONFIGURE_FILE(nel-net.pc.in nel-net.pc) - INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/nel-net.pc" DESTINATION lib/pkgconfig) -ELSE(NOT WIN32) - ADD_LIBRARY(nelnet STATIC ${SRC}) -ENDIF(NOT WIN32) +NL_TARGET_LIB(nelnet ${SRC}) IF(WITH_GTK) IF(GTK2_FOUND) @@ -24,22 +13,16 @@ ENDIF(WITH_GTK) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nelnet ${LIBXML2_LIBRARIES} ${NLMISC_LIB}) -SET_TARGET_PROPERTIES(nelnet PROPERTIES - VERSION ${NL_VERSION} - SOVERSION ${NL_VERSION_MAJOR} - PROJECT_LABEL "Library: NeL Net") +TARGET_LINK_LIBRARIES(nelnet ${LIBXML2_LIBRARIES} nelmisc) +NL_DEFAULT_PROPS(nelnet "Library: NeL Net") -IF(WIN32) - SET_TARGET_PROPERTIES(${NLNET_LIB} PROPERTIES - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r") -ENDIF(WIN32) +NL_ADD_LIB_SUFFIX(nelnet) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) IF(WITH_PCH) - ADD_NATIVE_PRECOMPILED_HEADER(${NLNET_LIB} ${CMAKE_CURRENT_SOURCE_DIR}/stdnet.h ${CMAKE_CURRENT_SOURCE_DIR}/stdnet.cpp) + ADD_NATIVE_PRECOMPILED_HEADER(nelnet ${CMAKE_CURRENT_SOURCE_DIR}/stdnet.h ${CMAKE_CURRENT_SOURCE_DIR}/stdnet.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS ${NLNET_LIB} LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) +NL_GEN_PC(nel-net.pc) +INSTALL(TARGETS nelnet LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) diff --git a/code/nel/src/pacs/CMakeLists.txt b/code/nel/src/pacs/CMakeLists.txt index 722f151d9..4f1c5e48d 100644 --- a/code/nel/src/pacs/CMakeLists.txt +++ b/code/nel/src/pacs/CMakeLists.txt @@ -1,27 +1,17 @@ FILE(GLOB SRC *.cpp *.h) -IF(NOT WIN32) - ADD_LIBRARY(nelpacs SHARED ${SRC}) - CONFIGURE_FILE(nel-pacs.pc.in nel-pacs.pc) - INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/nel-pacs.pc" DESTINATION lib/pkgconfig) -ELSE(NOT WIN32) - ADD_LIBRARY(nelpacs STATIC ${SRC}) -ENDIF(NOT WIN32) +NL_TARGET_LIB(nelpacs ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nelpacs ${LIBXML2_LIBRARIES} nelmisc) -SET_TARGET_PROPERTIES(nelpacs PROPERTIES - VERSION ${NL_VERSION} - SOVERSION ${NL_VERSION_MAJOR} - PROJECT_LABEL "Library: NeL PACS") +NL_DEFAULT_PROPS(nelpacs "Library: NeL PACS") ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -IF(WIN32) - SET_TARGET_PROPERTIES(nelpacs PROPERTIES DEBUG_POSTFIX "_d" RELEASE_POSTFIX "_r") -ENDIF(WIN32) +NL_ADD_LIB_SUFFIX(nelpacs) IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nelpacs ${CMAKE_CURRENT_SOURCE_DIR}/stdpacs.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpacs.cpp) ENDIF(WITH_PCH) +NL_GEN_PC(nel-pacs.pc) INSTALL(TARGETS nelpacs LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) diff --git a/code/nel/src/sound/CMakeLists.txt b/code/nel/src/sound/CMakeLists.txt index 36d43c182..28fe90c71 100644 --- a/code/nel/src/sound/CMakeLists.txt +++ b/code/nel/src/sound/CMakeLists.txt @@ -6,32 +6,20 @@ IF(APPLE) SET(SRC ${SRC} driver/sound_driver.cpp driver/buffer.cpp) ENDIF(APPLE) -IF(NOT WIN32) - ADD_LIBRARY(nelsound SHARED ${SRC}) - CONFIGURE_FILE(nel-sound.pc.in nel-sound.pc) - INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/nel-sound.pc" DESTINATION lib/pkgconfig) -ELSE(NOT WIN32) - ADD_LIBRARY(nelsound STATIC ${SRC}) -ENDIF(NOT WIN32) +nl_target_lib(nelsound ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nelsound ${LIBXML2_LIBRARIES} nelligo nelgeorges nel3d) -SET_TARGET_PROPERTIES(nelsound PROPERTIES - VERSION ${NL_VERSION} - SOVERSION ${NL_VERSION_MAJOR} - PROJECT_LABEL "Library: NeL Sound") +nl_default_props(nelsound "Library: NeL Sound") ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -IF(WIN32) - SET_TARGET_PROPERTIES(nelsound PROPERTIES - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r") -ENDIF(WIN32) +nl_add_lib_suffix(nelsound) IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nelsound ${CMAKE_CURRENT_SOURCE_DIR}/stdsound.h ${CMAKE_CURRENT_SOURCE_DIR}/stdsound.cpp) ENDIF(WITH_PCH) +nl_gen_pc(nel-sound.pc) INSTALL(TARGETS nelsound LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) ADD_SUBDIRECTORY(driver) diff --git a/code/nel/src/sound/driver/CMakeLists.txt b/code/nel/src/sound/driver/CMakeLists.txt index 6ac614a69..3c504a20f 100644 --- a/code/nel/src/sound/driver/CMakeLists.txt +++ b/code/nel/src/sound/driver/CMakeLists.txt @@ -1,22 +1,13 @@ FILE(GLOB SRC *.cpp *.h) -IF(NOT WIN32) - ADD_LIBRARY(nelsnd_lowlevel SHARED ${SRC}) -ELSE(NOT WIN32) - ADD_LIBRARY(nelsnd_lowlevel STATIC ${SRC}) -ENDIF(NOT WIN32) +nl_target_lib(nelsnd_lowlevel ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nelsnd_lowlevel ${LIBXML2_LIBRARIES} nelsound) -SET_TARGET_PROPERTIES(nelsnd_lowlevel PROPERTIES - VERSION ${NL_VERSION} - SOVERSION ${NL_VERSION_MAJOR} - PROJECT_LABEL "Library: NeL Sound Lowlevel") +nl_default_props(nelsnd_lowlevel "Library: NeL Sound Lowlevel") ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -IF(WIN32) - SET_TARGET_PROPERTIES(nelsnd_lowlevel PROPERTIES DEBUG_POSTFIX "_d" RELEASE_POSTFIX "_r") -ENDIF(WIN32) +nl_add_lib_suffix(nelsnd_lowlevel) INSTALL(TARGETS nelsnd_lowlevel LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) diff --git a/code/nel/src/sound/driver/openal/CMakeLists.txt b/code/nel/src/sound/driver/openal/CMakeLists.txt index cb180898c..401a8d1ea 100644 --- a/code/nel/src/sound/driver/openal/CMakeLists.txt +++ b/code/nel/src/sound/driver/openal/CMakeLists.txt @@ -1,12 +1,12 @@ FILE(GLOB SRC *.cpp *.h) -ADD_LIBRARY(nel_drv_openal SHARED ${SRC}) +NL_TARGET_DRIVER(nel_drv_openal ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${OPENAL_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nel_drv_openal ${LIBXML2_LIBRARIES} ${OPENAL_LIBRARY} nelsnd_lowlevel) -SET_TARGET_PROPERTIES(nel_drv_openal PROPERTIES - VERSION ${NL_VERSION} - SOVERSION ${NL_VERSION_MAJOR}) +NL_DEFAULT_PROPS(nel_drv_openal "Driver, Sound: OpenAL") +NL_ADD_LIB_SUFFIX(nel_drv_openal) +NL_ADD_RUNTIME_FLAGS(nel_drv_openal) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) IF(WIN32) @@ -14,13 +14,6 @@ IF(WIN32) FIND_PACKAGE(EFXUtil) INCLUDE_DIRECTORIES(${EFXUTIL_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nel_drv_openal ${EFXUTIL_LIBRARY}) - - SET_TARGET_PROPERTIES(nel_drv_openal PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r" - PROJECT_LABEL "Driver, Sound: OpenAL") ENDIF(WIN32) IF(WITH_PCH) diff --git a/code/nel/tools/nel_unit_test/CMakeLists.txt b/code/nel/tools/nel_unit_test/CMakeLists.txt index 96fe4b110..66fefc76a 100644 --- a/code/nel/tools/nel_unit_test/CMakeLists.txt +++ b/code/nel/tools/nel_unit_test/CMakeLists.txt @@ -1,22 +1,12 @@ FILE(GLOB SRC *.cpp *.h) -DECORATE_NEL_LIB("nelmisc") -SET(NLMISC_LIB ${LIBNAME}) -DECORATE_NEL_LIB("nelnet") -SET(NLNET_LIB ${LIBNAME}) -DECORATE_NEL_LIB("nelligo") -SET(NLLIGO_LIB ${LIBNAME}) - ADD_EXECUTABLE(nel_unit_test ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${CPPTEST_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nel_unit_test ${LIBXML2_LIBRARIES} ${CPPTEST_LIBRARY} ${PLATFORM_LINKFLAGS} nelmisc nelnet nelligo) -IF(WIN32) - SET_TARGET_PROPERTIES(nel_unit_test PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - PROJECT_LABEL "Unit Tests") -ENDIF(WIN32) +NL_DEFAULT_PROPS(nel_unit_test "Unit Tests") +NL_ADD_RUNTIME_FLAGS(nel_unit_test) + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) ADD_DEFINITIONS(-DNEL_UNIT_BASE="\\"${PROJECT_SOURCE_DIR}/tools/nel_unit_test/\\"") From b64b7467d92298cbf95295d9f35539c01ef3e00e Mon Sep 17 00:00:00 2001 From: rti Date: Wed, 14 Jul 2010 20:40:24 +0200 Subject: [PATCH 25/52] Fixed: #1020 GLWindow, create, destroy, create would lead to creating two autorelease pools --- .../src/3d/driver/opengl/mac/cocoa_adapter.mm | 101 ++++++++++++++---- 1 file changed, 78 insertions(+), 23 deletions(-) diff --git a/code/nel/src/3d/driver/opengl/mac/cocoa_adapter.mm b/code/nel/src/3d/driver/opengl/mac/cocoa_adapter.mm index 9ad145e1b..029617d7d 100644 --- a/code/nel/src/3d/driver/opengl/mac/cocoa_adapter.mm +++ b/code/nel/src/3d/driver/opengl/mac/cocoa_adapter.mm @@ -25,7 +25,7 @@ #include "cocoa_event_emitter.h" #include "cocoa_opengl_view.h" -// Virtual key codes are only defined here. We still do not need to link carbon. +// Virtual key codes are only defined here. Still do not need to link carbon. // see: http://lists.apple.com/archives/Cocoa-dev/2009/May/msg01180.html #include @@ -33,6 +33,27 @@ namespace NL3D { namespace MAC { +// This cocoa adapter can be used in two environments: +// First: There is no other code which creates the NSApplication object, so +// NeL is completely in charge of starting and setting up the application. +// In this case, the NSAutoreleasePool needed to handle the cocoa style memory +// management is created by this code. +// Second: There is already a NSApplication set up. This could be the case if +// NeL is used for example in a Qt widget. So Qt already created all the +// NSApplication infrastructure, so it is not set up by this code again! +// +// Thats why, the g_pool variable (containing a pointer to the NSAutoreleasePool +// created by this code) can be used to check whether NeL created the +// NSApplication infrastructure itself or not. +// +// WARNING: +// Currently the NSApplication infrastructure is automatically created with the +// call to createWindow(). So if for example Qt already created NSApplication, +// createWindow() must not be called. Instead, setDisplay() can be provided with +// a window handle (on Mac OS Cocoa Qt this is a NSView*). In this case, this +// cocoa adapter will skip the NSApplication setup and embed itself into the +// provided view running in the already set up application. + static NSAutoreleasePool* g_pool = nil; /* TODO move to event emitter class @@ -40,6 +61,7 @@ static NSAutoreleasePool* g_pool = nil; static bool g_emulateRawMode = false; static int g_bufferSize[2] = { 0, 0 }; +/// setup an apple style application menu (located at the top bar of the screen) static void setupApplicationMenu() { NSMenu* menu; @@ -98,6 +120,29 @@ static void setupApplicationMenu() [[NSApp mainMenu] addItem:menuItem]; } +/// set up the basic NSApplication and NSAutoreleasePool needed for Cocoa +static bool setupNSApplication() +{ + // if the pool was already created, return an error + if(g_pool) + return false; + + // create a pool, cocoa code would leak memory otherwise + g_pool = [[NSAutoreleasePool alloc] init]; + + // init the application object + [NSApplication sharedApplication]; + + // create the menu in the top screen bar + setupApplicationMenu(); + + // finish the application launching + [NSApp finishLaunching]; + + return true; +} + +/// setup an open gl view and embed it in the provided parent view static void setupGLView(NSView* superview) { /* @@ -169,20 +214,13 @@ bool unInit() return true; } +/// setup the basic cocoa app infrastructure and create a window nlWindow createWindow(const GfxMode& mode) { - // create a pool, cocoa code would leak memory otherwise - g_pool = [[NSAutoreleasePool alloc] init]; + if(!setupNSApplication()) + nlerror("createWindow must not be called before the old window was " + "destroyed using destroyWindow()!"); - // init the application object - [NSApplication sharedApplication]; - - // create the menu in the top screen bar - setupApplicationMenu(); - - // tell the application that we are running now - [NSApp finishLaunching]; - // describe how the window should look like and behave unsigned int styleMask = NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask; @@ -201,7 +239,7 @@ nlWindow createWindow(const GfxMode& mode) // enable mouse move events, NeL wants them [window setAcceptsMouseMovedEvents:YES]; - // there are no overlapping subviews, so we can use the magical optimization! + // there are no overlapping subviews, can use the magical optimization :) [window useOptimizedDrawing:YES]; // put the window to the front and make it the key window @@ -217,6 +255,7 @@ nlWindow createWindow(const GfxMode& mode) return view; } +/// destroy the given window and uninitialize the cocoa application bool destroyWindow(nlWindow wnd) { NSView* view = (NSView*)wnd; @@ -229,10 +268,12 @@ bool destroyWindow(nlWindow wnd) // release the pool [g_pool release]; + g_pool = nil; return true; } +/// set the displays settings, if no win is provided, a new one will be created nlWindow setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool resizeable) { NSView* view = (NSView*)wnd; @@ -247,6 +288,7 @@ nlWindow setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool resizeabl return view; } +/// switch between fullscreen and windowed mode bool setWindowStyle(nlWindow wnd, bool fullscreen) { if(wnd == EmptyWindow) @@ -315,7 +357,7 @@ bool setWindowStyle(nlWindow wnd, bool fullscreen) return true; } - +/// get the current mode of the screen void getCurrentScreenMode(nlWindow wnd, GfxMode& mode) { NSView* superview = (NSView*)wnd; @@ -347,6 +389,7 @@ void getCurrentScreenMode(nlWindow wnd, GfxMode& mode) } } +/// get the size of the window's content area void getWindowSize(nlWindow wnd, uint32 &width, uint32 &height) { NSView* superview = (NSView*)wnd; @@ -378,6 +421,7 @@ void getWindowSize(nlWindow wnd, uint32 &width, uint32 &height) } } +/// set the size of the window's content area void setWindowSize(nlWindow wnd, uint32 width, uint32 height) { NSView* superview = (NSView*)wnd; @@ -398,8 +442,8 @@ void setWindowSize(nlWindow wnd, uint32 width, uint32 height) } else { - // there is only a pool if nel created the window itself assuming that - // nel is also in charge of the main loop + // there is only a pool if NeL created the window itself + // else, the window is not NeL's, so it must not be changed if(g_pool) { NSWindow* window = [view window]; @@ -421,7 +465,7 @@ void setWindowSize(nlWindow wnd, uint32 width, uint32 height) g_bufferSize[1] = height; } - +/// get the position of the window void getWindowPos(nlWindow wnd, sint32 &x, sint32 &y) { NSView* superview = (NSView*)wnd; @@ -448,6 +492,7 @@ void getWindowPos(nlWindow wnd, sint32 &x, sint32 &y) y = screenRect.size.height - windowRect.size.height - windowRect.origin.y; } +/// set the position of the window void setWindowPos(nlWindow wnd, sint32 x, sint32 y) { NSView* superview = (NSView*)wnd; @@ -466,6 +511,7 @@ void setWindowPos(nlWindow wnd, sint32 x, sint32 y) [window setFrameTopLeftPoint:NSMakePoint(x, y)]; } +/// set the windows title (not the title of the application) void setWindowTitle(nlWindow wnd, const ucstring& title) { NSView* superview = (NSView*)wnd; @@ -480,6 +526,7 @@ void showWindow(bool show) nldebug("show: %d - implement me!", show); } +/// make the opengl context the current one bool activate(nlWindow wnd) { NSView* superview = (NSView*)wnd; @@ -493,6 +540,7 @@ bool activate(nlWindow wnd) return true; } +/// flush current back buffer to screen void swapBuffers(nlWindow wnd) { NSView* superview = (NSView*)wnd; @@ -509,6 +557,7 @@ void setCapture(bool capture) // no need to capture } +/// show or hide the mouse cursor void showCursor(bool show) { // Mac OS manages a show/hide counter for the cursor, so hiding the cursor @@ -535,6 +584,7 @@ void showCursor(bool show) nlerror("cannot show / hide cursor"); } +/// set the mouse position void setMousePos(nlWindow wnd, float x, float y) { NSView* superview = (NSView*)wnd; @@ -571,7 +621,8 @@ void setMousePos(nlWindow wnd, float x, float y) TODO: this function has to be moved to a more central place to handle key mapping on mac x11 as well */ -NLMISC::TKey virtualKeycodeToNelKey(unsigned short keycode) +/// map from virtual key code to nel internal key code +static NLMISC::TKey virtualKeycodeToNelKey(unsigned short keycode) { switch(keycode) { @@ -702,7 +753,8 @@ NLMISC::TKey virtualKeycodeToNelKey(unsigned short keycode) TODO: this function has to be moved to a more central place to handle key mapping on mac x11 as well */ -NLMISC::TKeyButton modifierFlagsToNelKeyButton(unsigned int modifierFlags) +/// convert modifier key state to nel internal modifier key state +static NLMISC::TKeyButton modifierFlagsToNelKeyButton(unsigned int modifierFlags) { unsigned int buttons = 0; if (modifierFlags & NSControlKeyMask) buttons |= NLMISC::ctrlKeyButton; @@ -711,7 +763,8 @@ NLMISC::TKeyButton modifierFlagsToNelKeyButton(unsigned int modifierFlags) return (NLMISC::TKeyButton)buttons; } -bool isTextKeyEvent(NSEvent* event) +/// check whether a given event represents input text +static bool isTextKeyEvent(NSEvent* event) { // if there are no characters provided with this event, it is not a text event if([[event characters] length] == 0) @@ -763,16 +816,18 @@ bool isTextKeyEvent(NSEvent* event) return false; } +/// switch between raw mode emulation, see IEventEmitter::emulateMouseRawMode() void emulateMouseRawMode(bool enable) { g_emulateRawMode = enable; } +/// submit events provided by the application to an event server void submitEvents(NLMISC::CEventServer& server, bool allWindows, NLMISC::CCocoaEventEmitter* eventEmitter) { - // there is only a pool if nel created the window itself assuming that - // nel is also in charge of the main loop + // if there is a pool, NeL needs to clean it up + // otherwise, other code must have created it (for example Qt) if(g_pool) { // cocoa style memory cleanup @@ -780,7 +835,7 @@ void submitEvents(NLMISC::CEventServer& server, g_pool = [[NSAutoreleasePool alloc] init]; } - // we break if there was no event to handle + // break if there was no event to handle /* TODO maximum number of events processed in one update? */ while(true) { From 43f54a986698d8d8684907cb77d7bb8f32297180 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 15 Jul 2010 14:22:19 +0200 Subject: [PATCH 26/52] Changed: #1021 nel-misc.pc install file missing ubuntu / debian linux --- code/nel/CMakeModules/nel.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/nel/CMakeModules/nel.cmake b/code/nel/CMakeModules/nel.cmake index 9a03672be..a15c30633 100644 --- a/code/nel/CMakeModules/nel.cmake +++ b/code/nel/CMakeModules/nel.cmake @@ -4,7 +4,7 @@ ### MACRO(NL_GEN_PC name) IF(NOT WIN32) - CONFIGURE_FILE(${name}.in ${name}) + CONFIGURE_FILE(${name}.in "${CMAKE_CURRENT_BINARY_DIR}/${name}") INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/${name}" DESTINATION lib/pkgconfig) ENDIF(NOT WIN32) ENDMACRO(NL_GEN_PC) From 5c4d2dd26364bf13c47d78e10548dc196fa1a712 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 15 Jul 2010 19:41:13 +0200 Subject: [PATCH 27/52] Fixed: config_file generated files not openable --- code/nel/src/misc.vcproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/nel/src/misc.vcproj b/code/nel/src/misc.vcproj index 017efdf64..dfb888354 100644 --- a/code/nel/src/misc.vcproj +++ b/code/nel/src/misc.vcproj @@ -442,7 +442,7 @@ > Date: Thu, 15 Jul 2010 19:58:04 +0200 Subject: [PATCH 28/52] Changed: NLMISC::strupr is depreciated (use NLMISC::toUpper instead --- code/ryzom/client/src/client_sheets/item_sheet.cpp | 6 +++--- code/ryzom/client/src/client_sheets/sbrick_sheet.cpp | 2 +- code/ryzom/client/src/color_slot_manager.cpp | 5 ++--- code/ryzom/client/src/interface_v3/action_phrase_faber.cpp | 3 +-- code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp | 6 ++---- code/ryzom/client/src/interface_v3/macrocmd_key.cpp | 3 +-- 6 files changed, 10 insertions(+), 15 deletions(-) diff --git a/code/ryzom/client/src/client_sheets/item_sheet.cpp b/code/ryzom/client/src/client_sheets/item_sheet.cpp index 3bb4810c8..7950e923b 100644 --- a/code/ryzom/client/src/client_sheets/item_sheet.cpp +++ b/code/ryzom/client/src/client_sheets/item_sheet.cpp @@ -239,7 +239,7 @@ void CItemSheet::build(const NLGEORGES::UFormElm &item) debug(toString("The slot name %d is Empty.", i)); // Push the possible slots for the item in the list. - SlotBF|= SINT64_CONSTANT(1)<< (SLOTTYPE::stringToSlotType(NLMISC::strupr(slotName))); + SlotBF|= SINT64_CONSTANT(1)<< (SLOTTYPE::stringToSlotType(NLMISC::toUpper(slotName))); } } } @@ -258,7 +258,7 @@ void CItemSheet::build(const NLGEORGES::UFormElm &item) } else { - Family = (ITEMFAMILY::EItemFamily) ITEMFAMILY::stringToItemFamily(NLMISC::strupr( family) ); + Family = (ITEMFAMILY::EItemFamily) ITEMFAMILY::stringToItemFamily(NLMISC::toUpper( family) ); if(Family == ITEMFAMILY::UNDEFINED) debug("Item Family Undefined."); } @@ -272,7 +272,7 @@ void CItemSheet::build(const NLGEORGES::UFormElm &item) } else { - ItemType = (ITEM_TYPE::TItemType) ITEM_TYPE::stringToItemType(NLMISC::strupr(itemtype) ); + ItemType = (ITEM_TYPE::TItemType) ITEM_TYPE::stringToItemType(NLMISC::toUpper(itemtype) ); if (ItemType == ITEM_TYPE::UNDEFINED) debug("Item Type Undefined."); } diff --git a/code/ryzom/client/src/client_sheets/sbrick_sheet.cpp b/code/ryzom/client/src/client_sheets/sbrick_sheet.cpp index 76000d099..c9379e1ed 100644 --- a/code/ryzom/client/src/client_sheets/sbrick_sheet.cpp +++ b/code/ryzom/client/src/client_sheets/sbrick_sheet.cpp @@ -103,7 +103,7 @@ void CSBrickSheet::build (const NLGEORGES::UFormElm &root) { string sheetName= Id.toString(); std::string::size_type end= sheetName.find(".sbrick")-2; - BrickFamily = BRICK_FAMILIES::toSBrickFamily ( strupr(sheetName.substr(0,end)) ); + BrickFamily = BRICK_FAMILIES::toSBrickFamily ( NLMISC::toUpper(sheetName.substr(0,end)) ); if(BrickFamily==BRICK_FAMILIES::Unknown) nlwarning("Unknown Family for SBrick: %s", sheetName.c_str()); } diff --git a/code/ryzom/client/src/color_slot_manager.cpp b/code/ryzom/client/src/color_slot_manager.cpp index d8e7116f6..905eecef5 100644 --- a/code/ryzom/client/src/color_slot_manager.cpp +++ b/code/ryzom/client/src/color_slot_manager.cpp @@ -266,7 +266,7 @@ bool CColorSlotManager::parseTexName(const char *texName, std::string *texNameWi static std::string nameToParse; static std::string currentExt; static TIntCoupleVect slotsId; - nameToParse = NLMISC::strupr(NLMISC::CFile::getFilenameWithoutExtension(texName)); + nameToParse = NLMISC::toUpper(NLMISC::CFile::getFilenameWithoutExtension(texName)); TStrPos currPos = nameToParse.length(); @@ -377,9 +377,8 @@ bool CColorSlotManager::changeTexName(std::string &texName, TIntCouple *slotIDs, static TIntCoupleVect srcSlotIDs; everythingOk = true; - texNameNoExt = NLMISC::CFile::getFilenameWithoutExtension(texName); + texNameNoExt = NLMISC::toUpper(NLMISC::CFile::getFilenameWithoutExtension(texName)); texExt = NLMISC::CFile::getExtension(texName); - NLMISC::strupr(texNameNoExt); TTex2Slots::const_iterator texIt = _TexMap.find(texNameNoExt); if (texIt != _TexMap.end()) { diff --git a/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp b/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp index b7b2afce2..bb4b72ecc 100644 --- a/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp +++ b/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp @@ -105,8 +105,7 @@ void CActionPhraseFaber::launchFaberCastWindow(sint32 memoryLine, uint memoryIn _FaberPlanBrickFamilies.clear(); if(rootBrick->Properties.size()>0) { - string prop= rootBrick->Properties[0].Text; - strupr(prop); + string prop= NLMISC::toUpper(rootBrick->Properties[0].Text); vector strList; splitString(prop, " ", strList); // The prop Id should be 'FPLAN:' diff --git a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp index 33f1e8400..c10253128 100644 --- a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp +++ b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp @@ -378,9 +378,8 @@ bool CCtrlSheetInfo::parseCtrlInfo(xmlNodePtr cur, CInterfaceGroup * /* parentGr // The string may have multiple brick type separated by | string brickTypeArray= (const char*)prop; - strupr(brickTypeArray); vector strList; - NLMISC::splitString(brickTypeArray, "|", strList); + NLMISC::splitString(NLMISC::toUpper(brickTypeArray), "|", strList); // Test All words for(uint i=0;i Date: Fri, 16 Jul 2010 22:16:21 +0200 Subject: [PATCH 29/52] Changed: #1023 Use a standard application path for writing files --- code/nel/include/nel/misc/path.h | 5 +++ code/nel/src/misc/path.cpp | 26 ++++++++++++++ code/ryzom/client/src/client.cpp | 58 ++++++++++++++++++-------------- code/ryzom/client/src/init.cpp | 5 ++- 4 files changed, 68 insertions(+), 26 deletions(-) diff --git a/code/nel/include/nel/misc/path.h b/code/nel/include/nel/misc/path.h index 52088d67b..98896a216 100644 --- a/code/nel/include/nel/misc/path.h +++ b/code/nel/include/nel/misc/path.h @@ -700,6 +700,11 @@ struct CFile * Call this method to get a temporary output filename. If you have successfully saved your data, delete the old filename and move the new one. */ static void getTemporaryOutputFilename (const std::string &originalFilename, std::string &tempFilename); + + /** Get application directory. + * \return directory where applications should write files. + */ + static std::string getApplicationDirectory(const std::string &appName = ""); }; } // NLMISC diff --git a/code/nel/src/misc/path.cpp b/code/nel/src/misc/path.cpp index e30982056..7ba510aa4 100644 --- a/code/nel/src/misc/path.cpp +++ b/code/nel/src/misc/path.cpp @@ -2435,4 +2435,30 @@ void CFile::getTemporaryOutputFilename (const std::string &originalFilename, std while (CFile::isExists(tempFilename)); } +std::string CFile::getApplicationDirectory(const std::string &appName) +{ + static std::string appPath; + if (appPath.empty()) + { +#ifdef NL_OS_WINDOWS + wchar_t buffer[MAX_PATH]; + SHGetSpecialFolderPathW(NULL, buffer, CSIDL_APPDATA, TRUE); + appPath = CPath::standardizePath(ucstring((ucchar*)buffer).toUtf8()); +#else + appPath = CPath::standardizePath(getenv("HOME")); +#endif + } + + std::string path = appPath; +#ifdef NL_OS_WINDOWS + if (!appName.empty()) + path = CPath::standardizePath(path + appName); +#else + if (!appName.empty)) + path = CPath::standardizePath(path + "." + toLower(appName)); +#endif + + return path; +} + } // NLMISC diff --git a/code/ryzom/client/src/client.cpp b/code/ryzom/client/src/client.cpp index 93a243949..cf0c621b3 100644 --- a/code/ryzom/client/src/client.cpp +++ b/code/ryzom/client/src/client.cpp @@ -345,6 +345,14 @@ int main(int argc, char **argv) // init the Nel context CApplicationContext *appContext = new CApplicationContext; +#ifdef CHANGE_CURRENT_PATH + std::string currentPath = CFile::getApplicationDirectory("Ryzom"); + + if (!CFile::isExists(currentPath)) CFile::createDirectory(currentPath); + + CPath::setCurrentPath(currentPath); +#endif // CHANGE_CURRENT_PATH + // temporary buffer to store Ryzom full path char filename[1024]; @@ -437,31 +445,6 @@ int main(int argc, char **argv) GetModuleFileName(GetModuleHandle(NULL), filename, 1024); -#else - - // TODO for Linux : splashscreen - - if (argc >= 3) - { - LoginLogin = argv[1]; - LoginPassword = argv[2]; - if (!fromString(argv[3], LoginShardId)) LoginShardId = -1; - } - else if (argc >= 2) - { - LoginLogin = argv[1]; - LoginPassword = argv[2]; - LoginShardId = -1; - } - - strcpy(filename, argv[0]); - -#endif - - // initialize patch manager and set the ryzom full path, before it's used - CPatchManager *pPM = CPatchManager::getInstance(); - pPM->setRyzomFilename(NLMISC::CFile::getFilename(filename)); - // Delete the .bat file because it s not useful anymore if (NLMISC::CFile::fileExists("updt_nl.bat")) NLMISC::CFile::deleteFile("updt_nl.bat"); @@ -488,6 +471,31 @@ int main(int argc, char **argv) } } +#else + + // TODO for Linux : splashscreen + + if (argc >= 3) + { + LoginLogin = argv[1]; + LoginPassword = argv[2]; + if (!fromString(argv[3], LoginShardId)) LoginShardId = -1; + } + else if (argc >= 2) + { + LoginLogin = argv[1]; + LoginPassword = argv[2]; + LoginShardId = -1; + } + + strcpy(filename, argv[0]); + +#endif + + // initialize patch manager and set the ryzom full path, before it's used + CPatchManager *pPM = CPatchManager::getInstance(); + pPM->setRyzomFilename(NLMISC::CFile::getFilename(filename)); + ///////////////////////////////// // Initialize the application. // #ifndef TEST_CRASH_COUNTER diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index 9f19b4844..ca2dcd9fe 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -728,7 +728,10 @@ void prelogInit() setDefaultEmailParams ("smtp.nevrax.com", "", "ryzombug@nevrax.com"); // create the save dir. - CFile::createDirectory("save"); + if (!CFile::isExists("data")) CFile::createDirectory("data"); + + // create the save dir. + if (!CFile::isExists("save")) CFile::createDirectory("save"); #if !FINAL_VERSION // if we're not in final version then start the file access logger to keep track of the files that we read as we play From 0d7106864b64bc4eaafcae4eba98d534c5d4848e Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 16 Jul 2010 22:20:39 +0200 Subject: [PATCH 30/52] Changed: #860 Remove/convert/update old projects --- code/nel/src/3d/driver/direct3d/driver_direct3d.vcproj | 2 +- code/nel/src/misc/Makefile.am | 1 - .../3d/plugin_max/nel_3dsmax_shared/nel_3dsmax_shared.vcproj | 2 +- code/ryzom/CMakeLists.txt | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d.vcproj b/code/nel/src/3d/driver/direct3d/driver_direct3d.vcproj index 6d02e3abe..bc522553e 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d.vcproj +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d.vcproj @@ -1,7 +1,7 @@ Date: Fri, 16 Jul 2010 22:23:45 +0200 Subject: [PATCH 31/52] Changed: #825 Remove all warning when compiling Ryzom --- code/ryzom/client/src/interface_v3/view_renderer.cpp | 6 +++--- code/ryzom/client/src/net_manager.cpp | 2 +- code/ryzom/tools/client/client_config/database.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/view_renderer.cpp b/code/ryzom/client/src/interface_v3/view_renderer.cpp index 90a010394..9e131ec71 100644 --- a/code/ryzom/client/src/interface_v3/view_renderer.cpp +++ b/code/ryzom/client/src/interface_v3/view_renderer.cpp @@ -611,7 +611,7 @@ void CViewRenderer::drawQuad(sint layerId, const NLMISC::CQuadUV &quadUV, sint32 std::swap(pUV0, pUV1); } - nlassert(count <= maxNumCorners); + nlassert(count <= (sint)maxNumCorners); if (count >= 3) { count -= 2; @@ -1088,7 +1088,7 @@ CRGBA CViewRenderer::getTextureColor(sint32 id, sint32 x, sint32 y) sint32 CViewRenderer::getTypoTextureW(char c) { if ((c>=0) && (c=0) && (cChildren.size (); + ChildId = (uint)parent->Children.size (); if (parent) parent->Children.push_back (this); Name = name; From 6b705c278acb179d3795edc950dbea7579dc1e05 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 16 Jul 2010 22:26:02 +0200 Subject: [PATCH 32/52] Changed: #878 Fix typos in comments/code --- code/ryzom/client/src/interface_v3/ctrl_scroll.cpp | 4 ++-- code/ryzom/common/src/game_share/server_edition_module.cpp | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/ctrl_scroll.cpp b/code/ryzom/client/src/interface_v3/ctrl_scroll.cpp index 5ea043daf..652bd5ed7 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_scroll.cpp +++ b/code/ryzom/client/src/interface_v3/ctrl_scroll.cpp @@ -833,7 +833,7 @@ void CCtrlScroll::moveTargetX (sint32 dx) _TrackPos = (sint32)factor; } - // invlidate only position. 1 pass is sufficient + // invalidate only position. 1 pass is sufficient invalidateCoords(1); } @@ -873,7 +873,7 @@ void CCtrlScroll::moveTargetY (sint32 dy) _TrackPos = (sint32)factor; } - // invlidate only position. 1 pass is sufficient + // invalidate only position. 1 pass is sufficient invalidateCoords(1); } diff --git a/code/ryzom/common/src/game_share/server_edition_module.cpp b/code/ryzom/common/src/game_share/server_edition_module.cpp index f1f03163f..2731ed40b 100644 --- a/code/ryzom/common/src/game_share/server_edition_module.cpp +++ b/code/ryzom/common/src/game_share/server_edition_module.cpp @@ -3254,10 +3254,6 @@ void CServerEditionModule::hibernateSession(NLNET::IModuleProxy *sender, TSessio } -static const std::string _SubRep = "r2/"; -//static const std::string _SubRep = ""; - - std::string CServerEditionModule::getSessionFilename(TSessionId sessionId, TCharId charId) const { return NLMISC::toString("r2_session_%.08u_%08u.dat", sessionId.asInt(), charId ); @@ -3265,7 +3261,7 @@ std::string CServerEditionModule::getSessionFilename(TSessionId sessionId, TChar std::string CServerEditionModule::getOverrideRingAccessFilename() const { - return NLMISC::toString("r2/override_ring_access.txt", _SubRep.c_str()); + return "r2/override_ring_access.txt"; } //implementation of characterKicked and command From 85c6498504684ac1975f13974c2b161043beecfc Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 16 Jul 2010 23:12:25 +0200 Subject: [PATCH 33/52] Changed: #1023 Use a standard application path for writing files --- code/ryzom/client/src/client_cfg.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index 87d4f038c..2bfec308e 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -1966,7 +1966,23 @@ void CClientConfig::serial(class NLMISC::IStream &f) throw(NLMISC::EStream) void CClientConfig::init(const string &configFileName) { if(!CFile::fileExists(configFileName)) + { +#if defined(NL_ETC_PREFIX) && defined(NL_SHARE_PREFIX) + nlwarning("CFG::init: creating '%s' with default values", configFileName.c_str ()); + + // create the basic .cfg that link the default one + FILE *fp = fopen(configFileName.c_str(), "w"); + if (fp == NULL) + { + nlerror ("CFG::init: Can't create config file '%s'", configFileName.c_str()); + } + fprintf(fp, "RootConfigFilename = \"%s/client_default.cfg\";\n", NL_ETC_PREFIX); + fprintf(fp, "DataPath = { \"%s/data\" };\n", NL_SHARE_PREFIX); + fclose(fp); +#else nlwarning("CFG::init: '%s' Not Found !!!", configFileName.c_str ()); +#endif + } // if the config file will be modified, it calls automatically the function setValuesOnFileChange() ClientCfg.ConfigFile.setCallback (CClientConfig::setValuesOnFileChange); From 3677fced18e82462fae2fe9c5b523def20bab71f Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 17 Jul 2010 17:44:31 +0200 Subject: [PATCH 34/52] Changed: #842 Removed CMake unused files --- code/ryzom/CMakeModules/FindCEGUI.cmake | 53 ----------------- code/ryzom/CMakeModules/FindCppTest.cmake | 51 ---------------- code/ryzom/CMakeModules/FindFreeType.cmake | 67 ---------------------- code/ryzom/CMakeModules/FindJpeg.cmake | 50 ---------------- 4 files changed, 221 deletions(-) delete mode 100644 code/ryzom/CMakeModules/FindCEGUI.cmake delete mode 100644 code/ryzom/CMakeModules/FindCppTest.cmake delete mode 100644 code/ryzom/CMakeModules/FindFreeType.cmake delete mode 100644 code/ryzom/CMakeModules/FindJpeg.cmake diff --git a/code/ryzom/CMakeModules/FindCEGUI.cmake b/code/ryzom/CMakeModules/FindCEGUI.cmake deleted file mode 100644 index a939ebfb7..000000000 --- a/code/ryzom/CMakeModules/FindCEGUI.cmake +++ /dev/null @@ -1,53 +0,0 @@ -# - Locate CEGUI library -# This module defines -# CEGUI_LIBRARY, the library to link against -# CEGUI_FOUND, if false, do not try to link to CEGUI -# CEGUI_INCLUDE_DIRS, where to find headers. - -IF(CEGUI_LIBRARY AND CEGUI_INCLUDE_DIRS) - # in cache already - SET(CEGUI_FIND_QUIETLY TRUE) -ENDIF(CEGUI_LIBRARY AND CEGUI_INCLUDE_DIRS) - - -FIND_PATH(CEGUI_INCLUDE_DIRS - CEGUI - PATHS - $ENV{CEGUI_DIR}/include - /usr/local/include - /usr/include - /sw/include - /opt/local/include - /opt/csw/include - /opt/include - PATH_SUFFIXES cegui CEGUI -) - -FIND_LIBRARY(CEGUI_LIBRARY - NAMES CEGUIBase - PATHS - $ENV{CEGUI_DIR}/lib - /usr/local/lib - /usr/lib - /usr/local/X11R6/lib - /usr/X11R6/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 -) - -GET_FILENAME_COMPONENT(CEGUI_LIB_DIR ${CEGUI_LIBRARY} PATH CACHE) - -IF(CEGUI_LIBRARY AND CEGUI_INCLUDE_DIRS) - SET(CEGUI_FOUND "YES") - SET(CEGUI_INCLUDE_DIRS "${CEGUI_INCLUDE_DIRS}/CEGUI") - IF(NOT CEGUI_FIND_QUIETLY) - MESSAGE(STATUS "Found CEGUI: ${CEGUI_LIBRARY}") - ENDIF(NOT CEGUI_FIND_QUIETLY) -ELSE(CEGUI_LIBRARY AND CEGUI_INCLUDE_DIRS) - IF(NOT CEGUI_FIND_QUIETLY) - MESSAGE(STATUS "Warning: Unable to find CEGUI!") - ENDIF(NOT CEGUI_FIND_QUIETLY) -ENDIF(CEGUI_LIBRARY AND CEGUI_INCLUDE_DIRS) diff --git a/code/ryzom/CMakeModules/FindCppTest.cmake b/code/ryzom/CMakeModules/FindCppTest.cmake deleted file mode 100644 index 54144eb56..000000000 --- a/code/ryzom/CMakeModules/FindCppTest.cmake +++ /dev/null @@ -1,51 +0,0 @@ -# -# Find the CppTest includes and library -# -# This module defines -# CPPTEST_INCLUDE_DIR, where to find tiff.h, etc. -# CPPTEST_LIBRARY, where to find the CppTest library. -# CPPTEST_FOUND, If false, do not try to use CppTest. - -# also defined, but not for general use are -IF(CPPTEST_LIBRARY AND CPPTEST_INCLUDE_DIR) - # in cache already - SET(CPPTEST_FIND_QUIETLY TRUE) -ENDIF(CPPTEST_LIBRARY AND CPPTEST_INCLUDE_DIR) - -FIND_PATH(CPPTEST_INCLUDE_DIR - cpptest.h - PATHS - /usr/local/include - /usr/include - /sw/include - /opt/local/include - /opt/csw/include - /opt/include - PATH_SUFFIXES cppunit -) - -FIND_LIBRARY(CPPTEST_LIBRARY - cpptest - PATHS - /usr/local/lib - /usr/lib - /usr/local/X11R6/lib - /usr/X11R6/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 -) - -IF(CPPTEST_LIBRARY AND CPPTEST_INCLUDE_DIR) - SET(CPPTEST_FOUND "YES") - IF(NOT CPPTEST_FIND_QUIETLY) - MESSAGE(STATUS "Found CppTest: ${CPPTEST_LIBRARY}") - ENDIF(NOT CPPTEST_FIND_QUIETLY) -ELSE(CPPTEST_LIBRARY AND CPPTEST_INCLUDE_DIR) - IF(NOT CPPTEST_FIND_QUIETLY) - MESSAGE(STATUS "Warning: Unable to find CppTest!") - ENDIF(NOT CPPTEST_FIND_QUIETLY) -ENDIF(CPPTEST_LIBRARY AND CPPTEST_INCLUDE_DIR) - diff --git a/code/ryzom/CMakeModules/FindFreeType.cmake b/code/ryzom/CMakeModules/FindFreeType.cmake deleted file mode 100644 index 0ba439fb9..000000000 --- a/code/ryzom/CMakeModules/FindFreeType.cmake +++ /dev/null @@ -1,67 +0,0 @@ -# - Locate FreeType library -# This module defines -# FREETYPE_LIBRARY, the library to link against -# FREETYPE_FOUND, if false, do not try to link to FREETYPE -# FREETYPE_INCLUDE_DIRS, where to find headers. - -IF(FREETYPE_LIBRARY AND FREETYPE_INCLUDE_DIRS) - # in cache already - SET(FREETYPE_FIND_QUIETLY TRUE) -ENDIF(FREETYPE_LIBRARY AND FREETYPE_INCLUDE_DIRS) - - -FIND_PATH(FREETYPE_INCLUDE_DIRS - freetype - PATHS - $ENV{FREETYPE_DIR}/include - /usr/local/include - /usr/include - /sw/include - /opt/local/include - /opt/csw/include - /opt/include - PATH_SUFFIXES freetype freetype2 -) - -# ft2build.h does not reside in the freetype include dir -FIND_PATH(FREETYPE_ADDITIONAL_INCLUDE_DIR - ft2build.h - PATHS - /usr/local/include - /usr/include - /sw/include - /opt/local/include - /opt/csw/include - /opt/include -) - -# combine both include directories into one variable -IF(FREETYPE_ADDITIONAL_INCLUDE_DIR) - SET(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS} ${FREETYPE_ADDITIONAL_INCLUDE_DIR}) -ENDIF(FREETYPE_ADDITIONAL_INCLUDE_DIR) - -FIND_LIBRARY(FREETYPE_LIBRARY - NAMES freetype libfreetype freetype219 - PATHS - $ENV{FREETYPE_DIR}/lib - /usr/local/lib - /usr/lib - /usr/local/X11R6/lib - /usr/X11R6/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 -) - -IF(FREETYPE_LIBRARY AND FREETYPE_INCLUDE_DIRS) - SET(FREETYPE_FOUND "YES") - IF(NOT FREETYPE_FIND_QUIETLY) - MESSAGE(STATUS "Found FreeType: ${FREETYPE_LIBRARY}") - ENDIF(NOT FREETYPE_FIND_QUIETLY) -ELSE(FREETYPE_LIBRARY AND FREETYPE_INCLUDE_DIRS) - IF(NOT FREETYPE_FIND_QUIETLY) - MESSAGE(STATUS "Warning: Unable to find FreeType!") - ENDIF(NOT FREETYPE_FIND_QUIETLY) -ENDIF(FREETYPE_LIBRARY AND FREETYPE_INCLUDE_DIRS) diff --git a/code/ryzom/CMakeModules/FindJpeg.cmake b/code/ryzom/CMakeModules/FindJpeg.cmake deleted file mode 100644 index 454f0fdc2..000000000 --- a/code/ryzom/CMakeModules/FindJpeg.cmake +++ /dev/null @@ -1,50 +0,0 @@ -# - Locate Jpeg library -# This module defines -# JPEG_LIBRARY, the library to link against -# JPEG_FOUND, if false, do not try to link to JPEG -# JPEG_INCLUDE_DIR, where to find headers. - -IF(JPEG_LIBRARY AND JPEG_INCLUDE_DIR) - # in cache already - SET(JPEG_FIND_QUIETLY TRUE) -ENDIF(JPEG_LIBRARY AND JPEG_INCLUDE_DIR) - - -FIND_PATH(JPEG_INCLUDE_DIR - jpeglib.h - PATHS - $ENV{JPEG_DIR}/include - /usr/local/include - /usr/include - /sw/include - /opt/local/include - /opt/csw/include - /opt/include - PATH_SUFFIXES jpeg -) - -FIND_LIBRARY(JPEG_LIBRARY - NAMES jpeg libjpeg - PATHS - $ENV{JPEG_DIR}/lib - /usr/local/lib - /usr/lib - /usr/local/X11R6/lib - /usr/X11R6/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 -) - -IF(JPEG_LIBRARY AND JPEG_INCLUDE_DIR) - SET(JPEG_FOUND "YES") - IF(NOT JPEG_FIND_QUIETLY) - MESSAGE(STATUS "Found Jpeg: ${JPEG_LIBRARY}") - ENDIF(NOT JPEG_FIND_QUIETLY) -ELSE(JPEG_LIBRARY AND JPEG_INCLUDE_DIR) - IF(NOT JPEG_FIND_QUIETLY) - MESSAGE(STATUS "Warning: Unable to find Jpeg!") - ENDIF(NOT JPEG_FIND_QUIETLY) -ENDIF(JPEG_LIBRARY AND JPEG_INCLUDE_DIR) From f9e5950126e921840f87c6055d050cffdfbf6236 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 17 Jul 2010 17:54:43 +0200 Subject: [PATCH 35/52] Changed: #842 Added new files for X11 applications --- code/ryzom/client/CMakeLists.txt | 6 ++++++ code/ryzom/client/unix/CMakeLists.txt | 4 ++++ code/ryzom/client/unix/ryzom.desktop.in | 11 +++++++++++ code/ryzom/client/unix/ryzom.png | Bin 0 -> 6128 bytes code/ryzom/common/CMakeLists.txt | 9 +++++++++ 5 files changed, 30 insertions(+) create mode 100644 code/ryzom/client/unix/CMakeLists.txt create mode 100644 code/ryzom/client/unix/ryzom.desktop.in create mode 100644 code/ryzom/client/unix/ryzom.png diff --git a/code/ryzom/client/CMakeLists.txt b/code/ryzom/client/CMakeLists.txt index 4b7537b55..642244536 100644 --- a/code/ryzom/client/CMakeLists.txt +++ b/code/ryzom/client/CMakeLists.txt @@ -1 +1,7 @@ ADD_SUBDIRECTORY(src) + +IF(UNIX AND NOT APPLE) + ADD_SUBDIRECTORY(unix) +ENDIF(UNIX AND NOT APPLE) + +INSTALL(FILES client_default.cfg DESTINATION ${RYZOM_ETC_PREFIX}) diff --git a/code/ryzom/client/unix/CMakeLists.txt b/code/ryzom/client/unix/CMakeLists.txt new file mode 100644 index 000000000..df17996fe --- /dev/null +++ b/code/ryzom/client/unix/CMakeLists.txt @@ -0,0 +1,4 @@ +CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/ryzom.desktop.in" "${CMAKE_CURRENT_BINARY_DIR}/ryzom.desktop") + +INSTALL(FILES ryzom.png DESTINATION share/pixmaps) +INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/ryzom.desktop" DESTINATION share/applications) diff --git a/code/ryzom/client/unix/ryzom.desktop.in b/code/ryzom/client/unix/ryzom.desktop.in new file mode 100644 index 000000000..da04de87c --- /dev/null +++ b/code/ryzom/client/unix/ryzom.desktop.in @@ -0,0 +1,11 @@ +[Desktop Entry] +Version=1.0 +Name=Ryzom +Type=Application +GenericName=ryzom +Comment=Ryzom MMORPG client +Exec=${RYZOM_BIN_PREFIX}/ryzom_client +Icon=ryzom +Terminal=false +Hidden=false +Categories=Game;RolePlaying; diff --git a/code/ryzom/client/unix/ryzom.png b/code/ryzom/client/unix/ryzom.png new file mode 100644 index 0000000000000000000000000000000000000000..43aae082f1e401220e2659bb831b117c5687827c GIT binary patch literal 6128 zcmVPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igY_ z4Fw{FJ74ht02gpcL_t(&-o2VxjAhq#p8s{`bM8D3HFQ;V*U(j6)g!x`O*YA<23qDI zDpaBvo|T8lHsIvJfMNm4TV4{x1`H2!A~=R+K?F$!vM5ocC{h&3p1X@ZcU9MPZw+^z z@45HPXXil(AVIMsiL}q#emHyY4-0$mwbuUw|3aVVdGyaQ??*DJWm`l5M;ylyh$kYB zhycI`K#Vbk0Vx6u#?S+p$ry8e=KHcFvk$Yj@L_%~?yYcz&dk;c}j(@f_(Q&s8?=-^}a%el|NcSzj-% zJ?_JwI5@lbPCT0U4$tw|J>S>E!Jzlg22ih;$Z;LTvkQX$KTP+l*+v~HX*=gj{N$U3NEHOHPYOTo%4{oD){e3GM&D8g*Wjc6pv3KIJ zbE|VRhc3lqu`A5?F58Z4r4n)WkpfiqHaJxaXX@?7^Dn;iH-7}iHT1qQRobg1G%X6> zBkHzWED#JJozK$jff07&;yb9cJ+k~7o1WZ{SSU)Zc9ZStKKiv1nSGt{j!nPwd;dX~ zWbG9Y?;bt*$Z|3odC9V@b}E_hKN5hg2g?%AOCNJ=W8(V7x4*Di?&Ip!%LfYEyILxl z!sz%u1Og#EdiDu4YgKHn-A5uCK&P>eX3IpaQO2QTk0KFIpw-yMowfULBp)0^bn63X z6u{_MwlF!f|5he7-hJ%JXU?Y+u@^zqi-g1MLjg2uyJEjnd-lp(FMlxZlAU{R+z4LaOCh|(xM5r`QRpOqep#1XPO#8a^F0iIQ1BFLY;P9 z4u+zE*Ixdse?K~R=0oD{hcu~NhS4OL6 zLg0Z&NCG1cZrnl0ZQ;iC3m6|e0B~J&yFK)JL-b2!baewDS-G`!?ZnM{Ye!W%)R@>m zD@~41eEoylw{9F=Tw=da1e*0q$oH&gZY`hxjL!$yUwq}yKCM@`<)!fycG^R1RBMPw zvv}m(IoyA+fo8J-z1s%}ICD6P2bCJ4SpnTDFg3o2WIPAU_OLK_9ILDMaPz@M%q$#0 ztJJ|@(1hrjDApQ~V;VXw4`DG<`_13}{dMAL>%`%szdt{Fu=jHV+`oH)_iXy(Qmy$E zz%KszpMUxHZrv*eRL&zs;8`LOLp+%VCnZT!HCCyv!(&|vOCp;*n8e0*mBfU~HrE<} zF45wFQDzQJ7%ow{G-Q_JBa=x{G8JY=PM)D$Zi2}YhxL_f^v=b%S*hBE+4GEl^SNKU zx?AZSe)dII5LBVw}ykcQ#PksgNc~{tKV|?YENI^x)j%ANy)37ByN3Y{8|*eH9^&Bduq^Yj>dscqkE~?5v7P zrH$L~mPiv7NW%eSRiK~;99T$U>GU`mJs;&x8ICW}V`m=2;;AP9CeRyiypH1bIvML7 zbXt8d&Lhimph_IzSloqo-#GfapZ|le3%rz0B~uCjGq4B9{Ha0Rwpa0!|$1Ys`9yW{jXsFw4pfjjSm>QKTGX~8> zr&Z2)jw!VJgJ&zX`nR&_l>LtaRBOdARCl^2Ts`mkE|xFvARmrGWgJ$h z42;c zl}neA%A{cF9D-T|BS{VE&YSURhpII?uHR4(u4b2;`i z06)6?idd`f+|;?v|5U6OX<*ne20peQbRh>t%4R}PC4m~o0D8+pG!q6VDCC(G+pB-uI|%~t5uSHJPO#m?@H>B-3jMUiR%te*n7dh^{xt6TYl?qK^w zt=@$>^q??e!H9^oCXs7+jQ2cpe3x-92hV5V1fF&_s;s0Otp zAqBZiih|K7JF<8Rk3ReyC1NSI{$L#fN7QN8nQRP*-#5k{IrBJ*#R7f%<-cXsog!?@ zp?>K;%gBJL`n0{f8)Y}I9lCns@~=L2=85udseF4hpYsI(sMJc-XjjhM`{BKrz5d#% z^&2fJZnQC;jZiiy01X4TcLsE1TEyr~j>@Kixv4P>nq9PXlPuFluh&IXQE0c)g~&5Z zkETdgMZ~iieDbN!Q!+UU$8yo@_K4$o?CzG)GY!IEhzl34P$;ND4F(X+j}mhY%q=cJ zj!)CgH(x<4s$lQ_3Z;YT!sRRPEY40ZE+ym9y8wO+ps7JF>SUPhv_sb}+=-ToI*VvQ zl2nbQBSGB1yGf!XvyGZXXLAP_XI2qI3~Q1_T+e33l^P1BN2BQwJAN<^SrF*({1~&L zA)cNfm6O=*tIHS~CJC~_7$?B7Od8ua$$s?aKTx5rv$GGM1yyW1^Y|0YIsG^`3+tpw zA?B!I?DcfYd7K#foW|5irIBa0LM1h~qPv%$-CaS+RAW9UjkPWbQN~sStd# zfwkp5WJ3Wg9@!6WX(nsKX~oCRNh)=qjTf5c=QpL(gGk#($>l{n>z6bcB&QXb^DCxecXKaE$Vms zY;0QN%H?&b(X57f{$Orrx6}~;V14Tr`{Cv9d^*Y{2gSO9&h};W+CCiLKqweR&mUq` z2x4`u3O>QZG<<~O5$vBE!_?>ujxHX9ZE@(-8W_*VVX8XXw^t#m491`bC6vbNufB*< zsf^)Z2u=_Y2&vdNnZw+|F`PQ~Bz6ira2y*#EQ8%j1xDY*pkw0pm3Ltb%Wy0Q%U9mZ zKKb#d?+Kz3+bva3B@@vH0syqT4KA0OxWe^4al5d2#`JiQ%42+df(}eApl9r1XJeiC zl!{@;q0#+W%+D;rbAYGL{aYH%PhdDO@Lym4GWl$PR)2uKYMT<8jQB_n!H`Ocgp7PH zfQgYD1rp;(GsGnhlu1kc<#IWlNyUHs4)_ilsc7cH&?qDf-DG?q0>Sr44W?PgG|}AaQorvr-5t`zbc%^Q zkL4?uAt?&|efz6ye)b`hcFR<6H<+xLaF|7zXpn_N8XU7j#jPq+1R$U)w7~>66Q01# z+({x?Wvzip-DZ!OOvc^YwDB0AOE!%IkL;*DFr{;bdAx&+H2UIdOaH;5BZpi?T!aFu;Do#1o9yV2-}VO zXd6x3|6mQiZ(?LJ072mZ0*Z|W^sWteU?ZPaU=1Z0_5ea4iW8QDZr{T8P6?&mU98={ ziE^<3&8{IB<%-|oY-JFr_f$Z;Knge2r(i2l{X&!bSdPW46w!K8*@UO}zcCrhcrmke+KIhKuN zB!bqUOM(mJQxVt!lU(10VL50FI;3hveBF|9z5m+BYzj zi=evKCO)Dd98-`BaP**NA{>@s>J|xtKb6Z(-JP3W`0GzS_1sUV)A2~w|KP@zV!vft zdL2@$?$8t@=1YW~y*4=(v5~Awd~nDr%_5X&3bAB@T+?TQAS02>QXn(I7BdWjUZnc4 z%kK2M;3S@uaDd(2=pY_bD4k6*PG-nuMA|9qObJQETRNMbN`cHF?VC%pZji_Nohk+T z0)x*GkVI0V5<7A7v9~h0k&>nb`#)3AL?S8w_|bDO_Z#M;uYLcGr+uGK+}-OU6P1w) z$*>f_HyspKs@Pfk2e`U~{rl&U&5S}*RoLwc?A|s!uZKZY1_i>{7Z4E&iXfX|ZX|>4 z-2p154Oj%DXCfr?@N5TiHVh@i!*LumdLC-)9dw%xSd53r04<;(7|tM*n}|Mo=Fz`5 zjN#9gl>7G0__bQu9?gvZw=nN(U;E}uFC<6y5obAIriZTHBSCUt2_m&>9S{-TeeVj? z@D?3fI)bR%hD?1DG9h$^eRLWoX_|tX!N39J6^GEG3V05r_bo)?GQ_AvYDB{BR*T4I zC~bD&+C;;y3rUmVI~;{Z1KCrR^*oE?$T@QQV{b1l9laY32T|N2Cs-< z;J|zygPx6`ki){EV^9Jzz<6k~fLKBWAYx`>X7i!N*}u)^GB+L9{V4$cCkKE0r7wBD z=LZ>MQn|A`J2QRayZbsf#38QLo7W~d;i{BpPCpy@G1`u zwr|qy+gHFyrn6^Xpi?KGC*M`DeC0A#?_QE$n0H$qFr*5!nr4GmODI88RNfycD zzyvjdjR&j5i4vQfnMZYJh0QNLyr%^cjbt)a^nJgcOeX!Gt2?a^hRst)j{Ie*T>s+Q z`g(NXk;5NcyLMr*zOyA9JoW_b?rfp3aUZ+{aB_xrc6Sg^Ll8xd>a8Yto^$T^UOO>izuQ#9i>#u#|PqK+fIT?@CzxC~JKG|&4!_#wz;W!31S8kCK z5*aVZ$Yk@>C{>v6^bw1ODHe;dsp&-oBMDLi5yp!eL`5af^I0$)Lbu(as~66*&Gj1; zO{CdQX#>-9r^$8&HWH70@P*&`^)F3MPTclA&$4X06_3Z*FD!8El`GoH%G$5pU)y@Z zb&P;v4kDMYUwXv0Er}xu2N#c!=bDU&gX=gX^TeEC8$9_$1ja~2ZeoV|1B2Oyh3wb_ z*|yEX@dOGR8?=1kJyxsiP_tELk|^WE<4=346e!K_pM3B6r$71CWHPZW2tqL!40ykk zz%i1`4!3vqzMhE3cF$i~{#_C zVQy!08Sg`DWSd(>kukRLr(gM-|9X!BCL-jt!0& zS>}+rjtNx_lNtyz$Mazf2V|KR8x9Th+HJDUApOq+-M4@ATf8XAiXuZ+R0al#c`hGHBn3&9z;itL zp2K|4gU=Wd5n~LnOp`3b^c~AEINuv)Gui6Vg@YHu(WqFfHxiSh`5zuVeCWl#KB&*n z&w3xZPJHv$9TEgV=7^iVc;(us-#&loxmv5ePYVQH$8{s&NK|J44k--z$(NM7Dx~`N=#B|s7l*zIDg~!gE`Z@!)9NV#G=ca#d`@t`z)UT|rk-+nk zAPA||2kU3=+*>`lvc7es+3Szkp09E|2ae|)V_i9A^pjDV`>nPhxt zetQ4=$B!<(&hh-7X`1%j+{`a*H~3IykIl^jxvtBLqA2;E7iqQI`*(Ir)0Jv{yxHky z216svaU7E*(F_H&b|#hF86U~7XS3-QQ55T@Wmz1@xwEs=zqH}wBelS+t~}rvz;Q&J z=lPuNI2>aPg1|F@7ktn6JTUl*BD4Jmrr1ZZ=KlfqbM8s3YBLM~0000 literal 0 HcmV?d00001 diff --git a/code/ryzom/common/CMakeLists.txt b/code/ryzom/common/CMakeLists.txt index 4b7537b55..dbf1c937d 100644 --- a/code/ryzom/common/CMakeLists.txt +++ b/code/ryzom/common/CMakeLists.txt @@ -1 +1,10 @@ ADD_SUBDIRECTORY(src) + +#ADD_CUSTOM_COMMAND(OUTPUT "${CMAKE_BINARY_DIR}/share/data_common.bnp" +# COMMAND bnp_make -p ${CMAKE_CURRENT_SOURCE_DIR}/data_common ${CMAKE_BINARY_DIR}/share > /dev/null) + +#ADD_CUSTOM_TARGET(data_common ALL +# DEPENDS "${CMAKE_BINARY_DIR}/share/data_common.bnp") + +#INSTALL(TARGETS data_common ARCHIVE DESTINATION ${RYZOM_SHARE_PREFIX}/data) +#INSTALL(FILES "${CMAKE_BINARY_DIR}/share/data_common.bnp" DESTINATION "${RYZOM_SHARE_PREFIX}/data") From 148f1659c848ec8decf633ff263f6e8fce92e2a2 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 17 Jul 2010 18:03:13 +0200 Subject: [PATCH 36/52] Changed: #1023 Use a standard application path for writing files --- code/ryzom/CMakeLists.txt | 7 +++- code/ryzom/CMakeModules/nel.cmake | 43 ++++++++++--------------- code/ryzom/client/src/CMakeLists.txt | 2 +- code/ryzom/client/src/client.cpp | 12 ++++--- code/ryzom/client/src/client_cfg.cpp | 48 +++++++++++++++++++++------- code/ryzom/client/src/init.cpp | 5 ++- code/ryzom/config.h.cmake | 10 ++++++ 7 files changed, 81 insertions(+), 46 deletions(-) diff --git a/code/ryzom/CMakeLists.txt b/code/ryzom/CMakeLists.txt index 11ab235b1..db44a106a 100644 --- a/code/ryzom/CMakeLists.txt +++ b/code/ryzom/CMakeLists.txt @@ -65,7 +65,7 @@ ENDIF(COMMAND cmake_policy) # Set default config options NL_SETUP_DEFAULT_OPTIONS() -NL_SETUP_PREFIX_PATHS() +RYZOM_SETUP_PREFIX_PATHS() #----------------------------------------------------------------------------- # Override default options @@ -114,6 +114,11 @@ IF(FINAL_VERSION) ADD_DEFINITIONS(-DFINAL_VERSION=1) ENDIF(FINAL_VERSION) +# config.h configuration and use by projects +CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h) +INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}) +ADD_DEFINITIONS(-DHAVE_CONFIG_H=1) + ADD_SUBDIRECTORY(common) IF(WITH_CLIENT) diff --git a/code/ryzom/CMakeModules/nel.cmake b/code/ryzom/CMakeModules/nel.cmake index 25ecef21e..105f09bcd 100644 --- a/code/ryzom/CMakeModules/nel.cmake +++ b/code/ryzom/CMakeModules/nel.cmake @@ -131,50 +131,41 @@ MACRO(NL_SETUP_BUILD_FLAGS) SET(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${NL_RELEASEDEBUG_CFLAGS} ${PLATFORM_CFLAGS} ") ENDMACRO(NL_SETUP_BUILD_FLAGS) -MACRO(NL_SETUP_PREFIX_PATHS) +MACRO(RYZOM_SETUP_PREFIX_PATHS) ## Allow override of install_prefix/etc path. - IF(NOT NL_ETC_PREFIX) + IF(NOT RYZOM_ETC_PREFIX) IF(WIN32) - SET(NL_ETC_PREFIX "../etc" CACHE PATH "Installation path for configurations") + SET(RYZOM_ETC_PREFIX "." CACHE PATH "Installation path for configurations") ELSE(WIN32) - SET(NL_ETC_PREFIX "${CMAKE_INSTALL_PREFIX}/etc" CACHE PATH "Installation path for configurations") + SET(RYZOM_ETC_PREFIX "${CMAKE_INSTALL_PREFIX}/etc/ryzom" CACHE PATH "Installation path for configurations") ENDIF(WIN32) - ENDIF(NOT NL_ETC_PREFIX) + ENDIF(NOT RYZOM_ETC_PREFIX) ## Allow override of install_prefix/share path. - IF(NOT NL_SHARE_PREFIX) + IF(NOT RYZOM_SHARE_PREFIX) IF(WIN32) - SET(NL_SHARE_PREFIX "../share" CACHE PATH "Installation path for data.") + SET(RYZOM_SHARE_PREFIX "." CACHE PATH "Installation path for data.") ELSE(WIN32) - SET(NL_SHARE_PREFIX "${CMAKE_INSTALL_PREFIX}/share" CACHE PATH "Installation path for data.") + SET(RYZOM_SHARE_PREFIX "${CMAKE_INSTALL_PREFIX}/share/ryzom" CACHE PATH "Installation path for data.") ENDIF(WIN32) ENDIF(NOT NL_SHARE_PREFIX) ## Allow override of install_prefix/sbin path. - IF(NOT NL_SBIN_PREFIX) + IF(NOT RYZOM_SBIN_PREFIX) IF(WIN32) - SET(NL_SBIN_PREFIX "../sbin" CACHE PATH "Installation path for admin tools and services.") + SET(RYZOM_SBIN_PREFIX "." CACHE PATH "Installation path for admin tools and services.") ELSE(WIN32) - SET(NL_SBIN_PREFIX "${CMAKE_INSTALL_PREFIX}/sbin" CACHE PATH "Installation path for admin tools and services.") + SET(RYZOM_SBIN_PREFIX "${CMAKE_INSTALL_PREFIX}/sbin" CACHE PATH "Installation path for admin tools and services.") ENDIF(WIN32) - ENDIF(NOT NL_SBIN_PREFIX) + ENDIF(NOT RYZOM_SBIN_PREFIX) ## Allow override of install_prefix/bin path. - IF(NOT NL_BIN_PREFIX) + IF(NOT RYZOM_BIN_PREFIX) IF(WIN32) - SET(NL_BIN_PREFIX "../bin" CACHE PATH "Installation path for tools and applications.") + SET(RYZOM_BIN_PREFIX "." CACHE PATH "Installation path for tools and applications.") ELSE(WIN32) - SET(NL_BIN_PREFIX "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation path for tools and applications.") + SET(RYZOM_BIN_PREFIX "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation path for client and tools.") ENDIF(WIN32) - ENDIF(NOT NL_BIN_PREFIX) + ENDIF(NOT RYZOM_BIN_PREFIX) - ## Allow override of install_prefix/bin path. - IF(NOT NL_LOG_PREFIX) - IF(WIN32) - SET(NL_LOG_PREFIX "../var/log" CACHE PATH "Installation path for tools and applications.") - ELSE(WIN32) - SET(NL_LOG_PREFIX "${CMAKE_INSTALL_PREFIX}/var/log" CACHE PATH "Installation path for tools and applications.") - ENDIF(WIN32) - ENDIF(NOT NL_LOG_PREFIX) - -ENDMACRO(NL_SETUP_PREFIX_PATHS) +ENDMACRO(RYZOM_SETUP_PREFIX_PATHS) diff --git a/code/ryzom/client/src/CMakeLists.txt b/code/ryzom/client/src/CMakeLists.txt index 273b09022..1d9c8a7bd 100644 --- a/code/ryzom/client/src/CMakeLists.txt +++ b/code/ryzom/client/src/CMakeLists.txt @@ -99,4 +99,4 @@ IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(ryzom_client ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS ryzom_client RUNTIME DESTINATION bin COMPONENT client BUNDLE DESTINATION /Applications) +INSTALL(TARGETS ryzom_client RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT client BUNDLE DESTINATION /Applications) diff --git a/code/ryzom/client/src/client.cpp b/code/ryzom/client/src/client.cpp index cf0c621b3..a7a4de917 100644 --- a/code/ryzom/client/src/client.cpp +++ b/code/ryzom/client/src/client.cpp @@ -345,13 +345,15 @@ int main(int argc, char **argv) // init the Nel context CApplicationContext *appContext = new CApplicationContext; -#ifdef CHANGE_CURRENT_PATH - std::string currentPath = CFile::getApplicationDirectory("Ryzom"); + // if client_default.cfg is not in current directory, use application default directory + if (!CFile::isExists("client_default.cfg")) + { + std::string currentPath = CFile::getApplicationDirectory("Ryzom"); - if (!CFile::isExists(currentPath)) CFile::createDirectory(currentPath); + if (!CFile::isExists(currentPath)) CFile::createDirectory(currentPath); - CPath::setCurrentPath(currentPath); -#endif // CHANGE_CURRENT_PATH + CPath::setCurrentPath(currentPath); + } // temporary buffer to store Ryzom full path char filename[1024]; diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index 2bfec308e..5fff82a73 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -39,6 +39,10 @@ #include "game_share/time_weather_season/time_and_season.h" #include "game_share/ryzom_version.h" +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif // HAVE_CONFIG_H + /////////// // MACRO // /////////// @@ -1967,21 +1971,41 @@ void CClientConfig::init(const string &configFileName) { if(!CFile::fileExists(configFileName)) { -#if defined(NL_ETC_PREFIX) && defined(NL_SHARE_PREFIX) - nlwarning("CFG::init: creating '%s' with default values", configFileName.c_str ()); + std::string defaultConfigFileName = "client_default.cfg"; + bool found = false; + + if (CFile::isExists(defaultConfigFileName)) found = true; - // create the basic .cfg that link the default one - FILE *fp = fopen(configFileName.c_str(), "w"); - if (fp == NULL) +#ifdef RYZOM_ETC_PREFIX + if (!found) + { + defaultConfigFileName = std::string(RYZOM_ETC_PREFIX"/") + defaultConfigFileName; + if (CFile::isExists(defaultConfigFileName)) found = true; + } +#endif // RYZOM_ETC_PREFIX + + if (found) { - nlerror ("CFG::init: Can't create config file '%s'", configFileName.c_str()); + // create the basic .cfg that link the default one + FILE *fp = fopen(configFileName.c_str(), "w"); + if (fp == NULL) + { + nlerror ("CFG::init: Can't create config file '%s'", configFileName.c_str()); + } + else + { + nlwarning("CFG::init: creating '%s' with default values", configFileName.c_str ()); + } + fprintf(fp, "RootConfigFilename = \"%s\";\n", defaultConfigFileName.c_str()); +#ifdef RYZOM_SHARE_PREFIX + fprintf(fp, "PreDataPath = { \"%s/data\" };\n", RYZOM_SHARE_PREFIX); +#endif // RYZOM_SHARE_PREFIX + fclose(fp); + } + else + { + nlwarning("CFG::init: '%s' Not Found !!!", cfgFile.c_str()); } - fprintf(fp, "RootConfigFilename = \"%s/client_default.cfg\";\n", NL_ETC_PREFIX); - fprintf(fp, "DataPath = { \"%s/data\" };\n", NL_SHARE_PREFIX); - fclose(fp); -#else - nlwarning("CFG::init: '%s' Not Found !!!", configFileName.c_str ()); -#endif } // if the config file will be modified, it calls automatically the function setValuesOnFileChange() diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index ca2dcd9fe..157cc9f86 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -727,12 +727,15 @@ void prelogInit() setReportEmailFunction ((void*)sendEmail); setDefaultEmailParams ("smtp.nevrax.com", "", "ryzombug@nevrax.com"); - // create the save dir. + // create the data dir. if (!CFile::isExists("data")) CFile::createDirectory("data"); // create the save dir. if (!CFile::isExists("save")) CFile::createDirectory("save"); + // create the user dir. + if (!CFile::isExists("user")) CFile::createDirectory("user"); + #if !FINAL_VERSION // if we're not in final version then start the file access logger to keep track of the files that we read as we play //ICommand::execute("iFileAccessLogStart",*NLMISC::InfoLog); diff --git a/code/ryzom/config.h.cmake b/code/ryzom/config.h.cmake index ac0caa3e0..68b81f02b 100644 --- a/code/ryzom/config.h.cmake +++ b/code/ryzom/config.h.cmake @@ -1,3 +1,6 @@ +#ifndef CONFIG_H +#define CONFIG_H + #cmakedefine HAVE_DL_H 1 #cmakedefine HAVE_EXECINFO_H 1 #cmakedefine HAVE_ICONV 1 @@ -30,3 +33,10 @@ #cmakedefine HAVE_STRTOULL 1 #cmakedefine HAVE_STATVFS 1 #cmakedefine HAVE_STAT64 1 + +#cmakedefine RYZOM_PREFIX "${RYZOM_PREFIX}" +#cmakedefine RYZOM_BIN_PREFIX "${RYZOM_BIN_PREFIX}" +#cmakedefine RYZOM_ETC_PREFIX "${RYZOM_ETC_PREFIX}" +#cmakedefine RYZOM_SHARE_PREFIX "${RYZOM_SHARE_PREFIX}" + +#endif // CONFIG_H From 67ea053ea675e48b71c57085c111b62b3e4aa3c4 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 17 Jul 2010 18:07:23 +0200 Subject: [PATCH 37/52] Changed: #825 Remove all warning when compiling Ryzom --- code/ryzom/client/src/init.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index 157cc9f86..e60366189 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -324,7 +324,7 @@ void ExitClientError (const char *format, ...) MessageBoxW (NULL, (WCHAR*)ucstr.c_str(), (WCHAR*)CI18N::get ("TheSagaOfRyzom").c_str (), MB_OK|MB_ICONERROR); */ #else - fprintf (stderr, str); + fprintf (stderr, "%s\n", str); #endif // Exit extern void quitCrashReport (); From 9d52d7bfd02cb123c54a103f39d777b797cd58cc Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 17 Jul 2010 18:09:03 +0200 Subject: [PATCH 38/52] Changed: #878 Fix typos in comments/code --- code/nel/CMakeModules/nel.cmake | 3 ++- code/ryzom/client/src/CMakeLists.txt | 40 ++++++++++++++-------------- code/ryzom/client/src/init.cpp | 4 +-- 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/code/nel/CMakeModules/nel.cmake b/code/nel/CMakeModules/nel.cmake index a15c30633..d3664cd15 100644 --- a/code/nel/CMakeModules/nel.cmake +++ b/code/nel/CMakeModules/nel.cmake @@ -64,6 +64,7 @@ MACRO(NL_ADD_RUNTIME_FLAGS name) LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}") ENDIF(WIN32) ENDMACRO(NL_ADD_RUNTIME_FLAGS) + ### # Checks build vs. source location. Prevents In-Source builds. ### @@ -228,7 +229,7 @@ MACRO(NL_SETUP_BUILD_FLAGS) ## MinSizeRel SET(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} ${NL_RELEASEDEBUG_CFLAGS} ${PLATFORM_CFLAGS} ") SET(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${NL_RELEASEDEBUG_CFLAGS} ${PLATFORM_CFLAGS} ") - SET(LINK_FLAGS_MINSIZEREL "${CMAKE_LINK_FLAGS_MINSIZEREL} ${NL_RELEASEDEBUG_LINK_CFLAGS} ${PLATFORM_LINKFLAGS} ") + SET(CMAKE_LINK_FLAGS_MINSIZEREL "${CMAKE_LINK_FLAGS_MINSIZEREL} ${NL_RELEASEDEBUG_LINK_CFLAGS} ${PLATFORM_LINKFLAGS} ") ENDMACRO(NL_SETUP_BUILD_FLAGS) MACRO(NL_SETUP_PREFIX_PATHS) diff --git a/code/ryzom/client/src/CMakeLists.txt b/code/ryzom/client/src/CMakeLists.txt index 1d9c8a7bd..3f2e9e5e8 100644 --- a/code/ryzom/client/src/CMakeLists.txt +++ b/code/ryzom/client/src/CMakeLists.txt @@ -10,8 +10,8 @@ ADD_SUBDIRECTORY(client_sheets) FILE(GLOB SRC *.cpp *.h motion/*.cpp motion/*.h motion/modes/*.cpp motion/modes/*.h r2/*.h r2/*.cpp r2/dmc/*.h r2/dmc/*.cpp interface_v3/*.h interface_v3/*.cpp) # Filter out the source files not actually compiled. -LIST(REMOVE_ITEM SRC - ${CMAKE_CURRENT_SOURCE_DIR}/animated_scene_object.cpp +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 @@ -53,7 +53,7 @@ if(APPLE) # COMMAND ${CMAKE_COMMAND} -E make_directory # ${CMAKE_CURRENT_BINARY_DIR}/ryzom_client.app/Contents/Frameworks # # copy framework into app bundle - # COMMAND ${CMAKE_COMMAND} -E copy ${SOME_LIBRARY} + # COMMAND ${CMAKE_COMMAND} -E copy ${SOME_LIBRARY} # ${CMAKE_CURRENT_BINARY_DIR}/ryzom_client.app/Contents/Frameworks # # ... # # install_name_tool the lib pathes @@ -63,24 +63,24 @@ ELSE(APPLE) ENDIF(APPLE) INCLUDE_DIRECTORIES( - ${LIBXML2_INCLUDE_DIR} - ${NEL_INCLUDE_DIR} - ${LUA_INCLUDE_DIR} - ${LIBWWW_INCLUDE_DIR} - ${CURL_INCLUDE_DIRS} + ${LIBXML2_INCLUDE_DIR} + ${NEL_INCLUDE_DIR} + ${LUA_INCLUDE_DIR} + ${LIBWWW_INCLUDE_DIR} + ${CURL_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}) -TARGET_LINK_LIBRARIES(ryzom_client ${PLATFORM_LINKFLAGS} - ${LIBXML2_LIBRARIES} - ${NELMISC_LIBRARY} - ryzom_gameshare - ${NELNET_LIBRARY} - ${NELLIGO_LIBRARY} - ${NELGEORGES_LIBRARY} - ${NEL3D_LIBRARY} - ${LUA_LIBRARIES} - ${CURL_LIBRARIES} - ${NELSOUND_LIBRARY} +TARGET_LINK_LIBRARIES(ryzom_client ${PLATFORM_LINKFLAGS} + ${LIBXML2_LIBRARIES} + ${NELMISC_LIBRARY} + ryzom_gameshare + ${NELNET_LIBRARY} + ${NELLIGO_LIBRARY} + ${NELGEORGES_LIBRARY} + ${NEL3D_LIBRARY} + ${LUA_LIBRARIES} + ${CURL_LIBRARIES} + ${NELSOUND_LIBRARY} ${NELSNDDRV_LIBRARY} ryzom_clientsheets ${NELPACS_LIBRARY} @@ -88,7 +88,7 @@ TARGET_LINK_LIBRARIES(ryzom_client ${PLATFORM_LINKFLAGS} ryzom_sevenzip luabind # TODO: find luabind and expat cleanly using a find script expat) - + IF(NOT WITH_COCOA) TARGET_LINK_LIBRARIES(ryzom_client ${X11_LIBRARIES}) ENDIF(NOT WITH_COCOA) diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index e60366189..b2f38db8e 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -168,7 +168,7 @@ uint TipsOfTheDayIndex; // XML allocator functions -// Due to Bug #906, we disable the stl xml allocation +// Due to Bug #906, we disable the stl xml allocation /* static volatile bool XmlAllocUsesSTL = true; @@ -691,7 +691,7 @@ void prelogInit() // _CrtSetDbgFlag( _CRTDBG_CHECK_CRT_DF ); // Init XML Lib allocator - // Due to Bug #906, we disable the stl xml allocation + // Due to Bug #906, we disable the stl xml allocation // nlverify (xmlMemSetup (XmlFree4NeL, XmlMalloc4NeL, XmlRealloc4NeL, XmlStrdup4NeL) == 0); // Init the debug memory From 64c6a0f756d66ab27c98fec351e30c6ce969d0c6 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 17 Jul 2010 18:09:41 +0200 Subject: [PATCH 39/52] Changed: #1023 Use a standard application path for writing files --- code/nel/src/misc/path.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/nel/src/misc/path.cpp b/code/nel/src/misc/path.cpp index 7ba510aa4..7750ce7d1 100644 --- a/code/nel/src/misc/path.cpp +++ b/code/nel/src/misc/path.cpp @@ -2454,7 +2454,7 @@ std::string CFile::getApplicationDirectory(const std::string &appName) if (!appName.empty()) path = CPath::standardizePath(path + appName); #else - if (!appName.empty)) + if (!appName.empty()) path = CPath::standardizePath(path + "." + toLower(appName)); #endif From 6ec37523e6802c004ece7b8d6e27504683bd7ef3 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 17 Jul 2010 18:21:02 +0200 Subject: [PATCH 40/52] Changed: #973 Added an icon for X11 --- code/ryzom/client/src/init.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index b2f38db8e..a047d9455 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -914,6 +914,23 @@ void prelogInit() // Set the title Driver->setWindowTitle(CI18N::get("TheSagaOfRyzom")); +#if defined(NL_OS_UNIX) && !defined(NL_OS_MAC) + vector bitmaps; + + string fileName = "/usr/share/pixmaps/ryzom.png"; + + CIFile file; + + if (file.open(fileName)) + { + CBitmap bitmap; + if (bitmap.load(file)) + bitmaps.push_back(bitmap); + } + + Driver->setWindowIcon(bitmaps); +#endif + sint32 posX = 0, posY = 0; if (ClientCfg.Windowed) From 45ceec813aee03da1f823d10c6622f83da194c12 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 17 Jul 2010 18:21:25 +0200 Subject: [PATCH 41/52] Changed: #1023 Use a standard application path for writing files --- code/ryzom/client/src/client_cfg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index 5fff82a73..3caa08763 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -2004,7 +2004,7 @@ void CClientConfig::init(const string &configFileName) } else { - nlwarning("CFG::init: '%s' Not Found !!!", cfgFile.c_str()); + nlwarning("CFG::init: '%s' Not Found !!!", defaultConfigFileName.c_str()); } } From cdffd703c1bd5e32cd554c14114b81020805ec75 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 17 Jul 2010 18:22:32 +0200 Subject: [PATCH 42/52] Changed: #982 Remove seven_zip dependency for Mac OS and Linux client --- code/ryzom/client/src/CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/code/ryzom/client/src/CMakeLists.txt b/code/ryzom/client/src/CMakeLists.txt index 3f2e9e5e8..a82b2214c 100644 --- a/code/ryzom/client/src/CMakeLists.txt +++ b/code/ryzom/client/src/CMakeLists.txt @@ -1,8 +1,8 @@ -ADD_SUBDIRECTORY(seven_zip) - # These are Windows/MFC apps IF(WIN32) + ADD_SUBDIRECTORY(seven_zip) ADD_SUBDIRECTORY(bug_report) + SET(SEVENZIP_LIBRARY "ryzom_sevenzip") ENDIF(WIN32) ADD_SUBDIRECTORY(client_sheets) @@ -38,7 +38,7 @@ if(APPLE) SET(MACOSX_BUNDLE_INFO_STRING "Ryzom Core Client") SET(MACOSX_BUNDLE_ICON_FILE "") SET(MACOSX_BUNDLE_GUI_IDENTIFIER "") - SET(MACOSX_BUNDLE_LONG_VERSION_STRING "0.8.0") + SET(MACOSX_BUNDLE_LONG_VERSION_STRING ${NL_VERSION}) SET(MACOSX_BUNDLE_BUNDLE_NAME "Ryzom Core Client") SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "0.8") SET(MACOSX_BUNDLE_BUNDLE_VERSION "1.0") @@ -82,10 +82,10 @@ TARGET_LINK_LIBRARIES(ryzom_client ${PLATFORM_LINKFLAGS} ${CURL_LIBRARIES} ${NELSOUND_LIBRARY} ${NELSNDDRV_LIBRARY} - ryzom_clientsheets - ${NELPACS_LIBRARY} - ${LIBWWW_LIBRARY} - ryzom_sevenzip + ryzom_clientsheets + ${NELPACS_LIBRARY} + ${LIBWWW_LIBRARY} + ${SEVENZIP_LIBRARY} luabind # TODO: find luabind and expat cleanly using a find script expat) From c6ef1a2c7090ca8aaeccedfcf72d2e9ea949623e Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 17 Jul 2010 18:23:24 +0200 Subject: [PATCH 43/52] Changed: #1023 Use a standard application path for writing files --- code/ryzom/CMakeModules/nel.cmake | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/code/ryzom/CMakeModules/nel.cmake b/code/ryzom/CMakeModules/nel.cmake index 105f09bcd..96f935964 100644 --- a/code/ryzom/CMakeModules/nel.cmake +++ b/code/ryzom/CMakeModules/nel.cmake @@ -132,6 +132,15 @@ MACRO(NL_SETUP_BUILD_FLAGS) ENDMACRO(NL_SETUP_BUILD_FLAGS) MACRO(RYZOM_SETUP_PREFIX_PATHS) + ## Allow override of install_prefix path. + IF(NOT RYZOM_PREFIX) + IF(WIN32) + SET(RYZOM_PREFIX "." CACHE PATH "Installation path") + ELSE(WIN32) + SET(RYZOM_PREFIX "${CMAKE_INSTALL_PREFIX}" CACHE PATH "Installation path") + ENDIF(WIN32) + ENDIF(NOT RYZOM_PREFIX) + ## Allow override of install_prefix/etc path. IF(NOT RYZOM_ETC_PREFIX) IF(WIN32) @@ -148,7 +157,7 @@ MACRO(RYZOM_SETUP_PREFIX_PATHS) ELSE(WIN32) SET(RYZOM_SHARE_PREFIX "${CMAKE_INSTALL_PREFIX}/share/ryzom" CACHE PATH "Installation path for data.") ENDIF(WIN32) - ENDIF(NOT NL_SHARE_PREFIX) + ENDIF(NOT RYZOM_SHARE_PREFIX) ## Allow override of install_prefix/sbin path. IF(NOT RYZOM_SBIN_PREFIX) From fb40de2303a450027d29a2f48502407f22f0da22 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 17 Jul 2010 18:30:02 +0200 Subject: [PATCH 44/52] Changed: #991 Make sure all debug files are created in log directory --- .../tools/sheets_packer/sheets_packer.cpp | 1 - .../tools/sheets_packer/sheets_packer.vcproj | 10 +--- .../sheets_packer/sheets_packer_init.cpp | 34 +++++++++---- .../tools/sheets_packer/sheets_packer_init.h | 2 + .../sheets_packer/sheets_packer_release.cpp | 49 ------------------- .../sheets_packer/sheets_packer_release.h | 33 ------------- 6 files changed, 28 insertions(+), 101 deletions(-) delete mode 100644 code/ryzom/tools/sheets_packer/sheets_packer_release.cpp delete mode 100644 code/ryzom/tools/sheets_packer/sheets_packer_release.h diff --git a/code/ryzom/tools/sheets_packer/sheets_packer.cpp b/code/ryzom/tools/sheets_packer/sheets_packer.cpp index e7f6388b3..83fc43173 100644 --- a/code/ryzom/tools/sheets_packer/sheets_packer.cpp +++ b/code/ryzom/tools/sheets_packer/sheets_packer.cpp @@ -35,7 +35,6 @@ // Client #include "sheets_packer_init.h" -#include "sheets_packer_release.h" /////////// diff --git a/code/ryzom/tools/sheets_packer/sheets_packer.vcproj b/code/ryzom/tools/sheets_packer/sheets_packer.vcproj index 9ae25c46f..798fafe68 100644 --- a/code/ryzom/tools/sheets_packer/sheets_packer.vcproj +++ b/code/ryzom/tools/sheets_packer/sheets_packer.vcproj @@ -1,7 +1,7 @@ - - - - diff --git a/code/ryzom/tools/sheets_packer/sheets_packer_init.cpp b/code/ryzom/tools/sheets_packer/sheets_packer_init.cpp index 906e86e7d..f429aa634 100644 --- a/code/ryzom/tools/sheets_packer/sheets_packer_init.cpp +++ b/code/ryzom/tools/sheets_packer/sheets_packer_init.cpp @@ -30,8 +30,6 @@ #include "nel/ligo/ligo_config.h" #include "nel/ligo/primitive.h" -// 3D Interface. -//#include "nel/3d/u_driver.h" // Application #include "sheets_packer_init.h" #include "sheets_packer_cfg.h" @@ -50,8 +48,7 @@ using namespace std; ///////////// // GLOBALS // ///////////// -//UDriver *Driver = 0; -CFileDisplayer fd("sheets_packer.log", true, "SHEETS_PACKER.LOG"); +CFileDisplayer *fd = NULL; NLLIGO::CLigoConfig LigoConfig; @@ -68,14 +65,16 @@ bool init() // Add a displayer for Debug Infos. createDebug(); + fd = new CFileDisplayer(getLogDirectory() + "sheets_packer.log", true, "SHEETS_PACKER.LOG"); + // register ligo 'standard' class NLLIGO::Register(); - DebugLog->addDisplayer (&fd); - InfoLog->addDisplayer (&fd); - WarningLog->addDisplayer (&fd); - ErrorLog->addDisplayer (&fd); - AssertLog->addDisplayer (&fd); + DebugLog->addDisplayer (fd); + InfoLog->addDisplayer (fd); + WarningLog->addDisplayer (fd); + ErrorLog->addDisplayer (fd); + AssertLog->addDisplayer (fd); // Load the application configuration. nlinfo("Loading config file..."); @@ -104,6 +103,23 @@ bool init() // The init is a success. return true; }// init // + +//--------------------------------------------------- +// release : +// Release all the memory. +//--------------------------------------------------- +void release() +{ + DebugLog->removeDisplayer ("SHEETS_PACKER.LOG"); + InfoLog->removeDisplayer ("SHEETS_PACKER.LOG"); + WarningLog->removeDisplayer ("SHEETS_PACKER.LOG"); + ErrorLog->removeDisplayer ("SHEETS_PACKER.LOG"); + AssertLog->removeDisplayer ("SHEETS_PACKER.LOG"); + + delete fd; + fd = NULL; +}// release // + void outputSomeDebugInfoForPackedSheetCrash() { } diff --git a/code/ryzom/tools/sheets_packer/sheets_packer_init.h b/code/ryzom/tools/sheets_packer/sheets_packer_init.h index 1bdcd4e94..26c476a7c 100644 --- a/code/ryzom/tools/sheets_packer/sheets_packer_init.h +++ b/code/ryzom/tools/sheets_packer/sheets_packer_init.h @@ -27,6 +27,8 @@ // Initialize the application. bool init(); +// Release all. +void release(); #endif // TL_SHEETS_PACKER_INIT_H diff --git a/code/ryzom/tools/sheets_packer/sheets_packer_release.cpp b/code/ryzom/tools/sheets_packer/sheets_packer_release.cpp deleted file mode 100644 index 1f08c1cc4..000000000 --- a/code/ryzom/tools/sheets_packer/sheets_packer_release.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// Ryzom - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - - - - -///////////// -// INCLUDE // -///////////// -#include "stdpch.h" -#include "sheets_packer_release.h" - -#include "nel/misc/debug.h" - - -/////////// -// USING // -/////////// -using namespace NLMISC; - - -/////////////// -// FUNCTIONS // -/////////////// -//--------------------------------------------------- -// release : -// Release all the memory. -//--------------------------------------------------- -void release() -{ - DebugLog->removeDisplayer ("SHEETS_PACKER.LOG"); - InfoLog->removeDisplayer ("SHEETS_PACKER.LOG"); - WarningLog->removeDisplayer ("SHEETS_PACKER.LOG"); - ErrorLog->removeDisplayer ("SHEETS_PACKER.LOG"); - AssertLog->removeDisplayer ("SHEETS_PACKER.LOG"); -}// release // diff --git a/code/ryzom/tools/sheets_packer/sheets_packer_release.h b/code/ryzom/tools/sheets_packer/sheets_packer_release.h deleted file mode 100644 index 0ac0cf7be..000000000 --- a/code/ryzom/tools/sheets_packer/sheets_packer_release.h +++ /dev/null @@ -1,33 +0,0 @@ -// Ryzom - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - - - -#ifndef TL_SHEETS_PACKER_RELEASE_H -#define TL_SHEETS_PACKER_RELEASE_H - -#include "nel/misc/types_nl.h" - - - -// Release all. -void release(); - - - -#endif // TL_SHEETS_PACKER_RELEASE_H - -/* End of sheets_packer_release.h */ From 2a91013055651eab820429ac25bc3eb9a1295a08 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 17 Jul 2010 18:46:24 +0200 Subject: [PATCH 45/52] Changed: #842 Added new files for X11 applications --- code/ryzom/client/unix/ryzom.desktop.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/ryzom/client/unix/ryzom.desktop.in b/code/ryzom/client/unix/ryzom.desktop.in index da04de87c..ded90c67f 100644 --- a/code/ryzom/client/unix/ryzom.desktop.in +++ b/code/ryzom/client/unix/ryzom.desktop.in @@ -1,9 +1,11 @@ [Desktop Entry] Version=1.0 Name=Ryzom +Name[ru]=Ризом Type=Application GenericName=ryzom -Comment=Ryzom MMORPG client +Comment=Ryzom client +Comment[fr_FR]=Client Ryzom Exec=${RYZOM_BIN_PREFIX}/ryzom_client Icon=ryzom Terminal=false From 4441f54bbaee9d0e4e2613249a1a008a333b6079 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 17 Jul 2010 18:47:38 +0200 Subject: [PATCH 46/52] Changed: only check screenshot folder presence one time --- .../ryzom/client/src/interface_v3/action_handler_misc.cpp | 8 +++++--- code/ryzom/client/src/interface_v3/action_handler_misc.h | 1 + code/ryzom/client/src/main_loop.cpp | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/action_handler_misc.cpp b/code/ryzom/client/src/interface_v3/action_handler_misc.cpp index 9a4f5f232..565165987 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_misc.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_misc.cpp @@ -595,12 +595,16 @@ void displayScreenShotSavedInfo(const string &filename) pIM->displaySystemInfo(msg); } +void initScreenshot() +{ + if (!CFile::isExists(ScreenshotsDirectory)) CFile::createDirectory(ScreenshotsDirectory); +} + void screenShotTGA() { CBitmap btm; getBuffer (btm); - if(!ScreenshotsDirectory.empty() && !CFile::isExists(ScreenshotsDirectory)) CFile::createDirectory(ScreenshotsDirectory); string filename = CFile::findNewFile (ScreenshotsDirectory+"screenshot.tga"); COFile fs(filename); btm.writeTGA(fs, 24, false); @@ -613,7 +617,6 @@ void screenShotPNG() CBitmap btm; getBuffer (btm); - if(!ScreenshotsDirectory.empty() && !CFile::isExists(ScreenshotsDirectory)) CFile::createDirectory(ScreenshotsDirectory); string filename = CFile::findNewFile (ScreenshotsDirectory+"screenshot.png"); COFile fs(filename); if (!btm.writePNG(fs, 24)) @@ -634,7 +637,6 @@ void screenShotJPG() CBitmap btm; getBuffer (btm); - if(!ScreenshotsDirectory.empty() && !CFile::isExists(ScreenshotsDirectory)) CFile::createDirectory(ScreenshotsDirectory); string filename = CFile::findNewFile (ScreenshotsDirectory+"screenshot.jpg"); COFile fs(filename); btm.writeJPG(fs); diff --git a/code/ryzom/client/src/interface_v3/action_handler_misc.h b/code/ryzom/client/src/interface_v3/action_handler_misc.h index 39e9c9eb0..5e9328832 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_misc.h +++ b/code/ryzom/client/src/interface_v3/action_handler_misc.h @@ -174,6 +174,7 @@ public: /** Capture current content of framebuffer and save the result. If a custom size is asked in ClientCfg, then the scene is rendered again * instead (possibly multiple time) */ +void initScreenshot(); void screenShotTGA(); void screenShotPNG(); void screenShotJPG(); diff --git a/code/ryzom/client/src/main_loop.cpp b/code/ryzom/client/src/main_loop.cpp index 430c0a81c..d995c0ed8 100644 --- a/code/ryzom/client/src/main_loop.cpp +++ b/code/ryzom/client/src/main_loop.cpp @@ -1443,6 +1443,9 @@ bool mainLoop() // initialize the structure for the ping. Ping.init(); + // initialize screenshots directory + initScreenshot(); + // Call a function for a demo to init. if (ClientCfg.Local) From a759eb65ef612ad822794bcb950730b1c78909d3 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 17 Jul 2010 18:56:01 +0200 Subject: [PATCH 47/52] Changed: cbDirectoryChanged now displays a warning if it couldn't change directory --- code/nel/src/net/service.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/code/nel/src/net/service.cpp b/code/nel/src/net/service.cpp index 9f917e21b..8f57d1c92 100644 --- a/code/nel/src/net/service.cpp +++ b/code/nel/src/net/service.cpp @@ -254,11 +254,7 @@ void cbDirectoryChanged (IVariable &var) // Update the running directory if needed if (var.getName() == "RunningDirectory") { -#ifdef NL_OS_WINDOWS - _chdir (vp.c_str()); -#else - chdir (vp.c_str()); -#endif + CPath::setCurrentPath(vp); } // Call the callback if provided From 58b223ce763fa0fd892b7f0c67765e2113a53715 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 17 Jul 2010 22:41:13 +0200 Subject: [PATCH 48/52] Changed: #842 Removed CMake unused files --- code/ryzom/CMakeModules/FindGTK2.cmake | 452 ------------------------- 1 file changed, 452 deletions(-) delete mode 100644 code/ryzom/CMakeModules/FindGTK2.cmake diff --git a/code/ryzom/CMakeModules/FindGTK2.cmake b/code/ryzom/CMakeModules/FindGTK2.cmake deleted file mode 100644 index a1df38350..000000000 --- a/code/ryzom/CMakeModules/FindGTK2.cmake +++ /dev/null @@ -1,452 +0,0 @@ -# - Try to find GTK2 -# Once done this will define -# -# GTK2_FOUND - System has Boost -# GTK2_INCLUDE_DIRS - GTK2 include directory -# GTK2_LIBRARIES - Link these to use GTK2 -# GTK2_LIBRARY_DIRS - The path to where the GTK2 library files are. -# GTK2_DEFINITIONS - Compiler switches required for using GTK2 -# -# Copyright (c) 2007 Andreas Schneider -# -# Redistribution and use is allowed according to the terms of the New -# BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. -# - -set(GTK2_DEBUG ON) - -macro(GTK2_DEBUG_MESSAGE _message) - if (GTK2_DEBUG) - message(STATUS "(DEBUG) ${_message}") - endif (GTK2_DEBUG) -endmacro(GTK2_DEBUG_MESSAGE _message) - -if (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS) - # in cache already - set(GTK2_FOUND TRUE) -else (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS) - if (UNIX) - # use pkg-config to get the directories and then use these values - # in the FIND_PATH() and FIND_LIBRARY() calls - include(UsePkgConfig) - - pkgconfig(gtk+-2.0 _GTK2IncDir _GTK2LinkDir _GTK2LinkFlags _GTK2Cflags) - - find_path(GTK2_GTK_INCLUDE_DIR - NAMES - gtk/gtk.h - PATHS - $ENV{GTK2_HOME} - ${_GTK2IncDir} - /usr/include/gtk-2.0 - /usr/local/include/gtk-2.0 - /opt/include/gtk-2.0 - /opt/gnome/include/gtk-2.0 - /sw/include/gtk-2.0 - ) - gtk2_debug_message("GTK2_GTK_INCLUDE_DIR is ${GTK2_GTK_INCLUDE_DIR}") - - # Some Linux distributions (e.g. Red Hat) have glibconfig.h - # and glib.h in different directories, so we need to look - # for both. - # - Atanas Georgiev - pkgconfig(glib-2.0 _GLIB2IncDir _GLIB2LinkDir _GLIB2LinkFlags _GLIB2Cflags) - pkgconfig(gmodule-2.0 _GMODULE2IncDir _GMODULE2LinkDir _GMODULE2LinkFlags _GMODULE2Cflags) - - find_path(GTK2_GLIBCONFIG_INCLUDE_DIR - NAMES - glibconfig.h - PATHS - ${_GLIB2IncDir} - ${_GMODULE2IncDir} - /opt/gnome/lib64/glib-2.0/include - /opt/gnome/lib/glib-2.0/include - /opt/lib/glib-2.0/include - /usr/lib64/glib-2.0/include - /usr/lib/glib-2.0/include - /sw/lib/glib-2.0/include - ) - gtk2_debug_message("GTK2_GLIBCONFIG_INCLUDE_DIR is ${GTK2_GLIBCONFIG_INCLUDE_DIR}") - - find_path(GTK2_GLIB_INCLUDE_DIR - NAMES - glib.h - PATHS - ${_GLIB2IncDir} - ${_GMODULE2IncDir} - /opt/include/glib-2.0 - /opt/gnome/include/glib-2.0 - /usr/include/glib-2.0 - /sw/include/glib-2.0 - ) - gtk2_debug_message("GTK2_GLIB_INCLUDE_DIR is ${GTK2_GLIB_INCLUDE_DIR}") - - pkgconfig(gdk-2.0 _GDK2IncDir _GDK2LinkDir _GDK2LinkFlags _GDK2Cflags) - - find_path(GTK2_GDK_INCLUDE_DIR - NAMES - gdkconfig.h - PATHS - ${_GDK2IncDir} - /opt/gnome/lib/gtk-2.0/include - /opt/gnome/lib64/gtk-2.0/include - /opt/lib/gtk-2.0/include - /usr/lib/gtk-2.0/include - /usr/lib64/gtk-2.0/include - /sw/lib/gtk-2.0/include - ) - gtk2_debug_message("GTK2_GDK_INCLUDE_DIR is ${GTK2_GDK_INCLUDE_DIR}") - - find_path(GTK2_GTKGL_INCLUDE_DIR - NAMES - gtkgl/gtkglarea.h - PATHS - ${_GLIB2IncDir} - /usr/include - /usr/include/gtkgl-2.0 - /usr/local/include - /usr/openwin/share/include - /opt/gnome/include - /opt/include - /sw/include - ) - gtk2_debug_message("GTK2_GTKGL_INCLUDE_DIR is ${GTK2_GTKGL_INCLUDE_DIR}") - - pkgconfig(libglade-2.0 _GLADEIncDir _GLADELinkDir _GLADELinkFlags _GLADECflags) - - find_path(GTK2_GLADE_INCLUDE_DIR - NAMES - glade/glade.h - PATHS - ${_GLADEIncDir} - /opt/gnome/include/libglade-2.0 - /usr/include/libglade-2.0 - /opt/include/libglade-2.0 - /sw/include/libglade-2.0 - ) - gtk2_debug_message("GTK2_GLADE_INCLUDE_DIR is ${GTK2_GLADE_INCLUDE_DIR}") - - pkgconfig(pango _PANGOIncDir _PANGOLinkDir _PANGOLinkFlags _PANGOCflags) - - find_path(GTK2_PANGO_INCLUDE_DIR - NAMES - pango/pango.h - PATHS - ${_PANGOIncDir} - /usr/include/pango-1.0 - /opt/gnome/include/pango-1.0 - /opt/include/pango-1.0 - /sw/include/pango-1.0 - ) - gtk2_debug_message("GTK2_PANGO_INCLUDE_DIR is ${GTK2_PANGO_INCLUDE_DIR}") - - pkgconfig(cairo _CAIROIncDir _CAIROLinkDir _CAIROLinkFlags _CAIROCflags) - - find_path(GTK2_CAIRO_INCLUDE_DIR - NAMES - cairo.h - PATHS - ${_CAIROIncDir} - /opt/gnome/include/cairo - /usr/include - /usr/include/cairo - /opt/include - /opt/include/cairo - /sw/include - /sw/include/cairo - ) - gtk2_debug_message("GTK2_CAIRO_INCLUDE_DIR is ${GTK2_CAIRO_INCLUDE_DIR}") - - pkgconfig(atk _ATKIncDir _ATKLinkDir _ATKLinkFlags _ATKCflags) - - find_path(GTK2_ATK_INCLUDE_DIR - NAMES - atk/atk.h - PATHS - ${_ATKIncDir} - /opt/gnome/include/atk-1.0 - /usr/include/atk-1.0 - /opt/include/atk-1.0 - /sw/include/atk-1.0 - ) - gtk2_debug_message("GTK2_ATK_INCLUDE_DIR is ${GTK2_ATK_INCLUDE_DIR}") - - find_library(GTK2_GTK_LIBRARY - NAMES - gtk-x11-2.0 - PATHS - ${_GTK2LinkDir} - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - /opt/lib - /sw/lib - ) - gtk2_debug_message("GTK2_GTK_LIBRARY is ${GTK2_GTK_LIBRARY}") - - find_library(GTK2_GDK_LIBRARY - NAMES - gdk-x11-2.0 - PATHS - ${_GDK2LinkDir} - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - /opt/lib - /sw/lib - ) - gtk2_debug_message("GTK2_GDK_LIBRARY is ${GTK2_GDK_LIBRARY}") - - find_library(GTK2_GDK_PIXBUF_LIBRARY - NAMES - gdk_pixbuf-2.0 - PATHS - ${_GDK2LinkDir} - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - /opt/lib - /sw/lib - ) - gtk2_debug_message("GTK2_GDK_PIXBUF_LIBRARY is ${GTK2_GDK_PIXBUF_LIBRARY}") - - find_library(GTK2_GMODULE_LIBRARY - NAMES - gmodule-2.0 - PATHS - ${_GMODULE2LinkDir} - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - /opt/lib - /sw/lib - ) - gtk2_debug_message("GTK2_GMODULE_LIBRARY is ${GTK2_GMODULE_LIBRARY}") - - find_library(GTK2_GTHREAD_LIBRARY - NAMES - gthread-2.0 - PATHS - ${_GTK2LinkDir} - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - /opt/lib - /sw/lib - ) - gtk2_debug_message("GTK2_GTHREAD_LIBRARY is ${GTK2_GTHREAD_LIBRARY}") - - find_library(GTK2_GOBJECT_LIBRARY - NAMES - gobject-2.0 - PATHS - ${_GTK2LinkDir} - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - /opt/lib - /sw/lib - ) - gtk2_debug_message("GTK2_GOBJECT_LIBRARY is ${GTK2_GOBJECT_LIBRARY}") - - find_library(GTK2_GLIB_LIBRARY - NAMES - glib-2.0 - PATHS - ${_GLIB2LinkDir} - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - /opt/lib - /sw/lib - ) - gtk2_debug_message("GTK2_GLIB_LIBRARY is ${GTK2_GLIB_LIBRARY}") - - find_library(GTK2_GTKGL_LIBRARY - NAMES - gtkgl-2.0 - PATHS - ${_GTK2LinkDir} - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - /opt/lib - /sw/lib - ) - gtk2_debug_message("GTK2_GTKGL_LIBRARY is ${GTK2_GTKGL_LIBRARY}") - - find_library(GTK2_GLADE_LIBRARY - NAMES - glade-2.0 - PATHS - ${_GLADELinkDir} - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - /opt/lib - /sw/lib - ) - gtk2_debug_message("GTK2_GLADE_LIBRARY is ${GTK2_GLADE_LIBRARY}") - - find_library(GTK2_PANGO_LIBRARY - NAMES - pango-1.0 - PATHS - ${_PANGOLinkDir} - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - /opt/lib - /sw/lib - ) - gtk2_debug_message("GTK2_PANGO_LIBRARY is ${GTK2_PANGO_LIBRARY}") - - find_library(GTK2_CAIRO_LIBRARY - NAMES - pangocairo-1.0 - PATHS - ${_CAIROLinkDir} - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - /opt/lib - /sw/lib - ) - gtk2_debug_message("GTK2_PANGO_LIBRARY is ${GTK2_CAIRO_LIBRARY}") - - find_library(GTK2_ATK_LIBRARY - NAMES - atk-1.0 - PATHS - ${_ATKinkDir} - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - /opt/lib - /sw/lib - ) - gtk2_debug_message("GTK2_ATK_LIBRARY is ${GTK2_ATK_LIBRARY}") - - set(GTK2_INCLUDE_DIRS - ${GTK2_GTK_INCLUDE_DIR} - ${GTK2_GLIBCONFIG_INCLUDE_DIR} - ${GTK2_GLIB_INCLUDE_DIR} - ${GTK2_GDK_INCLUDE_DIR} - ${GTK2_GLADE_INCLUDE_DIR} - ${GTK2_PANGO_INCLUDE_DIR} - ${GTK2_CAIRO_INCLUDE_DIR} - ${GTK2_ATK_INCLUDE_DIR} - ) - - if (GTK2_GTK_LIBRARY AND GTK2_GTK_INCLUDE_DIR) - if (GTK2_GDK_LIBRARY AND GTK2_GDK_PIXBUF_LIBRARY AND GTK2_GDK_INCLUDE_DIR) - if (GTK2_GMODULE_LIBRARY) - if (GTK2_GTHREAD_LIBRARY) - if (GTK2_GOBJECT_LIBRARY) - if (GTK2_GLADE_LIBRARY AND GTK2_GLADE_INCLUDE_DIR) - if (GTK2_PANGO_LIBRARY AND GTK2_PANGO_INCLUDE_DIR) - if (GTK2_CAIRO_LIBRARY AND GTK2_CAIRO_INCLUDE_DIR) - if (GTK2_ATK_LIBRARY AND GTK2_ATK_INCLUDE_DIR) - - # set GTK2 libraries - set (GTK2_LIBRARIES - ${GTK2_GTK_LIBRARY} - ${GTK2_GDK_LIBRARY} - ${GTK2_GDK_PIXBUF_LIBRARY} - ${GTK2_GMODULE_LIBRARY} - ${GTK2_GTHREAD_LIBRARY} - ${GTK2_GOBJECT_LIBRARY} - ${GTK2_GLADE_LIBRARY} - ${GTK2_PANGO_LIBRARY} - ${GTK2_CAIRO_LIBRARY} - ${GTK2_ATK_LIBRARY} - ) - - # check for gtkgl support - if (GTK2_GTKGL_LIBRARY AND GTK2_GTKGL_INCLUDE_DIR) - set(GTK2_GTKGL_FOUND TRUE) - - set(GTK2_INCLUDE_DIRS - ${GTK2_INCLUDE_DIRS} - ${GTK2_GTKGL_INCLUDE_DIR} - ) - - set(GTK2_LIBRARIES - ${GTK2_LIBRARIES} - ${GTK2_GTKGL_LIBRARY} - ) - endif (GTK2_GTKGL_LIBRARY AND GTK2_GTKGL_INCLUDE_DIR) - - else (GTK2_ATK_LIBRARY AND GTK2_ATK_INCLUDE_DIR) - message(SEND_ERROR "Could not find ATK") - endif (GTK2_ATK_LIBRARY AND GTK2_ATK_INCLUDE_DIR) - else (GTK2_CAIRO_LIBRARY AND GTK2_CAIRO_INCLUDE_DIR) - message(SEND_ERROR "Could not find CAIRO") - endif (GTK2_CAIRO_LIBRARY AND GTK2_CAIRO_INCLUDE_DIR) - else (GTK2_PANGO_LIBRARY AND GTK2_PANGO_INCLUDE_DIR) - message(SEND_ERROR "Could not find PANGO") - endif (GTK2_PANGO_LIBRARY AND GTK2_PANGO_INCLUDE_DIR) - else (GTK2_GLADE_LIBRARY AND GTK2_GLADE_INCLUDE_DIR) - message(SEND_ERROR "Could not find GLADE") - endif (GTK2_GLADE_LIBRARY AND GTK2_GLADE_INCLUDE_DIR) - else (GTK2_GOBJECT_LIBRARY) - message(SEND_ERROR "Could not find GOBJECT") - endif (GTK2_GOBJECT_LIBRARY) - else (GTK2_GTHREAD_LIBRARY) - message(SEND_ERROR "Could not find GTHREAD") - endif (GTK2_GTHREAD_LIBRARY) - else (GTK2_GMODULE_LIBRARY) - message(SEND_ERROR "Could not find GMODULE") - endif (GTK2_GMODULE_LIBRARY) - else (GTK2_GDK_LIBRARY AND GTK2_GDK_PIXBUF_LIBRARY AND GTK2_GDK_INCLUDE_DIR) - message(SEND_ERROR "Could not find GDK (GDK_PIXBUF)") - endif (GTK2_GDK_LIBRARY AND GTK2_GDK_PIXBUF_LIBRARY AND GTK2_GDK_INCLUDE_DIR) - else (GTK2_GTK_LIBRARY AND GTK2_GTK_INCLUDE_DIR) - message(SEND_ERROR "Could not find GTK2-X11") - endif (GTK2_GTK_LIBRARY AND GTK2_GTK_INCLUDE_DIR) - - if (GTK2_INCLUDE_DIRS AND GTK2_LIBRARIES) - set(GTK2_FOUND TRUE) - endif (GTK2_INCLUDE_DIRS AND GTK2_LIBRARIES) - - if (GTK2_FOUND) - if (NOT GTK2_FIND_QUIETLY) - message(STATUS "Found GTK2: ${GTK2_LIBRARIES}") - endif (NOT GTK2_FIND_QUIETLY) - else (GTK2_FOUND) - if (GTK2_FIND_REQUIRED) - message(FATAL_ERROR "Could not find GTK2") - endif (GTK2_FIND_REQUIRED) - endif (GTK2_FOUND) - - # show the GTK2_INCLUDE_DIRS and GTK2_LIBRARIES variables only in the advanced view - mark_as_advanced(GTK2_INCLUDE_DIRS GTK2_LIBRARIES) - - endif (UNIX) -endif (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS) - From 5d9a8e2d0617db1e82c1255bbe5cb44ac6507fe4 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 17 Jul 2010 23:04:22 +0200 Subject: [PATCH 49/52] Changed: #842 Added FINAL_VERSION for NeL --- code/nel/CMakeLists.txt | 4 ++++ code/nel/CMakeModules/nel.cmake | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/code/nel/CMakeLists.txt b/code/nel/CMakeLists.txt index 10b987724..ff075e315 100644 --- a/code/nel/CMakeLists.txt +++ b/code/nel/CMakeLists.txt @@ -185,6 +185,10 @@ NL_SETUP_BUILD_FLAGS() INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/PCHSupport.cmake) +IF(FINAL_VERSION) + ADD_DEFINITIONS(-DFINAL_VERSION=1) +ENDIF(FINAL_VERSION) + ADD_SUBDIRECTORY(src) ADD_SUBDIRECTORY(include) diff --git a/code/nel/CMakeModules/nel.cmake b/code/nel/CMakeModules/nel.cmake index d3664cd15..4a3720618 100644 --- a/code/nel/CMakeModules/nel.cmake +++ b/code/nel/CMakeModules/nel.cmake @@ -91,15 +91,16 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS) OPTION(WITH_LOGGING "With Logging" ON ) OPTION(WITH_COVERAGE "With Code Coverage Support" OFF) OPTION(WITH_PCH "With Precompiled Headers" ON ) - + OPTION(FINAL_VERSION "Build in Final Version mode" ON ) + # Default to static building on Windows. IF(WIN32) OPTION(WITH_STATIC "With static libraries." ON ) ELSE(WIN32) OPTION(WITH_STATIC "With static libraries." OFF) ENDIF(WIN32) - OPTION(WITH_STATIC_DRIVERS "With static drivers." OFF) - + OPTION(WITH_STATIC_DRIVERS "With static drivers." OFF) + ### # Core libraries ### From c33cc5575a89d08226d421bb7a3914184602b4a6 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 17 Jul 2010 23:26:55 +0200 Subject: [PATCH 50/52] Changed: #1023 Use a standard application path for writing files --- code/ryzom/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ryzom/CMakeLists.txt b/code/ryzom/CMakeLists.txt index db44a106a..aac342408 100644 --- a/code/ryzom/CMakeLists.txt +++ b/code/ryzom/CMakeLists.txt @@ -117,7 +117,7 @@ ENDIF(FINAL_VERSION) # config.h configuration and use by projects CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h) INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}) -ADD_DEFINITIONS(-DHAVE_CONFIG_H=1) +ADD_DEFINITIONS(-DHAVE_CONFIG_H) ADD_SUBDIRECTORY(common) From 2301fa03a5be6d54a6cf100f89f424553059be07 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 18 Jul 2010 10:51:16 +0200 Subject: [PATCH 51/52] Fixed: #1024 Ryzom-client requires Cmake 2.8 - Not standard in Ubuntu 9.04 --- code/ryzom/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ryzom/CMakeLists.txt b/code/ryzom/CMakeLists.txt index aac342408..77b1ceb02 100644 --- a/code/ryzom/CMakeLists.txt +++ b/code/ryzom/CMakeLists.txt @@ -36,7 +36,7 @@ ELSE(NOT NL_USING_MASTER_PROJECT) SET(CMAKE_LIBRARY_PATH "${CMAKE_BINARY_DIR}/lib;${CMAKE_LIBRARY_PATH}") ENDIF(NOT NL_USING_MASTER_PROJECT) -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(Ryzom CXX C) SET(NL_VERSION_MAJOR 0) From 0e25ebbfcdec4af28e6df83b48387c8839c3556c Mon Sep 17 00:00:00 2001 From: vl Date: Mon, 19 Jul 2010 10:11:00 +0200 Subject: [PATCH 52/52] Changed: Display fps and spf on SHIFT+F2 --- .../client/src/interface_v3/action_handler_debug.cpp | 2 ++ code/ryzom/client/src/main_loop.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/action_handler_debug.cpp b/code/ryzom/client/src/interface_v3/action_handler_debug.cpp index eaa24e354..cfaeac55f 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_debug.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_debug.cpp @@ -71,7 +71,9 @@ class CAHDisplayInfos : public IActionHandler { // can only be used by devs and CSR or in local mode #if FINAL_VERSION +# ifdef NL_OS_WINDOWS if( ClientCfg.Local || hasPrivilegeDEV() || hasPrivilegeSGM() || hasPrivilegeGM() || hasPrivilegeSG() || hasPrivilegeEM() || hasPrivilegeVG() ) +# endif #endif { ShowInfos = (ShowInfos+1)%6; diff --git a/code/ryzom/client/src/main_loop.cpp b/code/ryzom/client/src/main_loop.cpp index d995c0ed8..f085844dc 100644 --- a/code/ryzom/client/src/main_loop.cpp +++ b/code/ryzom/client/src/main_loop.cpp @@ -3095,15 +3095,15 @@ void displayDebugFps() line = 0.9f; // Ms per frame { + float spf = smoothFPS.getSmoothValue (); // Ms per frame - TextContext->printfAt(0.1f, line, "%.1f ms", smoothFPS.getSmoothValue ()*1000); + TextContext->printfAt(0.1f, line, "FPS %.1f ms - %.1f fps", spf*1000, 1.f/spf); line-= lineStep; // More Smoothed Ms per frame - TextContext->printfAt(0.1f, line, "%.1f ms", moreSmoothFPS.getSmoothValue ()*1000); + spf = moreSmoothFPS.getSmoothValue (); + TextContext->printfAt(0.1f, line, "Smoothed FPS %.1f ms - %.1f fps", spf*1000, 1.f/spf); line-= lineStep; } - - } static NLMISC::CRefPtr HighlightedDebugUI;