From 310c83d0666b166305e649e4efc5dc5f1d27802e Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Fri, 4 Jul 2008 23:57:06 +0000 Subject: [PATCH] add Numbers Only. Export either main+alt, or numbers - not both. --- .../Texture Font Generator.rc | 1 + .../Texture Font GeneratorDlg.cpp | 68 ++++++++++++------- .../Texture Font GeneratorDlg.h | 1 + .../src/Texture Font Generator/resource.h | 4 +- 4 files changed, 48 insertions(+), 26 deletions(-) diff --git a/stepmania/src/Texture Font Generator/Texture Font Generator.rc b/stepmania/src/Texture Font Generator/Texture Font Generator.rc index b01b1bd3f6..03df7e9a10 100644 --- a/stepmania/src/Texture Font Generator/Texture Font Generator.rc +++ b/stepmania/src/Texture Font Generator/Texture Font Generator.rc @@ -172,6 +172,7 @@ BEGIN BEGIN MENUITEM "Double Resolution", ID_OPTIONS_DOUBLERES MENUITEM "Export Stroke Templates", ID_OPTIONS_EXPORTSTROKETEMPLATES + MENUITEM "Numbers Only", ID_OPTIONS_NUMBERSONLY END END diff --git a/stepmania/src/Texture Font Generator/Texture Font GeneratorDlg.cpp b/stepmania/src/Texture Font Generator/Texture Font GeneratorDlg.cpp index 42449b8df9..50abb9b1fb 100644 --- a/stepmania/src/Texture Font Generator/Texture Font GeneratorDlg.cpp +++ b/stepmania/src/Texture Font Generator/Texture Font GeneratorDlg.cpp @@ -64,6 +64,7 @@ BEGIN_MESSAGE_MAP(CTextureFontGeneratorDlg, CDialog) ON_COMMAND(ID_ACCELERATOR_BOLD, OnStyleBold) ON_COMMAND(ID_OPTIONS_DOUBLERES, &CTextureFontGeneratorDlg::OnOptionsDoubleres) ON_COMMAND(ID_OPTIONS_EXPORTSTROKETEMPLATES, &CTextureFontGeneratorDlg::OnOptionsExportstroketemplates) + ON_COMMAND(ID_OPTIONS_NUMBERSONLY, &CTextureFontGeneratorDlg::OnOptionsNumbersonly) END_MESSAGE_MAP() @@ -142,35 +143,42 @@ void CTextureFontGeneratorDlg::UpdateFont( bool bSavingDoubleRes ) g_pTextureFont->m_PagesToGenerate.clear(); FontPageDescription desc; - desc.name = "main"; - for( int i = 0; map_cp1252[i]; ++i ) - { - wchar_t wc = map_cp1252[i]; - if( wc != 0xFFFF ) - desc.chars.push_back(wc); - } - g_pTextureFont->m_PagesToGenerate.push_back( desc ); - desc.name = "alt"; - desc.chars.clear(); - for( int i = 0; map_iso_8859_2[i]; ++i ) - { - wchar_t wc = map_iso_8859_2[i]; - if( wc != 0xFFFF ) - desc.chars.push_back(wc); - } - g_pTextureFont->m_PagesToGenerate.push_back( desc ); + bool bNumbersOnly = !!( pMenu->GetMenuState(ID_OPTIONS_NUMBERSONLY, 0) & MF_CHECKED ); - desc.name = "numbers"; - desc.chars.clear(); - for( int i = 0; map_numbers[i]; ++i ) + if( !bNumbersOnly ) { - wchar_t wc = map_numbers[i]; - if( wc != 0xFFFF ) - desc.chars.push_back(wc); - } - g_pTextureFont->m_PagesToGenerate.push_back( desc ); + desc.name = "main"; + for( int i = 0; map_cp1252[i]; ++i ) + { + wchar_t wc = map_cp1252[i]; + if( wc != 0xFFFF ) + desc.chars.push_back(wc); + } + g_pTextureFont->m_PagesToGenerate.push_back( desc ); + desc.name = "alt"; + desc.chars.clear(); + for( int i = 0; map_iso_8859_2[i]; ++i ) + { + wchar_t wc = map_iso_8859_2[i]; + if( wc != 0xFFFF ) + desc.chars.push_back(wc); + } + g_pTextureFont->m_PagesToGenerate.push_back( desc ); + } + else + { + desc.name = "numbers"; + desc.chars.clear(); + for( int i = 0; map_numbers[i]; ++i ) + { + wchar_t wc = map_numbers[i]; + if( wc != 0xFFFF ) + desc.chars.push_back(wc); + } + g_pTextureFont->m_PagesToGenerate.push_back( desc ); + } /* Go: */ g_pTextureFont->FormatFontPages(); @@ -520,6 +528,16 @@ void CTextureFontGeneratorDlg::OnOptionsExportstroketemplates() pMenu->CheckMenuItem( ID_OPTIONS_EXPORTSTROKETEMPLATES, Checked ); } +void CTextureFontGeneratorDlg::OnOptionsNumbersonly() +{ + CMenu *pMenu = GetMenu(); + int Checked = pMenu->GetMenuState(ID_OPTIONS_NUMBERSONLY, 0) & MF_CHECKED; + Checked ^= MF_CHECKED; + pMenu->CheckMenuItem( ID_OPTIONS_NUMBERSONLY, Checked ); + m_bUpdateFontNeeded = true; + Invalidate( FALSE ); +} + void CTextureFontGeneratorDlg::OnDeltaposSpinTop(NMHDR *pNMHDR, LRESULT *pResult) { LPNMUPDOWN pNMUpDown = reinterpret_cast(pNMHDR); diff --git a/stepmania/src/Texture Font Generator/Texture Font GeneratorDlg.h b/stepmania/src/Texture Font Generator/Texture Font GeneratorDlg.h index 2b62d0b5cb..37af168df6 100644 --- a/stepmania/src/Texture Font Generator/Texture Font GeneratorDlg.h +++ b/stepmania/src/Texture Font Generator/Texture Font GeneratorDlg.h @@ -71,6 +71,7 @@ public: CStatic m_FontType; afx_msg void OnOptionsDoubleres(); afx_msg void OnOptionsExportstroketemplates(); + afx_msg void OnOptionsNumbersonly(); }; /* diff --git a/stepmania/src/Texture Font Generator/resource.h b/stepmania/src/Texture Font Generator/resource.h index 2095a16663..972f47847c 100644 --- a/stepmania/src/Texture Font Generator/resource.h +++ b/stepmania/src/Texture Font Generator/resource.h @@ -28,16 +28,18 @@ #define IDC_CHECK1 1026 #define ID_ACCELERATOR_ITALIC 32773 #define ID_ACCELERATOR_BOLD 32774 +#define ID_OPTIONS_DOUBLERESOLUTION 32779 #define ID_OPTIONS_DOUBLERES 32780 #define IDC_OPTIONS_DOUBLERES 32781 #define ID_OPTIONS_EXPORTSTROKETEMPLATES 32782 +#define ID_OPTIONS_NUMBERSONLY 32783 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 145 -#define _APS_NEXT_COMMAND_VALUE 32783 +#define _APS_NEXT_COMMAND_VALUE 32784 #define _APS_NEXT_CONTROL_VALUE 1028 #define _APS_NEXT_SYMED_VALUE 101 #endif