Index: ddraw/glRenderer.cpp |
— | — | @@ -3890,6 +3890,33 @@ |
3891 | 3891 | else return FALSE;
|
3892 | 3892 | }
|
3893 | 3893 |
|
| 3894 | +static BOOL(WINAPI *__UpdateLayeredWindow)(HWND hWnd, HDC hdcDst, POINT *pptDst, SIZE *psize,
|
| 3895 | + HDC hdcSrc, POINT *pptSrc, COLORREF crKey, BLENDFUNCTION *pblend, DWORD dwFlags) = NULL;
|
| 3896 | +static BOOL UpdateLayeredWindowFail = FALSE;
|
| 3897 | +static BOOL WINAPI _UpdateLayeredWindow(HWND hWnd, HDC hdcDst, POINT *pptDst, SIZE *psize,
|
| 3898 | + HDC hdcSrc, POINT *pptSrc, COLORREF crKey, BLENDFUNCTION *pblend, DWORD dwFlags)
|
| 3899 | +{
|
| 3900 | + HANDLE hUser32;
|
| 3901 | + if (!__UpdateLayeredWindow)
|
| 3902 | + {
|
| 3903 | + if (UpdateLayeredWindowFail) return FALSE;
|
| 3904 | + hUser32 = GetModuleHandle(_T("user32.dll"));
|
| 3905 | + if (!hUser32)
|
| 3906 | + {
|
| 3907 | + UpdateLayeredWindowFail = TRUE;
|
| 3908 | + return FALSE;
|
| 3909 | + }
|
| 3910 | + __UpdateLayeredWindow = (BOOL(WINAPI*)(HWND,HDC,POINT*,SIZE*,HDC,POINT*,COLORREF,BLENDFUNCTION*,DWORD))
|
| 3911 | + GetProcAddress((HMODULE)hUser32, "UpdateLayeredWindow");
|
| 3912 | + if (!__UpdateLayeredWindow)
|
| 3913 | + {
|
| 3914 | + UpdateLayeredWindowFail = TRUE;
|
| 3915 | + return NULL;
|
| 3916 | + }
|
| 3917 | + }
|
| 3918 | + return __UpdateLayeredWindow(hWnd, hdcDst, pptDst, psize, hdcSrc, pptSrc, crKey, pblend, dwFlags);
|
| 3919 | +}
|
| 3920 | +
|
3894 | 3921 | void glRenderer__DrawScreen(glRenderer *This, glTexture *texture, glTexture *paltex, GLint vsync, glTexture *previous, BOOL setsync, BOOL settime)
|
3895 | 3922 | {
|
3896 | 3923 | int progtype;
|
— | — | @@ -4067,7 +4094,7 @@ |
4068 | 4095 | BLENDFUNCTION func = {AC_SRC_OVER,0,255,AC_SRC_ALPHA};
|
4069 | 4096 | hPrevObj = SelectObject(This->dib.hdc,This->dib.hbitmap);
|
4070 | 4097 | ClientToScreen(This->RenderWnd->GetHWnd(),&dest);
|
4071 | | - UpdateLayeredWindow(This->RenderWnd->GetHWnd(),hRenderDC,&dest,&wnd,
|
| 4098 | + _UpdateLayeredWindow(This->RenderWnd->GetHWnd(),hRenderDC,&dest,&wnd,
|
4072 | 4099 | This->dib.hdc,&srcpoint,0,&func,ULW_ALPHA);
|
4073 | 4100 | SelectObject(This->dib.hdc,hPrevObj);
|
4074 | 4101 | ReleaseDC(This->RenderWnd->GetHWnd(),hRenderDC);
|