summaryrefslogtreecommitdiff
path: root/src/video/win32_v.cpp
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2008-06-05 20:54:52 +0000
committerglx <glx@openttd.org>2008-06-05 20:54:52 +0000
commitb60a1326bf3ea9b9e0235cf18cdcd964c758a8bf (patch)
tree62bef57de81c1ddcc691d5de5e8db395615bdacc /src/video/win32_v.cpp
parentbb758700a87b19e47c6ef7aa28280ca05badd62f (diff)
downloadopenttd-b60a1326bf3ea9b9e0235cf18cdcd964c758a8bf.tar.xz
(svn r13390) -Codechange: introduce usererror() for fatal but not openttd related errors. Now all error() will 'crash' openttd after showing the message in win32 releases (MSVC), creating a crash.log and crash.dmp (like the '!' hack used before). On the other hand, usererror() will just close the game. So use error() only when it can be helpful to debugging, else use usererror().
Diffstat (limited to 'src/video/win32_v.cpp')
-rw-r--r--src/video/win32_v.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp
index f553b9916..19311bb36 100644
--- a/src/video/win32_v.cpp
+++ b/src/video/win32_v.cpp
@@ -59,7 +59,7 @@ static void MakePalette()
}
_wnd.gdi_palette = CreatePalette(pal);
- if (_wnd.gdi_palette == NULL) error("CreatePalette failed!\n");
+ if (_wnd.gdi_palette == NULL) usererror("CreatePalette failed!\n");
}
static void UpdatePalette(HDC dc, uint start, uint count)
@@ -292,7 +292,7 @@ static bool MakeWindow(bool full_screen)
_sntprintf(Windowtitle, sizeof(Windowtitle), _T("OpenTTD %s"), MB_TO_WIDE(_openttd_revision));
_wnd.main_wnd = CreateWindow(_T("OTTD"), Windowtitle, style, x, y, w, h, 0, 0, GetModuleHandle(NULL), 0);
- if (_wnd.main_wnd == NULL) error("CreateWindow failed");
+ if (_wnd.main_wnd == NULL) usererror("CreateWindow failed");
ShowWindow(_wnd.main_wnd, showstyle);
}
}
@@ -671,7 +671,7 @@ static void RegisterWndClass()
};
registered = true;
- if (!RegisterClass(&wnd)) error("RegisterClass failed");
+ if (!RegisterClass(&wnd)) usererror("RegisterClass failed");
}
}
@@ -684,7 +684,7 @@ static bool AllocateDibSection(int w, int h)
w = max(w, 64);
h = max(h, 64);
- if (bpp == 0) error("Can't use a blitter that blits 0 bpp for normal visuals");
+ if (bpp == 0) usererror("Can't use a blitter that blits 0 bpp for normal visuals");
if (w == _screen.width && h == _screen.height)
return false;
@@ -707,7 +707,7 @@ static bool AllocateDibSection(int w, int h)
dc = GetDC(0);
_wnd.dib_sect = CreateDIBSection(dc, bi, DIB_RGB_COLORS, (VOID**)&_wnd.buffer_bits, NULL, 0);
- if (_wnd.dib_sect == NULL) error("CreateDIBSection failed");
+ if (_wnd.dib_sect == NULL) usererror("CreateDIBSection failed");
ReleaseDC(0, dc);
return true;