]> git.lizzy.rs Git - minetest.git/commitdiff
Fall back to default when rendering mode (3d_mode) is set invalid (#10922)
authorMuhammad Rifqi Priyo Susanto <muhammadrifqipriyosusanto@gmail.com>
Sat, 6 Feb 2021 12:47:12 +0000 (19:47 +0700)
committerGitHub <noreply@github.com>
Sat, 6 Feb 2021 12:47:12 +0000 (13:47 +0100)
src/client/render/factory.cpp

index 30f9480fcf44d343437aff8f9eaab13b72385230..7fcec40dd32f1965c1a5d9a5e450bed74089f20b 100644 (file)
@@ -19,7 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 */
 
 #include "factory.h"
-#include <stdexcept>
+#include "log.h"
 #include "plain.h"
 #include "anaglyph.h"
 #include "interlaced.h"
@@ -45,5 +45,8 @@ RenderingCore *createRenderingCore(const std::string &stereo_mode, IrrlichtDevic
                return new RenderingCoreSideBySide(device, client, hud, true);
        if (stereo_mode == "crossview")
                return new RenderingCoreSideBySide(device, client, hud, false, true);
-       throw std::invalid_argument("Invalid rendering mode: " + stereo_mode);
+
+       // fallback to plain renderer
+       errorstream << "Invalid rendering mode: " << stereo_mode << std::endl;
+       return new RenderingCorePlain(device, client, hud);
 }