Commit 1bcd6e45 authored by Alexander Dorofeyev's avatar Alexander Dorofeyev Committed by Alexandre Julliard

wined3d: Get rid of gl buffer variable in BltOverride.

Uses This == dstSwapchain->frontBuffer instead as suggested by Henri Verbeet.
parent 7c388168
...@@ -3368,7 +3368,6 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT * ...@@ -3368,7 +3368,6 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT *
WINEDDCOLORKEY oldBltCKey = Src->SrcBltCKey; WINEDDCOLORKEY oldBltCKey = Src->SrcBltCKey;
RECT SourceRectangle; RECT SourceRectangle;
BOOL paletteOverride = FALSE; BOOL paletteOverride = FALSE;
GLenum buffer;
TRACE("Blt from surface %p to rendertarget %p\n", Src, This); TRACE("Blt from surface %p to rendertarget %p\n", Src, This);
...@@ -3442,29 +3441,16 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT * ...@@ -3442,29 +3441,16 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT *
/* Activate the destination context, set it up for blitting */ /* Activate the destination context, set it up for blitting */
ActivateContext(myDevice, (IWineD3DSurface *) This, CTXUSAGE_BLIT); ActivateContext(myDevice, (IWineD3DSurface *) This, CTXUSAGE_BLIT);
if(!dstSwapchain) { if (dstSwapchain && (IWineD3DSurface *)This == dstSwapchain->frontBuffer) {
TRACE("Drawing to offscreen buffer\n"); RECT windowsize;
buffer = myDevice->offscreenBuffer; POINT offset = {0,0};
} else { UINT h;
buffer = surface_get_gl_buffer((IWineD3DSurface *)This, (IWineD3DSwapChain *)dstSwapchain); ClientToScreen(dstSwapchain->win_handle, &offset);
GetClientRect(dstSwapchain->win_handle, &windowsize);
/* Front buffer coordinates are screen coordinates, while OpenGL coordinates are h = windowsize.bottom - windowsize.top;
* window relative. Also beware of the origin difference(top left vs bottom left). rect.x1 -= offset.x; rect.x2 -=offset.x;
* Also beware that the front buffer's surface size is screen width x screen height, rect.y1 -= offset.y; rect.y2 -=offset.y;
* whereas the real gl drawable size is the size of the window. rect.y1 += This->currentDesc.Height - h; rect.y2 += This->currentDesc.Height - h;
*/
if(buffer == GL_FRONT) {
RECT windowsize;
POINT offset = {0,0};
UINT h;
ClientToScreen(dstSwapchain->win_handle, &offset);
GetClientRect(dstSwapchain->win_handle, &windowsize);
h = windowsize.bottom - windowsize.top;
rect.x1 -= offset.x; rect.x2 -=offset.x;
rect.y1 -= offset.y; rect.y2 -=offset.y;
rect.y1 += This->currentDesc.Height - h; rect.y2 += This->currentDesc.Height - h;
}
TRACE("Drawing to %#x buffer\n", buffer);
} }
ENTER_GL(); ENTER_GL();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment