From 59a68892c6a7d5f0a9ef79cb3c6950cb31b55520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Kapu=C5=9Bci=C5=84ski?= Date: Sat, 18 Jul 2015 12:03:33 +0200 Subject: [PATCH] Game displays an error message and uses default graphics device when unknown device is selected with -graphics switch --- src/app/app.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/app.cpp b/src/app/app.cpp index 694b3b2d..a0ea7c06 100644 --- a/src/app/app.cpp +++ b/src/app/app.cpp @@ -540,8 +540,10 @@ bool CApplication::Create() if (m_device == nullptr) { - m_device = MakeUnique(); GetLogger()->Error("Unknown graphics device: %s\n", m_graphics.c_str()); + GetLogger()->Info("Changing to default device\n"); + GetSystemUtils()->SystemDialog(SDT_ERROR, "Graphics initialization error", "You have selected invalid graphics device with -graphics switch. Game will use default OpenGL device instead."); + m_device = Gfx::CreateDevice(m_deviceConfig, "opengl"); } } else