1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

Merge pull request #3491 from IvanSavenko/change_default_driver

Change default SDL driver name from opengl to empty (autoselection)
This commit is contained in:
Ivan Savenko 2024-01-15 11:57:42 +02:00 committed by GitHub
commit 8400c27251
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 1 deletions

View File

@ -199,6 +199,7 @@
},
"driver" : {
"type" : "string",
"defaultWindows" : "",
"default" : "opengl",
"description" : "preferred graphics backend driver name for SDL2"
},

View File

@ -169,6 +169,8 @@ static QStringList getAvailableRenderingDrivers()
SDL_Init(SDL_INIT_VIDEO);
QStringList result;
result += QString(); // empty value for autoselection
int driversCount = SDL_GetNumRenderDrivers();
for(int it = 0; it < driversCount; it++)

View File

@ -1289,7 +1289,12 @@ static JsonNode getDefaultValue(const JsonNode & schema, std::string fieldName)
#elif defined(VCMI_ANDROID)
if (!fieldProps["defaultAndroid"].isNull())
return fieldProps["defaultAndroid"];
#elif !defined(VCMI_MOBILE)
#elif defined(VCMI_WINDOWS)
if (!fieldProps["defaultWindows"].isNull())
return fieldProps["defaultWindows"];
#endif
#if !defined(VCMI_MOBILE)
if (!fieldProps["defaultDesktop"].isNull())
return fieldProps["defaultDesktop"];
#endif