GSdx: this should probably fix taking snapshots with dx9, also upped the version to .15, since the revision number has passed what the last release still had from the old repository.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@943 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gabest11 2009-04-10 07:12:29 +00:00
parent b1769a2061
commit b0da55cb89
3 changed files with 10 additions and 14 deletions

View File

@ -26,7 +26,7 @@
#pragma once
#define PLUGIN_VERSION 14
#define PLUGIN_VERSION 15
#include "GSVector.h"

View File

@ -349,8 +349,6 @@ protected:
OverrideOutput();
m_tc->InvalidateTextures(context->FRAME, context->ZBUF);
if(s_dump)
{
CString str;
@ -360,6 +358,8 @@ protected:
if(s_savez) ds->m_texture.Save(str);
// if(s_savez) m_dev.SaveToFileD32S8X24(ds->m_texture, str); // TODO
}
m_tc->InvalidateTextures(context->FRAME, context->ZBUF);
}
virtual void Draw(int prim, Texture& rt, Texture& ds, typename GSTextureCache<Device>::GSTexture* tex) = 0;

View File

@ -140,7 +140,7 @@ void GSTexture9::Unmap()
bool GSTexture9::Save(CString fn, bool dds)
{
CComPtr<IDirect3DResource9> res;
CComPtr<IDirect3DSurface9> surface;
if(m_desc.Usage & D3DUSAGE_DEPTHSTENCIL)
{
@ -153,8 +153,6 @@ bool GSTexture9::Save(CString fn, bool dds)
if(desc.Format != D3DFMT_D32F_LOCKABLE)
return false;
CComPtr<IDirect3DSurface9> surface;
hr = m_dev->CreateOffscreenPlainSurface(desc.Width, desc.Height, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &surface, NULL);
D3DLOCKED_RECT slr, dlr;
@ -175,24 +173,22 @@ bool GSTexture9::Save(CString fn, bool dds)
m_surface->UnlockRect();
surface->UnlockRect();
res = surface;
}
else
{
res = m_surface;
surface = m_surface;
}
if(CComQIPtr<IDirect3DSurface9> surface = res)
if(surface != NULL)
{
return SUCCEEDED(D3DXSaveSurfaceToFile(fn, dds ? D3DXIFF_DDS : D3DXIFF_BMP, surface, NULL, NULL));
}
if(CComQIPtr<IDirect3DTexture9> texture = res)
/*
if(CComQIPtr<IDirect3DTexture9> texture = surface)
{
return SUCCEEDED(D3DXSaveTextureToFile(fn, dds ? D3DXIFF_DDS : D3DXIFF_BMP, texture, NULL));
}
*/
return false;
}