From b4a015a4bd37991e3ce413946fe63652443a8d73 Mon Sep 17 00:00:00 2001 From: fonsinchen Date: Sun, 23 Feb 2014 14:15:55 +0000 Subject: (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) --- src/video/win32_v.cpp | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'src/video') 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(); } -- cgit v1.2.3-70-g09d2