Ignore:
Timestamp:
Nov 9, 2000, 7:16:57 PM (25 years ago)
Author:
sandervl
Message:

DeleteDC + CreateDIBSection fixes

File:
1 edited

Legend:

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

    r4450 r4574  
    1 /* $Id: dibsect.cpp,v 1.41 2000-10-07 11:39:16 sandervl Exp $ */
     1/* $Id: dibsect.cpp,v 1.42 2000-11-09 18:16:56 sandervl Exp $ */
    22
    33/*
     
    395395//******************************************************************************
    396396//******************************************************************************
     397int DIBSection::SetDIBColorTable(int startIdx, int cEntries, PALETTEENTRY *palentry)
     398{
     399 int i;
     400
     401  if(startIdx + cEntries > (1 << pOS2bmp->cBitCount))
     402  {
     403    dprintf(("DIBSection::SetDIBColorTable, invalid nr of entries %d %d\n", startIdx, cEntries));
     404    return(0);
     405  }
     406
     407  for(i=startIdx;i<cEntries;i++)
     408  {
     409    pOS2bmp->argbColor[i].fcOptions = 0;
     410    pOS2bmp->argbColor[i].bBlue  = palentry[i].peBlue;
     411    pOS2bmp->argbColor[i].bGreen = palentry[i].peGreen;
     412    pOS2bmp->argbColor[i].bRed   = palentry[i].peRed;
     413  }
     414
     415  return(cEntries);
     416}
     417//******************************************************************************
     418//******************************************************************************
    397419BOOL DIBSection::BitBlt(HDC hdcDest, int nXdest, int nYdest, int nDestWidth,
    398420                        int nDestHeight, int nXsrc, int nYsrc,
     
    428450
    429451        if(fFrameWindowDC) {
    430             GetWindowRect(hwndDest, &rect);
     452              GetWindowRect(hwndDest, &rect);
    431453        }
    432454        else  GetClientRect(hwndDest, &rect);
     
    488510  }
    489511*/
     512#ifdef INVERT
    490513  oldyinversion = GpiQueryYInversion(hps);
    491514  if(oldyinversion != 0) {
     
    493516        fRestoryYInversion = TRUE;
    494517  }
     518#endif
     519
     520#ifdef DEBUG
     521  RECTL rcltemp;
     522  GreGetDCOrigin(hps, (PPOINTL)&rcltemp);
     523  dprintf(("origin (%d,%d) yinv %d", rcltemp.xLeft, rcltemp.yBottom, oldyinversion));
     524#endif
    495525
    496526  if(fFlip & FLIP_HOR)
     
    572602            destdib->sync(hps, nYdest, nDestHeight);
    573603        }
     604#ifdef INVERT
    574605        //restore old y inversion height
    575606        if(fRestoryYInversion) GpiEnableYInversion(hps, oldyinversion);
     607#endif
    576608            SetLastError(ERROR_SUCCESS_W);
    577609
    578610        return(TRUE);
    579611  }
     612#ifdef INVERT
    580613  if(fRestoryYInversion) GpiEnableYInversion(hps, oldyinversion);
     614#endif
    581615
    582616  dprintf(("DIBSection::BitBlt %X (%d,%d) (%d,%d) to (%d,%d) (%d,%d) returned %d\n", hps, point[0].x, point[0].y, point[1].x, point[1].y, point[2].x, point[2].y, point[3].x, point[3].y, rc));
Note: See TracChangeset for help on using the changeset viewer.