diff --git a/src/common/startscreen/endoom.cpp b/src/common/startscreen/endoom.cpp index cd2890403c2..0fff948c0d8 100644 --- a/src/common/startscreen/endoom.cpp +++ b/src/common/startscreen/endoom.cpp @@ -192,6 +192,7 @@ int RunEndoom() return 0; } +[[noreturn]] void ST_Endoom() { int code = RunEndoom(); diff --git a/src/common/startscreen/startscreen.h b/src/common/startscreen/startscreen.h index 75ccf97a023..afac6c7594e 100644 --- a/src/common/startscreen/startscreen.h +++ b/src/common/startscreen/startscreen.h @@ -102,4 +102,5 @@ class FStartScreen FStartScreen* GetGameStartScreen(int max_progress); -extern void ST_Endoom(); +[[noreturn]] +void ST_Endoom(); diff --git a/src/menu/doommenu.cpp b/src/menu/doommenu.cpp index 476fa358d22..d7b57c84abe 100644 --- a/src/menu/doommenu.cpp +++ b/src/menu/doommenu.cpp @@ -66,6 +66,7 @@ #include "teaminfo.h" #include "i_time.h" #include "shiftstate.h" +#include "s_music.h" #include "hwrenderer/scene/hw_drawinfo.h" EXTERN_CVAR(Int, cl_gfxlocalization) @@ -294,6 +295,14 @@ void System_M_Dim() } +static void M_Quit() +{ + S_StopAllChannels(); + S_StopMusic(true); + CleanSWDrawer(); + ST_Endoom(); +} + //============================================================================= // // @@ -304,8 +313,7 @@ CCMD (menu_quit) { // F10 if (m_quickexit) { - CleanSWDrawer(); - ST_Endoom(); + M_Quit(); } M_StartControlPanel (true); @@ -336,8 +344,7 @@ CCMD (menu_quit) I_WaitVBL(105); } } - CleanSWDrawer(); - ST_Endoom(); + M_Quit(); });