--- np2/win9x/dialog/dialogs.cpp 2003/10/29 21:35:58 1.2 +++ np2/win9x/dialog/dialogs.cpp 2005/03/20 13:12:50 1.8 @@ -1,27 +1,28 @@ #include "compiler.h" #include "strres.h" +#include "bmpdata.h" #include "dosio.h" #include "commng.h" #include "dialogs.h" +#if defined(MT32SOUND_DLL) +#include "mt32snd.h" +#endif -static const char str_nc[] = "N/C"; - -// static char pathname[MAX_PATH]; -// static char filename[MAX_PATH]; +const TCHAR str_nc[] = _T("N/C"); -const char str_int0[] = "INT0"; -const char str_int1[] = "INT1"; -const char str_int2[] = "INT2"; -const char str_int4[] = "INT4"; -const char str_int5[] = "INT5"; -const char str_int6[] = "INT6"; +const TCHAR str_int0[] = _T("INT0"); +const TCHAR str_int1[] = _T("INT1"); +const TCHAR str_int2[] = _T("INT2"); +const TCHAR str_int4[] = _T("INT4"); +const TCHAR str_int5[] = _T("INT5"); +const TCHAR str_int6[] = _T("INT6"); // ---- file select BOOL dlgs_selectfile(HWND hWnd, const FILESEL *item, - char *path, UINT size, int *ro) { + OEMCHAR *path, UINT size, int *ro) { OPENFILENAME ofn; @@ -48,7 +49,7 @@ BOOL dlgs_selectfile(HWND hWnd, const FI } BOOL dlgs_selectwritefile(HWND hWnd, const FILESEL *item, - char *path, UINT size) { + OEMCHAR *path, UINT size) { OPENFILENAME ofn; @@ -72,28 +73,28 @@ BOOL dlgs_selectwritefile(HWND hWnd, con } BOOL dlgs_selectwritenum(HWND hWnd, const FILESEL *item, - char *path, UINT size) { + OEMCHAR *path, UINT size) { - char *file; - char *p; - char *q; + OEMCHAR *file; + OEMCHAR *p; + OEMCHAR *q; UINT i; BOOL r; if ((item == NULL) || (path == NULL) || (size == 0)) { return(FALSE); } - file = (char *)_MALLOC(size + 16, path); + file = (OEMCHAR *)_MALLOC((size + 16) * sizeof(OEMCHAR), path); if (file == NULL) { return(FALSE); } p = file_getname(path); milstr_ncpy(file, path, size); file_cutname(file); - q = file + strlen(file); + q = file + OEMSTRLEN(file); for (i=0; i<10000; i++) { - SPRINTF(q, p, i); + OEMSPRINTF(q, p, i); if (file_attr(file) == (short)-1) { break; } @@ -109,20 +110,20 @@ BOOL dlgs_selectwritenum(HWND hWnd, cons // ---- mimpi def file -static const char mimpi_title[] = "Open MIMPI define file"; -static const char mimpi_ext[] = "def"; -static const char mimpi_filter[] = "MIMPI define file(*.def)\0*.def\0"; +static const TCHAR mimpi_title[] = _T("Open MIMPI define file"); +static const TCHAR mimpi_ext[] = _T("def"); +static const TCHAR mimpi_filter[] = _T("MIMPI define file(*.def)\0*.def\0"); static const FILESEL mimpi = {mimpi_title, mimpi_ext, mimpi_filter, 1}; -void dlgs_browsemimpidef(HWND hWnd, WORD res) { +void dlgs_browsemimpidef(HWND hWnd, UINT16 res) { - HWND subwnd; - char path[MAX_PATH]; -const char *p; + HWND subwnd; + OEMCHAR path[MAX_PATH]; +const OEMCHAR *p; subwnd = GetDlgItem(hWnd, res); - GetWindowText(subwnd, path, sizeof(path)); - if (dlgs_selectfile(hWnd, &mimpi, path, sizeof(path), NULL)) { + GetWindowText(subwnd, path, NELEMENTS(path)); + if (dlgs_selectfile(hWnd, &mimpi, path, NELEMENTS(path), NULL)) { p = path; } else { @@ -134,7 +135,7 @@ const char *p; // ---- list -void dlgs_setliststr(HWND hWnd, WORD res, const char **item, UINT items) { +void dlgs_setliststr(HWND hWnd, UINT16 res, const TCHAR **item, UINT items) { HWND wnd; UINT i; @@ -145,15 +146,15 @@ void dlgs_setliststr(HWND hWnd, WORD res } } -void dlgs_setlistuint32(HWND hWnd, WORD res, const UINT32 *item, UINT items) { +void dlgs_setlistuint32(HWND hWnd, UINT16 res, const UINT32 *item, UINT items) { HWND wnd; UINT i; - char str[16]; + OEMCHAR str[16]; wnd = GetDlgItem(hWnd, res); for (i=0; ibfOffBits)), + bmpdata_getdatasize(bi)); + hmdc = CreateCompatibleDC(hdc); + SelectObject(hmdc, hbmp); + if (inf.height < 0) { + inf.height *= -1; + } + BitBlt(hdc, 0, 0, inf.width, inf.height, hmdc, 0, 0, SRCCOPY); + DeleteDC(hmdc); + DeleteObject(hbmp); - image += (x / 2) - y * align; - if (x & 1) { - while(l--) { - *image &= 0xf0; - *image |= c; - image -= align; - } - } - else { - c <<= 4; - while(l--) { - *image &= 0x0f; - *image |= c; - image -= align; - } - } -} - - -// ---- jumper - -void dlgs_setjumperx(BYTE *image, int x, int y, int align) { - - int i; - - x *= 9; - y *= 9; - for (i=0; i<2; i++) { - dlgs_linex(image, x, y+0+i, 19, align, 0); - dlgs_linex(image, x, y+8+i, 19, align, 0); - dlgs_liney(image, x+ 0+i, y, 9, align, 0); - dlgs_liney(image, x+17+i, y, 9, align, 0); - } -} - -void dlgs_setjumpery(BYTE *image, int x, int y, int align) { - - int i; - - x *= 9; - y *= 9; - for (i=0; i<2; i++) { - dlgs_linex(image, x, y+ 0+i, 9, align, 0); - dlgs_linex(image, x, y+17+i, 9, align, 0); - dlgs_liney(image, x+0+i, y, 19, align, 0); - dlgs_liney(image, x+8+i, y, 19, align, 0); - } +dsdb_err1: + _MFREE(bmp); }