Ignore:
Timestamp:
Nov 5, 1999, 10:17:27 AM (26 years ago)
Author:
sandervl
Message:

EBs fixes

File:
1 edited

Legend:

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

    r1533 r1606  
    1 /* $Id: gdi32.cpp,v 1.12 1999-10-31 21:38:17 achimha Exp $ */
     1/* $Id: gdi32.cpp,v 1.13 1999-11-05 09:17:27 sandervl Exp $ */
    22
    33/*
     
    297297//******************************************************************************
    298298//******************************************************************************
    299 int WIN32API StretchDIBits( HDC arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9, const void * arg10, const BITMAPINFO *arg11, UINT arg12, DWORD arg13)
    300 {
     299INT WIN32API StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst,
     300                           INT heightDst, INT xSrc, INT ySrc, INT widthSrc,
     301                           INT heightSrc, const void *bits,
     302                           const BITMAPINFO *info, UINT wUsage, DWORD dwRop )
     303{
     304#if 1
     305    dprintf(("GDI32: StretchDIBits"));
     306
     307    if(wUsage == DIB_PAL_COLORS && info->bmiHeader.biSize == sizeof(BITMAPINFOHEADER))
     308    {
     309      // workaround for open32 bug.
     310      // If syscolors > 256 and wUsage == DIB_PAL_COLORS.
     311
     312      int i;
     313      USHORT *pColorIndex = (USHORT *)info->bmiColors;
     314      RGBQUAD *pColors = (RGBQUAD *) alloca(info->bmiHeader.biClrUsed *
     315                         sizeof(RGBQUAD));
     316      BITMAPINFO *infoLoc = (BITMAPINFO *) alloca(sizeof(BITMAPINFO) +
     317                             info->bmiHeader.biClrUsed * sizeof(RGBQUAD));
     318
     319      memcpy(infoLoc, info, sizeof(BITMAPINFO));
     320
     321      if(GetDIBColorTable(hdc, 0, info->bmiHeader.biClrUsed, pColors) == 0)
     322        return FALSE;
     323
     324      for(i=0;i<info->bmiHeader.biClrUsed;i++, pColorIndex++)
     325      {
     326         infoLoc->bmiColors[i] = pColors[*pColorIndex];
     327      }
     328
     329      return O32_StretchDIBits(hdc, xDst, yDst, widthDst, heightDst, xSrc, ySrc,
     330                               widthSrc, heightSrc, (void *)bits,
     331                               (PBITMAPINFO)infoLoc, DIB_RGB_COLORS, dwRop);
     332    }
     333
     334    return O32_StretchDIBits(hdc, xDst, yDst, widthDst, heightDst, xSrc, ySrc,
     335                             widthSrc, heightSrc, (void *)bits,
     336                             (PBITMAPINFO)info, wUsage, dwRop);
     337#else
    301338    dprintf(("GDI32: StretchDIBits\n"));
    302339    return O32_StretchDIBits(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, (void *)arg10, (PBITMAPINFO)arg11, arg12, arg13);
     340#endif
    303341}
    304342//******************************************************************************
     
    20542092 int i;
    20552093
    2056   dprintf(("GDI32: OS2GetDIBColorTable, not implemented?\n"));
    20572094  rc = O32_GetPaletteEntries(hpal,
    20582095                         uStartIndex,
     
    20632100      i++)
    20642101  {
     2102    BYTE tmp;
     2103    tmp = pColors[i].rgbBlue;
     2104    pColors[i].rgbBlue = pColors[i].rgbRed;
     2105    pColors[i].rgbRed = tmp;
    20652106    pColors[i].rgbReserved = 0;
    20662107  }
    2067   dprintf(("GDI32: GetDIBColor returns %d\n", rc));
     2108  dprintf(("GDI32: GetDIBColorTable returns %d\n", rc));
    20682109  return(rc);
    20692110}
Note: See TracChangeset for help on using the changeset viewer.