From 7cb96f107183d8917195cdcffb5103605ba49e6f Mon Sep 17 00:00:00 2001 From: spacy51 Date: Sat, 1 Dec 2007 21:22:02 +0000 Subject: [PATCH] optimized font treatment on device reset git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@129 a31d4220-a93d-0410-bf67-fe4944624d44 --- src/win32/Direct3D.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/win32/Direct3D.cpp b/src/win32/Direct3D.cpp index 2bc04a40..e89f6850 100644 --- a/src/win32/Direct3D.cpp +++ b/src/win32/Direct3D.cpp @@ -734,7 +734,10 @@ bool Direct3DDisplay::resetDevice() if( !pDevice ) return false; HRESULT hr; - destroyFont(); + if( pFont ) { + // prepares font for rest + pFont->OnLostDevice(); + } destroyTexture(); prepareDisplayMode(); @@ -751,7 +754,10 @@ bool Direct3DDisplay::resetDevice() return false; } - createFont(); + if( pFont ) { + // re-aquires font resources + pFont->OnResetDevice(); + } createTexture(); setOption( _T("d3dFilter"), theApp.d3dFilter ); failed = false;