WineD3D: Account for offscreen rendering when setting up the clearing

Stefan Dösinger stefan at codeweavers.com
Fri Mar 9 17:58:01 CST 2007


Fixes the shadows in half-life 2, at least partially. A lot of them are 
missing, those that are there work correctly now.
-------------- next part --------------
From e9278447a98ce1b99a9c17196519c937698ea956 Mon Sep 17 00:00:00 2001
From: Stefan Doesinger <stefan at codeweavers.com>
Date: Wed, 7 Mar 2007 01:43:53 +0100
Subject: [PATCH] WineD3D: Account for offscreen rendering when setting up the clearing

scissor rectangle
---
 dlls/wined3d/device.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index ad82125..205fca2 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4221,8 +4221,13 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Clear(IWineD3DDevice *iface, DWORD Coun
                 continue;
             }
 
-            glScissor(curRect[i].x1, target->currentDesc.Height - curRect[i].y2,
-                        curRect[i].x2 - curRect[i].x1, curRect[i].y2 - curRect[i].y1);
+            if(This->render_offscreen) {
+                glScissor(curRect[i].x1, curRect[i].y1,
+                          curRect[i].x2 - curRect[i].x1, curRect[i].y2 - curRect[i].y1);
+            } else {
+                glScissor(curRect[i].x1, target->currentDesc.Height - curRect[i].y2,
+                          curRect[i].x2 - curRect[i].x1, curRect[i].y2 - curRect[i].y1);
+            }
             checkGLcall("glScissor");
 
             glClear(glMask);
-- 
1.4.4.3



More information about the wine-patches mailing list