1
0
Fork 0

(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)

release/1.4
fonsinchen 2014-02-23 14:15:55 +00:00
parent 2b10ee1891
commit b4a015a4bd
1 changed files with 5 additions and 14 deletions

View File

@ -192,12 +192,6 @@ static void ClientSizeChanged(int w, int h)
BlitterFactory::GetCurrentBlitter()->PostResize(); BlitterFactory::GetCurrentBlitter()->PostResize();
GameSizeChanged(); GameSizeChanged();
/* redraw screen */
if (_wnd.running) {
_screen.dst_ptr = _wnd.buffer_bits;
UpdateWindows();
}
} }
} }
@ -211,7 +205,6 @@ int RedrawScreenDebug()
HBITMAP old_bmp; HBITMAP old_bmp;
HPALETTE old_palette; HPALETTE old_palette;
_screen.dst_ptr = _wnd.buffer_bits;
UpdateWindows(); UpdateWindows();
dc = GetDC(_wnd.main_wnd); 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) { if (!_cursor.in_window) {
_cursor.in_window = true; _cursor.in_window = true;
SetTimer(hwnd, TID_POLLMOUSE, MOUSE_POLL_DELAY, (TIMERPROC)TrackMouseTimerProc); SetTimer(hwnd, TID_POLLMOUSE, MOUSE_POLL_DELAY, (TIMERPROC)TrackMouseTimerProc);
DrawMouseCursor();
} }
if (_cursor.fix_at) { 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; 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); bi = (BITMAPINFO*)alloca(sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * 256);
memset(bi, 0, sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * 256); memset(bi, 0, sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * 256);
bi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); 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"); if (_wnd.dib_sect == NULL) usererror("CreateDIBSection failed");
ReleaseDC(0, dc); 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; return true;
} }
@ -1300,7 +1293,6 @@ void VideoDriver_Win32::MainLoop()
if (_force_full_redraw) MarkWholeScreenDirty(); if (_force_full_redraw) MarkWholeScreenDirty();
_screen.dst_ptr = _wnd.buffer_bits;
UpdateWindows(); UpdateWindows();
CheckPaletteAnim(); CheckPaletteAnim();
} else { } else {
@ -1314,7 +1306,6 @@ void VideoDriver_Win32::MainLoop()
Sleep(1); Sleep(1);
if (_draw_threaded) _draw_mutex->BeginCritical(); if (_draw_threaded) _draw_mutex->BeginCritical();
_screen.dst_ptr = _wnd.buffer_bits;
NetworkDrawChatMessage(); NetworkDrawChatMessage();
DrawMouseCursor(); DrawMouseCursor();
} }