diff options
author | crystalpt <crystalpt@svn> | 2010-07-16 05:33:40 +0000 |
---|---|---|
committer | crystalpt <crystalpt@svn> | 2010-07-16 05:33:40 +0000 |
commit | e83106f40d6b5ba4ce040ec62886308236da06ac (patch) | |
tree | 2af9e8990c956fb9b1e9b419a7ba5cb0daf27314 /guilib | |
parent | 6464b30ae1f2839c6a85b27190901621719a62b7 (diff) |
[WIN32] changed: we don't need to save/restore render targets & depth stencils
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@31843 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib')
-rw-r--r-- | guilib/D3DResource.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/guilib/D3DResource.cpp b/guilib/D3DResource.cpp index a8f4dbc61f..787930b90b 100644 --- a/guilib/D3DResource.cpp +++ b/guilib/D3DResource.cpp @@ -122,14 +122,17 @@ void CD3DTexture::SaveTexture() { delete[] m_data; m_data = NULL; - D3DLOCKED_RECT lr; - if (LockRect( 0, &lr, NULL, D3DLOCK_READONLY )) + if (!(m_usage & D3DUSAGE_RENDERTARGET) && !(m_usage & D3DUSAGE_DEPTHSTENCIL)) { - m_pitch = lr.Pitch; - unsigned int memUsage = GetMemoryUsage(lr.Pitch); - m_data = new unsigned char[memUsage]; - memcpy(m_data, lr.pBits, memUsage); - UnlockRect(0); + D3DLOCKED_RECT lr; + if (LockRect( 0, &lr, NULL, D3DLOCK_READONLY )) + { + m_pitch = lr.Pitch; + unsigned int memUsage = GetMemoryUsage(lr.Pitch); + m_data = new unsigned char[memUsage]; + memcpy(m_data, lr.pBits, memUsage); + UnlockRect(0); + } } } SAFE_RELEASE(m_texture); |