Ignore:
Timestamp:
Mar 12, 2004, 7:13:51 PM (21 years ago)
Author:
sandervl
Message:

SetDIBitsToDevice/StretchDIBits; set coloruse to DIB_RGB_COLORS for high (>=15) bpp bitmaps; GPI will crash with DIB_PAL_COLORS

File:
1 edited

Legend:

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

    r10497 r10513  
    1 /* $Id: blit.cpp,v 1.49 2004-03-09 14:24:34 sandervl Exp $ */
     1/* $Id: blit.cpp,v 1.50 2004-03-12 18:13:51 sandervl Exp $ */
    22
    33/*
     
    184184    }
    185185
     186    // GPI will crash when the app accidentally specifies PAL indexes with
     187    // high bpp bitmap data
     188    if(coloruse == DIB_PAL_COLORS && info->bmiHeader.biBitCount >= 15) {
     189        dprintf(("WARNING: DIB_PAL_COLORS can't be used for high color bitmaps!!"));
     190        coloruse = DIB_RGB_COLORS;
     191    }
     192
    186193    if(bitfields[1] == 0x3E0)
    187194    {//RGB 555?
     
    191198        pRGB555to565(newbits, (WORD *)bits, imgsize/sizeof(WORD));
    192199        bits = newbits;
     200        dprintf(("RGB 555->565 new bits %x", newbits));
    193201    }
    194202
     
    499507    }
    500508
     509    // GPI will crash when the app accidentally specifies PAL indexes with
     510    // high bpp bitmap data
     511    if(wUsage == DIB_PAL_COLORS && info->bmiHeader.biBitCount >= 15) {
     512        dprintf(("WARNING: DIB_PAL_COLORS can't be used for high color bitmaps!!"));
     513        wUsage = DIB_RGB_COLORS;
     514    }
     515
    501516    if(bitfields[1] == RGB555_GREEN_MASK)
    502517    {//RGB 555?
Note: See TracChangeset for help on using the changeset viewer.