Alexander Dorofeyev : wined3d: Get rid of gl buffer variable in BltOverride .
Alexandre Julliard
julliard at winehq.org
Thu Sep 4 08:27:09 CDT 2008
Module: wine
Branch: master
Commit: 1bcd6e45080063ab9396506efb9cd5ad914c251e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1bcd6e45080063ab9396506efb9cd5ad914c251e
Author: Alexander Dorofeyev <alexd4 at inbox.lv>
Date: Wed Sep 3 23:59:53 2008 +0300
wined3d: Get rid of gl buffer variable in BltOverride.
Uses This == dstSwapchain->frontBuffer instead as suggested by Henri Verbeet.
---
dlls/wined3d/surface.c | 34 ++++++++++------------------------
1 files changed, 10 insertions(+), 24 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 31cb368..99379dd 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3368,7 +3368,6 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT *
WINEDDCOLORKEY oldBltCKey = Src->SrcBltCKey;
RECT SourceRectangle;
BOOL paletteOverride = FALSE;
- GLenum buffer;
TRACE("Blt from surface %p to rendertarget %p\n", Src, This);
@@ -3442,29 +3441,16 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT *
/* Activate the destination context, set it up for blitting */
ActivateContext(myDevice, (IWineD3DSurface *) This, CTXUSAGE_BLIT);
- if(!dstSwapchain) {
- TRACE("Drawing to offscreen buffer\n");
- buffer = myDevice->offscreenBuffer;
- } else {
- buffer = surface_get_gl_buffer((IWineD3DSurface *)This, (IWineD3DSwapChain *)dstSwapchain);
-
- /* Front buffer coordinates are screen coordinates, while OpenGL coordinates are
- * window relative. Also beware of the origin difference(top left vs bottom left).
- * Also beware that the front buffer's surface size is screen width x screen height,
- * whereas the real gl drawable size is the size of the window.
- */
- 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);
+ if (dstSwapchain && (IWineD3DSurface *)This == dstSwapchain->frontBuffer) {
+ 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;
}
ENTER_GL();
More information about the wine-cvs
mailing list