From 3793272aaab3dee7bb7a60a9d2c6100ea9122e7f Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Tue, 27 May 2008 08:56:36 +0000 Subject: [PATCH] Display -> FontViewAndCloseUp, UpdateSample -> UpdateCloseUp. Fix leak of CloseUp bitmap. --- .../Texture Font GeneratorDlg.cpp | 24 +++++++++---------- .../Texture Font GeneratorDlg.h | 6 ++--- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/stepmania/src/Texture Font Generator/Texture Font GeneratorDlg.cpp b/stepmania/src/Texture Font Generator/Texture Font GeneratorDlg.cpp index 0a9f1b91c9..0aaa7d5506 100644 --- a/stepmania/src/Texture Font Generator/Texture Font GeneratorDlg.cpp +++ b/stepmania/src/Texture Font Generator/Texture Font GeneratorDlg.cpp @@ -111,7 +111,6 @@ void CTextureFontGeneratorDlg::UpdateFont() m_bUpdateFontNeeded = false; m_FontView.SetBitmap( NULL ); - m_CloseUp.SetBitmap( NULL ); CString sOld; { @@ -186,7 +185,7 @@ void CTextureFontGeneratorDlg::UpdateFont() m_ShownPage.SetCurSel( iRet ); } -void CTextureFontGeneratorDlg::UpdateSample() +void CTextureFontGeneratorDlg::UpdateCloseUp() { HBITMAP hBitmap = m_CloseUp.GetBitmap(); m_CloseUp.SetBitmap( NULL ); @@ -303,16 +302,15 @@ BOOL CTextureFontGeneratorDlg::OnInitDialog() m_SpinBaseline.SetRange( 64, 0 ); m_bUpdateFontNeeded = true; - m_bUpdateDisplayNeeded = true; + m_bUpdateFontViewAndCloseUpNeeded = true; return TRUE; // return TRUE unless you set the focus to a control } -void CTextureFontGeneratorDlg::UpdateDisplay() +void CTextureFontGeneratorDlg::UpdateFontViewAndCloseUp() { - m_bUpdateDisplayNeeded = false; + m_bUpdateFontViewAndCloseUpNeeded = false; m_FontView.SetBitmap( NULL ); - m_CloseUp.SetBitmap( NULL ); m_SpinTop.EnableWindow( true ); m_SpinBaseline.EnableWindow( true ); @@ -339,7 +337,7 @@ void CTextureFontGeneratorDlg::UpdateDisplay() HBITMAP hBitmap = g_pTextureFont->m_apPages[iSelectedPage]->m_hPage; m_FontView.SetBitmap( hBitmap ); - UpdateSample(); + UpdateCloseUp(); CString sStr; sStr.Format("Overlap: %i, %i\nMaximum size: %ix%i", @@ -379,12 +377,12 @@ void CTextureFontGeneratorDlg::OnPaint() if( m_bUpdateFontNeeded ) { - m_bUpdateDisplayNeeded = true; + m_bUpdateFontViewAndCloseUpNeeded = true; UpdateFont(); } - if( m_bUpdateDisplayNeeded ) - UpdateDisplay(); + if( m_bUpdateFontViewAndCloseUpNeeded ) + UpdateFontViewAndCloseUp(); CDialog::OnPaint(); } @@ -447,7 +445,7 @@ BOOL CTextureFontGeneratorDlg::CanExit() void CTextureFontGeneratorDlg::OnCbnSelchangeShownPage() { - m_bUpdateDisplayNeeded = true; + m_bUpdateFontViewAndCloseUpNeeded = true; Invalidate( FALSE ); UpdateWindow(); } @@ -517,7 +515,7 @@ void CTextureFontGeneratorDlg::OnDeltaposSpinTop(NMHDR *pNMHDR, LRESULT *pResult LPNMUPDOWN pNMUpDown = reinterpret_cast(pNMHDR); *pResult = 0; - m_bUpdateDisplayNeeded = true; + m_bUpdateFontViewAndCloseUpNeeded = true; Invalidate( FALSE ); } @@ -526,7 +524,7 @@ void CTextureFontGeneratorDlg::OnDeltaposSpinBaseline(NMHDR *pNMHDR, LRESULT *pR LPNMUPDOWN pNMUpDown = reinterpret_cast(pNMHDR); *pResult = 0; - m_bUpdateDisplayNeeded = true; + m_bUpdateFontViewAndCloseUpNeeded = true; Invalidate( FALSE ); } diff --git a/stepmania/src/Texture Font Generator/Texture Font GeneratorDlg.h b/stepmania/src/Texture Font Generator/Texture Font GeneratorDlg.h index 0edcdff9e7..2f89d03bba 100644 --- a/stepmania/src/Texture Font Generator/Texture Font GeneratorDlg.h +++ b/stepmania/src/Texture Font Generator/Texture Font GeneratorDlg.h @@ -24,7 +24,7 @@ protected: BOOL CanExit(); bool m_bUpdateFontNeeded; - bool m_bUpdateDisplayNeeded; + bool m_bUpdateFontViewAndCloseUpNeeded; // Generated message map functions virtual BOOL OnInitDialog(); @@ -37,9 +37,9 @@ protected: virtual BOOL OnMouseWheel( UINT nFlags, short zDelta, CPoint pt ); DECLARE_MESSAGE_MAP() - void UpdateDisplay(); + void UpdateFontViewAndCloseUp(); void UpdateFont(); - void UpdateSample(); + void UpdateCloseUp(); public: vector m_PagesToGenerate;