Merge with develop

--HG--
branch : compatibility-develop
This commit is contained in:
kervala 2016-01-07 17:41:02 +01:00
commit 3f4a5010f6
8 changed files with 28 additions and 14 deletions

View file

@ -61,7 +61,7 @@ public:
class CClassIdHashMapTraits class CClassIdHashMapTraits
{ {
public: public:
enum { bucket_size = 4, min_buckets = 8, }; enum { bucket_size = 4, min_buckets = 8 };
inline size_t operator() ( const CClassId& classId ) const inline size_t operator() ( const CClassId& classId ) const
{ {
return ((((uint64)classId >> 32)|0xFFFFFFFF) ^ (((uint64)classId|0xFFFFFFFF) & 0xFFFFFFFF)); return ((((uint64)classId >> 32)|0xFFFFFFFF) ^ (((uint64)classId|0xFFFFFFFF) & 0xFFFFFFFF));

View file

@ -575,12 +575,12 @@ public:
// Traits for hash_map using CEntityId // Traits for hash_map using CEntityId
struct CEntityIdHashMapTraits struct CEntityIdHashMapTraits
{ {
enum { bucket_size = 4, min_buckets = 8, }; enum { bucket_size = 4, min_buckets = 8 };
CEntityIdHashMapTraits() { } CEntityIdHashMapTraits() { }
size_t operator() (const NLMISC::CEntityId &id ) const size_t operator() (const NLMISC::CEntityId &id ) const
{ {
uint64 hash64 = id.getUniqueId(); uint64 hash64 = id.getUniqueId();
#if (HAVE_X86_64) #ifdef HAVE_X86_64
return (size_t)hash64; return (size_t)hash64;
#else #else
return (size_t)hash64 ^ (size_t)(hash64 >> 32); return (size_t)hash64 ^ (size_t)(hash64 >> 32);

View file

@ -248,7 +248,7 @@ private :
class CSheetIdHashMapTraits class CSheetIdHashMapTraits
{ {
public: public:
enum { bucket_size = 4, min_buckets = 8, }; enum { bucket_size = 4, min_buckets = 8 };
inline size_t operator() ( const CSheetId& sheetId ) const inline size_t operator() ( const CSheetId& sheetId ) const
{ {
return sheetId.asInt() >> 5; return sheetId.asInt() >> 5;

View file

@ -39,7 +39,7 @@ typedef const std::string *TStringId;
// Traits for hash_map using CStringId // Traits for hash_map using CStringId
struct CStringIdHashMapTraits struct CStringIdHashMapTraits
{ {
enum { bucket_size = 4, min_buckets = 8, }; enum { bucket_size = 4, min_buckets = 8 };
CStringIdHashMapTraits() { } CStringIdHashMapTraits() { }
size_t operator() (const NLMISC::TStringId &stringId) const size_t operator() (const NLMISC::TStringId &stringId) const
{ {

View file

@ -415,6 +415,7 @@ CClientConfig::CClientConfig()
HDTextureInstalled = false; HDTextureInstalled = false;
Fog = true; // Fog is on by default Fog = true; // Fog is on by default
WaitVBL = false; WaitVBL = false;
VideoMemory = 0;
FXAA = true; FXAA = true;
@ -1041,6 +1042,8 @@ void CClientConfig::setValues()
// WaitVBL // WaitVBL
READ_BOOL_FV(WaitVBL) READ_BOOL_FV(WaitVBL)
// VideoMemory
READ_INT_FV(VideoMemory);
READ_INT_DEV(TimerMode) READ_INT_DEV(TimerMode)

View file

@ -255,6 +255,8 @@ struct CClientConfig
bool Fog; bool Fog;
/// Enable/Disable VSync /// Enable/Disable VSync
bool WaitVBL; bool WaitVBL;
/// Force or auto-detect video memory (in MiB)
sint VideoMemory;
/// Timer mode. 0 : QueryPerformanceCounter, 1 : timeGetTime. /// Timer mode. 0 : QueryPerformanceCounter, 1 : timeGetTime.
uint TimerMode; uint TimerMode;

View file

@ -891,18 +891,28 @@ void initMainLoop()
// only detect amount of video memory if using HD textures // only detect amount of video memory if using HD textures
if (ClientCfg.HDEntityTexture) if (ClientCfg.HDEntityTexture)
{ {
// determine video memory using 3D driver if (ClientCfg.VideoMemory <= 0)
videoMemory = Driver->getTotalVideoMemory(); {
// determine video memory using 3D driver
videoMemory = Driver->getTotalVideoMemory();
// if unable to determine, use plaform methods // if unable to determine, use plaform methods
if (videoMemory < 0) videoMemory = CSystemUtils::getTotalVideoMemory(); if (videoMemory <= 0) videoMemory = CSystemUtils::getTotalVideoMemory();
// in the worst case, use default value of 128 MiB // in the worst case, use default value of 128 MiB
if (videoMemory < 0) videoMemory = 128 * 1024; 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 else
{ {

View file

@ -17,7 +17,6 @@
#include "stdpch.h" #include "stdpch.h"
#include <functional>
#include "fg_prospection_phrase.h" #include "fg_prospection_phrase.h"
#include "nel/misc/common.h" #include "nel/misc/common.h"
#include "nel/misc/fast_floor.h" #include "nel/misc/fast_floor.h"