- some reformatting on exit code, mainly to make searching for the content easier.

This commit is contained in:
Christoph Oelckers 2019-10-01 19:06:28 +02:00
parent f3219ca979
commit 86ab366958
25 changed files with 55 additions and 50 deletions

View file

@ -512,7 +512,7 @@ int main(int argc, char** argv)
CreateMenu();
atterm(ReleaseApplicationController);
atexit(ReleaseApplicationController);
appCtrl = [ApplicationController new];
[NSApp setDelegate:appCtrl];

View file

@ -241,7 +241,7 @@ int main (int argc, char **argv)
}
}
exit (-1);
return -1;
}
catch (...)
{

View file

@ -932,7 +932,7 @@ void DoMain (HINSTANCE hInstance)
if (!Window)
{
MessageBoc(nullptr, "Fatal", "Unable to create main window", MB_ICONEXCLAMATION|MB_OK);
MessageBoxA(nullptr, "Unable to create main window", "Fatal", MB_ICONEXCLAMATION|MB_OK);
exit(-1);
}
@ -1233,7 +1233,7 @@ int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE nothing, LPWSTR cmdline, int
// don't support Windows 95, we have no obligation to provide assistance in
// getting it installed.
MessageBoxA(NULL, "Could not load riched20.dll", GAMENAME " Error", MB_OK | MB_ICONSTOP);
exit(0);
return 0;
}
#if !defined(__GNUC__) && defined(_DEBUG)
@ -1248,7 +1248,7 @@ int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE nothing, LPWSTR cmdline, int
{
}
DisplayCrashLog ();
exit (0);
return 0;
}
if (__argc == 2 && __wargv != nullptr && wcscmp (__wargv[1], L"TestStackCrash") == 0)
{
@ -1261,7 +1261,7 @@ int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE nothing, LPWSTR cmdline, int
{
}
DisplayCrashLog ();
exit (0);
return 0;
}
#endif

View file

@ -1343,13 +1343,11 @@ void FStrifeStartupScreen::DrawStuff(int old_laser, int new_laser)
//
//==========================================================================
void ST_Endoom()
int RunEndoom()
{
if (showendoom == 0) exit(0);
if (gameinfo.Endoom.Len() == 0)
if (showendoom == 0 || gameinfo.Endoom.Len() == 0)
{
exit(0);
return 0;
}
int endoom_lump = Wads.CheckNumForFullName (gameinfo.Endoom, true);
@ -1363,25 +1361,25 @@ void ST_Endoom()
if (endoom_lump < 0 || Wads.LumpLength (endoom_lump) != 4000)
{
exit(0);
return 0;
}
if (Wads.GetLumpFile(endoom_lump) == Wads.GetMaxIwadNum() && showendoom == 2)
{
// showendoom==2 means to show only lumps from PWADs.
exit(0);
return 0;
}
font = ST_Util_LoadFont (TEXT_FONT_NAME);
if (font == NULL)
{
exit(0);
return 0;
}
if (!ST_Util_CreateStartupWindow())
{
ST_Util_FreeFont (font);
exit(0);
return 0;
}
I_ShutdownGraphics ();
@ -1432,7 +1430,7 @@ void ST_Endoom()
}
ST_Util_FreeBitmap (StartupBitmap);
ST_Util_FreeFont (font);
exit (int(bRet == 0 ? mess.wParam : 0));
return int(bRet == 0 ? mess.wParam : 0);
}
else if (blinking && mess.message == WM_TIMER && mess.hwnd == Window && mess.wParam == 0x5A15A)
{
@ -1444,6 +1442,13 @@ void ST_Endoom()
}
}
void ST_Endoom()
{
int code = RunEndoom();
exit(code);
}
//==========================================================================
//
// ST_Util_CreateStartupWindow