Diff for /np2/win9x/dialog/dialogs.cpp between versions 1.2 and 1.5

version 1.2, 2003/10/29 21:35:58 version 1.5, 2005/02/07 15:39:28
Line 1 Line 1
 #include        "compiler.h"  #include        "compiler.h"
 #include        "strres.h"  #include        "strres.h"
   #include        "bmpdata.h"
 #include        "dosio.h"  #include        "dosio.h"
 #include        "commng.h"  #include        "commng.h"
 #include        "dialogs.h"  #include        "dialogs.h"
Line 7 Line 8
   
 static const char str_nc[] = "N/C";  static const char str_nc[] = "N/C";
   
 // static       char    pathname[MAX_PATH];  
 // static       char    filename[MAX_PATH];  
   
 const char str_int0[] = "INT0";  const char str_int0[] = "INT0";
 const char str_int1[] = "INT1";  const char str_int1[] = "INT1";
 const char str_int2[] = "INT2";  const char str_int2[] = "INT2";
Line 114  static const char mimpi_ext[] = "def"; Line 112  static const char mimpi_ext[] = "def";
 static const char mimpi_filter[] = "MIMPI define file(*.def)\0*.def\0";  static const char mimpi_filter[] = "MIMPI define file(*.def)\0*.def\0";
 static const FILESEL mimpi = {mimpi_title, mimpi_ext, mimpi_filter, 1};  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;          HWND    subwnd;
         char    path[MAX_PATH];          char    path[MAX_PATH];
Line 134  const char *p; Line 132  const char *p;
   
 // ---- list  // ---- list
   
 void dlgs_setliststr(HWND hWnd, WORD res, const char **item, UINT items) {  void dlgs_setliststr(HWND hWnd, UINT16 res, const char **item, UINT items) {
   
         HWND    wnd;          HWND    wnd;
         UINT    i;          UINT    i;
Line 145  void dlgs_setliststr(HWND hWnd, WORD res Line 143  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;          HWND    wnd;
         UINT    i;          UINT    i;
Line 161  void dlgs_setlistuint32(HWND hWnd, WORD  Line 159  void dlgs_setlistuint32(HWND hWnd, WORD 
   
 // ---- MIDIデバイスのリスト  // ---- MIDIデバイスのリスト
   
 void dlgs_setlistmidiout(HWND hWnd, WORD res, const char *defname) {  void dlgs_setlistmidiout(HWND hWnd, UINT16 res, const char *defname) {
   
         HWND            wnd;          HWND            wnd;
         UINT            defcur;          UINT            defcur;
Line 199  void dlgs_setlistmidiout(HWND hWnd, WORD Line 197  void dlgs_setlistmidiout(HWND hWnd, WORD
         SendMessage(wnd, CB_SETCURSEL, (WPARAM)defcur, (LPARAM)0);          SendMessage(wnd, CB_SETCURSEL, (WPARAM)defcur, (LPARAM)0);
 }  }
   
 void dlgs_setlistmidiin(HWND hWnd, WORD res, const char *defname) {  void dlgs_setlistmidiin(HWND hWnd, UINT16 res, const char *defname) {
   
         HWND            wnd;          HWND            wnd;
         UINT            defcur;          UINT            defcur;
Line 226  void dlgs_setlistmidiin(HWND hWnd, WORD  Line 224  void dlgs_setlistmidiin(HWND hWnd, WORD 
   
 // ---- draw  // ---- draw
   
 void dlgs_linex(BYTE *image, int x, int y, int l, int align, BYTE c) {  void dlgs_drawbmp(HDC hdc, UINT8 *bmp) {
   
         image -= y * align;  
         while(l--) {  
                 if (x & 1) {  
                         image[x/2] &= 0xf0;  
                         image[x/2] |= c;  
                 }  
                 else {  
                         image[x/2] &= 0x0f;  
                         image[x/2] |= (c << 4);  
                 }  
                 x++;  
         }  
 }  
   
 void dlgs_liney(BYTE *image, int x, int y, int l, int align, BYTE c) {          BMPFILE         *bf;
           BMPINFO         *bi;
           BMPDATA         inf;
           HBITMAP         hbmp;
           UINT8           *image;
           HDC                     hmdc;
   
           if (bmp == NULL) {
                   return;
           }
           bf = (BMPFILE *)bmp;
           bi = (BMPINFO *)(bf + 1);
           if (bmpdata_getinfo(bi, &inf) != SUCCESS) {
                   goto dsdb_err1;
           }
           hbmp = CreateDIBSection(hdc, (BITMAPINFO *)bi, DIB_RGB_COLORS,
                                                                                                   (void **)&image, NULL, 0);
           if (hbmp == NULL) {
                   goto dsdb_err1;
           }
           CopyMemory(image, bmp + (LOADINTELDWORD(bf->bfOffBits)),
                                                                                                           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;  dsdb_err1:
         if (x & 1) {          _MFREE(bmp);
                 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);  
         }  
 }  }
   

Removed from v.1.2  
changed lines
  Added in v.1.5


RetroPC.NET-CVS <cvs@retropc.net>