Ignore:
Timestamp:
May 25, 2001, 12:05:29 PM (24 years ago)
Author:
sandervl
Message:

dib section sync, setdibits & setpalette bugfixes

File:
1 edited

Legend:

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

    r4127 r5799  
    1 /* $Id: palette.cpp,v 1.7 2000-08-30 18:05:25 sandervl Exp $ */
     1/* $Id: palette.cpp,v 1.8 2001-05-25 10:05:29 sandervl Exp $ */
    22
    33/*
     
    8181HPALETTE WIN32API SelectPalette(HDC hdc, HPALETTE hPalette, BOOL bForceBackground)
    8282{
     83  HPALETTE hPal;
     84
    8385  dprintf(("GDI32: SelectPalette (0x%08X, 0x%08X, 0x%08X)", hdc, hPalette, bForceBackground));
     86  hPal = O32_SelectPalette(hdc, hPalette, bForceBackground);
    8487  if(DIBSection::getSection() != NULL)
    8588  {
     
    8790    if(dsect)
    8891    {
    89       int nrcolors;
    90       PALETTEENTRY Pal[256];
    91       char PalSize = dsect->GetBitCount();
    92       dprintf(("       - Set Palette Values in DIBSection\n"));
    93       if(PalSize<=8)
    94       {
    95         nrcolors = GetPaletteEntries( hPalette, 0, 1<<PalSize, (LPPALETTEENTRY)&Pal);
    96         dsect->SetDIBColorTable(0, nrcolors, (RGBQUAD*)&Pal);
    97       }
    98 
     92        dsect->sync(hdc, 0, dsect->GetHeight());
    9993    }
    10094  }
    101   return O32_SelectPalette(hdc, hPalette, bForceBackground);
     95  return hPal;
    10296}
    10397//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.