Browse Source

Temporary solution to Dx8 CopyRects alternative, but it is very slow. I will be implementing a better method.

Asad M. Zaman 22 years ago
parent
commit
ea16b5d9f7
1 changed files with 3 additions and 2 deletions
  1. 3 2
      panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx

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

@@ -3189,7 +3189,8 @@ copy_texture(Texture *tex, const DisplayRegion *dr) {
   SrcRect.bottom = yo+h;
   SrcRect.bottom = yo+h;
 
 
   // now copy from fb to tex
   // now copy from fb to tex
-  hr = _pD3DDevice->UpdateSurface(pCurRenderTarget,&SrcRect,pTexSurfaceLev0,NULL);
+  //hr = _pD3DDevice->UpdateSurface(pCurRenderTarget,&SrcRect,pTexSurfaceLev0,NULL);
+  hr = D3DXLoadSurfaceFromSurface(pTexSurfaceLev0, NULL, NULL, pCurRenderTarget, NULL, &SrcRect, D3DX_DEFAULT, 0);
   
   
   if(FAILED(hr)) {
   if(FAILED(hr)) {
     dxgsg9_cat.error() << "UpdateSurface failed in copy_texture" << D3DERRORSTRING(hr);
     dxgsg9_cat.error() << "UpdateSurface failed in copy_texture" << D3DERRORSTRING(hr);
@@ -3326,7 +3327,7 @@ copy_pixel_buffer(PixelBuffer *pb, const DisplayRegion *dr) {
            SrcCopyRect.bottom=TmpSurfYsize;
            SrcCopyRect.bottom=TmpSurfYsize;
         }
         }
 
 
-        hr=_pD3DDevice->CreateOffscreenPlainSurface(TmpSurfXsize,TmpSurfYsize,D3DFMT_A8R8G8B8,D3DPOOL_SCRATCH, &pD3DSurf, NULL);
+        hr=_pD3DDevice->CreateOffscreenPlainSurface(TmpSurfXsize,TmpSurfYsize,D3DFMT_A8R8G8B8,D3DPOOL_SYSTEMMEM, &pD3DSurf, NULL);
         if(FAILED(hr)) {
         if(FAILED(hr)) {
            dxgsg9_cat.error() << "CreateImageSurface failed in copy_pixel_buffer()" << D3DERRORSTRING(hr);
            dxgsg9_cat.error() << "CreateImageSurface failed in copy_pixel_buffer()" << D3DERRORSTRING(hr);
            return false;
            return false;