- consolidated the 3 I_Error implementations

Debug output is now being handled by the respective interface functions, not by the Windows I_Error itself.
This commit is contained in:
Christoph Oelckers 2019-10-07 00:01:12 +02:00
parent d7289f6469
commit cd086ae1da
4 changed files with 33 additions and 52 deletions

View File

@ -2268,6 +2268,34 @@ static void CheckCmdLine()
}
}
//==========================================================================
//
// I_Error
//
// Throw an error that will send us to the console if we are far enough
// along in the startup process.
//
//==========================================================================
void I_Error(const char *error, ...)
{
va_list argptr;
char errortext[MAX_ERRORTEXT];
va_start(argptr, error);
myvsnprintf(errortext, MAX_ERRORTEXT, error, argptr);
va_end(argptr);
I_DebugPrint(errortext);
throw CRecoverableError(errortext);
}
//==========================================================================
//
// I_Quit
//
//==========================================================================
void I_Quit()
{
if (demorecording)

View File

@ -132,19 +132,6 @@ void I_FatalError(const char* const error, ...)
}
void I_Error (const char *error, ...)
{
va_list argptr;
char errortext[MAX_ERRORTEXT];
va_start(argptr, error);
myvsnprintf (errortext, MAX_ERRORTEXT, error, argptr);
va_end (argptr);
throw CRecoverableError(errortext);
}
void I_SetIWADInfo()
{
}

View File

@ -182,18 +182,6 @@ void I_FatalError(const char* const error, ...)
}
void I_Error (const char *error, ...)
{
va_list argptr;
char errortext[MAX_ERRORTEXT];
va_start(argptr, error);
myvsnprintf (errortext, MAX_ERRORTEXT, error, argptr);
va_end (argptr);
throw CRecoverableError(errortext);
}
void I_SetIWADInfo ()
{
}

View File

@ -374,31 +374,6 @@ void I_FatalError(const char *error, ...)
std::terminate();
}
//==========================================================================
//
// I_Error
//
// Throw an error that will send us to the console if we are far enough
// along in the startup process.
//
//==========================================================================
void I_Error(const char *error, ...)
{
va_list argptr;
char errortext[MAX_ERRORTEXT];
va_start(argptr, error);
myvsnprintf(errortext, MAX_ERRORTEXT, error, argptr);
va_end(argptr);
if (IsDebuggerPresent())
{
auto wstr = WideString(errortext);
OutputDebugStringW(wstr.c_str());
}
throw CRecoverableError(errortext);
}
//==========================================================================
//
@ -560,8 +535,11 @@ static TArray<FString> bufferedConsoleStuff;
void I_DebugPrint(const char *cp)
{
auto wstr = WideString(cp);
OutputDebugStringW(wstr.c_str());
if (IsDebuggerPresent())
{
auto wstr = WideString(cp);
OutputDebugStringW(wstr.c_str());
}
}
void I_PrintStr(const char *cp)