Merge with develop

This commit is contained in:
kervala 2016-01-07 17:41:02 +01:00
parent bb9da04b4f
commit 989569c137
8 changed files with 28 additions and 14 deletions

View file

@ -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));

View file

@ -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);

View file

@ -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;

View file

@ -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
{

View file

@ -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)

View file

@ -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;

View file

@ -890,21 +890,31 @@ void initMainLoop()
// only detect amount of video memory if using HD textures
if (ClientCfg.HDEntityTexture)
{
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 (videoMemory <= 0) videoMemory = CSystemUtils::getTotalVideoMemory();
// 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
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
{
// 32 MiB of VRAM if DivideTextureSizeBy2 else 64 MiB
videoMemory = ClientCfg.DivideTextureSizeBy2 ? 32:64;

View file

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