mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-17 13:01:42 +00:00
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
This commit is contained in:
parent
b3a392d559
commit
51ec04b761
3 changed files with 23 additions and 8 deletions
|
@ -419,6 +419,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;
|
||||||
|
|
||||||
|
@ -1051,6 +1052,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;
|
||||||
|
|
|
@ -890,21 +890,31 @@ 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)
|
||||||
|
{
|
||||||
|
if (ClientCfg.VideoMemory <= 0)
|
||||||
{
|
{
|
||||||
// determine video memory using 3D driver
|
// determine video memory using 3D driver
|
||||||
videoMemory = Driver->getTotalVideoMemory();
|
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
|
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
|
// 32 MiB of VRAM if DivideTextureSizeBy2 else 64 MiB
|
||||||
videoMemory = ClientCfg.DivideTextureSizeBy2 ? 32:64;
|
videoMemory = ClientCfg.DivideTextureSizeBy2 ? 32:64;
|
||||||
|
|
Loading…
Reference in a new issue