Browse Source

Fix. Restore depth stencil surface.

aignacio_sf 17 years ago
parent
commit
46ada8c264
1 changed files with 2 additions and 3 deletions
  1. 2 3
      panda/src/dxgsg9/dxTextureContext9.cxx

+ 2 - 3
panda/src/dxgsg9/dxTextureContext9.cxx

@@ -1706,14 +1706,12 @@ fill_d3d_texture_pixels(DXScreenData &scrn) {
               IDirect3DSurface9 *depth_stencil_surface;
 
               // turn off depth stencil when clearing texture if it exists
+              depth_stencil_surface = 0;
               if (device -> GetDepthStencilSurface (&depth_stencil_surface) == D3D_OK) {
                 if (device -> SetDepthStencilSurface (NULL) == D3D_OK) {
       
                 }
               }
-              else {
-                depth_stencil_surface = 0;
-              }
 
               if (device -> SetRenderTarget (0, surface)  == D3D_OK) {
                 DWORD flags;
@@ -1727,6 +1725,7 @@ fill_d3d_texture_pixels(DXScreenData &scrn) {
 
               // restore depth stencil 
               if (depth_stencil_surface) {
+                device -> SetDepthStencilSurface (depth_stencil_surface);
                 depth_stencil_surface -> Release();
               }