mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-25 08:16:16 +00:00
Changed: #1275 Enable OpenGL ES driver in Ryzom client
This commit is contained in:
parent
ab83402089
commit
b69f65bb73
3 changed files with 24 additions and 13 deletions
|
@ -841,6 +841,7 @@ void CClientConfig::setValues()
|
|||
if (nlstricmp(varPtr->asString(), "Auto") == 0 || nlstricmp(varPtr->asString(), "0") == 0) ClientCfg.Driver3D = CClientConfig::DrvAuto;
|
||||
else if (nlstricmp(varPtr->asString(), "OpenGL") == 0 || nlstricmp(varPtr->asString(), "1") == 0) ClientCfg.Driver3D = CClientConfig::OpenGL;
|
||||
else if (nlstricmp(varPtr->asString(), "Direct3D") == 0 || nlstricmp(varPtr->asString(), "2") == 0) ClientCfg.Driver3D = CClientConfig::Direct3D;
|
||||
else if (nlstricmp(varPtr->asString(), "OpenGLES") == 0 || nlstricmp(varPtr->asString(), "3") == 0) ClientCfg.Driver3D = CClientConfig::OpenGLES;
|
||||
}
|
||||
else
|
||||
cfgWarning ("Default value used for 'Driver3D' !!!");
|
||||
|
|
|
@ -53,7 +53,7 @@ using std::string;
|
|||
//---------------------------------------------------
|
||||
struct CClientConfig
|
||||
{
|
||||
enum TDriver3D { DrvAuto = 0, OpenGL, Direct3D };
|
||||
enum TDriver3D { DrvAuto = 0, OpenGL, Direct3D, OpenGLES };
|
||||
enum TDriverSound { SoundDrvAuto = 0, SoundDrvFMod, SoundDrvOpenAL, SoundDrvDirectSound, SoundDrvXAudio2 };
|
||||
enum TStageLCTUsage { StageUseNoLCT = 0, StageUseAllLCT, StageUsePosOnlyLCT };
|
||||
|
||||
|
|
|
@ -819,33 +819,43 @@ void prelogInit()
|
|||
nmsg = "Creating 3d driver...";
|
||||
ProgressBar.newMessage ( ClientCfg.buildLoadingString(nmsg) );
|
||||
|
||||
bool direct3D = false;
|
||||
UDriver::TDriver driver = UDriver::OpenGl;
|
||||
|
||||
#ifdef NL_OS_WINDOWS
|
||||
uint icon = (uint)LoadIcon(HInstance, MAKEINTRESOURCE(IDI_MAIN_ICON));
|
||||
#else
|
||||
uint icon = 0;
|
||||
#endif // NL_OS_WINDOWS
|
||||
|
||||
switch(ClientCfg.Driver3D)
|
||||
{
|
||||
case CClientConfig::DrvAuto:
|
||||
#ifdef NL_OS_WINDOWS
|
||||
{
|
||||
// Fallback to D3D for card other than nVidia
|
||||
std::string deviceName;
|
||||
uint64 drvVersion;
|
||||
CSystemInfo::getVideoInfo( deviceName, drvVersion);
|
||||
CSystemInfo::getVideoInfo(deviceName, drvVersion);
|
||||
strlwr(deviceName);
|
||||
direct3D = strstr(deviceName.c_str(), NVIDIA_RECOMMANDED_DRIVERS_STRING_TEST) == NULL;
|
||||
driver = strstr(deviceName.c_str(), NVIDIA_RECOMMANDED_DRIVERS_STRING_TEST) == NULL ? UDriver::Direct3d:UDriver::OpenGl;
|
||||
}
|
||||
break;
|
||||
case CClientConfig::OpenGL:
|
||||
direct3D = false;
|
||||
break;
|
||||
case CClientConfig::Direct3D:
|
||||
direct3D = true;
|
||||
driver = UDriver::Direct3d;
|
||||
break;
|
||||
#endif // NL_OS_WINDOWS
|
||||
case CClientConfig::OpenGL:
|
||||
driver = UDriver::OpenGl;
|
||||
break;
|
||||
case CClientConfig::OpenGLES:
|
||||
driver = UDriver::OpenGlEs;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
Driver = UDriver::createDriver ((uint)LoadIcon (HInstance, MAKEINTRESOURCE(IDI_MAIN_ICON)), direct3D);
|
||||
|
||||
#else // NL_OS_WINDOWS
|
||||
Driver = UDriver::createDriver ();
|
||||
#endif // NL_OS_WINDOWS
|
||||
Driver = UDriver::createDriver(icon, driver);
|
||||
|
||||
if(Driver == NULL)
|
||||
{
|
||||
ExitClientError (CI18N::get ("Can_t_load_the_display_driver").toUtf8().c_str ());
|
||||
|
@ -1111,7 +1121,7 @@ void prelogInit()
|
|||
CBloomEffect::getInstance().setDriver(Driver);
|
||||
|
||||
// init bloom effect
|
||||
CBloomEffect::getInstance().init(!direct3D);
|
||||
CBloomEffect::getInstance().init(driver != UDriver::Direct3d);
|
||||
|
||||
nlinfo ("PROFILE: %d seconds for prelogInit", (uint32)(ryzomGetLocalTime ()-initStart)/1000);
|
||||
|
||||
|
|
Loading…
Reference in a new issue