diff options
author | michi_cc <michi_cc@openttd.org> | 2011-10-04 21:35:40 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2011-10-04 21:35:40 +0000 |
commit | 6dbb050a32122209497d9b41c373b3b759602883 (patch) | |
tree | d4a463d465885f4eb4f376ac548f71d68b09995b /src/video/win32_v.cpp | |
parent | 12e28de8187808b166541ee8fa339e38037538fd (diff) | |
download | openttd-6dbb050a32122209497d9b41c373b3b759602883.tar.xz |
(svn r22999) -Codechange: Allow changing the blitter during the running game.
Diffstat (limited to 'src/video/win32_v.cpp')
-rw-r--r-- | src/video/win32_v.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp index 5fdd3dab6..cc242fb2e 100644 --- a/src/video/win32_v.cpp +++ b/src/video/win32_v.cpp @@ -149,7 +149,7 @@ static uint MapWindowsKey(uint sym) return key; } -static bool AllocateDibSection(int w, int h); +static bool AllocateDibSection(int w, int h, bool force = false); static void ClientSizeChanged(int w, int h) { @@ -690,7 +690,7 @@ static void RegisterWndClass() } } -static bool AllocateDibSection(int w, int h) +static bool AllocateDibSection(int w, int h, bool force) { BITMAPINFO *bi; HDC dc; @@ -701,7 +701,7 @@ static bool AllocateDibSection(int w, int h) 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; + if (!force && w == _screen.width && h == _screen.height) return false; _screen.width = w; _screen.pitch = (bpp == 8) ? Align(w, 4) : w; @@ -927,3 +927,8 @@ bool VideoDriver_Win32::ToggleFullscreen(bool full_screen) { return this->MakeWindow(full_screen); } + +bool VideoDriver_Win32::AfterBlitterChange() +{ + return AllocateDibSection(_screen.width, _screen.height, true) && this->MakeWindow(_fullscreen); +} |