Skip to content

Commit 827a785

Browse files
authoredJun 30, 2021
Remove unsupported video drivers (#11395)
This completely removes any mention of the software and D3D drivers from MT, preventing the user from accidentally attempting to use them. Users who need a software renderer should be asked to install Mesa drivers which offer superior fidelity and performance over the 'burningsvideo' driver.
1 parent 8cc04e0 commit 827a785

File tree

2 files changed

+24
-32
lines changed

2 files changed

+24
-32
lines changed
 

‎builtin/settingtypes.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ texture_path (Texture path) path
715715
# Note: On Android, stick with OGLES1 if unsure! App may fail to start otherwise.
716716
# On other platforms, OpenGL is recommended.
717717
# Shaders are supported by OpenGL (desktop only) and OGLES2 (experimental)
718-
video_driver (Video driver) enum opengl null,software,burningsvideo,direct3d8,direct3d9,opengl,ogles1,ogles2
718+
video_driver (Video driver) enum opengl opengl,ogles1,ogles2
719719

720720
# Radius of cloud area stated in number of 64 node cloud squares.
721721
# Values larger than 26 will start to produce sharp cutoffs at cloud area corners.

‎src/client/renderingengine.cpp

+23-31
Original file line numberDiff line numberDiff line change
@@ -284,14 +284,6 @@ static bool getWindowHandle(irr::video::IVideoDriver *driver, HWND &hWnd)
284284
const video::SExposedVideoData exposedData = driver->getExposedVideoData();
285285

286286
switch (driver->getDriverType()) {
287-
#if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR < 9
288-
case video::EDT_DIRECT3D8:
289-
hWnd = reinterpret_cast<HWND>(exposedData.D3D8.HWnd);
290-
break;
291-
#endif
292-
case video::EDT_DIRECT3D9:
293-
hWnd = reinterpret_cast<HWND>(exposedData.D3D9.HWnd);
294-
break;
295287
#if ENABLE_GLES
296288
case video::EDT_OGLES1:
297289
case video::EDT_OGLES2:
@@ -527,11 +519,19 @@ void RenderingEngine::draw_menu_scene(gui::IGUIEnvironment *guienv,
527519

528520
std::vector<irr::video::E_DRIVER_TYPE> RenderingEngine::getSupportedVideoDrivers()
529521
{
522+
// Only check these drivers.
523+
// We do not support software and D3D in any capacity.
524+
static const irr::video::E_DRIVER_TYPE glDrivers[4] = {
525+
irr::video::EDT_NULL,
526+
irr::video::EDT_OPENGL,
527+
irr::video::EDT_OGLES1,
528+
irr::video::EDT_OGLES2,
529+
};
530530
std::vector<irr::video::E_DRIVER_TYPE> drivers;
531531

532-
for (int i = 0; i != irr::video::EDT_COUNT; i++) {
533-
if (irr::IrrlichtDevice::isDriverSupported((irr::video::E_DRIVER_TYPE)i))
534-
drivers.push_back((irr::video::E_DRIVER_TYPE)i);
532+
for (int i = 0; i < 4; i++) {
533+
if (irr::IrrlichtDevice::isDriverSupported(glDrivers[i]))
534+
drivers.push_back(glDrivers[i]);
535535
}
536536

537537
return drivers;
@@ -557,34 +557,26 @@ void RenderingEngine::draw_scene(video::SColor skycolor, bool show_hud,
557557

558558
const char *RenderingEngine::getVideoDriverName(irr::video::E_DRIVER_TYPE type)
559559
{
560-
static const char *driver_ids[] = {
561-
"null",
562-
"software",
563-
"burningsvideo",
564-
"direct3d8",
565-
"direct3d9",
566-
"opengl",
567-
"ogles1",
568-
"ogles2",
560+
static const std::unordered_map<irr::video::E_DRIVER_TYPE,const std::string> driver_ids = {
561+
{irr::video::EDT_NULL, "null"},
562+
{irr::video::EDT_OPENGL, "opengl"},
563+
{irr::video::EDT_OGLES1, "ogles1"},
564+
{irr::video::EDT_OGLES2, "ogles2"},
569565
};
570566

571-
return driver_ids[type];
567+
return driver_ids.at(type).c_str();
572568
}
573569

574570
const char *RenderingEngine::getVideoDriverFriendlyName(irr::video::E_DRIVER_TYPE type)
575571
{
576-
static const char *driver_names[] = {
577-
"NULL Driver",
578-
"Software Renderer",
579-
"Burning's Video",
580-
"Direct3D 8",
581-
"Direct3D 9",
582-
"OpenGL",
583-
"OpenGL ES1",
584-
"OpenGL ES2",
572+
static const std::unordered_map<irr::video::E_DRIVER_TYPE,const std::string> driver_names = {
573+
{irr::video::EDT_NULL, "NULL Driver"},
574+
{irr::video::EDT_OPENGL, "OpenGL"},
575+
{irr::video::EDT_OGLES1, "OpenGL ES1"},
576+
{irr::video::EDT_OGLES2, "OpenGL ES2"},
585577
};
586578

587-
return driver_names[type];
579+
return driver_names.at(type).c_str();
588580
}
589581

590582
#ifndef __ANDROID__

0 commit comments

Comments
 (0)