Changeset 960 for trunk/src


Ignore:
Timestamp:
Sep 16, 1999, 4:58:33 PM (26 years ago)
Author:
phaller
Message:

Fix: DIB_FixColorsToLoadflags - incr was not initialized

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/dib.cpp

    r949 r960  
    1 /* $Id: dib.cpp,v 1.1 1999-09-15 23:18:49 sandervl Exp $ */
     1/* $Id: dib.cpp,v 1.2 1999-09-16 14:57:05 phaller Exp $ */
    22
    33/*
     
    132132
    133133  //SvL: Wine code doesn't work for OS/2 1.3 bitmaps
    134   if (bmi->bmiHeader.biSize == sizeof(BITMAPINFOHEADER)) {
    135         if (bmi->bmiHeader.biBitCount > 8) return;
    136         colors = bmi->bmiHeader.biClrUsed;
    137         bitcount = bmi->bmiHeader.biBitCount;
    138         colorptr = (char*)bmi->bmiColors;
     134  if (bmi->bmiHeader.biSize == sizeof(BITMAPINFOHEADER))
     135  {
     136    if (bmi->bmiHeader.biBitCount > 8) return;
     137    colors   = bmi->bmiHeader.biClrUsed;
     138    bitcount = bmi->bmiHeader.biBitCount;
     139    colorptr = (char*)bmi->bmiColors;
     140    incr     = 4;
    139141  }
    140142  else
    141   if (bmi->bmiHeader.biSize == sizeof(BITMAPCOREHEADER)) {
    142         BITMAPCOREHEADER *core = (BITMAPCOREHEADER *)bmi;
    143 
    144         if (core->bcBitCount > 8) return;
    145         colors = (1 << core->bcBitCount);
    146         bitcount = core->bcBitCount;
    147         colorptr = (char*)(core + 1);
    148   }
    149   else {
    150     dprintf(("Wrong bitmap header size!\n"));
    151     return;
    152   }
     143    if (bmi->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
     144    {
     145      BITMAPCOREHEADER *core = (BITMAPCOREHEADER *)bmi;
     146
     147      if (core->bcBitCount > 8) return;
     148      colors   = (1 << core->bcBitCount);
     149      bitcount = core->bcBitCount;
     150      colorptr = (char*)(core + 1);
     151      incr     = 3;
     152    }
     153    else
     154    {
     155      dprintf(("Wrong bitmap header size!\n"));
     156      return;
     157    }
     158
    153159  if (!colors && (bitcount <= 8))
    154         colors = 1 << bitcount;
     160    colors = 1 << bitcount;
    155161
    156162  c_W = GetSysColor(COLOR_WINDOW);
     
    163169        case 4: pix = pix >> 4; break;
    164170        case 8: break;
    165         default: 
    166                 dprintf(("(%d): Unsupported depth\n", bitcount)); 
     171        default:
     172                dprintf(("(%d): Unsupported depth\n", bitcount));
    167173                return;
    168174        }
     
    182188                ptr = (RGBQUAD*)(colorptr +i*incr);
    183189                c_C = RGB(ptr->rgbRed, ptr->rgbGreen, ptr->rgbBlue);
    184                 if (c_C == RGB(128, 128, 128)) { 
     190                if (c_C == RGB(128, 128, 128)) {
    185191                        ptr->rgbRed = GetRValue(c_S);
    186192                        ptr->rgbGreen = GetGValue(c_S);
    187193                        ptr->rgbBlue = GetBValue(c_S);
    188                 } else if (c_C == RGB(192, 192, 192)) { 
     194                } else if (c_C == RGB(192, 192, 192)) {
    189195                        ptr->rgbRed = GetRValue(c_F);
    190196                        ptr->rgbGreen = GetGValue(c_F);
    191197                        ptr->rgbBlue = GetBValue(c_F);
    192                 } else if (c_C == RGB(223, 223, 223)) { 
     198                } else if (c_C == RGB(223, 223, 223)) {
    193199                        ptr->rgbRed = GetRValue(c_L);
    194200                        ptr->rgbGreen = GetGValue(c_L);
    195201                        ptr->rgbBlue = GetBValue(c_L);
    196                 } 
     202                }
    197203        }
    198204  }
    199  
    200 }
     205
     206}
Note: See TracChangeset for help on using the changeset viewer.