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..0a3d51208 100644 --- a/code/nel/include/nel/misc/entity_id.h +++ b/code/nel/include/nel/misc/entity_id.h @@ -575,12 +575,12 @@ 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 { 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); 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 { diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index db675349c..e0502bf6a 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -415,6 +415,7 @@ CClientConfig::CClientConfig() HDTextureInstalled = false; Fog = true; // Fog is on by default WaitVBL = false; + VideoMemory = 0; FXAA = true; @@ -1041,6 +1042,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 14f72a1b8..d934ae58a 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 { 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"