Ignore:
Timestamp:
May 29, 2001, 11:45:21 AM (24 years ago)
Author:
sandervl
Message:

Set/GetDIBColorTable fixes + SelectPalette hack

File:
1 edited

Legend:

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

    r5799 r5825  
    1 /* $Id: dibitmap.cpp,v 1.16 2001-05-25 10:05:28 sandervl Exp $ */
     1/* $Id: dibitmap.cpp,v 1.17 2001-05-29 09:45:21 sandervl Exp $ */
    22
    33/*
     
    203203//******************************************************************************
    204204//******************************************************************************
    205 UINT WIN32API GetDIBColorTable( HDC hdc, UINT uStartIndex, UINT cEntries,
    206                                   RGBQUAD *pColors)
    207 {
    208  HPALETTE hpal = GetCurrentObject(hdc, OBJ_PAL);
     205UINT WIN32API GetDIBColorTable(HDC hdc, UINT uStartIndex, UINT cEntries,
     206                               RGBQUAD *pColors)
     207{
     208 DIBSection *dsect = DIBSection::findHDC(hdc);
    209209 UINT rc;
    210210 int i;
    211211
    212   rc = O32_GetPaletteEntries(hpal,
    213                          uStartIndex,
    214                          cEntries,
    215                          (PALETTEENTRY *)pColors);
     212  dprintf(("GetDIBColorTable %x %d->%d %x", hdc, uStartIndex, cEntries, pColors));
     213
     214  if(dsect)
     215  {
     216       return(dsect->GetDIBColorTable(uStartIndex, cEntries, pColors));
     217  }
     218  //TODO: Is this correct?????
     219  //      Wine returns 0 if bitmap selected into dc with bpp > 8
     220  HPALETTE hpal = GetCurrentObject(hdc, OBJ_PAL);
     221  rc = O32_GetPaletteEntries(hpal, uStartIndex,
     222                             cEntries, (PALETTEENTRY *)pColors);
    216223  for(i=0;
    217224      i<cEntries;
     
    230237//******************************************************************************
    231238UINT WIN32API SetDIBColorTable(HDC hdc, UINT uStartIndex, UINT cEntries,
    232                                   RGBQUAD *pColors)
     239                               RGBQUAD *pColors)
    233240{
    234241 DIBSection *dsect = DIBSection::findHDC(hdc);
    235242
    236   dprintf(("GDI32: SetDIBColorTable\n"));
     243  dprintf(("GDI32: SetDIBColorTable %x %d,%d %x", hdc, uStartIndex, cEntries, pColors));
    237244  if(dsect)
    238245  {
Note: See TracChangeset for help on using the changeset viewer.