Ignore:
Timestamp:
Sep 1, 2000, 3:36:15 AM (25 years ago)
Author:
phaller
Message:

.

File:
1 edited

Legend:

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

    r4034 r4140  
    1 /* $Id: dibitmap.cpp,v 1.8 2000-08-18 18:14:56 sandervl Exp $ */
     1/* $Id: dibitmap.cpp,v 1.9 2000-09-01 01:36:14 phaller Exp $ */
    22
    33/*
     
    2929  HBITMAP rc;
    3030
    31     //TEMPORARY HACK TO PREVENT CRASH IN OPEN32 (WSeB GA)
    32 
    33     iHeight = lpbmih->biHeight;
    34     if(lpbmih->biHeight < 0)
    35     {
    36         dprintf(("GDI32: CreateDIBitmap negative height! (%d,%d)", lpbmih->biWidth, lpbmih->biHeight));
    37         ((BITMAPINFOHEADER *)lpbmih)->biHeight = -lpbmih->biHeight;
    38     }
    39 
    40     rc = O32_CreateDIBitmap(hdc, lpbmih, fdwInit, lpbInit, lpbmi, fuUsage);
    41 
    42     dprintf(("GDI32: CreateDIBitmap %x %x %x %x returned %x", hdc, fdwInit, lpbInit, fuUsage, rc));
    43 
    44     ((BITMAPINFOHEADER *)lpbmih)->biHeight = iHeight;
    45 
    46     return rc;
     31  //TEMPORARY HACK TO PREVENT CRASH IN OPEN32 (WSeB GA)
     32
     33  iHeight = lpbmih->biHeight;
     34  if(lpbmih->biHeight < 0)
     35  {
     36    dprintf(("GDI32: CreateDIBitmap negative height! (%d,%d)", lpbmih->biWidth, lpbmih->biHeight));
     37    ((BITMAPINFOHEADER *)lpbmih)->biHeight = -lpbmih->biHeight;
     38  }
     39
     40  // 2000/09/01 PH Netscape 4.7
     41  // If color depth of lpbhmi is 16 bit and lpbmi is 8 bit,
     42  // Open32 will crash since it won't allocate any palette color memory,
     43  // however wants to copy it later on ...
     44  int biBitCount = lpbmih->biBitCount;
     45 
     46  if (lpbmih->biBitCount != lpbmi->bmiHeader.biBitCount)
     47  {
     48    dprintf(("GDI32: CreateDIBitmap: color depths of bitmaps differ! (%d,%d\n",
     49             lpbmih->biBitCount,
     50             lpbmi->bmiHeader.biBitCount));
     51             
     52    ((BITMAPINFOHEADER *)lpbmih)->biBitCount = lpbmi->bmiHeader.biBitCount;
     53  }
     54
     55  rc = O32_CreateDIBitmap(hdc, lpbmih, fdwInit, lpbInit, lpbmi, fuUsage);
     56
     57  dprintf(("GDI32: CreateDIBitmap %x %x %x %x returned %x", hdc, fdwInit, lpbInit, fuUsage, rc));
     58
     59  ((BITMAPINFOHEADER *)lpbmih)->biHeight   = iHeight;
     60  ((BITMAPINFOHEADER *)lpbmih)->biBitCount = biBitCount;
     61
     62  return rc;
    4763}
    4864//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.