aboutsummaryrefslogtreecommitdiff
path: root/guilib/GUIFontTTFDX.cpp
diff options
context:
space:
mode:
authorcrystalpt <crystalpt@svn>2010-07-16 05:30:35 +0000
committercrystalpt <crystalpt@svn>2010-07-16 05:30:35 +0000
commit6464b30ae1f2839c6a85b27190901621719a62b7 (patch)
tree0fc8af8d4a4eb9bd2748976d43aea162be33832f /guilib/GUIFontTTFDX.cpp
parent4e9b332a6b4a26e137d274e3f89baef0b9df5f17 (diff)
[WIN32] fixed: LockRect when dynamic textures are not available
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@31842 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib/GUIFontTTFDX.cpp')
-rw-r--r--guilib/GUIFontTTFDX.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/guilib/GUIFontTTFDX.cpp b/guilib/GUIFontTTFDX.cpp
index 47b80a3dc9..f1b8c0d814 100644
--- a/guilib/GUIFontTTFDX.cpp
+++ b/guilib/GUIFontTTFDX.cpp
@@ -140,8 +140,9 @@ CBaseTexture* CGUIFontTTFDX::ReallocTexture(unsigned int& newHeight)
m_textureHeight = desc.Height;
m_textureWidth = desc.Width;
+ DWORD flags = (newTexture->Usage & D3DUSAGE_DYNAMIC) ? D3DLOCK_DISCARD : 0;
D3DLOCKED_RECT rect;
- newTexture->LockRect(0, &rect, NULL, D3DLOCK_DISCARD);
+ newTexture->LockRect(0, &rect, NULL, flags);
memset(rect.pBits, 0, rect.Pitch * m_textureHeight);
newTexture->UnlockRect(0);