mirror of
https://github.com/ZDoom/Raze.git
synced 2025-05-30 17:01:03 +00:00
- rewrote all remaining places that used wm_msgbox to throw a fatal error instead so that the global error handler can deal with the messages.
This eliminates another piece of hideous code. This commit also moves the memory error handler to the common code, so that all games can call it if triggered.
This commit is contained in:
parent
f65b2c1dcb
commit
055b310d60
8 changed files with 20 additions and 136 deletions
|
@ -292,6 +292,8 @@ int RunGame();
|
|||
|
||||
int GameMain()
|
||||
{
|
||||
set_memerr_handler(G_HandleMemErr);
|
||||
|
||||
int r;
|
||||
try
|
||||
{
|
||||
|
@ -583,13 +585,25 @@ int RunGame()
|
|||
|
||||
if (enginePreInit())
|
||||
{
|
||||
I_Error("app_main: There was a problem initializing the Build engine: %s\n", engineerrstr);
|
||||
I_FatalError("app_main: There was a problem initializing the Build engine: %s\n", engineerrstr);
|
||||
}
|
||||
|
||||
mouseGrabInput(true); // the intros require the mouse to be grabbed.
|
||||
return gi->app_main();
|
||||
}
|
||||
|
||||
void G_HandleMemErr(int32_t lineNum, const char* fileName, const char* funcName)
|
||||
{
|
||||
I_FatalError("Out of memory in %s:%d (%s)\n", fileName, lineNum, funcName);
|
||||
}
|
||||
|
||||
void G_FatalEngineError(void)
|
||||
{
|
||||
I_FatalError("Fatal Engine Initialization Error",
|
||||
"There was a problem initializing the engine: %s\n\nThe application will now close.", engineerrstr);
|
||||
}
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue