Changeset 2808 for trunk/src


Ignore:
Timestamp:
Feb 16, 2000, 8:48:52 PM (26 years ago)
Author:
sandervl
Message:

SetDIBitsToDevice fix

File:
1 edited

Legend:

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

    r2802 r2808  
    1 /* $Id: blit.cpp,v 1.5 2000-02-16 14:18:09 sandervl Exp $ */
     1/* $Id: blit.cpp,v 1.6 2000-02-16 19:48:52 sandervl Exp $ */
    22
    33/*
     
    9191    INT result, imgsize, palsize, height, width;
    9292    char *ptr;
    93     ULONG compression = 0, iHeight;
     93    ULONG compression = 0, iHeight, bmpsize;
    9494    WORD *newbits = 0;
    9595
     
    133133    // EB: <<<-
    134134
     135    //SvL: RP7's bitmap size is not correct; fix it here or else
     136    //     the blit is messed up in Open32
     137    bmpsize = info->bmiHeader.biSizeImage;
     138    if(info->bmiHeader.biSizeImage && info->bmiHeader.biSizeImage < imgsize)
     139    {
     140        ((BITMAPINFO *)info)->bmiHeader.biSizeImage = imgsize;
     141    }
     142
    135143    //SvL: Ignore BI_BITFIELDS type (SetDIBitsToDevice fails otherwise)
    136144    if(info->bmiHeader.biCompression == BI_BITFIELDS) {
     
    139147        ((BITMAPINFO *)info)->bmiHeader.biCompression = 0;
    140148        compression = BI_BITFIELDS;
     149
    141150        if(*(bitfields+1) == 0x3E0)
    142151        {//RGB 555?
     
    160169    result = (result == TRUE) ? lines : 0;
    161170
    162     dprintf(("GDI32: SetDIBitsToDevice hdc:%X xDest:%d yDest:%d, cx:%d, cy:%d, xSrc:%d, ySrc:%d, startscan:%d, lines:%d \nGDI32: bits:%X, info%X, coloruse:%d returned %d",
     171    dprintf(("GDI32: SetDIBitsToDevice hdc:%X xDest:%d yDest:%d, cx:%d, cy:%d, xSrc:%d, ySrc:%d, startscan:%d, lines:%d \nGDI32: bits 0x%X, info 0x%X, coloruse %d returned %d",
    163172                 hdc, xDest, yDest, cx, cy, xSrc, ySrc, startscan, lines, (LPVOID) bits, (PBITMAPINFO)info, coloruse, result));
    164173    dprintf(("GDI32: SetDIBitsToDevice %d %d %d %d %x %d", info->bmiHeader.biWidth, info->bmiHeader.biHeight, info->bmiHeader.biPlanes, info->bmiHeader.biBitCount, info->bmiHeader.biCompression, info->bmiHeader.biSizeImage));
     
    169178    }
    170179    ((BITMAPINFO *)info)->bmiHeader.biHeight = iHeight;
     180    ((BITMAPINFO *)info)->bmiHeader.biSizeImage = bmpsize;
    171181    return result;
    172182
Note: See TracChangeset for help on using the changeset viewer.