Ignore:
Timestamp:
Jan 28, 2000, 11:24:58 PM (26 years ago)
Author:
sandervl
Message:

Wrong return values for GetDIBits & SetDIBitsToDevice

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gdi32/oslibgdi.cpp

    r2049 r2551  
    1 /* $Id: oslibgdi.cpp,v 1.2 1999-12-09 16:49:45 cbratschi Exp $ */
     1/* $Id: oslibgdi.cpp,v 1.3 2000-01-28 22:24:58 sandervl Exp $ */
    22
    33/*
     
    2727                           UINT coloruse)
    2828{
    29   INT result;
     29  INT result, rc;
    3030  POINTL  points[4];
     31  BITMAPINFO2 os2bmpinfo;
    3132
    3233  // This is a quick hack. Only tested with winmine. Need much more testing.
    3334  // TODO: check parameter and info structure
    3435  lines = (int)lines >= 0 ? (int)lines : (int)-lines;
    35 
    36 #if 0     // WINE990508
    37     tmpheight = height = info->bmiHeader.biHeight;
    38     width = info->bmiHeader.biWidth;
    39     if (height < 0) height = -height;
    40     if (!lines || (startscan >= height)) return 0;
    41     if (startscan + lines > height) lines = height - startscan;
    42     if (ySrc < startscan) ySrc = startscan;
    43     else if (ySrc >= startscan + lines) return 0;
    44     if (xSrc >= width) return 0;
    45     if (ySrc + cy >= startscan + lines) cy = startscan + lines - ySrc;
    46     if (xSrc + cx >= width) cx = width - xSrc;
    47     if (!cx || !cy) return 0;
    48 
    49     descr.dc        = dc;
    50     descr.bits      = bits;
    51     descr.image     = NULL;
    52     descr.lines     = tmpheight >= 0 ? lines : -lines;
    53     descr.infoWidth = width;
    54     descr.depth     = dc->w.bitsPerPixel;
    55     descr.drawable  = physDev->drawable;
    56     descr.gc        = physDev->gc;
    57     descr.xSrc      = xSrc;
    58     descr.ySrc      = tmpheight >= 0 ? lines-(ySrc-startscan)-cy+(oldcy-cy)
    59                                      : ySrc - startscan;
    60     descr.xDest     = dc->w.DCOrgX + XLPTODP( dc, xDest );
    61     descr.yDest     = dc->w.DCOrgY + YLPTODP( dc, yDest ) +
    62                                      (tmpheight >= 0 ? oldcy-cy : 0);
    63     descr.width     = cx;
    64     descr.height    = cy;
    65 #endif
    6636
    6737  points[0].x = xDest;
     
    7444  points[3].y = ySrc + lines;
    7545
    76   // WINBITMAPINFOHEADER and BITMAPINFO2 are identical
    77   GpiDrawBits((HPS)hdc, (VOID *)bits, (BITMAPINFO2 *)info, 4,
    78               points, ROP_SRCCOPY, BBO_IGNORE);
     46  memset(&os2bmpinfo, 0, sizeof(os2bmpinfo)); 
     47  os2bmpinfo.cbFix         = sizeof(BITMAPINFO2) - sizeof(RGB2);
     48  os2bmpinfo.cx            = info->biWidth;
     49  os2bmpinfo.cy            = info->biHeight;
     50  os2bmpinfo.cPlanes       = info->biPlanes;
     51  os2bmpinfo.cBitCount     = info->biBitCount;
     52  os2bmpinfo.ulCompression = info->biCompression;
     53  os2bmpinfo.cbImage       = info->biSizeImage;
     54  os2bmpinfo.cxResolution  = info->biXPelsPerMeter;
     55  os2bmpinfo.cyResolution  = info->biYPelsPerMeter;
     56  os2bmpinfo.cclrUsed      = info->biClrUsed;
     57  os2bmpinfo.cclrImportant = info->biClrImportant;
    7958
     59//  rc = GpiDrawBits((HPS)hdc, (VOID *)bits, &os2bmpinfo, 4,
     60//                   points, ROP_SRCCOPY, BBO_IGNORE);
     61
     62//  if(rc != GPI_OK) {
     63//      dprintf(("GpiDrawBits returned %d", rc));
     64//  }
    8065  return lines;
    8166}
    8267//******************************************************************************
    8368//******************************************************************************
    84 
Note: See TracChangeset for help on using the changeset viewer.