diff --git a/src/common/platform/win32/i_main.cpp b/src/common/platform/win32/i_main.cpp index c68b5a7aa..406c165c0 100644 --- a/src/common/platform/win32/i_main.cpp +++ b/src/common/platform/win32/i_main.cpp @@ -339,7 +339,7 @@ int DoMain (HINSTANCE hInstance) } else if (StdOut == nullptr) { - mainwindow.ShowErrorPane(nullptr); + mainwindow.ShowErrorPane(""); } } } diff --git a/src/d_main.cpp b/src/d_main.cpp index 3f0ee70a0..bc65e9e6b 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -3227,7 +3227,9 @@ static int D_InitGame(const FIWADInfo* iwad_info, std::vector& allw int max_progress = TexMan.GuesstimateNumTextures(); int per_shader_progress = 0;//screen->GetShaderCount()? (max_progress / 10 / screen->GetShaderCount()) : 0; - bool nostartscreen = batchrun || restart || Args->CheckParm("-join") || Args->CheckParm("-host") || Args->CheckParm("-norun"); + + bool norun = Args->CheckParm("-norun"); + bool nostartscreen = batchrun || restart || Args->CheckParm("-join") || Args->CheckParm("-host") || norun; if (GameStartupInfo.Type == FStartupInfo::DefaultStartup) { @@ -3252,7 +3254,7 @@ static int D_InitGame(const FIWADInfo* iwad_info, std::vector& allw exec = NULL; } - if (!restart) + if (!(restart || norun)) V_Init2(); // [RH] Initialize localizable strings. @@ -3276,12 +3278,12 @@ static int D_InitGame(const FIWADInfo* iwad_info, std::vector& allw TexMan.Init(); - if (!batchrun) Printf ("V_Init: allocate screen.\n"); - if (!restart) + if (!(batchrun || norun)) Printf ("V_Init: allocate screen.\n"); + if (!(restart || norun)) { screen->CompileNextShader(); } - else + else if(!norun) { // Update screen palette when restarting screen->UpdatePalette(); @@ -3491,6 +3493,11 @@ static int D_InitGame(const FIWADInfo* iwad_info, std::vector& allw // about to begin the game. FBaseCVar::EnableNoSet (); + if (norun || batchrun) + { + return 1337; // special exit + } + // [RH] Run any saved commands from the command line or autoexec.cfg now. gamestate = GS_FULLCONSOLE; Net_Initialize(); @@ -3514,11 +3521,6 @@ static int D_InitGame(const FIWADInfo* iwad_info, std::vector& allw S_Sound (CHAN_BODY, 0, "misc/startupdone", 1, ATTN_NONE); - if (Args->CheckParm("-norun") || batchrun) - { - return 1337; // special exit - } - if (StartScreen) { StartScreen->Progress(max_progress); // advance progress bar to the end. @@ -3849,7 +3851,10 @@ int GameMain() M_SaveDefaultsFinal(); DeleteStartupScreen(); C_UninitCVars(); // must come last so that nothing will access the CVARs anymore after deletion. - CloseWidgetResources(); + if(ret != 1337) + { + CloseWidgetResources(); + } delete Args; Args = nullptr; return ret;