Ignore:
Timestamp:
Oct 1, 2000, 11:16:17 PM (25 years ago)
Author:
phaller
Message:

Fix for uncompressed/RGB bitmaps with biSizeImage == 0

File:
1 edited

Legend:

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

    r4127 r4354  
    1 /* $Id: dibsect.cpp,v 1.38 2000-08-30 18:05:24 sandervl Exp $ */
     1/* $Id: dibsect.cpp,v 1.39 2000-10-01 21:16:17 phaller Exp $ */
    22
    33/*
     
    525525        if(bmpBitsDblBuffer == NULL)
    526526                DebugInt3();
    527 
    528         if(CPUFeatures & CPUID_MMX) {
    529                 RGB555to565MMX((WORD *)bmpBitsDblBuffer, (WORD *)bitmapBits, pOS2bmp->cbImage/sizeof(WORD));
    530         }
    531         else    RGB555to565((WORD *)bmpBitsDblBuffer, (WORD *)bitmapBits, pOS2bmp->cbImage/sizeof(WORD));
    532         rc = GpiDrawBits(hps, bmpBitsDblBuffer, pOS2bmp, 4, &point[0], ROP_SRCCOPY, os2mode);
     527   
     528    // PH 2000/10/01 - Fix for Beyond Compare 1.9d
     529    // Note: according to documentation, cmImage can be zero for
     530    // RGB- / non-compressed bitmaps.
     531    int iLength = pOS2bmp->cbImage;
     532    if (iLength == 0)
     533      iLength = pOS2bmp->cx * pOS2bmp->cy * (pOS2bmp->cBitCount >> 3);
     534     
     535    if (iLength > 0)
     536    {
     537      if(CPUFeatures & CPUID_MMX)
     538        RGB555to565MMX((WORD *)bmpBitsDblBuffer, (WORD *)bitmapBits, iLength/sizeof(WORD));
     539      else     
     540        RGB555to565((WORD *)bmpBitsDblBuffer, (WORD *)bitmapBits, iLength/sizeof(WORD));
     541    }
     542    else
     543    {
     544      dprintf(("GDI32: DIBSect::BitBlt: WARNING! zero-length bitmap! %08xh",
     545               pOS2bmp));
     546    }
     547
     548
     549    rc = GpiDrawBits(hps, bmpBitsDblBuffer, pOS2bmp, 4, &point[0], ROP_SRCCOPY, os2mode);
    533550  }
    534551  else  rc = GpiDrawBits(hps, bitmapBits, pOS2bmp, 4, &point[0], ROP_SRCCOPY, os2mode);
Note: See TracChangeset for help on using the changeset viewer.