| version 1.8, 2005/03/20 13:12:50 | version 1.9, 2007/11/11 07:11:27 | 
| Line 13 | Line 13 | 
 | #include        "font.h" | #include        "font.h" | 
 |  |  | 
 |  |  | 
| static const TCHAR fontui_title[] = _T("Select font file"); | static const FSPARAM fpFont = | 
| static const TCHAR fontui_filter[] =                                                                    \ | { | 
| _T("PC-98 BMP font (*.bmp)\0")                                          \ | MAKEINTRESOURCE(IDS_FONTTITLE), | 
| _T("*.bmp\0")                                                                   \ | MAKEINTRESOURCE(IDS_FONTEXT), | 
| _T("Virtual98 font\0")                                                          \ | MAKEINTRESOURCE(IDS_FONTFILTER), | 
| _T("font.rom\0")                                                                \ | 3 | 
| _T("All supported files\0")                                                     \ | }; | 
| _T("*.bmp;")                                                                    \ |  | 
| _T("pc88.fnt;kanji1.rom;kanji2.rom;")                   \ | static const LPTSTR lpszBmpFilter[] = | 
| _T("font.rom;")                                                                 \ | { | 
| _T("subsys_c.rom;kanji.rom;")                                   \ | MAKEINTRESOURCE(IDS_BMPFILTER1), | 
| _T("fnt0808.x1;fnt0816.x1;fnt1616.x1;")                 \ | MAKEINTRESOURCE(IDS_BMPFILTER4), | 
| _T("cgrom.dat\0"); | MAKEINTRESOURCE(IDS_BMPFILTER8), | 
| static const FILESEL fontui = {fontui_title, tchar_bmp, fontui_filter, 3}; | MAKEINTRESOURCE(IDS_BMPFILTER24) | 
|  | }; | 
| static const OEMCHAR bmpui_file[] = OEMTEXT("NP2_%04d.BMP"); | static const OEMCHAR szBmpFile[] = OEMTEXT("NP2_####.BMP"); | 
|  |  | 
| static const TCHAR bmpui_title[] = _T("Save as bitmap file"); | void dialog_font(HWND hWnd) | 
| static const TCHAR bmpui_filter1[] =                                                                    \ | { | 
| _T("1bit-bitmap (*.bmp)\0*.bmp\0")                                      \ | OEMCHAR szPath[MAX_PATH]; | 
| _T("Graphics Interchange Format (*.gif)\0*.gif\0"); |  | 
| static const TCHAR bmpui_filter4[] =                                                                    \ | file_cpyname(szPath, np2cfg.fontfile, NELEMENTS(szPath)); | 
| _T("4bit-bitmap (*.bmp)\0*.bmp\0")                                      \ | if ((dlgs_openfile(hWnd, &fpFont, szPath, NELEMENTS(szPath), NULL)) && | 
| _T("Graphics Interchange Format (*.gif)\0*.gif\0"); | (font_load(szPath, FALSE))) | 
| static const TCHAR bmpui_filter8[] =                                                                    \ | { | 
| _T("8bit-bitmap (*.bmp)\0*.bmp\0") |  | 
| _T("Graphics Interchange Format (*.gif)\0*.gif\0"); |  | 
| static const TCHAR bmpui_filter24[] = _T("24bit-bitmap (*.bmp)\0*.bmp\0"); |  | 
| static const TCHAR *bmpui_filter[4] = { |  | 
| bmpui_filter1, bmpui_filter4, bmpui_filter8, bmpui_filter24}; |  | 
|  |  | 
|  |  | 
| void dialog_font(HWND hWnd) { |  | 
|  |  | 
| OEMCHAR path[MAX_PATH]; |  | 
|  |  | 
| file_cpyname(path, np2cfg.fontfile, NELEMENTS(path)); |  | 
| if ((dlgs_selectfile(hWnd, &fontui, path, NELEMENTS(path), NULL)) && |  | 
| (font_load(path, FALSE))) { |  | 
 | gdcs.textdisp |= GDCSCRN_ALLDRAW2; | gdcs.textdisp |= GDCSCRN_ALLDRAW2; | 
| milstr_ncpy(np2cfg.fontfile, path, NELEMENTS(np2cfg.fontfile)); | milstr_ncpy(np2cfg.fontfile, szPath, NELEMENTS(np2cfg.fontfile)); | 
 | sysmng_update(SYS_UPDATECFG); | sysmng_update(SYS_UPDATECFG); | 
 | } | } | 
 | } | } | 
| Line 61  void dialog_font(HWND hWnd) { | Line 47  void dialog_font(HWND hWnd) { | 
 | void dialog_writebmp(HWND hWnd) { | void dialog_writebmp(HWND hWnd) { | 
 |  |  | 
 | SCRNSAVE        ss; | SCRNSAVE        ss; | 
| FILESEL         bmpui; | FSPARAM         fp; | 
| OEMCHAR         path[MAX_PATH]; | OEMCHAR         szPath[MAX_PATH]; | 
| const OEMCHAR   *ext; | const OEMCHAR   *pszExt; | 
 |  |  | 
 | ss = scrnsave_get(); | ss = scrnsave_get(); | 
| if (ss == NULL) { | if (ss == NULL) | 
|  | { | 
 | return; | return; | 
 | } | } | 
| bmpui.title = bmpui_title; | fp.lpszTitle = MAKEINTRESOURCE(IDS_BMPTITLE); | 
| bmpui.ext = tchar_bmp; | fp.lpszDefExt = MAKEINTRESOURCE(IDS_BMPEXT); | 
| bmpui.filter = bmpui_filter[ss->type]; | fp.lpszFilter = lpszBmpFilter[ss->type]; | 
| bmpui.defindex = 1; | fp.nFilterIndex = 1; | 
| file_cpyname(path, bmpfilefolder, NELEMENTS(path)); | file_cpyname(szPath, bmpfilefolder, NELEMENTS(szPath)); | 
| file_cutname(path); | file_cutname(szPath); | 
| file_catname(path, bmpui_file, NELEMENTS(path)); | file_catname(szPath, szBmpFile, NELEMENTS(szPath)); | 
| if (dlgs_selectwritenum(hWnd, &bmpui, path, NELEMENTS(path))) { | if (dlgs_createfilenum(hWnd, &fp, szPath, NELEMENTS(szPath))) | 
| file_cpyname(bmpfilefolder, path, NELEMENTS(bmpfilefolder)); | { | 
|  | file_cpyname(bmpfilefolder, szPath, NELEMENTS(bmpfilefolder)); | 
 | sysmng_update(SYS_UPDATEOSCFG); | sysmng_update(SYS_UPDATEOSCFG); | 
| ext = file_getext(path); | pszExt = file_getext(szPath); | 
 | if ((ss->type <= SCRNSAVE_8BIT) && | if ((ss->type <= SCRNSAVE_8BIT) && | 
| (!file_cmpname(ext, OEMTEXT("gif")))) { | (!file_cmpname(pszExt, OEMTEXT("gif")))) | 
| scrnsave_writegif(ss, path, SCRNSAVE_AUTO); | { | 
|  | scrnsave_writegif(ss, szPath, SCRNSAVE_AUTO); | 
 | } | } | 
| else if (!file_cmpname(ext, str_bmp)) { | else if (!file_cmpname(pszExt, str_bmp)) | 
| scrnsave_writebmp(ss, path, SCRNSAVE_AUTO); | { | 
|  | scrnsave_writebmp(ss, szPath, SCRNSAVE_AUTO); | 
 | } | } | 
 | } | } | 
 | scrnsave_trash(ss); | scrnsave_trash(ss); |