diff --git a/stepmania/src/Texture Font Generator/Texture Font Generator.rc b/stepmania/src/Texture Font Generator/Texture Font Generator.rc index 13b69c2f66..b01b1bd3f6 100644 --- a/stepmania/src/Texture Font Generator/Texture Font Generator.rc +++ b/stepmania/src/Texture Font Generator/Texture Font Generator.rc @@ -171,6 +171,7 @@ BEGIN POPUP "Options" BEGIN MENUITEM "Double Resolution", ID_OPTIONS_DOUBLERES + MENUITEM "Export Stroke Templates", ID_OPTIONS_EXPORTSTROKETEMPLATES 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 7e8a2ed2ff..171ff90540 100644 --- a/stepmania/src/Texture Font Generator/Texture Font GeneratorDlg.cpp +++ b/stepmania/src/Texture Font Generator/Texture Font GeneratorDlg.cpp @@ -63,6 +63,7 @@ BEGIN_MESSAGE_MAP(CTextureFontGeneratorDlg, CDialog) ON_COMMAND(ID_ACCELERATOR_ITALIC, OnStyleItalic) ON_COMMAND(ID_ACCELERATOR_BOLD, OnStyleBold) ON_COMMAND(ID_OPTIONS_DOUBLERES, &CTextureFontGeneratorDlg::OnOptionsDoubleres) + ON_COMMAND(ID_OPTIONS_EXPORTSTROKETEMPLATES, &CTextureFontGeneratorDlg::OnOptionsExportstroketemplates) END_MESSAGE_MAP() @@ -158,7 +159,6 @@ void CTextureFontGeneratorDlg::UpdateFont( bool bSavingDoubleRes ) if( wc != 0xFFFF ) desc.chars.push_back(wc); } - g_pTextureFont->m_PagesToGenerate.push_back( desc ); desc.name = "numbers"; @@ -169,9 +169,25 @@ void CTextureFontGeneratorDlg::UpdateFont( bool bSavingDoubleRes ) if( wc != 0xFFFF ) desc.chars.push_back(wc); } - g_pTextureFont->m_PagesToGenerate.push_back( desc ); + + // + // Save duplicate imnages of each page with "-stroke" appended to the page name. + // + bool bExportStrokeTemplates = !!( pMenu->GetMenuState(ID_OPTIONS_EXPORTSTROKETEMPLATES, 0) & MF_CHECKED ); + if( bExportStrokeTemplates ) + { + int iNumPages = (int)g_pTextureFont->m_PagesToGenerate.size(); + for( int i=0; im_PagesToGenerate[i]; + desc.name += "-stroke"; + g_pTextureFont->m_PagesToGenerate.push_back( desc ); + } + } + + /* Go: */ g_pTextureFont->FormatFontPages(); @@ -512,6 +528,14 @@ void CTextureFontGeneratorDlg::OnOptionsDoubleres() Invalidate( FALSE ); } +void CTextureFontGeneratorDlg::OnOptionsExportstroketemplates() +{ + CMenu *pMenu = GetMenu(); + int Checked = pMenu->GetMenuState(ID_OPTIONS_EXPORTSTROKETEMPLATES, 0) & MF_CHECKED; + Checked ^= MF_CHECKED; + pMenu->CheckMenuItem( ID_OPTIONS_EXPORTSTROKETEMPLATES, Checked ); +} + void CTextureFontGeneratorDlg::OnDeltaposSpinTop(NMHDR *pNMHDR, LRESULT *pResult) { LPNMUPDOWN pNMUpDown = reinterpret_cast(pNMHDR); @@ -585,7 +609,8 @@ void CTextureFontGeneratorDlg::OnFileSave() */ CMenu *pMenu = GetMenu(); - if( !!( pMenu->GetMenuState(ID_OPTIONS_DOUBLERES, 0) & MF_CHECKED ) ) // DoubleRes checked? + bool bDoubleRes = !!( pMenu->GetMenuState(ID_OPTIONS_DOUBLERES, 0) & MF_CHECKED ); + if( bDoubleRes ) { g_pTextureFont->Save( szFile, "", true, false ); // save metrics UpdateFont( true ); // generate DoubleRes bitmaps diff --git a/stepmania/src/Texture Font Generator/Texture Font GeneratorDlg.h b/stepmania/src/Texture Font Generator/Texture Font GeneratorDlg.h index bc42739fe9..2b62d0b5cb 100644 --- a/stepmania/src/Texture Font Generator/Texture Font GeneratorDlg.h +++ b/stepmania/src/Texture Font Generator/Texture Font GeneratorDlg.h @@ -70,6 +70,7 @@ public: CSpinButtonCtrl m_SpinBaseline; CStatic m_FontType; afx_msg void OnOptionsDoubleres(); + afx_msg void OnOptionsExportstroketemplates(); }; /* diff --git a/stepmania/src/Texture Font Generator/resource.h b/stepmania/src/Texture Font Generator/resource.h index 5c3f1677d9..2095a16663 100644 --- a/stepmania/src/Texture Font Generator/resource.h +++ b/stepmania/src/Texture Font Generator/resource.h @@ -28,16 +28,16 @@ #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 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 145 -#define _APS_NEXT_COMMAND_VALUE 32782 +#define _APS_NEXT_COMMAND_VALUE 32783 #define _APS_NEXT_CONTROL_VALUE 1028 #define _APS_NEXT_SYMED_VALUE 101 #endif