mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-11 08:49:50 +00:00
(svn r23119) -Fix: [Win32] Don't show a crash/assertion message box for a GUI-less video driver.
This commit is contained in:
parent
65d0d19b16
commit
6a2735d24e
@ -25,6 +25,7 @@
|
|||||||
#include "../../strings_func.h"
|
#include "../../strings_func.h"
|
||||||
#include "../../gamelog.h"
|
#include "../../gamelog.h"
|
||||||
#include "../../saveload/saveload.h"
|
#include "../../saveload/saveload.h"
|
||||||
|
#include "../../video/video_driver.hpp"
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
@ -526,7 +527,7 @@ static LONG WINAPI ExceptionHandler(EXCEPTION_POINTERS *ep)
|
|||||||
/* Close any possible log files */
|
/* Close any possible log files */
|
||||||
CloseConsoleLogIfActive();
|
CloseConsoleLogIfActive();
|
||||||
|
|
||||||
if (_safe_esp != NULL) {
|
if ((_video_driver == NULL || _video_driver->HasGUI()) && _safe_esp != NULL) {
|
||||||
#ifdef _M_AMD64
|
#ifdef _M_AMD64
|
||||||
ep->ContextRecord->Rip = (DWORD64)ShowCrashlogWindow;
|
ep->ContextRecord->Rip = (DWORD64)ShowCrashlogWindow;
|
||||||
ep->ContextRecord->Rsp = (DWORD64)_safe_esp;
|
ep->ContextRecord->Rsp = (DWORD64)_safe_esp;
|
||||||
|
@ -163,6 +163,11 @@ const char *VideoDriver_Dedicated::Start(const char * const *parm)
|
|||||||
SetConsoleTitle(_T("OpenTTD Dedicated Server"));
|
SetConsoleTitle(_T("OpenTTD Dedicated Server"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
/* Disable the MSVC assertion message box. */
|
||||||
|
_set_error_mode(_OUT_TO_STDERR);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __OS2__
|
#ifdef __OS2__
|
||||||
/* For OS/2 we also need to switch to console mode instead of PM mode */
|
/* For OS/2 we also need to switch to console mode instead of PM mode */
|
||||||
OS2_SwitchToConsoleMode();
|
OS2_SwitchToConsoleMode();
|
||||||
|
@ -19,6 +19,11 @@ static FVideoDriver_Null iFVideoDriver_Null;
|
|||||||
|
|
||||||
const char *VideoDriver_Null::Start(const char * const *parm)
|
const char *VideoDriver_Null::Start(const char * const *parm)
|
||||||
{
|
{
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
/* Disable the MSVC assertion message box. */
|
||||||
|
_set_error_mode(_OUT_TO_STDERR);
|
||||||
|
#endif
|
||||||
|
|
||||||
this->ticks = GetDriverParamInt(parm, "ticks", 1000);
|
this->ticks = GetDriverParamInt(parm, "ticks", 1000);
|
||||||
_screen.width = _screen.pitch = _cur_resolution.width;
|
_screen.width = _screen.pitch = _cur_resolution.width;
|
||||||
_screen.height = _cur_resolution.height;
|
_screen.height = _cur_resolution.height;
|
||||||
|
Loading…
Reference in New Issue
Block a user