| 30 | extern bool OnMainThread(); |
| 31 | |
| 32 | static void ShowErrorMessage(const char* msg, const bool show_msg = false) |
| 33 | { |
| 34 | extern void LogD3D11DebugMessages(); |
| 35 | LogD3D11DebugMessages(); |
| 36 | |
| 37 | const bool on_ttapi_thread = !OnMainThread(); |
| 38 | |
| 39 | if (!on_ttapi_thread) |
| 40 | { |
| 41 | ShowWindow(gGameWindow, SW_HIDE); |
| 42 | |
| 43 | while (ShowCursor(TRUE) < 0) |
| 44 | ; |
| 45 | } |
| 46 | |
| 47 | if (!IsDebuggerPresent()) |
| 48 | { |
| 49 | if (!show_msg) |
| 50 | if (open_log()) |
| 51 | return; |
| 52 | |
| 53 | if (!on_ttapi_thread) |
| 54 | MessageBox(gGameWindow, msg, "FATAL ERROR", MB_OK | MB_ICONERROR | MB_SYSTEMMODAL); |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | static const char* GetThreadName() |
| 59 | { |
no test coverage detected