[D3D8] Add some depth/stencil buffer stuff

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

This patch makes Incoming Forces go further.
(and crash in vertex/pixel shaders stuff).

Bye.
Christian

Changelog :
Handle creation of a depth/stencil buffer when creating a device.
Implement IDirect3D8DeviceImpl_GetDepthStencilBuffer.

Christian Costa titan.costa@wanadoo.fr

Index: d3d8_private.h
===================================================================
RCS file: /home/wine/wine/dlls/d3d8/d3d8_private.h,v
retrieving revision 1.16
diff -u -r1.16 d3d8_private.h
--- d3d8_private.h	12 Apr 2003 00:06:43 -0000	1.16
+++ d3d8_private.h	12 Apr 2003 11:14:50 -0000
@@ -239,6 +239,7 @@
     /* IDirect3DDevice8 fields */
     IDirect3D8Impl               *direct3d8;
     IDirect3DSurface8Impl        *backBuffer;
+    IDirect3DSurface8Impl        *depthStencilBuffer;
     D3DPRESENT_PARAMETERS         PresentParms;
     D3DDEVICE_CREATION_PARAMETERS CreateParms;
 
Index: device.c
===================================================================
RCS file: /home/wine/wine/dlls/d3d8/device.c,v
retrieving revision 1.36
diff -u -r1.36 device.c
--- device.c	30 Jan 2003 00:18:27 -0000	1.36
+++ device.c	12 Apr 2003 11:15:00 -0000
@@ -828,12 +828,22 @@
     SHORT retVal;
 
     switch (fmt) {
+    /* color buffer */
     case D3DFMT_A4R4G4B4:         retVal = 2; break;
     case D3DFMT_A8R8G8B8:         retVal = 4; break;
     case D3DFMT_X8R8G8B8:         retVal = 4; break;
     case D3DFMT_R8G8B8:           retVal = 3; break;
     case D3DFMT_R5G6B5:           retVal = 2; break;
     case D3DFMT_A1R5G5B5:         retVal = 2; break;
+    /* depth/stencil buffer */
+    case D3DFMT_D16_LOCKABLE:     retVal = 2; break;
+    case D3DFMT_D32:              retVal = 4; break;
+    case D3DFMT_D15S1:            retVal = 2; break;
+    case D3DFMT_D24S8:            retVal = 4; break;
+    case D3DFMT_D16:              retVal = 2; break;
+    case D3DFMT_D24X8:            retVal = 4; break;
+    case D3DFMT_D24X4S4:          retVal = 4; break;
+    /* unknown */				  
     case D3DFMT_UNKNOWN:
         /* Guess at the highest value of the above */
         TRACE("D3DFMT_UNKNOWN - Guessing at 4 bytes/pixel %d\n", fmt);
@@ -1587,10 +1597,12 @@
 
     ICOM_THIS(IDirect3DDevice8Impl,iface);
 
-    /* Note inc ref on returned surface *
-    IDirect3DSurface8Impl_AddRef((LPDIRECT3DSURFACE8) *ppBackBuffer); */
+    TRACE("(%p)->(%p)\n", This, ppZStencilSurface);
+    
+    /* Note inc ref on returned surface */
+    IDirect3DSurface8Impl_AddRef((LPDIRECT3DSURFACE8)This->depthStencilBuffer);
+    *ppZStencilSurface = (LPDIRECT3DSURFACE8)This->depthStencilBuffer;
 
-    FIXME("(%p) : stub\n", This);
     return D3D_OK;
 }
 
Index: directx.c
===================================================================
RCS file: /home/wine/wine/dlls/d3d8/directx.c,v
retrieving revision 1.18
diff -u -r1.18 directx.c
--- directx.c	1 Feb 2003 00:35:36 -0000	1.18
+++ directx.c	12 Apr 2003 11:15:02 -0000
@@ -530,6 +530,13 @@
                                             pPresentationParameters->BackBufferFormat,
                                             (LPDIRECT3DSURFACE8*) &object->backBuffer);
 
+    if (pPresentationParameters->EnableAutoDepthStencil)
+        IDirect3DDevice8Impl_CreateImageSurface((LPDIRECT3DDEVICE8) object,
+                                                pPresentationParameters->BackBufferWidth,
+                                                pPresentationParameters->BackBufferHeight,
+                                                pPresentationParameters->AutoDepthStencilFormat,
+                                                (LPDIRECT3DSURFACE8*) &object->depthStencilBuffer);
+    
     /* Now override the surface's Flip method (if in double buffering) ?COPIED from DDRAW!?
     ((x11_ds_private *) surface->private)->opengl_flip = TRUE;
     {


[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux