From fcb6f00a7feb3b33e8c08b5a2bffec9f7b9696c3 Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Sat, 16 Sep 2017 22:56:43 +0200 Subject: [PATCH] Show the error dialog before creating the SDL window --- src/blupi.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/blupi.cxx b/src/blupi.cxx index a859e14..8063fff 100644 --- a/src/blupi.cxx +++ b/src/blupi.cxx @@ -625,6 +625,12 @@ DoInit (int argc, char * argv[], bool & exit) bOK = ReadConfig (); // lit le fichier config.json + if (!bOK) // Something wrong with config.json file? + { + InitFail ("Game not correctly installed"); + return EXIT_FAILURE; + } + auto res = SDL_Init (SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER); if (res < 0) return EXIT_FAILURE; @@ -655,12 +661,6 @@ DoInit (int argc, char * argv[], bool & exit) return EXIT_FAILURE; } - if (!bOK) // Something wrong with config.json file? - { - InitFail ("Game not correctly installed"); - return EXIT_FAILURE; - } - SDL_RenderSetLogicalSize (g_renderer, LXIMAGE, LYIMAGE); const auto renders = SDL_GetNumRenderDrivers ();