win32: force the entire client area to be invalidated at the beginning of WM_PAINT; this fixes the rare bug with DIRECTDRAWCLIPPER sometimes calculating wrong region (was noticed on some video cards)

This commit is contained in:
ansstuff 2012-12-29 11:43:38 +00:00
parent aafce94aaf
commit 15adae5df9
3 changed files with 8 additions and 5 deletions

View File

@ -701,8 +701,10 @@ void ConfigCheats(HWND hParent) {
{
selcheat=-1;
CheatWindow=1;
if (CheatStyle) pwindow = hCheat = CreateDialog(fceu_hInstance,"CHEATCONSOLE",NULL,CheatConsoleCallB);
else DialogBox(fceu_hInstance,"CHEATCONSOLE",hParent,CheatConsoleCallB);
if (CheatStyle)
pwindow = hCheat = CreateDialog(fceu_hInstance,"CHEATCONSOLE",NULL,CheatConsoleCallB);
else
DialogBox(fceu_hInstance,"CHEATCONSOLE",hParent,CheatConsoleCallB);
} else
{
ShowWindow(hCheat, SW_SHOWNORMAL);

View File

@ -68,7 +68,7 @@ PIANO_ROLL::PIANO_ROLL()
wincl.hInstance = fceu_hInstance;
wincl.lpszClassName = markerDragBoxClassName;
wincl.lpfnWndProc = MarkerDragBoxWndProc;
wincl.style = CS_DBLCLKS;
wincl.style = CS_SAVEBITS| CS_DBLCLKS;
wincl.cbSize = sizeof(WNDCLASSEX);
wincl.hIcon = 0;
wincl.hIconSm = 0;

View File

@ -1359,8 +1359,9 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
goto proco;
case WM_PAINT:
if(xbsave)
if (xbsave)
{
InvalidateRect(hWnd, NULL, false); // AnS: HACK in order to force the entire client area to be redrawn; this fixes the bug with DIRECTDRAWCLIPPER sometimes calculating wrong region
PAINTSTRUCT ps;
BeginPaint(hWnd,&ps);
FCEUD_BlitScreen(xbsave);
@ -2500,7 +2501,7 @@ int CreateMainWindow()
memset(&winclass, 0, sizeof(winclass));
winclass.cbSize = sizeof(WNDCLASSEX);
winclass.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW | CS_SAVEBITS | CS_DBLCLKS;
winclass.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS; // AnS: removed CS_SAVEBITS
winclass.lpfnWndProc = AppWndProc;
winclass.cbClsExtra = 0;
winclass.cbWndExtra = 0;