mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-24 09:58:46 +00:00
Merge with develop
--HG-- branch : compatibility-develop
This commit is contained in:
commit
3f4a5010f6
8 changed files with 28 additions and 14 deletions
|
@ -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));
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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
|
||||||
{
|
{
|
||||||
|
|
|
@ -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)
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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
|
||||||
{
|
{
|
||||||
|
|
|
@ -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"
|
||||||
|
|
Loading…
Reference in a new issue