From b3a392d559e3ba5c8b820248d8fdd117c4e8d3b2 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 7 Jan 2016 17:36:17 +0100 Subject: [PATCH 1/4] Changed: Minor changes --HG-- branch : develop --- code/nel/include/nel/misc/class_id.h | 2 +- code/nel/include/nel/misc/entity_id.h | 2 +- code/nel/include/nel/misc/sheet_id.h | 2 +- code/nel/include/nel/misc/string_mapper.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/code/nel/include/nel/misc/class_id.h b/code/nel/include/nel/misc/class_id.h index d02fc5646..c24ba8538 100644 --- a/code/nel/include/nel/misc/class_id.h +++ b/code/nel/include/nel/misc/class_id.h @@ -61,7 +61,7 @@ public: class CClassIdHashMapTraits { public: - enum { bucket_size = 4, min_buckets = 8, }; + enum { bucket_size = 4, min_buckets = 8 }; inline size_t operator() ( const CClassId& classId ) const { return ((((uint64)classId >> 32)|0xFFFFFFFF) ^ (((uint64)classId|0xFFFFFFFF) & 0xFFFFFFFF)); diff --git a/code/nel/include/nel/misc/entity_id.h b/code/nel/include/nel/misc/entity_id.h index 8c80daaba..25c744f4e 100644 --- a/code/nel/include/nel/misc/entity_id.h +++ b/code/nel/include/nel/misc/entity_id.h @@ -575,7 +575,7 @@ public: // Traits for hash_map using CEntityId struct CEntityIdHashMapTraits { - enum { bucket_size = 4, min_buckets = 8, }; + enum { bucket_size = 4, min_buckets = 8 }; CEntityIdHashMapTraits() { } size_t operator() (const NLMISC::CEntityId &id ) const { diff --git a/code/nel/include/nel/misc/sheet_id.h b/code/nel/include/nel/misc/sheet_id.h index b11e97188..7a735d3a4 100644 --- a/code/nel/include/nel/misc/sheet_id.h +++ b/code/nel/include/nel/misc/sheet_id.h @@ -248,7 +248,7 @@ private : class CSheetIdHashMapTraits { public: - enum { bucket_size = 4, min_buckets = 8, }; + enum { bucket_size = 4, min_buckets = 8 }; inline size_t operator() ( const CSheetId& sheetId ) const { return sheetId.asInt() >> 5; diff --git a/code/nel/include/nel/misc/string_mapper.h b/code/nel/include/nel/misc/string_mapper.h index 1f62dd123..a20489f1c 100644 --- a/code/nel/include/nel/misc/string_mapper.h +++ b/code/nel/include/nel/misc/string_mapper.h @@ -39,7 +39,7 @@ typedef const std::string *TStringId; // Traits for hash_map using CStringId struct CStringIdHashMapTraits { - enum { bucket_size = 4, min_buckets = 8, }; + enum { bucket_size = 4, min_buckets = 8 }; CStringIdHashMapTraits() { } size_t operator() (const NLMISC::TStringId &stringId) const { From 51ec04b761ffb6ded26e2c268fc3ad82ed72cf87 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 7 Jan 2016 17:39:11 +0100 Subject: [PATCH 2/4] Changed: Added VideoMemory variable in cfg to force video memory to use (useful if Ryzom can't detect the correct amount of video memory or when using several clients at once) --HG-- branch : develop --- code/ryzom/client/src/client_cfg.cpp | 3 +++ code/ryzom/client/src/client_cfg.h | 2 ++ code/ryzom/client/src/init_main_loop.cpp | 26 ++++++++++++++++-------- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index 76d730156..83f73afae 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -419,6 +419,7 @@ CClientConfig::CClientConfig() HDTextureInstalled = false; Fog = true; // Fog is on by default WaitVBL = false; + VideoMemory = 0; FXAA = true; @@ -1051,6 +1052,8 @@ void CClientConfig::setValues() // WaitVBL READ_BOOL_FV(WaitVBL) + // VideoMemory + READ_INT_FV(VideoMemory); READ_INT_DEV(TimerMode) diff --git a/code/ryzom/client/src/client_cfg.h b/code/ryzom/client/src/client_cfg.h index bbf9e4562..75c7698da 100644 --- a/code/ryzom/client/src/client_cfg.h +++ b/code/ryzom/client/src/client_cfg.h @@ -255,6 +255,8 @@ struct CClientConfig bool Fog; /// Enable/Disable VSync bool WaitVBL; + /// Force or auto-detect video memory (in MiB) + sint VideoMemory; /// Timer mode. 0 : QueryPerformanceCounter, 1 : timeGetTime. uint TimerMode; diff --git a/code/ryzom/client/src/init_main_loop.cpp b/code/ryzom/client/src/init_main_loop.cpp index a07f74de4..dc9a907b7 100644 --- a/code/ryzom/client/src/init_main_loop.cpp +++ b/code/ryzom/client/src/init_main_loop.cpp @@ -891,18 +891,28 @@ void initMainLoop() // only detect amount of video memory if using HD textures if (ClientCfg.HDEntityTexture) { - // determine video memory using 3D driver - videoMemory = Driver->getTotalVideoMemory(); + if (ClientCfg.VideoMemory <= 0) + { + // determine video memory using 3D driver + videoMemory = Driver->getTotalVideoMemory(); - // if unable to determine, use plaform methods - if (videoMemory < 0) videoMemory = CSystemUtils::getTotalVideoMemory(); + // if unable to determine, use plaform methods + if (videoMemory <= 0) videoMemory = CSystemUtils::getTotalVideoMemory(); - // in the worst case, use default value of 128 MiB - if (videoMemory < 0) videoMemory = 128 * 1024; + // in the worst case, use default value of 128 MiB + if (videoMemory <= 0) videoMemory = 128 * 1024; - videoMemory /= 1024; // size in MiB + videoMemory /= 1024; // size in MiB - nlinfo("Video memory detected: %d MiB", videoMemory); + nlinfo("Video memory detected: %d MiB", videoMemory); + } + else + { + // force video memory (at least 32 MiB) + videoMemory = ClientCfg.VideoMemory < 32 ? 32:ClientCfg.VideoMemory; + + nlinfo("Video memory forced: %d MiB", videoMemory); + } } else { From 9e8cd07e4bd9eb71ec2ab511c247344988b36481 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 7 Jan 2016 17:39:53 +0100 Subject: [PATCH 3/4] Changed: HAVE_X86_64 is defined or not --HG-- branch : develop --- code/nel/include/nel/misc/entity_id.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/nel/include/nel/misc/entity_id.h b/code/nel/include/nel/misc/entity_id.h index 25c744f4e..0a3d51208 100644 --- a/code/nel/include/nel/misc/entity_id.h +++ b/code/nel/include/nel/misc/entity_id.h @@ -580,7 +580,7 @@ struct CEntityIdHashMapTraits size_t operator() (const NLMISC::CEntityId &id ) const { uint64 hash64 = id.getUniqueId(); -#if (HAVE_X86_64) +#ifdef HAVE_X86_64 return (size_t)hash64; #else return (size_t)hash64 ^ (size_t)(hash64 >> 32); From 54ee3d79e940e7e9e6be30e5898e94d18503a0cb Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 7 Jan 2016 17:40:19 +0100 Subject: [PATCH 4/4] Changed: Minor change --HG-- branch : develop --- .../phrase_manager/fg_prospection_phrase.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/fg_prospection_phrase.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/fg_prospection_phrase.cpp index 7721bad0c..f2fc03eb0 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/fg_prospection_phrase.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/fg_prospection_phrase.cpp @@ -17,7 +17,6 @@ #include "stdpch.h" -#include #include "fg_prospection_phrase.h" #include "nel/misc/common.h" #include "nel/misc/fast_floor.h"