diff options
-rw-r--r-- | src/video/win32_v.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp index a9dbd8589..57a481bd8 100644 --- a/src/video/win32_v.cpp +++ b/src/video/win32_v.cpp @@ -975,24 +975,24 @@ static void RegisterWndClass() { static bool registered = false; - if (!registered) { - HINSTANCE hinst = GetModuleHandle(nullptr); - WNDCLASS wnd = { - CS_OWNDC, - WndProcGdi, - 0, - 0, - hinst, - LoadIcon(hinst, MAKEINTRESOURCE(100)), - LoadCursor(nullptr, IDC_ARROW), - 0, - 0, - _T("OTTD") - }; - - registered = true; - if (!RegisterClass(&wnd)) usererror("RegisterClass failed"); - } + if (registered) return; + + HINSTANCE hinst = GetModuleHandle(nullptr); + WNDCLASS wnd = { + CS_OWNDC, + WndProcGdi, + 0, + 0, + hinst, + LoadIcon(hinst, MAKEINTRESOURCE(100)), + LoadCursor(nullptr, IDC_ARROW), + 0, + 0, + _T("OTTD") + }; + + registered = true; + if (!RegisterClass(&wnd)) usererror("RegisterClass failed"); } static bool AllocateDibSection(int w, int h, bool force) |