CVS change done by Sascha Sommer CVS Update of /cvsroot/mplayer/main/libvo In directory mail:/var2/tmp/cvs-serv15185/libvo Modified Files: vo_directx.c Log Message: more sane order for overlay workarounds, fixed a bug where the mouse would stay hidden on win98 Index: vo_directx.c =================================================================== RCS file: /cvsroot/mplayer/main/libvo/vo_directx.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- vo_directx.c 1 May 2004 20:21:03 -0000 1.30 +++ vo_directx.c 18 May 2004 17:51:25 -0000 1.31 @@ -507,7 +507,7 @@ } else height=tmpheight; } - ShowCursor(TRUE); + while(ShowCursor(TRUE)<=0){} } rd.right=rd.left+width; rd.bottom=rd.top+height; @@ -521,6 +521,21 @@ ZeroMemory(&capsDrv, sizeof(capsDrv)); capsDrv.dwSize = sizeof(capsDrv); if(g_lpdd->lpVtbl->GetCaps(g_lpdd,&capsDrv, NULL) != DD_OK)return 1; + /*get minimum stretch, depends on display adaptor and mode (refresh rate!) */ + uStretchFactor1000 = capsDrv.dwMinOverlayStretch>1000 ? capsDrv.dwMinOverlayStretch : 1000; + rd.right = ((width+rd.left)*uStretchFactor1000+999)/1000; + rd.bottom = (height+rd.top)*uStretchFactor1000/1000; + /*calculate xstretch1000 and ystretch1000*/ + xstretch1000 = ((rd.right - rd.left)* 1000)/image_width ; + ystretch1000 = ((rd.bottom - rd.top)* 1000)/image_height; + rs.left=0; + rs.right=image_width; + rs.top=0; + rs.bottom=image_height; + if(rd.left < 0)rs.left=(-rd.left*1000)/xstretch1000; + if(rd.top < 0)rs.top=(-rd.top*1000)/ystretch1000; + if(rd.right > vo_screenwidth)rs.right=((vo_screenwidth-rd.left)*1000)/xstretch1000; + if(rd.bottom > vo_screenheight)rs.bottom=((vo_screenheight-rd.top)*1000)/ystretch1000; /*do not allow to zoom or shrink if hardware isn't able to do so*/ if((width < image_width)&& !(capsDrv.dwFXCaps & DDFXCAPS_OVERLAYSHRINKX)) { @@ -545,22 +560,7 @@ if(capsDrv.dwFXCaps & DDFXCAPS_OVERLAYSTRETCHYN)mp_msg(MSGT_VO, MSGL_ERR,"<vo_directx><ERROR>can only stretchN\n"); else mp_msg(MSGT_VO, MSGL_ERR,"<vo_directx><ERROR>can't stretch y\n"); rd.bottom = rd.top + image_height; - } - /*get minimum stretch, depends on display adaptor and mode (refresh rate!) */ - uStretchFactor1000 = capsDrv.dwMinOverlayStretch>1000 ? capsDrv.dwMinOverlayStretch : 1000; - rd.right = ((width+rd.left)*uStretchFactor1000+999)/1000; - rd.bottom = (height+rd.top)*uStretchFactor1000/1000; - /*calculate xstretch1000 and ystretch1000*/ - xstretch1000 = ((rd.right - rd.left)* 1000)/image_width ; - ystretch1000 = ((rd.bottom - rd.top)* 1000)/image_height; - rs.left=0; - rs.right=image_width; - rs.top=0; - rs.bottom=image_height; - if(rd.left < 0)rs.left=(-rd.left*1000)/xstretch1000; - if(rd.top < 0)rs.top=(-rd.top*1000)/ystretch1000; - if(rd.right > vo_screenwidth)rs.right=((vo_screenwidth-rd.left)*1000)/xstretch1000; - if(rd.bottom > vo_screenheight)rs.bottom=((vo_screenheight-rd.top)*1000)/ystretch1000; + } /*the last thing to check are alignment restrictions these expressions (x & -y) just do alignment by dropping low order bits... so to round up, we add first, then truncate*/ @@ -1178,7 +1178,8 @@ rd.top = vo_dy; rd.right = rd.left + d_image_width; rd.bottom = rd.top + d_image_height; - SetWindowPos(hWnd,NULL, rd.left, rd.top,rd.right-rd.left,rd.bottom-rd.top,SWP_SHOWWINDOW|SWP_NOOWNERZORDER); + AdjustWindowRect(&rd,WS_OVERLAPPEDWINDOW|WS_SIZEBOX,FALSE); + SetWindowPos(hWnd,NULL, vo_dx, vo_dy,rd.right-rd.left,rd.bottom-rd.top,SWP_SHOWWINDOW|SWP_NOOWNERZORDER); } else ShowWindow(hWnd,SW_SHOW);
participants (1)
-
syncmail@mplayerhq.hu