summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfonsinchen <fonsinchen@openttd.org>2014-02-23 14:15:55 +0000
committerfonsinchen <fonsinchen@openttd.org>2014-02-23 14:15:55 +0000
commitb4a015a4bd37991e3ce413946fe63652443a8d73 (patch)
tree81e5daf84a0177c31d4486649edaa5cab111b8cc
parent2b10ee1891b9586bd95ed01c20f9c188b4ca5650 (diff)
downloadopenttd-b4a015a4bd37991e3ce413946fe63652443a8d73.tar.xz
(svn r26365) -Fix [FS#5867]: Don't draw the cursor when its sprite isn't ready and set _screen.dst_ptr immediately when the buffer changes (frosch123)
-rw-r--r--src/video/win32_v.cpp19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp
index 0ba21b0a1..78a24b407 100644
--- a/src/video/win32_v.cpp
+++ b/src/video/win32_v.cpp
@@ -192,12 +192,6 @@ static void ClientSizeChanged(int w, int h)
BlitterFactory::GetCurrentBlitter()->PostResize();
GameSizeChanged();
-
- /* redraw screen */
- if (_wnd.running) {
- _screen.dst_ptr = _wnd.buffer_bits;
- UpdateWindows();
- }
}
}
@@ -211,7 +205,6 @@ int RedrawScreenDebug()
HBITMAP old_bmp;
HPALETTE old_palette;
- _screen.dst_ptr = _wnd.buffer_bits;
UpdateWindows();
dc = GetDC(_wnd.main_wnd);
@@ -755,8 +748,6 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
if (!_cursor.in_window) {
_cursor.in_window = true;
SetTimer(hwnd, TID_POLLMOUSE, MOUSE_POLL_DELAY, (TIMERPROC)TrackMouseTimerProc);
-
- DrawMouseCursor();
}
if (_cursor.fix_at) {
@@ -1066,9 +1057,6 @@ static bool AllocateDibSection(int w, int h, bool force)
if (!force && w == _screen.width && h == _screen.height) return false;
- _screen.width = w;
- _screen.pitch = (bpp == 8) ? Align(w, 4) : w;
- _screen.height = h;
bi = (BITMAPINFO*)alloca(sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * 256);
memset(bi, 0, sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * 256);
bi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
@@ -1087,6 +1075,11 @@ static bool AllocateDibSection(int w, int h, bool force)
if (_wnd.dib_sect == NULL) usererror("CreateDIBSection failed");
ReleaseDC(0, dc);
+ _screen.width = w;
+ _screen.pitch = (bpp == 8) ? Align(w, 4) : w;
+ _screen.height = h;
+ _screen.dst_ptr = _wnd.buffer_bits;
+
return true;
}
@@ -1300,7 +1293,6 @@ void VideoDriver_Win32::MainLoop()
if (_force_full_redraw) MarkWholeScreenDirty();
- _screen.dst_ptr = _wnd.buffer_bits;
UpdateWindows();
CheckPaletteAnim();
} else {
@@ -1314,7 +1306,6 @@ void VideoDriver_Win32::MainLoop()
Sleep(1);
if (_draw_threaded) _draw_mutex->BeginCritical();
- _screen.dst_ptr = _wnd.buffer_bits;
NetworkDrawChatMessage();
DrawMouseCursor();
}